[dpdk-stable] patch 'net/ixgbe: check for illegal Tx packets' has been queued to LTS release 18.11.7

Kevin Traynor ktraynor at redhat.com
Thu Feb 27 18:37:56 CET 2020


Hi,

FYI, your patch has been queued to LTS release 18.11.7

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/02/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/0b6691a41938f8844575f9426ad8b69f39bbfaad

Thanks.

Kevin.

---
>From 0b6691a41938f8844575f9426ad8b69f39bbfaad Mon Sep 17 00:00:00 2001
From: Xiao Zhang <xiao.zhang at intel.com>
Date: Mon, 17 Feb 2020 22:51:15 +0800
Subject: [PATCH] net/ixgbe: check for illegal Tx packets

[ upstream commit fc6f59a0d61b3a27b04bf0603c3fc62afb2fa49a ]

For ixgbe, there is restriction that data buffers of any transmitted
packet must include at least 12 bytes of the src/dst Ethernet MAC
addresses as well as 2 bytes of the Type/Len field, otherwise, tx hang
would happen.

This patch adds check for those illegal packets and protects TX from
hanging.

Fixes: 7829b8d52be0 ("net/ixgbe: add Tx preparation")

Signed-off-by: Xiao Zhang <xiao.zhang at intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev at intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye at intel.com>
---
 drivers/net/ixgbe/ixgbe_rxtx.c | 6 ++++++
 drivers/net/ixgbe/ixgbe_rxtx.h | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 7f98db15a4..08a79a0ea9 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -986,4 +986,10 @@ ixgbe_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 		}
 
+		/* check the size of packet */
+		if (m->pkt_len < IXGBE_TX_MIN_PKT_LEN) {
+			rte_errno = EINVAL;
+			return i;
+		}
+
 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
 		ret = rte_validate_tx_offload(m);
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.h b/drivers/net/ixgbe/ixgbe_rxtx.h
index 39378f7547..7ae16967c6 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.h
+++ b/drivers/net/ixgbe/ixgbe_rxtx.h
@@ -54,4 +54,6 @@
 #define IXGBE_TX_MAX_SEG                    40
 
+#define IXGBE_TX_MIN_PKT_LEN		     14
+
 #define IXGBE_PACKET_TYPE_MASK_82599        0X7F
 #define IXGBE_PACKET_TYPE_MASK_X550         0X10FF
-- 
2.21.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-02-27 17:26:23.961231347 +0000
+++ 0005-net-ixgbe-check-for-illegal-Tx-packets.patch	2020-02-27 17:26:23.625831617 +0000
@@ -1 +1 @@
-From fc6f59a0d61b3a27b04bf0603c3fc62afb2fa49a Mon Sep 17 00:00:00 2001
+From 0b6691a41938f8844575f9426ad8b69f39bbfaad Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit fc6f59a0d61b3a27b04bf0603c3fc62afb2fa49a ]
+
@@ -15 +16,0 @@
-Cc: stable at dpdk.org
@@ -26 +27 @@
-index 7b398f1a1b..f839bcaab7 100644
+index 7f98db15a4..08a79a0ea9 100644
@@ -29 +30 @@
-@@ -987,4 +987,10 @@ ixgbe_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
+@@ -986,4 +986,10 @@ ixgbe_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
@@ -41 +42 @@
-index 000c5b1194..20a8b291d4 100644
+index 39378f7547..7ae16967c6 100644



More information about the stable mailing list