patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH 1/2] net/iavf: fix TSO with big segments
@ 2023-09-19 14:04 David Marchand
  2023-09-19 14:04 ` [PATCH 2/2] net/ice: " David Marchand
  2023-09-27  9:41 ` [PATCH v2 1/4] net/iavf: remove log from Tx prepare datapath function David Marchand
  0 siblings, 2 replies; 12+ messages in thread
From: David Marchand @ 2023-09-19 14:04 UTC (permalink / raw)
  To: dev
  Cc: ktraynor, mkp, dexia.li, stable, Jingjing Wu, Beilei Xing,
	Kevin Liu, Qi Zhang

Packets to be segmented with TSO are usually larger than MTU.
Plus, a single segment for the whole packet may be used: in OVS case,
an external rte_malloc'd buffer is used for packets received
from vhost-user ports.

Before this fix, TSO packets were dropped by net/iavf with the following
message:
2023-09-18T14:08:52.739Z|00610|dpdk(pmd-c31/id:11)|ERR|iavf_prep_pkts():
	INVALID mbuf: bad data_len=[2962]

Remove the check on data_len.

Besides, logging an error level message in a datapath function may
slow down the whole application. It is better not to log anything.

Fixes: 19ee91c6bd9a ("net/iavf: check illegal packet sizes")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 drivers/net/iavf/iavf_rxtx.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index f7df4665d1..0396099708 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -3611,7 +3611,6 @@ iavf_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 	struct rte_mbuf *m;
 	struct iavf_tx_queue *txq = tx_queue;
 	struct rte_eth_dev *dev = &rte_eth_devices[txq->port_id];
-	uint16_t max_frame_size = dev->data->mtu + IAVF_ETH_OVERHEAD;
 	struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 	struct iavf_adapter *adapter = IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
 
@@ -3640,11 +3639,8 @@ iavf_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-		/* check the data_len in mbuf */
-		if (m->data_len < IAVF_TX_MIN_PKT_LEN ||
-			m->data_len > max_frame_size) {
+		if (m->pkt_len < IAVF_TX_MIN_PKT_LEN) {
 			rte_errno = EINVAL;
-			PMD_DRV_LOG(ERR, "INVALID mbuf: bad data_len=[%hu]", m->data_len);
 			return i;
 		}
 
-- 
2.41.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-09-27 12:36 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-19 14:04 [PATCH 1/2] net/iavf: fix TSO with big segments David Marchand
2023-09-19 14:04 ` [PATCH 2/2] net/ice: " David Marchand
2023-09-21  5:48   ` Zhang, Qi Z
2023-09-21  5:55     ` David Marchand
2023-09-21 10:42       ` Zhang, Qi Z
2023-09-25 10:30         ` David Marchand
2023-09-27  4:05           ` Zhang, Qi Z
2023-09-27  9:41 ` [PATCH v2 1/4] net/iavf: remove log from Tx prepare datapath function David Marchand
2023-09-27  9:41   ` [PATCH v2 2/4] net/iavf: fix TSO with big segments David Marchand
2023-09-27  9:41   ` [PATCH v2 3/4] net/ice: remove log from Tx prepare datapath function David Marchand
2023-09-27  9:41   ` [PATCH v2 4/4] net/ice: fix TSO with big segments David Marchand
2023-09-27 12:36     ` Zhang, Qi Z

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).