[dpdk-dev] net/virtio: fix wrong use_msix value for legacy device

Message ID 20171227100925.12953-1-zhiyong.yang@intel.com (mailing list archive)
State Superseded, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Yang, Zhiyong Dec. 27, 2017, 10:09 a.m. UTC
  If virtio fails to detect modern device, use_misx should be reset
to VIRTIO_MSIX_NONE, otherwise this wrong value will be used after
legacy device detection succeeds to be done.

Fixes: fe19d49cb525 ("net/virtio: fix Rx interrupt with VFIO")
Cc: stable@dpdk.org
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
---
 drivers/net/virtio/virtio_pci.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Yang, Zhiyong Dec. 28, 2017, 6:21 a.m. UTC | #1
Self Nack. 

Another patch has been sent out to fix testpmd startup failure issue using uio_pci_generic on virtio legacy device.
http://www.dpdk.org/dev/patchwork/patch/32779/

> -----Original Message-----
> From: Yang, Zhiyong
> Sent: Wednesday, December 27, 2017 6:09 PM
> To: dev@dpdk.org
> Cc: yliu@fridaylinux.org; maxime.coquelin@redhat.com; stable@dpdk.org; Yang,
> Zhiyong <zhiyong.yang@intel.com>
> Subject: [PATCH] net/virtio: fix wrong use_msix value for legacy device
> 
> If virtio fails to detect modern device, use_misx should be reset to
> VIRTIO_MSIX_NONE, otherwise this wrong value will be used after legacy device
> detection succeeds to be done.
> 
> Fixes: fe19d49cb525 ("net/virtio: fix Rx interrupt with VFIO")
> Cc: stable@dpdk.org
> Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
> ---
>  drivers/net/virtio/virtio_pci.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/virtio/virtio_pci.c b/drivers/net/virtio/virtio_pci.c index
> 9574498fb..5582238fd 100644
> --- a/drivers/net/virtio/virtio_pci.c
> +++ b/drivers/net/virtio/virtio_pci.c
> @@ -695,6 +695,7 @@ vtpci_init(struct rte_pci_device *dev, struct virtio_hw
> *hw)
>  		return 0;
>  	}
> 
> +	hw->use_msix = VIRTIO_MSIX_NONE;
>  	PMD_INIT_LOG(INFO, "trying with legacy virtio pci.");
>  	if (rte_pci_ioport_map(dev, 0, VTPCI_IO(hw)) < 0) {
>  		if (dev->kdrv == RTE_KDRV_UNKNOWN &&
> --
> 2.13.3
  

Patch

diff --git a/drivers/net/virtio/virtio_pci.c b/drivers/net/virtio/virtio_pci.c
index 9574498fb..5582238fd 100644
--- a/drivers/net/virtio/virtio_pci.c
+++ b/drivers/net/virtio/virtio_pci.c
@@ -695,6 +695,7 @@  vtpci_init(struct rte_pci_device *dev, struct virtio_hw *hw)
 		return 0;
 	}
 
+	hw->use_msix = VIRTIO_MSIX_NONE;
 	PMD_INIT_LOG(INFO, "trying with legacy virtio pci.");
 	if (rte_pci_ioport_map(dev, 0, VTPCI_IO(hw)) < 0) {
 		if (dev->kdrv == RTE_KDRV_UNKNOWN &&