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 C494BA0032 for ; Fri, 18 Feb 2022 13:45:25 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BF4AB4113F; Fri, 18 Feb 2022 13:45:25 +0100 (CET) Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) by mails.dpdk.org (Postfix) with ESMTP id 3895940395 for ; Fri, 18 Feb 2022 13:45:24 +0100 (CET) Received: by mail-ed1-f47.google.com with SMTP id m3so9292362eda.10 for ; Fri, 18 Feb 2022 04:45:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MbqPmz+Q11kpJ5Nu9Zxdq0PuCrxGn0sZkwl6p8xvrMM=; b=drFCq3AVCLERPQjjNqKyxsZDVk0BqdMBFEV+O6FYNko4yRMfUaNu+ohINhh4OlS0NJ zgz0HXFIxxvmPR4bZ9P9q5u1vbJrGynbSyKvU6nXaLIvh88xlBysnX/Nr3kBpmXu32T+ tfqztRTufLvL589sxOoY+eca9X8W7HvrmoQwz769h8PAst+jo2HIM54gFk3eyYvv5vUv BVfq1nGjYhZEY8d4EqLI1DzBuPEwiucCGDWciyb8x68QJeLQ+VcwWDObbtOMmJie1y1X hm+33JjNmgOv7he/s9PVUWSdiE48j8ni+fXq+3zbFUqjrWvqldb2rshQqERdHMbECOe0 v37A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MbqPmz+Q11kpJ5Nu9Zxdq0PuCrxGn0sZkwl6p8xvrMM=; b=4lI3CCTlm+7/xh7IJgcFgiuI3GTbAnZqXw+98hkTNZQX9zXs6Y0x7zl3k5IOj7iDM6 hRKW5ps8Fag+1gpR5e/e3QV099pKEDn+smZGuOjNg0/mPYFXvt0ZiNg4bSBQ1HgAAh2v Om9cMOngQJ5dK4MnxWluMth3sabR8KjEzFajmX3+B1MquWEOOLWn/P2gCo4R2JsUnyTF yRPsxyZj4JsMmEeKJUB3eetr6F36Nlw58vsYSKGg9yhsrpUP9TXim0/PqLDMzSmPjwMW vV80tdhNMEjQQtpvsUu6gycS0F+gfyqXEhKZeNtb+jX37JFqAIEAfkR4HtLiZ+5DW3AA 3c8g== X-Gm-Message-State: AOAM533/SjjwZmHMGHAhjpEbxM7GamvQFCrYC3ubLXjs80TcjGvOsO4/ EdAhHCNOWOIronEzx32TTgkRLOHFIi6loBlJ X-Google-Smtp-Source: ABdhPJzm7YMvHnVGIM/khKCmQQcdWGqbI1e5g8bU1pKrI8DVOWXGSmlYMSPMVHS6USaEbTcVnzOBEw== X-Received: by 2002:a05:6402:358f:b0:410:e245:f665 with SMTP id y15-20020a056402358f00b00410e245f665mr7965404edc.212.1645188323845; Fri, 18 Feb 2022 04:45:23 -0800 (PST) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id u3sm2259408ejz.99.2022.02.18.04.45.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Feb 2022 04:45:23 -0800 (PST) From: luca.boccassi@gmail.com 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 20.11.5 Date: Fri, 18 Feb 2022 12:39:23 +0000 Message-Id: <20220218123931.1749595-114-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220218123931.1749595-1-luca.boccassi@gmail.com> References: <20220218123931.1749595-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 20.11.5 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/20/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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/dc92390efe7d705e91aafebc61c50f8897e171df Thanks. Luca Boccassi --- >From dc92390efe7d705e91aafebc61c50f8897e171df 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 42eda0b4b4..67afb7bbba 100644 --- a/drivers/net/ice/base/ice_flex_pipe.c +++ b/drivers/net/ice/base/ice_flex_pipe.c @@ -1597,8 +1597,12 @@ static enum ice_prof_type 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 && fv->ew[i].off == ICE_VNI_OFFSET) @@ -1613,7 +1617,7 @@ ice_get_sw_prof_type(struct ice_hw *hw, struct ice_fv *fv) return ICE_PROF_TUN_PPPOE; } - return ICE_PROF_NON_TUN; + return valid_prof ? ICE_PROF_NON_TUN : ICE_PROF_INVALID; } /** @@ -1630,11 +1634,6 @@ ice_get_sw_fv_bitmap(struct ice_hw *hw, enum ice_prof_type req_profs, struct ice_seg *ice_seg; 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); ice_seg = hw->seg; diff --git a/drivers/net/ice/base/ice_flex_type.h b/drivers/net/ice/base/ice_flex_type.h index 1dd57baccd..a0030183ac 100644 --- a/drivers/net/ice/base/ice_flex_type.h +++ b/drivers/net/ice/base/ice_flex_type.h @@ -779,6 +779,7 @@ struct ice_chs_chg { #define ICE_FLOW_PTYPE_MAX ICE_XLT1_CNT enum ice_prof_type { + ICE_PROF_INVALID = 0x0, ICE_PROF_NON_TUN = 0x1, ICE_PROF_TUN_UDP = 0x2, ICE_PROF_TUN_GRE = 0x4, diff --git a/drivers/net/ice/base/ice_protocol_type.h b/drivers/net/ice/base/ice_protocol_type.h index e8caefd8f9..023d661341 100644 --- a/drivers/net/ice/base/ice_protocol_type.h +++ b/drivers/net/ice/base/ice_protocol_type.h @@ -164,6 +164,7 @@ 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 #define ICE_ETYPE_OL_HW 9 diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c index 95400dd315..d7a8836293 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -7022,6 +7022,7 @@ ice_get_compat_fv_bitmap(struct ice_hw *hw, struct ice_adv_rule_info *rinfo, 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: case ICE_SW_TUN_PROFID_MAC_IPV6_L2TPV3: -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-02-18 12:37:42.122195247 +0000 +++ 0114-net-ice-base-add-profile-validation-on-switch-filter.patch 2022-02-18 12:37:37.866795851 +0000 @@ -1 +1 @@ -From a62f095049900b8148a739ad0a86fbfc32429326 Mon Sep 17 00:00:00 2001 +From dc92390efe7d705e91aafebc61c50f8897e171df Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit a62f095049900b8148a739ad0a86fbfc32429326 ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -25 +26 @@ -index 395787806b..f6a29f87c5 100644 +index 42eda0b4b4..67afb7bbba 100644 @@ -28 +29 @@ -@@ -1785,8 +1785,12 @@ static enum ice_prof_type +@@ -1597,8 +1597,12 @@ static enum ice_prof_type @@ -41 +42 @@ -@@ -1801,7 +1805,7 @@ ice_get_sw_prof_type(struct ice_hw *hw, struct ice_fv *fv) +@@ -1613,7 +1617,7 @@ ice_get_sw_prof_type(struct ice_hw *hw, struct ice_fv *fv) @@ -50 +51 @@ -@@ -1818,11 +1822,6 @@ ice_get_sw_fv_bitmap(struct ice_hw *hw, enum ice_prof_type req_profs, +@@ -1630,11 +1634,6 @@ ice_get_sw_fv_bitmap(struct ice_hw *hw, enum ice_prof_type req_profs, @@ -63 +64 @@ -index 59eeca0a30..09a02fe9ac 100644 +index 1dd57baccd..a0030183ac 100644 @@ -66 +67 @@ -@@ -1003,6 +1003,7 @@ struct ice_chs_chg { +@@ -779,6 +779,7 @@ struct ice_chs_chg { @@ -75 +76 @@ -index cef8354f77..0e6e5990be 100644 +index e8caefd8f9..023d661341 100644 @@ -78 +79 @@ -@@ -191,6 +191,7 @@ enum ice_prot_id { +@@ -164,6 +164,7 @@ enum ice_prot_id { @@ -87 +88 @@ -index 1fee790c25..d4cc664ad7 100644 +index 95400dd315..d7a8836293 100644 @@ -90 +91 @@ -@@ -7779,6 +7779,7 @@ ice_get_compat_fv_bitmap(struct ice_hw *hw, struct ice_adv_rule_info *rinfo, +@@ -7022,6 +7022,7 @@ ice_get_compat_fv_bitmap(struct ice_hw *hw, struct ice_adv_rule_info *rinfo,