DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/virtio: disable LSC interrupt if MSIX not enabled
@ 2017-03-09 20:28 Allain Legacy
  2017-03-16  8:17 ` Yuanhan Liu
  0 siblings, 1 reply; 2+ messages in thread
From: Allain Legacy @ 2017-03-09 20:28 UTC (permalink / raw)
  To: yuanhan.liu, maxime.coquelin; +Cc: dev, matt.peters

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] net/virtio: disable LSC interrupt if MSIX not enabled
  2017-03-09 20:28 [dpdk-dev] [PATCH] net/virtio: disable LSC interrupt if MSIX not enabled Allain Legacy
@ 2017-03-16  8:17 ` Yuanhan Liu
  0 siblings, 0 replies; 2+ messages in thread
From: Yuanhan Liu @ 2017-03-16  8:17 UTC (permalink / raw)
  To: Allain Legacy; +Cc: maxime.coquelin, dev, matt.peters, stable

On Thu, Mar 09, 2017 at 03:28:02PM -0500, Allain Legacy wrote:
> 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
> 

Fixes: 954ea11540b6 ("virtio: do not report link state feature unless available")

Cc: stable@dpdk.org

Applied to dpdk-next-virtio. Thanks!

	--yliu
> Signed-off-by: Matt Peters <matt.peters@windriver.com>
> Signed-off-by: Allain Legacy <allain.legacy@windriver.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-16  8:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-09 20:28 [dpdk-dev] [PATCH] net/virtio: disable LSC interrupt if MSIX not enabled Allain Legacy
2017-03-16  8:17 ` Yuanhan Liu

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).