[dpdk-stable] patch 'net/iavf: fix Rx queue buffer size alignment' has been queued to stable release 20.11.4

Xueming Li xuemingl at nvidia.com
Wed Nov 10 07:29:07 CET 2021


Hi,

FYI, your patch has been queued to stable release 20.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/12/21. 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/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/88719f1273a4bc3aada347a97dc87e8e1637f6ee

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 88719f1273a4bc3aada347a97dc87e8e1637f6ee Mon Sep 17 00:00:00 2001
From: Qiming Chen <chenqiming_huawei at 163.com>
Date: Sat, 11 Sep 2021 10:07:56 +0800
Subject: [PATCH] net/iavf: fix Rx queue buffer size alignment
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit c9c45beb1b97eed3fbf05095e376823fc58c9aa7 ]

The RTE_ALIGN macro is aligned upwards. If the buf_size variable is not
aligned with 1 << I40E_RXQ_CTX_DBUFF_SHIFT, the rx_buf_len is larger than
the actual mbuf memory after the operation. When receiving the packet, if
the packet is larger than the configured buf_size, it will cause a memory
stepping event.

The patch uses the RTE_ALIGN_FLOOR down alignment macro to correct the
problem.

Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")

Signed-off-by: Qiming Chen <chenqiming_huawei at 163.com>
Acked-by: Qi Zhang <qi.z.zhang at intel.com>
---
 drivers/net/iavf/iavf_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index 248e3df03b..b0e86f022b 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -560,7 +560,7 @@ iavf_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 	rxq->vsi = vsi;
 
 	len = rte_pktmbuf_data_room_size(rxq->mp) - RTE_PKTMBUF_HEADROOM;
-	rxq->rx_buf_len = RTE_ALIGN(len, (1 << IAVF_RXQ_CTX_DBUFF_SHIFT));
+	rxq->rx_buf_len = RTE_ALIGN_FLOOR(len, (1 << IAVF_RXQ_CTX_DBUFF_SHIFT));
 
 	/* Allocate the software ring. */
 	len = nb_desc + IAVF_RX_MAX_BURST;
-- 
2.33.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-10 14:17:04.896631253 +0800
+++ 0063-net-iavf-fix-Rx-queue-buffer-size-alignment.patch	2021-11-10 14:17:01.824079806 +0800
@@ -1 +1 @@
-From c9c45beb1b97eed3fbf05095e376823fc58c9aa7 Mon Sep 17 00:00:00 2001
+From 88719f1273a4bc3aada347a97dc87e8e1637f6ee Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit c9c45beb1b97eed3fbf05095e376823fc58c9aa7 ]
@@ -16 +18,0 @@
-Cc: stable at dpdk.org
@@ -25 +27 @@
-index 7240e70f9e..6de8ad3fe3 100644
+index 248e3df03b..b0e86f022b 100644
@@ -28,2 +30,2 @@
-@@ -619,7 +619,7 @@ iavf_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
- 		rxq->crc_len = 0;
+@@ -560,7 +560,7 @@ iavf_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
+ 	rxq->vsi = vsi;


More information about the stable mailing list