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

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Jun 15 03:32:47 CEST 2023


Hi,

FYI, your patch has been queued to stable release 20.11.9

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/17/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/4b0fddb60cf9084a7b8592a25230797cbb01dd32

Thanks.

Luca Boccassi

---
>From 4b0fddb60cf9084a7b8592a25230797cbb01dd32 Mon Sep 17 00:00:00 2001
From: Wenjun Wu <wenjun1.wu at intel.com>
Date: Fri, 14 Apr 2023 13:47:41 +0800
Subject: [PATCH] net/ice: fix Rx data buffer size

[ upstream commit 9a5c9dc475428c7d2c74383c0903541ab80144ea ]

This patch does two fixes.

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

2. Replace RTE_ALIGN with RTE_ALIGN_FLOOR according to [1].

[1] Commit c9c45beb1b97 ("net/iavf: fix Rx queue buffer size alignment")

Fixes: 50370662b727 ("net/ice: support device and queue ops")
Fixes: 1b009275e2c8 ("net/ice: add Rx queue init in DCF")

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

diff --git a/drivers/net/ice/ice_dcf_ethdev.c b/drivers/net/ice/ice_dcf_ethdev.c
index 429057a862..eb8095a61f 100644
--- a/drivers/net/ice/ice_dcf_ethdev.c
+++ b/drivers/net/ice/ice_dcf_ethdev.c
@@ -52,7 +52,8 @@ ice_dcf_init_rxq(struct rte_eth_dev *dev, struct ice_rx_queue *rxq)
 
 	buf_size = rte_pktmbuf_data_room_size(rxq->mp) - RTE_PKTMBUF_HEADROOM;
 	rxq->rx_hdr_len = 0;
-	rxq->rx_buf_len = RTE_ALIGN(buf_size, (1 << ICE_RLAN_CTX_DBUF_S));
+	rxq->rx_buf_len = RTE_ALIGN_FLOOR(buf_size, (1 << ICE_RLAN_CTX_DBUF_S));
+	rxq->rx_buf_len = RTE_MIN(rxq->rx_buf_len, ICE_RX_MAX_DATA_BUF_SIZE);
 	max_pkt_len = RTE_MIN((uint32_t)
 			      ICE_SUPPORT_CHAIN_NUM * rxq->rx_buf_len,
 			      dev->data->dev_conf.rxmode.max_rx_pkt_len);
diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index 2716c56f3a..699bf7bb64 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -248,7 +248,8 @@ ice_program_hw_rx_queue(struct ice_rx_queue *rxq)
 	buf_size = (uint16_t)(rte_pktmbuf_data_room_size(rxq->mp) -
 			      RTE_PKTMBUF_HEADROOM);
 	rxq->rx_hdr_len = 0;
-	rxq->rx_buf_len = RTE_ALIGN(buf_size, (1 << ICE_RLAN_CTX_DBUF_S));
+	rxq->rx_buf_len = RTE_ALIGN_FLOOR(buf_size, (1 << ICE_RLAN_CTX_DBUF_S));
+	rxq->rx_buf_len = RTE_MIN(rxq->rx_buf_len, ICE_RX_MAX_DATA_BUF_SIZE);
 	rxq->max_pkt_len = RTE_MIN((uint32_t)
 				   ICE_SUPPORT_CHAIN_NUM * rxq->rx_buf_len,
 				   dev_data->dev_conf.rxmode.max_rx_pkt_len);
diff --git a/drivers/net/ice/ice_rxtx.h b/drivers/net/ice/ice_rxtx.h
index 1ba264ddbc..02da387897 100644
--- a/drivers/net/ice/ice_rxtx.h
+++ b/drivers/net/ice/ice_rxtx.h
@@ -42,6 +42,9 @@
 
 #define ICE_TX_MIN_PKT_LEN 17
 
