[v2,2/4] net/iavf: fix TSO with big segments

Message ID 20230927094148.1129330-2-david.marchand@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers
Series [v2,1/4] net/iavf: remove log from Tx prepare datapath function |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

David Marchand Sept. 27, 2023, 9:41 a.m. UTC
  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.

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

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
Changes since v1:
- moved log removal in a separate patch,

---
 drivers/net/iavf/iavf_rxtx.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
  

Patch

diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index 21a06b8351..c6ef6af1d8 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -3636,7 +3636,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);
 
@@ -3665,9 +3664,7 @@  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;
 			return i;
 		}