patch 'net/ice/base: add profile validation on switch filter' has been queued to stable release 21.11.1

Kevin Traynor ktraynor at redhat.com
Mon Feb 21 16:35:57 CET 2022


Hi,

FYI, your patch has been queued to stable release 21.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/26/22. 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

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

Thanks.

Kevin

---
>From d422a9cdae995635b9d8a826d08d6e12f5ecd30e Mon Sep 17 00:00:00 2001
From: Yuying Zhang <yuying.zhang at intel.com>
Date: Wed, 26 Jan 2022 15:57:09 +0000
Subject: [PATCH] net/ice/base: add profile validation on switch filter

[ upstream commit a62f095049900b8148a739ad0a86fbfc32429326 ]

Profile type was determined without validation when getting
switch field vector bitmap. It caused error when associating
profile id with given recipe if no lookup elements were given.
Add profile validation to check if the profile is existing
before getting bitmap.

Fixes: 55744222e6e2 ("net/ice/base: associate recipes by profile type")

Signed-off-by: Yuying Zhang <yuying.zhang at intel.com>
Acked-by: Qi Zhang <qi.z.zhang at intel.com>
---
 drivers/net/ice/base/ice_flex_pipe.c     | 11 +++++------
 drivers/net/ice/base/ice_flex_type.h     |  1 +
 drivers/net/ice/base/ice_protocol_type.h |  1 +
 drivers/net/ice/base/ice_switch.c        |  1 +
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ice/base/ice_flex_pipe.c b/drivers/net/ice/base/ice_flex_pipe.c
index 395787806b..f6a29f87c5 100644
--- a/drivers/net/ice/base/ice_flex_pipe.c
+++ b/drivers/net/ice/base/ice_flex_pipe.c
@@ -1786,6 +1786,10 @@ ice_get_sw_prof_type(struct ice_hw *hw, struct ice_fv *fv)
 {
 	u16 i;
+	bool valid_prof = false;
 
 	for (i = 0; i < hw->blk[ICE_BLK_SW].es.fvw; i++) {
+		if (fv->ew[i].off != ICE_NAN_OFFSET)
+			valid_prof = true;
+
 		/* UDP tunnel will have UDP_OF protocol ID and VNI offset */
 		if (fv->ew[i].prot_id == (u8)ICE_PROT_UDP_OF &&
@@ -1802,5 +1806,5 @@ ice_get_sw_prof_type(struct ice_hw *hw, struct ice_fv *fv)
 	}
 
-	return ICE_PROF_NON_TUN;
+	return valid_prof ? ICE_PROF_NON_TUN : ICE_PROF_INVALID;
 }
 
@@ -1819,9 +1823,4 @@ ice_get_sw_fv_bitmap(struct ice_hw *hw, enum ice_prof_type req_profs,
 	struct ice_fv *fv;
 
-	if (req_profs == ICE_PROF_ALL) {
-		ice_bitmap_set(bm, 0, ICE_MAX_NUM_PROFILES);
-		return;
-	}
-
 	ice_memset(&state, 0, sizeof(state), ICE_NONDMA_MEM);
 	ice_zero_bitmap(bm, ICE_MAX_NUM_PROFILES);
diff --git a/drivers/net/ice/base/ice_flex_type.h b/drivers/net/ice/base/ice_flex_type.h
index 59eeca0a30..09a02fe9ac 100644
--- a/drivers/net/ice/base/ice_flex_type.h
+++ b/drivers/net/ice/base/ice_flex_type.h
@@ -1004,4 +1004,5 @@ struct ice_chs_chg {
 
 enum ice_prof_type {
+	ICE_PROF_INVALID = 0x0,
 	ICE_PROF_NON_TUN = 0x1,
 	ICE_PROF_TUN_UDP = 0x2,
diff --git a/drivers/net/ice/base/ice_protocol_type.h b/drivers/net/ice/base/ice_protocol_type.h
index cef8354f77..0e6e5990be 100644
--- a/drivers/net/ice/base/ice_protocol_type.h
+++ b/drivers/net/ice/base/ice_protocol_type.h
@@ -192,4 +192,5 @@ enum ice_prot_id {
 #define ICE_VNI_OFFSET		12 /* offset of VNI from ICE_PROT_UDP_OF */
 
+#define ICE_NAN_OFFSET		511
 #define ICE_MAC_OFOS_HW		1
 #define ICE_MAC_IL_HW		4
diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c
index 1fee790c25..d4cc664ad7 100644
--- a/drivers/net/ice/base/ice_switch.c
+++ b/drivers/net/ice/base/ice_switch.c
@@ -7780,4 +7780,5 @@ bool ice_is_prof_rule(enum ice_sw_tunnel_type type)
 {
 	switch (type) {
+	case ICE_SW_TUN_AND_NON_TUN:
 	case ICE_SW_TUN_PROFID_IPV6_ESP:
 	case ICE_SW_TUN_PROFID_IPV6_AH:
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-21 15:22:48.181130904 +0000
+++ 0168-net-ice-base-add-profile-validation-on-switch-filter.patch	2022-02-21 15:22:44.329704662 +0000
@@ -1 +1 @@
-From a62f095049900b8148a739ad0a86fbfc32429326 Mon Sep 17 00:00:00 2001
+From d422a9cdae995635b9d8a826d08d6e12f5ecd30e Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a62f095049900b8148a739ad0a86fbfc32429326 ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org



More information about the stable mailing list