Skip to contentSkip to conversation

net/ionic: fix Tx fragment limits

PATCH Applied Andrew Boyer 2 participants 2 messages Feb 4, 2021 – Feb 5, 2021 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/ionic: fix Tx fragment limits

The reported nb_seg_max should include the main fragment in the descriptor and the fragments in the accompanying SGL.

Update the Tx prep check as well.

These were missed when updating to the v1 Tx queue structures.

Fixes 786c64763b50 ("net/ionic: clean up Tx queue version support")
---
 drivers/net/ionic/ionic_ethdev.c | 4 ++--
 drivers/net/ionic/ionic_rxtx.c   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/ionic/ionic_ethdev.c +2 -2
index c9d8493f49..cffe899c07 100644
@@ -74,8 +74,8 @@ static const struct rte_eth_desc_lim tx_desc_lim_v1 = {
 	.nb_max = IONIC_MAX_RING_DESC,
 	.nb_min = IONIC_MIN_RING_DESC,
 	.nb_align = 1,
-	.nb_seg_max = IONIC_TX_MAX_SG_ELEMS_V1,
-	.nb_mtu_seg_max = IONIC_TX_MAX_SG_ELEMS_V1,
+	.nb_seg_max = IONIC_TX_MAX_SG_ELEMS_V1 + 1,
+	.nb_mtu_seg_max = IONIC_TX_MAX_SG_ELEMS_V1 + 1,
 };
 
 static const struct eth_dev_ops ionic_eth_dev_ops = {
drivers/net/ionic/ionic_rxtx.c +1 -1
index 5ae9ecf400..99920109eb 100644
@@ -596,7 +596,7 @@ ionic_prep_pkts(void *tx_queue __rte_unused, struct rte_mbuf **tx_pkts,
 	for (i = 0; i < nb_pkts; i++) {
 		txm = tx_pkts[i];
 
-		if (txm->nb_segs > IONIC_TX_MAX_SG_ELEMS) {
+		if (txm->nb_segs > IONIC_TX_MAX_SG_ELEMS_V1 + 1) {
 			rte_errno = -EINVAL;
 			break;
 		}
Signature · 1 line
2.17.1
Applied
#1 lore raw
Quoted 9 lines · Andrew Boyer

The reported nb_seg_max should include the main fragment in the descriptor and the fragments in the accompanying SGL.

Update the Tx prep check as well.

These were missed when updating to the v1 Tx queue structures.

Fixes 786c64763b50 ("net/ionic: clean up Tx queue version support" >

Applied to dpdk-next-net/main, thanks.