From: Qi Zhang <qi.z.zhang@intel.com>
To: qiming.yang@intel.com
Cc: dev@dpdk.org, Qi Zhang <qi.z.zhang@intel.com>, stable@dpdk.org
Subject: [PATCH v2] net/ice: fix data length check
Date: Tue, 23 May 2023 06:35:09 -0400 [thread overview]
Message-ID: <20230523103509.2918185-1-qi.z.zhang@intel.com> (raw)
In-Reply-To: <20230522181447.2747713-1-qi.z.zhang@intel.com>
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>
---
v2:
- fix build warning
drivers/net/ice/ice_rxtx.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index 560c1a4af7..cd0e61c85f 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -3669,9 +3669,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];
@@ -3690,7 +3687,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
next prev parent reply other threads:[~2023-05-23 2:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-22 18:14 [PATCH] " Qi Zhang
2023-05-23 10:35 ` Qi Zhang [this message]
2023-06-09 1:50 ` [PATCH v2] " Zhang, Qi Z
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230523103509.2918185-1-qi.z.zhang@intel.com \
--to=qi.z.zhang@intel.com \
--cc=dev@dpdk.org \
--cc=qiming.yang@intel.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).