+/* Max data buffer size must be 16K - 128 bytes */
+#define ICE_RX_MAX_DATA_BUF_SIZE	(16 * 1024 - 128)
+
 typedef void (*ice_rx_release_mbufs_t)(struct ice_rx_queue *rxq);
 typedef void (*ice_tx_release_mbufs_t)(struct ice_tx_queue *txq);
 typedef void (*ice_rxd_to_pkt_fields_t)(struct ice_rx_queue *rxq,
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-06-15 01:56:37.337464438 +0100
+++ 0052-net-ice-fix-Rx-data-buffer-size.patch	2023-06-15 01:56:34.699544188 +0100
@@ -1 +1 @@
-From 9a5c9dc475428c7d2c74383c0903541ab80144ea Mon Sep 17 00:00:00 2001
+From 4b0fddb60cf9084a7b8592a25230797cbb01dd32 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 9a5c9dc475428c7d2c74383c0903541ab80144ea ]
+
@@ -17 +18,0 @@
-Cc: stable at dpdk.org
@@ -28 +29 @@
-index 13ff24552d..76b28bface 100644
+index 429057a862..eb8095a61f 100644
@@ -31 +32 @@
-@@ -114,7 +114,8 @@ ice_dcf_init_rxq(struct rte_eth_dev *dev, struct ice_rx_queue *rxq)
+@@ -52,7 +52,8 @@ ice_dcf_init_rxq(struct rte_eth_dev *dev, struct ice_rx_queue *rxq)
@@ -38,3 +39,3 @@
- 	max_pkt_len = RTE_MIN(ICE_SUPPORT_CHAIN_NUM * rxq->rx_buf_len,
- 			      dev->data->mtu + ICE_ETH_OVERHEAD);
- 
+ 	max_pkt_len = RTE_MIN((uint32_t)
+ 			      ICE_SUPPORT_CHAIN_NUM * rxq->rx_buf_len,
+ 			      dev->data->dev_conf.rxmode.max_rx_pkt_len);
@@ -42 +43 @@
-index 0ea0045836..560c1a4af7 100644
+index 2716c56f3a..699bf7bb64 100644
@@ -45,2 +46 @@
-@@ -259,7 +259,8 @@ ice_program_hw_rx_queue(struct ice_rx_queue *rxq)
- 	/* Set buffer size as the head split is disabled. */
+@@ -248,7 +248,8 @@ ice_program_hw_rx_queue(struct ice_rx_queue *rxq)
@@ -48,0 +49 @@
+ 	rxq->rx_hdr_len = 0;
@@ -52,3 +53,3 @@
- 	rxq->max_pkt_len =
- 		RTE_MIN((uint32_t)ICE_SUPPORT_CHAIN_NUM * rxq->rx_buf_len,
- 			frame_size);
+ 	rxq->max_pkt_len = RTE_MIN((uint32_t)
+ 				   ICE_SUPPORT_CHAIN_NUM * rxq->rx_buf_len,
+ 				   dev_data->dev_conf.rxmode.max_rx_pkt_len);
@@ -56 +57 @@
-index 94f6bcf3d1..89569029e1 100644
+index 1ba264ddbc..02da387897 100644
@@ -59,3 +60,3 @@
-@@ -51,6 +51,9 @@ extern int ice_timestamp_dynfield_offset;
- /* Max header size can be 2K - 64 bytes */
- #define ICE_RX_HDR_BUF_SIZE    (2048 - 64)
+@@ -42,6 +42,9 @@
+ 
+ #define ICE_TX_MIN_PKT_LEN 17
@@ -66,2 +66,0 @@
- #define ICE_HEADER_SPLIT_ENA   BIT(0)
- 
@@ -68,0 +68,2 @@
+ typedef void (*ice_tx_release_mbufs_t)(struct ice_tx_queue *txq);
+ typedef void (*ice_rxd_to_pkt_fields_t)(struct ice_rx_queue *rxq,


More information about the stable mailing list