get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/85544/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 85544,
    "url": "http://patches.dpdk.org/api/patches/85544/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20201220211405.313012-21-maxime.coquelin@redhat.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20201220211405.313012-21-maxime.coquelin@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20201220211405.313012-21-maxime.coquelin@redhat.com",
    "date": "2020-12-20T21:13:45",
    "name": "[20/40] net/virtio: make interrupt handling more generic",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "aede447d78f762386c9d5876f42df7496ae0e835",
    "submitter": {
        "id": 512,
        "url": "http://patches.dpdk.org/api/people/512/?format=api",
        "name": "Maxime Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "delegate": {
        "id": 2642,
        "url": "http://patches.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20201220211405.313012-21-maxime.coquelin@redhat.com/mbox/",
    "series": [
        {
            "id": 14390,
            "url": "http://patches.dpdk.org/api/series/14390/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=14390",
            "date": "2020-12-20T21:13:25",
            "name": "net/virtio: Virtio PMD rework",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/14390/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/85544/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/85544/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id DB3FDA09FD;\n\tSun, 20 Dec 2020 22:20:54 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id B6904CDC4;\n\tSun, 20 Dec 2020 22:15:41 +0100 (CET)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [216.205.24.124])\n by dpdk.org (Postfix) with ESMTP id 35AF9CD9A\n for <dev@dpdk.org>; Sun, 20 Dec 2020 22:15:37 +0100 (CET)",
            "from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com\n [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id\n us-mta-441-M-oh9q5bPSau4EUl-whPvg-1; Sun, 20 Dec 2020 16:15:33 -0500",
            "from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com\n [10.5.11.12])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C624D19251A1;\n Sun, 20 Dec 2020 21:15:32 +0000 (UTC)",
            "from max-t490s.redhat.com (unknown [10.36.110.43])\n by smtp.corp.redhat.com (Postfix) with ESMTP id EDBDB60C43;\n Sun, 20 Dec 2020 21:15:30 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1608498935;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=uSvFX9UBNfJcOyMFaaciG9eO0Xle6E0UC8gRUIIg5Go=;\n b=h9POIyO8QNgrNY7WbrzO7DdVjwaGOozkuwnSaXK+4uZuSUqzFmRjAS7AkU+G6PqD8482F5\n TSZjJFM6VLlygdHojUaLfcdie7s6ZRflLX8wfyw07asOgaFN2uzE4WcWfJZwayEdkq255Z\n ytNMpjZQZlC+ySeuSxjFI9YkVLWWQG8=",
        "X-MC-Unique": "M-oh9q5bPSau4EUl-whPvg-1",
        "From": "Maxime Coquelin <maxime.coquelin@redhat.com>",
        "To": "dev@dpdk.org, chenbo.xia@intel.com, olivier.matz@6wind.com,\n amorenoz@redhat.com, david.marchand@redhat.com",
        "Cc": "Maxime Coquelin <maxime.coquelin@redhat.com>",
        "Date": "Sun, 20 Dec 2020 22:13:45 +0100",
        "Message-Id": "<20201220211405.313012-21-maxime.coquelin@redhat.com>",
        "In-Reply-To": "<20201220211405.313012-1-maxime.coquelin@redhat.com>",
        "References": "<20201220211405.313012-1-maxime.coquelin@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.12",
        "Authentication-Results": "relay.mimecast.com;\n auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain; charset=\"US-ASCII\"",
        "Subject": "[dpdk-dev] [PATCH 20/40] net/virtio: make interrupt handling more\n\tgeneric",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "This patch aims at isolating MSIX notion into PCI\nlayer.\n\nSigned-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>\n---\n drivers/net/virtio/virtio.c             |   6 ++\n drivers/net/virtio/virtio.h             |  11 +-\n drivers/net/virtio/virtio_ethdev.c      |   7 +-\n drivers/net/virtio/virtio_pci.c         | 131 ++++++++++++------------\n drivers/net/virtio/virtio_pci.h         |  25 ++---\n drivers/net/virtio/virtio_user_ethdev.c |   4 +-\n 6 files changed, 90 insertions(+), 94 deletions(-)",
    "diff": "diff --git a/drivers/net/virtio/virtio.c b/drivers/net/virtio/virtio.c\nindex ba3203e68b..7e1e77797f 100644\n--- a/drivers/net/virtio/virtio.c\n+++ b/drivers/net/virtio/virtio.c\n@@ -63,3 +63,9 @@ virtio_get_status(struct virtio_hw *hw)\n {\n \treturn VIRTIO_OPS(hw)->get_status(hw);\n }\n+\n+uint8_t\n+virtio_get_isr(struct virtio_hw *hw)\n+{\n+\treturn VIRTIO_OPS(hw)->get_isr(hw);\n+}\ndiff --git a/drivers/net/virtio/virtio.h b/drivers/net/virtio/virtio.h\nindex 5169436c9f..f44125f48a 100644\n--- a/drivers/net/virtio/virtio.h\n+++ b/drivers/net/virtio/virtio.h\n@@ -124,6 +124,13 @@\n #define VIRTIO_CONFIG_STATUS_DEV_NEED_RESET\t0x40\n #define VIRTIO_CONFIG_STATUS_FAILED\t\t0x80\n \n+/* The bit of the ISR which indicates a device has an interrupt. */\n+#define VIRTIO_ISR_INTR   0x1\n+/* The bit of the ISR which indicates a device configuration change. */\n+#define VIRTIO_ISR_CONFIG 0x2\n+/* Vector value used to disable MSI for queue. */\n+#define VIRTIO_MSI_NO_VECTOR 0xFFFF\n+\n /*\n  * This structure is just a reference to read\n  * net device specific config space; it just a chodu structure\n@@ -168,7 +175,7 @@ struct virtio_hw {\n \tuint8_t mac_addr[RTE_ETHER_ADDR_LEN];\n \tuint32_t speed;  /* link speed in MB */\n \tuint8_t duplex;\n-\tuint8_t use_msix;\n+\tuint8_t intr_lsc;\n \tuint16_t max_mtu;\n \t/*\n \t * App management thread and virtio interrupt handler thread\n@@ -233,5 +240,5 @@ void virtio_write_dev_config(struct virtio_hw *hw, size_t offset, const void *sr\n void virtio_read_dev_config(struct virtio_hw *hw, size_t offset, void *dst, int length);\n void virtio_reset(struct virtio_hw *hw);\n void virtio_reinit_complete(struct virtio_hw *hw);\n-\n+uint8_t virtio_get_isr(struct virtio_hw *hw);\n #endif /* _VIRTIO_H_ */\ndiff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c\nindex 560647f11b..99a2dd24c4 100644\n--- a/drivers/net/virtio/virtio_ethdev.c\n+++ b/drivers/net/virtio/virtio_ethdev.c\n@@ -1442,13 +1442,13 @@ virtio_interrupt_handler(void *param)\n \tuint16_t status;\n \n \t/* Read interrupt status which clears interrupt */\n-\tisr = vtpci_isr(hw);\n+\tisr = virtio_get_isr(hw);\n \tPMD_DRV_LOG(INFO, \"interrupt status = %#x\", isr);\n \n \tif (virtio_intr_unmask(dev) < 0)\n \t\tPMD_DRV_LOG(ERR, \"interrupt enable failed\");\n \n-\tif (isr & VIRTIO_PCI_ISR_CONFIG) {\n+\tif (isr & VIRTIO_ISR_CONFIG) {\n \t\tif (virtio_dev_link_update(dev, 0) == 0)\n \t\t\trte_eth_dev_callback_process(dev,\n \t\t\t\t\t\t     RTE_ETH_EVENT_INTR_LSC,\n@@ -1655,8 +1655,7 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features)\n \thw->weak_barriers = !virtio_with_feature(hw, VIRTIO_F_ORDER_PLATFORM);\n \n \t/* If host does not support both status and MSI-X then disable LSC */\n-\tif (virtio_with_feature(hw, VIRTIO_NET_F_STATUS) &&\n-\t    hw->use_msix != VIRTIO_MSIX_NONE)\n+\tif (virtio_with_feature(hw, VIRTIO_NET_F_STATUS) && hw->intr_lsc)\n \t\teth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC;\n \telse\n \t\teth_dev->data->dev_flags &= ~RTE_ETH_DEV_INTR_LSC;\ndiff --git a/drivers/net/virtio/virtio_pci.c b/drivers/net/virtio/virtio_pci.c\nindex 29dd84888f..01a437a1b4 100644\n--- a/drivers/net/virtio/virtio_pci.c\n+++ b/drivers/net/virtio/virtio_pci.c\n@@ -28,8 +28,8 @@\n  * The remaining space is defined by each driver as the per-driver\n  * configuration space.\n  */\n-#define VIRTIO_PCI_CONFIG(hw) \\\n-\t\t(((hw)->use_msix == VIRTIO_MSIX_ENABLED) ? 24 : 20)\n+#define VIRTIO_PCI_CONFIG(dev) \\\n+\t\t(((dev)->msix_status == VIRTIO_MSIX_ENABLED) ? 24 : 20)\n \n \n struct virtio_pci_internal {\n@@ -71,6 +71,7 @@ static void\n legacy_read_dev_config(struct virtio_hw *hw, size_t offset,\n \t\t       void *dst, int length)\n {\n+\tstruct virtio_pci_dev *dev = virtio_pci_get_dev(hw);\n #ifdef RTE_ARCH_PPC_64\n \tint size;\n \n@@ -78,17 +79,17 @@ legacy_read_dev_config(struct virtio_hw *hw, size_t offset,\n \t\tif (length >= 4) {\n \t\t\tsize = 4;\n \t\t\trte_pci_ioport_read(VTPCI_IO(hw), dst, size,\n-\t\t\t\tVIRTIO_PCI_CONFIG(hw) + offset);\n+\t\t\t\tVIRTIO_PCI_CONFIG(dev) + offset);\n \t\t\t*(uint32_t *)dst = rte_be_to_cpu_32(*(uint32_t *)dst);\n \t\t} else if (length >= 2) {\n \t\t\tsize = 2;\n \t\t\trte_pci_ioport_read(VTPCI_IO(hw), dst, size,\n-\t\t\t\tVIRTIO_PCI_CONFIG(hw) + offset);\n+\t\t\t\tVIRTIO_PCI_CONFIG(dev) + offset);\n \t\t\t*(uint16_t *)dst = rte_be_to_cpu_16(*(uint16_t *)dst);\n \t\t} else {\n \t\t\tsize = 1;\n \t\t\trte_pci_ioport_read(VTPCI_IO(hw), dst, size,\n-\t\t\t\tVIRTIO_PCI_CONFIG(hw) + offset);\n+\t\t\t\tVIRTIO_PCI_CONFIG(dev) + offset);\n \t\t}\n \n \t\tdst = (char *)dst + size;\n@@ -97,7 +98,7 @@ legacy_read_dev_config(struct virtio_hw *hw, size_t offset,\n \t}\n #else\n \trte_pci_ioport_read(VTPCI_IO(hw), dst, length,\n-\t\tVIRTIO_PCI_CONFIG(hw) + offset);\n+\t\tVIRTIO_PCI_CONFIG(dev) + offset);\n #endif\n }\n \n@@ -105,6 +106,7 @@ static void\n legacy_write_dev_config(struct virtio_hw *hw, size_t offset,\n \t\t\tconst void *src, int length)\n {\n+\tstruct virtio_pci_dev *dev = virtio_pci_get_dev(hw);\n #ifdef RTE_ARCH_PPC_64\n \tunion {\n \t\tuint32_t u32;\n@@ -117,16 +119,16 @@ legacy_write_dev_config(struct virtio_hw *hw, size_t offset,\n \t\t\tsize = 4;\n \t\t\ttmp.u32 = rte_cpu_to_be_32(*(const uint32_t *)src);\n \t\t\trte_pci_ioport_write(VTPCI_IO(hw), &tmp.u32, size,\n-\t\t\t\tVIRTIO_PCI_CONFIG(hw) + offset);\n+\t\t\t\tVIRTIO_PCI_CONFIG(dev) + offset);\n \t\t} else if (length >= 2) {\n \t\t\tsize = 2;\n \t\t\ttmp.u16 = rte_cpu_to_be_16(*(const uint16_t *)src);\n \t\t\trte_pci_ioport_write(VTPCI_IO(hw), &tmp.u16, size,\n-\t\t\t\tVIRTIO_PCI_CONFIG(hw) + offset);\n+\t\t\t\tVIRTIO_PCI_CONFIG(dev) + offset);\n \t\t} else {\n \t\t\tsize = 1;\n \t\t\trte_pci_ioport_write(VTPCI_IO(hw), src, size,\n-\t\t\t\tVIRTIO_PCI_CONFIG(hw) + offset);\n+\t\t\t\tVIRTIO_PCI_CONFIG(dev) + offset);\n \t\t}\n \n \t\tsrc = (const char *)src + size;\n@@ -135,7 +137,7 @@ legacy_write_dev_config(struct virtio_hw *hw, size_t offset,\n \t}\n #else\n \trte_pci_ioport_write(VTPCI_IO(hw), src, length,\n-\t\tVIRTIO_PCI_CONFIG(hw) + offset);\n+\t\tVIRTIO_PCI_CONFIG(dev) + offset);\n #endif\n }\n \n@@ -533,12 +535,6 @@ const struct virtio_ops modern_ops = {\n \t.dev_close\t= modern_dev_close,\n };\n \n-uint8_t\n-vtpci_isr(struct virtio_hw *hw)\n-{\n-\treturn VIRTIO_OPS(hw)->get_isr(hw);\n-}\n-\n static void *\n get_cfg_addr(struct rte_pci_device *dev, struct virtio_pci_cap *cap)\n {\n@@ -623,9 +619,9 @@ virtio_read_caps(struct rte_pci_device *pci_dev, struct virtio_hw *hw)\n \t\t\t}\n \n \t\t\tif (flags & PCI_MSIX_ENABLE)\n-\t\t\t\thw->use_msix = VIRTIO_MSIX_ENABLED;\n+\t\t\t\tdev->msix_status = VIRTIO_MSIX_ENABLED;\n \t\t\telse\n-\t\t\t\thw->use_msix = VIRTIO_MSIX_DISABLED;\n+\t\t\t\tdev->msix_status = VIRTIO_MSIX_DISABLED;\n \t\t}\n \n \t\tif (cap.cap_vndr != PCI_CAP_ID_VNDR) {\n@@ -691,6 +687,54 @@ virtio_read_caps(struct rte_pci_device *pci_dev, struct virtio_hw *hw)\n \treturn 0;\n }\n \n+static enum virtio_msix_status\n+vtpci_msix_detect(struct rte_pci_device *dev)\n+{\n+\tuint8_t pos;\n+\tint ret;\n+\n+\tret = rte_pci_read_config(dev, &pos, 1, PCI_CAPABILITY_LIST);\n+\tif (ret != 1) {\n+\t\tPMD_INIT_LOG(DEBUG,\n+\t\t\t     \"failed to read pci capability list, ret %d\", ret);\n+\t\treturn VIRTIO_MSIX_NONE;\n+\t}\n+\n+\twhile (pos) {\n+\t\tuint8_t cap[2];\n+\n+\t\tret = rte_pci_read_config(dev, cap, sizeof(cap), pos);\n+\t\tif (ret != sizeof(cap)) {\n+\t\t\tPMD_INIT_LOG(DEBUG,\n+\t\t\t\t     \"failed to read pci cap at pos: %x ret %d\",\n+\t\t\t\t     pos, ret);\n+\t\t\tbreak;\n+\t\t}\n+\n+\t\tif (cap[0] == PCI_CAP_ID_MSIX) {\n+\t\t\tuint16_t flags;\n+\n+\t\t\tret = rte_pci_read_config(dev, &flags, sizeof(flags),\n+\t\t\t\t\tpos + sizeof(cap));\n+\t\t\tif (ret != sizeof(flags)) {\n+\t\t\t\tPMD_INIT_LOG(DEBUG,\n+\t\t\t\t\t     \"failed to read pci cap at pos:\"\n+\t\t\t\t\t     \" %x ret %d\", pos + 2, ret);\n+\t\t\t\tbreak;\n+\t\t\t}\n+\n+\t\t\tif (flags & PCI_MSIX_ENABLE)\n+\t\t\t\treturn VIRTIO_MSIX_ENABLED;\n+\t\t\telse\n+\t\t\t\treturn VIRTIO_MSIX_DISABLED;\n+\t\t}\n+\n+\t\tpos = cap[1];\n+\t}\n+\n+\treturn VIRTIO_MSIX_NONE;\n+}\n+\n /*\n  * Return -1:\n  *   if there is error mapping with VFIO/UIO.\n@@ -736,59 +780,12 @@ vtpci_init(struct rte_pci_device *pci_dev, struct virtio_pci_dev *dev)\n \tdev->modern = false;\n \n msix_detect:\n-\thw->use_msix = vtpci_msix_detect(pci_dev);\n+\tdev->msix_status = vtpci_msix_detect(pci_dev);\n+\thw->intr_lsc = !!dev->msix_status;\n \n \treturn 0;\n }\n \n-enum virtio_msix_status\n-vtpci_msix_detect(struct rte_pci_device *dev)\n-{\n-\tuint8_t pos;\n-\tint ret;\n-\n-\tret = rte_pci_read_config(dev, &pos, 1, PCI_CAPABILITY_LIST);\n-\tif (ret != 1) {\n-\t\tPMD_INIT_LOG(DEBUG,\n-\t\t\t     \"failed to read pci capability list, ret %d\", ret);\n-\t\treturn VIRTIO_MSIX_NONE;\n-\t}\n-\n-\twhile (pos) {\n-\t\tuint8_t cap[2];\n-\n-\t\tret = rte_pci_read_config(dev, cap, sizeof(cap), pos);\n-\t\tif (ret != sizeof(cap)) {\n-\t\t\tPMD_INIT_LOG(DEBUG,\n-\t\t\t\t     \"failed to read pci cap at pos: %x ret %d\",\n-\t\t\t\t     pos, ret);\n-\t\t\tbreak;\n-\t\t}\n-\n-\t\tif (cap[0] == PCI_CAP_ID_MSIX) {\n-\t\t\tuint16_t flags;\n-\n-\t\t\tret = rte_pci_read_config(dev, &flags, sizeof(flags),\n-\t\t\t\t\tpos + sizeof(cap));\n-\t\t\tif (ret != sizeof(flags)) {\n-\t\t\t\tPMD_INIT_LOG(DEBUG,\n-\t\t\t\t\t     \"failed to read pci cap at pos:\"\n-\t\t\t\t\t     \" %x ret %d\", pos + 2, ret);\n-\t\t\t\tbreak;\n-\t\t\t}\n-\n-\t\t\tif (flags & PCI_MSIX_ENABLE)\n-\t\t\t\treturn VIRTIO_MSIX_ENABLED;\n-\t\t\telse\n-\t\t\t\treturn VIRTIO_MSIX_DISABLED;\n-\t\t}\n-\n-\t\tpos = cap[1];\n-\t}\n-\n-\treturn VIRTIO_MSIX_NONE;\n-}\n-\n void vtpci_legacy_ioport_unmap(struct virtio_hw *hw)\n {\n \trte_pci_ioport_unmap(VTPCI_IO(hw));\ndiff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h\nindex 19d56c920c..4ee890ffda 100644\n--- a/drivers/net/virtio/virtio_pci.h\n+++ b/drivers/net/virtio/virtio_pci.h\n@@ -42,13 +42,6 @@ struct virtnet_ctl;\n #define VIRTIO_MSI_QUEUE_VECTOR\t  22 /* vector for selected VQ notifications\n \t\t\t\t      (16, RW) */\n \n-/* The bit of the ISR which indicates a device has an interrupt. */\n-#define VIRTIO_PCI_ISR_INTR   0x1\n-/* The bit of the ISR which indicates a device configuration change. */\n-#define VIRTIO_PCI_ISR_CONFIG 0x2\n-/* Vector value used to disable MSI for queue. */\n-#define VIRTIO_MSI_NO_VECTOR 0xFFFF\n-\n /* Common configuration */\n #define VIRTIO_PCI_CAP_COMMON_CFG\t1\n /* Notifications */\n@@ -103,12 +96,18 @@ struct virtio_pci_common_cfg {\n \tuint32_t queue_used_hi;\t\t/* read-write */\n };\n \n+enum virtio_msix_status {\n+\tVIRTIO_MSIX_NONE = 0,\n+\tVIRTIO_MSIX_DISABLED = 1,\n+\tVIRTIO_MSIX_ENABLED = 2\n+};\n \n struct virtio_pci_dev {\n \tstruct virtio_hw hw;\n \tstruct rte_pci_device *pci_dev;\n \tstruct virtio_pci_common_cfg *common_cfg;\n \tstruct virtio_net_config *dev_cfg;\n+\tenum virtio_msix_status msix_status;\n \tuint8_t *isr;\n \tuint16_t *notify_base;\n \tuint32_t notify_off_multiplier;\n@@ -126,22 +125,10 @@ struct virtio_pci_dev {\n /* The alignment to use between consumer and producer parts of vring. */\n #define VIRTIO_PCI_VRING_ALIGN 4096\n \n-enum virtio_msix_status {\n-\tVIRTIO_MSIX_NONE = 0,\n-\tVIRTIO_MSIX_DISABLED = 1,\n-\tVIRTIO_MSIX_ENABLED = 2\n-};\n-\n-\n /*\n  * Function declaration from virtio_pci.c\n  */\n int vtpci_init(struct rte_pci_device *pci_dev, struct virtio_pci_dev *dev);\n-\n-uint8_t vtpci_isr(struct virtio_hw *);\n-\n-enum virtio_msix_status vtpci_msix_detect(struct rte_pci_device *dev);\n-\n void vtpci_legacy_ioport_unmap(struct virtio_hw *hw);\n int vtpci_legacy_ioport_map(struct virtio_hw *hw);\n \ndiff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c\nindex 0f252c0732..eacb268297 100644\n--- a/drivers/net/virtio/virtio_user_ethdev.c\n+++ b/drivers/net/virtio/virtio_user_ethdev.c\n@@ -339,7 +339,7 @@ virtio_user_get_isr(struct virtio_hw *hw __rte_unused)\n \t/* rxq interrupts and config interrupt are separated in virtio-user,\n \t * here we only report config change.\n \t */\n-\treturn VIRTIO_PCI_ISR_CONFIG;\n+\treturn VIRTIO_ISR_CONFIG;\n }\n \n static uint16_t\n@@ -640,7 +640,7 @@ virtio_user_eth_dev_alloc(struct rte_vdev_device *vdev)\n \t * MSIX is required to enable LSC (see virtio_init_device).\n \t * Here just pretend that we support msix.\n \t */\n-\thw->use_msix = 1;\n+\thw->intr_lsc = 1;\n \thw->use_vec_rx = 0;\n \thw->use_vec_tx = 0;\n \thw->use_inorder_rx = 0;\n",
    "prefixes": [
        "20/40"
    ]
}