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 B280AA0555 for ; Thu, 9 Jun 2022 13:38:35 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ADD1840220; Thu, 9 Jun 2022 13:38:35 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id D83D840220 for ; Thu, 9 Jun 2022 13:38:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654774713; 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=CDPyMQcUpPNaOYBGZo97Ye5gDcik9UquCeZmnJv6KyU=; b=VuCYH7i6Vyp8kQzxsEaO3+6W6oS4Uja3smB7DArY9l9XIr1i0hNE0/C+rRn4BYJYVjpq3K ifHCt9tJRQxGJN6x2sKZfyJWDuz1J/yDqGglrQEvVDOwqgJD+kTThcc/spvrwARwNOiSha zh72nwmKkozo9t3E5WlgdFuXqJdo5eU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-224-RZy784zJPJaSkSB8X6Uyhw-1; Thu, 09 Jun 2022 07:38:30 -0400 X-MC-Unique: RZy784zJPJaSkSB8X6Uyhw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 387C185A581; Thu, 9 Jun 2022 11:38:30 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.195.82]) by smtp.corp.redhat.com (Postfix) with ESMTP id 302CD1730C; Thu, 9 Jun 2022 11:38:28 +0000 (UTC) From: Kevin Traynor To: Yuying Zhang Cc: Qi Zhang , dpdk stable Subject: patch 'net/ice/base: fix direction of flow that matches any' has been queued to stable release 21.11.2 Date: Thu, 9 Jun 2022 12:36:45 +0100 Message-Id: <20220609113701.386938-58-ktraynor@redhat.com> In-Reply-To: <20220609113701.386938-1-ktraynor@redhat.com> References: <20220609113701.386938-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 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-default=true 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.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/13/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/981abb1aebfe7002f29f415bbf068e859b9faffa Thanks. Kevin --- >From 981abb1aebfe7002f29f415bbf068e859b9faffa Mon Sep 17 00:00:00 2001 From: Yuying Zhang Date: Thu, 12 May 2022 07:42:00 +0000 Subject: [PATCH] net/ice/base: fix direction of flow that matches any [ upstream commit 8b95092b7f691a888f7b1a80872b549b08ee05ad ] The tx/rx packets were both dropped when creating drop any rule for ingress direction only, the root cause is the recipe didn't contain direction flag matching. This patch adds the packet flag which represents the direction of source interface to solve the issue. Fixes: 92317961a731 ("net/ice: support drop any and steer all to queue") Signed-off-by: Yuying Zhang Acked-by: Qi Zhang --- drivers/net/ice/base/ice_protocol_type.h | 6 +++-- drivers/net/ice/base/ice_switch.c | 31 ++++++++++++++++++++---- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/drivers/net/ice/base/ice_protocol_type.h b/drivers/net/ice/base/ice_protocol_type.h index 0e6e5990be..7dcc983707 100644 --- a/drivers/net/ice/base/ice_protocol_type.h +++ b/drivers/net/ice/base/ice_protocol_type.h @@ -55,4 +55,5 @@ enum ice_protocol_type { ICE_VLAN_EX, ICE_VLAN_IN, + ICE_FLG_DIR, ICE_PROTOCOL_LAST }; @@ -219,7 +220,8 @@ enum ice_prot_id { #define ICE_MDID_SIZE 2 -#define ICE_TUN_FLAG_MDID 21 -#define ICE_TUN_FLAG_MDID_OFF (ICE_MDID_SIZE * ICE_TUN_FLAG_MDID) +#define ICE_TUN_FLAG_MDID 20 +#define ICE_TUN_FLAG_MDID_OFF(word) (ICE_MDID_SIZE * (ICE_TUN_FLAG_MDID + (word))) #define ICE_TUN_FLAG_MASK 0xFF +#define ICE_DIR_FLAG_MASK 0x10 #define ICE_TUN_FLAG_VLAN_MASK 0x01 #define ICE_TUN_FLAG_FV_IND 2 diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c index d4cc664ad7..c0df3a1815 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -2304,5 +2304,5 @@ ice_get_recp_frm_fw(struct ice_hw *hw, struct ice_sw_recipe *recps, u8 rid, rg_entry->fv_mask[i]; if (prot == ICE_META_DATA_ID_HW && - off == ICE_TUN_FLAG_MDID_OFF) + off == ICE_TUN_FLAG_MDID_OFF(1)) vlan = true; fv_word_idx++; @@ -6771,4 +6771,5 @@ static struct ice_protocol_entry ice_prot_id_tbl[ICE_PROTOCOL_LAST] = { { ICE_VLAN_EX, ICE_VLAN_OF_HW }, { ICE_VLAN_IN, ICE_VLAN_OL_HW }, + { ICE_FLG_DIR, ICE_META_DATA_ID_HW}, }; @@ -7489,7 +7490,8 @@ free_mem: * ice_tun_type_match_word - determine if tun type needs a match mask * @tun_type: tunnel type + * @off: offset of packet flag * @mask: mask to be used for the tunnel */ -static bool ice_tun_type_match_word(enum ice_sw_tunnel_type tun_type, u16 *mask) +static bool ice_tun_type_match_word(enum ice_sw_tunnel_type tun_type, u16 *off, u16 *mask) { switch (tun_type) { @@ -7507,4 +7509,10 @@ static bool ice_tun_type_match_word(enum ice_sw_tunnel_type tun_type, u16 *mask) case ICE_SW_TUN_PPPOE_IPV6_QINQ: *mask = ICE_TUN_FLAG_MASK; + *off = ICE_TUN_FLAG_MDID_OFF(1); + return true; + + case ICE_SW_TUN_AND_NON_TUN: + *mask = ICE_DIR_FLAG_MASK; + *off = ICE_TUN_FLAG_MDID_OFF(0); return true; @@ -7512,8 +7520,10 @@ static bool ice_tun_type_match_word(enum ice_sw_tunnel_type tun_type, u16 *mask) case ICE_SW_TUN_VXLAN_VLAN: *mask = ICE_TUN_FLAG_MASK & ~ICE_TUN_FLAG_VLAN_MASK; + *off = ICE_TUN_FLAG_MDID_OFF(1); return true; default: *mask = 0; + *off = 0; return false; } @@ -7530,14 +7540,16 @@ ice_add_special_words(struct ice_adv_rule_info *rinfo, { u16 mask; + u16 off; /* If this is a tunneled packet, then add recipe index to match the - * tunnel bit in the packet metadata flags. + * tunnel bit in the packet metadata flags. If this is a tun_and_non_tun + * packet, then add recipe index to match the direction bit in the flag. */ - if (ice_tun_type_match_word(rinfo->tun_type, &mask)) { + if (ice_tun_type_match_word(rinfo->tun_type, &off, &mask)) { if (lkup_exts->n_val_words < ICE_MAX_CHAIN_WORDS) { u8 word = lkup_exts->n_val_words++; lkup_exts->fv_words[word].prot_id = ICE_META_DATA_ID_HW; - lkup_exts->fv_words[word].off = ICE_TUN_FLAG_MDID_OFF; + lkup_exts->fv_words[word].off = off; lkup_exts->field_mask[word] = mask; } else { @@ -7865,4 +7877,13 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups, ice_get_compat_fv_bitmap(hw, rinfo, fv_bitmap); + /* If it is a packet to match any, add a lookup element to match direction + * flag of source interface. + */ + if (rinfo->tun_type == ICE_SW_TUN_AND_NON_TUN && + lkups_cnt < ICE_MAX_CHAIN_WORDS) { + lkups[lkups_cnt].type = ICE_FLG_DIR; + lkups_cnt++; + } + status = ice_get_fv(hw, lkups, lkups_cnt, fv_bitmap, &rm->fv_list); if (status) -- 2.34.3 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-06-09 12:34:31.096546096 +0100 +++ 0058-net-ice-base-fix-direction-of-flow-that-matches-any.patch 2022-06-09 12:34:29.785980709 +0100 @@ -1 +1 @@ -From 8b95092b7f691a888f7b1a80872b549b08ee05ad Mon Sep 17 00:00:00 2001 +From 981abb1aebfe7002f29f415bbf068e859b9faffa Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 8b95092b7f691a888f7b1a80872b549b08ee05ad ] + @@ -14 +15,0 @@ -Cc: stable@dpdk.org @@ -24 +25 @@ -index 83867418c6..8fb95a8a8d 100644 +index 0e6e5990be..7dcc983707 100644 @@ -33 +34 @@ -@@ -220,7 +221,8 @@ enum ice_prot_id { +@@ -219,7 +220,8 @@ enum ice_prot_id {