patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: Qi Zhang <qi.z.zhang@intel.com>
Cc: Xu Ting <ting.xu@intel.com>, dpdk stable <stable@dpdk.org>
Subject: patch 'net/ice: refactor parser usage' has been queued to stable release 21.11.2
Date: Tue, 10 May 2022 13:29:45 +0100
Message-ID: <20220510123010.159523-8-ktraynor@redhat.com> (raw)
In-Reply-To: <20220510123010.159523-1-ktraynor@redhat.com>

Hi,

FYI, your patch has been queued to stable release 21.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 05/15/22. 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/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/aedf24edbb04a77fe2fcde21967a47a2c306515e

Thanks.

Kevin

---
From aedf24edbb04a77fe2fcde21967a47a2c306515e Mon Sep 17 00:00:00 2001
From: Qi Zhang <qi.z.zhang@intel.com>
Date: Thu, 7 Apr 2022 12:06:14 -0400
Subject: [PATCH] net/ice: refactor parser usage

[ upstream commit 531d2555c8a644030f1ee7d3c9edf1db9c35d6ef ]

Not necessary to create / destroy a parser instance for every raw packet
rule. A global parser instance will be created in ice_flow_init and be
destroyed in ice_flow_uninit.

Also, ice_dev_udp_tunnel_port_add has been hooked to perform corresponding
parser configure. This also fix the issue that RSS engine can't support
VXLAN inner through raw packet filter.

Fixes: 1b9c68120a1c ("net/ice: enable protocol agnostic flow offloading in RSS")

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Xu Ting <ting.xu@intel.com>
---
 drivers/net/ice/ice_ethdev.c       | 10 ++++++++++
 drivers/net/ice/ice_ethdev.h       |  1 +
 drivers/net/ice/ice_fdir_filter.c  | 14 ++++----------
 drivers/net/ice/ice_generic_flow.c |  8 ++++++++
 drivers/net/ice/ice_hash.c         |  9 ++++-----
 5 files changed, 27 insertions(+), 15 deletions(-)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 2ae25b16f6..ab3976a319 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -5455,4 +5455,6 @@ ice_dev_udp_tunnel_port_add(struct rte_eth_dev *dev,
 	int ret = 0;
 	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	struct ice_adapter *ad =
+		ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
 
 	if (udp_tunnel == NULL)
@@ -5462,4 +5464,7 @@ ice_dev_udp_tunnel_port_add(struct rte_eth_dev *dev,
 	case RTE_ETH_TUNNEL_TYPE_VXLAN:
 		ret = ice_create_tunnel(hw, TNL_VXLAN, udp_tunnel->udp_port);
+		if (!ret && ad->psr != NULL)
+			ice_parser_vxlan_tunnel_set(ad->psr,
+					udp_tunnel->udp_port, true);
 		break;
 	default:
@@ -5479,4 +5484,6 @@ ice_dev_udp_tunnel_port_del(struct rte_eth_dev *dev,
 	int ret = 0;
 	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	struct ice_adapter *ad =
+		ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
 
 	if (udp_tunnel == NULL)
@@ -5486,4 +5493,7 @@ ice_dev_udp_tunnel_port_del(struct rte_eth_dev *dev,
 	case RTE_ETH_TUNNEL_TYPE_VXLAN:
 		ret = ice_destroy_tunnel(hw, udp_tunnel->udp_port, 0);
+		if (!ret && ad->psr != NULL)
+			ice_parser_vxlan_tunnel_set(ad->psr,
+					udp_tunnel->udp_port, false);
 		break;
 	default:
diff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h
index c0d1baa1ec..56e53a6df3 100644
--- a/drivers/net/ice/ice_ethdev.h
+++ b/drivers/net/ice/ice_ethdev.h
@@ -537,4 +537,5 @@ struct ice_adapter {
 	/* True if DCF state of the associated PF is on */
 	bool dcf_state_on;
+	struct ice_parser *psr;
 #ifdef RTE_ARCH_X86
 	bool rx_use_avx2;
diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
index ff1cee1195..99053978a9 100644
--- a/drivers/net/ice/ice_fdir_filter.c
+++ b/drivers/net/ice/ice_fdir_filter.c
@@ -1829,5 +1829,4 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
 	struct ice_fdir_v6 *p_v6 = NULL;
 	struct ice_parser_result rslt;
-	struct ice_parser *psr;
 	uint8_t item_num = 0;
 
@@ -1864,4 +1863,7 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
 		switch (item_type) {
 		case RTE_FLOW_ITEM_TYPE_RAW: {
+			if (ad->psr == NULL)
+				return -rte_errno;
+
 			raw_spec = item->spec;
 			raw_mask = item->mask;
@@ -1875,5 +1877,4 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
 			unsigned char *tmp_mask =
 				(uint8_t *)(uintptr_t)raw_mask->pattern;
-			uint16_t udp_port = 0;
 			uint16_t tmp_val = 0;
 			uint8_t pkt_len = 0;
@@ -1924,13 +1925,6 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
 			pkt_len /= 2;
 
-			if (ice_parser_create(&ad->hw, &psr))
+			if (ice_parser_run(ad->psr, tmp_spec, pkt_len, &rslt))
 				return -rte_errno;
-			if (ice_get_open_tunnel_port(&ad->hw, TNL_VXLAN,
-						     &udp_port))
-				ice_parser_vxlan_tunnel_set(psr, udp_port,
-							    true);
-			if (ice_parser_run(psr, tmp_spec, pkt_len, &rslt))
-				return -rte_errno;
-			ice_parser_destroy(psr);
 
 			if (!tmp_mask)
diff --git a/drivers/net/ice/ice_generic_flow.c b/drivers/net/ice/ice_generic_flow.c
index 406a0a953f..f9be3a5c94 100644
--- a/drivers/net/ice/ice_generic_flow.c
+++ b/drivers/net/ice/ice_generic_flow.c
@@ -1827,4 +1827,7 @@ ice_flow_init(struct ice_adapter *ad)
 	rte_spinlock_init(&pf->flow_ops_lock);
 
+	if (ice_parser_create(&ad->hw, &ad->psr) != ICE_SUCCESS)
+		PMD_INIT_LOG(WARNING, "Failed to initialize DDP parser, raw packet filter will not be supported");
+
 	RTE_TAILQ_FOREACH_SAFE(engine, &engine_list, node, temp) {
 		if (engine->init == NULL) {
@@ -1881,4 +1884,9 @@ ice_flow_uninit(struct ice_adapter *ad)
 		rte_free(p_parser);
 	}
+
+	if (ad->psr != NULL) {
+		ice_parser_destroy(ad->psr);
+		ad->psr = NULL;
+	}
 }
 
diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c
index afbb357fa3..f35727856e 100644
--- a/drivers/net/ice/ice_hash.c
+++ b/drivers/net/ice/ice_hash.c
@@ -654,5 +654,4 @@ ice_hash_parse_raw_pattern(struct ice_adapter *ad,
 	struct ice_parser_profile prof;
 	struct ice_parser_result rslt;
-	struct ice_parser *psr;
 	uint8_t *pkt_buf, *msk_buf;
 	uint8_t spec_len, pkt_len;
@@ -661,4 +660,7 @@ ice_hash_parse_raw_pattern(struct ice_adapter *ad,
 	int i, j;
 
+	if (ad->psr == NULL)
+		return -rte_errno;
+
 	raw_spec = item->spec;
 	raw_mask = item->mask;
@@ -714,9 +716,6 @@ ice_hash_parse_raw_pattern(struct ice_adapter *ad,
 	}
 
-	if (ice_parser_create(&ad->hw, &psr))
+	if (ice_parser_run(ad->psr, pkt_buf, pkt_len, &rslt))
 		return -rte_errno;
-	if (ice_parser_run(psr, pkt_buf, pkt_len, &rslt))
-		return -rte_errno;
-	ice_parser_destroy(psr);
 
 	if (ice_parser_profile_init(&rslt, pkt_buf, msk_buf,
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-05-10 13:24:21.796636308 +0100
+++ 0008-net-ice-refactor-parser-usage.patch	2022-05-10 13:24:21.569646315 +0100
@@ -1 +1 @@
-From 531d2555c8a644030f1ee7d3c9edf1db9c35d6ef Mon Sep 17 00:00:00 2001
+From aedf24edbb04a77fe2fcde21967a47a2c306515e Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 531d2555c8a644030f1ee7d3c9edf1db9c35d6ef ]
+
@@ -15 +16,0 @@
-Cc: stable@dpdk.org
@@ -28 +29 @@
-index 73e550f5fb..8bb34b874b 100644
+index 2ae25b16f6..ab3976a319 100644
@@ -31 +32 @@
-@@ -5622,4 +5622,6 @@ ice_dev_udp_tunnel_port_add(struct rte_eth_dev *dev,
+@@ -5455,4 +5455,6 @@ ice_dev_udp_tunnel_port_add(struct rte_eth_dev *dev,
@@ -38 +39 @@
-@@ -5629,4 +5631,7 @@ ice_dev_udp_tunnel_port_add(struct rte_eth_dev *dev,
+@@ -5462,4 +5464,7 @@ ice_dev_udp_tunnel_port_add(struct rte_eth_dev *dev,
@@ -46 +47 @@
-@@ -5646,4 +5651,6 @@ ice_dev_udp_tunnel_port_del(struct rte_eth_dev *dev,
+@@ -5479,4 +5484,6 @@ ice_dev_udp_tunnel_port_del(struct rte_eth_dev *dev,
@@ -53 +54 @@
-@@ -5653,4 +5660,7 @@ ice_dev_udp_tunnel_port_del(struct rte_eth_dev *dev,
+@@ -5486,4 +5493,7 @@ ice_dev_udp_tunnel_port_del(struct rte_eth_dev *dev,
@@ -62 +63 @@
-index 3ab310628f..3d8427225f 100644
+index c0d1baa1ec..56e53a6df3 100644
@@ -65 +66 @@
-@@ -562,4 +562,5 @@ struct ice_adapter {
+@@ -537,4 +537,5 @@ struct ice_adapter {
@@ -72 +73 @@
-index 7954c6d8ea..0982478feb 100644
+index ff1cee1195..99053978a9 100644
@@ -75 +76 @@
-@@ -1827,5 +1827,4 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
+@@ -1829,5 +1829,4 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
@@ -81 +82 @@
-@@ -1862,4 +1861,7 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
+@@ -1864,4 +1863,7 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
@@ -89 +90 @@
-@@ -1873,5 +1875,4 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
+@@ -1875,5 +1877,4 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
@@ -95 +96 @@
-@@ -1922,13 +1923,6 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
+@@ -1924,13 +1925,6 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
@@ -111 +112 @@
-index 53b1c0b69a..57eb002bde 100644
+index 406a0a953f..f9be3a5c94 100644
@@ -114 +115 @@
-@@ -1832,4 +1832,7 @@ ice_flow_init(struct ice_adapter *ad)
+@@ -1827,4 +1827,7 @@ ice_flow_init(struct ice_adapter *ad)
@@ -122 +123 @@
-@@ -1886,4 +1889,9 @@ ice_flow_uninit(struct ice_adapter *ad)
+@@ -1881,4 +1884,9 @@ ice_flow_uninit(struct ice_adapter *ad)


  parent reply	other threads:[~2022-05-10 12:30 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-10 12:29 patch 'eal/windows: add missing C++ include guards' " Kevin Traynor
2022-05-10 12:29 ` patch 'net/dpaa2: fix dpdmux default interface' " Kevin Traynor
2022-05-10 12:29 ` patch 'examples/bond: fix invalid use of trylock' " Kevin Traynor
2022-05-10 12:29 ` patch 'test/bpf: skip test if libpcap is unavailable' " Kevin Traynor
2022-05-10 12:29 ` patch 'net/ice: improve performance of Rx timestamp offload' " Kevin Traynor
2022-05-10 12:29 ` patch 'net/i40e: populate error in flow director parser' " Kevin Traynor
2022-05-10 12:29 ` patch 'net/ice: add missing Tx burst mode name' " Kevin Traynor
2022-05-10 12:29 ` Kevin Traynor [this message]
2022-05-10 12:29 ` patch 'net/ice: fix raw flow input pattern parsing' " Kevin Traynor
2022-05-10 12:29 ` patch 'net/netvsc: fix calculation of checksums based on mbuf flag' " Kevin Traynor
2022-05-10 12:29 ` patch 'common/mlx5: fix memory region range calculation' " Kevin Traynor
2022-05-10 12:29 ` patch 'net/mlx5: fix Tx when inlining is impossible' " Kevin Traynor
2022-05-10 12:29 ` patch 'net/mlx5: fix probing with secondary bonding member' " Kevin Traynor
2022-05-10 12:29 ` patch 'net/mlx5: fix counter in non-termination meter' " Kevin Traynor
2022-05-10 12:29 ` patch 'net/mlx5: restrict Rx queue array access to boundary' " Kevin Traynor
2022-05-10 12:29 ` patch 'net/mlx5: fix GTP handling in header modify action' " Kevin Traynor
2022-05-10 12:29 ` patch 'net/mlx5: fix Rx/Tx stats concurrency' " Kevin Traynor
2022-05-10 12:29 ` patch 'test/table: fix buffer overflow on lpm entry' " Kevin Traynor
2022-05-10 12:29 ` patch 'mem: skip attaching external memory in secondary process' " Kevin Traynor
2022-05-10 12:29 ` patch 'malloc: fix ASan handling for unmapped memory' " Kevin Traynor
2022-05-10 12:29 ` patch 'eal: fix C++ include for device event and DMA' " Kevin Traynor
2022-05-10 12:29 ` patch 'crypto/dpaa_sec: fix digest size' " Kevin Traynor
2022-05-10 12:30 ` patch 'security: fix SA lifetime comments' " Kevin Traynor
2022-05-10 12:30 ` patch 'crypto/mlx5: fix login cleanup' " Kevin Traynor
2022-05-10 12:30 ` patch 'crypto/dpaa2_sec: fix fle buffer leak' " Kevin Traynor
2022-05-10 12:30 ` patch 'crypto/dpaa2_sec: fix buffer pool ID check' " Kevin Traynor
2022-05-10 12:30 ` patch 'crypto/dpaa_sec: fix chained FD length in raw datapath' " Kevin Traynor
2022-05-10 12:30 ` patch 'crypto/dpaa2_sec: " Kevin Traynor
2022-05-10 12:30 ` patch 'crypto/dpaa_sec: fix secondary process probing' " Kevin Traynor
2022-05-10 12:30 ` patch 'crypto/dpaa2_sec: fix crypto operation pointer' " Kevin Traynor
2022-05-10 12:30 ` patch 'crypto/dpaa2_sec: fix operation status for simple FD' " Kevin Traynor
2022-05-10 12:30 ` patch 'common/dpaax: fix short MAC-I IV calculation for ZUC' " Kevin Traynor
2022-05-10 12:30 ` patch 'examples/l2fwd-crypto: fix stats refresh rate' " Kevin Traynor

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=20220510123010.159523-8-ktraynor@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=qi.z.zhang@intel.com \
    --cc=stable@dpdk.org \
    --cc=ting.xu@intel.com \
    /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

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git