From patchwork Thu Mar 9 20:28:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allain Legacy X-Patchwork-Id: 21666 X-Patchwork-Delegate: yuanhan.liu@linux.intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 0A98037B4; Thu, 9 Mar 2017 21:28:14 +0100 (CET) Received: from mail1.windriver.com (mail1.windriver.com [147.11.146.13]) by dpdk.org (Postfix) with ESMTP id 15FB83DC for ; Thu, 9 Mar 2017 21:28:11 +0100 (CET) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail1.windriver.com (8.15.2/8.15.1) with ESMTPS id v29KSA3D020994 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Thu, 9 Mar 2017 12:28:10 -0800 (PST) Received: from yow-cgts4-lx.wrs.com (128.224.145.137) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server (TLS) id 14.3.294.0; Thu, 9 Mar 2017 12:28:09 -0800 From: Allain Legacy To: , CC: , Date: Thu, 9 Mar 2017 15:28:02 -0500 Message-ID: <1489091282-195702-1-git-send-email-allain.legacy@windriver.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [128.224.145.137] Subject: [dpdk-dev] [PATCH] net/virtio: disable LSC interrupt if MSIX not enabled X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Matt Peters The link state change interrupt can only be configured if the virtio device supports MSIX. Prior to this change the writing of the vector to the PCI config space was causing it to overwrite the initial part of the MAC address since the MSIX vector is not in the config space and is occupied by the MAC address. This has been reproduced in Virtual Box (v5.0.30.r112061) in Windows 7 Signed-off-by: Matt Peters Signed-off-by: Allain Legacy --- drivers/net/virtio/virtio_ethdev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index 4dc03b9..66770fc 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1338,11 +1338,11 @@ static int virtio_dev_xstats_get_names(struct rte_eth_dev *dev, rte_eth_copy_pci_info(eth_dev, pci_dev); } - /* If host does not support status then disable LSC */ - if (!vtpci_with_feature(hw, VIRTIO_NET_F_STATUS)) - eth_dev->data->dev_flags &= ~RTE_ETH_DEV_INTR_LSC; - else + /* If host does not support both status and MSI-X then disable LSC */ + if (vtpci_with_feature(hw, VIRTIO_NET_F_STATUS) && hw->use_msix) eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC; + else + eth_dev->data->dev_flags &= ~RTE_ETH_DEV_INTR_LSC; rx_func_get(eth_dev);