From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 4CC46A0096 for ; Wed, 10 Apr 2019 18:45:58 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3E6711B12B; Wed, 10 Apr 2019 18:45:58 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 88AE51B1CE for ; Wed, 10 Apr 2019 18:45:56 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EF8B43086223; Wed, 10 Apr 2019 16:45:55 +0000 (UTC) Received: from rh.redhat.com (ovpn-117-94.ams2.redhat.com [10.36.117.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id DD5B45D961; Wed, 10 Apr 2019 16:45:54 +0000 (UTC) From: Kevin Traynor To: Hyong Youb Kim Cc: John Daley , dpdk stable Date: Wed, 10 Apr 2019 17:44:02 +0100 Message-Id: <20190410164411.10546-54-ktraynor@redhat.com> In-Reply-To: <20190410164411.10546-1-ktraynor@redhat.com> References: <20190410164411.10546-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Wed, 10 Apr 2019 16:45:56 +0000 (UTC) Subject: [dpdk-stable] patch 'net/enic: fix SCTP match for flow API' has been queued to LTS release 18.11.2 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: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.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 04/16/19. 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. Thanks. Kevin Traynor --- >From 4ce5b801084779d85e00d77b526edaf9c76463f8 Mon Sep 17 00:00:00 2001 From: Hyong Youb Kim Date: Sat, 2 Mar 2019 02:42:41 -0800 Subject: [PATCH] net/enic: fix SCTP match for flow API [ upstream commit 3a1c3cd01b8bce9203e96520f2715b7fd8d93f02 ] The driver needs to explicitly set the protocol number (132) in the IP header pattern, as the current firmware filter API lacks "match SCTP packet" flag. Otherwise, the resulting NIC filter may lead to false positives (i.e. NIC reporting non-SCTP packets as SCTP packets). The flow director handler does the same (enic_clsf.c). Fixes: 6ced137607d0 ("net/enic: flow API for NICs with advanced filters enabled") Signed-off-by: Hyong Youb Kim Reviewed-by: John Daley --- drivers/net/enic/enic_flow.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/drivers/net/enic/enic_flow.c b/drivers/net/enic/enic_flow.c index bb9ed037a..55d8d50a1 100644 --- a/drivers/net/enic/enic_flow.c +++ b/drivers/net/enic/enic_flow.c @@ -71,5 +71,4 @@ static enic_copy_item_fn enic_copy_item_udp_v2; static enic_copy_item_fn enic_copy_item_tcp_v2; static enic_copy_item_fn enic_copy_item_sctp_v2; -static enic_copy_item_fn enic_copy_item_sctp_v2; static enic_copy_item_fn enic_copy_item_vxlan_v2; static copy_action_fn enic_copy_action_v1; @@ -238,5 +237,5 @@ static const struct enic_items enic_items_v3[] = { [RTE_FLOW_ITEM_TYPE_SCTP] = { .copy_item = enic_copy_item_sctp_v2, - .valid_start_item = 1, + .valid_start_item = 0, .prev_items = (const enum rte_flow_item_type[]) { RTE_FLOW_ITEM_TYPE_IPV4, @@ -820,4 +819,6 @@ enic_copy_item_sctp_v2(const struct rte_flow_item *item, const struct rte_flow_item_sctp *mask = item->mask; struct filter_generic_1 *gp = &enic_filter->u.generic_1; + uint8_t *ip_proto_mask = NULL; + uint8_t *ip_proto = NULL; FLOW_TRACE(); @@ -826,4 +827,27 @@ enic_copy_item_sctp_v2(const struct rte_flow_item *item, return ENOTSUP; + /* + * The NIC filter API has no flags for "match sctp", so explicitly set + * the protocol number in the IP pattern. + */ + if (gp->val_flags & FILTER_GENERIC_1_IPV4) { + struct ipv4_hdr *ip; + ip = (struct ipv4_hdr *)gp->layer[FILTER_GENERIC_1_L3].mask; + ip_proto_mask = &ip->next_proto_id; + ip = (struct ipv4_hdr *)gp->layer[FILTER_GENERIC_1_L3].val; + ip_proto = &ip->next_proto_id; + } else if (gp->val_flags & FILTER_GENERIC_1_IPV6) { + struct ipv6_hdr *ip; + ip = (struct ipv6_hdr *)gp->layer[FILTER_GENERIC_1_L3].mask; + ip_proto_mask = &ip->proto; + ip = (struct ipv6_hdr *)gp->layer[FILTER_GENERIC_1_L3].val; + ip_proto = &ip->proto; + } else { + /* Need IPv4/IPv6 pattern first */ + return EINVAL; + } + *ip_proto = IPPROTO_SCTP; + *ip_proto_mask = 0xff; + /* Match all if no spec */ if (!spec) -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-04-10 14:06:12.021238680 +0100 +++ 0054-net-enic-fix-SCTP-match-for-flow-API.patch 2019-04-10 14:06:08.006290993 +0100 @@ -1,8 +1,10 @@ -From 3a1c3cd01b8bce9203e96520f2715b7fd8d93f02 Mon Sep 17 00:00:00 2001 +From 4ce5b801084779d85e00d77b526edaf9c76463f8 Mon Sep 17 00:00:00 2001 From: Hyong Youb Kim Date: Sat, 2 Mar 2019 02:42:41 -0800 Subject: [PATCH] net/enic: fix SCTP match for flow API +[ upstream commit 3a1c3cd01b8bce9203e96520f2715b7fd8d93f02 ] + The driver needs to explicitly set the protocol number (132) in the IP header pattern, as the current firmware filter API lacks "match SCTP packet" flag. Otherwise, the resulting NIC filter may lead to false @@ -10,7 +12,6 @@ flow director handler does the same (enic_clsf.c). Fixes: 6ced137607d0 ("net/enic: flow API for NICs with advanced filters enabled") -Cc: stable@dpdk.org Signed-off-by: Hyong Youb Kim Reviewed-by: John Daley