[dpdk-stable] patch 'net/enic: fix SCTP match for flow API' has been queued to LTS release 18.11.2

Kevin Traynor ktraynor at redhat.com
Wed Apr 10 18:44:02 CEST 2019


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 <hyonkim at cisco.com>
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 <hyonkim at cisco.com>
Reviewed-by: John Daley <johndale at cisco.com>
---
 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 <hyonkim at cisco.com>
 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 at dpdk.org
 
 Signed-off-by: Hyong Youb Kim <hyonkim at cisco.com>
 Reviewed-by: John Daley <johndale at cisco.com>


More information about the stable mailing list