From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 8CA9BF94; Wed, 26 Apr 2017 06:52:05 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Apr 2017 21:52:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,252,1488873600"; d="scan'208";a="961148188" Received: from dpdk06.sh.intel.com ([10.239.129.195]) by orsmga003.jf.intel.com with ESMTP; 25 Apr 2017 21:52:03 -0700 From: Jianfeng Tan To: dev@dpdk.org Cc: yuanhan.liu@linux.intel.com, maxime.coquelin@redhat.com, thomas@monjalon.net, Jianfeng Tan , stable@dpdk.org Date: Wed, 26 Apr 2017 04:52:49 +0000 Message-Id: <1493182371-34295-2-git-send-email-jianfeng.tan@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1493182371-34295-1-git-send-email-jianfeng.tan@intel.com> References: <1493182371-34295-1-git-send-email-jianfeng.tan@intel.com> Subject: [dpdk-stable] [PATCH 1/3] net/virtio: fix wrong MSI-X for modern devices X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Apr 2017 04:52:06 -0000 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 --- 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