patch 'net/idpf: fix Rx data buffer size' has been queued to stable release 22.11.3

Xueming Li xuemingl at nvidia.com
Sun Jun 25 08:35:24 CEST 2023


Hi,

FYI, your patch has been queued to stable release 22.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/27/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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=c86c1efd2f380e03010cf3f47306b2d8939bf119

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From c86c1efd2f380e03010cf3f47306b2d8939bf119 Mon Sep 17 00:00:00 2001
From: Wenjun Wu <wenjun1.wu at intel.com>
Date: Fri, 14 Apr 2023 13:47:43 +0800
Subject: [PATCH] net/idpf: fix Rx data buffer size
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 4fc6c4d96dacc0af9733a0474061328be14f9a52 ]

This patch does two fixes.

1. According to hardware spec, the data buffer size should not
   be greater than 16K - 128.
2. Align data buffer size to 128.

Fixes: 9c47c29739a1 ("net/idpf: add Rx queue setup")

Signed-off-by: Wenjun Wu <wenjun1.wu at intel.com>
Acked-by: Qi Zhang <qi.z.zhang at intel.com>
---
 drivers/net/idpf/idpf_rxtx.c | 6 ++++--
 drivers/net/idpf/idpf_rxtx.h | 3 +++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/idpf/idpf_rxtx.c b/drivers/net/idpf/idpf_rxtx.c
index 1cbd5be8cc..ceb34d4d32 100644
--- a/drivers/net/idpf/idpf_rxtx.c
+++ b/drivers/net/idpf/idpf_rxtx.c
@@ -374,7 +374,8 @@ idpf_rx_split_bufq_setup(struct rte_eth_dev *dev, struct idpf_rx_queue *bufq,
 	bufq->adapter = adapter;
 
 	len = rte_pktmbuf_data_room_size(bufq->mp) - RTE_PKTMBUF_HEADROOM;
-	bufq->rx_buf_len = len;
+	bufq->rx_buf_len = RTE_ALIGN_FLOOR(len, (1 << IDPF_RLAN_CTX_DBUF_S));
+	bufq->rx_buf_len = RTE_MIN(bufq->rx_buf_len, IDPF_RX_MAX_DATA_BUF_SIZE);
 
 	/* Allocate the software ring. */
 	len = nb_desc + IDPF_RX_MAX_BURST;
@@ -473,7 +474,8 @@ idpf_rx_split_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 	rxq->offloads = offloads;
 
 	len = rte_pktmbuf_data_room_size(rxq->mp) - RTE_PKTMBUF_HEADROOM;
-	rxq->rx_buf_len = len;
+	rxq->rx_buf_len = RTE_ALIGN_FLOOR(len, (1 << IDPF_RLAN_CTX_DBUF_S));
+	rxq->rx_buf_len = RTE_MIN(rxq->rx_buf_len, IDPF_RX_MAX_DATA_BUF_SIZE);
 
 	len = rxq->nb_rx_desc + IDPF_RX_MAX_BURST;
 	ring_size = RTE_ALIGN(len *
diff --git a/drivers/net/idpf/idpf_rxtx.h b/drivers/net/idpf/idpf_rxtx.h
index 730dc64ebc..1c5b5b7c38 100644
--- a/drivers/net/idpf/idpf_rxtx.h
+++ b/drivers/net/idpf/idpf_rxtx.h
@@ -6,6 +6,9 @@
 #define _IDPF_RXTX_H_
 
 #include "idpf_ethdev.h"
+#define IDPF_RLAN_CTX_DBUF_S	7
+#define IDPF_RX_MAX_DATA_BUF_SIZE	(16 * 1024 - 128)
+
 
 /* MTS */
 #define GLTSYN_CMD_SYNC_0_0	(PF_TIMESYNC_BASE + 0x0)
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-06-25 14:32:01.331250200 +0800
+++ 0106-net-idpf-fix-Rx-data-buffer-size.patch	2023-06-25 14:31:58.555773900 +0800
@@ -1 +1 @@
-From 4fc6c4d96dacc0af9733a0474061328be14f9a52 Mon Sep 17 00:00:00 2001
+From c86c1efd2f380e03010cf3f47306b2d8939bf119 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 4fc6c4d96dacc0af9733a0474061328be14f9a52 ]
@@ -13 +15,0 @@
-Cc: stable at dpdk.org
@@ -18,2 +20,2 @@
- drivers/common/idpf/idpf_common_rxtx.h | 3 +++
- drivers/net/idpf/idpf_rxtx.c           | 6 ++++--
+ drivers/net/idpf/idpf_rxtx.c | 6 ++++--
+ drivers/net/idpf/idpf_rxtx.h | 3 +++
@@ -22,14 +23,0 @@
-diff --git a/drivers/common/idpf/idpf_common_rxtx.h b/drivers/common/idpf/idpf_common_rxtx.h
-index 11260d07f9..6cb83fc0a6 100644
---- a/drivers/common/idpf/idpf_common_rxtx.h
-+++ b/drivers/common/idpf/idpf_common_rxtx.h
-@@ -34,6 +34,9 @@
- #define IDPF_MAX_TSO_FRAME_SIZE	262143
- #define IDPF_TX_MAX_MTU_SEG     10
- 
-+#define IDPF_RLAN_CTX_DBUF_S	7
-+#define IDPF_RX_MAX_DATA_BUF_SIZE	(16 * 1024 - 128)
-+
- #define IDPF_TX_CKSUM_OFFLOAD_MASK (		\
- 		RTE_MBUF_F_TX_IP_CKSUM |	\
- 		RTE_MBUF_F_TX_L4_MASK |		\
@@ -37 +25 @@
-index 414f9a37f6..3e3d81ca6d 100644
+index 1cbd5be8cc..ceb34d4d32 100644
@@ -40 +28 @@
-@@ -155,7 +155,8 @@ idpf_rx_split_bufq_setup(struct rte_eth_dev *dev, struct idpf_rx_queue *rxq,
+@@ -374,7 +374,8 @@ idpf_rx_split_bufq_setup(struct rte_eth_dev *dev, struct idpf_rx_queue *bufq,
@@ -48 +36 @@
- 	/* Allocate a little more to support bulk allocate. */
+ 	/* Allocate the software ring. */
@@ -50,2 +38,2 @@
-@@ -275,7 +276,8 @@ idpf_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
- 	rxq->offloads = idpf_rx_offload_convert(offloads);
+@@ -473,7 +474,8 @@ idpf_rx_split_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
+ 	rxq->offloads = offloads;
@@ -58,2 +46,16 @@
- 	/* Allocate a little more to support bulk allocate. */
- 	len = nb_desc + IDPF_RX_MAX_BURST;
+ 	len = rxq->nb_rx_desc + IDPF_RX_MAX_BURST;
+ 	ring_size = RTE_ALIGN(len *
+diff --git a/drivers/net/idpf/idpf_rxtx.h b/drivers/net/idpf/idpf_rxtx.h
+index 730dc64ebc..1c5b5b7c38 100644
+--- a/drivers/net/idpf/idpf_rxtx.h
++++ b/drivers/net/idpf/idpf_rxtx.h
+@@ -6,6 +6,9 @@
+ #define _IDPF_RXTX_H_
+ 
+ #include "idpf_ethdev.h"
++#define IDPF_RLAN_CTX_DBUF_S	7
++#define IDPF_RX_MAX_DATA_BUF_SIZE	(16 * 1024 - 128)
++
+ 
+ /* MTS */
+ #define GLTSYN_CMD_SYNC_0_0	(PF_TIMESYNC_BASE + 0x0)


More information about the stable mailing list