Skip to content

Commit

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

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/ice with the following
message:
2023-09-18T13:34:31.064Z|00020|dpdk(pmd-c31/id:22)|ERR|ice_prep_pkts():
	INVALID mbuf: bad data_len=[2962]

Remove the check on data_len.

Fixes: ccf33dc ("net/ice: 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 kevintraynor committed Oct 31, 2023
1 parent d4041c9 commit 1b21ab3
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions drivers/net/ice/ice_rxtx.c
Original file line number Diff line number Diff line change
Expand Up @@ -3490,9 +3490,6 @@ ice_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
int i, ret;
uint64_t ol_flags;
struct rte_mbuf *m;
struct ice_tx_queue *txq = tx_queue;
struct rte_eth_dev *dev = &rte_eth_devices[txq->port_id];
uint16_t max_frame_size = dev->data->mtu + ICE_ETH_OVERHEAD;

for (i = 0; i < nb_pkts; i++) {
m = tx_pkts[i];
Expand All @@ -3509,9 +3506,7 @@ ice_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
return i;
}

/* check the data_len in mbuf */
if (m->data_len < ICE_TX_MIN_PKT_LEN ||
m->data_len > max_frame_size) {
if (m->pkt_len < ICE_TX_MIN_PKT_LEN) {
rte_errno = EINVAL;
return i;
}
Expand Down

0 comments on commit 1b21ab3

Please sign in to comment.