From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1F57BA0350 for ; Mon, 21 Feb 2022 16:42:38 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1A4D940E5A; Mon, 21 Feb 2022 16:42:38 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 87EC9410F0 for ; Mon, 21 Feb 2022 16:42:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645458155; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IlZp+2qiGXtnm7eGhWW/Smr7OUlSLcAFdoGDiatHwwA=; b=Z3BfOexyKJqgJ0B+z1jhH42uaJC5n9yQI3QYNBt3MzzAgt/vrSBCeqVkYam1dcg/0dJaao tuqmSrss7MiYDqLKe7n7sGYfW/IEzs1aN8suEBUyOT1EHiCPFtJznTfsizFPMXrXK8mDin gEqErj2WkU2zygTQuWXNwYbIwKpl7Vs= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-615-kuKAwUiFMrWfhorVCW5rng-1; Mon, 21 Feb 2022 10:42:32 -0500 X-MC-Unique: kuKAwUiFMrWfhorVCW5rng-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EA0E31091DA1; Mon, 21 Feb 2022 15:42:30 +0000 (UTC) Received: from rh.Home (unknown [10.39.195.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id F2ACC7E131; Mon, 21 Feb 2022 15:42:29 +0000 (UTC) From: Kevin Traynor To: Yuying Zhang Cc: Qi Zhang , dpdk stable Subject: patch 'net/ice/base: add profile validation on switch filter' has been queued to stable release 21.11.1 Date: Mon, 21 Feb 2022 15:35:57 +0000 Message-Id: <20220221153625.152324-168-ktraynor@redhat.com> In-Reply-To: <20220221153625.152324-1-ktraynor@redhat.com> References: <20220221153625.152324-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org 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 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 Acked-by: Qi Zhang --- 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@dpdk.org