patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] net/ice: fix data length check
@ 2023-05-22 18:14 Qi Zhang
  2023-05-23 10:35 ` [PATCH v2] " Qi Zhang
  0 siblings, 1 reply; 3+ messages in thread
From: Qi Zhang @ 2023-05-22 18:14 UTC (permalink / raw)
  To: qiming.yang; +Cc: dev, Qi Zhang, stable

In TSO, It is possible mbuf->data_len exceed mtu.
Fixed the incorrect data length check in ice_prep_pkts.

Fixes: ccf33dccf7aa ("net/ice: check illegal packet sizes")
Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ice/ice_rxtx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index 560c1a4af7..f4a4f43636 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -3671,7 +3671,6 @@ ice_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 	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];
@@ -3690,7 +3689,7 @@ ice_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 
 		/* check the data_len in mbuf */
 		if (m->data_len < ICE_TX_MIN_PKT_LEN ||
-			m->data_len > max_frame_size) {
+			m->data_len > ICE_FRAME_SIZE_MAX) {
 			rte_errno = EINVAL;
 			PMD_DRV_LOG(ERR, "INVALID mbuf: bad data_len=[%hu]", m->data_len);
 			return i;
-- 
2.31.1


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

end of thread, other threads:[~2023-06-09  1:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-22 18:14 [PATCH] net/ice: fix data length check Qi Zhang
2023-05-23 10:35 ` [PATCH v2] " Qi Zhang
2023-06-09  1:50   ` 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).