patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Yongseok Koh <yskoh@mellanox.com>
To: Hyong Youb Kim <hyonkim@cisco.com>
Cc: John Daley <johndale@cisco.com>, dpdk stable <stable@dpdk.org>
Subject: [dpdk-stable] patch 'net/enic: fix SCTP match for flow API' has been queued to LTS release 17.11.7
Date: Mon, 22 Jul 2019 17:59:50 -0700	[thread overview]
Message-ID: <20190723010115.6446-23-yskoh@mellanox.com> (raw)
In-Reply-To: <20190723010115.6446-1-yskoh@mellanox.com>

Hi,

FYI, your patch has been queued to LTS release 17.11.7

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objection by 07/27/19. So please
shout if anyone has objection.

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.

Yongseok

---
From b1ed5dea5fa3b41fc32f4e8bbd8f92b70fed3f3d Mon Sep 17 00:00:00 2001
From: Hyong Youb Kim <hyonkim@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@cisco.com>
Reviewed-by: John Daley <johndale@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 407b36e226..2eb68c985d 100644
--- a/drivers/net/enic/enic_flow.c
+++ b/drivers/net/enic/enic_flow.c
@@ -99,7 +99,6 @@ static enic_copy_item_fn enic_copy_item_ipv6_v2;
 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;
 static copy_action_fn enic_copy_action_v2;
@@ -266,7 +265,7 @@ 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,
 			       RTE_FLOW_ITEM_TYPE_IPV6,
@@ -818,12 +817,37 @@ enic_copy_item_sctp_v2(const struct rte_flow_item *item,
 	const struct rte_flow_item_sctp *spec = item->spec;
 	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();
 
 	if (*inner_ofst)
 		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)
 		return 0;
-- 
2.21.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-07-22 17:55:07.747159019 -0700
+++ 0023-net-enic-fix-SCTP-match-for-flow-API.patch	2019-07-22 17:55:05.884469000 -0700
@@ -1,8 +1,10 @@
-From 3a1c3cd01b8bce9203e96520f2715b7fd8d93f02 Mon Sep 17 00:00:00 2001
+From b1ed5dea5fa3b41fc32f4e8bbd8f92b70fed3f3d Mon Sep 17 00:00:00 2001
 From: Hyong Youb Kim <hyonkim@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@dpdk.org
 
 Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
 Reviewed-by: John Daley <johndale@cisco.com>
@@ -19,10 +20,10 @@
  1 file changed, 26 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/net/enic/enic_flow.c b/drivers/net/enic/enic_flow.c
-index bb9ed037a5..55d8d50a11 100644
+index 407b36e226..2eb68c985d 100644
 --- a/drivers/net/enic/enic_flow.c
 +++ b/drivers/net/enic/enic_flow.c
-@@ -70,7 +70,6 @@ static enic_copy_item_fn enic_copy_item_ipv6_v2;
+@@ -99,7 +99,6 @@ static enic_copy_item_fn enic_copy_item_ipv6_v2;
  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;
@@ -30,7 +31,7 @@
  static enic_copy_item_fn enic_copy_item_vxlan_v2;
  static copy_action_fn enic_copy_action_v1;
  static copy_action_fn enic_copy_action_v2;
