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

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Feb 27 10:33:28 CET 2020


Hi,

FYI, your patch has been queued to stable release 19.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/29/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.

Thanks.

Luca Boccassi

---
>From dc50bc8425ce7964f6ac61a0396cb2d716243786 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 91f5fe1517..a7b24cd053 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -988,6 +988,12 @@ ixgbe_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 			return i;
 		}
 
+		/* 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);
 		if (ret != 0) {
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.h b/drivers/net/ixgbe/ixgbe_rxtx.h
index 505d344b9c..5e1ac44942 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.h
+++ b/drivers/net/ixgbe/ixgbe_rxtx.h
@@ -53,6 +53,8 @@
 
 #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
 #define IXGBE_PACKET_TYPE_MASK_TUNNEL       0XFF
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-02-27 09:31:56.107195811 +0000
+++ 0008-net-ixgbe-check-for-illegal-Tx-packets.patch	2020-02-27 09:31:55.667945376 +0000
@@ -1,8 +1,10 @@
-From fc6f59a0d61b3a27b04bf0603c3fc62afb2fa49a Mon Sep 17 00:00:00 2001
+From dc50bc8425ce7964f6ac61a0396cb2d716243786 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
@@ -12,7 +14,6 @@
 hanging.
 
 Fixes: 7829b8d52be0 ("net/ixgbe: add Tx preparation")
-Cc: stable at dpdk.org
 
 Signed-off-by: Xiao Zhang <xiao.zhang at intel.com>
 Acked-by: Konstantin Ananyev <konstantin.ananyev at intel.com>
@@ -23,10 +24,10 @@
  2 files changed, 8 insertions(+)
 
 diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
-index 7b398f1a1b..f839bcaab7 100644
+index 91f5fe1517..a7b24cd053 100644
 --- a/drivers/net/ixgbe/ixgbe_rxtx.c
 +++ b/drivers/net/ixgbe/ixgbe_rxtx.c
-@@ -986,6 +986,12 @@ ixgbe_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
+@@ -988,6 +988,12 @@ ixgbe_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
  			return i;
  		}
  
@@ -40,7 +41,7 @@
  		ret = rte_validate_tx_offload(m);
  		if (ret != 0) {
 diff --git a/drivers/net/ixgbe/ixgbe_rxtx.h b/drivers/net/ixgbe/ixgbe_rxtx.h
-index 000c5b1194..20a8b291d4 100644
+index 505d344b9c..5e1ac44942 100644
 --- a/drivers/net/ixgbe/ixgbe_rxtx.h
 +++ b/drivers/net/ixgbe/ixgbe_rxtx.h
 @@ -53,6 +53,8 @@


More information about the stable mailing list