patch 'net/virtio: remove address width limit for modern devices' has been queued to stable release 20.11.8

luca.boccassi at gmail.com luca.boccassi at gmail.com
Wed Mar 22 01:41:47 CET 2023


Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/23/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/2f9b094042e64bb9ebd36ce8b2983b0a1c1c0f9b

Thanks.

Luca Boccassi

---
>From 2f9b094042e64bb9ebd36ce8b2983b0a1c1c0f9b Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand at redhat.com>
Date: Tue, 14 Mar 2023 09:53:34 +0100
Subject: [PATCH] net/virtio: remove address width limit for modern devices

[ upstream commit 8b76b3a0d327f6bedc1343149e03619337ab0408 ]

Modern devices don't have the same limitation as legacy devices, because
vring addresses are not configured using a 32-bit register.

Fixes: 6ba1f63b5ab0 ("virtio: support specification 1.0")

Signed-off-by: David Marchand <david.marchand at redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
Acked-by: Andy Pei <andy.pei at intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia at intel.com>
---
 drivers/net/virtio/virtio_pci.c | 28 ++++++++--------------------
 1 file changed, 8 insertions(+), 20 deletions(-)

diff --git a/drivers/net/virtio/virtio_pci.c b/drivers/net/virtio/virtio_pci.c
index 878a18555d..da5366802e 100644
--- a/drivers/net/virtio/virtio_pci.c
+++ b/drivers/net/virtio/virtio_pci.c
@@ -31,22 +31,6 @@
 #define VIRTIO_PCI_CONFIG(hw) \
 		(((hw)->use_msix == VIRTIO_MSIX_ENABLED) ? 24 : 20)
 
-static inline int
-check_vq_phys_addr_ok(struct virtqueue *vq)
-{
-	/* Virtio PCI device VIRTIO_PCI_QUEUE_PF register is 32bit,
-	 * and only accepts 32 bit page frame number.
-	 * Check if the allocated physical memory exceeds 16TB.
-	 */
-	if ((vq->vq_ring_mem + vq->vq_ring_size - 1) >>
-			(VIRTIO_PCI_QUEUE_ADDR_SHIFT + 32)) {
-		PMD_INIT_LOG(ERR, "vring address shouldn't be above 16TB!");
-		return 0;
-	}
-
-	return 1;
-}
-
 /*
  * Since we are in legacy mode:
  * http://ozlabs.org/~rusty/virtio-spec/virtio-0.9.5.pdf
@@ -213,8 +197,15 @@ legacy_setup_queue(struct virtio_hw *hw, struct virtqueue *vq)
 {
 	uint32_t src;
 
-	if (!check_vq_phys_addr_ok(vq))
+	/* Virtio PCI device VIRTIO_PCI_QUEUE_PFN register is 32bit,
+	 * and only accepts 32 bit page frame number.
+	 * Check if the allocated physical memory exceeds 16TB.
+	 */
+	if ((vq->vq_ring_mem + vq->vq_ring_size - 1) >>
+			(VIRTIO_PCI_QUEUE_ADDR_SHIFT + 32)) {
+		PMD_INIT_LOG(ERR, "vring address shouldn't be above 16TB!");
 		return -1;
+	}
 
 	rte_pci_ioport_write(VTPCI_IO(hw), &vq->vq_queue_index, 2,
 		VIRTIO_PCI_QUEUE_SEL);
@@ -366,9 +357,6 @@ modern_setup_queue(struct virtio_hw *hw, struct virtqueue *vq)
 	uint64_t desc_addr, avail_addr, used_addr;
 	uint16_t notify_off;
 
-	if (!check_vq_phys_addr_ok(vq))
-		return -1;
-
 	desc_addr = vq->vq_ring_mem;
 	avail_addr = desc_addr + vq->vq_nentries * sizeof(struct vring_desc);
 	used_addr = RTE_ALIGN_CEIL(avail_addr + offsetof(struct vring_avail,
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-21 21:56:37.495910124 +0000
+++ 0011-net-virtio-remove-address-width-limit-for-modern-dev.patch	2023-03-21 21:56:37.064806882 +0000
@@ -1 +1 @@
-From 8b76b3a0d327f6bedc1343149e03619337ab0408 Mon Sep 17 00:00:00 2001
+From 2f9b094042e64bb9ebd36ce8b2983b0a1c1c0f9b Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 8b76b3a0d327f6bedc1343149e03619337ab0408 ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -21 +22 @@
-index 9cf4d760b4..29eb739b04 100644
+index 878a18555d..da5366802e 100644
@@ -24,3 +25,3 @@
-@@ -33,22 +33,6 @@
- 
- struct virtio_pci_internal virtio_pci_internal[RTE_MAX_ETHPORTS];
+@@ -31,22 +31,6 @@
+ #define VIRTIO_PCI_CONFIG(hw) \
+ 		(((hw)->use_msix == VIRTIO_MSIX_ENABLED) ? 24 : 20)
@@ -44,4 +45,4 @@
- #define PCI_MSIX_ENABLE 0x8000
- 
- static enum virtio_msix_status
-@@ -273,8 +257,15 @@ legacy_setup_queue(struct virtio_hw *hw, struct virtqueue *vq)
+ /*
+  * Since we are in legacy mode:
+  * http://ozlabs.org/~rusty/virtio-spec/virtio-0.9.5.pdf
+@@ -213,8 +197,15 @@ legacy_setup_queue(struct virtio_hw *hw, struct virtqueue *vq)
@@ -64 +65 @@
-@@ -476,9 +467,6 @@ modern_setup_queue(struct virtio_hw *hw, struct virtqueue *vq)
+@@ -366,9 +357,6 @@ modern_setup_queue(struct virtio_hw *hw, struct virtqueue *vq)


More information about the stable mailing list