Skip to contentSkip to conversation

fix RX data buffer size

PATCH Superseded Wenjun Wu 2 participants 13 messages Apr 14, 2023 – Apr 26, 2023 Network drivers

lore
Share & tools
lore

Wenjun Wu

author
#0 lore raw

cover fix RX data buffer size

This patch set fixes RX data buffer size in ice, i40e, iavf and idpf driver.

1. Limit the maximum buffer size to no more than 16K - 128.
2. Align max buffer size to 128, or replace RTE_ALIGN with RTE_ALIGN_FLOOR according to [1].

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

Wenjun Wu (5):
net/i40e: fix RX data buffer size
net/ice: fix RX data buffer size
net/iavf: fix RX data buffer size
net/idpf: fix RX data buffer size
net/cpfl: fix RX data buffer size

 drivers/common/idpf/idpf_common_rxtx.h | 3 +++
 drivers/net/cpfl/cpfl_rxtx.c           | 3 ++-
 drivers/net/i40e/i40e_rxtx.c           | 2 ++
 drivers/net/i40e/i40e_rxtx.h           | 3 +++
 drivers/net/iavf/iavf_rxtx.c           | 1 +
 drivers/net/iavf/iavf_rxtx.h           | 3 +++
 drivers/net/ice/ice_dcf_ethdev.c       | 3 ++-
 drivers/net/ice/ice_rxtx.c             | 3 ++-
 drivers/net/ice/ice_rxtx.h             | 3 +++
 drivers/net/idpf/idpf_rxtx.c           | 6 ++++--
 10 files changed, 25 insertions(+), 5 deletions(-)
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH 1/5 net/i40e: fix RX data buffer size

No matter what the mbuf size is, the data buffer size should not be greater than 16K - 128.

Fixes 4861cde46116 ("i40e: new poll mode driver")
---
 drivers/net/i40e/i40e_rxtx.c | 2 ++
 drivers/net/i40e/i40e_rxtx.h | 3 +++
 2 files changed, 5 insertions(+)
drivers/net/i40e/i40e_rxtx.c +2 -0
index 788ffb51c2..fbbefb5015 100644
@@ -2904,6 +2904,8 @@ i40e_rx_queue_config(struct i40e_rx_queue *rxq)
 		rxq->rx_hdr_len = 0;
 		rxq->rx_buf_len = RTE_ALIGN_FLOOR(buf_size,
 			(1 << I40E_RXQ_CTX_DBUFF_SHIFT));
+		rxq->rx_buf_len = RTE_MIN(rxq->rx_buf_len,
+					  I40E_RX_MAX_DATA_BUF_SIZE);
 		rxq->hs_mode = i40e_header_split_none;
 		break;
 	}
drivers/net/i40e/i40e_rxtx.h +3 -0
index 5e6eecc501..0376c219be 100644
@@ -21,6 +21,9 @@
 /* In none-PXE mode QLEN must be whole number of 32 descriptors. */
 #define	I40E_ALIGN_RING_DESC	32
 
+/* Max data buffer size must be 16K - 128 bytes */
+#define I40E_RX_MAX_DATA_BUF_SIZE	(16 * 1024 - 128)
+
 #define	I40E_MIN_RING_DESC	64
 #define	I40E_MAX_RING_DESC	4096
 
Signature · 1 line
2.34.1
author
#2 lore raw

PATCH 2/5 net/ice: fix RX data buffer size

In reply to Wenjun Wu

This patch does two fixes.

1. No matter what the mbuf size is, 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")
---
 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(-)
drivers/net/ice/ice_dcf_ethdev.c +2 -1
index dcbf2af5b0..7304ea721c 100644
@@ -115,7 +115,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(ICE_SUPPORT_CHAIN_NUM * rxq->rx_buf_len,
 			      dev->data->mtu + ICE_ETH_OVERHEAD);
 
