From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 85ED51B488 for ; Thu, 22 Nov 2018 17:53:01 +0100 (CET) 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 mx1.redhat.com (Postfix) with ESMTPS id E31C0307D84E; Thu, 22 Nov 2018 16:53:00 +0000 (UTC) Received: from ktraynor.remote.csb (unknown [10.36.118.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id 75C0160FD9; Thu, 22 Nov 2018 16:52:59 +0000 (UTC) From: Kevin Traynor To: Faicker Mo Cc: Wei Zhao , dpdk stable Date: Thu, 22 Nov 2018 16:49:41 +0000 Message-Id: <20181122164957.13003-49-ktraynor@redhat.com> In-Reply-To: <20181122164957.13003-1-ktraynor@redhat.com> References: <20181122164957.13003-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Thu, 22 Nov 2018 16:53:01 +0000 (UTC) Subject: [dpdk-stable] patch 'net/ixgbe: fix flow create in ntuple check' has been queued to stable release 18.08.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 16:53:01 -0000 Hi, FYI, your patch has been queued to stable release 18.08.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 11/28/18. 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. If the code is different (ie: not only metadata diffs), due for example to a change in context or macro names, please double check it. Thanks. Kevin Traynor --- >>From 54952111c26539f4ca0449adf04eed0416be2099 Mon Sep 17 00:00:00 2001 From: Faicker Mo Date: Tue, 18 Sep 2018 13:48:52 +0800 Subject: [PATCH] net/ixgbe: fix flow create in ntuple check [ upstream commit d0dd0cf06135ec043c587bf14b66ec55adde876a ] In ixgbe_flow_create function, ntuple filter is parsed first. If the flow is considered to be ntuple filter, it will not go on to judge ethertype filter, syn filter and fdir filter. In the function ntuple_filter_to_5tuple, 5 tuple info is checked, but it's too late to jump over the ntuple filter if it's a fdir filter. Fixes: 46ea969177f3 ("net/ixgbe: add ntuple support to flow parser") Signed-off-by: Faicker Mo Acked-by: Wei Zhao --- drivers/net/ixgbe/ixgbe_flow.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c index 1adf1b803..f0fafebc8 100644 --- a/drivers/net/ixgbe/ixgbe_flow.c +++ b/drivers/net/ixgbe/ixgbe_flow.c @@ -364,4 +364,15 @@ cons_parse_ntuple_filter(const struct rte_flow_attr *attr, return -rte_errno; } + if ((ipv4_mask->hdr.src_addr != 0 && + ipv4_mask->hdr.src_addr != UINT32_MAX) || + (ipv4_mask->hdr.dst_addr != 0 && + ipv4_mask->hdr.dst_addr != UINT32_MAX) || + (ipv4_mask->hdr.next_proto_id != UINT8_MAX && + ipv4_mask->hdr.next_proto_id != 0)) { + rte_flow_error_set(error, + EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, + item, "Not supported by ntuple filter"); + return -rte_errno; + } filter->dst_ip_mask = ipv4_mask->hdr.dst_addr; @@ -433,4 +444,13 @@ cons_parse_ntuple_filter(const struct rte_flow_attr *attr, return -rte_errno; } + if ((tcp_mask->hdr.src_port != 0 && + tcp_mask->hdr.src_port != UINT16_MAX) || + (tcp_mask->hdr.dst_port != 0 && + tcp_mask->hdr.dst_port != UINT16_MAX)) { + rte_flow_error_set(error, + EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, + item, "Not supported by ntuple filter"); + return -rte_errno; + } filter->dst_port_mask = tcp_mask->hdr.dst_port; @@ -468,4 +488,13 @@ cons_parse_ntuple_filter(const struct rte_flow_attr *attr, return -rte_errno; } + if ((udp_mask->hdr.src_port != 0 && + udp_mask->hdr.src_port != UINT16_MAX) || + (udp_mask->hdr.dst_port != 0 && + udp_mask->hdr.dst_port != UINT16_MAX)) { + rte_flow_error_set(error, + EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, + item, "Not supported by ntuple filter"); + return -rte_errno; + } filter->dst_port_mask = udp_mask->hdr.dst_port; -- 2.19.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-22 16:47:33.540783379 +0000 +++ 0049-net-ixgbe-fix-flow-create-in-ntuple-check.patch 2018-11-22 16:47:32.000000000 +0000 @@ -1,8 +1,10 @@ -From d0dd0cf06135ec043c587bf14b66ec55adde876a Mon Sep 17 00:00:00 2001 +From 54952111c26539f4ca0449adf04eed0416be2099 Mon Sep 17 00:00:00 2001 From: Faicker Mo Date: Tue, 18 Sep 2018 13:48:52 +0800 Subject: [PATCH] net/ixgbe: fix flow create in ntuple check +[ upstream commit d0dd0cf06135ec043c587bf14b66ec55adde876a ] + In ixgbe_flow_create function, ntuple filter is parsed first. If the flow is considered to be ntuple filter, it will not go on to judge ethertype filter, syn filter and fdir filter. @@ -10,7 +12,6 @@ but it's too late to jump over the ntuple filter if it's a fdir filter. Fixes: 46ea969177f3 ("net/ixgbe: add ntuple support to flow parser") -Cc: stable@dpdk.org Signed-off-by: Faicker Mo Acked-by: Wei Zhao