Skip to content

Commit

Permalink
net/iavf: fix TSO with big segments
Browse files Browse the repository at this point in the history
[ upstream commit 8a1a5327ba71a19d8a6e1b9ceb5563b4af2c2029 ]

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: 19ee91c ("net/iavf: check illegal packet sizes")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
  • Loading branch information
david-marchand authored and bluca committed Oct 18, 2023
1 parent 5d3142e commit dc9a211
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions drivers/net/iavf/iavf_rxtx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2347,15 +2347,12 @@ iavf_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)

/* TX prep functions */
uint16_t
iavf_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
iavf_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
uint16_t nb_pkts)
{
int i, ret;
uint64_t ol_flags;
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;

for (i = 0; i < nb_pkts; i++) {
m = tx_pkts[i];
Expand All @@ -2379,9 +2376,7 @@ iavf_prep_pkts(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;
}
Expand Down

0 comments on commit dc9a211

Please sign in to comment.