drivers/net/ice/ice_rxtx.c +2 -1
index 0ea0045836..560c1a4af7 100644
@@ -259,7 +259,8 @@ ice_program_hw_rx_queue(struct ice_rx_queue *rxq)
 	/* Set buffer size as the head split is disabled. */
 	buf_size = (uint16_t)(rte_pktmbuf_data_room_size(rxq->mp) -
 			      RTE_PKTMBUF_HEADROOM);
-	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,
 			frame_size);
drivers/net/ice/ice_rxtx.h +3 -0
index 94f6bcf3d1..89569029e1 100644
@@ -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)
 
+/* Max data buffer size must be 16K - 128 bytes */
+#define ICE_RX_MAX_DATA_BUF_SIZE	(16 * 1024 - 128)
+
 #define ICE_HEADER_SPLIT_ENA   BIT(0)
 
 typedef void (*ice_rx_release_mbufs_t)(struct ice_rx_queue *rxq);
Signature · 1 line
2.34.1
author
#3 lore raw

PATCH 3/5 net/iavf: fix RX data buffer size

In reply to Wenjun Wu

No matter what the mbuf size is, the data buffer size should not be greater than 16K - 128.

Fixes 69dd4c3d0898 ("net/avf: enable queue and device")
---
 drivers/net/iavf/iavf_rxtx.c | 1 +
 drivers/net/iavf/iavf_rxtx.h | 3 +++
 2 files changed, 4 insertions(+)
drivers/net/iavf/iavf_rxtx.c +1 -0
index b1d0fbceb6..0db3aabd92 100644
@@ -697,6 +697,7 @@ iavf_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 
 	len = rte_pktmbuf_data_room_size(rxq->mp) - RTE_PKTMBUF_HEADROOM;
 	rxq->rx_buf_len = RTE_ALIGN_FLOOR(len, (1 << IAVF_RXQ_CTX_DBUFF_SHIFT));
+	rxq->rx_buf_len = RTE_MIN(rxq->rx_buf_len, IAVF_RX_MAX_DATA_BUF_SIZE);
 
 	/* Allocate the software ring. */
 	len = nb_desc + IAVF_RX_MAX_BURST;
drivers/net/iavf/iavf_rxtx.h +3 -0
index 09e2127db0..f205a2aaf1 100644
@@ -16,6 +16,9 @@
 /* used for Rx Bulk Allocate */
 #define IAVF_RX_MAX_BURST         32
 
+/* Max data buffer size must be 16K - 128 bytes */
+#define IAVF_RX_MAX_DATA_BUF_SIZE (16 * 1024 - 128)
+
 /* used for Vector PMD */
 #define IAVF_VPMD_RX_MAX_BURST    32
 #define IAVF_VPMD_TX_MAX_BURST    32
Signature · 1 line
2.34.1
author
#4 lore raw

PATCH 4/5 net/idpf: fix RX data buffer size

In reply to Wenjun Wu

This patch does two fixes.

1. No matter what the mbuf size is, 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")
---
 drivers/common/idpf/idpf_common_rxtx.h | 3 +++
 drivers/net/idpf/idpf_rxtx.c           | 6 ++++--
 2 files changed, 7 insertions(+), 2 deletions(-)
drivers/common/idpf/idpf_common_rxtx.h +3 -0
index 11260d07f9..6cb83fc0a6 100644
@@ -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 |		\
drivers/net/idpf/idpf_rxtx.c +4 -2
index 414f9a37f6..3e3d81ca6d 100644
@@ -155,7 +155,8 @@ idpf_rx_split_bufq_setup(struct rte_eth_dev *dev, struct idpf_rx_queue *rxq,
 	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 a little more to support bulk allocate. */
 	len = nb_desc + IDPF_RX_MAX_BURST;
@@ -275,7 +276,8 @@ idpf_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 	rxq->offloads = idpf_rx_offload_convert(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);
 
 	/* Allocate a little more to support bulk allocate. */
 	len = nb_desc + IDPF_RX_MAX_BURST;
Signature · 1 line
2.34.1
author
#5 lore raw

PATCH 5/5 net/cpfl: fix RX data buffer size

In reply to Wenjun Wu

This patch does two fixes.

1. No matter what the mbuf size is, the data buffer size should not be greater than 16K - 128.

2. Align data buffer size to 128.

---
 drivers/net/cpfl/cpfl_rxtx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/cpfl/cpfl_rxtx.c +2 -1
index de59b31b3d..75021c3c54 100644
@@ -155,7 +155,8 @@ cpfl_rx_split_bufq_setup(struct rte_eth_dev *dev, struct idpf_rx_queue *rxq,
 	bufq->adapter = base;
 
 	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 a little more to support bulk allocate. */
 	len = nb_desc + IDPF_RX_MAX_BURST;
Signature · 1 line
2.34.1
author
#6 lore raw

v2 cover fix Rx data buffer size

In reply to Wenjun Wu

This patch set fixes RX data buffer size in ice, i40e, iavf and idpf driver.

1. Limit the maximum buffer size to no more than 16K - 128.
2. Align max buffer size to 128, or replace RTE_ALIGN with RTE_ALIGN_FLOOR according to [1].

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

---
v2: fix commit log

Wenjun Wu (5):
net/i40e: fix Rx data buffer size
net/ice: fix Rx data buffer size
net/iavf: fix Rx data buffer size
net/idpf: fix Rx data buffer size
net/cpfl: fix Rx data buffer size

 drivers/common/idpf/idpf_common_rxtx.h | 3 +++
 drivers/net/cpfl/cpfl_rxtx.c           | 3 ++-
 drivers/net/i40e/i40e_rxtx.c           | 2 ++
 drivers/net/i40e/i40e_rxtx.h           | 3 +++
 drivers/net/iavf/iavf_rxtx.c           | 1 +
 drivers/net/iavf/iavf_rxtx.h           | 3 +++
 drivers/net/ice/ice_dcf_ethdev.c       | 3 ++-
 drivers/net/ice/ice_rxtx.c             | 3 ++-
 drivers/net/ice/ice_rxtx.h             | 3 +++
 drivers/net/idpf/idpf_rxtx.c           | 6 ++++--
 10 files changed, 25 insertions(+), 5 deletions(-)
Signature · 1 line
2.34.1
author
#7 lore raw

PATCH v2 1/5 net/i40e: fix Rx data buffer size

No matter what the mbuf size is, the data buffer size should not be greater than 16K - 128.

Fixes 4861cde46116 ("i40e: new poll mode driver")
---
 drivers/net/i40e/i40e_rxtx.c | 2 ++
 drivers/net/i40e/i40e_rxtx.h | 3 +++
 2 files changed, 5 insertions(+)
drivers/net/i40e/i40e_rxtx.c +2 -0
index 788ffb51c2..fbbefb5015 100644
@@ -2904,6 +2904,8 @@ i40e_rx_queue_config(struct i40e_rx_queue *rxq)
 		rxq->rx_hdr_len = 0;
 		rxq->rx_buf_len = RTE_ALIGN_FLOOR(buf_size,
 			(1 << I40E_RXQ_CTX_DBUFF_SHIFT));
+		rxq->rx_buf_len = RTE_MIN(rxq->rx_buf_len,
+					  I40E_RX_MAX_DATA_BUF_SIZE);
 		rxq->hs_mode = i40e_header_split_none;
 		break;
 	}
drivers/net/i40e/i40e_rxtx.h +3 -0
index 5e6eecc501..0376c219be 100644
@@ -21,6 +21,9 @@
 /* In none-PXE mode QLEN must be whole number of 32 descriptors. */
 #define	I40E_ALIGN_RING_DESC	32
 
+/* Max data buffer size must be 16K - 128 bytes */
+#define I40E_RX_MAX_DATA_BUF_SIZE	(16 * 1024 - 128)
+
 #define	I40E_MIN_RING_DESC	64
 #define	I40E_MAX_RING_DESC	4096
 
Signature · 1 line
2.34.1
author
#8 lore raw

PATCH v2 2/5 net/ice: fix Rx data buffer size

In reply to Wenjun Wu

This patch does two fixes.

1. No matter what the mbuf size is, 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")
---
 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(-)
drivers/net/ice/ice_dcf_ethdev.c +2 -1
index dcbf2af5b0..7304ea721c 100644
@@ -115,7 +115,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(ICE_SUPPORT_CHAIN_NUM * rxq->rx_buf_len,
 			      dev->data->mtu + ICE_ETH_OVERHEAD);
 
drivers/net/ice/ice_rxtx.c +2 -1
index 0ea0045836..560c1a4af7 100644
@@ -259,7 +259,8 @@ ice_program_hw_rx_queue(struct ice_rx_queue *rxq)
 	/* Set buffer size as the head split is disabled. */
 	buf_size = (uint16_t)(rte_pktmbuf_data_room_size(rxq->mp) -
 			      RTE_PKTMBUF_HEADROOM);
-	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,
 			frame_size);
