DPDK patches and discussions
 help / color / mirror / Atom feed
From: Allain Legacy <allain.legacy@windriver.com>
To: <yuanhan.liu@linux.intel.com>, <maxime.coquelin@redhat.com>
Cc: <dev@dpdk.org>, <matt.peters@windriver.com>
Subject: [dpdk-dev] [PATCH] net/virtio: disable LSC interrupt if MSIX not enabled
Date: Thu, 9 Mar 2017 15:28:02 -0500	[thread overview]
Message-ID: <1489091282-195702-1-git-send-email-allain.legacy@windriver.com> (raw)

From: Matt Peters <matt.peters@windriver.com>

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 <matt.peters@windriver.com>
Signed-off-by: Allain Legacy <allain.legacy@windriver.com>
---
 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);
 
-- 
1.8.3.1

             reply	other threads:[~2017-03-09 20:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-09 20:28 Allain Legacy [this message]
2017-03-16  8:17 ` Yuanhan Liu

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=1489091282-195702-1-git-send-email-allain.legacy@windriver.com \
    --to=allain.legacy@windriver.com \
    --cc=dev@dpdk.org \
    --cc=matt.peters@windriver.com \
    --cc=maxime.coquelin@redhat.com \
    --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).