patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Jianfeng Tan <jianfeng.tan@intel.com>
To: dev@dpdk.org
Cc: yuanhan.liu@linux.intel.com, maxime.coquelin@redhat.com,
	thomas@monjalon.net, Jianfeng Tan <jianfeng.tan@intel.com>,
	stable@dpdk.org
Subject: [dpdk-stable] [PATCH 1/3] net/virtio: fix wrong MSI-X for modern devices
Date: Wed, 26 Apr 2017 04:52:49 +0000	[thread overview]
Message-ID: <1493182371-34295-2-git-send-email-jianfeng.tan@intel.com> (raw)
In-Reply-To: <1493182371-34295-1-git-send-email-jianfeng.tan@intel.com>

The field, use_msix, in struct virtio_hw is not updated for modern
device, and is always zero. And now we depend on the status feature
and MSI-X to report LSC support (which is also not a correct
behavior). As a result, LSC is always disabled for modern devices.

Te fix this, we just recognize MSI-X capability when going through
capability list, and update the info in virtio.

Fixes: 6ba1f63b5ab0 ("virtio: support specification 1.0")
Cc: stable@dpdk.org

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
---
 drivers/net/virtio/virtio_pci.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/virtio/virtio_pci.c b/drivers/net/virtio/virtio_pci.c
index b767c03..ecad46e 100644
--- a/drivers/net/virtio/virtio_pci.c
+++ b/drivers/net/virtio/virtio_pci.c
@@ -50,6 +50,7 @@
  */
 #define PCI_CAPABILITY_LIST	0x34
 #define PCI_CAP_ID_VNDR		0x09
+#define PCI_CAP_ID_MSIX		0x11
 
 /*
  * The remaining space is defined by each driver as the per-driver
@@ -650,6 +651,9 @@ virtio_read_caps(struct rte_pci_device *dev, struct virtio_hw *hw)
 			break;
 		}
 
+		if (cap.cap_vndr == PCI_CAP_ID_MSIX)
+			hw->use_msix = 1;
+
 		if (cap.cap_vndr != PCI_CAP_ID_VNDR) {
 			PMD_INIT_LOG(DEBUG,
 				"[%2x] skipping non VNDR cap id: %02x",
-- 
2.7.4

       reply	other threads:[~2017-04-26  4:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1493182371-34295-1-git-send-email-jianfeng.tan@intel.com>
2017-04-26  4:52 ` Jianfeng Tan [this message]
2017-04-26  4:52 ` [dpdk-stable] [PATCH 3/3] net/virtio: fix link status always being down Jianfeng Tan
     [not found] ` <1493278539-44617-1-git-send-email-jianfeng.tan@intel.com>
2017-04-27  7:35   ` [dpdk-stable] [PATCH v2 1/4] net/virtio: fix wrong MSI-X for modern devices Jianfeng Tan
2017-04-27  7:35   ` [dpdk-stable] [PATCH v2 4/4] net/virtio: fix link status always being down Jianfeng Tan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1493182371-34295-2-git-send-email-jianfeng.tan@intel.com \
    --to=jianfeng.tan@intel.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    --cc=yuanhan.liu@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).