drivers/net/ice/ice_rxtx.h +3 -0
index 94f6bcf3d1..89569029e1 100644
@@ -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)
 
+/* Max data buffer size must be 16K - 128 bytes */
+#define ICE_RX_MAX_DATA_BUF_SIZE	(16 * 1024 - 128)
+
 #define ICE_HEADER_SPLIT_ENA   BIT(0)
 
 typedef void (*ice_rx_release_mbufs_t)(struct ice_rx_queue *rxq);
Signature · 1 line
2.34.1
author
#9 lore raw

PATCH v2 3/5 net/iavf: fix Rx data buffer size

In reply to Wenjun Wu

No matter what the mbuf size is, the data buffer size should not be greater than 16K - 128.

Fixes 69dd4c3d0898 ("net/avf: enable queue and device")
---
 drivers/net/iavf/iavf_rxtx.c | 1 +
 drivers/net/iavf/iavf_rxtx.h | 3 +++
 2 files changed, 4 insertions(+)
drivers/net/iavf/iavf_rxtx.c +1 -0
index b1d0fbceb6..0db3aabd92 100644
@@ -697,6 +697,7 @@ iavf_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 
 	len = rte_pktmbuf_data_room_size(rxq->mp) - RTE_PKTMBUF_HEADROOM;
 	rxq->rx_buf_len = RTE_ALIGN_FLOOR(len, (1 << IAVF_RXQ_CTX_DBUFF_SHIFT));
+	rxq->rx_buf_len = RTE_MIN(rxq->rx_buf_len, IAVF_RX_MAX_DATA_BUF_SIZE);
 
 	/* Allocate the software ring. */
 	len = nb_desc + IAVF_RX_MAX_BURST;
drivers/net/iavf/iavf_rxtx.h +3 -0
index 09e2127db0..f205a2aaf1 100644
@@ -16,6 +16,9 @@
 /* used for Rx Bulk Allocate */
 #define IAVF_RX_MAX_BURST         32
 
+/* Max data buffer size must be 16K - 128 bytes */
+#define IAVF_RX_MAX_DATA_BUF_SIZE (16 * 1024 - 128)
+
 /* used for Vector PMD */
 #define IAVF_VPMD_RX_MAX_BURST    32
 #define IAVF_VPMD_TX_MAX_BURST    32
Signature · 1 line
2.34.1
author
#10 lore raw

PATCH v2 4/5 net/idpf: fix Rx data buffer size

In reply to Wenjun Wu

This patch does two fixes.

1. No matter what the mbuf size is, 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")
---
 drivers/common/idpf/idpf_common_rxtx.h | 3 +++
 drivers/net/idpf/idpf_rxtx.c           | 6 ++++--
 2 files changed, 7 insertions(+), 2 deletions(-)