-@@ -237,7 +236,7 @@ static const struct enic_items enic_items_v3[] = {
+@@ -266,7 +265,7 @@ static const struct enic_items enic_items_v3[] = {
  	},
  	[RTE_FLOW_ITEM_TYPE_SCTP] = {
  		.copy_item = enic_copy_item_sctp_v2,
@@ -39,7 +40,7 @@
  		.prev_items = (const enum rte_flow_item_type[]) {
  			       RTE_FLOW_ITEM_TYPE_IPV4,
  			       RTE_FLOW_ITEM_TYPE_IPV6,
-@@ -819,12 +818,37 @@ enic_copy_item_sctp_v2(const struct rte_flow_item *item,
+@@ -818,12 +817,37 @@ enic_copy_item_sctp_v2(const struct rte_flow_item *item,
  	const struct rte_flow_item_sctp *spec = item->spec;
  	const struct rte_flow_item_sctp *mask = item->mask;
  	struct filter_generic_1 *gp = &enic_filter->u.generic_1;

  parent reply	other threads:[~2019-07-23  1:02 UTC|newest]

Thread overview: 108+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-23  0:59 [dpdk-stable] patch 'eal: improve musl compatibility of string functions' " Yongseok Koh
2019-07-23  0:59 ` [dpdk-stable] patch 'net/mlx5: fix instruction hotspot on replenishing Rx buffer' " Yongseok Koh
2019-07-23  0:59 ` [dpdk-stable] patch 'drivers/net: do not use private ethdev data' " Yongseok Koh
2019-07-23  0:59 ` [dpdk-stable] patch 'net/sfc: log port ID as 16-bit unsigned integer on panic' " Yongseok Koh
2019-07-23  0:59 ` [dpdk-stable] patch 'net/sfc: remove control path logging from Rx queue count' " Yongseok Koh
2019-07-23  0:59 ` [dpdk-stable] patch 'net/virtio: remove forward declaration' " Yongseok Koh
2019-07-23  0:59 ` [dpdk-stable] patch 'eal: support strlcat function' " Yongseok Koh
2019-07-23  0:59 ` [dpdk-stable] patch 'mbuf: fix a typo' " Yongseok Koh
2019-07-23  0:59 ` [dpdk-stable] patch 'net/bnxt: support IOVA VA mode' " Yongseok Koh
2019-07-23  0:59 ` [dpdk-stable] patch 'doc: fix a minor typo in testpmd guide' " Yongseok Koh
2019-07-23  0:59 ` [dpdk-stable] patch 'net/bonding: avoid warning for invalid port' " Yongseok Koh
2019-07-23  0:59 ` [dpdk-stable] patch 'net/bonding: fix reset active slave' " Yongseok Koh
2019-07-23  0:59 ` [dpdk-stable] patch 'mk: fix build of shared library with libbsd' " Yongseok Koh
2019-07-23  0:59 ` [dpdk-stable] patch 'net/bnx2x: fix segfaults due to stale interrupt status' " Yongseok Koh
2019-07-23  0:59 ` [dpdk-stable] patch 'doc: remove reference to rte.doc.mk in programmers guide' " Yongseok Koh
2019-07-23  0:59 ` [dpdk-stable] patch 'examples/ethtool: fix two typos' " Yongseok Koh
2019-07-23  0:59 ` [dpdk-stable] patch 'doc: fix link in Linux getting started guide' " Yongseok Koh
2019-07-23  0:59 ` [dpdk-stable] patch 'mk: fix AVX512 disabled warning on non x86' " Yongseok Koh
2019-07-23  0:59 ` [dpdk-stable] patch 'bus/vdev: fix debug message on probing' " Yongseok Koh
2019-07-23  0:59 ` [dpdk-stable] patch 'eal: fix check when retrieving current CPU affinity' " Yongseok Koh
2019-07-23  0:59 ` [dpdk-stable] patch 'eal: remove dead code in core list parsing' " Yongseok Koh
2019-07-23  0:59 ` [dpdk-stable] patch 'net/enic: fix flow director SCTP matching' " Yongseok Koh
2019-07-23  0:59 ` Yongseok Koh [this message]
2019-07-23  0:59 ` [dpdk-stable] patch 'net/enic: check for unsupported flow item types' " Yongseok Koh
2019-07-23  0:59 ` [dpdk-stable] patch 'net/ixgbe: fix crash on remove' " Yongseok Koh
2019-07-23  0:59 ` [dpdk-stable] patch 'net/mlx5: fix hex dump of error completion' " Yongseok Koh
2019-07-23  0:59 ` [dpdk-stable] patch 'net/mlx5: fix sync when handling Tx completions' " Yongseok Koh
2019-07-23  0:59 ` [dpdk-stable] patch 'net/i40e: fix time sync for 25G' " Yongseok Koh
2019-07-23  0:59 ` [dpdk-stable] patch 'net/qede: support IOVA VA mode' " Yongseok Koh
2019-07-23  0:59 ` [dpdk-stable] patch 'net/mlx5: fix packet inline on Tx queue wraparound' " Yongseok Koh
2019-07-23  0:59 ` [dpdk-stable] patch 'net/nfp: fix RSS query' " Yongseok Koh
2019-07-23  0:59 ` [dpdk-stable] patch 'app/testpmd: remove unused field from port struct' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'app/testpmd: fix a typo in log message' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'net/octeontx: fix vdev name' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'app/testpmd: fix stdout flush after printing stats' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'net/bonding: fix LACP negotiation' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'doc: fix examples in bonding guide' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'net/bonding: fix port id types' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'net/bonding: fix queue index " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'drivers/net: fix possible overflow using strlcat' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'examples/ipsec-secgw: fix AES-CTR block size' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'examples/ipsec-secgw: fix debug logs' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'cryptodev: fix driver name comparison' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'malloc: fix documentation of realloc function' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'eal/linux: fix log levels for pagemap reading failure' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'test/spinlock: remove delay for correct benchmarking' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'test/spinlock: amortize the cost of getting time' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'spinlock: reimplement with atomic one-way barrier' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'eal/ppc: fix global memory " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'bus/dpaa: fix Rx discard register mask' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'power: fix frequency list buffer validation' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'bus/fslmc: remove unused include of error.h' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'bus/fslmc: fix build with musl libc' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'app/test: " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'app/testpmd: remove useless casts on statistics' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'ethdev: fix a typo' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'net/bnxt: fix Rx VLAN offload flags' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'net/fm10k: fix VLAN strip offload flag' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'net/virtio: fix duplicate naming of include guard' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'net/virtio: remove useless condition' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'app/test: fix sprintf with strlcat' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'maintainers: update for IBM POWER' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'ring: fix an error message' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'event/sw: fix enqueue checks in self-test' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'crypto/dpaa2_sec: fix session clearing' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'ring: fix namesize macro documentation block' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'net/bonding: fix buffer length when printing strings' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'test/distributor: replace sprintf with strlcpy' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'test/hash: replace sprintf with snprintf' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'eal: fix typo in comment of vector function' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'doc: fix links to doxygen and sphinx sites' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'cfgfile: replace strcat with strlcat' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'app/testpmd: fix typo in comment' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'net: fix Tx VLAN flag for offload emulation' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'examples/l2fwd-cat: fix build on FreeBSD' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'app/crypto-perf: check range of socket id' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'kni: fix build with Linux 5.1' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'net/bnx2x: fix memory leak' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'net/bnx2x: fix ramrod timeout' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'net/bnx2x: fix DMAE " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'net/bnx2x: fix race for periodic flags' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'net/bnx2x: fix optic module verification' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'app/testpmd: set fixed flag for exact link speed' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'vhost: fix device leak on connection add failure' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'vhost: fix silent queue enabling with legacy guests' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'net/virtio: fix dangling pointer on failure' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'examples/vhost_scsi: fix null-check for parameter' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'net/i40e: fix dereference before null check in mbuf release' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'bitrate: fix unchecked return value' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'net/ixgbe: fix warning with GCC 9' " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'bus/fslmc: " Yongseok Koh
2019-07-23  1:00 ` [dpdk-stable] patch 'build: fix crash by disabling AVX512 with binutils 2.31' " Yongseok Koh
2019-07-23  1:01 ` [dpdk-stable] patch 'net/mlx5: fix comments mixing Rx and Tx' " Yongseok Koh
2019-07-23  1:01 ` [dpdk-stable] patch 'doc: fix interactive commands in testpmd guide' " Yongseok Koh
2019-07-23  1:01 ` [dpdk-stable] patch 'net/ring: avoid hard-coded length' " Yongseok Koh
2019-07-23  1:01 ` [dpdk-stable] patch 'net/ring: use calloc style where appropriate' " Yongseok Koh
2019-07-23  1:01 ` [dpdk-stable] patch 'net/ring: check length of ring name' " Yongseok Koh
2019-07-23  1:01 ` [dpdk-stable] patch 'net/ring: fix return value check' " Yongseok Koh
2019-07-23  1:01 ` [dpdk-stable] patch 'net/kni: " Yongseok Koh
2019-07-23  1:01 ` [dpdk-stable] patch 'net/i40e: fix link speed for X722' " Yongseok Koh
2019-07-23  1:01 ` [dpdk-stable] patch 'net/mlx5: check Tx queue size overflow' " Yongseok Koh
2019-07-23  1:01 ` [dpdk-stable] patch 'net/mlx5: fix max number of queues for NEON Tx' " Yongseok Koh
2019-07-23  1:01 ` [dpdk-stable] patch 'app/testpmd: revert fixed flag for exact link speed' " Yongseok Koh
2019-07-23  1:01 ` [dpdk-stable] patch 'hash: fix doc about thread/process safety' " Yongseok Koh
2019-07-23  1:01 ` [dpdk-stable] patch 'doc: fix broken link in LPM guide' " Yongseok Koh
2019-07-23  1:01 ` [dpdk-stable] patch 'net/mlx5: fix release of Rx queue object' " Yongseok Koh
2019-07-23  1:01 ` [dpdk-stable] patch 'doc: fix typo in mlx5 guide' " Yongseok Koh
2019-07-23  1:01 ` [dpdk-stable] patch 'examples/ipsec-secgw: fix build error log' " Yongseok Koh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190723010115.6446-23-yskoh@mellanox.com \
    --to=yskoh@mellanox.com \
    --cc=hyonkim@cisco.com \
    --cc=johndale@cisco.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).