patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 1/3] net/virtio: fix wrong MSI-X for modern devices
       [not found] <1493182371-34295-1-git-send-email-jianfeng.tan@intel.com>
@ 2017-04-26  4:52 ` Jianfeng Tan
  2017-04-26  4:52 ` [dpdk-stable] [PATCH 3/3] net/virtio: fix link status always being down Jianfeng Tan
       [not found] ` <1493278539-44617-1-git-send-email-jianfeng.tan@intel.com>
  2 siblings, 0 replies; 4+ messages in thread
From: Jianfeng Tan @ 2017-04-26  4:52 UTC (permalink / raw)
  To: dev; +Cc: yuanhan.liu, maxime.coquelin, thomas, Jianfeng Tan, stable

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 <jianfeng.tan@intel.com>
---
 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

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

* [dpdk-stable] [PATCH 3/3] net/virtio: fix link status always being down
       [not found] <1493182371-34295-1-git-send-email-jianfeng.tan@intel.com>
  2017-04-26  4:52 ` [dpdk-stable] [PATCH 1/3] net/virtio: fix wrong MSI-X for modern devices Jianfeng Tan
@ 2017-04-26  4:52 ` Jianfeng Tan
       [not found] ` <1493278539-44617-1-git-send-email-jianfeng.tan@intel.com>
  2 siblings, 0 replies; 4+ messages in thread
From: Jianfeng Tan @ 2017-04-26  4:52 UTC (permalink / raw)
  To: dev; +Cc: yuanhan.liu, maxime.coquelin, thomas, Jianfeng Tan, stable

The virtio port link status will always be DOWN:

The commit aa9f06061765 ("net/virtio: fix link status always being up")
introduces a flag to help checking the status. If this flag is not set,
status will be always down. However, in dev start, this flag is set
after link status update, then we miss the chance to change the status
to UP in dev start.

To fix this bug, we simply move the link status update after the flag
setting so that the status can be correctly updated.

Fixes: aa9f06061765 ("net/virtio: fix link status always being up")
Cc: stable@dpdk.org

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
---
 drivers/net/virtio/virtio_ethdev.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index e79748e..cd87c0e 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1742,9 +1742,6 @@ virtio_dev_start(struct rte_eth_dev *dev)
 		}
 	}
 
-	/* Initialize Link state */
-	virtio_dev_link_update(dev, 0);
-
 	/*Notify the backend
 	 *Otherwise the tap backend might already stop its queue due to fullness.
 	 *vhost backend will have no chance to be waked up
@@ -1773,8 +1770,12 @@ virtio_dev_start(struct rte_eth_dev *dev)
 		txvq = dev->data->tx_queues[i];
 		VIRTQUEUE_DUMP(txvq->vq);
 	}
+
 	hw->started = 1;
 
+	/* Initialize Link state */
+	virtio_dev_link_update(dev, 0);
+
 	return 0;
 }
 
-- 
2.7.4

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

* [dpdk-stable] [PATCH v2 1/4] net/virtio: fix wrong MSI-X for modern devices
       [not found] ` <1493278539-44617-1-git-send-email-jianfeng.tan@intel.com>
@ 2017-04-27  7:35   ` Jianfeng Tan
  2017-04-27  7:35   ` [dpdk-stable] [PATCH v2 4/4] net/virtio: fix link status always being down Jianfeng Tan
  1 sibling, 0 replies; 4+ messages in thread
From: Jianfeng Tan @ 2017-04-27  7:35 UTC (permalink / raw)
  To: dev; +Cc: yuanhan.liu, maxime.coquelin, thomas, Jianfeng Tan, stable

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 <jianfeng.tan@intel.com>
---
 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

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

* [dpdk-stable] [PATCH v2 4/4] net/virtio: fix link status always being down
       [not found] ` <1493278539-44617-1-git-send-email-jianfeng.tan@intel.com>
  2017-04-27  7:35   ` [dpdk-stable] [PATCH v2 1/4] net/virtio: fix wrong MSI-X for modern devices Jianfeng Tan
@ 2017-04-27  7:35   ` Jianfeng Tan
  1 sibling, 0 replies; 4+ messages in thread
From: Jianfeng Tan @ 2017-04-27  7:35 UTC (permalink / raw)
  To: dev; +Cc: yuanhan.liu, maxime.coquelin, thomas, Jianfeng Tan, stable

The virtio port link status will always be DOWN:

The commit aa9f06061765 ("net/virtio: fix link status always being up")
introduces a flag to help checking the status. If this flag is not set,
status will be always down. However, in dev start, this flag is set
after link status update, then we miss the chance to change the status
to UP in dev start.

To fix this bug, we simply move the link status update after the flag
setting so that the status can be correctly updated.

Fixes: aa9f06061765 ("net/virtio: fix link status always being up")
Cc: stable@dpdk.org

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
---
 drivers/net/virtio/virtio_ethdev.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index e79748e..cd87c0e 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1742,9 +1742,6 @@ virtio_dev_start(struct rte_eth_dev *dev)
 		}
 	}
 
-	/* Initialize Link state */
-	virtio_dev_link_update(dev, 0);
-
 	/*Notify the backend
 	 *Otherwise the tap backend might already stop its queue due to fullness.
 	 *vhost backend will have no chance to be waked up
@@ -1773,8 +1770,12 @@ virtio_dev_start(struct rte_eth_dev *dev)
 		txvq = dev->data->tx_queues[i];
 		VIRTQUEUE_DUMP(txvq->vq);
 	}
+
 	hw->started = 1;
 
+	/* Initialize Link state */
+	virtio_dev_link_update(dev, 0);
+
 	return 0;
 }
 
-- 
2.7.4

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

end of thread, other threads:[~2017-04-27  7:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1493182371-34295-1-git-send-email-jianfeng.tan@intel.com>
2017-04-26  4:52 ` [dpdk-stable] [PATCH 1/3] net/virtio: fix wrong MSI-X for modern devices Jianfeng Tan
2017-04-26  4:52 ` [dpdk-stable] [PATCH 3/3] net/virtio: fix link status always being down Jianfeng Tan
     [not found] ` <1493278539-44617-1-git-send-email-jianfeng.tan@intel.com>
2017-04-27  7:35   ` [dpdk-stable] [PATCH v2 1/4] net/virtio: fix wrong MSI-X for modern devices Jianfeng Tan
2017-04-27  7:35   ` [dpdk-stable] [PATCH v2 4/4] net/virtio: fix link status always being down Jianfeng Tan

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