drivers/common/idpf/idpf_common_rxtx.h +3 -0
index 11260d07f9..6cb83fc0a6 100644
@@ -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 |		\
drivers/net/idpf/idpf_rxtx.c +4 -2
index 414f9a37f6..3e3d81ca6d 100644
@@ -155,7 +155,8 @@ idpf_rx_split_bufq_setup(struct rte_eth_dev *dev, struct idpf_rx_queue *rxq,
 	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 a little more to support bulk allocate. */
 	len = nb_desc + IDPF_RX_MAX_BURST;
@@ -275,7 +276,8 @@ idpf_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 	rxq->offloads = idpf_rx_offload_convert(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);
 
 	/* Allocate a little more to support bulk allocate. */
 	len = nb_desc + IDPF_RX_MAX_BURST;
Signature · 1 line
2.34.1
author
#11 lore raw

PATCH v2 5/5 net/cpfl: fix Rx data buffer size

In reply to Wenjun Wu

This patch does two fixes.

1. No matter what the mbuf size is, the data buffer size should not be greater than 16K - 128.

2. Align data buffer size to 128.

Fixes 119834846e93 ("net/cpfl: support Rx queue setup")
---
 drivers/net/cpfl/cpfl_rxtx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/cpfl/cpfl_rxtx.c +2 -1
index de59b31b3d..75021c3c54 100644
@@ -155,7 +155,8 @@ cpfl_rx_split_bufq_setup(struct rte_eth_dev *dev, struct idpf_rx_queue *rxq,
 	bufq->adapter = base;
 
 	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 a little more to support bulk allocate. */
 	len = nb_desc + IDPF_RX_MAX_BURST;
Signature · 1 line
2.34.1
Acked-by on the v2 series Applied
#12 lore raw

RE: [PATCH v2 0/5] fix Rx data buffer size

In reply to Wenjun Wu
Quoted 11 lines

-----Original Message-----
From: Wu, Wenjun1 <[email protected]>
Sent: Friday, April 14, 2023 1:48 PM
To: [email protected]; Zhang, Yuying <[email protected]>; Xing, Beilei <[email protected]>; Wu, Jingjing <[email protected]>; Yang, Qiming <[email protected]>; Zhang, Qi Z <[email protected]>
Cc: Wu, Wenjun1 <[email protected]>
Subject: [PATCH v2 0/5] fix Rx data buffer size

Quoted 3 lines

This patch set fixes RX data buffer size in ice, i40e, iavf and idpf driver.

1. Limit the maximum buffer size to no more than 16K - 128.

Confirmed with author, this target to align with hardware spec, added related explanation in commit log.

Quoted 27 lines

2. Align max buffer size to 128, or replace RTE_ALIGN with RTE_ALIGN_FLOOR according to [1].

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

---
v2: fix commit log

Wenjun Wu (5):
net/i40e: fix Rx data buffer size
net/ice: fix Rx data buffer size
net/iavf: fix Rx data buffer size
net/idpf: fix Rx data buffer size
net/cpfl: fix Rx data buffer size

 drivers/common/idpf/idpf_common_rxtx.h | 3 +++
 drivers/net/cpfl/cpfl_rxtx.c           | 3 ++-
 drivers/net/i40e/i40e_rxtx.c           | 2 ++
 drivers/net/i40e/i40e_rxtx.h           | 3 +++
 drivers/net/iavf/iavf_rxtx.c           | 1 +
 drivers/net/iavf/iavf_rxtx.h           | 3 +++
 drivers/net/ice/ice_dcf_ethdev.c       | 3 ++-
 drivers/net/ice/ice_rxtx.c             | 3 ++-
 drivers/net/ice/ice_rxtx.h             | 3 +++
 drivers/net/idpf/idpf_rxtx.c           | 6 ++++--
 10 files changed, 25 insertions(+), 5 deletions(-)
Quoted 2 lines

--
2.34.1

Applied to dpdk-next-net-intel.

Thanks
Qi