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 99C9DA0A02 for ; Mon, 17 May 2021 18:12:57 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 92290410EA; Mon, 17 May 2021 18:12:57 +0200 (CEST) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by mails.dpdk.org (Postfix) with ESMTP id D013A40041 for ; Mon, 17 May 2021 18:12:54 +0200 (CEST) Received: from 2.general.paelzer.uk.vpn ([10.172.196.173] helo=Keschdeichel.fritz.box) by youngberry.canonical.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lifrS-0007o9-LU; Mon, 17 May 2021 16:12:54 +0000 From: Christian Ehrhardt To: Lance Richardson Cc: Ajit Khaparde , dpdk stable Date: Mon, 17 May 2021 18:08:07 +0200 Message-Id: <20210517161039.3132619-58-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517161039.3132619-1-christian.ehrhardt@canonical.com> References: <20210517161039.3132619-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/bnxt: fix handling of null flow mask' has been queued to stable release 19.11.9 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/19/21. 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/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/919272fe90a0c072de83f8c7b6d82e38cfa2959d Thanks. Christian Ehrhardt --- >From 919272fe90a0c072de83f8c7b6d82e38cfa2959d Mon Sep 17 00:00:00 2001 From: Lance Richardson Date: Thu, 18 Mar 2021 15:52:51 -0400 Subject: [PATCH] net/bnxt: fix handling of null flow mask [ upstream commit dea1afc71ffce08fccef2d49f09f6ad874c433c5 ] When the mask field of an rte_flow pattern item is NULL, the default mask for that item type should be used. Fixes: 5ef3b79fdfe6 ("net/bnxt: support flow filter ops") Signed-off-by: Lance Richardson Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_flow.c | 47 +++++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c index f069e5f56a..fea35f53f8 100644 --- a/drivers/net/bnxt/bnxt_flow.c +++ b/drivers/net/bnxt/bnxt_flow.c @@ -185,11 +185,15 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp, PMD_DRV_LOG(DEBUG, "Parse inner header\n"); break; case RTE_FLOW_ITEM_TYPE_ETH: - if (!item->spec || !item->mask) + if (!item->spec) break; eth_spec = item->spec; - eth_mask = item->mask; + + if (item->mask) + eth_mask = item->mask; + else + eth_mask = &rte_flow_item_eth_mask; /* Source MAC address mask cannot be partially set. * Should be All 0's or all 1's. @@ -278,7 +282,12 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp, break; case RTE_FLOW_ITEM_TYPE_VLAN: vlan_spec = item->spec; - vlan_mask = item->mask; + + if (item->mask) + vlan_mask = item->mask; + else + vlan_mask = &rte_flow_item_vlan_mask; + if (en & en_ethertype) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, @@ -321,11 +330,15 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp, case RTE_FLOW_ITEM_TYPE_IPV4: /* If mask is not involved, we could use EM filters. */ ipv4_spec = item->spec; - ipv4_mask = item->mask; - if (!item->spec || !item->mask) + if (!item->spec) break; + if (item->mask) + ipv4_mask = item->mask; + else + ipv4_mask = &rte_flow_item_ipv4_mask; + /* Only IP DST and SRC fields are maskable. */ if (ipv4_mask->hdr.version_ihl || ipv4_mask->hdr.type_of_service || @@ -382,11 +395,15 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp, break; case RTE_FLOW_ITEM_TYPE_IPV6: ipv6_spec = item->spec; - ipv6_mask = item->mask; - if (!item->spec || !item->mask) + if (!item->spec) break; + if (item->mask) + ipv6_mask = item->mask; + else + ipv6_mask = &rte_flow_item_ipv6_mask; + /* Only IP DST and SRC fields are maskable. */ if (ipv6_mask->hdr.vtc_flow || ipv6_mask->hdr.payload_len || @@ -434,11 +451,15 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp, break; case RTE_FLOW_ITEM_TYPE_TCP: tcp_spec = item->spec; - tcp_mask = item->mask; - if (!item->spec || !item->mask) + if (!item->spec) break; + if (item->mask) + tcp_mask = item->mask; + else + tcp_mask = &rte_flow_item_tcp_mask; + /* Check TCP mask. Only DST & SRC ports are maskable */ if (tcp_mask->hdr.sent_seq || tcp_mask->hdr.recv_ack || @@ -479,11 +500,15 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp, break; case RTE_FLOW_ITEM_TYPE_UDP: udp_spec = item->spec; - udp_mask = item->mask; - if (!item->spec || !item->mask) + if (!item->spec) break; + if (item->mask) + udp_mask = item->mask; + else + udp_mask = &rte_flow_item_udp_mask; + if (udp_mask->hdr.dgram_len || udp_mask->hdr.dgram_cksum) { rte_flow_error_set(error, -- 2.31.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-05-17 17:40:31.811026635 +0200 +++ 0058-net-bnxt-fix-handling-of-null-flow-mask.patch 2021-05-17 17:40:29.195809666 +0200 @@ -1 +1 @@ -From dea1afc71ffce08fccef2d49f09f6ad874c433c5 Mon Sep 17 00:00:00 2001 +From 919272fe90a0c072de83f8c7b6d82e38cfa2959d Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit dea1afc71ffce08fccef2d49f09f6ad874c433c5 ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -19 +20 @@ -index a8f5d91fc4..e3906b4779 100644 +index f069e5f56a..fea35f53f8 100644 @@ -22 +23 @@ -@@ -188,11 +188,15 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp, +@@ -185,11 +185,15 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp, @@ -40 +41 @@ -@@ -281,7 +285,12 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp, +@@ -278,7 +282,12 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp, @@ -54 +55 @@ -@@ -324,11 +333,15 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp, +@@ -321,11 +330,15 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp, @@ -72 +73 @@ -@@ -385,11 +398,15 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp, +@@ -382,11 +395,15 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp, @@ -90 +91 @@ -@@ -437,11 +454,15 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp, +@@ -434,11 +451,15 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp, @@ -108 +109 @@ -@@ -482,11 +503,15 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp, +@@ -479,11 +500,15 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp,