patches for DPDK stable branches
 help / color / mirror / Atom feed
* patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8
@ 2023-02-23  9:36 luca.boccassi
  2023-02-23  9:36 ` patch 'kni: fix build on RHEL 9.1' " luca.boccassi
                   ` (69 more replies)
  0 siblings, 70 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Tyler Retzlaff; +Cc: Stephen Hemminger, David Marchand, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/77f9d2464c9a604214849c9c233a9e8dc8a0a7e9

Thanks.

Luca Boccassi

---
From 77f9d2464c9a604214849c9c233a9e8dc8a0a7e9 Mon Sep 17 00:00:00 2001
From: Tyler Retzlaff <roretzla@linux.microsoft.com>
Date: Fri, 16 Dec 2022 09:16:39 -0800
Subject: [PATCH] eal/windows: mark memory config as complete

[ upstream commit 40032e5e0787fb311cc89c45bd681740b0c9e266 ]

Memory configuration was not being marked as completed.
Add the missing call to rte_eal_init() for Windows.

This allows rte_thread_register to work on Windows and lcores_autotest
to be built and run Windows which also exercises the
rte_ctrl_thread_create API on Windows.

Fixes: 5c307ba2a5b1 ("eal: register non-EAL threads as lcores")

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: David Marchand <david.marchand@redhat.com>
---
 lib/librte_eal/windows/eal.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/librte_eal/windows/eal.c b/lib/librte_eal/windows/eal.c
index 892c69356d..e865427e97 100644
--- a/lib/librte_eal/windows/eal.c
+++ b/lib/librte_eal/windows/eal.c
@@ -437,6 +437,9 @@ rte_eal_init(int argc, char **argv)
 	 */
 	rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MAIN);
 	rte_eal_mp_wait_lcore();
+
+	eal_mcfg_complete();
+
 	return fctret;
 }
 
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:28.384681399 +0000
+++ 0001-eal-windows-mark-memory-config-as-complete.patch	2023-02-23 09:36:28.166168835 +0000
@@ -1 +1 @@
-From 40032e5e0787fb311cc89c45bd681740b0c9e266 Mon Sep 17 00:00:00 2001
+From 77f9d2464c9a604214849c9c233a9e8dc8a0a7e9 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 40032e5e0787fb311cc89c45bd681740b0c9e266 ]
+
@@ -19 +21 @@
- lib/eal/windows/eal.c | 3 +++
+ lib/librte_eal/windows/eal.c | 3 +++
@@ -22,5 +24,5 @@
-diff --git a/lib/eal/windows/eal.c b/lib/eal/windows/eal.c
-index adb929a014..56fadc7afe 100644
---- a/lib/eal/windows/eal.c
-+++ b/lib/eal/windows/eal.c
-@@ -462,6 +462,9 @@ rte_eal_init(int argc, char **argv)
+diff --git a/lib/librte_eal/windows/eal.c b/lib/librte_eal/windows/eal.c
+index 892c69356d..e865427e97 100644
+--- a/lib/librte_eal/windows/eal.c
++++ b/lib/librte_eal/windows/eal.c
+@@ -437,6 +437,9 @@ rte_eal_init(int argc, char **argv)

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'kni: fix build on RHEL 9.1' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'doc: fix dependency setup in l2fwd-cat example guide' " luca.boccassi
                   ` (68 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Daxue Gao, David Marchand, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/21a2d0184ffb6f4f686f9014d97366efd2009b86

Thanks.

Luca Boccassi

---
From 21a2d0184ffb6f4f686f9014d97366efd2009b86 Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit@amd.com>
Date: Fri, 6 Jan 2023 20:13:14 +0000
Subject: [PATCH] kni: fix build on RHEL 9.1

[ upstream commit 8b07816b396f2075f44b4ffa65ecbd0d5a624661 ]

Linux kernel in the RHEL9.1 seems backported Linux commit 2655926aea9b
("net: Remove netif_rx_any_context() and netif_rx_ni().") that drops
netif_rx_ni().

This was fixed in DPDK for vanilla kernel with the commit
c98600d4bed6 ("kni: fix build with Linux 5.18").

Add RHEL9.1 check for the netif_rx_ni() usage to fix build error.

Bugzilla ID: 1076

Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
Tested-by: Daxue Gao <daxuex.gao@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
---
 kernel/linux/kni/compat.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h
index 3a86d12bbc..7aa6cd9fca 100644
--- a/kernel/linux/kni/compat.h
+++ b/kernel/linux/kni/compat.h
@@ -146,6 +146,8 @@
 #define HAVE_ETH_HW_ADDR_SET
 #endif
 
-#if KERNEL_VERSION(5, 18, 0) > LINUX_VERSION_CODE
+#if KERNEL_VERSION(5, 18, 0) > LINUX_VERSION_CODE && \
+	(!(defined(RHEL_RELEASE_CODE) && \
+	 RHEL_RELEASE_VERSION(9, 1) <= RHEL_RELEASE_CODE))
 #define HAVE_NETIF_RX_NI
 #endif
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:28.417041836 +0000
+++ 0002-kni-fix-build-on-RHEL-9.1.patch	2023-02-23 09:36:28.166168835 +0000
@@ -1 +1 @@
-From 8b07816b396f2075f44b4ffa65ecbd0d5a624661 Mon Sep 17 00:00:00 2001
+From 21a2d0184ffb6f4f686f9014d97366efd2009b86 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 8b07816b396f2075f44b4ffa65ecbd0d5a624661 ]
+
@@ -16 +17,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'doc: fix dependency setup in l2fwd-cat example guide' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
  2023-02-23  9:36 ` patch 'kni: fix build on RHEL 9.1' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'devtools: fix escaped space in grep pattern' " luca.boccassi
                   ` (67 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/94c37007c13f673ac403f2e9d8ff89dc2257fdb3

Thanks.

Luca Boccassi

---
From 94c37007c13f673ac403f2e9d8ff89dc2257fdb3 Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas@monjalon.net>
Date: Fri, 30 Dec 2022 21:52:15 +0100
Subject: [PATCH] doc: fix dependency setup in l2fwd-cat example guide

[ upstream commit 8c8bb7f04dfcb50140a508f883e1129e0bb185ba ]

The environment variable PQOS_INSTALL_PATH is not used anymore,
but the documentation was not updated.

Fixes: fda34680eb9a ("examples: remove legacy sections of makefiles")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 doc/guides/sample_app_ug/l2_forward_cat.rst | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/doc/guides/sample_app_ug/l2_forward_cat.rst b/doc/guides/sample_app_ug/l2_forward_cat.rst
index c1be2d7dff..aa4c0e2b07 100644
--- a/doc/guides/sample_app_ug/l2_forward_cat.rst
+++ b/doc/guides/sample_app_ug/l2_forward_cat.rst
@@ -50,13 +50,12 @@ Compiling the Application
     * https://github.com/01org/intel-cmt-cat
 
 
-#. To compile the application export the path to PQoS lib
-   and the DPDK source tree and go to the example directory:
+To compile the application, export the path to PQoS lib:
 
-   .. code-block:: console
-
-       export PQOS_INSTALL_PATH=/path/to/libpqos
+.. code-block:: console
 
+   export CFLAGS=-I/path/to/intel-cmt-cat/include
+   export LDFLAGS=-L/path/to/intel-cmt-cat/lib
 
 To compile the sample application see :doc:`compiling`.
 
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:28.452812016 +0000
+++ 0003-doc-fix-dependency-setup-in-l2fwd-cat-example-guide.patch	2023-02-23 09:36:28.166168835 +0000
@@ -1 +1 @@
-From 8c8bb7f04dfcb50140a508f883e1129e0bb185ba Mon Sep 17 00:00:00 2001
+From 94c37007c13f673ac403f2e9d8ff89dc2257fdb3 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 8c8bb7f04dfcb50140a508f883e1129e0bb185ba ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -18 +19 @@
-index 3ada3575ba..51621b692f 100644
+index c1be2d7dff..aa4c0e2b07 100644

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'devtools: fix escaped space in grep pattern' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
  2023-02-23  9:36 ` patch 'kni: fix build on RHEL 9.1' " luca.boccassi
  2023-02-23  9:36 ` patch 'doc: fix dependency setup in l2fwd-cat example guide' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'app/crypto-perf: fix number of segments' " luca.boccassi
                   ` (66 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: Tyler Retzlaff, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/60af5ed2f64ffdec1a11f26272012f8f11e5fae1

Thanks.

Luca Boccassi

---
From 60af5ed2f64ffdec1a11f26272012f8f11e5fae1 Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas@monjalon.net>
Date: Tue, 10 Jan 2023 22:23:27 +0100
Subject: [PATCH] devtools: fix escaped space in grep pattern

[ upstream commit 7f6b150cb79dad10b82fe004e5b2310e39507381 ]

Since grep 3.8, a warning is printed if a space is escaped in a pattern:
	grep: warning: stray \ before white space

There was an occurence of such extra backslash in check-git-log.sh.

Fixes: d448efa259e9 ("devtools: export dictionary for commit title check")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 devtools/check-git-log.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/devtools/check-git-log.sh b/devtools/check-git-log.sh
index 885d444b3d..2d357293af 100755
--- a/devtools/check-git-log.sh
+++ b/devtools/check-git-log.sh
@@ -113,7 +113,7 @@ words="$selfdir/words-case.txt"
 for word in $(cat $words); do
 	bad=$(echo "$headlines" | grep -iw $word | grep -vw $word)
 	if [ "$word" = "Tx" ]; then
-		bad=$(echo $bad | grep -v 'OCTEON\ TX')
+		bad=$(echo $bad | grep -v 'OCTEON TX')
 	fi
 	for bad_line in $bad; do
 		bad_word=$(echo $bad_line | cut -d":" -f2 | grep -iwo $word)
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:28.488545342 +0000
+++ 0004-devtools-fix-escaped-space-in-grep-pattern.patch	2023-02-23 09:36:28.166168835 +0000
@@ -1 +1 @@
-From 7f6b150cb79dad10b82fe004e5b2310e39507381 Mon Sep 17 00:00:00 2001
+From 60af5ed2f64ffdec1a11f26272012f8f11e5fae1 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 7f6b150cb79dad10b82fe004e5b2310e39507381 ]
+
@@ -12 +13,0 @@
-Cc: stable@dpdk.org
@@ -21 +22 @@
-index 01d8aa0717..e26205814b 100755
+index 885d444b3d..2d357293af 100755
@@ -24 +25 @@
-@@ -120,7 +120,7 @@ words="$selfdir/words-case.txt"
+@@ -113,7 +113,7 @@ words="$selfdir/words-case.txt"

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'app/crypto-perf: fix number of segments' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (2 preceding siblings ...)
  2023-02-23  9:36 ` patch 'devtools: fix escaped space in grep pattern' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'eventdev/eth_tx: fix devices loop' " luca.boccassi
                   ` (65 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Anoob Joseph; +Cc: Akhil Goyal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From f500d1f0f42a9705a14814ee3f03bd286e9627c9 Mon Sep 17 00:00:00 2001
From: Anoob Joseph <anoobj@marvell.com>
Date: Tue, 20 Dec 2022 10:25:33 +0530
Subject: [PATCH] app/crypto-perf: fix number of segments

[ upstream commit e03ecc56edd72acb077e2b9bb95ae34f54172a0c ]

When segment size is provided, the total number of segments would be
calculated. Segment size updates due to headroom/tailroom need to be
accounted for when determining total number of segments required.

Fixes: c1670ae0022b ("app/crypto-perf: honour min headroom/tailroom")

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Akhil Goyal <gakhil@marvell.com>
---
 app/test-crypto-perf/cperf_test_common.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/app/test-crypto-perf/cperf_test_common.c b/app/test-crypto-perf/cperf_test_common.c
index 12925c7f22..58bc2439ed 100644
--- a/app/test-crypto-perf/cperf_test_common.c
+++ b/app/test-crypto-perf/cperf_test_common.c
@@ -166,9 +166,11 @@ cperf_alloc_common_memory(const struct cperf_options *options,
 				RTE_CACHE_LINE_ROUNDUP(crypto_op_total_size);
 	uint32_t mbuf_size = sizeof(struct rte_mbuf) + options->segment_sz;
 	uint32_t max_size = options->max_buffer_size + options->digest_sz;
-	uint16_t segments_nb = (max_size % options->segment_sz) ?
-			(max_size / options->segment_sz) + 1 :
-			max_size / options->segment_sz;
+	uint32_t segment_data_len = options->segment_sz - options->headroom_sz -
+				    options->tailroom_sz;
+	uint16_t segments_nb = (max_size % segment_data_len) ?
+				(max_size / segment_data_len) + 1 :
+				(max_size / segment_data_len);
 	uint32_t obj_size = crypto_op_total_size_padded +
 				(mbuf_size * segments_nb);
 
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:28.523871539 +0000
+++ 0005-app-crypto-perf-fix-number-of-segments.patch	2023-02-23 09:36:28.166168835 +0000
@@ -1 +1 @@
-From e03ecc56edd72acb077e2b9bb95ae34f54172a0c Mon Sep 17 00:00:00 2001
+From f500d1f0f42a9705a14814ee3f03bd286e9627c9 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit e03ecc56edd72acb077e2b9bb95ae34f54172a0c ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index 27646cd619..932aab16df 100644
+index 12925c7f22..58bc2439ed 100644
@@ -23 +24 @@
-@@ -197,9 +197,11 @@ cperf_alloc_common_memory(const struct cperf_options *options,
+@@ -166,9 +166,11 @@ cperf_alloc_common_memory(const struct cperf_options *options,

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'eventdev/eth_tx: fix devices loop' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (3 preceding siblings ...)
  2023-02-23  9:36 ` patch 'app/crypto-perf: fix number of segments' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'crypto/qat: fix stream cipher direction' " luca.boccassi
                   ` (64 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Naga Harish K S V; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/70b0def9c8018d12a6c8e2cdbf71db69bde1c0eb

Thanks.

Luca Boccassi

---
From 70b0def9c8018d12a6c8e2cdbf71db69bde1c0eb Mon Sep 17 00:00:00 2001
From: Naga Harish K S V <s.v.naga.harish.k@intel.com>
Date: Sat, 7 Jan 2023 10:40:58 -0600
Subject: [PATCH] eventdev/eth_tx: fix devices loop

[ upstream commit a870c7e863a5996eb842befa30c6a7d3f9729fcf ]

Adapter service function is using RTE_ETH_FOREACH_DEV() macro for
looping through all available eth devices and flushing any pending
buffered packets.

When Traffic Management nodes (vports) are added and deleted dynamically,
there is a possibility of accessing the device info memory beyond the
allocated limit which can result in segfaults. Fixed the logic to
prevent illegal memory access.

Fixes: a3bbf2e09756 ("eventdev: add eth Tx adapter implementation")

Signed-off-by: Naga Harish K S V <s.v.naga.harish.k@intel.com>
---
 lib/librte_eventdev/rte_event_eth_tx_adapter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_eventdev/rte_event_eth_tx_adapter.c b/lib/librte_eventdev/rte_event_eth_tx_adapter.c
index 8870071a8b..6ec435af3e 100644
--- a/lib/librte_eventdev/rte_event_eth_tx_adapter.c
+++ b/lib/librte_eventdev/rte_event_eth_tx_adapter.c
@@ -582,7 +582,7 @@ txa_service_func(void *args)
 		RTE_ETH_FOREACH_DEV(i) {
 			uint16_t q;
 
-			if (i == txa->dev_count)
+			if (i >= txa->dev_count)
 				break;
 
 			dev = tdi[i].dev;
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:28.559518112 +0000
+++ 0006-eventdev-eth_tx-fix-devices-loop.patch	2023-02-23 09:36:28.166168835 +0000
@@ -1 +1 @@
-From a870c7e863a5996eb842befa30c6a7d3f9729fcf Mon Sep 17 00:00:00 2001
+From 70b0def9c8018d12a6c8e2cdbf71db69bde1c0eb Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a870c7e863a5996eb842befa30c6a7d3f9729fcf ]
+
@@ -16 +17,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
- lib/eventdev/rte_event_eth_tx_adapter.c | 2 +-
+ lib/librte_eventdev/rte_event_eth_tx_adapter.c | 2 +-
@@ -23,5 +24,5 @@
-diff --git a/lib/eventdev/rte_event_eth_tx_adapter.c b/lib/eventdev/rte_event_eth_tx_adapter.c
-index c780ee1264..6e9bcb1b79 100644
---- a/lib/eventdev/rte_event_eth_tx_adapter.c
-+++ b/lib/eventdev/rte_event_eth_tx_adapter.c
-@@ -678,7 +678,7 @@ txa_service_func(void *args)
+diff --git a/lib/librte_eventdev/rte_event_eth_tx_adapter.c b/lib/librte_eventdev/rte_event_eth_tx_adapter.c
+index 8870071a8b..6ec435af3e 100644
+--- a/lib/librte_eventdev/rte_event_eth_tx_adapter.c
++++ b/lib/librte_eventdev/rte_event_eth_tx_adapter.c
+@@ -582,7 +582,7 @@ txa_service_func(void *args)

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'crypto/qat: fix stream cipher direction' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (4 preceding siblings ...)
  2023-02-23  9:36 ` patch 'eventdev/eth_tx: fix devices loop' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'fbarray: fix metadata dump' " luca.boccassi
                   ` (63 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Ciara Power; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/09162b9e22428a67be570cab8b4231b5810ef246

Thanks.

Luca Boccassi

---
From 09162b9e22428a67be570cab8b4231b5810ef246 Mon Sep 17 00:00:00 2001
From: Ciara Power <ciara.power@intel.com>
Date: Wed, 21 Dec 2022 14:05:55 +0000
Subject: [PATCH] crypto/qat: fix stream cipher direction

[ upstream commit 96ef7feb7a63ee74a99e221d255d91e8af3cf196 ]

Stream ciphers use ENCRYPT mode in HW for both encryption and
decryption operations. This patch adds in an overwrite to always set
ENCRYPT mode for these algorithms.

Fixes: d9b7d5bbc845 ("crypto/qat: add ZUC EEA3/EIA3 capability")

Signed-off-by: Ciara Power <ciara.power@intel.com>
---
 drivers/crypto/qat/qat_sym_session.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/qat/qat_sym_session.c b/drivers/crypto/qat/qat_sym_session.c
index 10db656316..d397bde1ca 100644
--- a/drivers/crypto/qat/qat_sym_session.c
+++ b/drivers/crypto/qat/qat_sym_session.c
@@ -1572,9 +1572,10 @@ int qat_sym_session_aead_create_cd_cipher(struct qat_sym_session *cdesc,
 		key_convert = ICP_QAT_HW_CIPHER_NO_CONVERT;
 	} else if (cdesc->qat_cipher_alg == ICP_QAT_HW_CIPHER_ALGO_SNOW_3G_UEA2
 		|| cdesc->qat_cipher_alg ==
-			ICP_QAT_HW_CIPHER_ALGO_ZUC_3G_128_EEA3)
+			ICP_QAT_HW_CIPHER_ALGO_ZUC_3G_128_EEA3) {
 		key_convert = ICP_QAT_HW_CIPHER_KEY_CONVERT;
-	else if (cdesc->qat_dir == ICP_QAT_HW_CIPHER_ENCRYPT)
+		cdesc->qat_dir = ICP_QAT_HW_CIPHER_ENCRYPT;
+	} else if (cdesc->qat_dir == ICP_QAT_HW_CIPHER_ENCRYPT)
 		key_convert = ICP_QAT_HW_CIPHER_NO_CONVERT;
 	else
 		key_convert = ICP_QAT_HW_CIPHER_KEY_CONVERT;
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:28.596764182 +0000
+++ 0007-crypto-qat-fix-stream-cipher-direction.patch	2023-02-23 09:36:28.170168909 +0000
@@ -1 +1 @@
-From 96ef7feb7a63ee74a99e221d255d91e8af3cf196 Mon Sep 17 00:00:00 2001
+From 09162b9e22428a67be570cab8b4231b5810ef246 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 96ef7feb7a63ee74a99e221d255d91e8af3cf196 ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
-index ea1b729076..978ee49dce 100644
+index 10db656316..d397bde1ca 100644
@@ -22 +23 @@
-@@ -1884,9 +1884,10 @@ int qat_sym_cd_cipher_set(struct qat_sym_session *cdesc,
+@@ -1572,9 +1572,10 @@ int qat_sym_session_aead_create_cd_cipher(struct qat_sym_session *cdesc,
@@ -33,2 +34,2 @@
- 	else if (cdesc->qat_mode == ICP_QAT_HW_CIPHER_AEAD_MODE)
- 		key_convert = ICP_QAT_HW_CIPHER_NO_CONVERT;
+ 	else
+ 		key_convert = ICP_QAT_HW_CIPHER_KEY_CONVERT;

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'fbarray: fix metadata dump' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (5 preceding siblings ...)
  2023-02-23  9:36 ` patch 'crypto/qat: fix stream cipher direction' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'graph: fix node shrink' " luca.boccassi
                   ` (62 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: David Marchand; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/10b9f45a293d80760bf0de4f5531ce9c83c48d29

Thanks.

Luca Boccassi

---
From 10b9f45a293d80760bf0de4f5531ce9c83c48d29 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Tue, 3 Jan 2023 11:48:48 +0100
Subject: [PATCH] fbarray: fix metadata dump

[ upstream commit 70eb4069b05c82494155a89eb8d08d8d2f57b059 ]

If the passed fbarray is invalid, its lock was not taken before
releasing.

Fixes: c44d09811b40 ("eal: add shared indexed file-backed array")

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/librte_eal/common/eal_common_fbarray.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/librte_eal/common/eal_common_fbarray.c b/lib/librte_eal/common/eal_common_fbarray.c
index 592ec58594..1402cb521a 100644
--- a/lib/librte_eal/common/eal_common_fbarray.c
+++ b/lib/librte_eal/common/eal_common_fbarray.c
@@ -1485,7 +1485,7 @@ rte_fbarray_dump_metadata(struct rte_fbarray *arr, FILE *f)
 
 	if (fully_validate(arr->name, arr->elt_sz, arr->len)) {
 		fprintf(f, "Invalid file-backed array\n");
-		goto out;
+		return;
 	}
 
 	/* prevent array from changing under us */
@@ -1499,6 +1499,5 @@ rte_fbarray_dump_metadata(struct rte_fbarray *arr, FILE *f)
 
 	for (i = 0; i < msk->n_masks; i++)
 		fprintf(f, "msk idx %i: 0x%016" PRIx64 "\n", i, msk->data[i]);
-out:
 	rte_rwlock_read_unlock(&arr->rwlock);
 }
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:28.633424949 +0000
+++ 0008-fbarray-fix-metadata-dump.patch	2023-02-23 09:36:28.174168983 +0000
@@ -1 +1 @@
-From 70eb4069b05c82494155a89eb8d08d8d2f57b059 Mon Sep 17 00:00:00 2001
+From 10b9f45a293d80760bf0de4f5531ce9c83c48d29 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 70eb4069b05c82494155a89eb8d08d8d2f57b059 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -14 +15 @@
- lib/eal/common/eal_common_fbarray.c | 3 +--
+ lib/librte_eal/common/eal_common_fbarray.c | 3 +--
@@ -17,5 +18,5 @@
-diff --git a/lib/eal/common/eal_common_fbarray.c b/lib/eal/common/eal_common_fbarray.c
-index f11f87979f..169e66e04b 100644
---- a/lib/eal/common/eal_common_fbarray.c
-+++ b/lib/eal/common/eal_common_fbarray.c
-@@ -1482,7 +1482,7 @@ rte_fbarray_dump_metadata(struct rte_fbarray *arr, FILE *f)
+diff --git a/lib/librte_eal/common/eal_common_fbarray.c b/lib/librte_eal/common/eal_common_fbarray.c
+index 592ec58594..1402cb521a 100644
+--- a/lib/librte_eal/common/eal_common_fbarray.c
++++ b/lib/librte_eal/common/eal_common_fbarray.c
+@@ -1485,7 +1485,7 @@ rte_fbarray_dump_metadata(struct rte_fbarray *arr, FILE *f)
@@ -30 +31 @@
-@@ -1496,6 +1496,5 @@ rte_fbarray_dump_metadata(struct rte_fbarray *arr, FILE *f)
+@@ -1499,6 +1499,5 @@ rte_fbarray_dump_metadata(struct rte_fbarray *arr, FILE *f)

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'graph: fix node shrink' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (6 preceding siblings ...)
  2023-02-23  9:36 ` patch 'fbarray: fix metadata dump' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'net/nfp: fix firmware name derived from PCI name' " luca.boccassi
                   ` (61 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: David Marchand; +Cc: Kiran Kumar K, Jerin Jacob, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/5354cee5a09ad5083b9e0e034c4ce9a0bc04c26c

Thanks.

Luca Boccassi

---
From 5354cee5a09ad5083b9e0e034c4ce9a0bc04c26c Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Thu, 19 Jan 2023 11:32:34 +0100
Subject: [PATCH] graph: fix node shrink

[ upstream commit 99cc0a9ab6730d4df70dba4b19e78e87ad7ba110 ]

If the node id check failed, graph_lock was not taken before releasing.

Fixes: c59dac2ca14a ("graph: implement node operations")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Kiran Kumar K <kirankumark@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
---
 lib/librte_graph/node.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/librte_graph/node.c b/lib/librte_graph/node.c
index 873c9ab16d..ecbc4e5504 100644
--- a/lib/librte_graph/node.c
+++ b/lib/librte_graph/node.c
@@ -310,16 +310,16 @@ rte_node_edge_shrink(rte_node_t id, rte_edge_t size)
 		if (node->id == id) {
 			if (node->nb_edges < size) {
 				rte_errno = E2BIG;
-				goto fail;
+			} else {
+				node->nb_edges = size;
+				rc = size;
 			}
-			node->nb_edges = size;
-			rc = size;
 			break;
 		}
 	}
 
-fail:
 	graph_spinlock_unlock();
+fail:
 	return rc;
 }
 
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:28.670013783 +0000
+++ 0009-graph-fix-node-shrink.patch	2023-02-23 09:36:28.174168983 +0000
@@ -1 +1 @@
-From 99cc0a9ab6730d4df70dba4b19e78e87ad7ba110 Mon Sep 17 00:00:00 2001
+From 5354cee5a09ad5083b9e0e034c4ce9a0bc04c26c Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 99cc0a9ab6730d4df70dba4b19e78e87ad7ba110 ]
+
@@ -9 +10,0 @@
-Cc: stable@dpdk.org
@@ -15 +16 @@
- lib/graph/node.c | 8 ++++----
+ lib/librte_graph/node.c | 8 ++++----
@@ -18,5 +19,5 @@
-diff --git a/lib/graph/node.c b/lib/graph/node.c
-index fc6345de07..149414dcd9 100644
---- a/lib/graph/node.c
-+++ b/lib/graph/node.c
-@@ -300,16 +300,16 @@ rte_node_edge_shrink(rte_node_t id, rte_edge_t size)
+diff --git a/lib/librte_graph/node.c b/lib/librte_graph/node.c
+index 873c9ab16d..ecbc4e5504 100644
+--- a/lib/librte_graph/node.c
++++ b/lib/librte_graph/node.c
+@@ -310,16 +310,16 @@ rte_node_edge_shrink(rte_node_t id, rte_edge_t size)

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/nfp: fix firmware name derived from PCI name' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (7 preceding siblings ...)
  2023-02-23  9:36 ` patch 'graph: fix node shrink' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'app/testpmd: fix interactive mode with no ports' " luca.boccassi
                   ` (60 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Peng Zhang; +Cc: Chaoyong He, Niklas Söderlund, Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From a323b6863ee5fdc8280b3be9b59c436c87c61e15 Mon Sep 17 00:00:00 2001
From: Peng Zhang <peng.zhang@corigine.com>
Date: Thu, 8 Dec 2022 11:31:16 +0800
Subject: [PATCH] net/nfp: fix firmware name derived from PCI name
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit 3ddb4cc0914a13d6dd47a497c1f61919b3ed1c20 ]

Driver looks for a firmware file whose name is derived from the PCI
name, the firmware file name format is described in the driver document.

But the firmware name used in the code is slightly different than the
name in documentation,
document has 'pci-0000:04:00.0.nffw' vs code has 'pci-04:00.0.nffw'.

After this commit, driver will look for firmware file consistent with
what is documented (in nfp.rst).

Fixes: 896c265ef954 ("net/nfp: use new CPP interface")

Signed-off-by: Peng Zhang <peng.zhang@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 drivers/net/nfp/nfp_net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index b09ccac345..f4925e1879 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -3538,7 +3538,7 @@ nfp_fw_upload(struct rte_pci_device *dev, struct nfp_nsp *nsp, char *card)
 
 	/* Then try the PCI name */
 	snprintf(fw_name, sizeof(fw_name), "%s/pci-%s.nffw", DEFAULT_FW_PATH,
-			dev->device.name);
+			dev->name);
 
 	PMD_DRV_LOG(DEBUG, "Trying with fw file: %s", fw_name);
 	fw_f = open(fw_name, O_RDONLY);
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:28.705293713 +0000
+++ 0010-net-nfp-fix-firmware-name-derived-from-PCI-name.patch	2023-02-23 09:36:28.178169056 +0000
@@ -1 +1 @@
-From 3ddb4cc0914a13d6dd47a497c1f61919b3ed1c20 Mon Sep 17 00:00:00 2001
+From a323b6863ee5fdc8280b3be9b59c436c87c61e15 Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit 3ddb4cc0914a13d6dd47a497c1f61919b3ed1c20 ]
+
@@ -20 +21,0 @@
-Cc: stable@dpdk.org
@@ -27 +28 @@
- drivers/net/nfp/nfp_ethdev.c | 2 +-
+ drivers/net/nfp/nfp_net.c | 2 +-
@@ -30,6 +31,6 @@
-diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
-index 0956ea81df..f22ae24b53 100644
---- a/drivers/net/nfp/nfp_ethdev.c
-+++ b/drivers/net/nfp/nfp_ethdev.c
-@@ -724,7 +724,7 @@ nfp_fw_upload(struct rte_pci_device *dev, struct nfp_nsp *nsp, char *card)
- 		goto load_fw;
+diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
+index b09ccac345..f4925e1879 100644
+--- a/drivers/net/nfp/nfp_net.c
++++ b/drivers/net/nfp/nfp_net.c
+@@ -3538,7 +3538,7 @@ nfp_fw_upload(struct rte_pci_device *dev, struct nfp_nsp *nsp, char *card)
+ 
@@ -42 +43 @@
- 	if (rte_firmware_read(fw_name, &fw_buf, &fsize) == 0)
+ 	fw_f = open(fw_name, O_RDONLY);

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'app/testpmd: fix interactive mode with no ports' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (8 preceding siblings ...)
  2023-02-23  9:36 ` patch 'net/nfp: fix firmware name derived from PCI name' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'examples/qos_sched: fix debug mode' " luca.boccassi
                   ` (59 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Gregory Etelson; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From b395818b0abc09e649e2f9e24a85abc8fcf3bfd1 Mon Sep 17 00:00:00 2001
From: Gregory Etelson <getelson@nvidia.com>
Date: Thu, 19 Jan 2023 19:45:59 +0200
Subject: [PATCH] app/testpmd: fix interactive mode with no ports

[ upstream commit 7e40372522c5a129da616d1420ff582968b81b46 ]

Testpmd terminated unconditionally if it failed to start all ports.

The patch allows testpmd to get into the command line,
if the interactive mode was requested.

Fixes: 6937d2103e22 ("app/testpmd: add option to not start device")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 app/test-pmd/testpmd.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 13d8c1c72a..799fa9f539 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -3990,8 +3990,13 @@ main(int argc, char** argv)
 		}
 	}
 
-	if (!no_device_start && start_port(RTE_PORT_ALL) != 0)
-		rte_exit(EXIT_FAILURE, "Start ports failed\n");
+	if (!no_device_start && start_port(RTE_PORT_ALL) != 0) {
+		if (!interactive) {
+			rte_eal_cleanup();
+			rte_exit(EXIT_FAILURE, "Start ports failed\n");
+		}
+		fprintf(stderr, "Start ports failed\n");
+	}
 
 	/* set all ports to promiscuous mode by default */
 	RTE_ETH_FOREACH_DEV(port_id) {
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:28.742111733 +0000
+++ 0011-app-testpmd-fix-interactive-mode-with-no-ports.patch	2023-02-23 09:36:28.182169130 +0000
@@ -1 +1 @@
-From 7e40372522c5a129da616d1420ff582968b81b46 Mon Sep 17 00:00:00 2001
+From b395818b0abc09e649e2f9e24a85abc8fcf3bfd1 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 7e40372522c5a129da616d1420ff582968b81b46 ]
+
@@ -12 +13,0 @@
-Cc: stable@dpdk.org
@@ -21 +22 @@
-index 134d79a555..e366f81a0f 100644
+index 13d8c1c72a..799fa9f539 100644
@@ -24 +25 @@
-@@ -4483,8 +4483,13 @@ main(int argc, char** argv)
+@@ -3990,8 +3990,13 @@ main(int argc, char** argv)

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'examples/qos_sched: fix debug mode' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (9 preceding siblings ...)
  2023-02-23  9:36 ` patch 'app/testpmd: fix interactive mode with no ports' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'build: fix dependencies lookup' " luca.boccassi
                   ` (58 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Megha Ajmera; +Cc: Cristian Dumitrescu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/9533aa034b5aea24ab7687b79ab9a83e8ed66f53

Thanks.

Luca Boccassi

---
From 9533aa034b5aea24ab7687b79ab9a83e8ed66f53 Mon Sep 17 00:00:00 2001
From: Megha Ajmera <megha.ajmera@intel.com>
Date: Thu, 5 Jan 2023 12:28:53 +0000
Subject: [PATCH] examples/qos_sched: fix debug mode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit af13b8711aa43a851d2c12e5d3f8f87dd047307e ]

This issue is happening due to non-initialization of some
fields in “rte_eth_rxconf” structure in our application.
Doing a memset to zero before initialization in HQoS application.

Fixes: de3cfa2c9823 ("sched: initial import")

Signed-off-by: Megha Ajmera <megha.ajmera@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
 examples/qos_sched/init.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
index 1abe003fc6..33e8a75526 100644
--- a/examples/qos_sched/init.c
+++ b/examples/qos_sched/init.c
@@ -82,6 +82,7 @@ app_init_port(uint16_t portid, struct rte_mempool *mp)
 	if (app_inited_port_mask & (1u << portid))
 		return 0;
 
+	memset(&rx_conf, 0, sizeof(struct rte_eth_rxconf));
 	rx_conf.rx_thresh.pthresh = rx_thresh.pthresh;
 	rx_conf.rx_thresh.hthresh = rx_thresh.hthresh;
 	rx_conf.rx_thresh.wthresh = rx_thresh.wthresh;
@@ -89,6 +90,7 @@ app_init_port(uint16_t portid, struct rte_mempool *mp)
 	rx_conf.rx_drop_en = 0;
 	rx_conf.rx_deferred_start = 0;
 
+	memset(&tx_conf, 0, sizeof(struct rte_eth_txconf));
 	tx_conf.tx_thresh.pthresh = tx_thresh.pthresh;
 	tx_conf.tx_thresh.hthresh = tx_thresh.hthresh;
 	tx_conf.tx_thresh.wthresh = tx_thresh.wthresh;
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:28.781443820 +0000
+++ 0012-examples-qos_sched-fix-debug-mode.patch	2023-02-23 09:36:28.182169130 +0000
@@ -1 +1 @@
-From af13b8711aa43a851d2c12e5d3f8f87dd047307e Mon Sep 17 00:00:00 2001
+From 9533aa034b5aea24ab7687b79ab9a83e8ed66f53 Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit af13b8711aa43a851d2c12e5d3f8f87dd047307e ]
+
@@ -14 +15,0 @@
-Cc: stable@dpdk.org
@@ -23 +24 @@
-index 0709aec10c..d28350e14a 100644
+index 1abe003fc6..33e8a75526 100644
@@ -26 +27 @@
-@@ -79,6 +79,7 @@ app_init_port(uint16_t portid, struct rte_mempool *mp)
+@@ -82,6 +82,7 @@ app_init_port(uint16_t portid, struct rte_mempool *mp)
@@ -34 +35 @@
-@@ -86,6 +87,7 @@ app_init_port(uint16_t portid, struct rte_mempool *mp)
+@@ -89,6 +90,7 @@ app_init_port(uint16_t portid, struct rte_mempool *mp)

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'build: fix dependencies lookup' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (10 preceding siblings ...)
  2023-02-23  9:36 ` patch 'examples/qos_sched: fix debug mode' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'vdpa/ifc: fix argument compatibility check' " luca.boccassi
                   ` (57 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From d079d8a2ea98b0c629af9f029dd35a053f0b7703 Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas@monjalon.net>
Date: Sun, 15 Jan 2023 17:53:15 +0100
Subject: [PATCH] build: fix dependencies lookup

[ upstream commit 97cfdbfa28ae32d7667d76807233375ffd04adff ]

The first parameter of the Meson function "find_library()"
should be the library name without the "lib" prefix.

Otherwise Meson prints this warning:
	WARNING: find_library('libexecinfo') starting in "lib"
	only works by accident and is not portable

Fixes: 1cd512b2f532 ("build: detect execinfo library on Linux")
Fixes: e1defba4cf66 ("raw/ifpga/base: support device tree")
Fixes: a489f5dbf437 ("baseband/turbo_sw: support meson build")
Fixes: 72c00ae9dba7 ("regex/cn9k: use cnxk infrastructure")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/meson.build                    |  4 ++--
 drivers/baseband/turbo_sw/meson.build | 26 +++++++++++++-------------
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/config/meson.build b/config/meson.build
index 2b7f647367..5058b733e3 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -152,7 +152,7 @@ if numa_dep.found() and cc.has_header('numaif.h')
 endif
 
 has_libfdt = 0
-fdt_dep = cc.find_library('libfdt', required: false)
+fdt_dep = cc.find_library('fdt', required: false)
 if fdt_dep.found() and cc.has_header('fdt.h')
 	dpdk_conf.set10('RTE_HAS_LIBFDT', true)
 	has_libfdt = 1
@@ -160,7 +160,7 @@ if fdt_dep.found() and cc.has_header('fdt.h')
 	dpdk_extra_ldflags += '-lfdt'
 endif
 
-libexecinfo = cc.find_library('libexecinfo', required: false)
+libexecinfo = cc.find_library('execinfo', required: false)
 if libexecinfo.found() and cc.has_header('execinfo.h')
 	add_project_link_arguments('-lexecinfo', language: 'c')
 	dpdk_extra_ldflags += '-lexecinfo'
diff --git a/drivers/baseband/turbo_sw/meson.build b/drivers/baseband/turbo_sw/meson.build
index 55ef4e4ec7..34bbd550d2 100644
--- a/drivers/baseband/turbo_sw/meson.build
+++ b/drivers/baseband/turbo_sw/meson.build
@@ -6,15 +6,15 @@ path = get_option('flexran_sdk')
 # check for FlexRAN SDK libraries for AVX2
 lib4g = cc.find_library('libturbo', dirs: [path + '/lib_turbo'], required: false)
 if lib4g.found()
-	ext_deps += cc.find_library('libturbo', dirs: [path + '/lib_turbo'], required: true)
-	ext_deps += cc.find_library('libcrc', dirs: [path + '/lib_crc'], required: true)
-	ext_deps += cc.find_library('librate_matching', dirs: [path + '/lib_rate_matching'], required: true)
-	ext_deps += cc.find_library('libcommon', dirs: [path + '/lib_common'], required: true)
-	ext_deps += cc.find_library('libstdc++', required: true)
-	ext_deps += cc.find_library('libirc', required: true)
-	ext_deps += cc.find_library('libimf', required: true)
-	ext_deps += cc.find_library('libipps', required: true)
-	ext_deps += cc.find_library('libsvml', required: true)
+	ext_deps += cc.find_library('turbo', dirs: [path + '/lib_turbo'], required: true)
+	ext_deps += cc.find_library('crc', dirs: [path + '/lib_crc'], required: true)
+	ext_deps += cc.find_library('rate_matching', dirs: [path + '/lib_rate_matching'], required: true)
+	ext_deps += cc.find_library('common', dirs: [path + '/lib_common'], required: true)
+	ext_deps += cc.find_library('stdc++', required: true)
+	ext_deps += cc.find_library('irc', required: true)
+	ext_deps += cc.find_library('imf', required: true)
+	ext_deps += cc.find_library('ipps', required: true)
+	ext_deps += cc.find_library('svml', required: true)
 	includes += include_directories(path + '/lib_turbo')
 	includes += include_directories(path + '/lib_crc')
 	includes += include_directories(path + '/lib_rate_matching')
@@ -25,10 +25,10 @@ endif
 # check for FlexRAN SDK libraries for AVX512
 lib5g = cc.find_library('libldpc_decoder_5gnr', dirs: [path + '/lib_ldpc_decoder_5gnr'], required: false)
 if lib5g.found()
-	ext_deps += cc.find_library('libldpc_encoder_5gnr', dirs: [path + '/lib_ldpc_encoder_5gnr'], required: true)
-	ext_deps += cc.find_library('libldpc_decoder_5gnr', dirs: [path + '/lib_ldpc_decoder_5gnr'], required: true)
-	ext_deps += cc.find_library('libLDPC_ratematch_5gnr', dirs: [path + '/lib_LDPC_ratematch_5gnr'], required: true)
-	ext_deps += cc.find_library('librate_dematching_5gnr', dirs: [path + '/lib_rate_dematching_5gnr'], required: true)
+	ext_deps += cc.find_library('ldpc_encoder_5gnr', dirs: [path + '/lib_ldpc_encoder_5gnr'], required: true)
+	ext_deps += cc.find_library('ldpc_decoder_5gnr', dirs: [path + '/lib_ldpc_decoder_5gnr'], required: true)
+	ext_deps += cc.find_library('LDPC_ratematch_5gnr', dirs: [path + '/lib_LDPC_ratematch_5gnr'], required: true)
+	ext_deps += cc.find_library('rate_dematching_5gnr', dirs: [path + '/lib_rate_dematching_5gnr'], required: true)
 	includes += include_directories(path + '/lib_ldpc_encoder_5gnr')
 	includes += include_directories(path + '/lib_ldpc_decoder_5gnr')
 	includes += include_directories(path + '/lib_LDPC_ratematch_5gnr')
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:28.816821048 +0000
+++ 0013-build-fix-dependencies-lookup.patch	2023-02-23 09:36:28.186169203 +0000
@@ -1 +1 @@
-From 97cfdbfa28ae32d7667d76807233375ffd04adff Mon Sep 17 00:00:00 2001
+From d079d8a2ea98b0c629af9f029dd35a053f0b7703 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 97cfdbfa28ae32d7667d76807233375ffd04adff ]
+
@@ -17 +18,0 @@
-Cc: stable@dpdk.org
@@ -23,3 +24,2 @@
- drivers/baseband/turbo_sw/meson.build | 10 +++++-----
- drivers/regex/cn9k/meson.build        |  4 ++--
- 3 files changed, 9 insertions(+), 9 deletions(-)
+ drivers/baseband/turbo_sw/meson.build | 26 +++++++++++++-------------
+ 2 files changed, 15 insertions(+), 15 deletions(-)
@@ -28 +28 @@
-index b9ec685f28..26f3168bc9 100644
+index 2b7f647367..5058b733e3 100644
@@ -31 +31 @@
-@@ -191,7 +191,7 @@ if find_libnuma
+@@ -152,7 +152,7 @@ if numa_dep.found() and cc.has_header('numaif.h')
@@ -38,4 +38,4 @@
-     dpdk_conf.set10('RTE_HAS_LIBFDT', true)
-     has_libfdt = 1
-@@ -199,7 +199,7 @@ if fdt_dep.found() and cc.has_header('fdt.h')
-     dpdk_extra_ldflags += '-lfdt'
+ 	dpdk_conf.set10('RTE_HAS_LIBFDT', true)
+ 	has_libfdt = 1
+@@ -160,7 +160,7 @@ if fdt_dep.found() and cc.has_header('fdt.h')
+ 	dpdk_extra_ldflags += '-lfdt'
@@ -46,3 +46,3 @@
- if libexecinfo.found()
-     add_project_link_arguments('-lexecinfo', language: 'c')
-     dpdk_extra_ldflags += '-lexecinfo'
+ if libexecinfo.found() and cc.has_header('execinfo.h')
+ 	add_project_link_arguments('-lexecinfo', language: 'c')
+ 	dpdk_extra_ldflags += '-lexecinfo'
@@ -50 +50 @@
-index 417ec63394..aeb9a76f9e 100644
+index 55ef4e4ec7..34bbd550d2 100644
@@ -53,34 +53,40 @@
-@@ -6,11 +6,11 @@ dep_turbo = dependency('flexran_sdk_turbo', required: false)
- dep_dec5g = dependency('flexran_sdk_ldpc_decoder_5gnr', required: false)
- 
- if dep_turbo.found()
--    ext_deps += cc.find_library('libstdc++', required: true)
--    ext_deps += cc.find_library('libirc', required: true)
--    ext_deps += cc.find_library('libimf', required: true)
--    ext_deps += cc.find_library('libipps', required: true)
--    ext_deps += cc.find_library('libsvml', required: true)
-+    ext_deps += cc.find_library('stdc++', required: true)
-+    ext_deps += cc.find_library('irc', required: true)
-+    ext_deps += cc.find_library('imf', required: true)
-+    ext_deps += cc.find_library('ipps', required: true)
-+    ext_deps += cc.find_library('svml', required: true)
-     ext_deps += dep_turbo
-     ext_deps += dependency('flexran_sdk_crc', required: true)
-     ext_deps += dependency('flexran_sdk_rate_matching', required: true)
-diff --git a/drivers/regex/cn9k/meson.build b/drivers/regex/cn9k/meson.build
-index 06c906710c..19b2e70111 100644
---- a/drivers/regex/cn9k/meson.build
-+++ b/drivers/regex/cn9k/meson.build
-@@ -8,10 +8,10 @@ if not is_linux or not dpdk_conf.get('RTE_ARCH_64')
-     subdir_done()
- endif
- 
--lib = cc.find_library('librxp_compiler', required: false)
-+lib = cc.find_library('rxp_compiler', required: false)
- if lib.found()
-     ext_deps += lib
--    ext_deps += cc.find_library('libstdc++', required: true)
-+    ext_deps += cc.find_library('stdc++', required: true)
-     cflags += ['-DREE_COMPILER_SDK']
- endif
- 
+@@ -6,15 +6,15 @@ path = get_option('flexran_sdk')
+ # check for FlexRAN SDK libraries for AVX2
+ lib4g = cc.find_library('libturbo', dirs: [path + '/lib_turbo'], required: false)
+ if lib4g.found()
+-	ext_deps += cc.find_library('libturbo', dirs: [path + '/lib_turbo'], required: true)
+-	ext_deps += cc.find_library('libcrc', dirs: [path + '/lib_crc'], required: true)
+-	ext_deps += cc.find_library('librate_matching', dirs: [path + '/lib_rate_matching'], required: true)
+-	ext_deps += cc.find_library('libcommon', dirs: [path + '/lib_common'], required: true)
+-	ext_deps += cc.find_library('libstdc++', required: true)
+-	ext_deps += cc.find_library('libirc', required: true)
+-	ext_deps += cc.find_library('libimf', required: true)
+-	ext_deps += cc.find_library('libipps', required: true)
+-	ext_deps += cc.find_library('libsvml', required: true)
++	ext_deps += cc.find_library('turbo', dirs: [path + '/lib_turbo'], required: true)
++	ext_deps += cc.find_library('crc', dirs: [path + '/lib_crc'], required: true)
++	ext_deps += cc.find_library('rate_matching', dirs: [path + '/lib_rate_matching'], required: true)
++	ext_deps += cc.find_library('common', dirs: [path + '/lib_common'], required: true)
++	ext_deps += cc.find_library('stdc++', required: true)
++	ext_deps += cc.find_library('irc', required: true)
++	ext_deps += cc.find_library('imf', required: true)
++	ext_deps += cc.find_library('ipps', required: true)
++	ext_deps += cc.find_library('svml', required: true)
+ 	includes += include_directories(path + '/lib_turbo')
+ 	includes += include_directories(path + '/lib_crc')
+ 	includes += include_directories(path + '/lib_rate_matching')
+@@ -25,10 +25,10 @@ endif
+ # check for FlexRAN SDK libraries for AVX512
+ lib5g = cc.find_library('libldpc_decoder_5gnr', dirs: [path + '/lib_ldpc_decoder_5gnr'], required: false)
+ if lib5g.found()
+-	ext_deps += cc.find_library('libldpc_encoder_5gnr', dirs: [path + '/lib_ldpc_encoder_5gnr'], required: true)
+-	ext_deps += cc.find_library('libldpc_decoder_5gnr', dirs: [path + '/lib_ldpc_decoder_5gnr'], required: true)
+-	ext_deps += cc.find_library('libLDPC_ratematch_5gnr', dirs: [path + '/lib_LDPC_ratematch_5gnr'], required: true)
+-	ext_deps += cc.find_library('librate_dematching_5gnr', dirs: [path + '/lib_rate_dematching_5gnr'], required: true)
++	ext_deps += cc.find_library('ldpc_encoder_5gnr', dirs: [path + '/lib_ldpc_encoder_5gnr'], required: true)
++	ext_deps += cc.find_library('ldpc_decoder_5gnr', dirs: [path + '/lib_ldpc_decoder_5gnr'], required: true)
++	ext_deps += cc.find_library('LDPC_ratematch_5gnr', dirs: [path + '/lib_LDPC_ratematch_5gnr'], required: true)
++	ext_deps += cc.find_library('rate_dematching_5gnr', dirs: [path + '/lib_rate_dematching_5gnr'], required: true)
+ 	includes += include_directories(path + '/lib_ldpc_encoder_5gnr')
+ 	includes += include_directories(path + '/lib_ldpc_decoder_5gnr')
+ 	includes += include_directories(path + '/lib_LDPC_ratematch_5gnr')

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'vdpa/ifc: fix argument compatibility check' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (11 preceding siblings ...)
  2023-02-23  9:36 ` patch 'build: fix dependencies lookup' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'vdpa/ifc: fix reconnection in SW-assisted live migration' " luca.boccassi
                   ` (56 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Andy Pei; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From cb31fb020c20ebbfe74013c93774b025cc33c1a6 Mon Sep 17 00:00:00 2001
From: Andy Pei <andy.pei@intel.com>
Date: Thu, 1 Dec 2022 15:32:20 +0800
Subject: [PATCH] vdpa/ifc: fix argument compatibility check

[ upstream commit 97d2dfc4e15caf654eb84ede24f4c1a43793e850 ]

"sw_fallback_lm=0" means driver does not provide live migration assistance.
so hardware assistance is needed to support live migration.
However registers for live migration in BAR4 are not implemented.
In the case, we just return error after display some logs.

Fixes: 4c3f55cc23ea ("net/ifc: add LM mode parameter")

Signed-off-by: Andy Pei <andy.pei@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/vdpa/ifc/ifcvf_vdpa.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
index 4dbfd1a71d..371be23ace 100644
--- a/drivers/vdpa/ifc/ifcvf_vdpa.c
+++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
@@ -1253,6 +1253,11 @@ ifcvf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 			goto error;
 	}
 	internal->sw_lm = sw_fallback_lm;
+	if (!internal->sw_lm && !internal->hw.lm_cfg) {
+		DRV_LOG(ERR, "Device %s does not support HW assist live migration, please enable sw-live-migration!",
+			pci_dev->name);
+		goto error;
+	}
 
 	internal->vdev = rte_vdpa_register_device(&pci_dev->device, &ifcvf_ops);
 	if (internal->vdev == NULL) {
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:28.854919185 +0000
+++ 0014-vdpa-ifc-fix-argument-compatibility-check.patch	2023-02-23 09:36:28.186169203 +0000
@@ -1 +1 @@
-From 97d2dfc4e15caf654eb84ede24f4c1a43793e850 Mon Sep 17 00:00:00 2001
+From cb31fb020c20ebbfe74013c93774b025cc33c1a6 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 97d2dfc4e15caf654eb84ede24f4c1a43793e850 ]
+
@@ -12 +13,0 @@
-Cc: stable@dpdk.org
@@ -21 +22 @@
-index 49d68ad1b1..9468f66638 100644
+index 4dbfd1a71d..371be23ace 100644
@@ -24 +25 @@
-@@ -1746,6 +1746,11 @@ ifcvf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
+@@ -1253,6 +1253,11 @@ ifcvf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
@@ -34,2 +35,2 @@
- 	pthread_mutex_lock(&internal_list_lock);
- 	TAILQ_INSERT_TAIL(&internal_list, list, next);
+ 	internal->vdev = rte_vdpa_register_device(&pci_dev->device, &ifcvf_ops);
+ 	if (internal->vdev == NULL) {

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'vdpa/ifc: fix reconnection in SW-assisted live migration' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (12 preceding siblings ...)
  2023-02-23  9:36 ` patch 'vdpa/ifc: fix argument compatibility check' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'vhost: fix net header settings in datapath' " luca.boccassi
                   ` (55 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Andy Pei; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From eb73764d1146069bb3ffbcfb88e0928ef9c4b525 Mon Sep 17 00:00:00 2001
From: Andy Pei <andy.pei@intel.com>
Date: Mon, 12 Dec 2022 15:12:45 +0800
Subject: [PATCH] vdpa/ifc: fix reconnection in SW-assisted live migration

[ upstream commit ef3be7e237dd707f46870b09b93f88f8ee5e75c6 ]

In the case using argument "sw-live-migration=1" to enable SW assisted live
migration, we take QEMU as front end for example, after source VM migrates
to destination VM, we keep vdpa process for source VM there, we kill the
QEMU process for source VM, and restart the QEMU process for source VM.
In this case, vdpa driver will not perform DMA map and data path will not
work properly.

The above case works fine in the case "sw-live-migration=0".

The root cause is that current code driver does not set running flag to 0.
Driver treats device as ruuning and does not perform DMA map.

Fixes: 4bb531e152d3 ("net/ifc: support SW assisted VDPA live migration")

Signed-off-by: Andy Pei <andy.pei@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/vdpa/ifc/ifcvf_vdpa.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
index 371be23ace..360dd4b034 100644
--- a/drivers/vdpa/ifc/ifcvf_vdpa.c
+++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
@@ -842,6 +842,8 @@ ifcvf_sw_fallback_switchover(struct ifcvf_internal *internal)
 	vdpa_ifcvf_stop(internal);
 	vdpa_disable_vfio_intr(internal);
 
+	rte_atomic32_set(&internal->running, 0);
+
 	ret = rte_vhost_host_notifier_ctrl(vid, RTE_VHOST_QUEUE_ALL, false);
 	if (ret && ret != -ENOTSUP)
 		goto error;
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:28.892812648 +0000
+++ 0015-vdpa-ifc-fix-reconnection-in-SW-assisted-live-migrat.patch	2023-02-23 09:36:28.186169203 +0000
@@ -1 +1 @@
-From ef3be7e237dd707f46870b09b93f88f8ee5e75c6 Mon Sep 17 00:00:00 2001
+From eb73764d1146069bb3ffbcfb88e0928ef9c4b525 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit ef3be7e237dd707f46870b09b93f88f8ee5e75c6 ]
+
@@ -19 +20,0 @@
-Cc: stable@dpdk.org
@@ -28 +29 @@
-index 9468f66638..35520ea3ae 100644
+index 371be23ace..360dd4b034 100644
@@ -31,2 +32,2 @@
-@@ -1044,6 +1044,8 @@ ifcvf_sw_fallback_switchover(struct ifcvf_internal *internal)
- 
+@@ -842,6 +842,8 @@ ifcvf_sw_fallback_switchover(struct ifcvf_internal *internal)
+ 	vdpa_ifcvf_stop(internal);

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'vhost: fix net header settings in datapath' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (13 preceding siblings ...)
  2023-02-23  9:36 ` patch 'vdpa/ifc: fix reconnection in SW-assisted live migration' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'app/bbdev: add allocation checks' " luca.boccassi
                   ` (54 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Wenwu Ma; +Cc: Wei Ling, Cheng Jiang, Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/81d653f7233bd18d6dfa6dda19436669f1e69455

Thanks.

Luca Boccassi

---
From 81d653f7233bd18d6dfa6dda19436669f1e69455 Mon Sep 17 00:00:00 2001
From: Wenwu Ma <wenwux.ma@intel.com>
Date: Wed, 4 Jan 2023 10:39:45 +0800
Subject: [PATCH] vhost: fix net header settings in datapath

[ upstream commit b9c1ec8577936419c8801dfad61e848b3535295f ]

In vhost sync batch enqueue, the "num_buffers" of
virtio net header is not be set, but it should be
set to 1 if the mrg_rxbuf feature is turned on,
This patch fix the issue.

Fixes: ef861692c398 ("vhost: add packed ring batch enqueue")

Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
Tested-by: Wei Ling <weix.ling@intel.com>
Acked-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 lib/librte_vhost/virtio_net.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
index dd571b60a0..3792f82c3f 100644
--- a/lib/librte_vhost/virtio_net.c
+++ b/lib/librte_vhost/virtio_net.c
@@ -1329,6 +1329,12 @@ virtio_dev_rx_batch_packed(struct virtio_net *dev,
 			sizeof(struct virtio_net_hdr_mrg_rxbuf);
 	}
 
+	if (rxvq_is_mergeable(dev)) {
+		vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE) {
+			ASSIGN_UNLESS_EQUAL(hdrs[i]->num_buffers, 1);
+		}
+	}
+
 	vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE)
 		virtio_enqueue_offload(pkts[i], &hdrs[i]->hdr);
 
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:28.929128827 +0000
+++ 0016-vhost-fix-net-header-settings-in-datapath.patch	2023-02-23 09:36:28.190169277 +0000
@@ -1 +1 @@
-From b9c1ec8577936419c8801dfad61e848b3535295f Mon Sep 17 00:00:00 2001
+From 81d653f7233bd18d6dfa6dda19436669f1e69455 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b9c1ec8577936419c8801dfad61e848b3535295f ]
+
@@ -12 +13,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
- lib/vhost/virtio_net.c | 6 ++++++
+ lib/librte_vhost/virtio_net.c | 6 ++++++
@@ -22,5 +23,5 @@
-diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c
-index 9abf752f30..a3dbf8cb10 100644
---- a/lib/vhost/virtio_net.c
-+++ b/lib/vhost/virtio_net.c
-@@ -1453,6 +1453,12 @@ virtio_dev_rx_batch_packed_copy(struct virtio_net *dev,
+diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
+index dd571b60a0..3792f82c3f 100644
+--- a/lib/librte_vhost/virtio_net.c
++++ b/lib/librte_vhost/virtio_net.c
+@@ -1329,6 +1329,12 @@ virtio_dev_rx_batch_packed(struct virtio_net *dev,

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'app/bbdev: add allocation checks' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (14 preceding siblings ...)
  2023-02-23  9:36 ` patch 'vhost: fix net header settings in datapath' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'baseband/acc: fix memory leak on acc100 close' " luca.boccassi
                   ` (53 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Nicolas Chautru; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From eb40823a13fe79a6f0328015f4c2e6587f6dd8bb Mon Sep 17 00:00:00 2001
From: Nicolas Chautru <nicolas.chautru@intel.com>
Date: Tue, 13 Dec 2022 08:18:55 -0800
Subject: [PATCH] app/bbdev: add allocation checks

[ upstream commit 8abe31b1d9d9448ab4ab1d98a22314a2fa9fbfc6 ]

Adding check for error on return of the
rte_bbdev_*_op_alloc_bulk calls in bbdev-test.

Fixes: f714a18885a6 ("app/testbbdev: add test application for bbdev")

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 app/test-bbdev/test_bbdev_perf.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 36589f3c3e..f38d991f87 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -4361,7 +4361,8 @@ offload_latency_test_dec(struct rte_mempool *mempool, struct test_buffers *bufs,
 		if (unlikely(num_to_process - dequeued < burst_sz))
 			burst_sz = num_to_process - dequeued;
 
-		rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz);
+		ret = rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz);
+		TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops", burst_sz);
 		if (test_vector.op_type != RTE_BBDEV_OP_NONE)
 			copy_reference_dec_op(ops_enq, burst_sz, dequeued,
 					bufs->inputs,
@@ -4446,7 +4447,8 @@ offload_latency_test_ldpc_dec(struct rte_mempool *mempool,
 		if (unlikely(num_to_process - dequeued < burst_sz))
 			burst_sz = num_to_process - dequeued;
 
-		rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz);
+		ret = rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz);
+		TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops", burst_sz);
 		if (test_vector.op_type != RTE_BBDEV_OP_NONE)
 			copy_reference_ldpc_dec_op(ops_enq, burst_sz, dequeued,
 					bufs->inputs,
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:28.967985419 +0000
+++ 0017-app-bbdev-add-allocation-checks.patch	2023-02-23 09:36:28.194169351 +0000
@@ -1 +1 @@
-From 8abe31b1d9d9448ab4ab1d98a22314a2fa9fbfc6 Mon Sep 17 00:00:00 2001
+From eb40823a13fe79a6f0328015f4c2e6587f6dd8bb Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 8abe31b1d9d9448ab4ab1d98a22314a2fa9fbfc6 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -15,2 +16,2 @@
- app/test-bbdev/test_bbdev_perf.c | 9 ++++++---
- 1 file changed, 6 insertions(+), 3 deletions(-)
+ app/test-bbdev/test_bbdev_perf.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
@@ -19 +20 @@
-index 90eff6364e..e001074861 100644
+index 36589f3c3e..f38d991f87 100644
@@ -22,11 +23 @@
-@@ -4958,7 +4958,8 @@ offload_latency_test_fft(struct rte_mempool *mempool, struct test_buffers *bufs,
- 		if (unlikely(num_to_process - dequeued < burst_sz))
- 			burst_sz = num_to_process - dequeued;
- 
--		rte_bbdev_fft_op_alloc_bulk(mempool, ops_enq, burst_sz);
-+		ret = rte_bbdev_fft_op_alloc_bulk(mempool, ops_enq, burst_sz);
-+		TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops", burst_sz);
- 		if (test_vector.op_type != RTE_BBDEV_OP_NONE)
- 			copy_reference_fft_op(ops_enq, burst_sz, dequeued,
- 					bufs->inputs,
-@@ -5039,7 +5040,8 @@ offload_latency_test_dec(struct rte_mempool *mempool, struct test_buffers *bufs,
+@@ -4361,7 +4361,8 @@ offload_latency_test_dec(struct rte_mempool *mempool, struct test_buffers *bufs,
@@ -42 +33 @@
-@@ -5124,7 +5126,8 @@ offload_latency_test_ldpc_dec(struct rte_mempool *mempool,
+@@ -4446,7 +4447,8 @@ offload_latency_test_ldpc_dec(struct rte_mempool *mempool,

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'baseband/acc: fix memory leak on acc100 close' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (15 preceding siblings ...)
  2023-02-23  9:36 ` patch 'app/bbdev: add allocation checks' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'baseband/acc: fix acc100 iteration counter in TB' " luca.boccassi
                   ` (52 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Hernan Vargas; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From cb5f9847826edc8834caa9a53959a20d2d5670d3 Mon Sep 17 00:00:00 2001
From: Hernan Vargas <hernan.vargas@intel.com>
Date: Thu, 12 Jan 2023 11:36:03 -0800
Subject: [PATCH] baseband/acc: fix memory leak on acc100 close

[ upstream commit 1bc7f26ebd45da2ab2740a00c991100dc8f0037d ]

Explicitly call rte_free for harq_layout pointer in dev_close function
to prevent memory leak.

Fixes: ba2262fe16c ("baseband/acc100: fix close cleanup")

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/baseband/acc100/rte_acc100_pmd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/baseband/acc100/rte_acc100_pmd.c b/drivers/baseband/acc100/rte_acc100_pmd.c
index 1d4b25328a..ec0f045754 100644
--- a/drivers/baseband/acc100/rte_acc100_pmd.c
+++ b/drivers/baseband/acc100/rte_acc100_pmd.c
@@ -778,6 +778,7 @@ acc100_dev_close(struct rte_bbdev *dev)
 		rte_free(d->tail_ptrs);
 		rte_free(d->info_ring);
 		rte_free(d->sw_rings_base);
+		rte_free(d->harq_layout);
 		d->sw_rings_base = NULL;
 		d->tail_ptrs = NULL;
 		d->info_ring = NULL;
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:29.007907458 +0000
+++ 0018-baseband-acc-fix-memory-leak-on-acc100-close.patch	2023-02-23 09:36:28.202169498 +0000
@@ -1 +1 @@
-From 1bc7f26ebd45da2ab2740a00c991100dc8f0037d Mon Sep 17 00:00:00 2001
+From cb5f9847826edc8834caa9a53959a20d2d5670d3 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 1bc7f26ebd45da2ab2740a00c991100dc8f0037d ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -15 +16 @@
- drivers/baseband/acc/rte_acc100_pmd.c | 1 +
+ drivers/baseband/acc100/rte_acc100_pmd.c | 1 +
@@ -18,5 +19,5 @@
-diff --git a/drivers/baseband/acc/rte_acc100_pmd.c b/drivers/baseband/acc/rte_acc100_pmd.c
-index b3164529dd..146a22bd64 100644
---- a/drivers/baseband/acc/rte_acc100_pmd.c
-+++ b/drivers/baseband/acc/rte_acc100_pmd.c
-@@ -620,6 +620,7 @@ acc100_dev_close(struct rte_bbdev *dev)
+diff --git a/drivers/baseband/acc100/rte_acc100_pmd.c b/drivers/baseband/acc100/rte_acc100_pmd.c
+index 1d4b25328a..ec0f045754 100644
+--- a/drivers/baseband/acc100/rte_acc100_pmd.c
++++ b/drivers/baseband/acc100/rte_acc100_pmd.c
+@@ -778,6 +778,7 @@ acc100_dev_close(struct rte_bbdev *dev)

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'baseband/acc: fix acc100 iteration counter in TB' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (16 preceding siblings ...)
  2023-02-23  9:36 ` patch 'baseband/acc: fix memory leak on acc100 close' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'crypto/ccp: remove some printf' " luca.boccassi
                   ` (51 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Hernan Vargas; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/623a8db1ad8fced024cdd1bcd251770505e8ff2b

Thanks.

Luca Boccassi

---
From 623a8db1ad8fced024cdd1bcd251770505e8ff2b Mon Sep 17 00:00:00 2001
From: Hernan Vargas <hernan.vargas@intel.com>
Date: Thu, 12 Jan 2023 11:36:04 -0800
Subject: [PATCH] baseband/acc: fix acc100 iteration counter in TB

[ upstream commit 12f2bce128a1766765619357f707430c506c7bc6 ]

Use ldpc or turbo iteration counter based on the operation type.

Fixes: 5ad5060f8f7 ("baseband/acc100: add LDPC processing functions")

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/baseband/acc100/rte_acc100_pmd.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/baseband/acc100/rte_acc100_pmd.c b/drivers/baseband/acc100/rte_acc100_pmd.c
index ec0f045754..4f19fb966d 100644
--- a/drivers/baseband/acc100/rte_acc100_pmd.c
+++ b/drivers/baseband/acc100/rte_acc100_pmd.c
@@ -3968,8 +3968,12 @@ dequeue_dec_one_op_tb(struct acc100_queue *q, struct rte_bbdev_dec_op **ref_op,
 		/* CRC invalid if error exists */
 		if (!op->status)
 			op->status |= rsp.crc_status << RTE_BBDEV_CRC_ERROR;
-		op->turbo_dec.iter_count = RTE_MAX((uint8_t) rsp.iter_cnt,
-				op->turbo_dec.iter_count);
+		if (q->op_type == RTE_BBDEV_OP_LDPC_DEC)
+			op->ldpc_dec.iter_count = RTE_MAX((uint8_t) rsp.iter_cnt,
+					op->ldpc_dec.iter_count);
+		else
+			op->turbo_dec.iter_count = RTE_MAX((uint8_t) rsp.iter_cnt,
+					op->turbo_dec.iter_count);
 
 		/* Check if this is the last desc in batch (Atomic Queue) */
 		if (desc->req.last_desc_in_batch) {
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:29.046411209 +0000
+++ 0019-baseband-acc-fix-acc100-iteration-counter-in-TB.patch	2023-02-23 09:36:28.206169572 +0000
@@ -1 +1 @@
-From 12f2bce128a1766765619357f707430c506c7bc6 Mon Sep 17 00:00:00 2001
+From 623a8db1ad8fced024cdd1bcd251770505e8ff2b Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 12f2bce128a1766765619357f707430c506c7bc6 ]
+
@@ -9 +10,0 @@
-Cc: stable@dpdk.org
@@ -14 +15 @@
- drivers/baseband/acc/rte_acc100_pmd.c | 8 ++++++--
+ drivers/baseband/acc100/rte_acc100_pmd.c | 8 ++++++--
@@ -17,5 +18,5 @@
-diff --git a/drivers/baseband/acc/rte_acc100_pmd.c b/drivers/baseband/acc/rte_acc100_pmd.c
-index 146a22bd64..a00314c957 100644
---- a/drivers/baseband/acc/rte_acc100_pmd.c
-+++ b/drivers/baseband/acc/rte_acc100_pmd.c
-@@ -4033,8 +4033,12 @@ dequeue_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op **ref_op,
+diff --git a/drivers/baseband/acc100/rte_acc100_pmd.c b/drivers/baseband/acc100/rte_acc100_pmd.c
+index ec0f045754..4f19fb966d 100644
+--- a/drivers/baseband/acc100/rte_acc100_pmd.c
++++ b/drivers/baseband/acc100/rte_acc100_pmd.c
+@@ -3968,8 +3968,12 @@ dequeue_dec_one_op_tb(struct acc100_queue *q, struct rte_bbdev_dec_op **ref_op,

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'crypto/ccp: remove some printf' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (17 preceding siblings ...)
  2023-02-23  9:36 ` patch 'baseband/acc: fix acc100 iteration counter in TB' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'test/crypto: add missing MAC-I to PDCP vectors' " luca.boccassi
                   ` (50 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: David Marchand; +Cc: Sunil Uttarwar, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/230bbf810bfdcb9a7f728a2b393a8724e5d3188f

Thanks.

Luca Boccassi

---
From 230bbf810bfdcb9a7f728a2b393a8724e5d3188f Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Tue, 4 Oct 2022 11:51:29 +0200
Subject: [PATCH] crypto/ccp: remove some printf

[ upstream commit e946ca8e727424b511fe4ea278d8bec76b800e7a ]

A DPDK application must _not_ use printf.
Use log framework.

Fixes: ef4b04f87fa6 ("crypto/ccp: support device init")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Sunil Uttarwar <sunilprakashrao.uttarwar@amd.com>
---
 drivers/crypto/ccp/ccp_dev.c     | 4 ++--
 drivers/crypto/ccp/ccp_pci.c     | 3 ++-
 drivers/crypto/ccp/rte_ccp_pmd.c | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/ccp/ccp_dev.c b/drivers/crypto/ccp/ccp_dev.c
index 664ddc1747..c36409a0bc 100644
--- a/drivers/crypto/ccp/ccp_dev.c
+++ b/drivers/crypto/ccp/ccp_dev.c
@@ -361,7 +361,7 @@ ccp_find_lsb_regions(struct ccp_queue *cmd_q, uint64_t status)
 		if (ccp_get_bit(&cmd_q->lsbmask, j))
 			weight++;
 
-	printf("Queue %d can access %d LSB regions  of mask  %lu\n",
+	CCP_LOG_DBG("Queue %d can access %d LSB regions  of mask  %lu\n",
 	       (int)cmd_q->id, weight, cmd_q->lsbmask);
 
 	return weight ? 0 : -EINVAL;
@@ -797,7 +797,7 @@ ccp_probe_devices(const struct rte_pci_id *ccp_id)
 		snprintf(dirname, sizeof(dirname), "%s/%s",
 			     SYSFS_PCI_DEVICES, d->d_name);
 		if (is_ccp_device(dirname, ccp_id, &ccp_type)) {
-			printf("CCP : Detected CCP device with ID = 0x%x\n",
+			CCP_LOG_DBG("CCP : Detected CCP device with ID = 0x%x\n",
 			       ccp_id[ccp_type].device_id);
 			ret = ccp_probe_device(dirname, domain, bus, devid,
 					       function, ccp_type);
diff --git a/drivers/crypto/ccp/ccp_pci.c b/drivers/crypto/ccp/ccp_pci.c
index 1702a09c4f..6932cb4152 100644
--- a/drivers/crypto/ccp/ccp_pci.c
+++ b/drivers/crypto/ccp/ccp_pci.c
@@ -11,6 +11,7 @@
 #include <rte_string_fns.h>
 
 #include "ccp_pci.h"
+#include "ccp_pmd_private.h"
 
 static const char * const uio_module_names[] = {
 	"igb_uio",
@@ -40,7 +41,7 @@ ccp_check_pci_uio_module(void)
 		rewind(fp);
 	}
 	fclose(fp);
-	printf("Insert igb_uio or uio_pci_generic kernel module(s)");
+	CCP_LOG_DBG("Insert igb_uio or uio_pci_generic kernel module(s)");
 	return -1;/* uio not inserted */
 }
 
diff --git a/drivers/crypto/ccp/rte_ccp_pmd.c b/drivers/crypto/ccp/rte_ccp_pmd.c
index 000b2f4fe0..0536994300 100644
--- a/drivers/crypto/ccp/rte_ccp_pmd.c
+++ b/drivers/crypto/ccp/rte_ccp_pmd.c
@@ -342,7 +342,7 @@ cryptodev_ccp_create(const char *name,
 		goto init_error;
 	}
 
-	printf("CCP : Crypto device count = %d\n", cryptodev_cnt);
+	CCP_LOG_DBG("CCP : Crypto device count = %d\n", cryptodev_cnt);
 	dev->driver_id = ccp_cryptodev_driver_id;
 
 	/* register rx/tx burst functions for data path */
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:29.087317499 +0000
+++ 0020-crypto-ccp-remove-some-printf.patch	2023-02-23 09:36:28.210169645 +0000
@@ -1 +1 @@
-From e946ca8e727424b511fe4ea278d8bec76b800e7a Mon Sep 17 00:00:00 2001
+From 230bbf810bfdcb9a7f728a2b393a8724e5d3188f Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit e946ca8e727424b511fe4ea278d8bec76b800e7a ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -21 +22 @@
-index 424ead82c3..9c9cb81236 100644
+index 664ddc1747..c36409a0bc 100644
@@ -24 +25 @@
-@@ -362,7 +362,7 @@ ccp_find_lsb_regions(struct ccp_queue *cmd_q, uint64_t status)
+@@ -361,7 +361,7 @@ ccp_find_lsb_regions(struct ccp_queue *cmd_q, uint64_t status)
@@ -33 +34 @@
-@@ -709,7 +709,7 @@ ccp_probe_devices(struct rte_pci_device *pci_dev,
+@@ -797,7 +797,7 @@ ccp_probe_devices(const struct rte_pci_id *ccp_id)
@@ -40,2 +41,2 @@
- 			ret = ccp_probe_device(ccp_type, pci_dev);
- 			if (ret == 0)
+ 			ret = ccp_probe_device(dirname, domain, bus, devid,
+ 					       function, ccp_type);
@@ -43 +44 @@
-index 38029a9081..c941e222c7 100644
+index 1702a09c4f..6932cb4152 100644
@@ -54 +55 @@
-@@ -41,7 +42,7 @@ ccp_check_pci_uio_module(void)
+@@ -40,7 +41,7 @@ ccp_check_pci_uio_module(void)
@@ -64 +65 @@
-index 221a0a5235..bcb621234c 100644
+index 000b2f4fe0..0536994300 100644
@@ -67 +68 @@
-@@ -237,7 +237,7 @@ cryptodev_ccp_create(const char *name,
+@@ -342,7 +342,7 @@ cryptodev_ccp_create(const char *name,
@@ -73,2 +73,0 @@
- 	dev->device = &pci_dev->device;
- 	dev->device->driver = &pci_drv->driver;
@@ -75,0 +75,2 @@
+ 
+ 	/* register rx/tx burst functions for data path */

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'test/crypto: add missing MAC-I to PDCP vectors' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (18 preceding siblings ...)
  2023-02-23  9:36 ` patch 'crypto/ccp: remove some printf' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'compressdev: fix end of driver list' " luca.boccassi
                   ` (49 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Volodymyr Fialko; +Cc: Akhil Goyal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/9ce02a45cca8c63f4ba0f8d89bbcda6e79dbc3b1

Thanks.

Luca Boccassi

---
From 9ce02a45cca8c63f4ba0f8d89bbcda6e79dbc3b1 Mon Sep 17 00:00:00 2001
From: Volodymyr Fialko <vfialko@marvell.com>
Date: Tue, 24 Jan 2023 17:39:24 +0100
Subject: [PATCH] test/crypto: add missing MAC-I to PDCP vectors

[ upstream commit 7b2ae9efa223b220f4699c1940a6ed530e063bf8 ]

Existing PDCP 12-bit C/U-plane output vectors with NULL encryption + NULL
integrity do not contain the MAC-I (32-bit of all zeros according to the
specification).
Vectors for other SN length (5, 18 bits) have the MAC-I set.

Fixes: d883e6e7131b ("test/crypto: add PDCP C-Plane encap cases")
Fixes: cca7d1f78524 ("test/crypto: add PDCP U-Plane encap with integrity cases")

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
---
 app/test/test_cryptodev_security_pdcp_test_vectors.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/app/test/test_cryptodev_security_pdcp_test_vectors.h b/app/test/test_cryptodev_security_pdcp_test_vectors.h
index 3e8a8a243e..8e007f7802 100644
--- a/app/test/test_cryptodev_security_pdcp_test_vectors.h
+++ b/app/test/test_cryptodev_security_pdcp_test_vectors.h
@@ -5441,7 +5441,7 @@ static uint8_t *pdcp_test_data_out[] = {
 		    0xC2, 0xE2, 0x91, 0x91, 0xA3, 0x9C, 0xE6, 0x30, 0x69, 0x70,
 		    0x33, 0x8A, 0x15, 0xD0, 0x36, 0x47, 0x0E, 0x8F, 0xEE, 0x2C,
 		    0x96, 0x0C, 0xD7, 0x7D, 0x70, 0x1B, 0x01, 0x7F, 0x96, 0x46,
-		    0x53, 0xB0, 0xA4, 0x7A, 0xF9, 0xDD},
+		    0x53, 0xB0, 0xA4, 0x7A, 0xF9, 0xDD, 0x00, 0x00, 0x00, 0x00},
 	/* Control Plane w/NULL enc. + NULL int. DL LONG SN */
 	(uint8_t[]){0xA0, 0x00, 0x86, 0xB8, 0xF8, 0xDB, 0x2D, 0x3F, 0x23, 0x82,
 		    0x53, 0xFD, 0x37, 0xDE, 0x88, 0x63, 0x08, 0x4F, 0xD3, 0x71,
@@ -5449,7 +5449,7 @@ static uint8_t *pdcp_test_data_out[] = {
 		    0xC2, 0xE2, 0x91, 0x91, 0xA3, 0x9C, 0xE6, 0x30, 0x69, 0x70,
 		    0x33, 0x8A, 0x15, 0xD0, 0x36, 0x47, 0x0E, 0x8F, 0xEE, 0x2C,
 		    0x96, 0x0C, 0xD7, 0x7D, 0x70, 0x1B, 0x01, 0x7F, 0x96, 0x46,
-		    0x53, 0xB0, 0xA4, 0x7A, 0xF9, 0xDD},
+		    0x53, 0xB0, 0xA4, 0x7A, 0xF9, 0xDD, 0x00, 0x00, 0x00, 0x00},
 	/* Control Plane w/NULL enc. + SNOW f9 int. UL LONG SN */
 	(uint8_t[]){0x00, 0x01, 0x86, 0xB8, 0xF8, 0xDB, 0x2D, 0x3F, 0x23, 0x82,
 		    0x53, 0xFD, 0x37, 0xDE, 0x88, 0x63, 0x08, 0x4F, 0xD3, 0x71,
@@ -5835,7 +5835,7 @@ static uint8_t *pdcp_test_data_out[] = {
 		    0xC2, 0xE2, 0x91, 0x91, 0xA3, 0x9C, 0xE6, 0x30, 0x69, 0x70,
 		    0x33, 0x8A, 0x15, 0xD0, 0x36, 0x47, 0x0E, 0x8F, 0xEE, 0x2C,
 		    0x96, 0x0C, 0xD7, 0x7D, 0x70, 0x1B, 0x01, 0x7F, 0x96, 0x46,
-		    0x53, 0xB0, 0xA4, 0x7A, 0xF9, 0xDD},
+		    0x53, 0xB0, 0xA4, 0x7A, 0xF9, 0xDD, 0x00, 0x00, 0x00, 0x00},
 	/* User Plane w/NULL enc. + NULL int. DL for 12-bit SN */
 	(uint8_t[]){0xA0, 0x00, 0x86, 0xB8, 0xF8, 0xDB, 0x2D, 0x3F, 0x23, 0x82,
 		    0x53, 0xFD, 0x37, 0xDE, 0x88, 0x63, 0x08, 0x4F, 0xD3, 0x71,
@@ -5843,7 +5843,7 @@ static uint8_t *pdcp_test_data_out[] = {
 		    0xC2, 0xE2, 0x91, 0x91, 0xA3, 0x9C, 0xE6, 0x30, 0x69, 0x70,
 		    0x33, 0x8A, 0x15, 0xD0, 0x36, 0x47, 0x0E, 0x8F, 0xEE, 0x2C,
 		    0x96, 0x0C, 0xD7, 0x7D, 0x70, 0x1B, 0x01, 0x7F, 0x96, 0x46,
-		    0x53, 0xB0, 0xA4, 0x7A, 0xF9, 0xDD},
+		    0x53, 0xB0, 0xA4, 0x7A, 0xF9, 0xDD, 0x00, 0x00, 0x00, 0x00},
 	/* User Plane w/NULL enc. + SNOW f9 int. UL for 12-bit SN */
 	(uint8_t[]){0x80, 0x01, 0x86, 0xB8, 0xF8, 0xDB, 0x2D, 0x3F, 0x23, 0x82,
 		    0x53, 0xFD, 0x37, 0xDE, 0x88, 0x63, 0x08, 0x4F, 0xD3, 0x71,
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:29.124940690 +0000
+++ 0021-test-crypto-add-missing-MAC-I-to-PDCP-vectors.patch	2023-02-23 09:36:28.214169719 +0000
@@ -1 +1 @@
-From 7b2ae9efa223b220f4699c1940a6ed530e063bf8 Mon Sep 17 00:00:00 2001
+From 9ce02a45cca8c63f4ba0f8d89bbcda6e79dbc3b1 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 7b2ae9efa223b220f4699c1940a6ed530e063bf8 ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
-index 6fdc4cd9e3..56d4884529 100644
+index 3e8a8a243e..8e007f7802 100644
@@ -25 +26 @@
-@@ -5560,7 +5560,7 @@ static uint8_t *pdcp_test_data_out[] = {
+@@ -5441,7 +5441,7 @@ static uint8_t *pdcp_test_data_out[] = {
@@ -34 +35 @@
-@@ -5568,7 +5568,7 @@ static uint8_t *pdcp_test_data_out[] = {
+@@ -5449,7 +5449,7 @@ static uint8_t *pdcp_test_data_out[] = {
@@ -43 +44 @@
-@@ -5954,7 +5954,7 @@ static uint8_t *pdcp_test_data_out[] = {
+@@ -5835,7 +5835,7 @@ static uint8_t *pdcp_test_data_out[] = {
@@ -52 +53 @@
-@@ -5962,7 +5962,7 @@ static uint8_t *pdcp_test_data_out[] = {
+@@ -5843,7 +5843,7 @@ static uint8_t *pdcp_test_data_out[] = {

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'compressdev: fix end of driver list' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (19 preceding siblings ...)
  2023-02-23  9:36 ` patch 'test/crypto: add missing MAC-I to PDCP vectors' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'net/bnxt: fix Tx queue stats after queue stop and start' " luca.boccassi
                   ` (48 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Michael Baum; +Cc: Akhil Goyal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From d734d76db5885a7c2399474ffb87b3077bd22158 Mon Sep 17 00:00:00 2001
From: Michael Baum <michaelba@nvidia.com>
Date: Wed, 1 Feb 2023 17:35:30 +0200
Subject: [PATCH] compressdev: fix end of driver list

[ upstream commit 33b84a2efca7ac188def108ba8b981daa7572b9a ]

The "rte_compressdev_info_get()" function retrieves the contextual
information of a device.
The output structure "dev_info" contains a list of devices supported
capabilities for each supported algorithm.

In this function description, it says the element after the last valid
element has op field set to "RTE_COMP_ALGO_LIST_END".
On the other hand, when this function used by
"rte_compressdev_capability_get()" function, it uses
"RTE_COMP_ALGO_UNSPECIFIED" as end of list as same as the
"RTE_COMP_END_OF_CAPABILITIES_LIST()".

The mlx5 and qat PMDs use "RTE_COMP_ALGO_LIST_END" as the end of
capabilities list. When "rte_compressdev_capability_get()" function is
called with unsupported algorithm, it might read memory out of bound.

This patch change the "rte_compressdev_info_get()" function description
to say using "RTE_COMP_ALGO_UNSPECIFIED" as the end of capabilities
list.
In addition, it moves both mlx5 and qat PMDs to use
"RTE_COMP_ALGO_UNSPECIFIED" through
"RTE_COMP_END_OF_CAPABILITIES_LIST()" macro.

Fixes: 5d432f364078 ("compressdev: add device capabilities")
Fixes: 2d148597ce76 ("compress/qat: add gen-specific implementation")
Fixes: 384bac8d6555 ("compress/mlx5: add supported capabilities")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
---
 drivers/compress/qat/qat_comp_pmd.c      | 2 +-
 lib/librte_compressdev/rte_compressdev.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/compress/qat/qat_comp_pmd.c b/drivers/compress/qat/qat_comp_pmd.c
index 4b8594d76c..31d561a808 100644
--- a/drivers/compress/qat/qat_comp_pmd.c
+++ b/drivers/compress/qat/qat_comp_pmd.c
@@ -30,7 +30,7 @@ static const struct rte_compressdev_capabilities qat_comp_gen_capabilities[] = {
 				RTE_COMP_FF_OOP_LB_IN_SGL_OUT |
 				RTE_COMP_FF_STATEFUL_DECOMPRESSION,
 	 .window_size = {.min = 15, .max = 15, .increment = 0} },
-	{RTE_COMP_ALGO_LIST_END, 0, {0, 0, 0} } };
+	 RTE_COMP_END_OF_CAPABILITIES_LIST() };
 
 static void
 qat_comp_stats_get(struct rte_compressdev *dev,
diff --git a/lib/librte_compressdev/rte_compressdev.h b/lib/librte_compressdev/rte_compressdev.h
index 2840c27c6c..d9b2fe40dc 100644
--- a/lib/librte_compressdev/rte_compressdev.h
+++ b/lib/librte_compressdev/rte_compressdev.h
@@ -353,7 +353,7 @@ rte_compressdev_stats_reset(uint8_t dev_id);
  * @note The capabilities field of dev_info is set to point to the first
  * element of an array of struct rte_compressdev_capabilities.
  * The element after the last valid element has it's op field set to
- * RTE_COMP_ALGO_LIST_END.
+ * RTE_COMP_ALGO_UNSPECIFIED.
  */
 __rte_experimental
 void
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:29.165615397 +0000
+++ 0022-compressdev-fix-end-of-driver-list.patch	2023-02-23 09:36:28.218169792 +0000
@@ -1 +1 @@
-From 33b84a2efca7ac188def108ba8b981daa7572b9a Mon Sep 17 00:00:00 2001
+From d734d76db5885a7c2399474ffb87b3077bd22158 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 33b84a2efca7ac188def108ba8b981daa7572b9a ]
+
@@ -32 +33,0 @@
-Cc: stable@dpdk.org
@@ -37,26 +38,9 @@
- drivers/compress/mlx5/mlx5_compress.c        | 4 +---
- drivers/compress/qat/dev/qat_comp_pmd_gen1.c | 2 +-
- drivers/compress/qat/dev/qat_comp_pmd_gen4.c | 2 +-
- lib/compressdev/rte_compressdev.h            | 2 +-
- 4 files changed, 4 insertions(+), 6 deletions(-)
-
-diff --git a/drivers/compress/mlx5/mlx5_compress.c b/drivers/compress/mlx5/mlx5_compress.c
-index fb2bda9745..459e4b5e8a 100644
---- a/drivers/compress/mlx5/mlx5_compress.c
-+++ b/drivers/compress/mlx5/mlx5_compress.c
-@@ -96,9 +96,7 @@ static const struct rte_compressdev_capabilities mlx5_caps[] = {
- 				      RTE_COMP_FF_HUFFMAN_DYNAMIC,
- 		.window_size = {.min = 10, .max = 15, .increment = 1},
- 	},
--	{
--		.algo = RTE_COMP_ALGO_LIST_END,
--	}
-+	RTE_COMP_END_OF_CAPABILITIES_LIST()
- };
- 
- static void
-diff --git a/drivers/compress/qat/dev/qat_comp_pmd_gen1.c b/drivers/compress/qat/dev/qat_comp_pmd_gen1.c
-index 12d9d89072..3a8484eef1 100644
---- a/drivers/compress/qat/dev/qat_comp_pmd_gen1.c
-+++ b/drivers/compress/qat/dev/qat_comp_pmd_gen1.c
-@@ -26,7 +26,7 @@ const struct rte_compressdev_capabilities qat_gen1_comp_capabilities[] = {
+ drivers/compress/qat/qat_comp_pmd.c      | 2 +-
+ lib/librte_compressdev/rte_compressdev.h | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/compress/qat/qat_comp_pmd.c b/drivers/compress/qat/qat_comp_pmd.c
+index 4b8594d76c..31d561a808 100644
+--- a/drivers/compress/qat/qat_comp_pmd.c
++++ b/drivers/compress/qat/qat_comp_pmd.c
+@@ -30,7 +30,7 @@ static const struct rte_compressdev_capabilities qat_comp_gen_capabilities[] = {
@@ -69,19 +53,6 @@
- static int
- qat_comp_dev_config_gen1(struct rte_compressdev *dev,
-diff --git a/drivers/compress/qat/dev/qat_comp_pmd_gen4.c b/drivers/compress/qat/dev/qat_comp_pmd_gen4.c
-index 79b2ceb414..05906f13e0 100644
---- a/drivers/compress/qat/dev/qat_comp_pmd_gen4.c
-+++ b/drivers/compress/qat/dev/qat_comp_pmd_gen4.c
-@@ -25,7 +25,7 @@ qat_gen4_comp_capabilities[] = {
- 				RTE_COMP_FF_OOP_SGL_IN_LB_OUT |
- 				RTE_COMP_FF_OOP_LB_IN_SGL_OUT,
- 	 .window_size = {.min = 15, .max = 15, .increment = 0} },
--	{RTE_COMP_ALGO_LIST_END, 0, {0, 0, 0} } };
-+	 RTE_COMP_END_OF_CAPABILITIES_LIST() };
- 
- static int
- qat_comp_dev_config_gen4(struct rte_compressdev *dev,
-diff --git a/lib/compressdev/rte_compressdev.h b/lib/compressdev/rte_compressdev.h
-index 42bda9fc79..7eb5c58798 100644
---- a/lib/compressdev/rte_compressdev.h
-+++ b/lib/compressdev/rte_compressdev.h
+ static void
+ qat_comp_stats_get(struct rte_compressdev *dev,
+diff --git a/lib/librte_compressdev/rte_compressdev.h b/lib/librte_compressdev/rte_compressdev.h
+index 2840c27c6c..d9b2fe40dc 100644
+--- a/lib/librte_compressdev/rte_compressdev.h
++++ b/lib/librte_compressdev/rte_compressdev.h

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/bnxt: fix Tx queue stats after queue stop and start' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (20 preceding siblings ...)
  2023-02-23  9:36 ` patch 'compressdev: fix end of driver list' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'net/bnxt: fix Rx " luca.boccassi
                   ` (47 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Kalesh AP; +Cc: Ajit Khaparde, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/82a289a1db6ab917c2342f9c12523c68b7a6b9d5

Thanks.

Luca Boccassi

---
From 82a289a1db6ab917c2342f9c12523c68b7a6b9d5 Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Date: Wed, 1 Feb 2023 09:50:12 +0530
Subject: [PATCH] net/bnxt: fix Tx queue stats after queue stop and start

[ upstream commit 9bd8998fe09736a048e367e1ef7543dd8b5dfd2c ]

The Tx queue stats are being reported incorrectly due to a workaround
for ring counters sometimes being reported as zero.  When a queue is
stopped and started, the ring counter is reset to zero.  The workaround
interprets the zero as incorrect, and sets the reported ring count as
the previously read value (from before the queue being restared).  This
shows up as negative counters in testpmd's "show fwd stats" command.
The fix clears the prev counter for the queue when the queue is started.

Fixes: 219842b9990c ("net/bnxt: workaround spurious zero stats in Thor")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_txr.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c
index 78d7329f2b..4310a14eed 100644
--- a/drivers/net/bnxt/bnxt_txr.c
+++ b/drivers/net/bnxt/bnxt_txr.c
@@ -535,6 +535,12 @@ int bnxt_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id)
 	if (rc)
 		return rc;
 
+	/* reset the previous stats for the tx_queue since the counters
+	 * will be cleared when the queue is started.
+	 */
+	memset(&bp->prev_tx_ring_stats[tx_queue_id], 0,
+	       sizeof(struct bnxt_ring_stats));
+
 	dev->data->tx_queue_state[tx_queue_id] = RTE_ETH_QUEUE_STATE_STARTED;
 	txq->tx_started = true;
 	PMD_DRV_LOG(DEBUG, "Tx queue started\n");
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:29.201946377 +0000
+++ 0023-net-bnxt-fix-Tx-queue-stats-after-queue-stop-and-sta.patch	2023-02-23 09:36:28.218169792 +0000
@@ -1 +1 @@
-From 9bd8998fe09736a048e367e1ef7543dd8b5dfd2c Mon Sep 17 00:00:00 2001
+From 82a289a1db6ab917c2342f9c12523c68b7a6b9d5 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 9bd8998fe09736a048e367e1ef7543dd8b5dfd2c ]
+
@@ -15 +16,0 @@
-Cc: stable@dpdk.org
@@ -24 +25 @@
-index 67e016775c..21c2217092 100644
+index 78d7329f2b..4310a14eed 100644
@@ -27 +28 @@
-@@ -560,6 +560,12 @@ int bnxt_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id)
+@@ -535,6 +535,12 @@ int bnxt_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id)
@@ -37,3 +38,3 @@
- 	bnxt_free_hwrm_tx_ring(bp, tx_queue_id);
- 	rc = bnxt_alloc_hwrm_tx_ring(bp, tx_queue_id);
- 	if (rc)
+ 	dev->data->tx_queue_state[tx_queue_id] = RTE_ETH_QUEUE_STATE_STARTED;
+ 	txq->tx_started = true;
+ 	PMD_DRV_LOG(DEBUG, "Tx queue started\n");

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/bnxt: fix Rx queue stats after queue stop and start' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (21 preceding siblings ...)
  2023-02-23  9:36 ` patch 'net/bnxt: fix Tx queue stats after queue stop and start' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'net/bnxt: fix RSS hash in mbuf' " luca.boccassi
                   ` (46 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Mike Baucom
  Cc: Somnath Kotur, Kishore Padmanabha, Randy Schacher, Ajit Khaparde,
	dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/37a8b1a6dd47c44e7dff7e5fed8830d06eba108c

Thanks.

Luca Boccassi

---
From 37a8b1a6dd47c44e7dff7e5fed8830d06eba108c Mon Sep 17 00:00:00 2001
From: Mike Baucom <michael.baucom@broadcom.com>
Date: Wed, 1 Feb 2023 09:50:13 +0530
Subject: [PATCH] net/bnxt: fix Rx queue stats after queue stop and start

[ upstream commit 0180d3040e4a7734dc9987ff6c49ec1daedcdf8c ]

The Rx queue stats are being reported incorrectly due to a workaround
for ring counters sometimes being reported as zero.  When a queue is
stopped and started, the ring counter is reset to zero.  The workaround
interprets the zero as incorrect, and sets the reported ring count as
the previously read value (from before the queue being restared).  This
shows up as negative counters in testpmd's "show fwd stats" command.
The fix clears the prev counter for the queue when the queue is started.

Fixes: 219842b9990c ("net/bnxt: workaround spurious zero stats in Thor")

Signed-off-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_rxq.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/bnxt/bnxt_rxq.c b/drivers/net/bnxt/bnxt_rxq.c
index f597f376e6..2ed1ae117f 100644
--- a/drivers/net/bnxt/bnxt_rxq.c
+++ b/drivers/net/bnxt/bnxt_rxq.c
@@ -446,6 +446,12 @@ int bnxt_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)
 		return -EINVAL;
 	}
 
+	/* reset the previous stats for the rx_queue since the counters
+	 * will be cleared when the queue is started.
+	 */
+	memset(&bp->prev_rx_ring_stats[rx_queue_id], 0,
+	       sizeof(struct bnxt_ring_stats));
+
 	/* Set the queue state to started here.
 	 * We check the status of the queue while posting buffer.
 	 * If queue is it started, we do not post buffers for Rx.
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:29.239122685 +0000
+++ 0024-net-bnxt-fix-Rx-queue-stats-after-queue-stop-and-sta.patch	2023-02-23 09:36:28.218169792 +0000
@@ -1 +1 @@
-From 0180d3040e4a7734dc9987ff6c49ec1daedcdf8c Mon Sep 17 00:00:00 2001
+From 37a8b1a6dd47c44e7dff7e5fed8830d06eba108c Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 0180d3040e4a7734dc9987ff6c49ec1daedcdf8c ]
+
@@ -15 +16,0 @@
-Cc: stable@dpdk.org
@@ -27 +28 @@
-index fabbbd4560..99758dd304 100644
+index f597f376e6..2ed1ae117f 100644
@@ -30 +31 @@
-@@ -471,6 +471,12 @@ int bnxt_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)
+@@ -446,6 +446,12 @@ int bnxt_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/bnxt: fix RSS hash in mbuf' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (22 preceding siblings ...)
  2023-02-23  9:36 ` patch 'net/bnxt: fix Rx " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'mem: fix hugepage info mapping' " luca.boccassi
                   ` (45 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Venkat Duvvuru; +Cc: Kalesh AP, Kishore Padmanabha, Ajit Khaparde, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From d00a67ba5cc37b80374f9c2faa2ff4c38a3a361f Mon Sep 17 00:00:00 2001
From: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Date: Wed, 1 Feb 2023 09:50:14 +0530
Subject: [PATCH] net/bnxt: fix RSS hash in mbuf

[ upstream commit 031102f531e87e25174d4744c4ced92e5b291891 ]

By clearing mbuf->hash.fdir.id in the data path, the driver is
corrupting the RSS hash value populated in the mbuf as they
are defined as a union.

This patch fixes the problem by removing the code that clears
mbuf->hash.fdir.id.

Fixes: 17b6c8386d73 ("net/bnxt: fix mark handling")

Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_rxr.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index f923b35ce2..c31b034bb7 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -749,7 +749,6 @@ bnxt_ulp_set_mark_in_mbuf(struct bnxt *bp, struct rx_pkt_cmpl_hi *rxcmp1,
 
 skip_mark:
 	mbuf->hash.fdir.hi = 0;
-	mbuf->hash.fdir.id = 0;
 
 	return 0;
 }
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:29.275556963 +0000
+++ 0025-net-bnxt-fix-RSS-hash-in-mbuf.patch	2023-02-23 09:36:28.218169792 +0000
@@ -1 +1 @@
-From 031102f531e87e25174d4744c4ced92e5b291891 Mon Sep 17 00:00:00 2001
+From d00a67ba5cc37b80374f9c2faa2ff4c38a3a361f Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 031102f531e87e25174d4744c4ced92e5b291891 ]
+
@@ -14 +15,0 @@
-Cc: stable@dpdk.org
@@ -25 +26 @@
-index daaf9ffc1e..0eebddb05d 100644
+index f923b35ce2..c31b034bb7 100644
@@ -28 +29 @@
-@@ -813,7 +813,6 @@ bnxt_ulp_set_mark_in_mbuf(struct bnxt *bp, struct rx_pkt_cmpl_hi *rxcmp1,
+@@ -749,7 +749,6 @@ bnxt_ulp_set_mark_in_mbuf(struct bnxt *bp, struct rx_pkt_cmpl_hi *rxcmp1,

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'mem: fix hugepage info mapping' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (23 preceding siblings ...)
  2023-02-23  9:36 ` patch 'net/bnxt: fix RSS hash in mbuf' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'raw/ifpga/base: fix init with multi-process' " luca.boccassi
                   ` (44 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: David Marchand, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From c9375a166c7f23a35c3f8bc0aae05cbb90f25ae0 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Mon, 6 Feb 2023 10:53:10 +0000
Subject: [PATCH] mem: fix hugepage info mapping

[ upstream commit 66e7ac416f3d62c5ee773ff02c115a24da9f1991 ]

The map_shared_memory() function should treat mmap MAP_FAILED as NULL
because callers compare it with NULL to determine whether the map is
failed.

Fixes: 764bf26873b9 ("add FreeBSD support")
Fixes: cb97d93e9d3b ("mem: share hugepage info primary and secondary")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
---
 lib/librte_eal/freebsd/eal_hugepage_info.c | 2 +-
 lib/librte_eal/linux/eal_hugepage_info.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_eal/freebsd/eal_hugepage_info.c b/lib/librte_eal/freebsd/eal_hugepage_info.c
index 9dbe375bd3..e58e618469 100644
--- a/lib/librte_eal/freebsd/eal_hugepage_info.c
+++ b/lib/librte_eal/freebsd/eal_hugepage_info.c
@@ -33,7 +33,7 @@ map_shared_memory(const char *filename, const size_t mem_size, int flags)
 	}
 	retval = mmap(NULL, mem_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
 	close(fd);
-	return retval;
+	return retval == MAP_FAILED ? NULL : retval;
 }
 
 static void *
diff --git a/lib/librte_eal/linux/eal_hugepage_info.c b/lib/librte_eal/linux/eal_hugepage_info.c
index 4191af6a21..e8f79a0ee7 100644
--- a/lib/librte_eal/linux/eal_hugepage_info.c
+++ b/lib/librte_eal/linux/eal_hugepage_info.c
@@ -57,7 +57,7 @@ map_shared_memory(const char *filename, const size_t mem_size, int flags)
 	retval = mmap(NULL, mem_size, PROT_READ | PROT_WRITE,
 			MAP_SHARED, fd, 0);
 	close(fd);
-	return retval;
+	return retval == MAP_FAILED ? NULL : retval;
 }
 
 static void *
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:29.311410509 +0000
+++ 0026-mem-fix-hugepage-info-mapping.patch	2023-02-23 09:36:28.222169866 +0000
@@ -1 +1 @@
-From 66e7ac416f3d62c5ee773ff02c115a24da9f1991 Mon Sep 17 00:00:00 2001
+From c9375a166c7f23a35c3f8bc0aae05cbb90f25ae0 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 66e7ac416f3d62c5ee773ff02c115a24da9f1991 ]
+
@@ -12 +13,0 @@
-Cc: stable@dpdk.org
@@ -17,2 +18,2 @@
- lib/eal/freebsd/eal_hugepage_info.c | 2 +-
- lib/eal/linux/eal_hugepage_info.c   | 2 +-
+ lib/librte_eal/freebsd/eal_hugepage_info.c | 2 +-
+ lib/librte_eal/linux/eal_hugepage_info.c   | 2 +-
@@ -21 +22 @@
-diff --git a/lib/eal/freebsd/eal_hugepage_info.c b/lib/eal/freebsd/eal_hugepage_info.c
+diff --git a/lib/librte_eal/freebsd/eal_hugepage_info.c b/lib/librte_eal/freebsd/eal_hugepage_info.c
@@ -23,2 +24,2 @@
---- a/lib/eal/freebsd/eal_hugepage_info.c
-+++ b/lib/eal/freebsd/eal_hugepage_info.c
+--- a/lib/librte_eal/freebsd/eal_hugepage_info.c
++++ b/lib/librte_eal/freebsd/eal_hugepage_info.c
@@ -34,5 +35,5 @@
-diff --git a/lib/eal/linux/eal_hugepage_info.c b/lib/eal/linux/eal_hugepage_info.c
-index a1b6cb31ff..24411d9c5b 100644
---- a/lib/eal/linux/eal_hugepage_info.c
-+++ b/lib/eal/linux/eal_hugepage_info.c
-@@ -50,7 +50,7 @@ map_shared_memory(const char *filename, const size_t mem_size, int flags)
+diff --git a/lib/librte_eal/linux/eal_hugepage_info.c b/lib/librte_eal/linux/eal_hugepage_info.c
+index 4191af6a21..e8f79a0ee7 100644
+--- a/lib/librte_eal/linux/eal_hugepage_info.c
++++ b/lib/librte_eal/linux/eal_hugepage_info.c
+@@ -57,7 +57,7 @@ map_shared_memory(const char *filename, const size_t mem_size, int flags)

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'raw/ifpga/base: fix init with multi-process' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (24 preceding siblings ...)
  2023-02-23  9:36 ` patch 'mem: fix hugepage info mapping' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'telemetry: fix repeat display when callback don't init dict' " luca.boccassi
                   ` (43 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: Rosen Xu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From a16c5f0eea2899d4983e68a251e67a45b5588d1e Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Mon, 6 Feb 2023 10:53:11 +0000
Subject: [PATCH] raw/ifpga/base: fix init with multi-process

[ upstream commit e6a2804b77c5fbfd97d0fe05ec7f959a0404a380 ]

The MAP_FAILED should be used to determine whether the mapping is
successful.

Fixes: e41856b515ce ("raw/ifpga/base: enhance driver reliability in multi-process")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Reviewed-by: Rosen Xu <rosen.xu@intel.com>
---
 drivers/raw/ifpga/base/opae_hw_api.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/raw/ifpga/base/opae_hw_api.c b/drivers/raw/ifpga/base/opae_hw_api.c
index d5cd5fe608..8b05a2988d 100644
--- a/drivers/raw/ifpga/base/opae_hw_api.c
+++ b/drivers/raw/ifpga/base/opae_hw_api.c
@@ -380,7 +380,7 @@ static pthread_mutex_t *opae_adapter_mutex_open(struct opae_adapter *adapter)
 				PROT_READ | PROT_WRITE, MAP_SHARED,
 				shm_id, 0);
 		adapter->lock = (pthread_mutex_t *)ptr;
-		if (ptr) {
+		if (ptr != MAP_FAILED) {
 			dev_info(NULL,
 					"shared memory %s address is %p\n",
 					shm_name, ptr);
@@ -497,7 +497,7 @@ static void *opae_adapter_shm_alloc(struct opae_adapter *adapter)
 		adapter->shm.size = size;
 		adapter->shm.ptr = mmap(NULL, size, PROT_READ | PROT_WRITE,
 							MAP_SHARED, shm_id, 0);
-		if (adapter->shm.ptr) {
+		if (adapter->shm.ptr != MAP_FAILED) {
 			dev_info(NULL,
 					"shared memory %s address is %p\n",
 					shm_name, adapter->shm.ptr);
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:29.348212901 +0000
+++ 0027-raw-ifpga-base-fix-init-with-multi-process.patch	2023-02-23 09:36:28.222169866 +0000
@@ -1 +1 @@
-From e6a2804b77c5fbfd97d0fe05ec7f959a0404a380 Mon Sep 17 00:00:00 2001
+From a16c5f0eea2899d4983e68a251e67a45b5588d1e Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit e6a2804b77c5fbfd97d0fe05ec7f959a0404a380 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
-index 1117c3e160..6d48d227d6 100644
+index d5cd5fe608..8b05a2988d 100644
@@ -31 +32 @@
-@@ -499,7 +499,7 @@ static void *opae_adapter_shm_alloc(struct opae_adapter *adapter)
+@@ -497,7 +497,7 @@ static void *opae_adapter_shm_alloc(struct opae_adapter *adapter)

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'telemetry: fix repeat display when callback don't init dict' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (25 preceding siblings ...)
  2023-02-23  9:36 ` patch 'raw/ifpga/base: fix init with multi-process' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'test/mbuf: fix mbuf reset test' " luca.boccassi
                   ` (42 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/9d07f1d80f32a31d8fded7a84e2be080f0400682

Thanks.

Luca Boccassi

---
From 9d07f1d80f32a31d8fded7a84e2be080f0400682 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Thu, 9 Feb 2023 01:25:33 +0000
Subject: [PATCH] telemetry: fix repeat display when callback don't init dict

[ upstream commit ff50c4f9136781bae9089c596e0a12d113e1d474 ]

When a telemetry callback doesn't initialize the telemetry data
structure and returns a non-negative number, the telemetry will repeat
to display the last result. This patch zero the data structure to avoid
the problem.

Fixes: 6dd571fd07c3 ("telemetry: introduce new functionality")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/librte_telemetry/telemetry.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_telemetry/telemetry.c b/lib/librte_telemetry/telemetry.c
index c3522b7173..ed00c17d9f 100644
--- a/lib/librte_telemetry/telemetry.c
+++ b/lib/librte_telemetry/telemetry.c
@@ -281,7 +281,7 @@ output_json(const char *cmd, const struct rte_tel_data *d, int s)
 static void
 perform_command(telemetry_cb fn, const char *cmd, const char *param, int s)
 {
-	struct rte_tel_data data;
+	struct rte_tel_data data = {0};
 
 	int ret = fn(cmd, param, &data);
 	if (ret < 0) {
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:29.384233750 +0000
+++ 0028-telemetry-fix-repeat-display-when-callback-don-t-ini.patch	2023-02-23 09:36:28.222169866 +0000
@@ -1 +1 @@
-From ff50c4f9136781bae9089c596e0a12d113e1d474 Mon Sep 17 00:00:00 2001
+From 9d07f1d80f32a31d8fded7a84e2be080f0400682 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit ff50c4f9136781bae9089c596e0a12d113e1d474 ]
+
@@ -12 +13,0 @@
-Cc: stable@dpdk.org
@@ -17 +18 @@
- lib/telemetry/telemetry.c | 2 +-
+ lib/librte_telemetry/telemetry.c | 2 +-
@@ -20,5 +21,5 @@
-diff --git a/lib/telemetry/telemetry.c b/lib/telemetry/telemetry.c
-index 655191bcf1..7bceadcee7 100644
---- a/lib/telemetry/telemetry.c
-+++ b/lib/telemetry/telemetry.c
-@@ -333,7 +333,7 @@ output_json(const char *cmd, const struct rte_tel_data *d, int s)
+diff --git a/lib/librte_telemetry/telemetry.c b/lib/librte_telemetry/telemetry.c
+index c3522b7173..ed00c17d9f 100644
+--- a/lib/librte_telemetry/telemetry.c
++++ b/lib/librte_telemetry/telemetry.c
+@@ -281,7 +281,7 @@ output_json(const char *cmd, const struct rte_tel_data *d, int s)

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'test/mbuf: fix mbuf reset test' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (26 preceding siblings ...)
  2023-02-23  9:36 ` patch 'telemetry: fix repeat display when callback don't init dict' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'eventdev/timer: fix overflow' " luca.boccassi
                   ` (41 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Jie Hai; +Cc: David Marchand, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/2cf454946ca32d71365c1d22e09f28a2d851fffd

Thanks.

Luca Boccassi

---
From 2cf454946ca32d71365c1d22e09f28a2d851fffd Mon Sep 17 00:00:00 2001
From: Jie Hai <haijie1@huawei.com>
Date: Tue, 31 Jan 2023 10:48:51 +0800
Subject: [PATCH] test/mbuf: fix mbuf reset test

[ upstream commit bf47fb83a61a4bc6bf45e1ec6e3ddd239a856190 ]

Retest "mbuf_autotest" will fail because the mbuf pool was
not freed after previous test successful done.
This patch fixes it.

Fixes: efc6f9104c80 ("mbuf: fix reset on mbuf free")

Signed-off-by: Jie Hai <haijie1@huawei.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
---
 app/test/test_mbuf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
index f0dd693e94..8f6abf5875 100644
--- a/app/test/test_mbuf.c
+++ b/app/test/test_mbuf.c
@@ -2764,6 +2764,7 @@ test_nb_segs_and_next_reset(void)
 			m2->nb_segs != 1 || m2->next != NULL)
 		GOTO_FAIL("nb_segs or next was not reset properly");
 
+	rte_mempool_free(pool);
 	return 0;
 
 fail:
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:29.419586407 +0000
+++ 0029-test-mbuf-fix-mbuf-reset-test.patch	2023-02-23 09:36:28.226169940 +0000
@@ -1 +1 @@
-From bf47fb83a61a4bc6bf45e1ec6e3ddd239a856190 Mon Sep 17 00:00:00 2001
+From 2cf454946ca32d71365c1d22e09f28a2d851fffd Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit bf47fb83a61a4bc6bf45e1ec6e3ddd239a856190 ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index 53fe898a38..6cbb03b0af 100644
+index f0dd693e94..8f6abf5875 100644

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'eventdev/timer: fix overflow' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (27 preceding siblings ...)
  2023-02-23  9:36 ` patch 'test/mbuf: fix mbuf reset test' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'vhost: decrease log level for unimplemented requests' " luca.boccassi
                   ` (40 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Erik Gabriel Carrillo; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From cbc71a34d04d53cbd915cd5fd3bd5d845f96744d Mon Sep 17 00:00:00 2001
From: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
Date: Thu, 9 Feb 2023 09:13:49 -0600
Subject: [PATCH] eventdev/timer: fix overflow

[ upstream commit 13aba5f88d2e1bd8644a2d52fd6b1e4fc73fc3ca ]

The software timer adapter converts event timer timeout ticks to a
number of TSC cycles at which an rte_timer should expire. The
computation uses an integer multiplication that can result in overflow.

If necessary, reduce the timeout_nsecs value by the number of whole
seconds it contains to keep the value of the multiplier within a
range that will not result in overflow.  Add the saved value back later
to get the final result. Also, move the logic that checks the timeout
range into the function that performs the above computation.

Fixes: 6750b21bd6af ("eventdev: add default software timer adapter")

Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
---
 lib/librte_eventdev/rte_event_timer_adapter.c | 97 +++++++++++--------
 1 file changed, 59 insertions(+), 38 deletions(-)

diff --git a/lib/librte_eventdev/rte_event_timer_adapter.c b/lib/librte_eventdev/rte_event_timer_adapter.c
index 64b0f7ed0f..fac32e2b2d 100644
--- a/lib/librte_eventdev/rte_event_timer_adapter.c
+++ b/lib/librte_eventdev/rte_event_timer_adapter.c
@@ -19,6 +19,7 @@
 #include <rte_timer.h>
 #include <rte_service_component.h>
 #include <rte_cycles.h>
+#include <rte_reciprocal.h>
 
 #include "rte_eventdev.h"
 #include "rte_eventdev_pmd.h"
@@ -645,13 +646,51 @@ swtim_callback(struct rte_timer *tim)
 	}
 }
 
-static __rte_always_inline uint64_t
+static __rte_always_inline int
 get_timeout_cycles(struct rte_event_timer *evtim,
-		   const struct rte_event_timer_adapter *adapter)
+		   const struct rte_event_timer_adapter *adapter,
+		   uint64_t *timeout_cycles)
 {
-	struct swtim *sw = swtim_pmd_priv(adapter);
-	uint64_t timeout_ns = evtim->timeout_ticks * sw->timer_tick_ns;
-	return timeout_ns * rte_get_timer_hz() / NSECPERSEC;
+	static struct rte_reciprocal_u64 nsecpersec_inverse;
+	static uint64_t timer_hz;
+	uint64_t rem_cycles, secs_cycles = 0;
+	uint64_t secs, timeout_nsecs;
+	uint64_t nsecpersec;
+	struct swtim *sw;
+
+	sw = swtim_pmd_priv(adapter);
+	nsecpersec = (uint64_t)NSECPERSEC;
+
+	timeout_nsecs = evtim->timeout_ticks * sw->timer_tick_ns;
+	if (timeout_nsecs > sw->max_tmo_ns)
+		return -1;
+	if (timeout_nsecs < sw->timer_tick_ns)
+		return -2;
+
+	/* Set these values in the first invocation */
+	if (!timer_hz) {
+		timer_hz = rte_get_timer_hz();
+		nsecpersec_inverse = rte_reciprocal_value_u64(nsecpersec);
+	}
+
+	/* If timeout_nsecs > nsecpersec, decrease timeout_nsecs by the number
+	 * of whole seconds it contains and convert that value to a number
+	 * of cycles. This keeps timeout_nsecs in the interval [0..nsecpersec)
+	 * in order to avoid overflow when we later multiply by timer_hz.
+	 */
+	if (timeout_nsecs > nsecpersec) {
+		secs = rte_reciprocal_divide_u64(timeout_nsecs,
+						 &nsecpersec_inverse);
+		secs_cycles = secs * timer_hz;
+		timeout_nsecs -= secs * nsecpersec;
+	}
+
+	rem_cycles = rte_reciprocal_divide_u64(timeout_nsecs * timer_hz,
+					       &nsecpersec_inverse);
+
+	*timeout_cycles = secs_cycles + rem_cycles;
+
+	return 0;
 }
 
 /* This function returns true if one or more (adapter) ticks have occurred since
@@ -685,23 +724,6 @@ swtim_did_tick(struct swtim *sw)
 	return false;
 }
 
-/* Check that event timer timeout value is in range */
-static __rte_always_inline int
-check_timeout(struct rte_event_timer *evtim,
-	      const struct rte_event_timer_adapter *adapter)
-{
-	uint64_t tmo_nsec;
-	struct swtim *sw = swtim_pmd_priv(adapter);
-
-	tmo_nsec = evtim->timeout_ticks * sw->timer_tick_ns;
-	if (tmo_nsec > sw->max_tmo_ns)
-		return -1;
-	if (tmo_nsec < sw->timer_tick_ns)
-		return -2;
-
-	return 0;
-}
-
 /* Check that event timer event queue sched type matches destination event queue
  * sched type
  */
@@ -1072,21 +1094,6 @@ __swtim_arm_burst(const struct rte_event_timer_adapter *adapter,
 			break;
 		}
 
-		ret = check_timeout(evtims[i], adapter);
-		if (unlikely(ret == -1)) {
-			__atomic_store_n(&evtims[i]->state,
-					RTE_EVENT_TIMER_ERROR_TOOLATE,
-					__ATOMIC_RELAXED);
-			rte_errno = EINVAL;
-			break;
-		} else if (unlikely(ret == -2)) {
-			__atomic_store_n(&evtims[i]->state,
-					RTE_EVENT_TIMER_ERROR_TOOEARLY,
-					__ATOMIC_RELAXED);
-			rte_errno = EINVAL;
-			break;
-		}
-
 		if (unlikely(check_destination_event_queue(evtims[i],
 							   adapter) < 0)) {
 			__atomic_store_n(&evtims[i]->state,
@@ -1102,7 +1109,21 @@ __swtim_arm_burst(const struct rte_event_timer_adapter *adapter,
 		evtims[i]->impl_opaque[0] = (uintptr_t)tim;
 		evtims[i]->impl_opaque[1] = (uintptr_t)adapter;
 
-		cycles = get_timeout_cycles(evtims[i], adapter);
+		ret = get_timeout_cycles(evtims[i], adapter, &cycles);
+		if (unlikely(ret == -1)) {
+			__atomic_store_n(&evtims[i]->state,
+					RTE_EVENT_TIMER_ERROR_TOOLATE,
+					__ATOMIC_RELAXED);
+			rte_errno = EINVAL;
+			break;
+		} else if (unlikely(ret == -2)) {
+			__atomic_store_n(&evtims[i]->state,
+					RTE_EVENT_TIMER_ERROR_TOOEARLY,
+					__ATOMIC_RELAXED);
+			rte_errno = EINVAL;
+			break;
+		}
+
 		ret = rte_timer_alt_reset(sw->timer_data_id, tim, cycles,
 					  SINGLE, lcore_id, NULL, evtims[i]);
 		if (ret < 0) {
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:29.459059393 +0000
+++ 0030-eventdev-timer-fix-overflow.patch	2023-02-23 09:36:28.226169940 +0000
@@ -1 +1 @@
-From 13aba5f88d2e1bd8644a2d52fd6b1e4fc73fc3ca Mon Sep 17 00:00:00 2001
+From cbc71a34d04d53cbd915cd5fd3bd5d845f96744d Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 13aba5f88d2e1bd8644a2d52fd6b1e4fc73fc3ca ]
+
@@ -17 +18,0 @@
-Cc: stable@dpdk.org
@@ -21 +22 @@
- lib/eventdev/rte_event_timer_adapter.c | 97 ++++++++++++++++----------
+ lib/librte_eventdev/rte_event_timer_adapter.c | 97 +++++++++++--------
@@ -24,5 +25,5 @@
-diff --git a/lib/eventdev/rte_event_timer_adapter.c b/lib/eventdev/rte_event_timer_adapter.c
-index 7f4f347369..23eb1d4a7d 100644
---- a/lib/eventdev/rte_event_timer_adapter.c
-+++ b/lib/eventdev/rte_event_timer_adapter.c
-@@ -18,6 +18,7 @@
+diff --git a/lib/librte_eventdev/rte_event_timer_adapter.c b/lib/librte_eventdev/rte_event_timer_adapter.c
+index 64b0f7ed0f..fac32e2b2d 100644
+--- a/lib/librte_eventdev/rte_event_timer_adapter.c
++++ b/lib/librte_eventdev/rte_event_timer_adapter.c
+@@ -19,6 +19,7 @@
@@ -31 +32 @@
- #include <rte_telemetry.h>
+ #include <rte_cycles.h>
@@ -34,3 +35,3 @@
- #include "event_timer_adapter_pmd.h"
- #include "eventdev_pmd.h"
-@@ -734,13 +735,51 @@ swtim_callback(struct rte_timer *tim)
+ #include "rte_eventdev.h"
+ #include "rte_eventdev_pmd.h"
+@@ -645,13 +646,51 @@ swtim_callback(struct rte_timer *tim)
@@ -93 +94 @@
-@@ -774,23 +813,6 @@ swtim_did_tick(struct swtim *sw)
+@@ -685,23 +724,6 @@ swtim_did_tick(struct swtim *sw)
@@ -117 +118 @@
-@@ -1210,21 +1232,6 @@ __swtim_arm_burst(const struct rte_event_timer_adapter *adapter,
+@@ -1072,21 +1094,6 @@ __swtim_arm_burst(const struct rte_event_timer_adapter *adapter,
@@ -139 +140 @@
-@@ -1240,7 +1247,21 @@ __swtim_arm_burst(const struct rte_event_timer_adapter *adapter,
+@@ -1102,7 +1109,21 @@ __swtim_arm_burst(const struct rte_event_timer_adapter *adapter,
@@ -160 +161 @@
- 					  type, lcore_id, NULL, evtims[i]);
+ 					  SINGLE, lcore_id, NULL, evtims[i]);

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'vhost: decrease log level for unimplemented requests' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (28 preceding siblings ...)
  2023-02-23  9:36 ` patch 'eventdev/timer: fix overflow' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'vhost: fix possible FD leaks' " luca.boccassi
                   ` (39 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Maxime Coquelin; +Cc: Chenbo Xia, Kevin Traynor, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/08a43750b568989f171f8c2bd1caa7ad398da7e9

Thanks.

Luca Boccassi

---
From 08a43750b568989f171f8c2bd1caa7ad398da7e9 Mon Sep 17 00:00:00 2001
From: Maxime Coquelin <maxime.coquelin@redhat.com>
Date: Mon, 6 Feb 2023 16:07:33 +0100
Subject: [PATCH] vhost: decrease log level for unimplemented requests

[ upstream commit 43ccd55fdd6ab34b55060045594cc21aefa74383 ]

This patch changes VHOST_USER_SET_VRING_ERR and
VHOST_USER_SET_LOG_FD "not implemented" log levels from
INFO to DEBUG, as implementing these requests is not
mandatory. Having them being displayed at INFO level
may induce some confusion to the end-user.

Fixes: fd29c33b651a ("vhost: handle unsupported message types in functions")

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
---
 lib/librte_vhost/vhost_user.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index da04a37867..93781f4b80 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -1679,7 +1679,7 @@ static int vhost_user_set_vring_err(struct virtio_net **pdev __rte_unused,
 
 	if (!(msg->payload.u64 & VHOST_USER_VRING_NOFD_MASK))
 		close(msg->fds[0]);
-	VHOST_LOG_CONFIG(INFO, "not implemented\n");
+	VHOST_LOG_CONFIG(DEBUG, "not implemented\n");
 
 	return RTE_VHOST_MSG_RESULT_OK;
 }
@@ -2191,7 +2191,7 @@ static int vhost_user_set_log_fd(struct virtio_net **pdev __rte_unused,
 		return RTE_VHOST_MSG_RESULT_ERR;
 
 	close(msg->fds[0]);
-	VHOST_LOG_CONFIG(INFO, "not implemented.\n");
+	VHOST_LOG_CONFIG(DEBUG, "not implemented.\n");
 
 	return RTE_VHOST_MSG_RESULT_OK;
 }
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:29.495272824 +0000
+++ 0031-vhost-decrease-log-level-for-unimplemented-requests.patch	2023-02-23 09:36:28.230170013 +0000
@@ -1 +1 @@
-From 43ccd55fdd6ab34b55060045594cc21aefa74383 Mon Sep 17 00:00:00 2001
+From 08a43750b568989f171f8c2bd1caa7ad398da7e9 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 43ccd55fdd6ab34b55060045594cc21aefa74383 ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
- lib/vhost/vhost_user.c | 4 ++--
+ lib/librte_vhost/vhost_user.c | 4 ++--
@@ -22,5 +23,5 @@
-diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c
-index 8c1d60b76b..b4236820a2 100644
---- a/lib/vhost/vhost_user.c
-+++ b/lib/vhost/vhost_user.c
-@@ -1818,7 +1818,7 @@ static int vhost_user_set_vring_err(struct virtio_net **pdev,
+diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
+index da04a37867..93781f4b80 100644
+--- a/lib/librte_vhost/vhost_user.c
++++ b/lib/librte_vhost/vhost_user.c
+@@ -1679,7 +1679,7 @@ static int vhost_user_set_vring_err(struct virtio_net **pdev __rte_unused,
@@ -28,4 +29,4 @@
- 	if (!(ctx->msg.payload.u64 & VHOST_USER_VRING_NOFD_MASK))
- 		close(ctx->fds[0]);
--	VHOST_LOG_CONFIG(dev->ifname, INFO, "not implemented\n");
-+	VHOST_LOG_CONFIG(dev->ifname, DEBUG, "not implemented\n");
+ 	if (!(msg->payload.u64 & VHOST_USER_VRING_NOFD_MASK))
+ 		close(msg->fds[0]);
+-	VHOST_LOG_CONFIG(INFO, "not implemented\n");
++	VHOST_LOG_CONFIG(DEBUG, "not implemented\n");
@@ -35 +36 @@
-@@ -2340,7 +2340,7 @@ static int vhost_user_set_log_fd(struct virtio_net **pdev,
+@@ -2191,7 +2191,7 @@ static int vhost_user_set_log_fd(struct virtio_net **pdev __rte_unused,
@@ -38,3 +39,3 @@
- 	close(ctx->fds[0]);
--	VHOST_LOG_CONFIG(dev->ifname, INFO, "not implemented.\n");
-+	VHOST_LOG_CONFIG(dev->ifname, DEBUG, "not implemented.\n");
+ 	close(msg->fds[0]);
+-	VHOST_LOG_CONFIG(INFO, "not implemented.\n");
++	VHOST_LOG_CONFIG(DEBUG, "not implemented.\n");

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'vhost: fix possible FD leaks' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (29 preceding siblings ...)
  2023-02-23  9:36 ` patch 'vhost: decrease log level for unimplemented requests' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'vhost: fix possible FD leaks on truncation' " luca.boccassi
                   ` (38 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Maxime Coquelin; +Cc: David Marchand, Chenbo Xia, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/6a874396c4c6384acd6168bb3768fbcd18b4c3a5

Thanks.

Luca Boccassi

---
From 6a874396c4c6384acd6168bb3768fbcd18b4c3a5 Mon Sep 17 00:00:00 2001
From: Maxime Coquelin <maxime.coquelin@redhat.com>
Date: Tue, 7 Feb 2023 17:22:39 +0100
Subject: [PATCH] vhost: fix possible FD leaks

[ upstream commit 585283f9a703fcd994dbf9aca07dea9445319862 ]

On failure, read_vhost_message() only closed the message
FDs if the header size was unexpected, but there are other
cases where it is required. For example in the case the
payload size read from the header is greater than the
expected maximum payload size.

This patch fixes this by closing all messages FDs in all
error cases. It also improve error logging by displaying
the request name when failure happens if possible.

Fixes: bf472259dde6 ("vhost: fix possible denial of service by leaking FDs")

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
---
 lib/librte_vhost/vhost_user.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index 93781f4b80..d42ca1d59c 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -2609,30 +2609,37 @@ read_vhost_message(int sockfd, struct VhostUserMsg *msg)
 
 	ret = read_fd_message(sockfd, (char *)msg, VHOST_USER_HDR_SIZE,
 		msg->fds, VHOST_MEMORY_MAX_NREGIONS, &msg->fd_num);
-	if (ret <= 0) {
-		return ret;
-	} else if (ret != VHOST_USER_HDR_SIZE) {
+	if (ret <= 0)
+		goto out;
+
+	if (ret != VHOST_USER_HDR_SIZE) {
 		VHOST_LOG_CONFIG(ERR, "Unexpected header size read\n");
-		close_msg_fds(msg);
-		return -1;
+		ret = -1;
+		goto out;
 	}
 
 	if (msg->size) {
 		if (msg->size > sizeof(msg->payload)) {
 			VHOST_LOG_CONFIG(ERR,
 				"invalid msg size: %d\n", msg->size);
-			return -1;
+			ret = -1;
+			goto out;
 		}
 		ret = read(sockfd, &msg->payload, msg->size);
 		if (ret <= 0)
-			return ret;
+			goto out;
 		if (ret != (int)msg->size) {
 			VHOST_LOG_CONFIG(ERR,
 				"read control message failed\n");
-			return -1;
+			ret = -1;
+			goto out;
 		}
 	}
 
+out:
+	if (ret <= 0)
+		close_msg_fds(msg);
+
 	return ret;
 }
 
@@ -2778,6 +2785,7 @@ vhost_user_msg_handler(int vid, int fd)
 		}
 	}
 
+	msg.request.master = VHOST_USER_NONE;
 	ret = read_vhost_message(fd, &msg);
 	if (ret <= 0) {
 		if (ret < 0)
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:29.533149201 +0000
+++ 0032-vhost-fix-possible-FD-leaks.patch	2023-02-23 09:36:28.234170087 +0000
@@ -1 +1 @@
-From 585283f9a703fcd994dbf9aca07dea9445319862 Mon Sep 17 00:00:00 2001
+From 6a874396c4c6384acd6168bb3768fbcd18b4c3a5 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 585283f9a703fcd994dbf9aca07dea9445319862 ]
+
@@ -17 +18,0 @@
-Cc: stable@dpdk.org
@@ -23,2 +24,2 @@
- lib/vhost/vhost_user.c | 40 ++++++++++++++++++++++++++--------------
- 1 file changed, 26 insertions(+), 14 deletions(-)
+ lib/librte_vhost/vhost_user.c | 24 ++++++++++++++++--------
+ 1 file changed, 16 insertions(+), 8 deletions(-)
@@ -26,5 +27,5 @@
-diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c
-index b4236820a2..d702d082dd 100644
---- a/lib/vhost/vhost_user.c
-+++ b/lib/vhost/vhost_user.c
-@@ -2831,29 +2831,36 @@ read_vhost_message(struct virtio_net *dev, int sockfd, struct  vhu_msg_context *
+diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
+index 93781f4b80..d42ca1d59c 100644
+--- a/lib/librte_vhost/vhost_user.c
++++ b/lib/librte_vhost/vhost_user.c
+@@ -2609,30 +2609,37 @@ read_vhost_message(int sockfd, struct VhostUserMsg *msg)
@@ -32,2 +33,2 @@
- 	ret = read_fd_message(dev->ifname, sockfd, (char *)&ctx->msg, VHOST_USER_HDR_SIZE,
- 		ctx->fds, VHOST_MEMORY_MAX_NREGIONS, &ctx->fd_num);
+ 	ret = read_fd_message(sockfd, (char *)msg, VHOST_USER_HDR_SIZE,
+ 		msg->fds, VHOST_MEMORY_MAX_NREGIONS, &msg->fd_num);
@@ -41,2 +42,2 @@
- 		VHOST_LOG_CONFIG(dev->ifname, ERR, "Unexpected header size read\n");
--		close_msg_fds(ctx);
+ 		VHOST_LOG_CONFIG(ERR, "Unexpected header size read\n");
+-		close_msg_fds(msg);
@@ -48,4 +49,4 @@
- 	if (ctx->msg.size) {
- 		if (ctx->msg.size > sizeof(ctx->msg.payload)) {
- 			VHOST_LOG_CONFIG(dev->ifname, ERR, "invalid msg size: %d\n",
- 				ctx->msg.size);
+ 	if (msg->size) {
+ 		if (msg->size > sizeof(msg->payload)) {
+ 			VHOST_LOG_CONFIG(ERR,
+ 				"invalid msg size: %d\n", msg->size);
@@ -56 +57 @@
- 		ret = read(sockfd, &ctx->msg.payload, ctx->msg.size);
+ 		ret = read(sockfd, &msg->payload, msg->size);
@@ -60,2 +61,3 @@
- 		if (ret != (int)ctx->msg.size) {
- 			VHOST_LOG_CONFIG(dev->ifname, ERR, "read control message failed\n");
+ 		if (ret != (int)msg->size) {
+ 			VHOST_LOG_CONFIG(ERR,
+ 				"read control message failed\n");
@@ -70 +72 @@
-+		close_msg_fds(ctx);
++		close_msg_fds(msg);
@@ -75 +77 @@
-@@ -3031,13 +3038,10 @@ vhost_user_msg_handler(int vid, int fd)
+@@ -2778,6 +2785,7 @@ vhost_user_msg_handler(int vid, int fd)
@@ -79,28 +81,4 @@
-+	ctx.msg.request.master = VHOST_USER_NONE;
- 	ret = read_vhost_message(dev, fd, &ctx);
--	if (ret <= 0) {
--		if (ret < 0)
--			VHOST_LOG_CONFIG(dev->ifname, ERR, "vhost read message failed\n");
--		else
--			VHOST_LOG_CONFIG(dev->ifname, INFO, "vhost peer closed\n");
--
-+	if (ret == 0) {
-+		VHOST_LOG_CONFIG(dev->ifname, INFO, "vhost peer closed\n");
- 		return -1;
- 	}
- 
-@@ -3047,6 +3051,14 @@ vhost_user_msg_handler(int vid, int fd)
- 	else
- 		msg_handler = NULL;
- 
-+	if (ret < 0) {
-+		VHOST_LOG_CONFIG(dev->ifname, ERR, "vhost read message %s%s%sfailed\n",
-+				msg_handler != NULL ? "for " : "",
-+				msg_handler != NULL ? msg_handler->description : "",
-+				msg_handler != NULL ? " " : "");
-+		return -1;
-+	}
-+
- 	if (msg_handler != NULL && msg_handler->description != NULL) {
- 		if (request != VHOST_USER_IOTLB_MSG)
- 			VHOST_LOG_CONFIG(dev->ifname, INFO,
++	msg.request.master = VHOST_USER_NONE;
+ 	ret = read_vhost_message(fd, &msg);
+ 	if (ret <= 0) {
+ 		if (ret < 0)

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'vhost: fix possible FD leaks on truncation' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (30 preceding siblings ...)
  2023-02-23  9:36 ` patch 'vhost: fix possible FD leaks' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'net/virtio-user: fix device starting failure handling' " luca.boccassi
                   ` (37 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Maxime Coquelin; +Cc: David Marchand, Chenbo Xia, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From d1e390eb131be74d8a25d9f63f6b6c128c806383 Mon Sep 17 00:00:00 2001
From: Maxime Coquelin <maxime.coquelin@redhat.com>
Date: Tue, 7 Feb 2023 17:22:40 +0100
Subject: [PATCH] vhost: fix possible FD leaks on truncation

[ upstream commit 218daf1664561eca787369c13e1a9ea5cdaad2a8 ]

This patch fixes possible FDs leaks when truncation happens
on either the message buffer or its control data. Indeed,
by returning early, it did not let a chance to retrieve the
FDs passed as ancillary data, and so caused a potential FDs
leak.

This patch fixes this by extracting the FDs from the
ancillary data as long as recvmsg() call succeeded. It also
improves the logs to differentiate between MSG_TRUNC and
MSG_CTRUNC.

Fixes: bf472259dde6 ("vhost: fix possible denial of service by leaking FDs")

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
---
 lib/librte_vhost/socket.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c
index a3e5a0160b..63c95587b0 100644
--- a/lib/librte_vhost/socket.c
+++ b/lib/librte_vhost/socket.c
@@ -128,10 +128,12 @@ read_fd_message(int sockfd, char *buf, int buflen, int *fds, int max_fds,
 		return ret;
 	}
 
-	if (msgh.msg_flags & (MSG_TRUNC | MSG_CTRUNC)) {
+	if (msgh.msg_flags & MSG_TRUNC)
 		VHOST_LOG_CONFIG(ERR, "truncated msg\n");
-		return -1;
-	}
+
+	/* MSG_CTRUNC may be caused by LSM misconfiguration */
+	if (msgh.msg_flags & MSG_CTRUNC)
+		VHOST_LOG_CONFIG(ERR, "truncated control data (fd %d)\n", sockfd);
 
 	for (cmsg = CMSG_FIRSTHDR(&msgh); cmsg != NULL;
 		cmsg = CMSG_NXTHDR(&msgh, cmsg)) {
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:29.571147026 +0000
+++ 0033-vhost-fix-possible-FD-leaks-on-truncation.patch	2023-02-23 09:36:28.234170087 +0000
@@ -1 +1 @@
-From 218daf1664561eca787369c13e1a9ea5cdaad2a8 Mon Sep 17 00:00:00 2001
+From d1e390eb131be74d8a25d9f63f6b6c128c806383 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 218daf1664561eca787369c13e1a9ea5cdaad2a8 ]
+
@@ -18 +19,0 @@
-Cc: stable@dpdk.org
@@ -24 +25 @@
- lib/vhost/socket.c | 8 +++++---
+ lib/librte_vhost/socket.c | 8 +++++---
@@ -27,5 +28,5 @@
-diff --git a/lib/vhost/socket.c b/lib/vhost/socket.c
-index 863a6f6d52..669c322e12 100644
---- a/lib/vhost/socket.c
-+++ b/lib/vhost/socket.c
-@@ -129,10 +129,12 @@ read_fd_message(char *ifname, int sockfd, char *buf, int buflen, int *fds, int m
+diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c
+index a3e5a0160b..63c95587b0 100644
+--- a/lib/librte_vhost/socket.c
++++ b/lib/librte_vhost/socket.c
+@@ -128,10 +128,12 @@ read_fd_message(int sockfd, char *buf, int buflen, int *fds, int max_fds,
@@ -37 +38 @@
- 		VHOST_LOG_CONFIG(ifname, ERR, "truncated msg (fd %d)\n", sockfd);
+ 		VHOST_LOG_CONFIG(ERR, "truncated msg\n");
@@ -43 +44 @@
-+		VHOST_LOG_CONFIG(ifname, ERR, "truncated control data (fd %d)\n", sockfd);
++		VHOST_LOG_CONFIG(ERR, "truncated control data (fd %d)\n", sockfd);

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/virtio-user: fix device starting failure handling' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (31 preceding siblings ...)
  2023-02-23  9:36 ` patch 'vhost: fix possible FD leaks on truncation' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'app/testpmd: fix forwarding stats for Tx dropped' " luca.boccassi
                   ` (36 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Maxime Coquelin; +Cc: Chenbo Xia, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/7b89a6890e19dded3dad3925be927471b7dd346f

Thanks.

Luca Boccassi

---
From 7b89a6890e19dded3dad3925be927471b7dd346f Mon Sep 17 00:00:00 2001
From: Maxime Coquelin <maxime.coquelin@redhat.com>
Date: Thu, 9 Feb 2023 10:17:01 +0100
Subject: [PATCH] net/virtio-user: fix device starting failure handling

[ upstream commit c1a6f787b04e470ebe9b5a3891022195eb2bc555 ]

If the device fails to start, read the status from the
device and return early.

Fixes: 57912824615f ("net/virtio-user: support vhost status setting")

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
---
 drivers/net/virtio/virtio_user_ethdev.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c
index 347caeef41..a6a2135eff 100644
--- a/drivers/net/virtio/virtio_user_ethdev.c
+++ b/drivers/net/virtio/virtio_user_ethdev.c
@@ -317,10 +317,15 @@ virtio_user_set_status(struct virtio_hw *hw, uint8_t status)
 	if (status & VIRTIO_CONFIG_STATUS_FEATURES_OK &&
 			~old_status & VIRTIO_CONFIG_STATUS_FEATURES_OK)
 		virtio_user_dev_set_features(dev);
-	if (status & VIRTIO_CONFIG_STATUS_DRIVER_OK)
-		virtio_user_start_device(dev);
-	else if (status == VIRTIO_CONFIG_STATUS_RESET)
+
+	if (status & VIRTIO_CONFIG_STATUS_DRIVER_OK) {
+		if (virtio_user_start_device(dev)) {
+			virtio_user_dev_update_status(dev);
+			return;
+		}
+	} else if (status == VIRTIO_CONFIG_STATUS_RESET) {
 		virtio_user_reset(hw);
+	}
 
 	virtio_user_dev_set_status(dev, status);
 }
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:29.608319515 +0000
+++ 0034-net-virtio-user-fix-device-starting-failure-handling.patch	2023-02-23 09:36:28.234170087 +0000
@@ -1 +1 @@
-From c1a6f787b04e470ebe9b5a3891022195eb2bc555 Mon Sep 17 00:00:00 2001
+From 7b89a6890e19dded3dad3925be927471b7dd346f Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit c1a6f787b04e470ebe9b5a3891022195eb2bc555 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
-index d32abec327..78b1ed9ace 100644
+index 347caeef41..a6a2135eff 100644
@@ -22 +23 @@
-@@ -90,10 +90,15 @@ virtio_user_set_status(struct virtio_hw *hw, uint8_t status)
+@@ -317,10 +317,15 @@ virtio_user_set_status(struct virtio_hw *hw, uint8_t status)

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'app/testpmd: fix forwarding stats for Tx dropped' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (32 preceding siblings ...)
  2023-02-23  9:36 ` patch 'net/virtio-user: fix device starting failure handling' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'net/txgbe: fix default signal quality value for KX/KX4' " luca.boccassi
                   ` (35 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Joshua Washington, Huisong Li, Aman Singh, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/632cf722cc2a9f850de14fa1a79adfced8449228

Thanks.

Luca Boccassi

---
From 632cf722cc2a9f850de14fa1a79adfced8449228 Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit@amd.com>
Date: Tue, 31 Jan 2023 11:56:03 +0000
Subject: [PATCH] app/testpmd: fix forwarding stats for Tx dropped

[ upstream commit c3fd1e6089cce14ad3f941ab5df0501e03b3356c ]

There is an inconsistency at displaying Tx dropped value for per port
forwarding stats and accumulated forwarding stats.

While displaying per port TX-dropped value, it only takes
'ports_stats[pt_id].tx_dropped' into account,
but for accumulated TX-dropped results it takes both
'ports_stats[pt_id].tx_dropped' & 'stats.oerrors' into account.

To fix, make both per port and accumulated stats display 'tx_dropped'
and 'stats.oerrors' (ports_stats[pt_id].tx_dropped + stats.oerrors).

Fixes: 53324971a14e ("app/testpmd: display/clear forwarding stats on demand")

Reported-by: Joshua Washington <joshwash@google.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
Acked-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Aman Singh <aman.deep.singh@intel.com>
---
 app/test-pmd/testpmd.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 799fa9f539..508f2c4268 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1845,6 +1845,8 @@ fwd_stats_display(void)
 			fwd_cycles += fs->core_cycles;
 	}
 	for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
+		uint64_t tx_dropped = 0;
+
 		pt_id = fwd_ports_ids[i];
 		port = &ports[pt_id];
 
@@ -1866,8 +1868,9 @@ fwd_stats_display(void)
 		total_recv += stats.ipackets;
 		total_xmit += stats.opackets;
 		total_rx_dropped += stats.imissed;
-		total_tx_dropped += ports_stats[pt_id].tx_dropped;
-		total_tx_dropped += stats.oerrors;
+		tx_dropped += ports_stats[pt_id].tx_dropped;
+		tx_dropped += stats.oerrors;
+		total_tx_dropped += tx_dropped;
 		total_rx_nombuf  += stats.rx_nombuf;
 
 		printf("\n  %s Forward statistics for port %-2d %s\n",
@@ -1891,8 +1894,8 @@ fwd_stats_display(void)
 
 		printf("  TX-packets: %-14"PRIu64" TX-dropped: %-14"PRIu64
 		       "TX-total: %-"PRIu64"\n",
-		       stats.opackets, ports_stats[pt_id].tx_dropped,
-		       stats.opackets + ports_stats[pt_id].tx_dropped);
+		       stats.opackets, tx_dropped,
+		       stats.opackets + tx_dropped);
 
 		if (record_burst_stats) {
 			if (ports_stats[pt_id].rx_stream)
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:29.644052780 +0000
+++ 0035-app-testpmd-fix-forwarding-stats-for-Tx-dropped.patch	2023-02-23 09:36:28.238170161 +0000
@@ -1 +1 @@
-From c3fd1e6089cce14ad3f941ab5df0501e03b3356c Mon Sep 17 00:00:00 2001
+From 632cf722cc2a9f850de14fa1a79adfced8449228 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit c3fd1e6089cce14ad3f941ab5df0501e03b3356c ]
+
@@ -18 +19,0 @@
-Cc: stable@dpdk.org
@@ -29 +30 @@
-index 86fa9c16ba..f3e29a5b4b 100644
+index 799fa9f539..508f2c4268 100644
@@ -32,2 +33,2 @@
-@@ -2061,6 +2061,8 @@ fwd_stats_display(void)
- 			fwd_cycles += fs->busy_cycles;
+@@ -1845,6 +1845,8 @@ fwd_stats_display(void)
+ 			fwd_cycles += fs->core_cycles;
@@ -41 +42 @@
-@@ -2082,8 +2084,9 @@ fwd_stats_display(void)
+@@ -1866,8 +1868,9 @@ fwd_stats_display(void)
@@ -53 +54 @@
-@@ -2110,8 +2113,8 @@ fwd_stats_display(void)
+@@ -1891,8 +1894,8 @@ fwd_stats_display(void)

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/txgbe: fix default signal quality value for KX/KX4' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (33 preceding siblings ...)
  2023-02-23  9:36 ` patch 'app/testpmd: fix forwarding stats for Tx dropped' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'net/txgbe: fix packet type to parse from offload flags' " luca.boccassi
                   ` (34 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Jiawen Wu; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/62b31a67404a62fd3e09149f17e541f7f03db80d

Thanks.

Luca Boccassi

---
From 62b31a67404a62fd3e09149f17e541f7f03db80d Mon Sep 17 00:00:00 2001
From: Jiawen Wu <jiawenwu@trustnetic.com>
Date: Thu, 2 Feb 2023 17:21:25 +0800
Subject: [PATCH] net/txgbe: fix default signal quality value for KX/KX4

[ upstream commit 7211175417d4f6a7b03a0e7e7355dc62fced8512 ]

On old firmware versions, the default value of signal quality(TX_EQ) is
configured by the driver. Fix it for KX/KX4 mode.

Fixes: 01c3cf5c85a7 ("net/txgbe: add autoneg control read and write")

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
 drivers/net/txgbe/base/txgbe_phy.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/txgbe/base/txgbe_phy.c b/drivers/net/txgbe/base/txgbe_phy.c
index ce6d580636..73f3cdced1 100644
--- a/drivers/net/txgbe/base/txgbe_phy.c
+++ b/drivers/net/txgbe/base/txgbe_phy.c
@@ -1491,9 +1491,10 @@ txgbe_set_link_to_kx4(struct txgbe_hw *hw, bool autoneg)
 	wr32_epcs(hw, TXGBE_PHY_MISC_CTL0, 0x4F00);
 
 	value = (0x1804 & ~0x3F3F);
+	value |= 40 << 8;
 	wr32_epcs(hw, TXGBE_PHY_TX_EQ_CTL0, value);
 
-	value = (0x50 & ~0x7F) | 40 | (1 << 6);
+	value = (0x50 & ~0x7F) | (1 << 6);
 	wr32_epcs(hw, TXGBE_PHY_TX_EQ_CTL1, value);
 
 	for (i = 0; i < 4; i++) {
@@ -1701,10 +1702,10 @@ txgbe_set_link_to_kx(struct txgbe_hw *hw,
 
 	wr32_epcs(hw, TXGBE_PHY_MISC_CTL0, 0x4F00);
 
-	value = (0x1804 & ~0x3F3F) | (24 << 8) | 4;
+	value = (0x1804 & ~0x3F3F) | (24 << 8);
 	wr32_epcs(hw, TXGBE_PHY_TX_EQ_CTL0, value);
 
-	value = (0x50 & ~0x7F) | 16 | (1 << 6);
+	value = (0x50 & ~0x7F) | (1 << 6);
 	wr32_epcs(hw, TXGBE_PHY_TX_EQ_CTL1, value);
 
 	for (i = 0; i < 4; i++) {
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:29.683013222 +0000
+++ 0036-net-txgbe-fix-default-signal-quality-value-for-KX-KX.patch	2023-02-23 09:36:28.242170234 +0000
@@ -1 +1 @@
-From 7211175417d4f6a7b03a0e7e7355dc62fced8512 Mon Sep 17 00:00:00 2001
+From 62b31a67404a62fd3e09149f17e541f7f03db80d Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 7211175417d4f6a7b03a0e7e7355dc62fced8512 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -18 +19 @@
-index 9f46d5bdb0..87935abdaa 100644
+index ce6d580636..73f3cdced1 100644
@@ -21,25 +22,25 @@
-@@ -1693,9 +1693,10 @@ txgbe_set_link_to_kx4(struct txgbe_hw *hw, bool autoneg)
- 		wr32_epcs(hw, TXGBE_PHY_TX_EQ_CTL1, value);
- 	} else if (hw->fw_version <= TXGBE_FW_N_TXEQ) {
- 		value = (0x1804 & ~0x3F3F);
-+		value |= 40 << 8;
- 		wr32_epcs(hw, TXGBE_PHY_TX_EQ_CTL0, value);
- 
--		value = (0x50 & ~0x7F) | 40 | (1 << 6);
-+		value = (0x50 & ~0x7F) | (1 << 6);
- 		wr32_epcs(hw, TXGBE_PHY_TX_EQ_CTL1, value);
- 	}
- out:
-@@ -1907,10 +1908,10 @@ txgbe_set_link_to_kx(struct txgbe_hw *hw,
- 		value |= hw->phy.ffe_post | (1 << 6);
- 		wr32_epcs(hw, TXGBE_PHY_TX_EQ_CTL1, value);
- 	} else if (hw->fw_version <= TXGBE_FW_N_TXEQ) {
--		value = (0x1804 & ~0x3F3F) | (24 << 8) | 4;
-+		value = (0x1804 & ~0x3F3F) | (40 << 8);
- 		wr32_epcs(hw, TXGBE_PHY_TX_EQ_CTL0, value);
- 
--		value = (0x50 & ~0x7F) | 16 | (1 << 6);
-+		value = (0x50 & ~0x7F) | (1 << 6);
- 		wr32_epcs(hw, TXGBE_PHY_TX_EQ_CTL1, value);
- 	}
- out:
+@@ -1491,9 +1491,10 @@ txgbe_set_link_to_kx4(struct txgbe_hw *hw, bool autoneg)
+ 	wr32_epcs(hw, TXGBE_PHY_MISC_CTL0, 0x4F00);
+ 
+ 	value = (0x1804 & ~0x3F3F);
++	value |= 40 << 8;
+ 	wr32_epcs(hw, TXGBE_PHY_TX_EQ_CTL0, value);
+ 
+-	value = (0x50 & ~0x7F) | 40 | (1 << 6);
++	value = (0x50 & ~0x7F) | (1 << 6);
+ 	wr32_epcs(hw, TXGBE_PHY_TX_EQ_CTL1, value);
+ 
+ 	for (i = 0; i < 4; i++) {
+@@ -1701,10 +1702,10 @@ txgbe_set_link_to_kx(struct txgbe_hw *hw,
+ 
+ 	wr32_epcs(hw, TXGBE_PHY_MISC_CTL0, 0x4F00);
+ 
+-	value = (0x1804 & ~0x3F3F) | (24 << 8) | 4;
++	value = (0x1804 & ~0x3F3F) | (24 << 8);
+ 	wr32_epcs(hw, TXGBE_PHY_TX_EQ_CTL0, value);
+ 
+-	value = (0x50 & ~0x7F) | 16 | (1 << 6);
++	value = (0x50 & ~0x7F) | (1 << 6);
+ 	wr32_epcs(hw, TXGBE_PHY_TX_EQ_CTL1, value);
+ 
+ 	for (i = 0; i < 4; i++) {

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/txgbe: fix packet type to parse from offload flags' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (34 preceding siblings ...)
  2023-02-23  9:36 ` patch 'net/txgbe: fix default signal quality value for KX/KX4' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'net/txgbe: fix interrupt loss' " luca.boccassi
                   ` (33 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Jiawen Wu; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/1c060c633e390268f4508ea6962c65e294325dfe

Thanks.

Luca Boccassi

---
From 1c060c633e390268f4508ea6962c65e294325dfe Mon Sep 17 00:00:00 2001
From: Jiawen Wu <jiawenwu@trustnetic.com>
Date: Thu, 2 Feb 2023 17:21:26 +0800
Subject: [PATCH] net/txgbe: fix packet type to parse from offload flags

[ upstream commit 0e32d6edd47914d38857c34d97416b9c91929020 ]

Context descriptors which contains the length of each packet layer and
the packet type are needed when Tx checksum offload or TSO is on. If the
packet type and length do not strictly match, it will cause Tx ring hang.

In some external applications, developers may fill in wrong packet_type
in rte_mbuf for Tx path. For example, they encap/decap the packets but
did not refill the packet_type. To prevent this, change it to parse from
ol_flags.

Fixes: ca46fcd753b1 ("net/txgbe: support Tx with hardware offload")

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
 drivers/net/txgbe/txgbe_rxtx.c | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/drivers/net/txgbe/txgbe_rxtx.c b/drivers/net/txgbe/txgbe_rxtx.c
index 82dde509a0..1196b95367 100644
--- a/drivers/net/txgbe/txgbe_rxtx.c
+++ b/drivers/net/txgbe/txgbe_rxtx.c
@@ -495,20 +495,21 @@ tx_desc_ol_flags_to_cmdtype(uint64_t ol_flags)
 	return cmdtype;
 }
 
-static inline uint8_t
-tx_desc_ol_flags_to_ptid(uint64_t oflags, uint32_t ptype)
+static inline uint32_t
+tx_desc_ol_flags_to_ptype(uint64_t oflags)
 {
+	uint32_t ptype;
 	bool tun;
 
-	if (ptype)
-		return txgbe_encode_ptype(ptype);
-
 	/* Only support flags in TXGBE_TX_OFFLOAD_MASK */
 	tun = !!(oflags & PKT_TX_TUNNEL_MASK);
 
 	/* L2 level */
 	ptype = RTE_PTYPE_L2_ETHER;
 	if (oflags & PKT_TX_VLAN)
+		ptype |= (tun ? RTE_PTYPE_INNER_L2_ETHER_VLAN : RTE_PTYPE_L2_ETHER_VLAN);
+
+	if (oflags & PKT_TX_QINQ) /* tunnel + QINQ is not supported */
 		ptype |= RTE_PTYPE_L2_ETHER_VLAN;
 
 	/* L3 level */
@@ -572,6 +573,16 @@ tx_desc_ol_flags_to_ptid(uint64_t oflags, uint32_t ptype)
 		break;
 	}
 
+	return ptype;
+}
+
+static inline uint8_t
+tx_desc_ol_flags_to_ptid(uint64_t oflags)
+{
+	uint32_t ptype;
+
+	ptype = tx_desc_ol_flags_to_ptype(oflags);
+
 	return txgbe_encode_ptype(ptype);
 }
 
@@ -731,8 +742,7 @@ txgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 		/* If hardware offload required */
 		tx_ol_req = ol_flags & TXGBE_TX_OFFLOAD_MASK;
 		if (tx_ol_req) {
-			tx_offload.ptid = tx_desc_ol_flags_to_ptid(tx_ol_req,
-					tx_pkt->packet_type);
+			tx_offload.ptid = tx_desc_ol_flags_to_ptid(tx_ol_req);
 			tx_offload.l2_len = tx_pkt->l2_len;
 			tx_offload.l3_len = tx_pkt->l3_len;
 			tx_offload.l4_len = tx_pkt->l4_len;
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:29.720632695 +0000
+++ 0037-net-txgbe-fix-packet-type-to-parse-from-offload-flag.patch	2023-02-23 09:36:28.246170308 +0000
@@ -1 +1 @@
-From 0e32d6edd47914d38857c34d97416b9c91929020 Mon Sep 17 00:00:00 2001
+From 1c060c633e390268f4508ea6962c65e294325dfe Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 0e32d6edd47914d38857c34d97416b9c91929020 ]
+
@@ -16 +17,0 @@
-Cc: stable@dpdk.org
@@ -24 +25 @@
-index ac1bba08a3..021f281fbb 100644
+index 82dde509a0..1196b95367 100644
@@ -27 +28 @@
-@@ -516,20 +516,21 @@ tx_desc_ol_flags_to_cmdtype(uint64_t ol_flags)
+@@ -495,20 +495,21 @@ tx_desc_ol_flags_to_cmdtype(uint64_t ol_flags)
@@ -43 +44 @@
- 	tun = !!(oflags & RTE_MBUF_F_TX_TUNNEL_MASK);
+ 	tun = !!(oflags & PKT_TX_TUNNEL_MASK);
@@ -47 +48 @@
- 	if (oflags & RTE_MBUF_F_TX_VLAN)
+ 	if (oflags & PKT_TX_VLAN)
@@ -50 +51 @@
-+	if (oflags & RTE_MBUF_F_TX_QINQ) /* tunnel + QINQ is not supported */
++	if (oflags & PKT_TX_QINQ) /* tunnel + QINQ is not supported */
@@ -54 +55 @@
-@@ -587,6 +588,16 @@ tx_desc_ol_flags_to_ptid(uint64_t oflags, uint32_t ptype)
+@@ -572,6 +573,16 @@ tx_desc_ol_flags_to_ptid(uint64_t oflags, uint32_t ptype)
@@ -71 +72 @@
-@@ -776,8 +787,7 @@ txgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
+@@ -731,8 +742,7 @@ txgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
@@ -78,2 +78,0 @@
- 			if (tx_offload.ptid & TXGBE_PTID_PKT_TUN)
- 				tx_offload.ptid |= txgbe_parse_tun_ptid(tx_pkt);
@@ -80,0 +80,2 @@
+ 			tx_offload.l3_len = tx_pkt->l3_len;
+ 			tx_offload.l4_len = tx_pkt->l4_len;

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/txgbe: fix interrupt loss' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (35 preceding siblings ...)
  2023-02-23  9:36 ` patch 'net/txgbe: fix packet type to parse from offload flags' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'net/hns3: fix log about indirection table size' " luca.boccassi
                   ` (32 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Jiawen Wu; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/0ddf24a6beba37641ca3cb91b3163f7151fe0f17

Thanks.

Luca Boccassi

---
From 0ddf24a6beba37641ca3cb91b3163f7151fe0f17 Mon Sep 17 00:00:00 2001
From: Jiawen Wu <jiawenwu@trustnetic.com>
Date: Thu, 2 Feb 2023 17:21:31 +0800
Subject: [PATCH] net/txgbe: fix interrupt loss

[ upstream commit a4315c1434b6bf78a9e04bf5fa34d02e9b3afd35 ]

Disable interrupt in the interrupt handling process will sometimes cause
interrupts to be lost.

Fixes: 2fc745e6b606 ("net/txgbe: add interrupt operation")

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
 drivers/net/txgbe/txgbe_ethdev.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c
index c62ed02cfd..dd5b54b83f 100644
--- a/drivers/net/txgbe/txgbe_ethdev.c
+++ b/drivers/net/txgbe/txgbe_ethdev.c
@@ -2682,9 +2682,6 @@ txgbe_dev_interrupt_get_status(struct rte_eth_dev *dev,
 			intr_handle->type != RTE_INTR_HANDLE_VFIO_MSIX)
 		wr32(hw, TXGBE_PX_INTA, 1);
 
-	/* clear all cause mask */
-	txgbe_disable_intr(hw);
-
 	/* read-on-clear nic registers here */
 	eicr = ((u32 *)hw->isb_mem)[TXGBE_ISB_MISC];
 	PMD_DRV_LOG(DEBUG, "eicr %x", eicr);
@@ -2704,6 +2701,8 @@ txgbe_dev_interrupt_get_status(struct rte_eth_dev *dev,
 	if (eicr & TXGBE_ICRMISC_GPIO)
 		intr->flags |= TXGBE_FLAG_PHY_INTERRUPT;
 
+	((u32 *)hw->isb_mem)[TXGBE_ISB_MISC] = 0;
+
 	return 0;
 }
 
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:29.760724943 +0000
+++ 0038-net-txgbe-fix-interrupt-loss.patch	2023-02-23 09:36:28.250170382 +0000
@@ -1 +1 @@
-From a4315c1434b6bf78a9e04bf5fa34d02e9b3afd35 Mon Sep 17 00:00:00 2001
+From 0ddf24a6beba37641ca3cb91b3163f7151fe0f17 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a4315c1434b6bf78a9e04bf5fa34d02e9b3afd35 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -18 +19 @@
-index ce7cf2506d..6e939b8ce3 100644
+index c62ed02cfd..dd5b54b83f 100644
@@ -21,2 +22,2 @@
-@@ -2972,9 +2972,6 @@ txgbe_dev_interrupt_get_status(struct rte_eth_dev *dev,
- 		rte_intr_type_get(intr_handle) != RTE_INTR_HANDLE_VFIO_MSIX)
+@@ -2682,9 +2682,6 @@ txgbe_dev_interrupt_get_status(struct rte_eth_dev *dev,
+ 			intr_handle->type != RTE_INTR_HANDLE_VFIO_MSIX)
@@ -31,3 +32,3 @@
-@@ -3000,6 +2997,8 @@ txgbe_dev_interrupt_get_status(struct rte_eth_dev *dev,
- 	if (eicr & TXGBE_ICRMISC_HEAT)
- 		intr->flags |= TXGBE_FLAG_OVERHEAT;
+@@ -2704,6 +2701,8 @@ txgbe_dev_interrupt_get_status(struct rte_eth_dev *dev,
+ 	if (eicr & TXGBE_ICRMISC_GPIO)
+ 		intr->flags |= TXGBE_FLAG_PHY_INTERRUPT;

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/hns3: fix log about indirection table size' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (36 preceding siblings ...)
  2023-02-23  9:36 ` patch 'net/txgbe: fix interrupt loss' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'net/hns3: refactor set RSS hash algorithm and key interface' " luca.boccassi
                   ` (31 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/5d42c551fc2010c7cb55ef9cbcc27ab474647289

Thanks.

Luca Boccassi

---
From 5d42c551fc2010c7cb55ef9cbcc27ab474647289 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Tue, 31 Jan 2023 21:02:51 +0800
Subject: [PATCH] net/hns3: fix log about indirection table size

[ upstream commit b55516a94246364f272db802f5dfb9aeb8d3a2f2 ]

The error log about indirection table size during initialization phase
of PF and VF is unreasonable.

In addition, VF driver should use error level to print this log.

Fixes: 0fce2c46dc16 ("net/hns3: fix RSS indirection table size")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_ethdev.c    | 5 ++---
 drivers/net/hns3/hns3_ethdev_vf.c | 5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index 08422474a5..4956290488 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -3040,9 +3040,8 @@ hns3_check_dev_specifications(struct hns3_hw *hw)
 {
 	if (hw->rss_ind_tbl_size == 0 ||
 	    hw->rss_ind_tbl_size > HNS3_RSS_IND_TBL_SIZE_MAX) {
-		hns3_err(hw, "the size of hash lookup table configured (%u)"
-			      " exceeds the maximum(%u)", hw->rss_ind_tbl_size,
-			      HNS3_RSS_IND_TBL_SIZE_MAX);
+		hns3_err(hw, "the indirection table size obtained (%u) is invalid, and should not be zero or exceed the maximum(%u)",
+			 hw->rss_ind_tbl_size, HNS3_RSS_IND_TBL_SIZE_MAX);
 		return -EINVAL;
 	}
 
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
index f5bf5d1a29..8e6fe9bd54 100644
--- a/drivers/net/hns3/hns3_ethdev_vf.c
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
@@ -1163,9 +1163,8 @@ hns3vf_check_dev_specifications(struct hns3_hw *hw)
 {
 	if (hw->rss_ind_tbl_size == 0 ||
 	    hw->rss_ind_tbl_size > HNS3_RSS_IND_TBL_SIZE_MAX) {
-		hns3_warn(hw, "the size of hash lookup table configured (%u)"
-			      " exceeds the maximum(%u)", hw->rss_ind_tbl_size,
-			      HNS3_RSS_IND_TBL_SIZE_MAX);
+		hns3_err(hw, "the indirection table size obtained (%u) is invalid, and should not be zero or exceed the maximum(%u)",
+			 hw->rss_ind_tbl_size, HNS3_RSS_IND_TBL_SIZE_MAX);
 		return -EINVAL;
 	}
 
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:29.800696934 +0000
+++ 0039-net-hns3-fix-log-about-indirection-table-size.patch	2023-02-23 09:36:28.258170529 +0000
@@ -1 +1 @@
-From b55516a94246364f272db802f5dfb9aeb8d3a2f2 Mon Sep 17 00:00:00 2001
+From 5d42c551fc2010c7cb55ef9cbcc27ab474647289 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b55516a94246364f272db802f5dfb9aeb8d3a2f2 ]
+
@@ -12 +13,0 @@
-Cc: stable@dpdk.org
@@ -17,3 +18,3 @@
- drivers/net/hns3/hns3_ethdev.c    | 2 +-
- drivers/net/hns3/hns3_ethdev_vf.c | 4 ++--
- 2 files changed, 3 insertions(+), 3 deletions(-)
+ drivers/net/hns3/hns3_ethdev.c    | 5 ++---
+ drivers/net/hns3/hns3_ethdev_vf.c | 5 ++---
+ 2 files changed, 4 insertions(+), 6 deletions(-)
@@ -22 +23 @@
-index d326f70129..eb809cd8c9 100644
+index 08422474a5..4956290488 100644
@@ -25 +26 @@
-@@ -2679,7 +2679,7 @@ hns3_check_dev_specifications(struct hns3_hw *hw)
+@@ -3040,9 +3040,8 @@ hns3_check_dev_specifications(struct hns3_hw *hw)
@@ -29 +30,3 @@
--		hns3_err(hw, "the size of hash lookup table configured (%u) exceeds the maximum(%u)",
+-		hns3_err(hw, "the size of hash lookup table configured (%u)"
+-			      " exceeds the maximum(%u)", hw->rss_ind_tbl_size,
+-			      HNS3_RSS_IND_TBL_SIZE_MAX);
@@ -31 +34 @@
- 			 hw->rss_ind_tbl_size, HNS3_RSS_IND_TBL_SIZE_MAX);
++			 hw->rss_ind_tbl_size, HNS3_RSS_IND_TBL_SIZE_MAX);
@@ -33,0 +37 @@
+ 
@@ -35 +39 @@
-index d220522c43..e43815607a 100644
+index f5bf5d1a29..8e6fe9bd54 100644
@@ -38 +42 @@
-@@ -718,8 +718,8 @@ hns3vf_check_dev_specifications(struct hns3_hw *hw)
+@@ -1163,9 +1163,8 @@ hns3vf_check_dev_specifications(struct hns3_hw *hw)
@@ -42,2 +46,3 @@
--		hns3_warn(hw, "the size of hash lookup table configured (%u) exceeds the maximum(%u)",
--			  hw->rss_ind_tbl_size, HNS3_RSS_IND_TBL_SIZE_MAX);
+-		hns3_warn(hw, "the size of hash lookup table configured (%u)"
+-			      " exceeds the maximum(%u)", hw->rss_ind_tbl_size,
+-			      HNS3_RSS_IND_TBL_SIZE_MAX);

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/hns3: refactor set RSS hash algorithm and key interface' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (37 preceding siblings ...)
  2023-02-23  9:36 ` patch 'net/hns3: fix log about indirection table size' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'net/hns3: fix RSS key size compatibility' " luca.boccassi
                   ` (30 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/43aad169fa3c11e4a6d1a1d2a29ddee459846d72

Thanks.

Luca Boccassi

---
From 43aad169fa3c11e4a6d1a1d2a29ddee459846d72 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Tue, 31 Jan 2023 21:02:53 +0800
Subject: [PATCH] net/hns3: refactor set RSS hash algorithm and key interface

[ upstream commit 88347111eb53bc54c598dde81715a06ca1dbd132 ]

The hns3_rss_set_algo_key() is used to set RSS hash algorithm and key to
hardware.
The maximum execution time of the command sent to the firmware is
proportional to the length of the key.
However, now this times is fixed, which isn't good for key expansion.

In addition, hash algorithm comes from rss_info::hash_algo maintained in
the driver, which also isn't good for the usage of this function.

Interface is updated to get hash algorithm and key length as input
parameters.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_flow.c |  3 ++-
 drivers/net/hns3/hns3_rss.c  | 48 ++++++++++++++++--------------------
 drivers/net/hns3/hns3_rss.h  |  4 ++-
 3 files changed, 26 insertions(+), 29 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index facd4c5be7..fedc3ee664 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1462,7 +1462,8 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
 	if (ret)
 		return ret;
 
-	ret = hns3_set_rss_algo_key(hw, rss_config->key);
+	ret = hns3_set_rss_algo_key(hw, hw->rss_info.hash_algo,
+				    rss_config->key, HNS3_RSS_KEY_SIZE);
 	if (ret)
 		return ret;
 
diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
index c105072f24..e1bf8f36f1 100644
--- a/drivers/net/hns3/hns3_rss.c
+++ b/drivers/net/hns3/hns3_rss.c
@@ -277,45 +277,37 @@ static const struct {
 
 /*
  * rss_generic_config command function, opcode:0x0D01.
- * Used to set algorithm, key_offset and hash key of rss.
+ * Used to set algorithm and hash key of RSS.
  */
 int
-hns3_set_rss_algo_key(struct hns3_hw *hw, const uint8_t *key)
+hns3_set_rss_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
+		      const uint8_t *key, uint8_t key_len)
 {
-#define HNS3_KEY_OFFSET_MAX	3
-#define HNS3_SET_HASH_KEY_BYTE_FOUR	2
-
 	struct hns3_rss_generic_config_cmd *req;
 	struct hns3_cmd_desc desc;
-	uint32_t key_offset, key_size;
-	const uint8_t *key_cur;
-	uint8_t cur_offset;
+	const uint8_t *cur_key;
+	uint16_t cur_key_size;
+	uint16_t max_bd_num;
+	uint16_t idx;
 	int ret;
 
 	req = (struct hns3_rss_generic_config_cmd *)desc.data;
 
-	/*
-	 * key_offset=0, hash key byte0~15 is set to hardware.
-	 * key_offset=1, hash key byte16~31 is set to hardware.
-	 * key_offset=2, hash key byte32~39 is set to hardware.
-	 */
-	for (key_offset = 0; key_offset < HNS3_KEY_OFFSET_MAX; key_offset++) {
+	max_bd_num = DIV_ROUND_UP(key_len, HNS3_RSS_HASH_KEY_NUM);
+	for (idx = 0; idx < max_bd_num; idx++) {
 		hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_RSS_GENERIC_CONFIG,
 					  false);
 
-		req->hash_config |=
-			(hw->rss_info.hash_algo & HNS3_RSS_HASH_ALGO_MASK);
-		req->hash_config |= (key_offset << HNS3_RSS_HASH_KEY_OFFSET_B);
+		req->hash_config |= (hash_algo & HNS3_RSS_HASH_ALGO_MASK);
+		req->hash_config |= (idx << HNS3_RSS_HASH_KEY_OFFSET_B);
 
-		if (key_offset == HNS3_SET_HASH_KEY_BYTE_FOUR)
-			key_size = HNS3_RSS_KEY_SIZE - HNS3_RSS_HASH_KEY_NUM *
-			HNS3_SET_HASH_KEY_BYTE_FOUR;
+		if (idx == max_bd_num - 1)
+			cur_key_size = key_len % HNS3_RSS_HASH_KEY_NUM;
 		else
-			key_size = HNS3_RSS_HASH_KEY_NUM;
+			cur_key_size = HNS3_RSS_HASH_KEY_NUM;
 
-		cur_offset = key_offset * HNS3_RSS_HASH_KEY_NUM;
-		key_cur = key + cur_offset;
-		memcpy(req->hash_key, key_cur, key_size);
+		cur_key = key + idx * HNS3_RSS_HASH_KEY_NUM;
+		memcpy(req->hash_key, cur_key, cur_key_size);
 
 		ret = hns3_cmd_send(hw, &desc, 1);
 		if (ret) {
@@ -518,7 +510,8 @@ hns3_dev_rss_hash_update(struct rte_eth_dev *dev,
 		goto set_tuple_fail;
 
 	if (key) {
-		ret = hns3_set_rss_algo_key(hw, key);
+		ret = hns3_set_rss_algo_key(hw, hw->rss_info.hash_algo,
+					    key, HNS3_RSS_KEY_SIZE);
 		if (ret)
 			goto set_algo_key_fail;
 	}
@@ -800,8 +793,9 @@ hns3_config_rss(struct hns3_adapter *hns)
 		break;
 	}
 
-	/* Configure RSS hash algorithm and hash key offset */
-	ret = hns3_set_rss_algo_key(hw, hash_key);
+	/* Configure RSS hash algorithm and hash key */
+	ret = hns3_set_rss_algo_key(hw, hw->rss_info.hash_algo, hash_key,
+				    HNS3_RSS_KEY_SIZE);
 	if (ret)
 		return ret;
 
diff --git a/drivers/net/hns3/hns3_rss.h b/drivers/net/hns3/hns3_rss.h
index 751e3475ed..630229796c 100644
--- a/drivers/net/hns3/hns3_rss.h
+++ b/drivers/net/hns3/hns3_rss.h
@@ -113,7 +113,9 @@ int hns3_rss_reset_indir_table(struct hns3_hw *hw);
 int hns3_config_rss(struct hns3_adapter *hns);
 void hns3_rss_uninit(struct hns3_adapter *hns);
 int hns3_set_rss_tuple_by_rss_hf(struct hns3_hw *hw, uint64_t rss_hf);
-int hns3_set_rss_algo_key(struct hns3_hw *hw, const uint8_t *key);
+int hns3_set_rss_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
+			  const uint8_t *key, uint8_t key_len);
 int hns3_restore_filter(struct hns3_adapter *hns);
 
+
 #endif /* _HNS3_RSS_H_ */
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:29.842596160 +0000
+++ 0040-net-hns3-refactor-set-RSS-hash-algorithm-and-key-int.patch	2023-02-23 09:36:28.262170603 +0000
@@ -1 +1 @@
-From 88347111eb53bc54c598dde81715a06ca1dbd132 Mon Sep 17 00:00:00 2001
+From 43aad169fa3c11e4a6d1a1d2a29ddee459846d72 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 88347111eb53bc54c598dde81715a06ca1dbd132 ]
+
@@ -19 +20,0 @@
-Cc: stable@dpdk.org
@@ -30 +31 @@
-index e88f9b7e45..ac094c839f 100644
+index facd4c5be7..fedc3ee664 100644
@@ -33 +34 @@
-@@ -1494,7 +1494,8 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
+@@ -1462,7 +1462,8 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
@@ -37,2 +38,2 @@
--	ret = hns3_rss_set_algo_key(hw, rss_config->key);
-+	ret = hns3_rss_set_algo_key(hw, hw->rss_info.hash_algo,
+-	ret = hns3_set_rss_algo_key(hw, rss_config->key);
++	ret = hns3_set_rss_algo_key(hw, hw->rss_info.hash_algo,
@@ -44 +45 @@
-index ca5a129234..3db7bf0445 100644
+index c105072f24..e1bf8f36f1 100644
@@ -55,2 +56,2 @@
--hns3_rss_set_algo_key(struct hns3_hw *hw, const uint8_t *key)
-+hns3_rss_set_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
+-hns3_set_rss_algo_key(struct hns3_hw *hw, const uint8_t *key)
++hns3_set_rss_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
@@ -113,2 +114,2 @@
--		ret = hns3_rss_set_algo_key(hw, key);
-+		ret = hns3_rss_set_algo_key(hw, hw->rss_info.hash_algo,
+-		ret = hns3_set_rss_algo_key(hw, key);
++		ret = hns3_set_rss_algo_key(hw, hw->rss_info.hash_algo,
@@ -119 +120 @@
-@@ -795,8 +788,9 @@ hns3_config_rss(struct hns3_adapter *hns)
+@@ -800,8 +793,9 @@ hns3_config_rss(struct hns3_adapter *hns)
@@ -124 +125 @@
--	ret = hns3_rss_set_algo_key(hw, hash_key);
+-	ret = hns3_set_rss_algo_key(hw, hash_key);
@@ -126 +127 @@
-+	ret = hns3_rss_set_algo_key(hw, hw->rss_info.hash_algo, hash_key,
++	ret = hns3_set_rss_algo_key(hw, hw->rss_info.hash_algo, hash_key,
@@ -132 +133 @@
-index 8e8b056f4e..b7f62ca1ee 100644
+index 751e3475ed..630229796c 100644
@@ -135 +136 @@
-@@ -109,6 +109,8 @@ int hns3_rss_reset_indir_table(struct hns3_hw *hw);
+@@ -113,7 +113,9 @@ int hns3_rss_reset_indir_table(struct hns3_hw *hw);
@@ -139,2 +140,2 @@
--int hns3_rss_set_algo_key(struct hns3_hw *hw, const uint8_t *key);
-+int hns3_rss_set_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
+-int hns3_set_rss_algo_key(struct hns3_hw *hw, const uint8_t *key);
++int hns3_set_rss_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
@@ -142 +143 @@
-+
+ int hns3_restore_filter(struct hns3_adapter *hns);
@@ -144 +145,2 @@
- #endif /* HNS3_RSS_H */
++
+ #endif /* _HNS3_RSS_H_ */

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/hns3: fix RSS key size compatibility' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (38 preceding siblings ...)
  2023-02-23  9:36 ` patch 'net/hns3: refactor set RSS hash algorithm and key interface' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'net/hns3: fix clearing RSS configuration' " luca.boccassi
                   ` (29 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From b7baddb50f519a8e24252ca27630df10c1297897 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Tue, 31 Jan 2023 21:02:54 +0800
Subject: [PATCH] net/hns3: fix RSS key size compatibility

[ upstream commit 5172f9c464aa315a9d45b9177af71b4f99d55cdb ]

For better compatibility, the RSS key size of PF and VF are obtained
from firmware. However, the outdated HNS3_RSS_KEY_SIZE macro is still
utilized in many locations as the key size.

Fixes: 9c740336f024 ("net/hns3: get device specifications from firmware")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_ethdev.c | 12 +++++++++++-
 drivers/net/hns3/hns3_flow.c   | 26 ++++++++++++--------------
 drivers/net/hns3/hns3_rss.c    | 23 +++++++++++------------
 drivers/net/hns3/hns3_rss.h    |  3 ++-
 4 files changed, 36 insertions(+), 28 deletions(-)

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index 4956290488..4c650e9a72 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -2606,7 +2606,7 @@ hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
 	};
 
 	info->reta_size = hw->rss_ind_tbl_size;
-	info->hash_key_size = HNS3_RSS_KEY_SIZE;
+	info->hash_key_size = hw->rss_key_size;
 	info->flow_type_rss_offloads = HNS3_ETH_RSS_SUPPORT;
 
 	info->default_rxportconf.burst_size = HNS3_DEFAULT_PORT_CONF_BURST_SIZE;
@@ -3045,6 +3045,16 @@ hns3_check_dev_specifications(struct hns3_hw *hw)
 		return -EINVAL;
 	}
 
+	if (hw->rss_key_size == 0 || hw->rss_key_size > HNS3_RSS_KEY_SIZE_MAX) {
+		 hns3_err(hw, "the RSS key size obtained (%u) is invalid, and should not be zero or exceed the maximum(%u)",
+			   hw->rss_key_size, HNS3_RSS_KEY_SIZE_MAX);
+		 return -EINVAL;
+	}
+
+	if (hw->rss_key_size > HNS3_RSS_KEY_SIZE)
+		 hns3_warn(hw, "the RSS key size obtained (%u) is greater than the default key size (%u)",
+			    hw->rss_key_size, HNS3_RSS_KEY_SIZE);
+
 	return 0;
 }
 
diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index fedc3ee664..0ce4cd1e2a 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1363,10 +1363,10 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev,
 		return rte_flow_error_set(error, ENOTSUP,
 					  RTE_FLOW_ERROR_TYPE_ACTION_CONF, act,
 					  "a nonzero RSS encapsulation level is not supported");
-	if (rss->key_len && rss->key_len != RTE_DIM(rss_conf->key))
+	if (rss->key_len && rss->key_len != hw->rss_key_size)
 		return rte_flow_error_set(error, ENOTSUP,
 					  RTE_FLOW_ERROR_TYPE_ACTION_CONF, act,
-					  "RSS hash key must be exactly 40 bytes");
+					  "invalid RSS key length");
 
 	/*
 	 * For Kunpeng920 and Kunpeng930 NIC hardware, it is not supported to
@@ -1411,16 +1411,6 @@ hns3_disable_rss(struct hns3_hw *hw)
 	return 0;
 }
 
-static void
-hns3_parse_rss_key(struct hns3_hw *hw, struct rte_flow_action_rss *rss_conf)
-{
-	if (rss_conf->key == NULL || rss_conf->key_len < HNS3_RSS_KEY_SIZE) {
-		hns3_warn(hw, "Default RSS hash key to be set");
-		rss_conf->key = hns3_hash_key;
-		rss_conf->key_len = HNS3_RSS_KEY_SIZE;
-	}
-}
-
 static int
 hns3_parse_rss_algorithm(struct hns3_hw *hw, enum rte_eth_hash_function *func,
 			 uint8_t *hash_algo)
@@ -1453,9 +1443,16 @@ hns3_parse_rss_algorithm(struct hns3_hw *hw, enum rte_eth_hash_function *func,
 static int
 hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
 {
+	uint8_t rss_key[HNS3_RSS_KEY_SIZE_MAX] = {0};
+	bool use_default_key = false;
 	int ret;
 
-	hns3_parse_rss_key(hw, rss_config);
+	if (rss_config->key == NULL || rss_config->key_len != hw->rss_key_size) {
+		hns3_warn(hw, "Default RSS hash key to be set");
+		memcpy(rss_key, hns3_hash_key,
+			RTE_MIN(sizeof(hns3_hash_key), hw->rss_key_size));
+		use_default_key = true;
+	}
 
 	ret = hns3_parse_rss_algorithm(hw, &rss_config->func,
 				       &hw->rss_info.hash_algo);
@@ -1463,7 +1460,8 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
 		return ret;
 
 	ret = hns3_set_rss_algo_key(hw, hw->rss_info.hash_algo,
-				    rss_config->key, HNS3_RSS_KEY_SIZE);
+				    use_default_key ? rss_key : rss_config->key,
+				    hw->rss_key_size);
 	if (ret)
 		return ret;
 
diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
index e1bf8f36f1..c38e12f79d 100644
--- a/drivers/net/hns3/hns3_rss.c
+++ b/drivers/net/hns3/hns3_rss.c
@@ -316,7 +316,7 @@ hns3_set_rss_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
 		}
 	}
 	/* Update the shadow RSS key with user specified */
-	memcpy(hw->rss_info.key, key, HNS3_RSS_KEY_SIZE);
+	memcpy(hw->rss_info.key, key, hw->rss_key_size);
 	return 0;
 }
 
@@ -498,9 +498,9 @@ hns3_dev_rss_hash_update(struct rte_eth_dev *dev,
 	uint8_t *key = rss_conf->rss_key;
 	int ret;
 
-	if (key && key_len != HNS3_RSS_KEY_SIZE) {
+	if (key && key_len != hw->rss_key_size) {
 		hns3_err(hw, "the hash key len(%u) is invalid, must be %u",
-			 key_len, HNS3_RSS_KEY_SIZE);
+			 key_len, hw->rss_key_size);
 		return -EINVAL;
 	}
 
@@ -511,7 +511,7 @@ hns3_dev_rss_hash_update(struct rte_eth_dev *dev,
 
 	if (key) {
 		ret = hns3_set_rss_algo_key(hw, hw->rss_info.hash_algo,
-					    key, HNS3_RSS_KEY_SIZE);
+					    key, hw->rss_key_size);
 		if (ret)
 			goto set_algo_key_fail;
 	}
@@ -547,9 +547,9 @@ hns3_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
 	rss_conf->rss_hf = rss_cfg->conf.types;
 
 	/* Get the RSS Key required by the user */
-	if (rss_conf->rss_key && rss_conf->rss_key_len >= HNS3_RSS_KEY_SIZE) {
-		memcpy(rss_conf->rss_key, rss_cfg->key, HNS3_RSS_KEY_SIZE);
-		rss_conf->rss_key_len = HNS3_RSS_KEY_SIZE;
+	if (rss_conf->rss_key && rss_conf->rss_key_len >= hw->rss_key_size) {
+		memcpy(rss_conf->rss_key, rss_cfg->key, hw->rss_key_size);
+		rss_conf->rss_key_len = hw->rss_key_size;
 	}
 	rte_spinlock_unlock(&hw->lock);
 
@@ -759,8 +759,8 @@ hns3_set_default_rss_args(struct hns3_hw *hw)
 	/* Default hash algorithm */
 	rss_cfg->conf.func = RTE_ETH_HASH_FUNCTION_TOEPLITZ;
 
-	/* Default RSS key */
-	memcpy(rss_cfg->key, hns3_hash_key, HNS3_RSS_KEY_SIZE);
+	memcpy(rss_cfg->key, hns3_hash_key,
+		RTE_MIN(sizeof(hns3_hash_key), hw->rss_key_size));
 
 	/* Initialize RSS indirection table */
 	for (i = 0; i < hw->rss_ind_tbl_size; i++)
@@ -793,9 +793,8 @@ hns3_config_rss(struct hns3_adapter *hns)
 		break;
 	}
 
-	/* Configure RSS hash algorithm and hash key */
-	ret = hns3_set_rss_algo_key(hw, hw->rss_info.hash_algo, hash_key,
-				    HNS3_RSS_KEY_SIZE);
+	ret = hns3_set_rss_algo_key(hw, rss_cfg->hash_algo,
+				    hash_key, hw->rss_key_size);
 	if (ret)
 		return ret;
 
diff --git a/drivers/net/hns3/hns3_rss.h b/drivers/net/hns3/hns3_rss.h
index 630229796c..636b6fdf3a 100644
--- a/drivers/net/hns3/hns3_rss.h
+++ b/drivers/net/hns3/hns3_rss.h
@@ -29,6 +29,7 @@
 #define HNS3_RSS_IND_TBL_SIZE	512 /* The size of hash lookup table */
 #define HNS3_RSS_IND_TBL_SIZE_MAX 2048
 #define HNS3_RSS_KEY_SIZE	40
+#define HNS3_RSS_KEY_SIZE_MAX	128
 #define HNS3_RSS_SET_BITMAP_MSK	0xffff
 
 #define HNS3_RSS_HASH_ALGO_TOEPLITZ	0
@@ -45,7 +46,7 @@ struct hns3_rss_conf {
 	/* RSS parameters :algorithm, flow_types,  key, queue */
 	struct rte_flow_action_rss conf;
 	uint8_t hash_algo; /* hash function type defined by hardware */
-	uint8_t key[HNS3_RSS_KEY_SIZE];  /* Hash key */
+	uint8_t key[HNS3_RSS_KEY_SIZE_MAX];  /* Hash key */
 	uint16_t rss_indirection_tbl[HNS3_RSS_IND_TBL_SIZE_MAX];
 	uint16_t queue[HNS3_RSS_QUEUES_BUFFER_NUM]; /* Queues indices to use */
 	bool valid; /* check if RSS rule is valid */
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:29.880234847 +0000
+++ 0041-net-hns3-fix-RSS-key-size-compatibility.patch	2023-02-23 09:36:28.270170750 +0000
@@ -1 +1 @@
-From 5172f9c464aa315a9d45b9177af71b4f99d55cdb Mon Sep 17 00:00:00 2001
+From b7baddb50f519a8e24252ca27630df10c1297897 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 5172f9c464aa315a9d45b9177af71b4f99d55cdb ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -16 +17 @@
- drivers/net/hns3/hns3_common.c | 12 +++++++++++-
+ drivers/net/hns3/hns3_ethdev.c | 12 +++++++++++-
@@ -22,5 +23,5 @@
-diff --git a/drivers/net/hns3/hns3_common.c b/drivers/net/hns3/hns3_common.c
-index 74d537d8d0..a0c9e66c2c 100644
---- a/drivers/net/hns3/hns3_common.c
-+++ b/drivers/net/hns3/hns3_common.c
-@@ -130,7 +130,7 @@ hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
+diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
+index 4956290488..4c650e9a72 100644
+--- a/drivers/net/hns3/hns3_ethdev.c
++++ b/drivers/net/hns3/hns3_ethdev.c
+@@ -2606,7 +2606,7 @@ hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
@@ -35 +36 @@
-@@ -896,6 +896,16 @@ hns3_check_dev_specifications(struct hns3_hw *hw)
+@@ -3045,6 +3045,16 @@ hns3_check_dev_specifications(struct hns3_hw *hw)
@@ -40,3 +41,3 @@
-+		hns3_err(hw, "the RSS key size obtained (%u) is invalid, and should not be zero or exceed the maximum(%u)",
-+			 hw->rss_key_size, HNS3_RSS_KEY_SIZE_MAX);
-+		return -EINVAL;
++		 hns3_err(hw, "the RSS key size obtained (%u) is invalid, and should not be zero or exceed the maximum(%u)",
++			   hw->rss_key_size, HNS3_RSS_KEY_SIZE_MAX);
++		 return -EINVAL;
@@ -46,2 +47,2 @@
-+		hns3_warn(hw, "the RSS key size obtained (%u) is greater than the default key size (%u)",
-+			  hw->rss_key_size, HNS3_RSS_KEY_SIZE);
++		 hns3_warn(hw, "the RSS key size obtained (%u) is greater than the default key size (%u)",
++			    hw->rss_key_size, HNS3_RSS_KEY_SIZE);
@@ -53 +54 @@
-index ac094c839f..de38a42048 100644
+index fedc3ee664..0ce4cd1e2a 100644
@@ -56 +57 @@
-@@ -1406,10 +1406,10 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev,
+@@ -1363,10 +1363,10 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev,
@@ -67,3 +68,3 @@
- 	if (!hns3_rss_input_tuple_supported(hw, rss))
- 		return rte_flow_error_set(error, EINVAL,
-@@ -1443,16 +1443,6 @@ hns3_disable_rss(struct hns3_hw *hw)
+ 	/*
+ 	 * For Kunpeng920 and Kunpeng930 NIC hardware, it is not supported to
+@@ -1411,16 +1411,6 @@ hns3_disable_rss(struct hns3_hw *hw)
@@ -74 +75 @@
--hns3_adjust_rss_key(struct hns3_hw *hw, struct rte_flow_action_rss *rss_conf)
+-hns3_parse_rss_key(struct hns3_hw *hw, struct rte_flow_action_rss *rss_conf)
@@ -86 +87 @@
-@@ -1485,9 +1475,16 @@ hns3_parse_rss_algorithm(struct hns3_hw *hw, enum rte_eth_hash_function *func,
+@@ -1453,9 +1443,16 @@ hns3_parse_rss_algorithm(struct hns3_hw *hw, enum rte_eth_hash_function *func,
@@ -94 +95 @@
--	hns3_adjust_rss_key(hw, rss_config);
+-	hns3_parse_rss_key(hw, rss_config);
@@ -104 +105 @@
-@@ -1495,7 +1492,8 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
+@@ -1463,7 +1460,8 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
@@ -107 +108 @@
- 	ret = hns3_rss_set_algo_key(hw, hw->rss_info.hash_algo,
+ 	ret = hns3_set_rss_algo_key(hw, hw->rss_info.hash_algo,
@@ -115 +116 @@
-index 3db7bf0445..d6e0754273 100644
+index e1bf8f36f1..c38e12f79d 100644
@@ -118 +119 @@
-@@ -316,7 +316,7 @@ hns3_rss_set_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
+@@ -316,7 +316,7 @@ hns3_set_rss_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
@@ -142 +143 @@
- 		ret = hns3_rss_set_algo_key(hw, hw->rss_info.hash_algo,
+ 		ret = hns3_set_rss_algo_key(hw, hw->rss_info.hash_algo,
@@ -161 +162 @@
-@@ -754,8 +754,8 @@ hns3_rss_set_default_args(struct hns3_hw *hw)
+@@ -759,8 +759,8 @@ hns3_set_default_rss_args(struct hns3_hw *hw)
@@ -172 +173 @@
-@@ -788,9 +788,8 @@ hns3_config_rss(struct hns3_adapter *hns)
+@@ -793,9 +793,8 @@ hns3_config_rss(struct hns3_adapter *hns)
@@ -177 +178 @@
--	ret = hns3_rss_set_algo_key(hw, hw->rss_info.hash_algo, hash_key,
+-	ret = hns3_set_rss_algo_key(hw, hw->rss_info.hash_algo, hash_key,
@@ -179 +180 @@
-+	ret = hns3_rss_set_algo_key(hw, rss_cfg->hash_algo,
++	ret = hns3_set_rss_algo_key(hw, rss_cfg->hash_algo,
@@ -185 +186 @@
-index b7f62ca1ee..d6f81996f4 100644
+index 630229796c..636b6fdf3a 100644
@@ -196 +197 @@
-@@ -41,7 +42,7 @@ struct hns3_rss_conf {
+@@ -45,7 +46,7 @@ struct hns3_rss_conf {

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/hns3: fix clearing RSS configuration' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (39 preceding siblings ...)
  2023-02-23  9:36 ` patch 'net/hns3: fix RSS key size compatibility' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'net/hns3: use RSS filter list to check duplicated rule' " luca.boccassi
                   ` (28 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/3463844614179865471d552dbd54d1bf0d3a5c19

Thanks.

Luca Boccassi

---
From 3463844614179865471d552dbd54d1bf0d3a5c19 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Tue, 31 Jan 2023 21:02:55 +0800
Subject: [PATCH] net/hns3: fix clearing RSS configuration

[ upstream commit 1aa5222454725001939ff571e685225f6cf85653 ]

When a RSS rule has an unsupported action, the RSS configuration is
cleared by mistake.

Remove clearing RSS configuration in this case.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_flow.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 0ce4cd1e2a..67379d5bbb 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1389,12 +1389,10 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev,
 
 	/* Check if the next not void action is END */
 	NEXT_ITEM_OF_ACTION(act, actions, act_index);
-	if (act->type != RTE_FLOW_ACTION_TYPE_END) {
-		memset(rss_conf, 0, sizeof(struct hns3_rss_conf));
+	if (act->type != RTE_FLOW_ACTION_TYPE_END)
 		return rte_flow_error_set(error, EINVAL,
 					  RTE_FLOW_ERROR_TYPE_ACTION,
 					  act, "Not supported action.");
-	}
 
 	return 0;
 }
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:29.919208143 +0000
+++ 0042-net-hns3-fix-clearing-RSS-configuration.patch	2023-02-23 09:36:28.270170750 +0000
@@ -1 +1 @@
-From 1aa5222454725001939ff571e685225f6cf85653 Mon Sep 17 00:00:00 2001
+From 3463844614179865471d552dbd54d1bf0d3a5c19 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 1aa5222454725001939ff571e685225f6cf85653 ]
+
@@ -12 +13,0 @@
-Cc: stable@dpdk.org
@@ -21 +22 @@
-index de38a42048..5711757684 100644
+index 0ce4cd1e2a..67379d5bbb 100644
@@ -24 +25 @@
-@@ -1421,12 +1421,10 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev,
+@@ -1389,12 +1389,10 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev,

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/hns3: use RSS filter list to check duplicated rule' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (40 preceding siblings ...)
  2023-02-23  9:36 ` patch 'net/hns3: fix clearing RSS configuration' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'net/hns3: remove useless code when destroy valid RSS " luca.boccassi
                   ` (27 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/1ec2d6e14c158c7148691362ca77aba8f4160705

Thanks.

Luca Boccassi

---
From 1ec2d6e14c158c7148691362ca77aba8f4160705 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Tue, 31 Jan 2023 21:02:56 +0800
Subject: [PATCH] net/hns3: use RSS filter list to check duplicated rule

[ upstream commit 6afde23d843ecf67453eaf69924bd79873f6f207 ]

All rules from user are saved in RSS filter list, so use RSS
filter list to check duplicated rule.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_flow.c | 35 +++++++++++++++++++++--------------
 1 file changed, 21 insertions(+), 14 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 67379d5bbb..0e0cf418ee 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1279,7 +1279,7 @@ hns3_action_rss_same(const struct rte_flow_action_rss *comp,
 		!memcmp(comp->key, with->key, with->key_len);
 
 	return (func_is_same && rss_key_is_same &&
-		comp->types == (with->types & HNS3_ETH_RSS_SUPPORT) &&
+		comp->types == with->types &&
 		comp->level == with->level &&
 		comp->queue_num == with->queue_num &&
 		!memcmp(comp->queue, with->queue,
@@ -1564,15 +1564,7 @@ hns3_config_rss_filter(struct hns3_hw *hw,
 	}
 
 	/* Set hash algorithm and flow types by the user's config */
-	ret = hns3_hw_rss_hash_set(hw, &rss_flow_conf);
-	if (ret)
-		return ret;
-
-	ret = hns3_rss_conf_copy(rss_info, &rss_flow_conf);
-	if (ret)
-		hns3_err(hw, "RSS config init fail(%d)", ret);
-
-	return ret;
+	return hns3_hw_rss_hash_set(hw, &rss_flow_conf);
 }
 
 static int
@@ -1645,17 +1637,32 @@ hns3_restore_filter(struct hns3_adapter *hns)
 	return hns3_restore_rss_filter(hw);
 }
 
+static bool
+hns3_rss_action_is_dup(struct hns3_hw *hw,
+		       const struct rte_flow_action_rss *act)
+{
+	struct hns3_rss_conf_ele *filter;
+
+	TAILQ_FOREACH(filter, &hw->flow_rss_list, entries) {
+		if (!filter->filter_info.valid)
+			continue;
+
+		if (hns3_action_rss_same(&filter->filter_info.conf, act))
+			return true;
+	}
+
+	return false;
+}
+
 static int
 hns3_flow_parse_rss(struct rte_eth_dev *dev,
 		    const struct hns3_rss_conf *conf, bool add)
 {
 	struct hns3_adapter *hns = dev->data->dev_private;
 	struct hns3_hw *hw = &hns->hw;
-	bool ret;
 
-	ret = hns3_action_rss_same(&hw->rss_info.conf, &conf->conf);
-	if (ret) {
-		hns3_err(hw, "Enter duplicate RSS configuration : %d", ret);
+	if (hns3_rss_action_is_dup(hw, &conf->conf)) {
+		hns3_err(hw, "duplicate RSS configuration");
 		return -EINVAL;
 	}
 
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:29.956546584 +0000
+++ 0043-net-hns3-use-RSS-filter-list-to-check-duplicated-rul.patch	2023-02-23 09:36:28.270170750 +0000
@@ -1 +1 @@
-From 6afde23d843ecf67453eaf69924bd79873f6f207 Mon Sep 17 00:00:00 2001
+From 1ec2d6e14c158c7148691362ca77aba8f4160705 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 6afde23d843ecf67453eaf69924bd79873f6f207 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
-index 5711757684..4cca675c53 100644
+index 67379d5bbb..0e0cf418ee 100644
@@ -22 +23 @@
-@@ -1300,7 +1300,7 @@ hns3_action_rss_same(const struct rte_flow_action_rss *comp,
+@@ -1279,7 +1279,7 @@ hns3_action_rss_same(const struct rte_flow_action_rss *comp,
@@ -31 +32 @@
-@@ -1596,15 +1596,7 @@ hns3_config_rss_filter(struct hns3_hw *hw,
+@@ -1564,15 +1564,7 @@ hns3_config_rss_filter(struct hns3_hw *hw,
@@ -48 +49 @@
-@@ -1676,17 +1668,32 @@ hns3_restore_filter(struct hns3_adapter *hns)
+@@ -1645,17 +1637,32 @@ hns3_restore_filter(struct hns3_adapter *hns)

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/hns3: remove useless code when destroy valid RSS rule' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (41 preceding siblings ...)
  2023-02-23  9:36 ` patch 'net/hns3: use RSS filter list to check duplicated rule' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'net/hns3: fix warning on flush or destroy " luca.boccassi
                   ` (26 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From b3663385a2aeff0fee1fe9bfed703c657eb29705 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Tue, 31 Jan 2023 21:02:57 +0800
Subject: [PATCH] net/hns3: remove useless code when destroy valid RSS rule

[ upstream commit 546031ba551485c3e3aa57c3698975c2852cbef1 ]

When all rules are flushed the hw::rss_info::conf::func set to
RTE_ETH_HASH_FUNCTION_MAX and hw::rss_info::conf::queue set to NULL
which indicates no flow rules is issued.
See: commit eb158fc756a5 ("net/hns3: fix config when creating RSS rule
after flush").

Actually, the way determining whether there are rules has been changed
by walking the flow RSS list.
See: commit 705a50800334 ("net/hns3: fix RSS filter restore").

In addition, the rte_flow_action_rss from user isn't saved to 'conf' in
hw->rss_info now. So this code can be removed.

Fixes: eb158fc756a5 ("net/hns3: fix config when creating RSS rule after flush")
Fixes: 705a50800334 ("net/hns3: fix RSS filter restore")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_flow.c | 26 ++------------------------
 1 file changed, 2 insertions(+), 24 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 0e0cf418ee..f6de004fbc 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1258,19 +1258,8 @@ hns3_action_rss_same(const struct rte_flow_action_rss *comp,
 	bool rss_key_is_same;
 	bool func_is_same;
 
-	/*
-	 * When user flush all RSS rule, RSS func is set invalid with
-	 * RTE_ETH_HASH_FUNCTION_MAX. Then the user create a flow after
-	 * flushed, any validate RSS func is different with it before
-	 * flushed. Others, when user create an action RSS with RSS func
-	 * specified RTE_ETH_HASH_FUNCTION_DEFAULT, the func is the same
-	 * between continuous RSS flow.
-	 */
-	if (comp->func == RTE_ETH_HASH_FUNCTION_MAX)
-		func_is_same = false;
-	else
-		func_is_same = (with->func != RTE_ETH_HASH_FUNCTION_DEFAULT) ?
-				(comp->func == with->func) : true;
+	func_is_same = (with->func != RTE_ETH_HASH_FUNCTION_DEFAULT) ?
+			(comp->func == with->func) : true;
 
 	if (with->key_len == 0 || with->key == NULL)
 		rss_key_is_same = 1;
@@ -1501,7 +1490,6 @@ static int
 hns3_config_rss_filter(struct hns3_hw *hw,
 		       const struct hns3_rss_conf *conf, bool add)
 {
-	struct hns3_rss_conf *rss_info;
 	uint64_t flow_types;
 	uint16_t num;
 	int ret;
@@ -1528,7 +1516,6 @@ hns3_config_rss_filter(struct hns3_hw *hw,
 	/* Update the useful flow types */
 	rss_flow_conf.types = flow_types;
 
-	rss_info = &hw->rss_info;
 	if (!add) {
 		if (!conf->valid)
 			return 0;
@@ -1539,15 +1526,6 @@ hns3_config_rss_filter(struct hns3_hw *hw,
 			return ret;
 		}
 
-		if (rss_flow_conf.queue_num) {
-			/*
-			 * Due the content of queue pointer have been reset to
-			 * 0, the rss_info->conf.queue should be set to NULL
-			 */
-			rss_info->conf.queue = NULL;
-			rss_info->conf.queue_num = 0;
-		}
-
 		return 0;
 	}
 
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:29.993376016 +0000
+++ 0044-net-hns3-remove-useless-code-when-destroy-valid-RSS-.patch	2023-02-23 09:36:28.274170824 +0000
@@ -1 +1 @@
-From 546031ba551485c3e3aa57c3698975c2852cbef1 Mon Sep 17 00:00:00 2001
+From b3663385a2aeff0fee1fe9bfed703c657eb29705 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 546031ba551485c3e3aa57c3698975c2852cbef1 ]
+
@@ -21 +22,0 @@
-Cc: stable@dpdk.org
@@ -30 +31 @@
-index 4cca675c53..3809fcc2d7 100644
+index 0e0cf418ee..f6de004fbc 100644
@@ -33 +34 @@
-@@ -1279,19 +1279,8 @@ hns3_action_rss_same(const struct rte_flow_action_rss *comp,
+@@ -1258,19 +1258,8 @@ hns3_action_rss_same(const struct rte_flow_action_rss *comp,
@@ -55 +56 @@
-@@ -1533,7 +1522,6 @@ static int
+@@ -1501,7 +1490,6 @@ static int
@@ -63 +64 @@
-@@ -1560,7 +1548,6 @@ hns3_config_rss_filter(struct hns3_hw *hw,
+@@ -1528,7 +1516,6 @@ hns3_config_rss_filter(struct hns3_hw *hw,
@@ -71 +72 @@
-@@ -1571,15 +1558,6 @@ hns3_config_rss_filter(struct hns3_hw *hw,
+@@ -1539,15 +1526,6 @@ hns3_config_rss_filter(struct hns3_hw *hw,

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/hns3: fix warning on flush or destroy rule' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (42 preceding siblings ...)
  2023-02-23  9:36 ` patch 'net/hns3: remove useless code when destroy valid RSS " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'net/hns3: fix config struct used for conversion' " luca.boccassi
                   ` (25 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/08e0d5d703e00d9e0205f14a04dc91a94cb06f3d

Thanks.

Luca Boccassi

---
From 08e0d5d703e00d9e0205f14a04dc91a94cb06f3d Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Tue, 31 Jan 2023 21:02:58 +0800
Subject: [PATCH] net/hns3: fix warning on flush or destroy rule

[ upstream commit a7bf2789168c8d49ca4dec5bb7bb0b3f765fc1bd ]

Although flow rules will no longer be used when user flush all rules
or destroy a rule a warning is generated like:
"modified RSS types based on hardware support, requested:0x137f83fffc
configured:0x3ffc".

Prevent warning for flush or destroy rule case.

Fixes: ec674cb742e5 ("net/hns3: fix flushing RSS rule")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_flow.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index f6de004fbc..0b4add5e80 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1505,17 +1505,6 @@ hns3_config_rss_filter(struct hns3_hw *hw,
 		.queue = conf->conf.queue,
 	};
 
-	/* Filter the unsupported flow types */
-	flow_types = conf->conf.types ?
-		     rss_flow_conf.types & HNS3_ETH_RSS_SUPPORT :
-		     hw->rss_info.conf.types;
-	if (flow_types != rss_flow_conf.types)
-		hns3_warn(hw, "modified RSS types based on hardware support, "
-			      "requested:0x%" PRIx64 " configured:0x%" PRIx64,
-			  rss_flow_conf.types, flow_types);
-	/* Update the useful flow types */
-	rss_flow_conf.types = flow_types;
-
 	if (!add) {
 		if (!conf->valid)
 			return 0;
@@ -1541,6 +1530,17 @@ hns3_config_rss_filter(struct hns3_hw *hw,
 			return ret;
 	}
 
+	/* Filter the unsupported flow types */
+	flow_types = conf->conf.types ?
+		     rss_flow_conf.types & HNS3_ETH_RSS_SUPPORT :
+		     hw->rss_info.conf.types;
+	if (flow_types != rss_flow_conf.types)
+		hns3_warn(hw, "modified RSS types based on hardware support,"
+			  " requested:0x%" PRIx64 " configured:0x%" PRIx64,
+			  rss_flow_conf.types, flow_types);
+	/* Update the useful flow types */
+	rss_flow_conf.types = flow_types;
+
 	/* Set hash algorithm and flow types by the user's config */
 	return hns3_hw_rss_hash_set(hw, &rss_flow_conf);
 }
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:30.031260796 +0000
+++ 0045-net-hns3-fix-warning-on-flush-or-destroy-rule.patch	2023-02-23 09:36:28.274170824 +0000
@@ -1 +1 @@
-From a7bf2789168c8d49ca4dec5bb7bb0b3f765fc1bd Mon Sep 17 00:00:00 2001
+From 08e0d5d703e00d9e0205f14a04dc91a94cb06f3d Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a7bf2789168c8d49ca4dec5bb7bb0b3f765fc1bd ]
+
@@ -14 +15,0 @@
-Cc: stable@dpdk.org
@@ -23 +24 @@
-index 3809fcc2d7..632247b846 100644
+index f6de004fbc..0b4add5e80 100644
@@ -26 +27 @@
-@@ -1537,17 +1537,6 @@ hns3_config_rss_filter(struct hns3_hw *hw,
+@@ -1505,17 +1505,6 @@ hns3_config_rss_filter(struct hns3_hw *hw,
@@ -44 +45 @@
-@@ -1573,6 +1562,17 @@ hns3_config_rss_filter(struct hns3_hw *hw,
+@@ -1541,6 +1530,17 @@ hns3_config_rss_filter(struct hns3_hw *hw,

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/hns3: fix config struct used for conversion' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (43 preceding siblings ...)
  2023-02-23  9:36 ` patch 'net/hns3: fix warning on flush or destroy " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'net/hns3: fix duplicate RSS rule check' " luca.boccassi
                   ` (24 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/9c4a8738cdbb4117b9f680815fc613f6850cedaa

Thanks.

Luca Boccassi

---
From 9c4a8738cdbb4117b9f680815fc613f6850cedaa Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Tue, 31 Jan 2023 21:02:59 +0800
Subject: [PATCH] net/hns3: fix config struct used for conversion

[ upstream commit 815c7db53167f7ee1573dca18fa7f889e44764d4 ]

When the type in 'struct rte_flow_action' is RTE_FLOW_ACTION_TYPE_RSS,
the 'conf' pointer references the 'struct rte_flow_action_rss' instead
of the 'struct hns3_rss_conf' in driver. But driver uses 'struct
hns3_rss_conf' to convert this 'conf' pointer to get RSS action
configuration.

In addition, RSS filter configuration is directly cloned to RSS filter
node instead of coping it after successfully setting to hardware.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_flow.c | 59 ++++++++++++++----------------------
 1 file changed, 22 insertions(+), 37 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 0b4add5e80..a0d292db00 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -94,8 +94,8 @@ static const struct rte_flow_action *
 hns3_find_rss_general_action(const struct rte_flow_item pattern[],
 			     const struct rte_flow_action actions[])
 {
+	const struct rte_flow_action_rss *rss_act;
 	const struct rte_flow_action *act = NULL;
-	const struct hns3_rss_conf *rss;
 	bool have_eth = false;
 
 	for (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) {
@@ -114,8 +114,8 @@ hns3_find_rss_general_action(const struct rte_flow_item pattern[],
 		}
 	}
 
-	rss = act->conf;
-	if (have_eth && rss->conf.queue_num) {
+	rss_act = act->conf;
+	if (have_eth && rss_act->queue_num) {
 		/*
 		 * Pattern have ETH and action's queue_num > 0, indicate this is
 		 * queue region configuration.
@@ -1275,30 +1275,6 @@ hns3_action_rss_same(const struct rte_flow_action_rss *comp,
 			sizeof(*with->queue) * with->queue_num));
 }
 
-static int
-hns3_rss_conf_copy(struct hns3_rss_conf *out,
-		   const struct rte_flow_action_rss *in)
-{
-	if (in->key_len > RTE_DIM(out->key) ||
-	    in->queue_num > RTE_DIM(out->queue))
-		return -EINVAL;
-	if (in->key == NULL && in->key_len)
-		return -EINVAL;
-	out->conf = (struct rte_flow_action_rss) {
-		.func = in->func,
-		.level = in->level,
-		.types = in->types,
-		.key_len = in->key_len,
-		.queue_num = in->queue_num,
-	};
-	out->conf.queue = memcpy(out->queue, in->queue,
-				sizeof(*in->queue) * in->queue_num);
-	if (in->key)
-		out->conf.key = memcpy(out->key, in->key, in->key_len);
-
-	return 0;
-}
-
 /*
  * This function is used to parse rss action validation.
  */
@@ -1702,9 +1678,10 @@ hns3_flow_create_rss_rule(struct rte_eth_dev *dev,
 			  struct rte_flow *flow)
 {
 	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	const struct rte_flow_action_rss *rss_act;
 	struct hns3_rss_conf_ele *rss_filter_ptr;
 	struct hns3_rss_conf_ele *filter_ptr;
-	const struct hns3_rss_conf *rss_conf;
+	struct hns3_rss_conf *new_conf;
 	int ret;
 
 	rss_filter_ptr = rte_zmalloc("hns3 rss filter",
@@ -1714,19 +1691,27 @@ hns3_flow_create_rss_rule(struct rte_eth_dev *dev,
 		return -ENOMEM;
 	}
 
-	/*
-	 * After all the preceding tasks are successfully configured, configure
-	 * rules to the hardware to simplify the rollback of rules in the
-	 * hardware.
-	 */
-	rss_conf = (const struct hns3_rss_conf *)act->conf;
-	ret = hns3_flow_parse_rss(dev, rss_conf, true);
+	rss_act = (const struct rte_flow_action_rss *)act->conf;
+	new_conf = &rss_filter_ptr->filter_info;
+	memcpy(&new_conf->conf, rss_act, sizeof(*rss_act));
+	if (rss_act->queue_num > 0) {
+		memcpy(new_conf->queue, rss_act->queue,
+		       rss_act->queue_num * sizeof(new_conf->queue[0]));
+		new_conf->conf.queue = new_conf->queue;
+	}
+	if (rss_act->key_len > 0) {
+		if (rss_act->key != NULL) {
+			memcpy(new_conf->key, rss_act->key,
+			       rss_act->key_len * sizeof(new_conf->key[0]));
+			new_conf->conf.key = new_conf->key;
+		}
+	}
+
+	ret = hns3_flow_parse_rss(dev, new_conf, true);
 	if (ret != 0) {
 		rte_free(rss_filter_ptr);
 		return ret;
 	}
-
-	hns3_rss_conf_copy(&rss_filter_ptr->filter_info, &rss_conf->conf);
 	rss_filter_ptr->filter_info.valid = true;
 
 	/*
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:30.067838505 +0000
+++ 0046-net-hns3-fix-config-struct-used-for-conversion.patch	2023-02-23 09:36:28.278170898 +0000
@@ -1 +1 @@
-From 815c7db53167f7ee1573dca18fa7f889e44764d4 Mon Sep 17 00:00:00 2001
+From 9c4a8738cdbb4117b9f680815fc613f6850cedaa Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 815c7db53167f7ee1573dca18fa7f889e44764d4 ]
+
@@ -16 +17,0 @@
-Cc: stable@dpdk.org
@@ -25 +26 @@
-index 632247b846..dd762c02cb 100644
+index 0b4add5e80..a0d292db00 100644
@@ -28 +29 @@
-@@ -95,8 +95,8 @@ static const struct rte_flow_action *
+@@ -94,8 +94,8 @@ static const struct rte_flow_action *
@@ -38 +39 @@
-@@ -115,8 +115,8 @@ hns3_find_rss_general_action(const struct rte_flow_item pattern[],
+@@ -114,8 +114,8 @@ hns3_find_rss_general_action(const struct rte_flow_item pattern[],
@@ -49 +50 @@
-@@ -1296,30 +1296,6 @@ hns3_action_rss_same(const struct rte_flow_action_rss *comp,
+@@ -1275,30 +1275,6 @@ hns3_action_rss_same(const struct rte_flow_action_rss *comp,
@@ -77,4 +78,4 @@
- static bool
- hns3_rss_input_tuple_supported(struct hns3_hw *hw,
- 			       const struct rte_flow_action_rss *rss)
-@@ -1733,9 +1709,10 @@ hns3_flow_create_rss_rule(struct rte_eth_dev *dev,
+ /*
+  * This function is used to parse rss action validation.
+  */
+@@ -1702,9 +1678,10 @@ hns3_flow_create_rss_rule(struct rte_eth_dev *dev,
@@ -92 +93 @@
-@@ -1745,19 +1722,27 @@ hns3_flow_create_rss_rule(struct rte_eth_dev *dev,
+@@ -1714,19 +1691,27 @@ hns3_flow_create_rss_rule(struct rte_eth_dev *dev,

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/hns3: fix duplicate RSS rule check' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (44 preceding siblings ...)
  2023-02-23  9:36 ` patch 'net/hns3: fix config struct used for conversion' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'net/hns3: extract common functions to set Rx/Tx' " luca.boccassi
                   ` (23 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/52655240fdacc2d41cdd820da291509bceb411f1

Thanks.

Luca Boccassi

---
From 52655240fdacc2d41cdd820da291509bceb411f1 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Tue, 31 Jan 2023 21:03:00 +0800
Subject: [PATCH] net/hns3: fix duplicate RSS rule check

[ upstream commit 150fd8f839e332d68aa7b60646c2033084544cb7 ]

Currently, the interface for verifying duplicate RSS rules has
some problems:
1) If the value of 'func' in configuring RSS rule is default
   value, this rule is mistakenly considered as a duplicate rule.
2) If key length is zero or 'key' is NULL in configuring RSS rule
   this rule is also mistakenly considered as a duplicate rule.
3) If 'key' or 'queue' in struct rte_flow_action_rss being NULL
   is used to memcpy, which may cause segment fault.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_flow.c | 63 +++++++++++++++++++++++++++---------
 1 file changed, 47 insertions(+), 16 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index a0d292db00..400054a9a2 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1251,28 +1251,59 @@ hns3_filterlist_flush(struct rte_eth_dev *dev)
 	}
 }
 
+static bool
+hns3_flow_rule_key_same(const struct rte_flow_action_rss *comp,
+			const struct rte_flow_action_rss *with)
+{
+	if (comp->key_len != with->key_len)
+		return false;
+
+	if (with->key_len == 0)
+		return true;
+
+	if (comp->key == NULL && with->key == NULL)
+		return true;
+
+	if (!(comp->key != NULL && with->key != NULL))
+		return false;
+
+	return !memcmp(comp->key, with->key, with->key_len);
+}
+
+static bool
+hns3_flow_rule_queues_same(const struct rte_flow_action_rss *comp,
+			   const struct rte_flow_action_rss *with)
+{
+	if (comp->queue_num != with->queue_num)
+		return false;
+
+	if (with->queue_num == 0)
+		return true;
+
+	if (comp->queue == NULL && with->queue == NULL)
+		return true;
+
+	if (!(comp->queue != NULL && with->queue != NULL))
+		return false;
+
+	return !memcmp(comp->queue, with->queue, with->queue_num);
+}
+
 static bool
 hns3_action_rss_same(const struct rte_flow_action_rss *comp,
 		     const struct rte_flow_action_rss *with)
 {
-	bool rss_key_is_same;
-	bool func_is_same;
+	bool same_level;
+	bool same_types;
+	bool same_func;
 
-	func_is_same = (with->func != RTE_ETH_HASH_FUNCTION_DEFAULT) ?
-			(comp->func == with->func) : true;
+	same_level = (comp->level == with->level);
+	same_types = (comp->types == with->types);
+	same_func = (comp->func == with->func);
 
-	if (with->key_len == 0 || with->key == NULL)
-		rss_key_is_same = 1;
-	else
-		rss_key_is_same = comp->key_len == with->key_len &&
-		!memcmp(comp->key, with->key, with->key_len);
-
-	return (func_is_same && rss_key_is_same &&
-		comp->types == with->types &&
-		comp->level == with->level &&
-		comp->queue_num == with->queue_num &&
-		!memcmp(comp->queue, with->queue,
-			sizeof(*with->queue) * with->queue_num));
+	return same_level && same_types && same_func &&
+		hns3_flow_rule_key_same(comp, with) &&
+		hns3_flow_rule_queues_same(comp, with);
 }
 
 /*
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:30.104099588 +0000
+++ 0047-net-hns3-fix-duplicate-RSS-rule-check.patch	2023-02-23 09:36:28.278170898 +0000
@@ -1 +1 @@
-From 150fd8f839e332d68aa7b60646c2033084544cb7 Mon Sep 17 00:00:00 2001
+From 52655240fdacc2d41cdd820da291509bceb411f1 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 150fd8f839e332d68aa7b60646c2033084544cb7 ]
+
@@ -16 +17,0 @@
-Cc: stable@dpdk.org
@@ -25 +26 @@
-index dd762c02cb..881d70613c 100644
+index a0d292db00..400054a9a2 100644
@@ -28 +29 @@
-@@ -1272,28 +1272,59 @@ hns3_filterlist_flush(struct rte_eth_dev *dev)
+@@ -1251,28 +1251,59 @@ hns3_filterlist_flush(struct rte_eth_dev *dev)
@@ -103 +104 @@
- static bool
+ /*

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/hns3: extract common functions to set Rx/Tx' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (45 preceding siblings ...)
  2023-02-23  9:36 ` patch 'net/hns3: fix duplicate RSS rule check' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'net/sfc: enforce fate action in transfer flow rules' " luca.boccassi
                   ` (22 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/248a22552eee5c3ee6fafaeeaa29b37158867859

Thanks.

Luca Boccassi

---
From 248a22552eee5c3ee6fafaeeaa29b37158867859 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Sat, 11 Feb 2023 17:18:30 +0800
Subject: [PATCH] net/hns3: extract common functions to set Rx/Tx

[ upstream commit 4ba28c957a16bbfe5b2a8d49dfda1c85387d7602 ]

Extract two common functions to set Rx/Tx function in order to
reduce duplicate codes.

Fixes: 23d4b61fee5d ("net/hns3: support multiple process")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_ethdev.c    | 19 ++++---------------
 drivers/net/hns3/hns3_ethdev_vf.c | 20 +++++---------------
 drivers/net/hns3/hns3_mp.c        |  4 ++--
 drivers/net/hns3/hns3_rxtx.c      | 29 +++++++++++++++++++++++++++++
 drivers/net/hns3/hns3_rxtx.h      |  2 ++
 5 files changed, 42 insertions(+), 32 deletions(-)

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index 4c650e9a72..8d5e1f4beb 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -5077,8 +5077,7 @@ hns3_dev_start(struct rte_eth_dev *dev)
 	rte_spinlock_unlock(&hw->lock);
 
 	hns3_rx_scattered_calc(dev);
-	hns3_set_rxtx_function(dev);
-	hns3_mp_req_start_rxtx(dev);
+	hns3_start_rxtx_datapath(dev);
 	rte_eal_alarm_set(HNS3_SERVICE_INTERVAL, hns3_service_handler, dev);
 
 	/* Enable interrupt of all rx queues before enabling queues */
@@ -5184,12 +5183,7 @@ hns3_dev_stop(struct rte_eth_dev *dev)
 	dev->data->dev_started = 0;
 
 	hw->adapter_state = HNS3_NIC_STOPPING;
-	hns3_set_rxtx_function(dev);
-	rte_wmb();
-	/* Disable datapath on secondary process. */
-	hns3_mp_req_stop_rxtx(dev);
-	/* Prevent crashes when queues are still in use. */
-	rte_delay_ms(hw->cfg_max_queues);
+	hns3_stop_rxtx_datapath(dev);
 
 	rte_spinlock_lock(&hw->lock);
 	if (rte_atomic16_read(&hw->reset.resetting) == 0) {
@@ -5679,11 +5673,7 @@ hns3_stop_service(struct hns3_adapter *hns)
 		rte_eal_alarm_cancel(hns3_service_handler, eth_dev);
 	hw->mac.link_status = ETH_LINK_DOWN;
 
-	hns3_set_rxtx_function(eth_dev);
-	rte_wmb();
-	/* Disable datapath on secondary process. */
-	hns3_mp_req_stop_rxtx(eth_dev);
-	rte_delay_ms(hw->cfg_max_queues);
+	hns3_stop_rxtx_datapath(eth_dev);
 
 	rte_spinlock_lock(&hw->lock);
 	if (hns->hw.adapter_state == HNS3_NIC_STARTED ||
@@ -5716,8 +5706,7 @@ hns3_start_service(struct hns3_adapter *hns)
 	    hw->reset.level == HNS3_GLOBAL_RESET)
 		hns3_set_rst_done(hw);
 	eth_dev = &rte_eth_devices[hw->data->port_id];
-	hns3_set_rxtx_function(eth_dev);
-	hns3_mp_req_start_rxtx(eth_dev);
+	hns3_start_rxtx_datapath(eth_dev);
 	if (hw->adapter_state == HNS3_NIC_STARTED) {
 		hns3_service_handler(eth_dev);
 
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
index 8e6fe9bd54..94652dfb1d 100644
--- a/drivers/net/hns3/hns3_ethdev_vf.c
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
@@ -1962,12 +1962,7 @@ hns3vf_dev_stop(struct rte_eth_dev *dev)
 	dev->data->dev_started = 0;
 
 	hw->adapter_state = HNS3_NIC_STOPPING;
-	hns3_set_rxtx_function(dev);
-	rte_wmb();
-	/* Disable datapath on secondary process. */
-	hns3_mp_req_stop_rxtx(dev);
-	/* Prevent crashes when queues are still in use. */
-	rte_delay_ms(hw->cfg_max_queues);
+	hns3_stop_rxtx_datapath(dev);
 
 	rte_spinlock_lock(&hw->lock);
 	if (rte_atomic16_read(&hw->reset.resetting) == 0) {
@@ -2241,8 +2236,7 @@ hns3vf_dev_start(struct rte_eth_dev *dev)
 	rte_spinlock_unlock(&hw->lock);
 
 	hns3_rx_scattered_calc(dev);
-	hns3_set_rxtx_function(dev);
-	hns3_mp_req_start_rxtx(dev);
+	hns3_start_rxtx_datapath(dev);
 	hns3vf_service_handler(dev);
 
 	/* Enable interrupt of all rx queues before enabling queues */
@@ -2406,11 +2400,7 @@ hns3vf_stop_service(struct hns3_adapter *hns)
 		rte_eal_alarm_cancel(hns3vf_service_handler, eth_dev);
 	hw->mac.link_status = ETH_LINK_DOWN;
 
-	hns3_set_rxtx_function(eth_dev);
-	rte_wmb();
-	/* Disable datapath on secondary process. */
-	hns3_mp_req_stop_rxtx(eth_dev);
-	rte_delay_ms(hw->cfg_max_queues);
+	hns3_stop_rxtx_datapath(eth_dev);
 
 	rte_spinlock_lock(&hw->lock);
 	if (hw->adapter_state == HNS3_NIC_STARTED ||
@@ -2440,8 +2430,8 @@ hns3vf_start_service(struct hns3_adapter *hns)
 	struct rte_eth_dev *eth_dev;
 
 	eth_dev = &rte_eth_devices[hw->data->port_id];
-	hns3_set_rxtx_function(eth_dev);
-	hns3_mp_req_start_rxtx(eth_dev);
+	hns3_start_rxtx_datapath(eth_dev);
+
 	if (hw->adapter_state == HNS3_NIC_STARTED) {
 		hns3vf_service_handler(eth_dev);
 
diff --git a/drivers/net/hns3/hns3_mp.c b/drivers/net/hns3/hns3_mp.c
index 8d7fb93065..1b5cd696f5 100644
--- a/drivers/net/hns3/hns3_mp.c
+++ b/drivers/net/hns3/hns3_mp.c
@@ -87,7 +87,7 @@ mp_secondary_handle(const struct rte_mp_msg *mp_msg, const void *peer)
 	case HNS3_MP_REQ_START_RXTX:
 		PMD_INIT_LOG(INFO, "port %u starting datapath",
 			     dev->data->port_id);
-		hns3_set_rxtx_function(dev);
+		hns3_start_rxtx_datapath(dev);
 		rte_mb();
 		mp_init_msg(dev, &mp_res, param->type);
 		res->result = 0;
@@ -96,7 +96,7 @@ mp_secondary_handle(const struct rte_mp_msg *mp_msg, const void *peer)
 	case HNS3_MP_REQ_STOP_RXTX:
 		PMD_INIT_LOG(INFO, "port %u stopping datapath",
 			     dev->data->port_id);
-		hns3_set_rxtx_function(dev);
+		hns3_stop_rxtx_datapath(dev);
 		rte_mb();
 		mp_init_msg(dev, &mp_res, param->type);
 		res->result = 0;
diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index fadec9c7e2..1a1e62c1c1 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -19,6 +19,7 @@
 #include "hns3_regs.h"
 #include "hns3_logs.h"
 #include "hns3_rxtx.h"
+#include "hns3_mp.h"
 
 #define HNS3_CFG_DESC_NUM(num)	((num) / 8 - 1)
 #define HNS3_RX_RING_PREFETCTH_MASK	3
@@ -4117,3 +4118,31 @@ hns3_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id)
 	else
 		return fbd_num - driver_hold_bd_num;
 }
+
+void
+hns3_stop_rxtx_datapath(struct rte_eth_dev *dev)
+{
+	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+
+	hns3_set_rxtx_function(dev);
+
+	if (rte_eal_process_type() == RTE_PROC_SECONDARY)
+		return;
+
+	rte_wmb();
+	/* Disable datapath on secondary process. */
+	hns3_mp_req_stop_rxtx(dev);
+	/* Prevent crashes when queues are still in use. */
+	rte_delay_ms(hw->cfg_max_queues);
+}
+
+void
+hns3_start_rxtx_datapath(struct rte_eth_dev *dev)
+{
+	hns3_set_rxtx_function(dev);
+
+	if (rte_eal_process_type() == RTE_PROC_SECONDARY)
+		return;
+
+	hns3_mp_req_start_rxtx(dev);
+}
diff --git a/drivers/net/hns3/hns3_rxtx.h b/drivers/net/hns3/hns3_rxtx.h
index b18c3f1165..74371d0866 100644
--- a/drivers/net/hns3/hns3_rxtx.h
+++ b/drivers/net/hns3/hns3_rxtx.h
@@ -702,5 +702,7 @@ int hns3_start_all_txqs(struct rte_eth_dev *dev);
 int hns3_start_all_rxqs(struct rte_eth_dev *dev);
 void hns3_stop_all_txqs(struct rte_eth_dev *dev);
 void hns3_restore_tqp_enable_state(struct hns3_hw *hw);
+void hns3_stop_rxtx_datapath(struct rte_eth_dev *dev);
+void hns3_start_rxtx_datapath(struct rte_eth_dev *dev);
 
 #endif /* _HNS3_RXTX_H_ */
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:30.142438137 +0000
+++ 0048-net-hns3-extract-common-functions-to-set-Rx-Tx.patch	2023-02-23 09:36:28.290171119 +0000
@@ -1 +1 @@
-From 4ba28c957a16bbfe5b2a8d49dfda1c85387d7602 Mon Sep 17 00:00:00 2001
+From 248a22552eee5c3ee6fafaeeaa29b37158867859 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 4ba28c957a16bbfe5b2a8d49dfda1c85387d7602 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -15,2 +16,2 @@
- drivers/net/hns3/hns3_ethdev.c    | 20 ++++----------------
- drivers/net/hns3/hns3_ethdev_vf.c | 19 ++++---------------
+ drivers/net/hns3/hns3_ethdev.c    | 19 ++++---------------
+ drivers/net/hns3/hns3_ethdev_vf.c | 20 +++++---------------
@@ -18 +19 @@
- drivers/net/hns3/hns3_rxtx.c      | 28 ++++++++++++++++++++++++++++
+ drivers/net/hns3/hns3_rxtx.c      | 29 +++++++++++++++++++++++++++++
@@ -20 +21 @@
- 5 files changed, 40 insertions(+), 33 deletions(-)
+ 5 files changed, 42 insertions(+), 32 deletions(-)
@@ -23 +24 @@
-index ab565ce128..6babf67fce 100644
+index 4c650e9a72..8d5e1f4beb 100644
@@ -26 +27 @@
-@@ -5052,8 +5052,7 @@ hns3_dev_start(struct rte_eth_dev *dev)
+@@ -5077,8 +5077,7 @@ hns3_dev_start(struct rte_eth_dev *dev)
@@ -32,0 +34 @@
+ 	rte_eal_alarm_set(HNS3_SERVICE_INTERVAL, hns3_service_handler, dev);
@@ -35,2 +37 @@
- 	hns3_dev_all_rx_queue_intr_enable(hw, true);
-@@ -5131,12 +5130,7 @@ hns3_dev_stop(struct rte_eth_dev *dev)
+@@ -5184,12 +5183,7 @@ hns3_dev_stop(struct rte_eth_dev *dev)
@@ -49,2 +50,2 @@
- 	if (__atomic_load_n(&hw->reset.resetting, __ATOMIC_RELAXED) == 0) {
-@@ -5752,12 +5746,7 @@ hns3_stop_service(struct hns3_adapter *hns)
+ 	if (rte_atomic16_read(&hw->reset.resetting) == 0) {
+@@ -5679,11 +5673,7 @@ hns3_stop_service(struct hns3_adapter *hns)
@@ -52,3 +53,2 @@
- 		hns3_update_linkstatus_and_event(hw, false);
- 	}
--
+ 	hw->mac.link_status = ETH_LINK_DOWN;
+ 
@@ -64 +64 @@
-@@ -5790,8 +5779,7 @@ hns3_start_service(struct hns3_adapter *hns)
+@@ -5716,8 +5706,7 @@ hns3_start_service(struct hns3_adapter *hns)
@@ -72,2 +72,2 @@
- 		/*
- 		 * This API parent function already hold the hns3_hw.lock, the
+ 		hns3_service_handler(eth_dev);
+ 
@@ -75 +75 @@
-index d3c1bdf2c5..d051a1357b 100644
+index 8e6fe9bd54..94652dfb1d 100644
@@ -78 +78 @@
-@@ -1572,12 +1572,7 @@ hns3vf_dev_stop(struct rte_eth_dev *dev)
+@@ -1962,12 +1962,7 @@ hns3vf_dev_stop(struct rte_eth_dev *dev)
@@ -91,2 +91,2 @@
- 	if (__atomic_load_n(&hw->reset.resetting, __ATOMIC_RELAXED) == 0) {
-@@ -1731,8 +1726,7 @@ hns3vf_dev_start(struct rte_eth_dev *dev)
+ 	if (rte_atomic16_read(&hw->reset.resetting) == 0) {
+@@ -2241,8 +2236,7 @@ hns3vf_dev_start(struct rte_eth_dev *dev)
@@ -98,0 +99 @@
+ 	hns3vf_service_handler(dev);
@@ -101,4 +102,3 @@
- 	hns3_dev_all_rx_queue_intr_enable(hw, true);
-@@ -1902,11 +1896,7 @@ hns3vf_stop_service(struct hns3_adapter *hns)
- 	}
- 	hw->mac.link_status = RTE_ETH_LINK_DOWN;
+@@ -2406,11 +2400,7 @@ hns3vf_stop_service(struct hns3_adapter *hns)
+ 		rte_eal_alarm_cancel(hns3vf_service_handler, eth_dev);
+ 	hw->mac.link_status = ETH_LINK_DOWN;
@@ -115 +115 @@
-@@ -1938,8 +1928,7 @@ hns3vf_start_service(struct hns3_adapter *hns)
+@@ -2440,8 +2430,8 @@ hns3vf_start_service(struct hns3_adapter *hns)
@@ -121,0 +122,3 @@
++
+ 	if (hw->adapter_state == HNS3_NIC_STARTED) {
+ 		hns3vf_service_handler(eth_dev);
@@ -123,2 +125,0 @@
- 	rte_eal_alarm_set(HNS3VF_KEEP_ALIVE_INTERVAL, hns3vf_keep_alive_handler,
- 			  eth_dev);
@@ -126 +127 @@
-index 7184f9ad58..556f1941c6 100644
+index 8d7fb93065..1b5cd696f5 100644
@@ -129 +130 @@
-@@ -89,12 +89,12 @@ mp_secondary_handle(const struct rte_mp_msg *mp_msg, const void *peer)
+@@ -87,7 +87,7 @@ mp_secondary_handle(const struct rte_mp_msg *mp_msg, const void *peer)
@@ -135 +136,4 @@
- 		break;
+ 		rte_mb();
+ 		mp_init_msg(dev, &mp_res, param->type);
+ 		res->result = 0;
+@@ -96,7 +96,7 @@ mp_secondary_handle(const struct rte_mp_msg *mp_msg, const void *peer)
@@ -141,3 +145,3 @@
- 		break;
- 	case HNS3_MP_REQ_START_TX:
- 		PMD_INIT_LOG(INFO, "port %u starting Tx datapath",
+ 		rte_mb();
+ 		mp_init_msg(dev, &mp_res, param->type);
+ 		res->result = 0;
@@ -145 +149 @@
-index def22bcd30..4065c519c3 100644
+index fadec9c7e2..1a1e62c1c1 100644
@@ -148,3 +152,11 @@
-@@ -4765,3 +4765,31 @@ hns3_start_tx_datapath(struct rte_eth_dev *dev)
- 
- 	hns3_mp_req_start_tx(dev);
+@@ -19,6 +19,7 @@
+ #include "hns3_regs.h"
+ #include "hns3_logs.h"
+ #include "hns3_rxtx.h"
++#include "hns3_mp.h"
+ 
+ #define HNS3_CFG_DESC_NUM(num)	((num) / 8 - 1)
+ #define HNS3_RX_RING_PREFETCTH_MASK	3
+@@ -4117,3 +4118,31 @@ hns3_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id)
+ 	else
+ 		return fbd_num - driver_hold_bd_num;
@@ -181 +193 @@
-index 1bdc124b7b..fa39f6481a 100644
+index b18c3f1165..74371d0866 100644
@@ -184,4 +196,4 @@
-@@ -773,5 +773,7 @@ int hns3_dev_tx_descriptor_status(void *tx_queue, uint16_t offset);
- void hns3_tx_push_init(struct rte_eth_dev *dev);
- void hns3_stop_tx_datapath(struct rte_eth_dev *dev);
- void hns3_start_tx_datapath(struct rte_eth_dev *dev);
+@@ -702,5 +702,7 @@ int hns3_start_all_txqs(struct rte_eth_dev *dev);
+ int hns3_start_all_rxqs(struct rte_eth_dev *dev);
+ void hns3_stop_all_txqs(struct rte_eth_dev *dev);
+ void hns3_restore_tqp_enable_state(struct hns3_hw *hw);
@@ -191 +203 @@
- #endif /* HNS3_RXTX_H */
+ #endif /* _HNS3_RXTX_H_ */

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/sfc: enforce fate action in transfer flow rules' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (46 preceding siblings ...)
  2023-02-23  9:36 ` patch 'net/hns3: extract common functions to set Rx/Tx' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'net/txgbe: fix Rx buffer size in config register' " luca.boccassi
                   ` (21 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Ivan Malov
  Cc: Viacheslav Galaktionov, Andy Moreton, Andrew Rybchenko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/3098cd7566794ad7c3770231dd52be532ea032fc

Thanks.

Luca Boccassi

---
From 3098cd7566794ad7c3770231dd52be532ea032fc Mon Sep 17 00:00:00 2001
From: Ivan Malov <ivan.malov@arknetworks.am>
Date: Tue, 14 Feb 2023 17:12:47 +0400
Subject: [PATCH] net/sfc: enforce fate action in transfer flow rules

[ upstream commit 3b8e8f046b6754dfa7157675699ea0f5c65bba36 ]

According to DPDK documentation, not specifying a
fate action in a flow rule results in undefined
behaviour. Define right behaviour in the driver.

Fixes: 0839236d0391 ("net/sfc: support flow action drop in transfer rules")

Signed-off-by: Ivan Malov <ivan.malov@arknetworks.am>
Reviewed-by: Viacheslav Galaktionov <viacheslav.galaktionov@arknetworks.am>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 drivers/net/sfc/sfc_mae.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c
index 02f189eca5..45431f9cd2 100644
--- a/drivers/net/sfc/sfc_mae.c
+++ b/drivers/net/sfc/sfc_mae.c
@@ -2136,6 +2136,21 @@ sfc_mae_rule_parse_actions(struct sfc_adapter *sa,
 	if (rc != 0)
 		goto fail_rule_parse_action;
 
+	/*
+	 * A DPDK flow entry must specify a fate action, which the parser
+	 * converts into a DELIVER action in a libefx action set. An
+	 * attempt to replace the action in the action set should
+	 * fail. If it succeeds then report an error, as the
+	 * parsed flow entry did not contain a fate action.
+	 */
+	rc = efx_mae_action_set_populate_drop(spec);
+	if (rc == 0) {
+		rc = rte_flow_error_set(error, EINVAL,
+					RTE_FLOW_ERROR_TYPE_ACTION, NULL,
+					"no fate action found");
+		goto fail_check_fate_action;
+	}
+
 	*action_setp = sfc_mae_action_set_attach(sa, spec);
 	if (*action_setp != NULL) {
 		efx_mae_action_set_spec_fini(sa->nic, spec);
@@ -2149,6 +2164,7 @@ sfc_mae_rule_parse_actions(struct sfc_adapter *sa,
 	return 0;
 
 fail_action_set_add:
+fail_check_fate_action:
 fail_rule_parse_action:
 	efx_mae_action_set_spec_fini(sa->nic, spec);
 
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:30.189456956 +0000
+++ 0049-net-sfc-enforce-fate-action-in-transfer-flow-rules.patch	2023-02-23 09:36:28.294171192 +0000
@@ -1 +1 @@
-From 3b8e8f046b6754dfa7157675699ea0f5c65bba36 Mon Sep 17 00:00:00 2001
+From 3098cd7566794ad7c3770231dd52be532ea032fc Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 3b8e8f046b6754dfa7157675699ea0f5c65bba36 ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
-index c254562696..3daeed81b9 100644
+index 02f189eca5..45431f9cd2 100644
@@ -25,3 +26,3 @@
-@@ -3910,6 +3910,21 @@ sfc_mae_rule_parse_actions(struct sfc_adapter *sa,
- 		SFC_ASSERT(B_FALSE);
- 	}
+@@ -2136,6 +2136,21 @@ sfc_mae_rule_parse_actions(struct sfc_adapter *sa,
+ 	if (rc != 0)
+ 		goto fail_rule_parse_action;
@@ -36 +37 @@
-+	rc = efx_mae_action_set_populate_drop(ctx.spec);
++	rc = efx_mae_action_set_populate_drop(spec);
@@ -44,4 +45,4 @@
- 	spec_mae->action_set = sfc_mae_action_set_attach(sa, &ctx);
- 	if (spec_mae->action_set != NULL) {
- 		sfc_mae_mac_addr_del(sa, ctx.src_mac);
-@@ -3926,6 +3941,7 @@ sfc_mae_rule_parse_actions(struct sfc_adapter *sa,
+ 	*action_setp = sfc_mae_action_set_attach(sa, spec);
+ 	if (*action_setp != NULL) {
+ 		efx_mae_action_set_spec_fini(sa->nic, spec);
+@@ -2149,6 +2164,7 @@ sfc_mae_rule_parse_actions(struct sfc_adapter *sa,
@@ -52,3 +53,3 @@
- fail_workaround_tunnel_delivery:
- fail_nb_count:
- 	sfc_mae_encap_header_del(sa, ctx.encap_header);
+ fail_rule_parse_action:
+ 	efx_mae_action_set_spec_fini(sa->nic, spec);
+ 

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/txgbe: fix Rx buffer size in config register' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (47 preceding siblings ...)
  2023-02-23  9:36 ` patch 'net/sfc: enforce fate action in transfer flow rules' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'net/mlx5: fix flow sample with ConnectX-5' " luca.boccassi
                   ` (20 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Jiawen Wu; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/54b97b047879c9483c80ead08d0eaba0aece58ef

Thanks.

Luca Boccassi

---
From 54b97b047879c9483c80ead08d0eaba0aece58ef Mon Sep 17 00:00:00 2001
From: Jiawen Wu <jiawenwu@trustnetic.com>
Date: Wed, 15 Feb 2023 10:00:56 +0800
Subject: [PATCH] net/txgbe: fix Rx buffer size in config register

[ upstream commit 8a3ef4b89e6dd0247355fdf3a77ff7ec1db28d8d ]

When round up buffer size to 1K, to configure the register, hardware
will receive packets exceeding the buffer size in LRO mode. It will
cause a segment fault in the receive function.

Fixes: be797cbf4582 ("net/txgbe: add Rx and Tx init")

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
 drivers/net/txgbe/txgbe_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/txgbe/txgbe_rxtx.c b/drivers/net/txgbe/txgbe_rxtx.c
index 1196b95367..ae6aa07a01 100644
--- a/drivers/net/txgbe/txgbe_rxtx.c
+++ b/drivers/net/txgbe/txgbe_rxtx.c
@@ -4243,7 +4243,7 @@ txgbe_dev_rx_init(struct rte_eth_dev *dev)
 		 */
 		buf_size = (uint16_t)(rte_pktmbuf_data_room_size(rxq->mb_pool) -
 			RTE_PKTMBUF_HEADROOM);
-		buf_size = ROUND_UP(buf_size, 0x1 << 10);
+		buf_size = ROUND_DOWN(buf_size, 0x1 << 10);
 		srrctl |= TXGBE_RXCFG_PKTLEN(buf_size);
 
 		wr32(hw, TXGBE_RXCFG(rxq->reg_idx), srrctl);
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:30.227470610 +0000
+++ 0050-net-txgbe-fix-Rx-buffer-size-in-config-register.patch	2023-02-23 09:36:28.298171266 +0000
@@ -1 +1 @@
-From 8a3ef4b89e6dd0247355fdf3a77ff7ec1db28d8d Mon Sep 17 00:00:00 2001
+From 54b97b047879c9483c80ead08d0eaba0aece58ef Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 8a3ef4b89e6dd0247355fdf3a77ff7ec1db28d8d ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
-index 021f281fbb..427f8b82ac 100644
+index 1196b95367..ae6aa07a01 100644
@@ -22 +23 @@
-@@ -4392,7 +4392,7 @@ txgbe_dev_rx_init(struct rte_eth_dev *dev)
+@@ -4243,7 +4243,7 @@ txgbe_dev_rx_init(struct rte_eth_dev *dev)

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/mlx5: fix flow sample with ConnectX-5' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (48 preceding siblings ...)
  2023-02-23  9:36 ` patch 'net/txgbe: fix Rx buffer size in config register' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'net/mlx5: fix error CQE dumping for vectorized Rx' " luca.boccassi
                   ` (19 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Jiawei Wang; +Cc: Viacheslav Ovsiienko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/5286c2391c6714374b3da8123f0fcb00e62ba0fd

Thanks.

Luca Boccassi

---
From 5286c2391c6714374b3da8123f0fcb00e62ba0fd Mon Sep 17 00:00:00 2001
From: Jiawei Wang <jiaweiw@nvidia.com>
Date: Fri, 9 Dec 2022 16:34:06 +0200
Subject: [PATCH] net/mlx5: fix flow sample with ConnectX-5

[ upstream commit 7aa6d7998a9e59dc510e4e5706f675493855ff27 ]

The sample flow tried to get the reserved metadata register for
the match implicitly, and if the reserved metadata register was
invalid then back to use the application tag.

The assertion failure was caused while getting registered due to
the reserved metadata regC is invalid on CX-5 trusted device(VF/SF).

This patch adds the checking for reserved metadata register before
getting the register, to avoid assertion failure.

Fixes: 9a726360dd30 ("net/mlx5: fix sample flow action on trusted device")

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 87d55fc6be..ad11611027 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -4821,13 +4821,14 @@ flow_sample_split_prep(struct rte_eth_dev *dev,
 	if (!fdb_tx) {
 		/* Prepare the prefix tag action. */
 		set_tag = (void *)(actions_pre + actions_n + 1);
-		ret = mlx5_flow_get_reg_id(dev, MLX5_SAMPLE_ID, 0, error);
 		/* Trust VF/SF on CX5 not supported meter so that the reserved
 		 * metadata regC is REG_NON, back to use application tag
 		 * index 0.
 		 */
-		if (unlikely(ret == REG_NON))
+		if (unlikely(priv->mtr_color_reg == REG_NON))
 			ret = mlx5_flow_get_reg_id(dev, MLX5_APP_TAG, 0, error);
+		else
+			ret = mlx5_flow_get_reg_id(dev, MLX5_SAMPLE_ID, 0, error);
 		if (ret < 0)
 			return ret;
 		set_tag->id = ret;
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:30.268107363 +0000
+++ 0051-net-mlx5-fix-flow-sample-with-ConnectX-5.patch	2023-02-23 09:36:28.302171339 +0000
@@ -1 +1 @@
-From 7aa6d7998a9e59dc510e4e5706f675493855ff27 Mon Sep 17 00:00:00 2001
+From 5286c2391c6714374b3da8123f0fcb00e62ba0fd Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 7aa6d7998a9e59dc510e4e5706f675493855ff27 ]
+
@@ -17 +18,0 @@
-Cc: stable@dpdk.org
@@ -26 +27 @@
-index 51547aa78f..ea2016598e 100644
+index 87d55fc6be..ad11611027 100644
@@ -29 +30,2 @@
-@@ -6186,13 +6186,14 @@ flow_sample_split_prep(struct rte_eth_dev *dev,
+@@ -4821,13 +4821,14 @@ flow_sample_split_prep(struct rte_eth_dev *dev,
+ 	if (!fdb_tx) {
@@ -31,2 +33 @@
- 		append_index++;
- 		set_tag = (void *)(actions_pre + actions_n + append_index);
+ 		set_tag = (void *)(actions_pre + actions_n + 1);
@@ -45 +46 @@
- 		mlx5_ipool_malloc(priv->sh->ipool
+ 		set_tag->id = ret;

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/mlx5: fix error CQE dumping for vectorized Rx' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (49 preceding siblings ...)
  2023-02-23  9:36 ` patch 'net/mlx5: fix flow sample with ConnectX-5' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'net/mlx5: ignore non-critical syndromes for Rx queue' " luca.boccassi
                   ` (18 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Alexander Kozyrev; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From b151f703cdf97f40950ca20d03b91cf33af342d6 Mon Sep 17 00:00:00 2001
From: Alexander Kozyrev <akozyrev@nvidia.com>
Date: Fri, 27 Jan 2023 05:22:11 +0200
Subject: [PATCH] net/mlx5: fix error CQE dumping for vectorized Rx

[ upstream commit 633684e0d0defdd7649132797cc14329f71f678c ]

There is a dump file with debug information created
for an error CQE to help with troubleshooting later.
It starts with the last CQE, which, presumably is the error CQE.
But this is only true for the scalar Rx burst routing since
we handle CQEs there one by one and detect the error immediately.
For vectorized Rx bursts, we may already move to another CQE
when we detect the error since we handle CQEs in batches there.
Go back to the error CQE in this case to dump proper CQE.

Fixes: 88c0733535 ("net/mlx5: extend Rx completion with error handling")

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_rxtx.c     | 16 +++++++++++-----
 drivers/net/mlx5/mlx5_rxtx.h     |  3 ++-
 drivers/net/mlx5/mlx5_rxtx_vec.c | 12 +++++++-----
 3 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index 12a1eff681..1422961d62 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -1000,12 +1000,14 @@ mlx5_queue_state_modify(struct rte_eth_dev *dev,
  * @param[in] vec
  *   1 when called from vectorized Rx burst, need to prepare mbufs for the RQ.
  *   0 when called from non-vectorized Rx burst.
+ * @param[in] err_n
+ *   Number of CQEs to check for an error.
  *
  * @return
  *   MLX5_RECOVERY_ERROR_RET in case of recovery error, otherwise the CQE status.
  */
 int
-mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec)
+mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec, uint16_t err_n)
 {
 	const uint16_t cqe_n = 1 << rxq->cqe_n;
 	const uint16_t cqe_mask = cqe_n - 1;
@@ -1017,13 +1019,18 @@ mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec)
 		volatile struct mlx5_cqe *cqe;
 		volatile struct mlx5_err_cqe *err_cqe;
 	} u = {
-		.cqe = &(*rxq->cqes)[rxq->cq_ci & cqe_mask],
+		.cqe = &(*rxq->cqes)[(rxq->cq_ci - vec) & cqe_mask],
 	};
 	struct mlx5_mp_arg_queue_state_modify sm;
-	int ret;
+	int ret, i;
 
 	switch (rxq->err_state) {
 	case MLX5_RXQ_ERR_STATE_NO_ERROR:
+		for (i = 0; i < (int)err_n; i++) {
+			u.cqe = &(*rxq->cqes)[(rxq->cq_ci - vec - i) & cqe_mask];
+			if (MLX5_CQE_OPCODE(u.cqe->op_own) == MLX5_CQE_RESP_ERR)
+				break;
+		}
 		rxq->err_state = MLX5_RXQ_ERR_STATE_NEED_RESET;
 		/* Fall-through */
 	case MLX5_RXQ_ERR_STATE_NEED_RESET:
@@ -1083,7 +1090,6 @@ mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec)
 					rxq->elts_ci : rxq->rq_ci;
 				uint32_t elt_idx;
 				struct rte_mbuf **elt;
-				int i;
 				unsigned int n = elts_n - (elts_ci -
 							  rxq->rq_pi);
 
@@ -1204,7 +1210,7 @@ mlx5_rx_poll_len(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe,
 			if (unlikely(ret != MLX5_CQE_STATUS_SW_OWN)) {
 				if (unlikely(ret == MLX5_CQE_STATUS_ERR ||
 					     rxq->err_state)) {
-					ret = mlx5_rx_err_handle(rxq, 0);
+					ret = mlx5_rx_err_handle(rxq, 0, 1);
 					if (ret == MLX5_CQE_STATUS_HW_OWN ||
 					    ret == MLX5_RECOVERY_ERROR_RET)
 						return MLX5_ERROR_CQE_RET;
diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h
index 964ebaaaad..7fa471a651 100644
--- a/drivers/net/mlx5/mlx5_rxtx.h
+++ b/drivers/net/mlx5/mlx5_rxtx.h
@@ -427,7 +427,8 @@ void mlx5_set_cksum_table(void);
 void mlx5_set_swp_types_table(void);
 uint16_t mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n);
 void mlx5_rxq_initialize(struct mlx5_rxq_data *rxq);
-__rte_noinline int mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec);
+__rte_noinline int mlx5_rx_err_handle(struct mlx5_rxq_data *rxq,
+				      uint8_t vec, uint16_t err_n);
 void mlx5_mprq_buf_free_cb(void *addr, void *opaque);
 void mlx5_mprq_buf_free(struct mlx5_mprq_buf *buf);
 uint16_t mlx5_rx_burst_mprq(void *dpdk_rxq, struct rte_mbuf **pkts,
diff --git a/drivers/net/mlx5/mlx5_rxtx_vec.c b/drivers/net/mlx5/mlx5_rxtx_vec.c
index d156de4ec1..ca0f585863 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec.c
+++ b/drivers/net/mlx5/mlx5_rxtx_vec.c
@@ -73,7 +73,7 @@ rxq_handle_pending_error(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts,
 	rxq->stats.ipackets -= (pkts_n - n);
 	rxq->stats.ibytes -= err_bytes;
 #endif
-	mlx5_rx_err_handle(rxq, 1);
+	mlx5_rx_err_handle(rxq, 1, pkts_n);
 	return n;
 }
 
@@ -247,8 +247,6 @@ rxq_copy_mprq_mbuf_v(struct mlx5_rxq_data *rxq,
 	}
 	rxq->rq_pi += i;
 	rxq->cq_ci += i;
-	rte_io_wmb();
-	*rxq->cq_db = rte_cpu_to_be_32(rxq->cq_ci);
 	if (rq_ci != rxq->rq_ci) {
 		rxq->rq_ci = rq_ci;
 		rte_io_wmb();
@@ -355,8 +353,6 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts,
 			rxq->decompressed -= n;
 		}
 	}
-	rte_io_wmb();
-	*rxq->cq_db = rte_cpu_to_be_32(rxq->cq_ci);
 	*no_cq = !rcvd_pkt;
 	return rcvd_pkt;
 }
@@ -384,6 +380,7 @@ mlx5_rx_burst_vec(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
 	bool no_cq = false;
 
 	do {
+		err = 0;
 		nb_rx = rxq_burst_v(rxq, pkts + tn, pkts_n - tn,
 				    &err, &no_cq);
 		if (unlikely(err | rxq->err_state))
@@ -391,6 +388,8 @@ mlx5_rx_burst_vec(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
 		tn += nb_rx;
 		if (unlikely(no_cq))
 			break;
+		rte_io_wmb();
+		*rxq->cq_db = rte_cpu_to_be_32(rxq->cq_ci);
 	} while (tn != pkts_n);
 	return tn;
 }
@@ -518,6 +517,7 @@ mlx5_rx_burst_mprq_vec(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
 	bool no_cq = false;
 
 	do {
+		err = 0;
 		nb_rx = rxq_burst_mprq_v(rxq, pkts + tn, pkts_n - tn,
 					 &err, &no_cq);
 		if (unlikely(err | rxq->err_state))
@@ -525,6 +525,8 @@ mlx5_rx_burst_mprq_vec(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
 		tn += nb_rx;
 		if (unlikely(no_cq))
 			break;
+		rte_io_wmb();
+		*rxq->cq_db = rte_cpu_to_be_32(rxq->cq_ci);
 	} while (tn != pkts_n);
 	return tn;
 }
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:30.314715380 +0000
+++ 0052-net-mlx5-fix-error-CQE-dumping-for-vectorized-Rx.patch	2023-02-23 09:36:28.310171487 +0000
@@ -1 +1 @@
-From 633684e0d0defdd7649132797cc14329f71f678c Mon Sep 17 00:00:00 2001
+From b151f703cdf97f40950ca20d03b91cf33af342d6 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 633684e0d0defdd7649132797cc14329f71f678c ]
+
@@ -16 +17,0 @@
-Cc: stable@dpdk.org
@@ -21,2 +22,2 @@
- drivers/net/mlx5/mlx5_rx.c       | 16 +++++++++++-----
- drivers/net/mlx5/mlx5_rx.h       |  3 ++-
+ drivers/net/mlx5/mlx5_rxtx.c     | 16 +++++++++++-----
+ drivers/net/mlx5/mlx5_rxtx.h     |  3 ++-
@@ -26,5 +27,5 @@
-diff --git a/drivers/net/mlx5/mlx5_rx.c b/drivers/net/mlx5/mlx5_rx.c
-index 917c517b83..7612d15f01 100644
---- a/drivers/net/mlx5/mlx5_rx.c
-+++ b/drivers/net/mlx5/mlx5_rx.c
-@@ -425,12 +425,14 @@ mlx5_rxq_initialize(struct mlx5_rxq_data *rxq)
+diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
+index 12a1eff681..1422961d62 100644
+--- a/drivers/net/mlx5/mlx5_rxtx.c
++++ b/drivers/net/mlx5/mlx5_rxtx.c
+@@ -1000,12 +1000,14 @@ mlx5_queue_state_modify(struct rte_eth_dev *dev,
@@ -46 +47 @@
-@@ -442,13 +444,18 @@ mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec)
+@@ -1017,13 +1019,18 @@ mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec)
@@ -67 +68 @@
-@@ -507,7 +514,6 @@ mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec)
+@@ -1083,7 +1090,6 @@ mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec)
@@ -75 +76 @@
-@@ -628,7 +634,7 @@ mlx5_rx_poll_len(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe,
+@@ -1204,7 +1210,7 @@ mlx5_rx_poll_len(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe,
@@ -84,6 +85,6 @@
-diff --git a/drivers/net/mlx5/mlx5_rx.h b/drivers/net/mlx5/mlx5_rx.h
-index e078aaf3dc..4ba53ebc48 100644
---- a/drivers/net/mlx5/mlx5_rx.h
-+++ b/drivers/net/mlx5/mlx5_rx.h
-@@ -286,7 +286,8 @@ int mlx5_hrxq_modify(struct rte_eth_dev *dev, uint32_t hxrq_idx,
- 
+diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h
+index 964ebaaaad..7fa471a651 100644
+--- a/drivers/net/mlx5/mlx5_rxtx.h
++++ b/drivers/net/mlx5/mlx5_rxtx.h
+@@ -427,7 +427,8 @@ void mlx5_set_cksum_table(void);
+ void mlx5_set_swp_types_table(void);
@@ -94,0 +96 @@
+ void mlx5_mprq_buf_free_cb(void *addr, void *opaque);
@@ -97 +98,0 @@
- 			    uint16_t pkts_n);
@@ -99 +100 @@
-index 0e2eab068a..c6be2be763 100644
+index d156de4ec1..ca0f585863 100644
@@ -102 +103 @@
-@@ -74,7 +74,7 @@ rxq_handle_pending_error(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts,
+@@ -73,7 +73,7 @@ rxq_handle_pending_error(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts,
@@ -111 +112 @@
-@@ -253,8 +253,6 @@ rxq_copy_mprq_mbuf_v(struct mlx5_rxq_data *rxq,
+@@ -247,8 +247,6 @@ rxq_copy_mprq_mbuf_v(struct mlx5_rxq_data *rxq,
@@ -120 +121 @@
-@@ -361,8 +359,6 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts,
+@@ -355,8 +353,6 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts,
@@ -129 +130 @@
-@@ -390,6 +386,7 @@ mlx5_rx_burst_vec(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
+@@ -384,6 +380,7 @@ mlx5_rx_burst_vec(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
@@ -137 +138 @@
-@@ -397,6 +394,8 @@ mlx5_rx_burst_vec(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
+@@ -391,6 +388,8 @@ mlx5_rx_burst_vec(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
@@ -146 +147 @@
-@@ -524,6 +523,7 @@ mlx5_rx_burst_mprq_vec(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
+@@ -518,6 +517,7 @@ mlx5_rx_burst_mprq_vec(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
@@ -154 +155 @@
-@@ -531,6 +531,8 @@ mlx5_rx_burst_mprq_vec(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
+@@ -525,6 +525,8 @@ mlx5_rx_burst_mprq_vec(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/mlx5: ignore non-critical syndromes for Rx queue' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (50 preceding siblings ...)
  2023-02-23  9:36 ` patch 'net/mlx5: fix error CQE dumping for vectorized Rx' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'net/i40e: reduce interrupt interval in multi-driver mode' " luca.boccassi
                   ` (17 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Alexander Kozyrev; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From aad5672767479652695f199cdb26dcdae7e5f5e6 Mon Sep 17 00:00:00 2001
From: Alexander Kozyrev <akozyrev@nvidia.com>
Date: Fri, 27 Jan 2023 05:22:43 +0200
Subject: [PATCH] net/mlx5: ignore non-critical syndromes for Rx queue

[ upstream commit aa67ed3084588e6ca12e9709a6cab021f0ffeba7 ]

For non-fatal syndromes like LOCAL_LENGTH_ERR, the Rx queue reset
shouldn't be triggered. Rx queue could continue with the next packets
without any recovery. Only three syndromes warrant Rx queue reset:
LOCAL_QP_OP_ERR, LOCAL_PROT_ERR and WR_FLUSH_ERR.
Do not initiate a Rx queue reset in any other cases.
Skip all non-critical error CQEs and continue with packet processing.

Fixes: 88c0733535 ("net/mlx5: extend Rx completion with error handling")

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_rxtx.c     | 123 ++++++++++++++++++++++++-------
 drivers/net/mlx5/mlx5_rxtx.h     |   5 +-
 drivers/net/mlx5/mlx5_rxtx_vec.c |   3 +-
 3 files changed, 102 insertions(+), 29 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index 1422961d62..f7c8b8c076 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -86,7 +86,8 @@ rxq_cq_to_pkt_type(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe,
 
 static __rte_always_inline int
 mlx5_rx_poll_len(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe,
-		 uint16_t cqe_cnt, volatile struct mlx5_mini_cqe8 **mcqe);
+		 uint16_t cqe_cnt, volatile struct mlx5_mini_cqe8 **mcqe,
+		 uint16_t *skip_cnt, bool mprq);
 
 static __rte_always_inline uint32_t
 rxq_cq_to_ol_flags(volatile struct mlx5_cqe *cqe);
@@ -983,10 +984,14 @@ mlx5_queue_state_modify(struct rte_eth_dev *dev,
 	return ret;
 }
 
+#define MLX5_ERROR_CQE_MASK 0x40000000
 /* Must be negative. */
-#define MLX5_ERROR_CQE_RET (-1)
+#define MLX5_REGULAR_ERROR_CQE_RET (-5)
+#define MLX5_CRITICAL_ERROR_CQE_RET (-4)
 /* Must not be negative. */
 #define MLX5_RECOVERY_ERROR_RET 0
+#define MLX5_RECOVERY_IGNORE_RET 1
+#define MLX5_RECOVERY_COMPLETED_RET 2
 
 /**
  * Handle a Rx error.
@@ -1004,10 +1009,14 @@ mlx5_queue_state_modify(struct rte_eth_dev *dev,
  *   Number of CQEs to check for an error.
  *
  * @return
- *   MLX5_RECOVERY_ERROR_RET in case of recovery error, otherwise the CQE status.
+ *   MLX5_RECOVERY_ERROR_RET in case of recovery error,
+ *   MLX5_RECOVERY_IGNORE_RET in case of non-critical error syndrome,
+ *   MLX5_RECOVERY_COMPLETED_RET in case of recovery is completed,
+ *   otherwise the CQE status after ignored error syndrome or queue reset.
  */
 int
-mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec, uint16_t err_n)
+mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec,
+		   uint16_t err_n, uint16_t *skip_cnt)
 {
 	const uint16_t cqe_n = 1 << rxq->cqe_n;
 	const uint16_t cqe_mask = cqe_n - 1;
@@ -1022,14 +1031,35 @@ mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec, uint16_t err_n)
 		.cqe = &(*rxq->cqes)[(rxq->cq_ci - vec) & cqe_mask],
 	};
 	struct mlx5_mp_arg_queue_state_modify sm;
+	bool critical_syndrome = false;
 	int ret, i;
 
 	switch (rxq->err_state) {
+	case MLX5_RXQ_ERR_STATE_IGNORE:
+		ret = check_cqe(u.cqe, cqe_n, rxq->cq_ci - vec);
+		if (ret != MLX5_CQE_STATUS_ERR) {
+			rxq->err_state = MLX5_RXQ_ERR_STATE_NO_ERROR;
+			return ret;
+		}
+		/* Fall-through */
 	case MLX5_RXQ_ERR_STATE_NO_ERROR:
 		for (i = 0; i < (int)err_n; i++) {
 			u.cqe = &(*rxq->cqes)[(rxq->cq_ci - vec - i) & cqe_mask];
-			if (MLX5_CQE_OPCODE(u.cqe->op_own) == MLX5_CQE_RESP_ERR)
+			if (MLX5_CQE_OPCODE(u.cqe->op_own) == MLX5_CQE_RESP_ERR) {
+				if (u.err_cqe->syndrome == MLX5_CQE_SYNDROME_LOCAL_QP_OP_ERR ||
+				    u.err_cqe->syndrome == MLX5_CQE_SYNDROME_LOCAL_PROT_ERR ||
+				    u.err_cqe->syndrome == MLX5_CQE_SYNDROME_WR_FLUSH_ERR)
+					critical_syndrome = true;
 				break;
+			}
+		}
+		if (!critical_syndrome) {
+			if (rxq->err_state == MLX5_RXQ_ERR_STATE_NO_ERROR) {
+				*skip_cnt = 0;
+				if (i == err_n)
+					rxq->err_state = MLX5_RXQ_ERR_STATE_IGNORE;
+			}
+			return MLX5_RECOVERY_IGNORE_RET;
 		}
 		rxq->err_state = MLX5_RXQ_ERR_STATE_NEED_RESET;
 		/* Fall-through */
@@ -1122,6 +1152,7 @@ mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec, uint16_t err_n)
 			}
 			mlx5_rxq_initialize(rxq);
 			rxq->err_state = MLX5_RXQ_ERR_STATE_NO_ERROR;
+			return MLX5_RECOVERY_COMPLETED_RET;
 		}
 		return ret;
 	default:
@@ -1141,19 +1172,24 @@ mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec, uint16_t err_n)
  * @param[out] mcqe
  *   Store pointer to mini-CQE if compressed. Otherwise, the pointer is not
  *   written.
- *
+ * @param[out] skip_cnt
+ *   Number of packets skipped due to recoverable errors.
+ * @param mprq
+ *   Indication if it is called from MPRQ.
  * @return
- *   0 in case of empty CQE, MLX5_ERROR_CQE_RET in case of error CQE,
- *   otherwise the packet size in regular RxQ, and striding byte
- *   count format in mprq case.
+ *   0 in case of empty CQE, MLX5_REGULAR_ERROR_CQE_RET in case of error CQE,
+ *   MLX5_CRITICAL_ERROR_CQE_RET in case of error CQE lead to Rx queue reset,
+ *   otherwise the packet size in regular RxQ,
+ *   and striding byte count format in mprq case.
  */
 static inline int
 mlx5_rx_poll_len(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe,
-		 uint16_t cqe_cnt, volatile struct mlx5_mini_cqe8 **mcqe)
+		 uint16_t cqe_cnt, volatile struct mlx5_mini_cqe8 **mcqe,
+		 uint16_t *skip_cnt, bool mprq)
 {
 	struct rxq_zip *zip = &rxq->zip;
 	uint16_t cqe_n = cqe_cnt + 1;
-	int len;
+	int len = 0, ret = 0;
 	uint16_t idx, end;
 
 	do {
@@ -1202,7 +1238,6 @@ mlx5_rx_poll_len(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe,
 		 * compressed.
 		 */
 		} else {
-			int ret;
 			int8_t op_own;
 			uint32_t cq_ci;
 
@@ -1210,10 +1245,12 @@ mlx5_rx_poll_len(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe,
 			if (unlikely(ret != MLX5_CQE_STATUS_SW_OWN)) {
 				if (unlikely(ret == MLX5_CQE_STATUS_ERR ||
 					     rxq->err_state)) {
-					ret = mlx5_rx_err_handle(rxq, 0, 1);
-					if (ret == MLX5_CQE_STATUS_HW_OWN ||
-					    ret == MLX5_RECOVERY_ERROR_RET)
-						return MLX5_ERROR_CQE_RET;
+					ret = mlx5_rx_err_handle(rxq, 0, 1, skip_cnt);
+					if (ret == MLX5_CQE_STATUS_HW_OWN)
+						return MLX5_ERROR_CQE_MASK;
+					if (ret == MLX5_RECOVERY_ERROR_RET ||
+						ret == MLX5_RECOVERY_COMPLETED_RET)
+						return MLX5_CRITICAL_ERROR_CQE_RET;
 				} else {
 					return 0;
 				}
@@ -1266,8 +1303,15 @@ mlx5_rx_poll_len(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe,
 			}
 		}
 		if (unlikely(rxq->err_state)) {
+			if (rxq->err_state == MLX5_RXQ_ERR_STATE_IGNORE &&
+			    ret == MLX5_CQE_STATUS_SW_OWN) {
+				rxq->err_state = MLX5_RXQ_ERR_STATE_NO_ERROR;
+				return len & MLX5_ERROR_CQE_MASK;
+			}
 			cqe = &(*rxq->cqes)[rxq->cq_ci & cqe_cnt];
 			++rxq->stats.idropped;
+			(*skip_cnt) += mprq ? (len & MLX5_MPRQ_STRIDE_NUM_MASK) >>
+				MLX5_MPRQ_STRIDE_NUM_SHIFT : 1;
 		} else {
 			return len;
 		}
@@ -1418,6 +1462,7 @@ mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
 	int len = 0; /* keep its value across iterations. */
 
 	while (pkts_n) {
+		uint16_t skip_cnt;
 		unsigned int idx = rq_ci & wqe_cnt;
 		volatile struct mlx5_wqe_data_seg *wqe =
 			&((volatile struct mlx5_wqe_data_seg *)rxq->wqes)[idx];
@@ -1456,11 +1501,24 @@ mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
 		}
 		if (!pkt) {
 			cqe = &(*rxq->cqes)[rxq->cq_ci & cqe_cnt];
-			len = mlx5_rx_poll_len(rxq, cqe, cqe_cnt, &mcqe);
-			if (len <= 0) {
-				rte_mbuf_raw_free(rep);
-				if (unlikely(len == MLX5_ERROR_CQE_RET))
+			len = mlx5_rx_poll_len(rxq, cqe, cqe_cnt, &mcqe, &skip_cnt, false);
+			if (unlikely(len & MLX5_ERROR_CQE_MASK)) {
+				if (len == MLX5_CRITICAL_ERROR_CQE_RET) {
+					rte_mbuf_raw_free(rep);
 					rq_ci = rxq->rq_ci << sges_n;
+					break;
+				}
+				rq_ci >>= sges_n;
+				rq_ci += skip_cnt;
+				rq_ci <<= sges_n;
+				idx = rq_ci & wqe_cnt;
+				wqe = &((volatile struct mlx5_wqe_data_seg *)rxq->wqes)[idx];
+				seg = (*rxq->elts)[idx];
+				cqe = &(*rxq->cqes)[rxq->cq_ci & cqe_cnt];
+				len = len & ~MLX5_ERROR_CQE_MASK;
+			}
+			if (len == 0) {
+				rte_mbuf_raw_free(rep);
 				break;
 			}
 			pkt = seg;
@@ -1684,6 +1742,7 @@ mlx5_rx_burst_mprq(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
 		uint16_t strd_cnt;
 		uint16_t strd_idx;
 		uint32_t byte_cnt;
+		uint16_t skip_cnt;
 		volatile struct mlx5_mini_cqe8 *mcqe = NULL;
 		enum mlx5_rqx_code rxq_code;
 
@@ -1696,14 +1755,26 @@ mlx5_rx_burst_mprq(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
 			buf = (*rxq->mprq_bufs)[rq_ci & wq_mask];
 		}
 		cqe = &(*rxq->cqes)[rxq->cq_ci & cq_mask];
-		ret = mlx5_rx_poll_len(rxq, cqe, cq_mask, &mcqe);
+		ret = mlx5_rx_poll_len(rxq, cqe, cq_mask, &mcqe, &skip_cnt, true);
+		if (unlikely(ret & MLX5_ERROR_CQE_MASK)) {
+			if (ret == MLX5_CRITICAL_ERROR_CQE_RET) {
+				rq_ci = rxq->rq_ci;
+				consumed_strd = rxq->consumed_strd;
+				break;
+			}
+			consumed_strd += skip_cnt;
+			while (consumed_strd >= strd_n) {
+				/* Replace WQE if the buffer is still in use. */
+				mprq_buf_replace(rxq, rq_ci & wq_mask);
+				/* Advance to the next WQE. */
+				consumed_strd -= strd_n;
+				++rq_ci;
+				buf = (*rxq->mprq_bufs)[rq_ci & wq_mask];
+			}
+			cqe = &(*rxq->cqes)[rxq->cq_ci & cq_mask];
+		}
 		if (ret == 0)
 			break;
-		if (unlikely(ret == MLX5_ERROR_CQE_RET)) {
-			rq_ci = rxq->rq_ci;
-			consumed_strd = rxq->consumed_strd;
-			break;
-		}
 		byte_cnt = ret;
 		len = (byte_cnt & MLX5_MPRQ_LEN_MASK) >> MLX5_MPRQ_LEN_SHIFT;
 		MLX5_ASSERT((int)len >= (rxq->crc_present << 2));
diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h
index 7fa471a651..b5fe330a71 100644
--- a/drivers/net/mlx5/mlx5_rxtx.h
+++ b/drivers/net/mlx5/mlx5_rxtx.h
@@ -91,6 +91,7 @@ enum mlx5_rxq_err_state {
 	MLX5_RXQ_ERR_STATE_NO_ERROR = 0,
 	MLX5_RXQ_ERR_STATE_NEED_RESET,
 	MLX5_RXQ_ERR_STATE_NEED_READY,
+	MLX5_RXQ_ERR_STATE_IGNORE,
 };
 
 enum mlx5_rqx_code {
@@ -427,8 +428,8 @@ void mlx5_set_cksum_table(void);
 void mlx5_set_swp_types_table(void);
 uint16_t mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n);
 void mlx5_rxq_initialize(struct mlx5_rxq_data *rxq);
-__rte_noinline int mlx5_rx_err_handle(struct mlx5_rxq_data *rxq,
-				      uint8_t vec, uint16_t err_n);
+__rte_noinline int mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec,
+				      uint16_t err_n, uint16_t *skip_cnt);
 void mlx5_mprq_buf_free_cb(void *addr, void *opaque);
 void mlx5_mprq_buf_free(struct mlx5_mprq_buf *buf);
 uint16_t mlx5_rx_burst_mprq(void *dpdk_rxq, struct rte_mbuf **pkts,
diff --git a/drivers/net/mlx5/mlx5_rxtx_vec.c b/drivers/net/mlx5/mlx5_rxtx_vec.c
index ca0f585863..4a1dc3c3e1 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec.c
+++ b/drivers/net/mlx5/mlx5_rxtx_vec.c
@@ -50,6 +50,7 @@ rxq_handle_pending_error(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts,
 			 uint16_t pkts_n)
 {
 	uint16_t n = 0;
+	uint16_t skip_cnt;
 	unsigned int i;
 #ifdef MLX5_PMD_SOFT_COUNTERS
 	uint32_t err_bytes = 0;
@@ -73,7 +74,7 @@ rxq_handle_pending_error(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts,
 	rxq->stats.ipackets -= (pkts_n - n);
 	rxq->stats.ibytes -= err_bytes;
 #endif
-	mlx5_rx_err_handle(rxq, 1, pkts_n);
+	mlx5_rx_err_handle(rxq, 1, pkts_n, &skip_cnt);
 	return n;
 }
 
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:30.351277669 +0000
+++ 0053-net-mlx5-ignore-non-critical-syndromes-for-Rx-queue.patch	2023-02-23 09:36:28.318171634 +0000
@@ -1 +1 @@
-From aa67ed3084588e6ca12e9709a6cab021f0ffeba7 Mon Sep 17 00:00:00 2001
+From aad5672767479652695f199cdb26dcdae7e5f5e6 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit aa67ed3084588e6ca12e9709a6cab021f0ffeba7 ]
+
@@ -14 +15,0 @@
-Cc: stable@dpdk.org
@@ -19,2 +20,2 @@
- drivers/net/mlx5/mlx5_rx.c       | 123 ++++++++++++++++++++++++-------
- drivers/net/mlx5/mlx5_rx.h       |   5 +-
+ drivers/net/mlx5/mlx5_rxtx.c     | 123 ++++++++++++++++++++++++-------
+ drivers/net/mlx5/mlx5_rxtx.h     |   5 +-
@@ -24,5 +25,5 @@
-diff --git a/drivers/net/mlx5/mlx5_rx.c b/drivers/net/mlx5/mlx5_rx.c
-index 7612d15f01..99a08ef5f1 100644
---- a/drivers/net/mlx5/mlx5_rx.c
-+++ b/drivers/net/mlx5/mlx5_rx.c
-@@ -39,7 +39,8 @@ rxq_cq_to_pkt_type(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe,
+diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
+index 1422961d62..f7c8b8c076 100644
+--- a/drivers/net/mlx5/mlx5_rxtx.c
++++ b/drivers/net/mlx5/mlx5_rxtx.c
+@@ -86,7 +86,8 @@ rxq_cq_to_pkt_type(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe,
@@ -38,2 +39,2 @@
-@@ -408,10 +409,14 @@ mlx5_rxq_initialize(struct mlx5_rxq_data *rxq)
- 	*rxq->rq_db = rte_cpu_to_be_32(rxq->rq_ci);
+@@ -983,10 +984,14 @@ mlx5_queue_state_modify(struct rte_eth_dev *dev,
+ 	return ret;
@@ -54 +55 @@
-@@ -429,10 +434,14 @@ mlx5_rxq_initialize(struct mlx5_rxq_data *rxq)
+@@ -1004,10 +1009,14 @@ mlx5_queue_state_modify(struct rte_eth_dev *dev,
@@ -71 +72 @@
-@@ -447,14 +456,35 @@ mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec, uint16_t err_n)
+@@ -1022,14 +1031,35 @@ mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec, uint16_t err_n)
@@ -108 +109 @@
-@@ -546,6 +576,7 @@ mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec, uint16_t err_n)
+@@ -1122,6 +1152,7 @@ mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec, uint16_t err_n)
@@ -116 +117 @@
-@@ -565,19 +596,24 @@ mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec, uint16_t err_n)
+@@ -1141,19 +1172,24 @@ mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec, uint16_t err_n)
@@ -147 +148 @@
-@@ -626,7 +662,6 @@ mlx5_rx_poll_len(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe,
+@@ -1202,7 +1238,6 @@ mlx5_rx_poll_len(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe,
@@ -155 +156 @@
-@@ -634,10 +669,12 @@ mlx5_rx_poll_len(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe,
+@@ -1210,10 +1245,12 @@ mlx5_rx_poll_len(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe,
@@ -172 +173 @@
-@@ -690,8 +727,15 @@ mlx5_rx_poll_len(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe,
+@@ -1266,8 +1303,15 @@ mlx5_rx_poll_len(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe,
@@ -188 +189 @@
-@@ -843,6 +887,7 @@ mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
+@@ -1418,6 +1462,7 @@ mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
@@ -196 +197 @@
-@@ -881,11 +926,24 @@ mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
+@@ -1456,11 +1501,24 @@ mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
@@ -225 +226 @@
-@@ -1095,6 +1153,7 @@ mlx5_rx_burst_mprq(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
+@@ -1684,6 +1742,7 @@ mlx5_rx_burst_mprq(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
@@ -233 +234 @@
-@@ -1107,14 +1166,26 @@ mlx5_rx_burst_mprq(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
+@@ -1696,14 +1755,26 @@ mlx5_rx_burst_mprq(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
@@ -266,5 +267,5 @@
-diff --git a/drivers/net/mlx5/mlx5_rx.h b/drivers/net/mlx5/mlx5_rx.h
-index 4ba53ebc48..6b42e27c89 100644
---- a/drivers/net/mlx5/mlx5_rx.h
-+++ b/drivers/net/mlx5/mlx5_rx.h
-@@ -62,6 +62,7 @@ enum mlx5_rxq_err_state {
+diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h
+index 7fa471a651..b5fe330a71 100644
+--- a/drivers/net/mlx5/mlx5_rxtx.h
++++ b/drivers/net/mlx5/mlx5_rxtx.h
+@@ -91,6 +91,7 @@ enum mlx5_rxq_err_state {
@@ -278,2 +279,2 @@
-@@ -286,8 +287,8 @@ int mlx5_hrxq_modify(struct rte_eth_dev *dev, uint32_t hxrq_idx,
- 
+@@ -427,8 +428,8 @@ void mlx5_set_cksum_table(void);
+ void mlx5_set_swp_types_table(void);
@@ -285,0 +287 @@
+ void mlx5_mprq_buf_free_cb(void *addr, void *opaque);
@@ -288 +289,0 @@
- 			    uint16_t pkts_n);
@@ -290 +291 @@
-index c6be2be763..667475a93e 100644
+index ca0f585863..4a1dc3c3e1 100644
@@ -293 +294 @@
-@@ -51,6 +51,7 @@ rxq_handle_pending_error(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts,
+@@ -50,6 +50,7 @@ rxq_handle_pending_error(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts,
@@ -301 +302 @@
-@@ -74,7 +75,7 @@ rxq_handle_pending_error(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts,
+@@ -73,7 +74,7 @@ rxq_handle_pending_error(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts,

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/i40e: reduce interrupt interval in multi-driver mode' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (51 preceding siblings ...)
  2023-02-23  9:36 ` patch 'net/mlx5: ignore non-critical syndromes for Rx queue' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:36 ` patch 'net/ixgbe: fix firmware version consistency' " luca.boccassi
                   ` (16 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Qiming Yang; +Cc: Qi Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From db41cc1510c34326c1f9b93358c9de76a261f5a3 Mon Sep 17 00:00:00 2001
From: Qiming Yang <qiming.yang@intel.com>
Date: Fri, 16 Dec 2022 03:11:40 +0000
Subject: [PATCH] net/i40e: reduce interrupt interval in multi-driver mode

[ upstream commit d730fd0a9fa98e2600cea53208f60d4d0f2cc301 ]

This patch change the interrupt interval from 8160us to 32us
to improve the performance of multi-driver mode.

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/i40e/i40e_ethdev.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
index 601520ca66..81763b957c 100644
--- a/drivers/net/i40e/i40e_ethdev.h
+++ b/drivers/net/i40e/i40e_ethdev.h
@@ -1560,7 +1560,7 @@ i40e_calc_itr_interval(bool is_pf, bool is_multi_drv)
 	uint16_t interval = 0;
 
 	if (is_multi_drv) {
-		interval = I40E_QUEUE_ITR_INTERVAL_MAX;
+		interval = I40E_QUEUE_ITR_INTERVAL_DEFAULT;
 	} else {
 		if (is_pf)
 			interval = I40E_QUEUE_ITR_INTERVAL_DEFAULT;
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:30.390094432 +0000
+++ 0054-net-i40e-reduce-interrupt-interval-in-multi-driver-m.patch	2023-02-23 09:36:28.318171634 +0000
@@ -1 +1 @@
-From d730fd0a9fa98e2600cea53208f60d4d0f2cc301 Mon Sep 17 00:00:00 2001
+From db41cc1510c34326c1f9b93358c9de76a261f5a3 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit d730fd0a9fa98e2600cea53208f60d4d0f2cc301 ]
+
@@ -9,2 +10,0 @@
-Cc: stable@dpdk.org
-
@@ -18 +18 @@
-index fe943a45ff..7c4cc44a27 100644
+index 601520ca66..81763b957c 100644
@@ -21 +21 @@
-@@ -1497,7 +1497,7 @@ i40e_calc_itr_interval(bool is_pf, bool is_multi_drv)
+@@ -1560,7 +1560,7 @@ i40e_calc_itr_interval(bool is_pf, bool is_multi_drv)

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/ixgbe: fix firmware version consistency' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (52 preceding siblings ...)
  2023-02-23  9:36 ` patch 'net/i40e: reduce interrupt interval in multi-driver mode' " luca.boccassi
@ 2023-02-23  9:36 ` luca.boccassi
  2023-02-23  9:37 ` patch 'net/iavf: add lock for VF commands' " luca.boccassi
                   ` (15 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:36 UTC (permalink / raw)
  To: Shiyang He; +Cc: Morten Brørup, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/060c26e4450a9237b49f8dc75fac282d05bb0e25

Thanks.

Luca Boccassi

---
From 060c26e4450a9237b49f8dc75fac282d05bb0e25 Mon Sep 17 00:00:00 2001
From: Shiyang He <shiyangx.he@intel.com>
Date: Mon, 9 Jan 2023 06:53:09 +0000
Subject: [PATCH] net/ixgbe: fix firmware version consistency
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit b5c4535d5d9a6cf363f548503c2c755be0ab656b ]

This patch follows the code of ixgbe kernel driver so that it keeps the
firmware version obtained by dpdk-ethtool consistent with that obtained
by linux-ethtool.

Fixes: 8b0b56574269 ("net/ixgbe: add firmware version get")

Signed-off-by: Shiyang He <shiyangx.he@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 31 ++++++++++++++++++++-----------
 1 file changed, 20 insertions(+), 11 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index cee7ee33f3..8041749e71 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -3869,23 +3869,32 @@ static int
 ixgbe_fw_version_get(struct rte_eth_dev *dev, char *fw_version, size_t fw_size)
 {
 	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	u16 eeprom_verh, eeprom_verl;
-	u32 etrack_id;
+	struct ixgbe_nvm_version nvm_ver;
 	int ret;
 
-	ixgbe_read_eeprom(hw, 0x2e, &eeprom_verh);
-	ixgbe_read_eeprom(hw, 0x2d, &eeprom_verl);
+	ixgbe_get_oem_prod_version(hw, &nvm_ver);
+	if (nvm_ver.oem_valid) {
+		snprintf(fw_version, fw_size, "%x.%x.%x",
+			 nvm_ver.oem_major, nvm_ver.oem_minor,
+			 nvm_ver.oem_release);
+		return 0;
+	}
 
-	etrack_id = (eeprom_verh << 16) | eeprom_verl;
-	ret = snprintf(fw_version, fw_size, "0x%08x", etrack_id);
+	ixgbe_get_etk_id(hw, &nvm_ver);
+	ixgbe_get_orom_version(hw, &nvm_ver);
+
+	if (nvm_ver.or_valid) {
+		snprintf(fw_version, fw_size, "0x%08x, %d.%d.%d",
+			 nvm_ver.etk_id, nvm_ver.or_major,
+			 nvm_ver.or_build, nvm_ver.or_patch);
+		return 0;
+	}
+
+	ret = snprintf(fw_version, fw_size, "0x%08x", nvm_ver.etk_id);
 	if (ret < 0)
 		return -EINVAL;
 
-	ret += 1; /* add the size of '\0' */
-	if (fw_size < (size_t)ret)
-		return ret;
-	else
-		return 0;
+	return (fw_size < (size_t)ret++) ? ret : 0;
 }
 
 static int
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:30.427170255 +0000
+++ 0055-net-ixgbe-fix-firmware-version-consistency.patch	2023-02-23 09:36:28.326171781 +0000
@@ -1 +1 @@
-From b5c4535d5d9a6cf363f548503c2c755be0ab656b Mon Sep 17 00:00:00 2001
+From 060c26e4450a9237b49f8dc75fac282d05bb0e25 Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit b5c4535d5d9a6cf363f548503c2c755be0ab656b ]
+
@@ -14 +15,0 @@
-Cc: stable@dpdk.org
@@ -19 +19,0 @@
- .mailmap                         |  1 +
@@ -21 +21 @@
- 2 files changed, 21 insertions(+), 11 deletions(-)
+ 1 file changed, 20 insertions(+), 11 deletions(-)
@@ -23,12 +22,0 @@
-diff --git a/.mailmap b/.mailmap
-index b797fec215..cb9bd28bd3 100644
---- a/.mailmap
-+++ b/.mailmap
-@@ -1217,6 +1217,7 @@ Shiqi Liu <835703180@qq.com>
- Shiri Kuzin <shirik@nvidia.com> <shirik@mellanox.com>
- Shivanshu Shukla <shivanshu.shukla@intel.com>
- Shiweixian <shiweixian@huawei.com>
-+Shiyang He <shiyangx.he@intel.com>
- Shlomi Gridish <sgridish@marvell.com>
- Shougang Wang <shougangx.wang@intel.com>
- Shraddha Joshi <jshraddha@vmware.com>
@@ -36 +24 @@
-index 3f8da11bd1..88118bc305 100644
+index cee7ee33f3..8041749e71 100644
@@ -39 +27 @@
-@@ -3853,23 +3853,32 @@ static int
+@@ -3869,23 +3869,32 @@ static int

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/iavf: add lock for VF commands' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (53 preceding siblings ...)
  2023-02-23  9:36 ` patch 'net/ixgbe: fix firmware version consistency' " luca.boccassi
@ 2023-02-23  9:37 ` luca.boccassi
  2023-02-23  9:37 ` patch 'net/i40e: fix validation of flow transfer attribute' " luca.boccassi
                   ` (14 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:37 UTC (permalink / raw)
  To: Mike Pattrick; +Cc: Qi Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From a44e4276ba85ff1f146ee7e50710d0102087dc69 Mon Sep 17 00:00:00 2001
From: Mike Pattrick <mkp@redhat.com>
Date: Wed, 28 Dec 2022 18:00:25 -0500
Subject: [PATCH] net/iavf: add lock for VF commands

[ upstream commit 91bf37d250aacfc9512a33ce9ec6d4783766804e ]

iavf admin queue commands aren't thread-safe. Bugs surrounding this
issue can manifest in a variety of ways but frequently pend_cmd is
over written. Simultaneously executing commands can result in a
misconfigured device or DPDK sleeping in a thread for 2 second.

Despite this limitation, vf commands may be executed from both
iavf_dev_alarm_handler() in a control thread and the applications main
thread. This is trivial to simulate in the testpmd application by
creating a bond of vf's in active backup mode, and then turning the
bond off and then on again repeatedly.

Previously [1] was proposed as a potential solution, but this commit did
not resolve all potential issues concerning the admin queue and has been
reverted from the stable branch. I propose adding locks until a more
complete solution is available.

[1] commit cb5c1b91f76f ("net/iavf: add thread for event callbacks")

Fixes: 48de41ca11f0 ("net/avf: enable link status update")
Fixes: 84108425054a ("net/iavf: support asynchronous virtual channel message")

Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/iavf/iavf.h       |  1 +
 drivers/net/iavf/iavf_vchnl.c | 72 ++++++++++++++++++++++-------------
 2 files changed, 46 insertions(+), 27 deletions(-)

diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h
index 41d9856358..f0408c2b40 100644
--- a/drivers/net/iavf/iavf.h
+++ b/drivers/net/iavf/iavf.h
@@ -160,6 +160,7 @@ struct iavf_info {
 	struct iavf_qv_map *qv_map; /* queue vector mapping */
 	struct iavf_flow_list flow_list;
 	rte_spinlock_t flow_ops_lock;
+	rte_spinlock_t aq_lock;
 	struct iavf_parser_list rss_parser_list;
 	struct iavf_parser_list dist_parser_list;
 
diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c
index 77f10a90c7..4c6efaac3a 100644
--- a/drivers/net/iavf/iavf_vchnl.c
+++ b/drivers/net/iavf/iavf_vchnl.c
@@ -387,6 +387,20 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args)
 	return err;
 }
 
+static int
+iavf_execute_vf_cmd_safe(struct iavf_adapter *adapter,
+	struct iavf_cmd_info *args)
+{
+	struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter);
+	int ret;
+
+	rte_spinlock_lock(&vf->aq_lock);
+	ret = iavf_execute_vf_cmd(adapter, args);
+	rte_spinlock_unlock(&vf->aq_lock);
+
+	return ret;
+}
+
 static void
 iavf_handle_pf_event_msg(struct rte_eth_dev *dev, uint8_t *msg,
 			uint16_t msglen)
@@ -504,7 +518,7 @@ iavf_enable_vlan_strip(struct iavf_adapter *adapter)
 	args.in_args_size = 0;
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
-	ret = iavf_execute_vf_cmd(adapter, &args);
+	ret = iavf_execute_vf_cmd_safe(adapter, &args);
 	if (ret)
 		PMD_DRV_LOG(ERR, "Failed to execute command of"
 			    " OP_ENABLE_VLAN_STRIPPING");
@@ -525,7 +539,7 @@ iavf_disable_vlan_strip(struct iavf_adapter *adapter)
 	args.in_args_size = 0;
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
-	ret = iavf_execute_vf_cmd(adapter, &args);
+	ret = iavf_execute_vf_cmd_safe(adapter, &args);
 	if (ret)
 		PMD_DRV_LOG(ERR, "Failed to execute command of"
 			    " OP_DISABLE_VLAN_STRIPPING");
@@ -554,7 +568,7 @@ iavf_check_api_version(struct iavf_adapter *adapter)
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
 
-	err = iavf_execute_vf_cmd(adapter, &args);
+	err = iavf_execute_vf_cmd_safe(adapter, &args);
 	if (err) {
 		PMD_INIT_LOG(ERR, "Fail to execute command of OP_VERSION");
 		return err;
@@ -609,7 +623,7 @@ iavf_get_vf_resource(struct iavf_adapter *adapter)
 	args.in_args = (uint8_t *)&caps;
 	args.in_args_size = sizeof(caps);
 
-	err = iavf_execute_vf_cmd(adapter, &args);
+	err = iavf_execute_vf_cmd_safe(adapter, &args);
 
 	if (err) {
 		PMD_DRV_LOG(ERR,
@@ -654,7 +668,7 @@ iavf_get_supported_rxdid(struct iavf_adapter *adapter)
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
 
-	ret = iavf_execute_vf_cmd(adapter, &args);
+	ret = iavf_execute_vf_cmd_safe(adapter, &args);
 	if (ret) {
 		PMD_DRV_LOG(ERR,
 			    "Failed to execute command of OP_GET_SUPPORTED_RXDIDS");
@@ -686,7 +700,7 @@ iavf_enable_queues(struct iavf_adapter *adapter)
 	args.in_args_size = sizeof(queue_select);
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
-	err = iavf_execute_vf_cmd(adapter, &args);
+	err = iavf_execute_vf_cmd_safe(adapter, &args);
 	if (err) {
 		PMD_DRV_LOG(ERR,
 			    "Failed to execute command of OP_ENABLE_QUEUES");
@@ -714,7 +728,7 @@ iavf_disable_queues(struct iavf_adapter *adapter)
 	args.in_args_size = sizeof(queue_select);
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
-	err = iavf_execute_vf_cmd(adapter, &args);
+	err = iavf_execute_vf_cmd_safe(adapter, &args);
 	if (err) {
 		PMD_DRV_LOG(ERR,
 			    "Failed to execute command of OP_DISABLE_QUEUES");
@@ -747,7 +761,7 @@ iavf_switch_queue(struct iavf_adapter *adapter, uint16_t qid,
 	args.in_args_size = sizeof(queue_select);
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
-	err = iavf_execute_vf_cmd(adapter, &args);
+	err = iavf_execute_vf_cmd_safe(adapter, &args);
 	if (err)
 		PMD_DRV_LOG(ERR, "Failed to execute command of %s",
 			    on ? "OP_ENABLE_QUEUES" : "OP_DISABLE_QUEUES");
@@ -789,7 +803,7 @@ iavf_enable_queues_lv(struct iavf_adapter *adapter)
 	args.in_args_size = len;
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
-	err = iavf_execute_vf_cmd(adapter, &args);
+	err = iavf_execute_vf_cmd_safe(adapter, &args);
 	if (err)
 		PMD_DRV_LOG(ERR,
 			    "Failed to execute command of OP_ENABLE_QUEUES_V2");
@@ -833,7 +847,7 @@ iavf_disable_queues_lv(struct iavf_adapter *adapter)
 	args.in_args_size = len;
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
-	err = iavf_execute_vf_cmd(adapter, &args);
+	err = iavf_execute_vf_cmd_safe(adapter, &args);
 	if (err)
 		PMD_DRV_LOG(ERR,
 			    "Failed to execute command of OP_DISABLE_QUEUES_V2");
@@ -879,7 +893,7 @@ iavf_switch_queue_lv(struct iavf_adapter *adapter, uint16_t qid,
 	args.in_args_size = len;
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
-	err = iavf_execute_vf_cmd(adapter, &args);
+	err = iavf_execute_vf_cmd_safe(adapter, &args);
 	if (err)
 		PMD_DRV_LOG(ERR, "Failed to execute command of %s",
 			    on ? "OP_ENABLE_QUEUES_V2" : "OP_DISABLE_QUEUES_V2");
@@ -911,7 +925,7 @@ iavf_configure_rss_lut(struct iavf_adapter *adapter)
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
 
-	err = iavf_execute_vf_cmd(adapter, &args);
+	err = iavf_execute_vf_cmd_safe(adapter, &args);
 	if (err)
 		PMD_DRV_LOG(ERR,
 			    "Failed to execute command of OP_CONFIG_RSS_LUT");
@@ -943,7 +957,7 @@ iavf_configure_rss_key(struct iavf_adapter *adapter)
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
 
-	err = iavf_execute_vf_cmd(adapter, &args);
+	err = iavf_execute_vf_cmd_safe(adapter, &args);
 	if (err)
 		PMD_DRV_LOG(ERR,
 			    "Failed to execute command of OP_CONFIG_RSS_KEY");
@@ -1035,7 +1049,7 @@ iavf_configure_queues(struct iavf_adapter *adapter,
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
 
-	err = iavf_execute_vf_cmd(adapter, &args);
+	err = iavf_execute_vf_cmd_safe(adapter, &args);
 	if (err)
 		PMD_DRV_LOG(ERR, "Failed to execute command of"
 			    " VIRTCHNL_OP_CONFIG_VSI_QUEUES");
@@ -1076,7 +1090,7 @@ iavf_config_irq_map(struct iavf_adapter *adapter)
 	args.in_args_size = len;
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
-	err = iavf_execute_vf_cmd(adapter, &args);
+	err = iavf_execute_vf_cmd_safe(adapter, &args);
 	if (err)
 		PMD_DRV_LOG(ERR, "fail to execute command OP_CONFIG_IRQ_MAP");
 
@@ -1117,7 +1131,7 @@ iavf_config_irq_map_lv(struct iavf_adapter *adapter, uint16_t num,
 	args.in_args_size = len;
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
-	err = iavf_execute_vf_cmd(adapter, &args);
+	err = iavf_execute_vf_cmd_safe(adapter, &args);
 	if (err)
 		PMD_DRV_LOG(ERR, "fail to execute command OP_MAP_QUEUE_VECTOR");
 
@@ -1179,7 +1193,7 @@ iavf_add_del_all_mac_addr(struct iavf_adapter *adapter, bool add)
 		args.in_args_size = len;
 		args.out_buffer = vf->aq_resp;
 		args.out_size = IAVF_AQ_BUF_SZ;
-		err = iavf_execute_vf_cmd(adapter, &args);
+		err = iavf_execute_vf_cmd_safe(adapter, &args);
 		if (err)
 			PMD_DRV_LOG(ERR, "fail to execute command %s",
 				    add ? "OP_ADD_ETHER_ADDRESS" :
@@ -1206,7 +1220,7 @@ iavf_query_stats(struct iavf_adapter *adapter,
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
 
-	err = iavf_execute_vf_cmd(adapter, &args);
+	err = iavf_execute_vf_cmd_safe(adapter, &args);
 	if (err) {
 		PMD_DRV_LOG(ERR, "fail to execute command OP_GET_STATS");
 		*pstats = NULL;
@@ -1241,7 +1255,7 @@ iavf_config_promisc(struct iavf_adapter *adapter,
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
 
-	err = iavf_execute_vf_cmd(adapter, &args);
+	err = iavf_execute_vf_cmd_safe(adapter, &args);
 
 	if (err) {
 		PMD_DRV_LOG(ERR,
@@ -1281,7 +1295,7 @@ iavf_add_del_eth_addr(struct iavf_adapter *adapter, struct rte_ether_addr *addr,
 	args.in_args_size = sizeof(cmd_buffer);
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
-	err = iavf_execute_vf_cmd(adapter, &args);
+	err = iavf_execute_vf_cmd_safe(adapter, &args);
 	if (err)
 		PMD_DRV_LOG(ERR, "fail to execute command %s",
 			    add ? "OP_ADD_ETH_ADDR" :  "OP_DEL_ETH_ADDR");
@@ -1308,7 +1322,7 @@ iavf_add_del_vlan(struct iavf_adapter *adapter, uint16_t vlanid, bool add)
 	args.in_args_size = sizeof(cmd_buffer);
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
-	err = iavf_execute_vf_cmd(adapter, &args);
+	err = iavf_execute_vf_cmd_safe(adapter, &args);
 	if (err)
 		PMD_DRV_LOG(ERR, "fail to execute command %s",
 			    add ? "OP_ADD_VLAN" :  "OP_DEL_VLAN");
@@ -1335,7 +1349,7 @@ iavf_fdir_add(struct iavf_adapter *adapter,
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
 
-	err = iavf_execute_vf_cmd(adapter, &args);
+	err = iavf_execute_vf_cmd_safe(adapter, &args);
 	if (err) {
 		PMD_DRV_LOG(ERR, "fail to execute command OP_ADD_FDIR_FILTER");
 		return err;
@@ -1395,7 +1409,7 @@ iavf_fdir_del(struct iavf_adapter *adapter,
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
 
-	err = iavf_execute_vf_cmd(adapter, &args);
+	err = iavf_execute_vf_cmd_safe(adapter, &args);
 	if (err) {
 		PMD_DRV_LOG(ERR, "fail to execute command OP_DEL_FDIR_FILTER");
 		return err;
@@ -1442,7 +1456,7 @@ iavf_fdir_check(struct iavf_adapter *adapter,
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
 
-	err = iavf_execute_vf_cmd(adapter, &args);
+	err = iavf_execute_vf_cmd_safe(adapter, &args);
 	if (err) {
 		PMD_DRV_LOG(ERR, "fail to check flow director rule");
 		return err;
@@ -1483,7 +1497,7 @@ iavf_add_del_rss_cfg(struct iavf_adapter *adapter,
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
 
-	err = iavf_execute_vf_cmd(adapter, &args);
+	err = iavf_execute_vf_cmd_safe(adapter, &args);
 	if (err)
 		PMD_DRV_LOG(ERR,
 			    "Failed to execute command of %s",
@@ -1536,7 +1550,7 @@ iavf_add_del_mc_addr_list(struct iavf_adapter *adapter,
 		i * sizeof(struct virtchnl_ether_addr);
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
-	err = iavf_execute_vf_cmd(adapter, &args);
+	err = iavf_execute_vf_cmd_safe(adapter, &args);
 
 	if (err) {
 		PMD_DRV_LOG(ERR, "fail to execute command %s",
@@ -1580,10 +1594,14 @@ iavf_request_queues(struct rte_eth_dev *dev, uint16_t num)
 	/*
 	 * disable interrupt to avoid the admin queue message to be read
 	 * before iavf_read_msg_from_pf.
+	 *
+	 * don't disable interrupt handler until ready to execute vf cmd.
 	 */
+	rte_spinlock_lock(&vf->aq_lock);
 	rte_intr_disable(&pci_dev->intr_handle);
 	err = iavf_execute_vf_cmd(adapter, &args);
 	rte_intr_enable(&pci_dev->intr_handle);
+	rte_spinlock_unlock(&vf->aq_lock);
 	if (err) {
 		PMD_DRV_LOG(ERR, "fail to execute command OP_REQUEST_QUEUES");
 		return err;
@@ -1618,7 +1636,7 @@ iavf_get_max_rss_queue_region(struct iavf_adapter *adapter)
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
 
-	err = iavf_execute_vf_cmd(adapter, &args);
+	err = iavf_execute_vf_cmd_safe(adapter, &args);
 	if (err) {
 		PMD_DRV_LOG(ERR, "Failed to execute command of VIRTCHNL_OP_GET_MAX_RSS_QREGION");
 		return err;
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:30.470745817 +0000
+++ 0056-net-iavf-add-lock-for-VF-commands.patch	2023-02-23 09:36:28.326171781 +0000
@@ -1 +1 @@
-From 91bf37d250aacfc9512a33ce9ec6d4783766804e Mon Sep 17 00:00:00 2001
+From a44e4276ba85ff1f146ee7e50710d0102087dc69 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 91bf37d250aacfc9512a33ce9ec6d4783766804e ]
+
@@ -26 +27,0 @@
-Cc: stable@dpdk.org
@@ -31,3 +32,3 @@
- drivers/net/iavf/iavf.h       |   1 +
- drivers/net/iavf/iavf_vchnl.c | 106 ++++++++++++++++++++--------------
- 2 files changed, 63 insertions(+), 44 deletions(-)
+ drivers/net/iavf/iavf.h       |  1 +
+ drivers/net/iavf/iavf_vchnl.c | 72 ++++++++++++++++++++++-------------
+ 2 files changed, 46 insertions(+), 27 deletions(-)
@@ -36 +37 @@
-index 1edebab8dc..aa18650ffa 100644
+index 41d9856358..f0408c2b40 100644
@@ -39 +40 @@
-@@ -262,6 +262,7 @@ struct iavf_info {
+@@ -160,6 +160,7 @@ struct iavf_info {
@@ -46 +47 @@
- 	struct iavf_parser_list ipsec_crypto_parser_list;
+ 
@@ -48 +49 @@
-index f92daf97f2..9adaadb173 100644
+index 77f10a90c7..4c6efaac3a 100644
@@ -51 +52 @@
-@@ -397,6 +397,20 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args,
+@@ -387,6 +387,20 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args)
@@ -57 +58 @@
-+	struct iavf_cmd_info *args, int async)
++	struct iavf_cmd_info *args)
@@ -63 +64 @@
-+	ret = iavf_execute_vf_cmd(adapter, args, async);
++	ret = iavf_execute_vf_cmd(adapter, args);
@@ -72 +73 @@
-@@ -554,7 +568,7 @@ iavf_enable_vlan_strip(struct iavf_adapter *adapter)
+@@ -504,7 +518,7 @@ iavf_enable_vlan_strip(struct iavf_adapter *adapter)
@@ -76,2 +77,2 @@
--	ret = iavf_execute_vf_cmd(adapter, &args, 0);
-+	ret = iavf_execute_vf_cmd_safe(adapter, &args, 0);
+-	ret = iavf_execute_vf_cmd(adapter, &args);
++	ret = iavf_execute_vf_cmd_safe(adapter, &args);
@@ -81 +82 @@
-@@ -575,7 +589,7 @@ iavf_disable_vlan_strip(struct iavf_adapter *adapter)
+@@ -525,7 +539,7 @@ iavf_disable_vlan_strip(struct iavf_adapter *adapter)
@@ -85,2 +86,2 @@
--	ret = iavf_execute_vf_cmd(adapter, &args, 0);
-+	ret = iavf_execute_vf_cmd_safe(adapter, &args, 0);
+-	ret = iavf_execute_vf_cmd(adapter, &args);
++	ret = iavf_execute_vf_cmd_safe(adapter, &args);
@@ -90 +91 @@
-@@ -604,7 +618,7 @@ iavf_check_api_version(struct iavf_adapter *adapter)
+@@ -554,7 +568,7 @@ iavf_check_api_version(struct iavf_adapter *adapter)
@@ -94,2 +95,2 @@
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
+-	err = iavf_execute_vf_cmd(adapter, &args);
++	err = iavf_execute_vf_cmd_safe(adapter, &args);
@@ -99 +100 @@
-@@ -665,7 +679,7 @@ iavf_get_vf_resource(struct iavf_adapter *adapter)
+@@ -609,7 +623,7 @@ iavf_get_vf_resource(struct iavf_adapter *adapter)
@@ -103,2 +104,2 @@
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
+-	err = iavf_execute_vf_cmd(adapter, &args);
++	err = iavf_execute_vf_cmd_safe(adapter, &args);
@@ -108 +109 @@
-@@ -710,7 +724,7 @@ iavf_get_supported_rxdid(struct iavf_adapter *adapter)
+@@ -654,7 +668,7 @@ iavf_get_supported_rxdid(struct iavf_adapter *adapter)
@@ -112,2 +113,2 @@
--	ret = iavf_execute_vf_cmd(adapter, &args, 0);
-+	ret = iavf_execute_vf_cmd_safe(adapter, &args, 0);
+-	ret = iavf_execute_vf_cmd(adapter, &args);
++	ret = iavf_execute_vf_cmd_safe(adapter, &args);
@@ -117,37 +118 @@
-@@ -754,7 +768,7 @@ iavf_config_vlan_strip_v2(struct iavf_adapter *adapter, bool enable)
- 	args.in_args_size = sizeof(vlan_strip);
- 	args.out_buffer = vf->aq_resp;
- 	args.out_size = IAVF_AQ_BUF_SZ;
--	ret = iavf_execute_vf_cmd(adapter, &args, 0);
-+	ret = iavf_execute_vf_cmd_safe(adapter, &args, 0);
- 	if (ret)
- 		PMD_DRV_LOG(ERR, "fail to execute command %s",
- 			    enable ? "VIRTCHNL_OP_ENABLE_VLAN_STRIPPING_V2" :
-@@ -794,7 +808,7 @@ iavf_config_vlan_insert_v2(struct iavf_adapter *adapter, bool enable)
- 	args.in_args_size = sizeof(vlan_insert);
- 	args.out_buffer = vf->aq_resp;
- 	args.out_size = IAVF_AQ_BUF_SZ;
--	ret = iavf_execute_vf_cmd(adapter, &args, 0);
-+	ret = iavf_execute_vf_cmd_safe(adapter, &args, 0);
- 	if (ret)
- 		PMD_DRV_LOG(ERR, "fail to execute command %s",
- 			    enable ? "VIRTCHNL_OP_ENABLE_VLAN_INSERTION_V2" :
-@@ -837,7 +851,7 @@ iavf_add_del_vlan_v2(struct iavf_adapter *adapter, uint16_t vlanid, bool add)
- 	args.in_args_size = sizeof(vlan_filter);
- 	args.out_buffer = vf->aq_resp;
- 	args.out_size = IAVF_AQ_BUF_SZ;
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
- 	if (err)
- 		PMD_DRV_LOG(ERR, "fail to execute command %s",
- 			    add ? "OP_ADD_VLAN_V2" :  "OP_DEL_VLAN_V2");
-@@ -858,7 +872,7 @@ iavf_get_vlan_offload_caps_v2(struct iavf_adapter *adapter)
- 	args.out_buffer = vf->aq_resp;
- 	args.out_size = IAVF_AQ_BUF_SZ;
- 
--	ret = iavf_execute_vf_cmd(adapter, &args, 0);
-+	ret = iavf_execute_vf_cmd_safe(adapter, &args, 0);
- 	if (ret) {
- 		PMD_DRV_LOG(ERR,
- 			    "Failed to execute command of VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS");
-@@ -889,7 +903,7 @@ iavf_enable_queues(struct iavf_adapter *adapter)
+@@ -686,7 +700,7 @@ iavf_enable_queues(struct iavf_adapter *adapter)
@@ -157,2 +122,2 @@
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
+-	err = iavf_execute_vf_cmd(adapter, &args);
++	err = iavf_execute_vf_cmd_safe(adapter, &args);
@@ -162 +127 @@
-@@ -917,7 +931,7 @@ iavf_disable_queues(struct iavf_adapter *adapter)
+@@ -714,7 +728,7 @@ iavf_disable_queues(struct iavf_adapter *adapter)
@@ -166,2 +131,2 @@
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
+-	err = iavf_execute_vf_cmd(adapter, &args);
++	err = iavf_execute_vf_cmd_safe(adapter, &args);
@@ -171 +136 @@
-@@ -953,7 +967,7 @@ iavf_switch_queue(struct iavf_adapter *adapter, uint16_t qid,
+@@ -747,7 +761,7 @@ iavf_switch_queue(struct iavf_adapter *adapter, uint16_t qid,
@@ -175,2 +140,2 @@
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
+-	err = iavf_execute_vf_cmd(adapter, &args);
++	err = iavf_execute_vf_cmd_safe(adapter, &args);
@@ -180 +145 @@
-@@ -995,7 +1009,7 @@ iavf_enable_queues_lv(struct iavf_adapter *adapter)
+@@ -789,7 +803,7 @@ iavf_enable_queues_lv(struct iavf_adapter *adapter)
@@ -184,2 +149,2 @@
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
+-	err = iavf_execute_vf_cmd(adapter, &args);
++	err = iavf_execute_vf_cmd_safe(adapter, &args);
@@ -189 +154 @@
-@@ -1039,7 +1053,7 @@ iavf_disable_queues_lv(struct iavf_adapter *adapter)
+@@ -833,7 +847,7 @@ iavf_disable_queues_lv(struct iavf_adapter *adapter)
@@ -193,2 +158,2 @@
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
+-	err = iavf_execute_vf_cmd(adapter, &args);
++	err = iavf_execute_vf_cmd_safe(adapter, &args);
@@ -198 +163 @@
-@@ -1085,7 +1099,7 @@ iavf_switch_queue_lv(struct iavf_adapter *adapter, uint16_t qid,
+@@ -879,7 +893,7 @@ iavf_switch_queue_lv(struct iavf_adapter *adapter, uint16_t qid,
@@ -202,2 +167,2 @@
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
+-	err = iavf_execute_vf_cmd(adapter, &args);
++	err = iavf_execute_vf_cmd_safe(adapter, &args);
@@ -207 +172 @@
-@@ -1117,7 +1131,7 @@ iavf_configure_rss_lut(struct iavf_adapter *adapter)
+@@ -911,7 +925,7 @@ iavf_configure_rss_lut(struct iavf_adapter *adapter)
@@ -211,2 +176,2 @@
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
+-	err = iavf_execute_vf_cmd(adapter, &args);
++	err = iavf_execute_vf_cmd_safe(adapter, &args);
@@ -216 +181 @@
-@@ -1149,7 +1163,7 @@ iavf_configure_rss_key(struct iavf_adapter *adapter)
+@@ -943,7 +957,7 @@ iavf_configure_rss_key(struct iavf_adapter *adapter)
@@ -220,2 +185,2 @@
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
+-	err = iavf_execute_vf_cmd(adapter, &args);
++	err = iavf_execute_vf_cmd_safe(adapter, &args);
@@ -225 +190 @@
-@@ -1247,7 +1261,7 @@ iavf_configure_queues(struct iavf_adapter *adapter,
+@@ -1035,7 +1049,7 @@ iavf_configure_queues(struct iavf_adapter *adapter,
@@ -229,2 +194,2 @@
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
+-	err = iavf_execute_vf_cmd(adapter, &args);
++	err = iavf_execute_vf_cmd_safe(adapter, &args);
@@ -234 +199 @@
-@@ -1288,7 +1302,7 @@ iavf_config_irq_map(struct iavf_adapter *adapter)
+@@ -1076,7 +1090,7 @@ iavf_config_irq_map(struct iavf_adapter *adapter)
@@ -238,2 +203,2 @@
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
+-	err = iavf_execute_vf_cmd(adapter, &args);
++	err = iavf_execute_vf_cmd_safe(adapter, &args);
@@ -243 +208 @@
-@@ -1329,7 +1343,7 @@ iavf_config_irq_map_lv(struct iavf_adapter *adapter, uint16_t num,
+@@ -1117,7 +1131,7 @@ iavf_config_irq_map_lv(struct iavf_adapter *adapter, uint16_t num,
@@ -247,2 +212,2 @@
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
+-	err = iavf_execute_vf_cmd(adapter, &args);
++	err = iavf_execute_vf_cmd_safe(adapter, &args);
@@ -252 +217 @@
-@@ -1389,7 +1403,7 @@ iavf_add_del_all_mac_addr(struct iavf_adapter *adapter, bool add)
+@@ -1179,7 +1193,7 @@ iavf_add_del_all_mac_addr(struct iavf_adapter *adapter, bool add)
@@ -256,2 +221,2 @@
--		err = iavf_execute_vf_cmd(adapter, &args, 0);
-+		err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
+-		err = iavf_execute_vf_cmd(adapter, &args);
++		err = iavf_execute_vf_cmd_safe(adapter, &args);
@@ -261 +226 @@
-@@ -1419,7 +1433,7 @@ iavf_query_stats(struct iavf_adapter *adapter,
+@@ -1206,7 +1220,7 @@ iavf_query_stats(struct iavf_adapter *adapter,
@@ -265,2 +230,2 @@
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
+-	err = iavf_execute_vf_cmd(adapter, &args);
++	err = iavf_execute_vf_cmd_safe(adapter, &args);
@@ -270 +235 @@
-@@ -1457,7 +1471,7 @@ iavf_config_promisc(struct iavf_adapter *adapter,
+@@ -1241,7 +1255,7 @@ iavf_config_promisc(struct iavf_adapter *adapter,
@@ -274,2 +239,2 @@
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
+-	err = iavf_execute_vf_cmd(adapter, &args);
++	err = iavf_execute_vf_cmd_safe(adapter, &args);
@@ -279 +244 @@
-@@ -1500,7 +1514,7 @@ iavf_add_del_eth_addr(struct iavf_adapter *adapter, struct rte_ether_addr *addr,
+@@ -1281,7 +1295,7 @@ iavf_add_del_eth_addr(struct iavf_adapter *adapter, struct rte_ether_addr *addr,
@@ -283,2 +248,2 @@
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
+-	err = iavf_execute_vf_cmd(adapter, &args);
++	err = iavf_execute_vf_cmd_safe(adapter, &args);
@@ -288 +253 @@
-@@ -1527,7 +1541,7 @@ iavf_add_del_vlan(struct iavf_adapter *adapter, uint16_t vlanid, bool add)
+@@ -1308,7 +1322,7 @@ iavf_add_del_vlan(struct iavf_adapter *adapter, uint16_t vlanid, bool add)
@@ -292,2 +257,2 @@
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
+-	err = iavf_execute_vf_cmd(adapter, &args);
++	err = iavf_execute_vf_cmd_safe(adapter, &args);
@@ -297 +262 @@
-@@ -1554,7 +1568,7 @@ iavf_fdir_add(struct iavf_adapter *adapter,
+@@ -1335,7 +1349,7 @@ iavf_fdir_add(struct iavf_adapter *adapter,
@@ -301,2 +266,2 @@
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
+-	err = iavf_execute_vf_cmd(adapter, &args);
++	err = iavf_execute_vf_cmd_safe(adapter, &args);
@@ -306 +271 @@
-@@ -1614,7 +1628,7 @@ iavf_fdir_del(struct iavf_adapter *adapter,
+@@ -1395,7 +1409,7 @@ iavf_fdir_del(struct iavf_adapter *adapter,
@@ -310,2 +275,2 @@
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
+-	err = iavf_execute_vf_cmd(adapter, &args);
++	err = iavf_execute_vf_cmd_safe(adapter, &args);
@@ -315 +280 @@
-@@ -1661,7 +1675,7 @@ iavf_fdir_check(struct iavf_adapter *adapter,
+@@ -1442,7 +1456,7 @@ iavf_fdir_check(struct iavf_adapter *adapter,
@@ -319,2 +284,2 @@
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
+-	err = iavf_execute_vf_cmd(adapter, &args);
++	err = iavf_execute_vf_cmd_safe(adapter, &args);
@@ -324,28 +289 @@
-@@ -1704,7 +1718,7 @@ iavf_flow_sub(struct iavf_adapter *adapter, struct iavf_fsub_conf *filter)
- 	args.out_buffer = vf->aq_resp;
- 	args.out_size = IAVF_AQ_BUF_SZ;
- 
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
- 	if (err) {
- 		PMD_DRV_LOG(ERR, "Failed to execute command of "
- 				 "OP_FLOW_SUBSCRIBE");
-@@ -1755,7 +1769,7 @@ iavf_flow_unsub(struct iavf_adapter *adapter, struct iavf_fsub_conf *filter)
- 	args.out_buffer = vf->aq_resp;
- 	args.out_size = IAVF_AQ_BUF_SZ;
- 
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
- 	if (err) {
- 		PMD_DRV_LOG(ERR, "Failed to execute command of "
- 				 "OP_FLOW_UNSUBSCRIBE");
-@@ -1798,7 +1812,7 @@ iavf_flow_sub_check(struct iavf_adapter *adapter,
- 	args.out_buffer = vf->aq_resp;
- 	args.out_size = IAVF_AQ_BUF_SZ;
- 
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
- 	if (err) {
- 		PMD_DRV_LOG(ERR, "Failed to check flow subscription rule");
- 		return err;
-@@ -1838,7 +1852,7 @@ iavf_add_del_rss_cfg(struct iavf_adapter *adapter,
+@@ -1483,7 +1497,7 @@ iavf_add_del_rss_cfg(struct iavf_adapter *adapter,
@@ -355,2 +293,2 @@
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
+-	err = iavf_execute_vf_cmd(adapter, &args);
++	err = iavf_execute_vf_cmd_safe(adapter, &args);
@@ -360,46 +298 @@
-@@ -1861,7 +1875,7 @@ iavf_get_hena_caps(struct iavf_adapter *adapter, uint64_t *caps)
- 	args.out_buffer = vf->aq_resp;
- 	args.out_size = IAVF_AQ_BUF_SZ;
- 
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
- 	if (err) {
- 		PMD_DRV_LOG(ERR,
- 			    "Failed to execute command of OP_GET_RSS_HENA_CAPS");
-@@ -1887,7 +1901,7 @@ iavf_set_hena(struct iavf_adapter *adapter, uint64_t hena)
- 	args.out_buffer = vf->aq_resp;
- 	args.out_size = IAVF_AQ_BUF_SZ;
- 
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
- 	if (err)
- 		PMD_DRV_LOG(ERR,
- 			    "Failed to execute command of OP_SET_RSS_HENA");
-@@ -1908,7 +1922,7 @@ iavf_get_qos_cap(struct iavf_adapter *adapter)
- 	args.in_args_size = 0;
- 	args.out_buffer = vf->aq_resp;
- 	args.out_size = IAVF_AQ_BUF_SZ;
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
- 
- 	if (err) {
- 		PMD_DRV_LOG(ERR,
-@@ -1941,7 +1955,7 @@ int iavf_set_q_tc_map(struct rte_eth_dev *dev,
- 	args.out_buffer = vf->aq_resp;
- 	args.out_size = IAVF_AQ_BUF_SZ;
- 
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
- 	if (err)
- 		PMD_DRV_LOG(ERR, "Failed to execute command of"
- 			    " VIRTCHNL_OP_CONFIG_TC_MAP");
-@@ -1964,7 +1978,7 @@ int iavf_set_q_bw(struct rte_eth_dev *dev,
- 	args.out_buffer = vf->aq_resp;
- 	args.out_size = IAVF_AQ_BUF_SZ;
- 
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
- 	if (err)
- 		PMD_DRV_LOG(ERR, "Failed to execute command of"
- 			    " VIRTCHNL_OP_CONFIG_QUEUE_BW");
-@@ -2009,7 +2023,7 @@ iavf_add_del_mc_addr_list(struct iavf_adapter *adapter,
+@@ -1536,7 +1550,7 @@ iavf_add_del_mc_addr_list(struct iavf_adapter *adapter,
@@ -409,2 +302,2 @@
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
+-	err = iavf_execute_vf_cmd(adapter, &args);
++	err = iavf_execute_vf_cmd_safe(adapter, &args);
@@ -414,25 +307,12 @@
-@@ -2053,13 +2067,17 @@ iavf_request_queues(struct rte_eth_dev *dev, uint16_t num)
- 	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_WB_ON_ITR) {
- 		/* disable interrupt to avoid the admin queue message to be read
- 		 * before iavf_read_msg_from_pf.
-+		 *
-+		 * don't disable interrupt handler until ready to execute vf cmd.
- 		 */
-+		rte_spinlock_lock(&vf->aq_lock);
- 		rte_intr_disable(pci_dev->intr_handle);
- 		err = iavf_execute_vf_cmd(adapter, &args, 0);
- 		rte_intr_enable(pci_dev->intr_handle);
-+		rte_spinlock_unlock(&vf->aq_lock);
- 	} else {
- 		rte_eal_alarm_cancel(iavf_dev_alarm_handler, dev);
--		err = iavf_execute_vf_cmd(adapter, &args, 0);
-+		err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
- 		rte_eal_alarm_set(IAVF_ALARM_INTERVAL,
- 				  iavf_dev_alarm_handler, dev);
- 	}
-@@ -2098,7 +2116,7 @@ iavf_get_max_rss_queue_region(struct iavf_adapter *adapter)
- 	args.out_buffer = vf->aq_resp;
- 	args.out_size = IAVF_AQ_BUF_SZ;
- 
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
+@@ -1580,10 +1594,14 @@ iavf_request_queues(struct rte_eth_dev *dev, uint16_t num)
+ 	/*
+ 	 * disable interrupt to avoid the admin queue message to be read
+ 	 * before iavf_read_msg_from_pf.
++	 *
++	 * don't disable interrupt handler until ready to execute vf cmd.
+ 	 */
++	rte_spinlock_lock(&vf->aq_lock);
+ 	rte_intr_disable(&pci_dev->intr_handle);
+ 	err = iavf_execute_vf_cmd(adapter, &args);
+ 	rte_intr_enable(&pci_dev->intr_handle);
++	rte_spinlock_unlock(&vf->aq_lock);
@@ -440 +320 @@
- 		PMD_DRV_LOG(ERR, "Failed to execute command of VIRTCHNL_OP_GET_MAX_RSS_QREGION");
+ 		PMD_DRV_LOG(ERR, "fail to execute command OP_REQUEST_QUEUES");
@@ -442,10 +322 @@
-@@ -2129,7 +2147,7 @@ iavf_ipsec_crypto_request(struct iavf_adapter *adapter,
- 	args.out_buffer = vf->aq_resp;
- 	args.out_size = IAVF_AQ_BUF_SZ;
- 
--	err = iavf_execute_vf_cmd(adapter, &args, 1);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 1);
- 	if (err) {
- 		PMD_DRV_LOG(ERR, "fail to execute command %s",
- 				"OP_INLINE_IPSEC_CRYPTO");
-@@ -2163,7 +2181,7 @@ iavf_set_vf_quanta_size(struct iavf_adapter *adapter, u16 start_queue_id, u16 nu
+@@ -1618,7 +1636,7 @@ iavf_get_max_rss_queue_region(struct iavf_adapter *adapter)
@@ -455,2 +326,2 @@
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
+-	err = iavf_execute_vf_cmd(adapter, &args);
++	err = iavf_execute_vf_cmd_safe(adapter, &args);
@@ -458 +329 @@
- 		PMD_DRV_LOG(ERR, "Failed to execute command VIRTCHNL_OP_CONFIG_QUANTA");
+ 		PMD_DRV_LOG(ERR, "Failed to execute command of VIRTCHNL_OP_GET_MAX_RSS_QREGION");
@@ -460,18 +330,0 @@
-@@ -2189,7 +2207,7 @@ iavf_get_ptp_cap(struct iavf_adapter *adapter)
- 	args.out_buffer = vf->aq_resp;
- 	args.out_size = IAVF_AQ_BUF_SZ;
- 
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
- 	if (err) {
- 		PMD_DRV_LOG(ERR,
- 			    "Failed to execute command of OP_1588_PTP_GET_CAPS");
-@@ -2217,7 +2235,7 @@ iavf_get_phc_time(struct iavf_rx_queue *rxq)
- 	args.out_size = IAVF_AQ_BUF_SZ;
- 
- 	rte_spinlock_lock(&vf->phc_time_aq_lock);
--	err = iavf_execute_vf_cmd(adapter, &args, 0);
-+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
- 	if (err) {
- 		PMD_DRV_LOG(ERR,
- 			    "Failed to execute command of VIRTCHNL_OP_1588_PTP_GET_TIME");

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/i40e: fix validation of flow transfer attribute' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (54 preceding siblings ...)
  2023-02-23  9:37 ` patch 'net/iavf: add lock for VF commands' " luca.boccassi
@ 2023-02-23  9:37 ` luca.boccassi
  2023-02-23  9:37 ` patch 'net/ice: " luca.boccassi
                   ` (13 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:37 UTC (permalink / raw)
  To: Steve Yang; +Cc: Qi Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From ce654f6ae188f0e0133002040aad61f1eb66c155 Mon Sep 17 00:00:00 2001
From: Steve Yang <stevex.yang@intel.com>
Date: Mon, 26 Dec 2022 00:37:14 +0000
Subject: [PATCH] net/i40e: fix validation of flow transfer attribute

[ upstream commit 74d20de6101f60d3d2b345abcd4ab5bfd2b6076a ]

i40e doesn't support transfer attribute of flow rule,
ignore it when validating rule attributes.

Fixes: 86eb05d6350b ("net/i40e: add flow validate function")

Signed-off-by: Steve Yang <stevex.yang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/i40e/i40e_flow.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index b41a1fd3ca..5f519d7403 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -1991,6 +1991,14 @@ i40e_flow_parse_attr(const struct rte_flow_attr *attr,
 		return -rte_errno;
 	}
 
+	/* Not supported */
+	if (attr->transfer) {
+		rte_flow_error_set(error, EINVAL,
+				   RTE_FLOW_ERROR_TYPE_ATTR_TRANSFER,
+				   attr, "Not support transfer.");
+		return -rte_errno;
+	}
+
 	/* Not supported */
 	if (attr->priority) {
 		rte_flow_error_set(error, EINVAL,
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:30.508800761 +0000
+++ 0057-net-i40e-fix-validation-of-flow-transfer-attribute.patch	2023-02-23 09:36:28.334171928 +0000
@@ -1 +1 @@
-From 74d20de6101f60d3d2b345abcd4ab5bfd2b6076a Mon Sep 17 00:00:00 2001
+From ce654f6ae188f0e0133002040aad61f1eb66c155 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 74d20de6101f60d3d2b345abcd4ab5bfd2b6076a ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
-index 3c550733f2..877e49151e 100644
+index b41a1fd3ca..5f519d7403 100644
@@ -22 +23 @@
-@@ -1236,6 +1236,14 @@ i40e_flow_parse_attr(const struct rte_flow_attr *attr,
+@@ -1991,6 +1991,14 @@ i40e_flow_parse_attr(const struct rte_flow_attr *attr,

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/ice: fix validation of flow transfer attribute' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (55 preceding siblings ...)
  2023-02-23  9:37 ` patch 'net/i40e: fix validation of flow transfer attribute' " luca.boccassi
@ 2023-02-23  9:37 ` luca.boccassi
  2023-02-23  9:37 ` patch 'net/iavf: protect insertion in flow list' " luca.boccassi
                   ` (12 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:37 UTC (permalink / raw)
  To: Steve Yang; +Cc: Qi Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/020d47beeb1fa34a15525d019176b0532cd978ab

Thanks.

Luca Boccassi

---
From 020d47beeb1fa34a15525d019176b0532cd978ab Mon Sep 17 00:00:00 2001
From: Steve Yang <stevex.yang@intel.com>
Date: Mon, 26 Dec 2022 00:37:15 +0000
Subject: [PATCH] net/ice: fix validation of flow transfer attribute

[ upstream commit a6153cf2c3b98bfd4035dc3ad304b5d75a56940b ]

ice doesn't support transfer attribute of flow rule,
ignore it when validating rule attributes.

Fixes: d76116a4678f ("net/ice: add generic flow API")

Signed-off-by: Steve Yang <stevex.yang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ice/ice_generic_flow.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/ice/ice_generic_flow.c b/drivers/net/ice/ice_generic_flow.c
index 311fd7d162..4ed093bcae 100644
--- a/drivers/net/ice/ice_generic_flow.c
+++ b/drivers/net/ice/ice_generic_flow.c
@@ -1946,6 +1946,14 @@ ice_flow_valid_attr(struct ice_adapter *ad,
 		return -rte_errno;
 	}
 
+	/* Not supported */
+	if (attr->transfer) {
+		rte_flow_error_set(error, EINVAL,
+				   RTE_FLOW_ERROR_TYPE_ATTR_TRANSFER,
+				   attr, "Not support transfer.");
+		return -rte_errno;
+	}
+
 	/* Check pipeline mode support to set classification stage */
 	if (ad->devargs.pipe_mode_support) {
 		if (attr->priority == 0)
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:30.548946121 +0000
+++ 0058-net-ice-fix-validation-of-flow-transfer-attribute.patch	2023-02-23 09:36:28.334171928 +0000
@@ -1 +1 @@
-From a6153cf2c3b98bfd4035dc3ad304b5d75a56940b Mon Sep 17 00:00:00 2001
+From 020d47beeb1fa34a15525d019176b0532cd978ab Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a6153cf2c3b98bfd4035dc3ad304b5d75a56940b ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
-index d496c28dec..86a32f8cb1 100644
+index 311fd7d162..4ed093bcae 100644
@@ -22 +23 @@
-@@ -2030,6 +2030,14 @@ ice_flow_valid_attr(struct ice_adapter *ad,
+@@ -1946,6 +1946,14 @@ ice_flow_valid_attr(struct ice_adapter *ad,

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/iavf: protect insertion in flow list' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (56 preceding siblings ...)
  2023-02-23  9:37 ` patch 'net/ice: " luca.boccassi
@ 2023-02-23  9:37 ` luca.boccassi
  2023-02-23  9:37 ` patch 'net/ixgbe: enable IPv6 mask in flow rules' " luca.boccassi
                   ` (11 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:37 UTC (permalink / raw)
  To: David Marchand; +Cc: Qi Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/2f6bcfd34b4ea29d60bc6ab0b57627d21cb2b159

Thanks.

Luca Boccassi

---
From 2f6bcfd34b4ea29d60bc6ab0b57627d21cb2b159 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Thu, 5 Jan 2023 14:57:43 +0100
Subject: [PATCH] net/iavf: protect insertion in flow list

[ upstream commit d79c3b264e31465695bc4c6279381522060a22f6 ]

Add missing lock acquire.

Fixes: ff2d0c345c3b ("net/iavf: support generic flow API")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/iavf/iavf_generic_flow.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/iavf/iavf_generic_flow.c b/drivers/net/iavf/iavf_generic_flow.c
index 00e7f15c33..0df67befe2 100644
--- a/drivers/net/iavf/iavf_generic_flow.c
+++ b/drivers/net/iavf/iavf_generic_flow.c
@@ -1246,11 +1246,12 @@ iavf_flow_create(struct rte_eth_dev *dev,
 	}
 
 	flow->engine = engine;
+	rte_spinlock_lock(&vf->flow_ops_lock);
 	TAILQ_INSERT_TAIL(&vf->flow_list, flow, node);
+	rte_spinlock_unlock(&vf->flow_ops_lock);
 	PMD_DRV_LOG(INFO, "Succeeded to create (%d) flow", engine->type);
 
 free_flow:
-	rte_spinlock_unlock(&vf->flow_ops_lock);
 	return flow;
 }
 
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:30.588094200 +0000
+++ 0059-net-iavf-protect-insertion-in-flow-list.patch	2023-02-23 09:36:28.334171928 +0000
@@ -1 +1 @@
-From d79c3b264e31465695bc4c6279381522060a22f6 Mon Sep 17 00:00:00 2001
+From 2f6bcfd34b4ea29d60bc6ab0b57627d21cb2b159 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit d79c3b264e31465695bc4c6279381522060a22f6 ]
+
@@ -9 +10,0 @@
-Cc: stable@dpdk.org
@@ -18 +19 @@
-index f33c764764..6f6e95fc45 100644
+index 00e7f15c33..0df67befe2 100644
@@ -21 +22 @@
-@@ -2278,11 +2278,12 @@ iavf_flow_create(struct rte_eth_dev *dev,
+@@ -1246,11 +1246,12 @@ iavf_flow_create(struct rte_eth_dev *dev,

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/ixgbe: enable IPv6 mask in flow rules' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (57 preceding siblings ...)
  2023-02-23  9:37 ` patch 'net/iavf: protect insertion in flow list' " luca.boccassi
@ 2023-02-23  9:37 ` luca.boccassi
  2023-02-23  9:37 ` patch 'app/compress-perf: fix some typos' " luca.boccassi
                   ` (10 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:37 UTC (permalink / raw)
  To: Kaiwen Deng; +Cc: Yuan Peng, Qiming Yang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/9f6828a85b045d0e341867c4b591c66d95955ace

Thanks.

Luca Boccassi

---
From 9f6828a85b045d0e341867c4b591c66d95955ace Mon Sep 17 00:00:00 2001
From: Kaiwen Deng <kaiwenx.deng@intel.com>
Date: Sat, 28 Jan 2023 15:15:19 +0800
Subject: [PATCH] net/ixgbe: enable IPv6 mask in flow rules

[ upstream commit cba954b7bedaa7d0baea1ddc39fd0199015f583c ]

Add IPv6 addr mask and L4 mask support for rte_flow APIs.

IPv6 flow rules do not take effect in ixgbe when set
IPv6 addr mask and L4 mask to default value as 0xFF.

Set IPv6 addr mask and L4 mask as 0 to enable fields
can fix this issue.

Fixes: 11777435c727 ("net/ixgbe: parse flow director filter")

Signed-off-by: Kaiwen Deng <kaiwenx.deng@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
---
 drivers/net/ixgbe/ixgbe_flow.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c
index d444d8588c..6d75ff73ef 100644
--- a/drivers/net/ixgbe/ixgbe_flow.c
+++ b/drivers/net/ixgbe/ixgbe_flow.c
@@ -1645,6 +1645,10 @@ ixgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev,
 	memset(&rule->mask, 0xFF, sizeof(struct ixgbe_hw_fdir_mask));
 	rule->mask.vlan_tci_mask = 0;
 	rule->mask.flex_bytes_mask = 0;
+	rule->mask.dst_port_mask = 0;
+	rule->mask.src_port_mask = 0;
+	rule->mask.src_ipv6_mask = 0;
+	rule->mask.dst_ipv6_mask = 0;
 
 	/**
 	 * The first not void item should be
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:30.624733674 +0000
+++ 0060-net-ixgbe-enable-IPv6-mask-in-flow-rules.patch	2023-02-23 09:36:28.338172002 +0000
@@ -1 +1 @@
-From cba954b7bedaa7d0baea1ddc39fd0199015f583c Mon Sep 17 00:00:00 2001
+From 9f6828a85b045d0e341867c4b591c66d95955ace Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit cba954b7bedaa7d0baea1ddc39fd0199015f583c ]
+
@@ -15 +16,0 @@
-Cc: stable@dpdk.org
@@ -25 +26 @@
-index fe710b7900..79c84044af 100644
+index d444d8588c..6d75ff73ef 100644

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'app/compress-perf: fix some typos' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (58 preceding siblings ...)
  2023-02-23  9:37 ` patch 'net/ixgbe: enable IPv6 mask in flow rules' " luca.boccassi
@ 2023-02-23  9:37 ` luca.boccassi
  2023-02-23  9:37 ` patch 'app/compress-perf: fix testing single operation' " luca.boccassi
                   ` (9 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:37 UTC (permalink / raw)
  To: Michael Baum; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/7320677147b3dd998c13838ff4b751afa491fbbb

Thanks.

Luca Boccassi

---
From 7320677147b3dd998c13838ff4b751afa491fbbb Mon Sep 17 00:00:00 2001
From: Michael Baum <michaelba@nvidia.com>
Date: Tue, 14 Feb 2023 19:40:27 +0200
Subject: [PATCH] app/compress-perf: fix some typos

[ upstream commit 1643fc9b077ebb55b13a2c4469b75c251499acdc ]

Fix some typos in comments and prints in this app.

Fixes: e0b6287c035d ("app/compress-perf: add parser")
Fixes: 2695db95a147 ("test/compress: add cycle-count mode to perf tool")
Fixes: 971d89f5116b ("app/compress-perf: prevent output buffer overflow")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
---
 app/test-compress-perf/comp_perf_options_parse.c   | 4 ++--
 app/test-compress-perf/comp_perf_test_cyclecount.c | 2 +-
 app/test-compress-perf/comp_perf_test_verify.c     | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/app/test-compress-perf/comp_perf_options_parse.c b/app/test-compress-perf/comp_perf_options_parse.c
index 019eddb7bd..9b9d4e6554 100644
--- a/app/test-compress-perf/comp_perf_options_parse.c
+++ b/app/test-compress-perf/comp_perf_options_parse.c
@@ -491,7 +491,7 @@ parse_huffman_enc(struct comp_test_data *test_data, const char *arg)
 	int id = get_str_key_id_mapping(huffman_namemap,
 			RTE_DIM(huffman_namemap), arg);
 	if (id < 0) {
-		RTE_LOG(ERR, USER1, "Invalid Huffmane encoding specified\n");
+		RTE_LOG(ERR, USER1, "Invalid Huffman encoding specified\n");
 		return -1;
 	}
 
@@ -507,7 +507,7 @@ parse_level(struct comp_test_data *test_data, const char *arg)
 
 	/*
 	 * Try parsing the argument as a range, if it fails,
-	 * arse it as a list
+	 * parse it as a list
 	 */
 	if (parse_range(arg, &test_data->level_lst.min,
 			&test_data->level_lst.max,
diff --git a/app/test-compress-perf/comp_perf_test_cyclecount.c b/app/test-compress-perf/comp_perf_test_cyclecount.c
index 4a6e7aa094..ea62fcf52e 100644
--- a/app/test-compress-perf/comp_perf_test_cyclecount.c
+++ b/app/test-compress-perf/comp_perf_test_cyclecount.c
@@ -558,7 +558,7 @@ cperf_cyclecount_test_runner(void *test_ctx)
 		"    [D-e] - decompression enqueue\n"
 		"    [D-d] - decompression dequeue\n"
 		"  - Cycles section: number of cycles per 'op' for the following operations:\n"
-		"    setup/op - memory allocation, op configuration and memory dealocation\n"
+		"    setup/op - memory allocation, op configuration and memory deallocation\n"
 		"    [C-e] - compression enqueue\n"
 		"    [C-d] - compression dequeue\n"
 		"    [D-e] - decompression enqueue\n"
diff --git a/app/test-compress-perf/comp_perf_test_verify.c b/app/test-compress-perf/comp_perf_test_verify.c
index d0dfa41b4b..98704a9548 100644
--- a/app/test-compress-perf/comp_perf_test_verify.c
+++ b/app/test-compress-perf/comp_perf_test_verify.c
@@ -224,7 +224,7 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
 				  op->status ==
 				  RTE_COMP_OP_STATUS_OUT_OF_SPACE_RECOVERABLE) {
 					RTE_LOG(ERR, USER1,
-"Out of space error occurred due to uncompressible input data expanding to larger than destination buffer. Increase the EXPANSE_RATIO constant to use this data.\n");
+"Out of space error occurred due to incompressible input data expanding to larger than destination buffer. Increase the EXPANSE_RATIO constant to use this data.\n");
 					res = -1;
 					goto end;
 				} else if (op->status !=
@@ -309,7 +309,7 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
 				  op->status ==
 				  RTE_COMP_OP_STATUS_OUT_OF_SPACE_RECOVERABLE) {
 					RTE_LOG(ERR, USER1,
-"Out of space error occurred due to uncompressible input data expanding to larger than destination buffer. Increase the EXPANSE_RATIO constant to use this data.\n");
+"Out of space error occurred due to incompressible input data expanding to larger than destination buffer. Increase the EXPANSE_RATIO constant to use this data.\n");
 					res = -1;
 					goto end;
 				} else if (op->status !=
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:30.667331522 +0000
+++ 0061-app-compress-perf-fix-some-typos.patch	2023-02-23 09:36:28.338172002 +0000
@@ -1 +1 @@
-From 1643fc9b077ebb55b13a2c4469b75c251499acdc Mon Sep 17 00:00:00 2001
+From 7320677147b3dd998c13838ff4b751afa491fbbb Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 1643fc9b077ebb55b13a2c4469b75c251499acdc ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -43 +44 @@
-index 7473cb6277..ce457fefbb 100644
+index 4a6e7aa094..ea62fcf52e 100644
@@ -46 +47 @@
-@@ -563,7 +563,7 @@ cperf_cyclecount_test_runner(void *test_ctx)
+@@ -558,7 +558,7 @@ cperf_cyclecount_test_runner(void *test_ctx)
@@ -56 +57 @@
-index 8964442891..6b61a9194f 100644
+index d0dfa41b4b..98704a9548 100644
@@ -59 +60 @@
-@@ -226,7 +226,7 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
+@@ -224,7 +224,7 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
@@ -68 +69 @@
-@@ -311,7 +311,7 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
+@@ -309,7 +309,7 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'app/compress-perf: fix testing single operation' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (59 preceding siblings ...)
  2023-02-23  9:37 ` patch 'app/compress-perf: fix some typos' " luca.boccassi
@ 2023-02-23  9:37 ` luca.boccassi
  2023-02-23  9:37 ` patch 'net/bnxt: fix link state change interrupt config' " luca.boccassi
                   ` (8 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:37 UTC (permalink / raw)
  To: Michael Baum; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/3cc7c9875b09be70696cd0f5c00ed8c540bb8c44

Thanks.

Luca Boccassi

---
From 3cc7c9875b09be70696cd0f5c00ed8c540bb8c44 Mon Sep 17 00:00:00 2001
From: Michael Baum <michaelba@nvidia.com>
Date: Tue, 14 Feb 2023 19:40:28 +0200
Subject: [PATCH] app/compress-perf: fix testing single operation

[ upstream commit 83cc3b90ad7a63868a43a67d6aa13b55068fbe0c ]

Part of the application options is to test only compress and only
decompress but actually the application ignores this user option and
tries to test always both compress and decompress.

Allow testing only compress and only decompress.

Fixes: e0b6287c035d ("app/compress-perf: add parser")

Signed-off-by: Matan Azrad <matan@nvidia.com>
Signed-off-by: Michael Baum <michaelba@nvidia.com>
---
 app/test-compress-perf/comp_perf_options.h    |   6 +-
 .../comp_perf_options_parse.c                 |   4 +-
 .../comp_perf_test_common.c                   | 126 +++++++++++++-----
 .../comp_perf_test_cyclecount.c               |  69 ++++++----
 .../comp_perf_test_throughput.c               |  66 +++++----
 .../comp_perf_test_verify.c                   |  58 +++++---
 app/test-compress-perf/main.c                 |   8 ++
 7 files changed, 223 insertions(+), 114 deletions(-)

diff --git a/app/test-compress-perf/comp_perf_options.h b/app/test-compress-perf/comp_perf_options.h
index 0b777521c5..cfb00bd1ad 100644
--- a/app/test-compress-perf/comp_perf_options.h
+++ b/app/test-compress-perf/comp_perf_options.h
@@ -30,9 +30,9 @@ enum cperf_test_type {
 };
 
 enum comp_operation {
-	COMPRESS_ONLY,
-	DECOMPRESS_ONLY,
-	COMPRESS_DECOMPRESS
+	COMPRESS = (1 << 0),
+	DECOMPRESS = (1 << 1),
+	COMPRESS_DECOMPRESS = (COMPRESS | DECOMPRESS),
 };
 
 struct range_list {
diff --git a/app/test-compress-perf/comp_perf_options_parse.c b/app/test-compress-perf/comp_perf_options_parse.c
index 9b9d4e6554..303e714cda 100644
--- a/app/test-compress-perf/comp_perf_options_parse.c
+++ b/app/test-compress-perf/comp_perf_options_parse.c
@@ -446,11 +446,11 @@ parse_op_type(struct comp_test_data *test_data, const char *arg)
 	struct name_id_map optype_namemap[] = {
 		{
 			"comp",
-			COMPRESS_ONLY
+			COMPRESS
 		},
 		{
 			"decomp",
-			DECOMPRESS_ONLY
+			DECOMPRESS
 		},
 		{
 			"comp_and_decomp",
diff --git a/app/test-compress-perf/comp_perf_test_common.c b/app/test-compress-perf/comp_perf_test_common.c
index b402a0d839..cd60958944 100644
--- a/app/test-compress-perf/comp_perf_test_common.c
+++ b/app/test-compress-perf/comp_perf_test_common.c
@@ -227,23 +227,43 @@ comp_perf_allocate_memory(struct comp_test_data *test_data,
 {
 	uint16_t comp_mbuf_size;
 	uint16_t decomp_mbuf_size;
+	size_t comp_data_size;
+	size_t decomp_data_size;
+	size_t output_data_sz;
 
 	test_data->out_seg_sz = find_buf_size(test_data->seg_sz);
 
-	/* Number of segments for input and output
-	 * (compression and decompression)
-	 */
-	test_data->total_segs = DIV_CEIL(test_data->input_data_sz,
-			test_data->seg_sz);
+	if (test_data->test_op & COMPRESS) {
+		/*
+		 * Number of segments for input and output
+		 * (compression and decompression)
+		 */
+		test_data->total_segs = DIV_CEIL(test_data->input_data_sz,
+						 test_data->seg_sz);
+	} else {
+		/*
+		 * When application does decompression only, input data is
+		 * compressed and smaller than the output. The expected size of
+		 * uncompressed data given by the user in segment size argument.
+		 */
+		test_data->total_segs = test_data->max_sgl_segs;
+	}
+
+	output_data_sz = (size_t) test_data->out_seg_sz * test_data->total_segs;
+	output_data_sz =
+		RTE_MAX(output_data_sz, (size_t) MIN_COMPRESSED_BUF_SIZE);
 
 	if (test_data->use_external_mbufs != 0) {
 		if (comp_perf_allocate_external_mbufs(test_data, mem) < 0)
 			return -1;
 		comp_mbuf_size = 0;
 		decomp_mbuf_size = 0;
-	} else {
+	} else if (test_data->test_op & COMPRESS) {
 		comp_mbuf_size = test_data->out_seg_sz + RTE_PKTMBUF_HEADROOM;
 		decomp_mbuf_size = test_data->seg_sz + RTE_PKTMBUF_HEADROOM;
+	} else {
+		comp_mbuf_size = test_data->seg_sz + RTE_PKTMBUF_HEADROOM;
+		decomp_mbuf_size = test_data->out_seg_sz + RTE_PKTMBUF_HEADROOM;
 	}
 
 	char pool_name[32] = "";
@@ -287,26 +307,28 @@ comp_perf_allocate_memory(struct comp_test_data *test_data,
 		return -1;
 	}
 
-	/*
-	 * Compressed data might be a bit larger than input data,
-	 * if data cannot be compressed
-	 */
-	mem->compressed_data = rte_zmalloc_socket(NULL,
-				RTE_MAX(
-				    (size_t) test_data->out_seg_sz *
-							  test_data->total_segs,
-				    (size_t) MIN_COMPRESSED_BUF_SIZE),
-				0,
-				rte_socket_id());
+	if (test_data->test_op & COMPRESS) {
+		/*
+		 * Compressed data might be a bit larger than input data,
+		 * if data cannot be compressed
+		 */
+		comp_data_size = output_data_sz;
+		decomp_data_size = test_data->input_data_sz;
+	} else {
+		comp_data_size = test_data->input_data_sz;
+		decomp_data_size = output_data_sz;
+	}
+
+	mem->compressed_data = rte_zmalloc_socket(NULL, comp_data_size, 0,
+						  rte_socket_id());
 	if (mem->compressed_data == NULL) {
 		RTE_LOG(ERR, USER1, "Memory to hold the data from the input "
 				"file could not be allocated\n");
 		return -1;
 	}
 
-	mem->decompressed_data = rte_zmalloc_socket(NULL,
-				test_data->input_data_sz, 0,
-				rte_socket_id());
+	mem->decompressed_data = rte_zmalloc_socket(NULL, decomp_data_size, 0,
+						    rte_socket_id());
 	if (mem->decompressed_data == NULL) {
 		RTE_LOG(ERR, USER1, "Memory to hold the data from the input "
 				"file could not be allocated\n");
@@ -351,6 +373,7 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)
 	uint16_t segs_per_mbuf = 0;
 	uint32_t cmz = 0;
 	uint32_t dmz = 0;
+	bool decompress_only = !!(test_data->test_op == DECOMPRESS);
 
 	for (i = 0; i < mem->total_bufs; i++) {
 		/* Allocate data in input mbuf and copy data from input file */
@@ -361,8 +384,6 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)
 			return -1;
 		}
 
-		data_sz = RTE_MIN(remaining_data, test_data->seg_sz);
-
 		if (test_data->use_external_mbufs != 0) {
 			rte_pktmbuf_attach_extbuf(mem->decomp_bufs[i],
 					mem->decomp_memzones[dmz]->addr,
@@ -372,16 +393,23 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)
 			dmz++;
 		}
 
+		if (!decompress_only)
+			data_sz = RTE_MIN(remaining_data, test_data->seg_sz);
+		else
+			data_sz = test_data->out_seg_sz;
+
 		data_addr = (uint8_t *) rte_pktmbuf_append(
 					mem->decomp_bufs[i], data_sz);
 		if (data_addr == NULL) {
 			RTE_LOG(ERR, USER1, "Could not append data\n");
 			return -1;
 		}
-		rte_memcpy(data_addr, input_data_ptr, data_sz);
 
-		input_data_ptr += data_sz;
-		remaining_data -= data_sz;
+		if (!decompress_only) {
+			rte_memcpy(data_addr, input_data_ptr, data_sz);
+			input_data_ptr += data_sz;
+			remaining_data -= data_sz;
+		}
 
 		/* Already one segment in the mbuf */
 		segs_per_mbuf = 1;
@@ -398,8 +426,6 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)
 				return -1;
 			}
 
-			data_sz = RTE_MIN(remaining_data, test_data->seg_sz);
-
 			if (test_data->use_external_mbufs != 0) {
 				rte_pktmbuf_attach_extbuf(
 					next_seg,
@@ -410,6 +436,12 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)
 				dmz++;
 			}
 
+			if (!decompress_only)
+				data_sz = RTE_MIN(remaining_data,
+						  test_data->seg_sz);
+			else
+				data_sz = test_data->out_seg_sz;
+
 			data_addr = (uint8_t *)rte_pktmbuf_append(next_seg,
 				data_sz);
 
@@ -418,9 +450,11 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)
 				return -1;
 			}
 
-			rte_memcpy(data_addr, input_data_ptr, data_sz);
-			input_data_ptr += data_sz;
-			remaining_data -= data_sz;
+			if (!decompress_only) {
+				rte_memcpy(data_addr, input_data_ptr, data_sz);
+				input_data_ptr += data_sz;
+				remaining_data -= data_sz;
+			}
 
 			if (rte_pktmbuf_chain(mem->decomp_bufs[i],
 					next_seg) < 0) {
@@ -447,16 +481,26 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)
 			cmz++;
 		}
 
-		data_addr = (uint8_t *) rte_pktmbuf_append(
-					mem->comp_bufs[i],
-					test_data->out_seg_sz);
+		if (decompress_only)
+			data_sz = RTE_MIN(remaining_data, test_data->seg_sz);
+		else
+			data_sz = test_data->out_seg_sz;
+
+		data_addr = (uint8_t *) rte_pktmbuf_append(mem->comp_bufs[i],
+							   data_sz);
 		if (data_addr == NULL) {
 			RTE_LOG(ERR, USER1, "Could not append data\n");
 			return -1;
 		}
 
+		if (decompress_only) {
+			rte_memcpy(data_addr, input_data_ptr, data_sz);
+			input_data_ptr += data_sz;
+			remaining_data -= data_sz;
+		}
+
 		/* Chain mbufs if needed for output mbufs */
-		for (j = 1; j < segs_per_mbuf; j++) {
+		for (j = 1; j < segs_per_mbuf && remaining_data > 0; j++) {
 			struct rte_mbuf *next_seg =
 				rte_pktmbuf_alloc(mem->comp_buf_pool);
 
@@ -476,13 +520,25 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)
 				cmz++;
 			}
 
+			if (decompress_only)
+				data_sz = RTE_MIN(remaining_data,
+						  test_data->seg_sz);
+			else
+				data_sz = test_data->out_seg_sz;
+
 			data_addr = (uint8_t *)rte_pktmbuf_append(next_seg,
-				test_data->out_seg_sz);
+								  data_sz);
 			if (data_addr == NULL) {
 				RTE_LOG(ERR, USER1, "Could not append data\n");
 				return -1;
 			}
 
+			if (decompress_only) {
+				rte_memcpy(data_addr, input_data_ptr, data_sz);
+				input_data_ptr += data_sz;
+				remaining_data -= data_sz;
+			}
+
 			if (rte_pktmbuf_chain(mem->comp_bufs[i],
 					next_seg) < 0) {
 				RTE_LOG(ERR, USER1, "Could not chain mbufs\n");
diff --git a/app/test-compress-perf/comp_perf_test_cyclecount.c b/app/test-compress-perf/comp_perf_test_cyclecount.c
index ea62fcf52e..8474e59f17 100644
--- a/app/test-compress-perf/comp_perf_test_cyclecount.c
+++ b/app/test-compress-perf/comp_perf_test_cyclecount.c
@@ -510,38 +510,55 @@ cperf_cyclecount_test_runner(void *test_ctx)
 	if (cperf_verify_test_runner(&ctx->ver))
 		return EXIT_FAILURE;
 
-	/*
-	 * Run the tests twice, discarding the first performance
-	 * results, before the cache is warmed up
-	 */
+	if (test_data->test_op & COMPRESS) {
+		/*
+		 * Run the test twice, discarding the first performance
+		 * results, before the cache is warmed up
+		 */
+		for (i = 0; i < 2; i++) {
+			if (main_loop(ctx, RTE_COMP_COMPRESS) < 0)
+				return EXIT_FAILURE;
+		}
 
-	/* C O M P R E S S */
-	for (i = 0; i < 2; i++) {
-		if (main_loop(ctx, RTE_COMP_COMPRESS) < 0)
-			return EXIT_FAILURE;
-	}
-
-	ops_enq_retries_comp = ctx->ops_enq_retries;
-	ops_deq_retries_comp = ctx->ops_deq_retries;
+		ops_enq_retries_comp = ctx->ops_enq_retries;
+		ops_deq_retries_comp = ctx->ops_deq_retries;
 
-	duration_enq_per_op_comp = ctx->duration_enq /
-			(ctx->ver.mem.total_bufs * test_data->num_iter);
-	duration_deq_per_op_comp = ctx->duration_deq /
-			(ctx->ver.mem.total_bufs * test_data->num_iter);
+		duration_enq_per_op_comp = ctx->duration_enq /
+				(ctx->ver.mem.total_bufs * test_data->num_iter);
+		duration_deq_per_op_comp = ctx->duration_deq /
+				(ctx->ver.mem.total_bufs * test_data->num_iter);
+	} else {
+		ops_enq_retries_comp = 0;
+		ops_deq_retries_comp = 0;
 
-	/* D E C O M P R E S S */
-	for (i = 0; i < 2; i++) {
-		if (main_loop(ctx, RTE_COMP_DECOMPRESS) < 0)
-			return EXIT_FAILURE;
+		duration_enq_per_op_comp = 0;
+		duration_deq_per_op_comp = 0;
 	}
 
-	ops_enq_retries_decomp = ctx->ops_enq_retries;
-	ops_deq_retries_decomp = ctx->ops_deq_retries;
+	if (test_data->test_op & DECOMPRESS) {
+		/*
+		 * Run the test twice, discarding the first performance
+		 * results, before the cache is warmed up
+		 */
+		for (i = 0; i < 2; i++) {
+			if (main_loop(ctx, RTE_COMP_DECOMPRESS) < 0)
+				return EXIT_FAILURE;
+		}
+
+		ops_enq_retries_decomp = ctx->ops_enq_retries;
+		ops_deq_retries_decomp = ctx->ops_deq_retries;
 
-	duration_enq_per_op_decomp = ctx->duration_enq /
-			(ctx->ver.mem.total_bufs * test_data->num_iter);
-	duration_deq_per_op_decomp = ctx->duration_deq /
-			(ctx->ver.mem.total_bufs * test_data->num_iter);
+		duration_enq_per_op_decomp = ctx->duration_enq /
+				(ctx->ver.mem.total_bufs * test_data->num_iter);
+		duration_deq_per_op_decomp = ctx->duration_deq /
+				(ctx->ver.mem.total_bufs * test_data->num_iter);
+	} else {
+		ops_enq_retries_decomp = 0;
+		ops_deq_retries_decomp = 0;
+
+		duration_enq_per_op_decomp = 0;
+		duration_deq_per_op_decomp = 0;
+	}
 
 	duration_setup_per_op = ctx->duration_op /
 			(ctx->ver.mem.total_bufs * test_data->num_iter);
diff --git a/app/test-compress-perf/comp_perf_test_throughput.c b/app/test-compress-perf/comp_perf_test_throughput.c
index 7574e33ac7..5ea56e366a 100644
--- a/app/test-compress-perf/comp_perf_test_throughput.c
+++ b/app/test-compress-perf/comp_perf_test_throughput.c
@@ -355,41 +355,53 @@ cperf_throughput_test_runner(void *test_ctx)
 	 * First the verification part is needed
 	 */
 	if (cperf_verify_test_runner(&ctx->ver)) {
-		ret =  EXIT_FAILURE;
+		ret = EXIT_FAILURE;
 		goto end;
 	}
 
-	/*
-	 * Run the tests twice, discarding the first performance
-	 * results, before the cache is warmed up
-	 */
-	for (i = 0; i < 2; i++) {
-		if (main_loop(ctx, RTE_COMP_COMPRESS) < 0) {
-			ret = EXIT_FAILURE;
-			goto end;
+	if (test_data->test_op & COMPRESS) {
+		/*
+		 * Run the test twice, discarding the first performance
+		 * results, before the cache is warmed up
+		 */
+		for (i = 0; i < 2; i++) {
+			if (main_loop(ctx, RTE_COMP_COMPRESS) < 0) {
+				ret = EXIT_FAILURE;
+				goto end;
+			}
 		}
-	}
 
-	for (i = 0; i < 2; i++) {
-		if (main_loop(ctx, RTE_COMP_DECOMPRESS) < 0) {
-			ret = EXIT_FAILURE;
-			goto end;
-		}
-	}
-
-	ctx->comp_tsc_byte =
+		ctx->comp_tsc_byte =
 			(double)(ctx->comp_tsc_duration[test_data->level]) /
-					test_data->input_data_sz;
+						       test_data->input_data_sz;
+		ctx->comp_gbps = rte_get_tsc_hz() / ctx->comp_tsc_byte * 8 /
+								     1000000000;
+	} else {
+		ctx->comp_tsc_byte = 0;
+		ctx->comp_gbps = 0;
+	}
 
-	ctx->decomp_tsc_byte =
+	if (test_data->test_op & DECOMPRESS) {
+		/*
+		 * Run the test twice, discarding the first performance
+		 * results, before the cache is warmed up
+		 */
+		for (i = 0; i < 2; i++) {
+			if (main_loop(ctx, RTE_COMP_DECOMPRESS) < 0) {
+				ret = EXIT_FAILURE;
+				goto end;
+			}
+		}
+
+		ctx->decomp_tsc_byte =
 			(double)(ctx->decomp_tsc_duration[test_data->level]) /
-					test_data->input_data_sz;
-
-	ctx->comp_gbps = rte_get_tsc_hz() / ctx->comp_tsc_byte * 8 /
-			1000000000;
-
-	ctx->decomp_gbps = rte_get_tsc_hz() / ctx->decomp_tsc_byte * 8 /
-			1000000000;
+						       test_data->input_data_sz;
+		ctx->decomp_gbps = rte_get_tsc_hz() / ctx->decomp_tsc_byte * 8 /
+								     1000000000;
+	} else {
+		ctx->decomp_tsc_byte = 0;
+		ctx->decomp_gbps = 0;
+	}
 
 	if (rte_atomic16_test_and_set(&display_once)) {
 		printf("\n%12s%6s%12s%17s%15s%16s\n",
diff --git a/app/test-compress-perf/comp_perf_test_verify.c b/app/test-compress-perf/comp_perf_test_verify.c
index 98704a9548..aaf50657c0 100644
--- a/app/test-compress-perf/comp_perf_test_verify.c
+++ b/app/test-compress-perf/comp_perf_test_verify.c
@@ -112,7 +112,8 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
 		output_data_sz = &ctx->decomp_data_sz;
 		input_bufs = mem->comp_bufs;
 		output_bufs = mem->decomp_bufs;
-		out_seg_sz = test_data->seg_sz;
+		out_seg_sz = (test_data->test_op & COMPRESS) ?
+			     test_data->seg_sz : test_data->out_seg_sz;
 	}
 
 	/* Create private xform */
@@ -395,32 +396,47 @@ cperf_verify_test_runner(void *test_ctx)
 
 	test_data->ratio = 0;
 
-	if (main_loop(ctx, RTE_COMP_COMPRESS) < 0) {
-		ret = EXIT_FAILURE;
-		goto end;
+	if (test_data->test_op & COMPRESS) {
+		if (main_loop(ctx, RTE_COMP_COMPRESS) < 0) {
+			ret = EXIT_FAILURE;
+			goto end;
+		}
 	}
 
-	if (main_loop(ctx, RTE_COMP_DECOMPRESS) < 0) {
-		ret = EXIT_FAILURE;
-		goto end;
-	}
+	if (test_data->test_op & DECOMPRESS) {
+		if (main_loop(ctx, RTE_COMP_DECOMPRESS) < 0) {
+			ret = EXIT_FAILURE;
+			goto end;
+		}
+
+		if (!(test_data->test_op & COMPRESS)) {
+			/*
+			 * For DECOMPRESS_ONLY mode there is no more
+			 * verifications, reset the 'ratio' and 'comp_data_sz'
+			 * fields for other tests report.
+			 */
+			ctx->comp_data_sz = 0;
+			ctx->ratio = 0;
+			goto end;
+		}
 
-	if (ctx->decomp_data_sz != test_data->input_data_sz) {
-		RTE_LOG(ERR, USER1,
-	   "Decompressed data length not equal to input data length\n");
-		RTE_LOG(ERR, USER1,
-			"Decompressed size = %zu, expected = %zu\n",
-			ctx->decomp_data_sz, test_data->input_data_sz);
-		ret = EXIT_FAILURE;
-		goto end;
-	} else {
-		if (memcmp(ctx->mem.decompressed_data,
-				test_data->input_data,
-				test_data->input_data_sz) != 0) {
+		if (ctx->decomp_data_sz != test_data->input_data_sz) {
+			RTE_LOG(ERR, USER1,
+				"Decompressed data length not equal to input data length\n");
 			RTE_LOG(ERR, USER1,
-		    "Decompressed data is not the same as file data\n");
+				"Decompressed size = %zu, expected = %zu\n",
+				ctx->decomp_data_sz, test_data->input_data_sz);
 			ret = EXIT_FAILURE;
 			goto end;
+		} else {
+			if (memcmp(ctx->mem.decompressed_data,
+					test_data->input_data,
+					test_data->input_data_sz) != 0) {
+				RTE_LOG(ERR, USER1,
+					"Decompressed data is not the same as file data\n");
+				ret = EXIT_FAILURE;
+				goto end;
+			}
 		}
 	}
 
diff --git a/app/test-compress-perf/main.c b/app/test-compress-perf/main.c
index ce9e80bedc..832140f814 100644
--- a/app/test-compress-perf/main.c
+++ b/app/test-compress-perf/main.c
@@ -253,6 +253,14 @@ comp_perf_dump_input_data(struct comp_test_data *test_data)
 		goto end;
 	}
 
+	if (!(test_data->test_op & COMPRESS) &&
+	    test_data->input_data_sz >
+	    (size_t) test_data->seg_sz * (size_t) test_data->max_sgl_segs) {
+		RTE_LOG(ERR, USER1,
+			"Size of input must be less than total segments\n");
+		goto end;
+	}
+
 	test_data->input_data = rte_zmalloc_socket(NULL,
 				test_data->input_data_sz, 0, rte_socket_id());
 
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:30.718322882 +0000
+++ 0062-app-compress-perf-fix-testing-single-operation.patch	2023-02-23 09:36:28.342172076 +0000
@@ -1 +1 @@
-From 83cc3b90ad7a63868a43a67d6aa13b55068fbe0c Mon Sep 17 00:00:00 2001
+From 3cc7c9875b09be70696cd0f5c00ed8c540bb8c44 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 83cc3b90ad7a63868a43a67d6aa13b55068fbe0c ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -23 +24 @@
- .../comp_perf_test_verify.c                   |  60 ++++++---
+ .../comp_perf_test_verify.c                   |  58 +++++---
@@ -25 +26 @@
- 7 files changed, 224 insertions(+), 115 deletions(-)
+ 7 files changed, 223 insertions(+), 114 deletions(-)
@@ -28 +29 @@
-index 57dd146330..d00b299247 100644
+index 0b777521c5..cfb00bd1ad 100644
@@ -31 +32 @@
-@@ -32,9 +32,9 @@ enum cperf_test_type {
+@@ -30,9 +30,9 @@ enum cperf_test_type {
@@ -299 +300 @@
-index ce457fefbb..ce6c4d7605 100644
+index ea62fcf52e..8474e59f17 100644
@@ -302 +303 @@
-@@ -514,38 +514,55 @@ cperf_cyclecount_test_runner(void *test_ctx)
+@@ -510,38 +510,55 @@ cperf_cyclecount_test_runner(void *test_ctx)
@@ -385 +386 @@
-index 79cd2b2bf2..c9f8237626 100644
+index 7574e33ac7..5ea56e366a 100644
@@ -388 +389 @@
-@@ -359,41 +359,53 @@ cperf_throughput_test_runner(void *test_ctx)
+@@ -355,41 +355,53 @@ cperf_throughput_test_runner(void *test_ctx)
@@ -467,2 +468,2 @@
- 	exp = 0;
- 	if (__atomic_compare_exchange_n(&display_once, &exp, 1, 0,
+ 	if (rte_atomic16_test_and_set(&display_once)) {
+ 		printf("\n%12s%6s%12s%17s%15s%16s\n",
@@ -470 +471 @@
-index 6b61a9194f..7d6b6abecd 100644
+index 98704a9548..aaf50657c0 100644
@@ -473 +474 @@
-@@ -114,7 +114,8 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
+@@ -112,7 +112,8 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
@@ -483,7 +484 @@
-@@ -392,44 +393,59 @@ cperf_verify_test_runner(void *test_ctx)
- 	int ret = EXIT_SUCCESS;
- 	static uint16_t display_once;
- 	uint32_t lcore = rte_lcore_id();
-+	uint16_t exp = 0;
- 
- 	ctx->mem.lcore_id = lcore;
+@@ -395,32 +396,47 @@ cperf_verify_test_runner(void *test_ctx)
@@ -557,7 +551,0 @@
- 	ctx->ratio = (double) ctx->comp_data_sz /
- 			test_data->input_data_sz * 100;
- 
--	uint16_t exp = 0;
- 	if (!ctx->silent) {
- 		if (__atomic_compare_exchange_n(&display_once, &exp, 1, 0,
- 				__ATOMIC_RELAXED, __ATOMIC_RELAXED)) {
@@ -565 +553 @@
-index 41b8edc2bd..bbb4c7917b 100644
+index ce9e80bedc..832140f814 100644
@@ -568 +556 @@
-@@ -254,6 +254,14 @@ comp_perf_dump_input_data(struct comp_test_data *test_data)
+@@ -253,6 +253,14 @@ comp_perf_dump_input_data(struct comp_test_data *test_data)

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/bnxt: fix link state change interrupt config' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (60 preceding siblings ...)
  2023-02-23  9:37 ` patch 'app/compress-perf: fix testing single operation' " luca.boccassi
@ 2023-02-23  9:37 ` luca.boccassi
  2023-02-23  9:37 ` patch 'app/testpmd: fix crash on cleanup' " luca.boccassi
                   ` (7 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:37 UTC (permalink / raw)
  To: Edwin Brossette; +Cc: Somnath Kotur, Ajit Khaparde, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From de481ff9ddb85bddac2834cbdae53280a119aa3d Mon Sep 17 00:00:00 2001
From: Edwin Brossette <edwin.brossette@6wind.com>
Date: Mon, 6 Feb 2023 18:11:13 +0100
Subject: [PATCH] net/bnxt: fix link state change interrupt config

[ upstream commit 60653f4a25bd87a32bc148461f32566af997da8b ]

When getting the device's info via bnxt_dev_info_get_op(), the device
enables interrupts on link state changes because of the following line:

  eth_dev->data->dev_conf.intr_conf.lsc = 1;

Enabling this mode might not be wanted by the user.

The flag RTE_ETH_DEV_INTR_LSC can be used to inform the above
application that LSC interrupts are supported. Thus, checking this flag,
the user can decide whether or not to enable these interrupts.

Since there is no reason for a function meant to display config to
actually modify it, remove this line. In addition, raise the dev_flag
associated with this state on the device's initialization to show the
device supports link state change interrupts.

Fixes: 7bc8e9a227cc ("net/bnxt: support async link notification")

Signed-off-by: Edwin Brossette <edwin.brossette@6wind.com>
Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 44056c9c4d..827253ff1c 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -1030,7 +1030,6 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
 		.tx_free_thresh = 32,
 		.tx_rs_thresh = 32,
 	};
-	eth_dev->data->dev_conf.intr_conf.lsc = 1;
 
 	dev_info->rx_desc_lim.nb_min = BNXT_MIN_RING_DESC;
 	dev_info->rx_desc_lim.nb_max = BNXT_MAX_RX_RING_DESC;
@@ -5772,6 +5771,7 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev, void *params __rte_unused)
 
 	rte_eth_copy_pci_info(eth_dev, pci_dev);
 	eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
+	eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC;
 
 	bp = eth_dev->data->dev_private;
 
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:30.763745888 +0000
+++ 0063-net-bnxt-fix-link-state-change-interrupt-config.patch	2023-02-23 09:36:28.346172150 +0000
@@ -1 +1 @@
-From 60653f4a25bd87a32bc148461f32566af997da8b Mon Sep 17 00:00:00 2001
+From de481ff9ddb85bddac2834cbdae53280a119aa3d Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 60653f4a25bd87a32bc148461f32566af997da8b ]
+
@@ -23 +24,0 @@
-Cc: stable@dpdk.org
@@ -29 +29,0 @@
- .mailmap                       | 1 +
@@ -31 +31 @@
- 2 files changed, 2 insertions(+), 1 deletion(-)
+ 1 file changed, 1 insertion(+), 1 deletion(-)
@@ -33,12 +32,0 @@
-diff --git a/.mailmap b/.mailmap
-index e111e05bc2..a9f4f28fba 100644
---- a/.mailmap
-+++ b/.mailmap
-@@ -339,6 +339,7 @@ Dzmitry Sautsa <dzmitryx.sautsa@intel.com>
- Ed Czeck <ed.czeck@atomicrules.com>
- Eduard Serra <eserra@vmware.com>
- Edward Makarov <makarov@kraftway.ru>
-+Edwin Brossette <edwin.brossette@6wind.com>
- Eelco Chaudron <echaudro@redhat.com>
- Elad Nachman <eladv6@gmail.com>
- Elad Persiko <eladpe@mellanox.com>
@@ -46 +34 @@
-index b3de490d36..753e86b4b2 100644
+index 44056c9c4d..827253ff1c 100644
@@ -49 +37 @@
-@@ -1017,7 +1017,6 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
+@@ -1030,7 +1030,6 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
@@ -57 +45 @@
-@@ -5859,6 +5858,7 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev, void *params __rte_unused)
+@@ -5772,6 +5771,7 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev, void *params __rte_unused)

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'app/testpmd: fix crash on cleanup' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (61 preceding siblings ...)
  2023-02-23  9:37 ` patch 'net/bnxt: fix link state change interrupt config' " luca.boccassi
@ 2023-02-23  9:37 ` luca.boccassi
  2023-02-23  9:37 ` patch 'eal/freebsd: fix lock in alarm callback' " luca.boccassi
                   ` (6 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:37 UTC (permalink / raw)
  To: David Marchand; +Cc: Aman Singh, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/7dbf8ba3c72dca7b52e60796b5fb7a95258fb1a1

Thanks.

Luca Boccassi

---
From 7dbf8ba3c72dca7b52e60796b5fb7a95258fb1a1 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Mon, 6 Feb 2023 16:49:46 +0100
Subject: [PATCH] app/testpmd: fix crash on cleanup

[ upstream commit 563fbd084b6b8de866d4fad9582f9eb071e6da0a ]

If allocating the ports[] array fails, a crash will occur when shutting
down testpmd since ethdev emits RTE_ETH_EVENT_DESTROY events.
Move init_port() before registering ethdev event handler.

Fixes: 85c6571c9103 ("app/testpmd: reset port status on close notification")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Aman Singh <aman.deep.singh@intel.com>
---
 app/test-pmd/testpmd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 508f2c4268..f22c05920f 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -3898,6 +3898,9 @@ main(int argc, char** argv)
 		rte_exit(EXIT_FAILURE,
 			 "Secondary process type not supported.\n");
 
+	/* allocate port structures, and init them */
+	init_port();
+
 	ret = register_eth_event_callback();
 	if (ret != 0)
 		rte_exit(EXIT_FAILURE, "Cannot register for ethdev events");
@@ -3916,9 +3919,6 @@ main(int argc, char** argv)
 	if (nb_ports == 0)
 		TESTPMD_LOG(WARNING, "No probed ethernet devices\n");
 
-	/* allocate port structures, and init them */
-	init_port();
-
 	set_def_fwd_config();
 	if (nb_lcores == 0)
 		rte_exit(EXIT_FAILURE, "No cores defined for forwarding\n"
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:30.831910081 +0000
+++ 0064-app-testpmd-fix-crash-on-cleanup.patch	2023-02-23 09:36:28.350172224 +0000
@@ -1 +1 @@
-From 563fbd084b6b8de866d4fad9582f9eb071e6da0a Mon Sep 17 00:00:00 2001
+From 7dbf8ba3c72dca7b52e60796b5fb7a95258fb1a1 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 563fbd084b6b8de866d4fad9582f9eb071e6da0a ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index a6c5dec4c0..0c14325b8d 100644
+index 508f2c4268..f22c05920f 100644
@@ -23,3 +24,3 @@
-@@ -4429,6 +4429,9 @@ main(int argc, char** argv)
- 		rte_exit(EXIT_FAILURE, "Cannot init EAL: %s\n",
- 			 rte_strerror(rte_errno));
+@@ -3898,6 +3898,9 @@ main(int argc, char** argv)
+ 		rte_exit(EXIT_FAILURE,
+ 			 "Secondary process type not supported.\n");
@@ -33 +34 @@
-@@ -4447,9 +4450,6 @@ main(int argc, char** argv)
+@@ -3916,9 +3919,6 @@ main(int argc, char** argv)

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'eal/freebsd: fix lock in alarm callback' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (62 preceding siblings ...)
  2023-02-23  9:37 ` patch 'app/testpmd: fix crash on cleanup' " luca.boccassi
@ 2023-02-23  9:37 ` luca.boccassi
  2023-02-23  9:37 ` patch 'reorder: invalidate buffer from ready queue in drain' " luca.boccassi
                   ` (5 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:37 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/45ff268fbc9d20911bde534876f99c826b2ac562

Thanks.

Luca Boccassi

---
From 45ff268fbc9d20911bde534876f99c826b2ac562 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Mon, 13 Feb 2023 12:44:52 +0000
Subject: [PATCH] eal/freebsd: fix lock in alarm callback

[ upstream commit fc6bdd5248e843ba1300c8d46d43b263b4a69438 ]

The spinlock should unlock when clock_gettime() failed. This patch
fixes it by invoking clock_gettime() before lock.

Fixes: 26021a715067 ("eal/bsd: support alarm API")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/librte_eal/freebsd/eal_alarm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/librte_eal/freebsd/eal_alarm.c b/lib/librte_eal/freebsd/eal_alarm.c
index c38b2e04f8..3677bdfe40 100644
--- a/lib/librte_eal/freebsd/eal_alarm.c
+++ b/lib/librte_eal/freebsd/eal_alarm.c
@@ -148,12 +148,12 @@ eal_alarm_callback(void *arg __rte_unused)
 	struct timespec now;
 	struct alarm_entry *ap;
 
-	rte_spinlock_lock(&alarm_list_lk);
-	ap = LIST_FIRST(&alarm_list);
-
 	if (clock_gettime(CLOCK_TYPE_ID, &now) < 0)
 		return;
 
+	rte_spinlock_lock(&alarm_list_lk);
+	ap = LIST_FIRST(&alarm_list);
+
 	while (ap != NULL && timespec_cmp(&now, &ap->time) >= 0) {
 		ap->executing = 1;
 		ap->executing_id = pthread_self();
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:30.887116157 +0000
+++ 0065-eal-freebsd-fix-lock-in-alarm-callback.patch	2023-02-23 09:36:28.350172224 +0000
@@ -1 +1 @@
-From fc6bdd5248e843ba1300c8d46d43b263b4a69438 Mon Sep 17 00:00:00 2001
+From 45ff268fbc9d20911bde534876f99c826b2ac562 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit fc6bdd5248e843ba1300c8d46d43b263b4a69438 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -15 +16 @@
- lib/eal/freebsd/eal_alarm.c | 6 +++---
+ lib/librte_eal/freebsd/eal_alarm.c | 6 +++---
@@ -18,5 +19,5 @@
-diff --git a/lib/eal/freebsd/eal_alarm.c b/lib/eal/freebsd/eal_alarm.c
-index 1023c32937..1a3e6c0aad 100644
---- a/lib/eal/freebsd/eal_alarm.c
-+++ b/lib/eal/freebsd/eal_alarm.c
-@@ -171,12 +171,12 @@ eal_alarm_callback(void *arg __rte_unused)
+diff --git a/lib/librte_eal/freebsd/eal_alarm.c b/lib/librte_eal/freebsd/eal_alarm.c
+index c38b2e04f8..3677bdfe40 100644
+--- a/lib/librte_eal/freebsd/eal_alarm.c
++++ b/lib/librte_eal/freebsd/eal_alarm.c
+@@ -148,12 +148,12 @@ eal_alarm_callback(void *arg __rte_unused)

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'reorder: invalidate buffer from ready queue in drain' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (63 preceding siblings ...)
  2023-02-23  9:37 ` patch 'eal/freebsd: fix lock in alarm callback' " luca.boccassi
@ 2023-02-23  9:37 ` luca.boccassi
  2023-02-23  9:37 ` patch 'test/reorder: fix double free of drained buffers' " luca.boccassi
                   ` (4 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:37 UTC (permalink / raw)
  To: Volodymyr Fialko; +Cc: Stephen Hemminger, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/59e1f7e8f3143fe3e90d1a1dd359c198230287f8

Thanks.

Luca Boccassi

---
From 59e1f7e8f3143fe3e90d1a1dd359c198230287f8 Mon Sep 17 00:00:00 2001
From: Volodymyr Fialko <vfialko@marvell.com>
Date: Sat, 7 Jan 2023 16:19:38 +0100
Subject: [PATCH] reorder: invalidate buffer from ready queue in drain

[ upstream commit af12092f927d0d230b4dc051529dae88902fba1c ]

Set drained buffers from ready queue to NULL, since their ownership
returned to user. Otherwise it's possible that both user and library
will attempt to free the packet.

Fixes: b70b56032bff ("reorder: new library")

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/librte_reorder/rte_reorder.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/librte_reorder/rte_reorder.c b/lib/librte_reorder/rte_reorder.c
index 9445853b79..a5b9663aa5 100644
--- a/lib/librte_reorder/rte_reorder.c
+++ b/lib/librte_reorder/rte_reorder.c
@@ -392,6 +392,7 @@ rte_reorder_drain(struct rte_reorder_buffer *b, struct rte_mbuf **mbufs,
 	/* Try to fetch requested number of mbufs from ready buffer */
 	while ((drain_cnt < max_mbufs) && (ready_buf->tail != ready_buf->head)) {
 		mbufs[drain_cnt++] = ready_buf->entries[ready_buf->tail];
+		ready_buf->entries[ready_buf->tail] = NULL;
 		ready_buf->tail = (ready_buf->tail + 1) & ready_buf->mask;
 	}
 
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:30.932780291 +0000
+++ 0066-reorder-invalidate-buffer-from-ready-queue-in-drain.patch	2023-02-23 09:36:28.350172224 +0000
@@ -1 +1 @@
-From af12092f927d0d230b4dc051529dae88902fba1c Mon Sep 17 00:00:00 2001
+From 59e1f7e8f3143fe3e90d1a1dd359c198230287f8 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit af12092f927d0d230b4dc051529dae88902fba1c ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -16 +17 @@
- lib/reorder/rte_reorder.c | 1 +
+ lib/librte_reorder/rte_reorder.c | 1 +
@@ -19,5 +20,5 @@
-diff --git a/lib/reorder/rte_reorder.c b/lib/reorder/rte_reorder.c
-index 385ee479da..b38e71f460 100644
---- a/lib/reorder/rte_reorder.c
-+++ b/lib/reorder/rte_reorder.c
-@@ -389,6 +389,7 @@ rte_reorder_drain(struct rte_reorder_buffer *b, struct rte_mbuf **mbufs,
+diff --git a/lib/librte_reorder/rte_reorder.c b/lib/librte_reorder/rte_reorder.c
+index 9445853b79..a5b9663aa5 100644
+--- a/lib/librte_reorder/rte_reorder.c
++++ b/lib/librte_reorder/rte_reorder.c
+@@ -392,6 +392,7 @@ rte_reorder_drain(struct rte_reorder_buffer *b, struct rte_mbuf **mbufs,

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'test/reorder: fix double free of drained buffers' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (64 preceding siblings ...)
  2023-02-23  9:37 ` patch 'reorder: invalidate buffer from ready queue in drain' " luca.boccassi
@ 2023-02-23  9:37 ` luca.boccassi
  2023-02-23  9:37 ` patch 'build: fix toolchain definition' " luca.boccassi
                   ` (3 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:37 UTC (permalink / raw)
  To: Volodymyr Fialko; +Cc: Stephen Hemminger, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/5109a26c9ff22053f3cae64cec69c7a6e0f4aa7b

Thanks.

Luca Boccassi

---
From 5109a26c9ff22053f3cae64cec69c7a6e0f4aa7b Mon Sep 17 00:00:00 2001
From: Volodymyr Fialko <vfialko@marvell.com>
Date: Sat, 7 Jan 2023 16:19:39 +0100
Subject: [PATCH] test/reorder: fix double free of drained buffers

[ upstream commit d51955ea93fba1873e9c2b86a911e114787bdd4d ]

Set to zero array of drained buffers after free, to prevent freeing them
one more time.
Discovered with enabled `RTE_LIBRTE_MEMPOOL_DEBUG`.

Fixes: ecd867faa860 ("test/reorder: fix freeing mbuf twice")

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
 app/test/test_reorder.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/app/test/test_reorder.c b/app/test/test_reorder.c
index 1c4226da65..69b63bceba 100644
--- a/app/test/test_reorder.c
+++ b/app/test/test_reorder.c
@@ -270,6 +270,7 @@ test_reorder_drain(void)
 	}
 	if (robufs[0] != NULL)
 		rte_pktmbuf_free(robufs[0]);
+	memset(robufs, 0, sizeof(robufs));
 
 	/* Insert more packets
 	 * RB[] = {NULL, NULL, NULL, NULL}
@@ -306,6 +307,7 @@ test_reorder_drain(void)
 		if (robufs[i] != NULL)
 			rte_pktmbuf_free(robufs[i]);
 	}
+	memset(robufs, 0, sizeof(robufs));
 
 	/*
 	 * RB[] = {NULL, NULL, NULL, NULL}
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:30.976002904 +0000
+++ 0067-test-reorder-fix-double-free-of-drained-buffers.patch	2023-02-23 09:36:28.350172224 +0000
@@ -1 +1 @@
-From d51955ea93fba1873e9c2b86a911e114787bdd4d Mon Sep 17 00:00:00 2001
+From 5109a26c9ff22053f3cae64cec69c7a6e0f4aa7b Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit d51955ea93fba1873e9c2b86a911e114787bdd4d ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index f0714a5c18..7b5e590bac 100644
+index 1c4226da65..69b63bceba 100644
@@ -23,2 +24 @@
-@@ -278,6 +278,7 @@ test_reorder_drain(void)
- 		goto exit;
+@@ -270,6 +270,7 @@ test_reorder_drain(void)
@@ -26 +26,2 @@
- 	rte_pktmbuf_free(robufs[0]);
+ 	if (robufs[0] != NULL)
+ 		rte_pktmbuf_free(robufs[0]);
@@ -31,3 +32,3 @@
-@@ -313,6 +314,7 @@ test_reorder_drain(void)
- 	for (i = 0; i < 3; i++) {
- 		rte_pktmbuf_free(robufs[i]);
+@@ -306,6 +307,7 @@ test_reorder_drain(void)
+ 		if (robufs[i] != NULL)
+ 			rte_pktmbuf_free(robufs[i]);

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'build: fix toolchain definition' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (65 preceding siblings ...)
  2023-02-23  9:37 ` patch 'test/reorder: fix double free of drained buffers' " luca.boccassi
@ 2023-02-23  9:37 ` luca.boccassi
  2023-02-23  9:37 ` patch 'eal: use same atomic intrinsics for GCC and clang' " luca.boccassi
                   ` (2 subsequent siblings)
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:37 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Keith Wiles, Tyler Retzlaff, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/25adf87e6057906f21c97ce5640f475df081b290

Thanks.

Luca Boccassi

---
From 25adf87e6057906f21c97ce5640f475df081b290 Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Tue, 7 Feb 2023 15:22:00 +0000
Subject: [PATCH] build: fix toolchain definition

[ upstream commit e08c1645df1f2967b331e132ddb36ba817812dc2 ]

When using "icx" (Intel(R) oneAPI DPC++/C++ Compiler) to build DPDK,
meson reports the toolchain as "intel-llvm"[1]. This value is used
directly to define the RTE_TOOLCHAIN macros, which means that we end up
with the invalid macro name "RTE_TOOLCHAIN_INTEL-LLVM", and getting the
compiler warning:

rte_build_config.h:422:28: warning: ISO C99 requires whitespace after the macro name

This can be fixed, and the macro generation made more robust generally,
by adding "underscorify()" on the string. This replaces the "-", and
any other invalid characters, with "_" [2].

[1] https://mesonbuild.com/Reference-tables.html#compiler-ids
[2] https://mesonbuild.com/Reference-manual_elementary_str.html#strunderscorify

Fixes: afd18fa21b5e ("build: set toolchain info during meson configure")

Reported-by: Keith Wiles <keith.wiles@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 config/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/config/meson.build b/config/meson.build
index 5058b733e3..b95b1ffa91 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -107,7 +107,7 @@ endif
 
 toolchain = cc.get_id()
 dpdk_conf.set_quoted('RTE_TOOLCHAIN', toolchain)
-dpdk_conf.set('RTE_TOOLCHAIN_' + toolchain.to_upper(), 1)
+dpdk_conf.set('RTE_TOOLCHAIN_' + toolchain.to_upper().underscorify(), 1)
 
 dpdk_conf.set('RTE_ARCH_64', cc.sizeof('void *') == 8)
 dpdk_conf.set('RTE_ARCH_32', cc.sizeof('void *') == 4)
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:31.020459934 +0000
+++ 0068-build-fix-toolchain-definition.patch	2023-02-23 09:36:28.354172297 +0000
@@ -1 +1 @@
-From e08c1645df1f2967b331e132ddb36ba817812dc2 Mon Sep 17 00:00:00 2001
+From 25adf87e6057906f21c97ce5640f475df081b290 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit e08c1645df1f2967b331e132ddb36ba817812dc2 ]
+
@@ -22 +23,0 @@
-Cc: stable@dpdk.org
@@ -33 +34 @@
-index 26f3168bc9..fc3ac99a32 100644
+index 5058b733e3..b95b1ffa91 100644
@@ -36 +37 @@
-@@ -139,7 +139,7 @@ endif
+@@ -107,7 +107,7 @@ endif

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'eal: use same atomic intrinsics for GCC and clang' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (66 preceding siblings ...)
  2023-02-23  9:37 ` patch 'build: fix toolchain definition' " luca.boccassi
@ 2023-02-23  9:37 ` luca.boccassi
  2023-02-23  9:37 ` patch 'examples/cmdline: fix build with GCC 12' " luca.boccassi
  2023-02-23  9:37 ` patch 'examples/qos_sched: fix Tx port config when link down' " luca.boccassi
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:37 UTC (permalink / raw)
  To: Honnappa Nagarahalli
  Cc: Ola Liljedahl, Ruifeng Wang, Morten Brørup, Tyler Retzlaff,
	dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/60ac57c2f188bb85ba6bf6437aa9ec978b900369

Thanks.

Luca Boccassi

---
From 60ac57c2f188bb85ba6bf6437aa9ec978b900369 Mon Sep 17 00:00:00 2001
From: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Date: Fri, 17 Feb 2023 19:58:03 -0600
Subject: [PATCH] eal: use same atomic intrinsics for GCC and clang
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit 0c0eb1156e3d52ede4b19d687aa5387d1dca7666 ]

The size generic atomic intrinsics generate the same
code as the size specific intrinsics for gcc. Use size
generic intrinsics for both gcc and clang.

Fixes: 7bdccb93078e ("eal: fix ARM build with clang")

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ola Liljedahl <ola.liljedahl@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 lib/librte_eal/include/generic/rte_atomic.h | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/lib/librte_eal/include/generic/rte_atomic.h b/lib/librte_eal/include/generic/rte_atomic.h
index 276272f40b..f73825a3d3 100644
--- a/lib/librte_eal/include/generic/rte_atomic.h
+++ b/lib/librte_eal/include/generic/rte_atomic.h
@@ -175,11 +175,7 @@ rte_atomic16_exchange(volatile uint16_t *dst, uint16_t val);
 static inline uint16_t
 rte_atomic16_exchange(volatile uint16_t *dst, uint16_t val)
 {
-#if defined(__clang__)
 	return __atomic_exchange_n(dst, val, __ATOMIC_SEQ_CST);
-#else
-	return __atomic_exchange_2(dst, val, __ATOMIC_SEQ_CST);
-#endif
 }
 #endif
 
@@ -458,11 +454,7 @@ rte_atomic32_exchange(volatile uint32_t *dst, uint32_t val);
 static inline uint32_t
 rte_atomic32_exchange(volatile uint32_t *dst, uint32_t val)
 {
-#if defined(__clang__)
 	return __atomic_exchange_n(dst, val, __ATOMIC_SEQ_CST);
-#else
-	return __atomic_exchange_4(dst, val, __ATOMIC_SEQ_CST);
-#endif
 }
 #endif
 
@@ -740,11 +732,7 @@ rte_atomic64_exchange(volatile uint64_t *dst, uint64_t val);
 static inline uint64_t
 rte_atomic64_exchange(volatile uint64_t *dst, uint64_t val)
 {
-#if defined(__clang__)
 	return __atomic_exchange_n(dst, val, __ATOMIC_SEQ_CST);
-#else
-	return __atomic_exchange_8(dst, val, __ATOMIC_SEQ_CST);
-#endif
 }
 #endif
 
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:31.066224032 +0000
+++ 0069-eal-use-same-atomic-intrinsics-for-GCC-and-clang.patch	2023-02-23 09:36:28.354172297 +0000
@@ -1 +1 @@
-From 0c0eb1156e3d52ede4b19d687aa5387d1dca7666 Mon Sep 17 00:00:00 2001
+From 60ac57c2f188bb85ba6bf6437aa9ec978b900369 Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit 0c0eb1156e3d52ede4b19d687aa5387d1dca7666 ]
+
@@ -14 +15,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
- lib/eal/include/generic/rte_atomic.h | 12 ------------
+ lib/librte_eal/include/generic/rte_atomic.h | 12 ------------
@@ -25,5 +26,5 @@
-diff --git a/lib/eal/include/generic/rte_atomic.h b/lib/eal/include/generic/rte_atomic.h
-index f5c49a9870..234b268b91 100644
---- a/lib/eal/include/generic/rte_atomic.h
-+++ b/lib/eal/include/generic/rte_atomic.h
-@@ -176,11 +176,7 @@ rte_atomic16_exchange(volatile uint16_t *dst, uint16_t val);
+diff --git a/lib/librte_eal/include/generic/rte_atomic.h b/lib/librte_eal/include/generic/rte_atomic.h
+index 276272f40b..f73825a3d3 100644
+--- a/lib/librte_eal/include/generic/rte_atomic.h
++++ b/lib/librte_eal/include/generic/rte_atomic.h
+@@ -175,11 +175,7 @@ rte_atomic16_exchange(volatile uint16_t *dst, uint16_t val);
@@ -41 +42 @@
-@@ -459,11 +455,7 @@ rte_atomic32_exchange(volatile uint32_t *dst, uint32_t val);
+@@ -458,11 +454,7 @@ rte_atomic32_exchange(volatile uint32_t *dst, uint32_t val);
@@ -53 +54 @@
-@@ -741,11 +733,7 @@ rte_atomic64_exchange(volatile uint64_t *dst, uint64_t val);
+@@ -740,11 +732,7 @@ rte_atomic64_exchange(volatile uint64_t *dst, uint64_t val);

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'examples/cmdline: fix build with GCC 12' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (67 preceding siblings ...)
  2023-02-23  9:37 ` patch 'eal: use same atomic intrinsics for GCC and clang' " luca.boccassi
@ 2023-02-23  9:37 ` luca.boccassi
  2023-02-23  9:37 ` patch 'examples/qos_sched: fix Tx port config when link down' " luca.boccassi
  69 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:37 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Olivier Matz, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From e6c09a4ba8216aa2ece322ac68ad921f42880089 Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Wed, 18 Jan 2023 16:11:11 +0000
Subject: [PATCH] examples/cmdline: fix build with GCC 12

[ upstream commit 2ba8d0adb06f92ef73bc8e3953ca45b7d322c823 ]

When building the example without libbsd and using the DPDK-provided
strlcpy function, a compiler warning is emitted by GCC 12 about the copy
of the parsed string into the resulting object. This is because the
source from cmdline library is 128 bytes and the destination buffer is
64-bytes.

commands.c: In function 'cmd_obj_add_parsed':
rte_string_fns.h:61:24: warning: '%s' directive output may be truncated
writing up to 127 bytes into a region of size 64 [-Wformat-truncation=]
   61 |         return (size_t)snprintf(dst, size, "%s", src);
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:894,
                 from commands.c:7:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:71:10: note:
'__builtin_snprintf' output between 1 and 128 bytes into a destination of size 64

Multiple options are possible to fix this, but the one taken in this
patch is to ensure truncation never occurs by setting the destination
buffer size to be the same as that used by the cmdline library.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---
 examples/cmdline/parse_obj_list.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/examples/cmdline/parse_obj_list.h b/examples/cmdline/parse_obj_list.h
index 6516d3e2c2..1223ac1e8b 100644
--- a/examples/cmdline/parse_obj_list.h
+++ b/examples/cmdline/parse_obj_list.h
@@ -12,8 +12,9 @@
 
 #include <sys/queue.h>
 #include <cmdline_parse.h>
+#include <cmdline_parse_string.h>
 
-#define OBJ_NAME_LEN_MAX 64
+#define OBJ_NAME_LEN_MAX sizeof(cmdline_fixed_string_t)
 
 struct object {
 	SLIST_ENTRY(object) next;
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:31.111446829 +0000
+++ 0070-examples-cmdline-fix-build-with-GCC-12.patch	2023-02-23 09:36:28.354172297 +0000
@@ -1 +1 @@
-From 2ba8d0adb06f92ef73bc8e3953ca45b7d322c823 Mon Sep 17 00:00:00 2001
+From e6c09a4ba8216aa2ece322ac68ad921f42880089 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 2ba8d0adb06f92ef73bc8e3953ca45b7d322c823 ]
+
@@ -27 +28,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'examples/qos_sched: fix Tx port config when link down' has been queued to stable release 20.11.8
  2023-02-23  9:36 patch 'eal/windows: mark memory config as complete' has been queued to stable release 20.11.8 luca.boccassi
                   ` (68 preceding siblings ...)
  2023-02-23  9:37 ` patch 'examples/cmdline: fix build with GCC 12' " luca.boccassi
@ 2023-02-23  9:37 ` luca.boccassi
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
  69 siblings, 1 reply; 144+ messages in thread
From: luca.boccassi @ 2023-02-23  9:37 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Cristian Dumitrescu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/66cce69e5c34aea0db9d5e34d44206b26c261dac

Thanks.

Luca Boccassi

---
From 66cce69e5c34aea0db9d5e34d44206b26c261dac Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Fri, 3 Feb 2023 10:05:30 +0000
Subject: [PATCH] examples/qos_sched: fix Tx port config when link down

[ upstream commit 665b49c51639a10c553433bc2bcd85c7331c631e ]

The Tx port config will fail if the port is not up,
so wait 10 seconds on startup for it to start.

Fixes: de3cfa2c9823 ("sched: initial import")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
 examples/qos_sched/init.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
index 33e8a75526..c6310fc374 100644
--- a/examples/qos_sched/init.c
+++ b/examples/qos_sched/init.c
@@ -387,6 +387,8 @@ int app_init(void)
 	for(i = 0; i < nb_pfc; i++) {
 		uint32_t socket = rte_lcore_to_socket_id(qos_conf[i].rx_core);
 		struct rte_ring *ring;
+		struct rte_eth_link link = {0};
+		int retry_count = 100, retry_delay = 100; /* try every 100ms for 10 sec */
 
 		snprintf(ring_name, MAX_NAME_LEN, "ring-%u-%u", i, qos_conf[i].rx_core);
 		ring = rte_ring_lookup(ring_name);
@@ -417,6 +419,14 @@ int app_init(void)
 		app_init_port(qos_conf[i].rx_port, qos_conf[i].mbuf_pool);
 		app_init_port(qos_conf[i].tx_port, qos_conf[i].mbuf_pool);
 
+		rte_eth_link_get(qos_conf[i].tx_port, &link);
+		if (link.link_status == 0)
+			printf("Waiting for link on port %u\n", qos_conf[i].tx_port);
+		while (link.link_status == 0 && retry_count--) {
+			rte_delay_ms(retry_delay);
+			rte_eth_link_get(qos_conf[i].tx_port, &link);
+		}
+
 		qos_conf[i].sched_port = app_init_sched_port(qos_conf[i].tx_port, socket);
 	}
 
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:31.154440596 +0000
+++ 0071-examples-qos_sched-fix-Tx-port-config-when-link-down.patch	2023-02-23 09:36:28.354172297 +0000
@@ -1 +1 @@
-From 665b49c51639a10c553433bc2bcd85c7331c631e Mon Sep 17 00:00:00 2001
+From 66cce69e5c34aea0db9d5e34d44206b26c261dac Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 665b49c51639a10c553433bc2bcd85c7331c631e ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
-index d28350e14a..7a27c03b64 100644
+index 33e8a75526..c6310fc374 100644
@@ -22 +23 @@
-@@ -328,6 +328,8 @@ int app_init(void)
+@@ -387,6 +387,8 @@ int app_init(void)
@@ -31 +32 @@
-@@ -358,6 +360,14 @@ int app_init(void)
+@@ -417,6 +419,14 @@ int app_init(void)

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'eal/windows: fix pedantic build' has been queued to stable release 20.11.8
  2023-02-23  9:37 ` patch 'examples/qos_sched: fix Tx port config when link down' " luca.boccassi
@ 2023-03-15 22:45   ` luca.boccassi
  2023-03-15 22:45     ` patch 'doc: fix reference to event timer header' " luca.boccassi
                       ` (37 more replies)
  0 siblings, 38 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:45 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: Tyler Retzlaff, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/0ccc2b5cf0ade8a6e64fef7ac9edd13e052e6ffe

Thanks.

Luca Boccassi

---
From 0ccc2b5cf0ade8a6e64fef7ac9edd13e052e6ffe Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas@monjalon.net>
Date: Thu, 5 Jan 2023 16:18:38 +0100
Subject: [PATCH] eal/windows: fix pedantic build

[ upstream commit 4ef69b2877a24ddb89afaf4bb6f4e73bb52a605b ]

MinGW GCC 12 shows an illegal pointer conversion
when included in a pedantic module:

lib/eal/windows/include/pthread.h:137:41: error:
	ISO C forbids conversion of object pointer to function pointer type
	[-Werror=pedantic]
 137 | hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)threadfunc,
     |                                 ^

By using uintptr_t, the compiler is forced to accept the conversion.

Fixes: e8428a9d89f1 ("eal/windows: add some basic functions and macros")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 lib/librte_eal/windows/include/pthread.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/librte_eal/windows/include/pthread.h b/lib/librte_eal/windows/include/pthread.h
index 27fd2cca52..f7cf0e9ddf 100644
--- a/lib/librte_eal/windows/include/pthread.h
+++ b/lib/librte_eal/windows/include/pthread.h
@@ -134,7 +134,8 @@ pthread_create(void *threadid, const void *threadattr, void *threadfunc,
 {
 	RTE_SET_USED(threadattr);
 	HANDLE hThread;
-	hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)threadfunc,
+	hThread = CreateThread(NULL, 0,
+		(LPTHREAD_START_ROUTINE)(uintptr_t)threadfunc,
 		args, 0, (LPDWORD)threadid);
 	if (hThread) {
 		SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS);
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:49.711012572 +0000
+++ 0001-eal-windows-fix-pedantic-build.patch	2023-03-15 22:44:49.463847745 +0000
@@ -1 +1 @@
-From 4ef69b2877a24ddb89afaf4bb6f4e73bb52a605b Mon Sep 17 00:00:00 2001
+From 0ccc2b5cf0ade8a6e64fef7ac9edd13e052e6ffe Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 4ef69b2877a24ddb89afaf4bb6f4e73bb52a605b ]
+
@@ -18 +19,0 @@
-Cc: stable@dpdk.org
@@ -23 +24 @@
- lib/eal/windows/include/pthread.h | 3 ++-
+ lib/librte_eal/windows/include/pthread.h | 3 ++-
@@ -26 +27 @@
-diff --git a/lib/eal/windows/include/pthread.h b/lib/eal/windows/include/pthread.h
+diff --git a/lib/librte_eal/windows/include/pthread.h b/lib/librte_eal/windows/include/pthread.h
@@ -28,2 +29,2 @@
---- a/lib/eal/windows/include/pthread.h
-+++ b/lib/eal/windows/include/pthread.h
+--- a/lib/librte_eal/windows/include/pthread.h
++++ b/lib/librte_eal/windows/include/pthread.h

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'doc: fix reference to event timer header' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
@ 2023-03-15 22:45     ` luca.boccassi
  2023-03-15 22:45     ` patch 'test/bbdev: fix crash for non supported HARQ length' " luca.boccassi
                       ` (36 subsequent siblings)
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:45 UTC (permalink / raw)
  To: David Marchand; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From d69156209f92f4855a70a570cc75d57cd9d17577 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Mon, 20 Feb 2023 15:47:11 +0100
Subject: [PATCH] doc: fix reference to event timer header

[ upstream commit 72b0b4205a635f997d4a2ffcb1fabdc2de5b36d0 ]

The event timer header is rte_event_timer_adapter.h.
Besides, we don't need to detail the full path to such a header.

Fixes: 30e7fbd62839 ("doc: add event timer adapter guide")

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 doc/guides/prog_guide/event_timer_adapter.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/guides/prog_guide/event_timer_adapter.rst b/doc/guides/prog_guide/event_timer_adapter.rst
index 5364db1ed6..d121dbbdb4 100644
--- a/doc/guides/prog_guide/event_timer_adapter.rst
+++ b/doc/guides/prog_guide/event_timer_adapter.rst
@@ -35,7 +35,7 @@ device upon timer expiration.
 
 The Event Timer Adapter API represents each event timer with a generic struct,
 which contains an event and user metadata.  The ``rte_event_timer`` struct is
-defined in ``lib/librte_event/librte_event_timer_adapter.h``.
+defined in ``rte_event_timer_adapter.h``.
 
 .. _timer_expiry_event:
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:49.759187552 +0000
+++ 0002-doc-fix-reference-to-event-timer-header.patch	2023-03-15 22:44:49.467847828 +0000
@@ -1 +1 @@
-From 72b0b4205a635f997d4a2ffcb1fabdc2de5b36d0 Mon Sep 17 00:00:00 2001
+From d69156209f92f4855a70a570cc75d57cd9d17577 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 72b0b4205a635f997d4a2ffcb1fabdc2de5b36d0 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -18 +19 @@
-index 4e07f0cc23..2a15ed8f5c 100644
+index 5364db1ed6..d121dbbdb4 100644
@@ -25 +26 @@
--defined in ``lib/event/librte_event_timer_adapter.h``.
+-defined in ``lib/librte_event/librte_event_timer_adapter.h``.

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'test/bbdev: fix crash for non supported HARQ length' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
  2023-03-15 22:45     ` patch 'doc: fix reference to event timer header' " luca.boccassi
@ 2023-03-15 22:45     ` luca.boccassi
  2023-03-15 22:45     ` patch 'test/bbdev: extend HARQ tolerance' " luca.boccassi
                       ` (35 subsequent siblings)
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:45 UTC (permalink / raw)
  To: Hernan Vargas; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/9df9bd72b00d52167e6285988534b39c9ca0d1a7

Thanks.

Luca Boccassi

---
From 9df9bd72b00d52167e6285988534b39c9ca0d1a7 Mon Sep 17 00:00:00 2001
From: Hernan Vargas <hernan.vargas@intel.com>
Date: Thu, 2 Mar 2023 12:21:55 -0800
Subject: [PATCH] test/bbdev: fix crash for non supported HARQ length

[ upstream commit bee9ac50e5da1f573dfb3c647687da15326d7c3e ]

Fix segmentation fault happening in corner case in test-bbdev.
This fault could happen when running some specific vectors which size
are not supported by the PMD.

Fixes: 335c11fd2763 ("app/bbdev: support HARQ validation")

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 app/test-bbdev/test_bbdev_perf.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index f38d991f87..5f8bd91ac7 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -76,7 +76,7 @@
 /* Increment for next code block in external HARQ memory */
 #define HARQ_INCR 32768
 /* Headroom for filler LLRs insertion in HARQ buffer */
-#define FILLER_HEADROOM 1024
+#define FILLER_HEADROOM 2048
 /* Constants from K0 computation from 3GPP 38.212 Table 5.4.2.1-2 */
 #define N_ZC_1 66 /* N = 66 Zc for BG 1 */
 #define N_ZC_2 50 /* N = 50 Zc for BG 2 */
@@ -1925,9 +1925,9 @@ validate_op_harq_chain(struct rte_bbdev_op_data *op,
 					ops_ld->n_filler;
 			if (data_len > deRmOutSize)
 				data_len = deRmOutSize;
-			if (data_len > orig_op->segments[i].length)
-				data_len = orig_op->segments[i].length;
 		}
+		if (data_len > orig_op->segments[i].length)
+			data_len = orig_op->segments[i].length;
 		/*
 		 * HARQ output can have minor differences
 		 * due to integer representation and related scaling
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:49.814447124 +0000
+++ 0003-test-bbdev-fix-crash-for-non-supported-HARQ-length.patch	2023-03-15 22:44:49.479848080 +0000
@@ -1 +1 @@
-From bee9ac50e5da1f573dfb3c647687da15326d7c3e Mon Sep 17 00:00:00 2001
+From 9df9bd72b00d52167e6285988534b39c9ca0d1a7 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit bee9ac50e5da1f573dfb3c647687da15326d7c3e ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index 45e1780df7..027f32cbf1 100644
+index f38d991f87..5f8bd91ac7 100644
@@ -23 +24 @@
-@@ -84,7 +84,7 @@
+@@ -76,7 +76,7 @@
@@ -32 +33 @@
-@@ -2111,9 +2111,9 @@ validate_op_harq_chain(struct rte_bbdev_op_data *op,
+@@ -1925,9 +1925,9 @@ validate_op_harq_chain(struct rte_bbdev_op_data *op,

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'test/bbdev: extend HARQ tolerance' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
  2023-03-15 22:45     ` patch 'doc: fix reference to event timer header' " luca.boccassi
  2023-03-15 22:45     ` patch 'test/bbdev: fix crash for non supported HARQ length' " luca.boccassi
@ 2023-03-15 22:45     ` luca.boccassi
  2023-03-15 22:45     ` patch 'test/bbdev: remove check for invalid opaque data' " luca.boccassi
                       ` (34 subsequent siblings)
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:45 UTC (permalink / raw)
  To: Hernan Vargas; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/83969dbe773464e827abf2816346532b372486dd

Thanks.

Luca Boccassi

---
From 83969dbe773464e827abf2816346532b372486dd Mon Sep 17 00:00:00 2001
From: Hernan Vargas <hernan.vargas@intel.com>
Date: Thu, 2 Mar 2023 12:21:56 -0800
Subject: [PATCH] test/bbdev: extend HARQ tolerance

[ upstream commit 39b601c462b8192b8f1c98fe26b604430ebcc8e4 ]

HARQ memory implementation could have different size assumptions.
Extending HARQ tolerance to cover different implementations.

Fixes: 335c11fd2763 ("app/bbdev: support HARQ validation")

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 app/test-bbdev/test_bbdev_perf.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 5f8bd91ac7..7c29b4bcee 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -87,6 +87,7 @@
 #define K0_3_1 56 /* K0 fraction numerator for rv 3 and BG 1 */
 #define K0_3_2 43 /* K0 fraction numerator for rv 3 and BG 2 */
 
+#define HARQ_MEM_TOLERANCE 256
 static struct test_bbdev_vector test_vector;
 
 /* Switch between PMD and Interrupt for throughput TC */
@@ -1904,13 +1905,17 @@ validate_op_harq_chain(struct rte_bbdev_op_data *op,
 		uint16_t data_len = rte_pktmbuf_data_len(m) - offset;
 		total_data_size += orig_op->segments[i].length;
 
-		TEST_ASSERT(orig_op->segments[i].length <
-				(uint32_t)(data_len + 64),
+		TEST_ASSERT(orig_op->segments[i].length < (uint32_t)(data_len + HARQ_MEM_TOLERANCE),
 				"Length of segment differ in original (%u) and filled (%u) op",
 				orig_op->segments[i].length, data_len);
 		harq_orig = (int8_t *) orig_op->segments[i].addr;
 		harq_out = rte_pktmbuf_mtod_offset(m, int8_t *, offset);
 
+		/* Cannot compare HARQ output data for such cases */
+		if ((ldpc_llr_decimals > 1) && ((ops_ld->op_flags & RTE_BBDEV_LDPC_LLR_COMPRESSION)
+				|| (ops_ld->op_flags & RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION)))
+			break;
+
 		if (!(ldpc_cap_flags &
 				RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS
 				) || (ops_ld->op_flags &
@@ -1986,7 +1991,7 @@ validate_op_harq_chain(struct rte_bbdev_op_data *op,
 
 	/* Validate total mbuf pkt length */
 	uint32_t pkt_len = rte_pktmbuf_pkt_len(op->data) - op->offset;
-	TEST_ASSERT(total_data_size < pkt_len + 64,
+	TEST_ASSERT(total_data_size < pkt_len + HARQ_MEM_TOLERANCE,
 			"Length of data differ in original (%u) and filled (%u) op",
 			total_data_size, pkt_len);
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:49.870332790 +0000
+++ 0004-test-bbdev-extend-HARQ-tolerance.patch	2023-03-15 22:44:49.487848248 +0000
@@ -1 +1 @@
-From 39b601c462b8192b8f1c98fe26b604430ebcc8e4 Mon Sep 17 00:00:00 2001
+From 83969dbe773464e827abf2816346532b372486dd Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 39b601c462b8192b8f1c98fe26b604430ebcc8e4 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
-index 027f32cbf1..74e7e13940 100644
+index 5f8bd91ac7..7c29b4bcee 100644
@@ -22 +23 @@
-@@ -95,6 +95,7 @@
+@@ -87,6 +87,7 @@
@@ -30 +31 @@
-@@ -2090,13 +2091,17 @@ validate_op_harq_chain(struct rte_bbdev_op_data *op,
+@@ -1904,13 +1905,17 @@ validate_op_harq_chain(struct rte_bbdev_op_data *op,
@@ -50 +51 @@
-@@ -2172,7 +2177,7 @@ validate_op_harq_chain(struct rte_bbdev_op_data *op,
+@@ -1986,7 +1991,7 @@ validate_op_harq_chain(struct rte_bbdev_op_data *op,

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'test/bbdev: remove check for invalid opaque data' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (2 preceding siblings ...)
  2023-03-15 22:45     ` patch 'test/bbdev: extend HARQ tolerance' " luca.boccassi
@ 2023-03-15 22:45     ` luca.boccassi
  2023-03-15 22:45     ` patch 'vhost: fix OOB access for invalid vhost ID' " luca.boccassi
                       ` (33 subsequent siblings)
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:45 UTC (permalink / raw)
  To: Hernan Vargas; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From dcac7514c8e03da0a90129fd44d4fc8648899528 Mon Sep 17 00:00:00 2001
From: Hernan Vargas <hernan.vargas@intel.com>
Date: Thu, 2 Mar 2023 12:21:57 -0800
Subject: [PATCH] test/bbdev: remove check for invalid opaque data

[ upstream commit 26437807ff57a13133d4c03d87c5eac037f1ffaa ]

Assert also if the opaque data is invalid.

Fixes: 335c11fd2763 ("app/bbdev: support HARQ validation")

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 app/test-bbdev/test_bbdev_perf.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 7c29b4bcee..1675b90c79 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -70,7 +70,6 @@
 
 #define SYNC_WAIT 0
 #define SYNC_START 1
-#define INVALID_OPAQUE -1
 
 #define INVALID_QUEUE_ID -1
 /* Increment for next code block in external HARQ memory */
@@ -1780,10 +1779,9 @@ check_enc_status_and_ordering(struct rte_bbdev_enc_op *op,
 			"op_status (%d) != expected_status (%d)",
 			op->status, expected_status);
 
-	if (op->opaque_data != (void *)(uintptr_t)INVALID_OPAQUE)
-		TEST_ASSERT((void *)(uintptr_t)order_idx == op->opaque_data,
-				"Ordering error, expected %p, got %p",
-				(void *)(uintptr_t)order_idx, op->opaque_data);
+	TEST_ASSERT((void *)(uintptr_t)order_idx == op->opaque_data,
+			"Ordering error, expected %p, got %p",
+			(void *)(uintptr_t)order_idx, op->opaque_data);
 
 	return TEST_SUCCESS;
 }
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:49.941892220 +0000
+++ 0005-test-bbdev-remove-check-for-invalid-opaque-data.patch	2023-03-15 22:44:49.503848583 +0000
@@ -1 +1 @@
-From 26437807ff57a13133d4c03d87c5eac037f1ffaa Mon Sep 17 00:00:00 2001
+From dcac7514c8e03da0a90129fd44d4fc8648899528 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 26437807ff57a13133d4c03d87c5eac037f1ffaa ]
+
@@ -9 +10,0 @@
-Cc: stable@dpdk.org
@@ -18 +19 @@
-index 74e7e13940..95d63a3548 100644
+index 7c29b4bcee..1675b90c79 100644
@@ -21 +22 @@
-@@ -78,7 +78,6 @@
+@@ -70,7 +70,6 @@
@@ -29 +30 @@
-@@ -1951,10 +1950,9 @@ check_enc_status_and_ordering(struct rte_bbdev_enc_op *op,
+@@ -1780,10 +1779,9 @@ check_enc_status_and_ordering(struct rte_bbdev_enc_op *op,

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'vhost: fix OOB access for invalid vhost ID' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (3 preceding siblings ...)
  2023-03-15 22:45     ` patch 'test/bbdev: remove check for invalid opaque data' " luca.boccassi
@ 2023-03-15 22:45     ` luca.boccassi
  2023-03-16  9:27       ` Luca Boccassi
  2023-03-15 22:45     ` patch 'Revert "vhost: fix OOB access for invalid vhost ID"' " luca.boccassi
                       ` (32 subsequent siblings)
  37 siblings, 1 reply; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:45 UTC (permalink / raw)
  To: David Marchand; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/145ffdbb7ea750f4d3b17446bde22a805957ad71

Thanks.

Luca Boccassi

---
From 145ffdbb7ea750f4d3b17446bde22a805957ad71 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Mon, 27 Feb 2023 11:59:27 +0100
Subject: [PATCH] vhost: fix OOB access for invalid vhost ID

[ upstream commit 1c80a404fd82b816d5c3ebb7cd9e89804ac63984 ]

The net/vhost pmd currently provides a -1 vid when disabling interrupt
after a virtio port got disconnected.

This can be caught when running with ASan.

First, start dpdk-l3fwd-power in interrupt mode with a net/vhost port.

$ ./build-clang/examples/dpdk-l3fwd-power -l0,1 --in-memory \
	-a 0000:00:00.0 \
	--vdev net_vhost0,iface=plop.sock,client=1\
	-- \
	-p 0x1 \
	--interrupt-only \
	--config '(0,0,1)' \
	--parse-ptype 0

Then start testpmd with virtio-user.

$ ./build-clang/app/dpdk-testpmd -l0,2 --single-file-segment --in-memory \
	-a 0000:00:00.0 \
	--vdev net_virtio_user0,path=plop.sock,server=1 \
	-- \
	-i

Finally stop testpmd.
ASan then splats in dpdk-l3fwd-power:

=================================================================
==3641005==ERROR: AddressSanitizer: global-buffer-overflow on address
	0x000005ed0778 at pc 0x000001270f81 bp 0x7fddbd2eee20
	sp 0x7fddbd2eee18
READ of size 8 at 0x000005ed0778 thread T2
    #0 0x1270f80 in get_device .../lib/vhost/vhost.h:801:27
    #1 0x1270f80 in rte_vhost_get_vhost_vring .../lib/vhost/vhost.c:951:8
    #2 0x3ac95cb in eth_rxq_intr_disable
	.../drivers/net/vhost/rte_eth_vhost.c:647:8
    #3 0x170e0bf in rte_eth_dev_rx_intr_disable
	.../lib/ethdev/rte_ethdev.c:5443:25
    #4 0xf72ba7 in turn_on_off_intr .../examples/l3fwd-power/main.c:881:4
    #5 0xf71045 in main_intr_loop .../examples/l3fwd-power/main.c:1061:6
    #6 0x17f9292 in eal_thread_loop
	.../lib/eal/common/eal_common_thread.c:210:9
    #7 0x18373f5 in eal_worker_thread_loop .../lib/eal/linux/eal.c:915:2
    #8 0x7fddc16ae12c in start_thread (/lib64/libc.so.6+0x8b12c)
	(BuildId: 81daba31ee66dbd63efdc4252a872949d874d136)
    #9 0x7fddc172fbbf in __GI___clone3 (/lib64/libc.so.6+0x10cbbf)
	(BuildId: 81daba31ee66dbd63efdc4252a872949d874d136)

0x000005ed0778 is located 8 bytes to the left of global variable
	'vhost_devices' defined in '.../lib/vhost/vhost.c:24'
	(0x5ed0780) of size 8192
0x000005ed0778 is located 20 bytes to the right of global variable
	'vhost_config_log_level' defined in '.../lib/vhost/vhost.c:2174'
	(0x5ed0760) of size 4
SUMMARY: AddressSanitizer: global-buffer-overflow
	.../lib/vhost/vhost.h:801:27 in get_device
Shadow bytes around the buggy address:
  0x000080bd2090: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
  0x000080bd20a0: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
  0x000080bd20b0: f9 f9 f9 f9 00 f9 f9 f9 00 f9 f9 f9 00 f9 f9 f9
  0x000080bd20c0: 00 00 00 00 00 00 00 f9 f9 f9 f9 f9 04 f9 f9 f9
  0x000080bd20d0: 00 00 00 00 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 00
=>0x000080bd20e0: 00 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9 04 f9 f9[f9]
  0x000080bd20f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x000080bd2100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x000080bd2110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x000080bd2120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x000080bd2130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
Thread T2 created by T0 here:
    #0 0xe98996 in __interceptor_pthread_create
	(.examples/dpdk-l3fwd-power+0xe98996)
	(BuildId: d0b984a3b0287b9e0f301b73426fa921aeecca3a)
    #1 0x1836767 in eal_worker_thread_create .../lib/eal/linux/eal.c:952:6
    #2 0x1834b83 in rte_eal_init .../lib/eal/linux/eal.c:1257:9
    #3 0xf68902 in main .../examples/l3fwd-power/main.c:2496:8
    #4 0x7fddc164a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f)
	(BuildId: 81daba31ee66dbd63efdc4252a872949d874d136)

==3641005==ABORTING

More generally, any application passing an incorrect vid would trigger
such an OOB access.

Fixes: 4796ad63ba1f ("examples/vhost: import userspace vhost application")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 lib/librte_vhost/vhost.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
index 92b67a2c6f..ee4e5317d0 100644
--- a/lib/librte_vhost/vhost.h
+++ b/lib/librte_vhost/vhost.h
@@ -663,7 +663,10 @@ hva_to_gpa(struct virtio_net *dev, uint64_t vva, uint64_t len)
 static __rte_always_inline struct virtio_net *
 get_device(int vid)
 {
-	struct virtio_net *dev = vhost_devices[vid];
+	struct virtio_net *dev = NULL;
+
+	if (likely(vid >= 0 && vid < RTE_MAX_VHOST_DEVICE))
+		dev = vhost_devices[vid];
 
 	if (unlikely(!dev)) {
 		VHOST_LOG_CONFIG(ERR,
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:50.000737881 +0000
+++ 0006-vhost-fix-OOB-access-for-invalid-vhost-ID.patch	2023-03-15 22:44:49.507848667 +0000
@@ -1 +1 @@
-From 1c80a404fd82b816d5c3ebb7cd9e89804ac63984 Mon Sep 17 00:00:00 2001
+From 145ffdbb7ea750f4d3b17446bde22a805957ad71 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 1c80a404fd82b816d5c3ebb7cd9e89804ac63984 ]
+
@@ -109 +110,0 @@
-Cc: stable@dpdk.org
@@ -114 +115 @@
- lib/vhost/vhost.h | 5 ++++-
+ lib/librte_vhost/vhost.h | 5 ++++-
@@ -117,5 +118,5 @@
-diff --git a/lib/vhost/vhost.h b/lib/vhost/vhost.h
-index 5750f0c005..954c0ac197 100644
---- a/lib/vhost/vhost.h
-+++ b/lib/vhost/vhost.h
-@@ -798,7 +798,10 @@ hva_to_gpa(struct virtio_net *dev, uint64_t vva, uint64_t len)
+diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
+index 92b67a2c6f..ee4e5317d0 100644
+--- a/lib/librte_vhost/vhost.h
++++ b/lib/librte_vhost/vhost.h
+@@ -663,7 +663,10 @@ hva_to_gpa(struct virtio_net *dev, uint64_t vva, uint64_t len)
@@ -132 +133 @@
- 		VHOST_LOG_CONFIG("device", ERR, "(%d) device not found.\n", vid);
+ 		VHOST_LOG_CONFIG(ERR,

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'Revert "vhost: fix OOB access for invalid vhost ID"' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (4 preceding siblings ...)
  2023-03-15 22:45     ` patch 'vhost: fix OOB access for invalid vhost ID' " luca.boccassi
@ 2023-03-15 22:45     ` luca.boccassi
  2023-03-15 22:45     ` patch 'net/virtio: deduce IP length for TSO checksum' " luca.boccassi
                       ` (31 subsequent siblings)
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:45 UTC (permalink / raw)
  To: Luca Boccassi; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/9bf78c69c32e0e0256e435ea4ecd0a63450afa55

Thanks.

Luca Boccassi

---
From 9bf78c69c32e0e0256e435ea4ecd0a63450afa55 Mon Sep 17 00:00:00 2001
From: Luca Boccassi <bluca@debian.org>
Date: Tue, 14 Mar 2023 23:32:47 +0000
Subject: [PATCH] Revert "vhost: fix OOB access for invalid vhost ID"

This reverts commit 145ffdbb7ea750f4d3b17446bde22a805957ad71.
---
 lib/librte_vhost/vhost.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
index ee4e5317d0..92b67a2c6f 100644
--- a/lib/librte_vhost/vhost.h
+++ b/lib/librte_vhost/vhost.h
@@ -663,10 +663,7 @@ hva_to_gpa(struct virtio_net *dev, uint64_t vva, uint64_t len)
 static __rte_always_inline struct virtio_net *
 get_device(int vid)
 {
-	struct virtio_net *dev = NULL;
-
-	if (likely(vid >= 0 && vid < RTE_MAX_VHOST_DEVICE))
-		dev = vhost_devices[vid];
+	struct virtio_net *dev = vhost_devices[vid];
 
 	if (unlikely(!dev)) {
 		VHOST_LOG_CONFIG(ERR,
-- 
2.39.2


^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/virtio: deduce IP length for TSO checksum' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (5 preceding siblings ...)
  2023-03-15 22:45     ` patch 'Revert "vhost: fix OOB access for invalid vhost ID"' " luca.boccassi
@ 2023-03-15 22:45     ` luca.boccassi
  2023-03-15 22:46     ` patch 'app/testpmd: fix Tx preparation in checksum engine' " luca.boccassi
                       ` (30 subsequent siblings)
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:45 UTC (permalink / raw)
  To: Boleslav Stankevich; +Cc: Andrew Rybchenko, Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/74a0293db637e616478d0a55de93e002c6d52641

Thanks.

Luca Boccassi

---
From 74a0293db637e616478d0a55de93e002c6d52641 Mon Sep 17 00:00:00 2001
From: Boleslav Stankevich <boleslav.stankevich@oktetlabs.ru>
Date: Fri, 3 Mar 2023 14:19:29 +0300
Subject: [PATCH] net/virtio: deduce IP length for TSO checksum

[ upstream commit d069c80a5d8c0a05033932421851cdb7159de0df ]

The length of TSO payload could not fit into 16 bits provided by the
IPv4 total length and IPv6 payload length fields. Thus, deduce it
from the length of the packet.

Fixes: 696573046e9e ("net/virtio: support TSO")

Signed-off-by: Boleslav Stankevich <boleslav.stankevich@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/net/virtio/virtio_rxtx.c | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index fe6f9942a9..469da168ec 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -421,29 +421,36 @@ virtio_tso_fix_cksum(struct rte_mbuf *m)
 	if (likely(rte_pktmbuf_data_len(m) >= m->l2_len + m->l3_len +
 			m->l4_len)) {
 		struct rte_ipv4_hdr *iph;
-		struct rte_ipv6_hdr *ip6h;
 		struct rte_tcp_hdr *th;
-		uint16_t prev_cksum, new_cksum, ip_len, ip_paylen;
+		uint16_t prev_cksum, new_cksum;
+		uint32_t ip_paylen;
 		uint32_t tmp;
 
 		iph = rte_pktmbuf_mtod_offset(m,
 					struct rte_ipv4_hdr *, m->l2_len);
 		th = RTE_PTR_ADD(iph, m->l3_len);
+
+		/*
+		 * Calculate IPv4 header checksum with current total length value
+		 * (whatever it is) to have correct checksum after update on edits
+		 * done by TSO.
+		 */
 		if ((iph->version_ihl >> 4) == 4) {
 			iph->hdr_checksum = 0;
 			iph->hdr_checksum = rte_ipv4_cksum(iph);
-			ip_len = iph->total_length;
-			ip_paylen = rte_cpu_to_be_16(rte_be_to_cpu_16(ip_len) -
-				m->l3_len);
-		} else {
-			ip6h = (struct rte_ipv6_hdr *)iph;
-			ip_paylen = ip6h->payload_len;
 		}
 
+		/*
+		 * Do not use IPv4 total length and IPv6 payload length fields to get
+		 * TSO payload length since it could not fit into 16 bits.
+		 */
+		ip_paylen = rte_cpu_to_be_32(rte_pktmbuf_pkt_len(m) - m->l2_len -
+					m->l3_len);
+
 		/* calculate the new phdr checksum not including ip_paylen */
 		prev_cksum = th->cksum;
 		tmp = prev_cksum;
-		tmp += ip_paylen;
+		tmp += (ip_paylen & 0xffff) + (ip_paylen >> 16);
 		tmp = (tmp & 0xffff) + (tmp >> 16);
 		new_cksum = tmp;
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:50.100977161 +0000
+++ 0008-net-virtio-deduce-IP-length-for-TSO-checksum.patch	2023-03-15 22:44:49.515848835 +0000
@@ -1 +1 @@
-From d069c80a5d8c0a05033932421851cdb7159de0df Mon Sep 17 00:00:00 2001
+From 74a0293db637e616478d0a55de93e002c6d52641 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit d069c80a5d8c0a05033932421851cdb7159de0df ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -17 +17,0 @@
- .mailmap                         |  1 +
@@ -19 +19 @@
- 2 files changed, 17 insertions(+), 9 deletions(-)
+ 1 file changed, 16 insertions(+), 9 deletions(-)
@@ -21,12 +20,0 @@
-diff --git a/.mailmap b/.mailmap
-index a9f4f28fba..8e7d78f37e 100644
---- a/.mailmap
-+++ b/.mailmap
-@@ -167,6 +167,7 @@ Bin Huang <brian.huangbin@huawei.com> <bin.huang@hxt-semitech.com>
- Bin Zheng <zhengbin.89740@bytedance.com>
- Björn Töpel <bjorn.topel@intel.com>
- Bo Chen <box.c.chen@intel.com>
-+Boleslav Stankevich <boleslav.stankevich@oktetlabs.ru>
- Boon Ang <bang@vmware.com>
- Boris Pismenny <borisp@mellanox.com>
- Brandon Lo <blo@iol.unh.edu>
@@ -34 +22 @@
-index 2d0afd3302..e48ff3cca7 100644
+index fe6f9942a9..469da168ec 100644
@@ -37 +25 @@
-@@ -404,29 +404,36 @@ virtio_tso_fix_cksum(struct rte_mbuf *m)
+@@ -421,29 +421,36 @@ virtio_tso_fix_cksum(struct rte_mbuf *m)

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'app/testpmd: fix Tx preparation in checksum engine' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (6 preceding siblings ...)
  2023-03-15 22:45     ` patch 'net/virtio: deduce IP length for TSO checksum' " luca.boccassi
@ 2023-03-15 22:46     ` luca.boccassi
  2023-03-15 22:46     ` patch 'app/testpmd: fix packet count in IEEE 1588 " luca.boccassi
                       ` (29 subsequent siblings)
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:46 UTC (permalink / raw)
  To: David Marchand; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/609789aebdf2a1aa9944fab0e9a6704d258d17a0

Thanks.

Luca Boccassi

---
From 609789aebdf2a1aa9944fab0e9a6704d258d17a0 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Mon, 20 Feb 2023 19:34:54 +0100
Subject: [PATCH] app/testpmd: fix Tx preparation in checksum engine

[ upstream commit 88a0b0f3858bf430616fe2bcac6f3eee05c383f5 ]

"unprepared" packets could get to the wire in the retry loop.

Split packets freeing in two stages: one for preparation failure, and
one for transmission failure.
Adjust dropped counter update accordingly.

Fixes: 6b520d54ebfe ("app/testpmd: use Tx preparation in checksum engine")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 app/test-pmd/csumonly.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index aa1c60e7b3..7a91fcb63f 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -1133,9 +1133,12 @@ tunnel_update:
 
 	nb_prep = rte_eth_tx_prepare(fs->tx_port, fs->tx_queue,
 			tx_pkts_burst, nb_rx);
-	if (nb_prep != nb_rx)
+	if (nb_prep != nb_rx) {
 		printf("Preparing packet burst to transmit failed: %s\n",
 				rte_strerror(rte_errno));
+		fs->fwd_dropped += (nb_rx - nb_prep);
+		rte_pktmbuf_free_bulk(&tx_pkts_burst[nb_prep], nb_rx - nb_prep);
+	}
 
 	nb_tx = rte_eth_tx_burst(fs->tx_port, fs->tx_queue, tx_pkts_burst,
 			nb_prep);
@@ -1143,12 +1146,12 @@ tunnel_update:
 	/*
 	 * Retry if necessary
 	 */
-	if (unlikely(nb_tx < nb_rx) && fs->retry_enabled) {
+	if (unlikely(nb_tx < nb_prep) && fs->retry_enabled) {
 		retry = 0;
-		while (nb_tx < nb_rx && retry++ < burst_tx_retry_num) {
+		while (nb_tx < nb_prep && retry++ < burst_tx_retry_num) {
 			rte_delay_us(burst_tx_delay_time);
 			nb_tx += rte_eth_tx_burst(fs->tx_port, fs->tx_queue,
-					&tx_pkts_burst[nb_tx], nb_rx - nb_tx);
+					&tx_pkts_burst[nb_tx], nb_prep - nb_tx);
 		}
 	}
 	fs->tx_packets += nb_tx;
@@ -1157,11 +1160,11 @@ tunnel_update:
 	fs->rx_bad_outer_l4_csum += rx_bad_outer_l4_csum;
 
 	inc_tx_burst_stats(fs, nb_tx);
-	if (unlikely(nb_tx < nb_rx)) {
-		fs->fwd_dropped += (nb_rx - nb_tx);
+	if (unlikely(nb_tx < nb_prep)) {
+		fs->fwd_dropped += (nb_prep - nb_tx);
 		do {
 			rte_pktmbuf_free(tx_pkts_burst[nb_tx]);
-		} while (++nb_tx < nb_rx);
+		} while (++nb_tx < nb_prep);
 	}
 
 	get_end_cycles(fs, start_tsc);
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:50.159222075 +0000
+++ 0009-app-testpmd-fix-Tx-preparation-in-checksum-engine.patch	2023-03-15 22:44:49.519848919 +0000
@@ -1 +1 @@
-From 88a0b0f3858bf430616fe2bcac6f3eee05c383f5 Mon Sep 17 00:00:00 2001
+From 609789aebdf2a1aa9944fab0e9a6704d258d17a0 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 88a0b0f3858bf430616fe2bcac6f3eee05c383f5 ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
-index 1c24598515..90a59e0aa5 100644
+index aa1c60e7b3..7a91fcb63f 100644
@@ -25 +26 @@
-@@ -1168,10 +1168,13 @@ tunnel_update:
+@@ -1133,9 +1133,12 @@ tunnel_update:
@@ -31,3 +32,2 @@
- 		fprintf(stderr,
- 			"Preparing packet burst to transmit failed: %s\n",
- 			rte_strerror(rte_errno));
+ 		printf("Preparing packet burst to transmit failed: %s\n",
+ 				rte_strerror(rte_errno));
@@ -40 +40 @@
-@@ -1179,12 +1182,12 @@ tunnel_update:
+@@ -1143,12 +1146,12 @@ tunnel_update:
@@ -56,2 +56,2 @@
-@@ -1194,11 +1197,11 @@ tunnel_update:
- 	fs->rx_bad_outer_ip_csum += rx_bad_outer_ip_csum;
+@@ -1157,11 +1160,11 @@ tunnel_update:
+ 	fs->rx_bad_outer_l4_csum += rx_bad_outer_l4_csum;

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'app/testpmd: fix packet count in IEEE 1588 engine' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (7 preceding siblings ...)
  2023-03-15 22:46     ` patch 'app/testpmd: fix Tx preparation in checksum engine' " luca.boccassi
@ 2023-03-15 22:46     ` luca.boccassi
  2023-03-15 22:46     ` patch 'app/testpmd: fix packet transmission in noisy VNF " luca.boccassi
                       ` (28 subsequent siblings)
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:46 UTC (permalink / raw)
  To: David Marchand; +Cc: Aman Singh, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From fa73c89d4a4e1757d7ca668752f65731767c760c Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Mon, 20 Feb 2023 19:34:55 +0100
Subject: [PATCH] app/testpmd: fix packet count in IEEE 1588 engine

[ upstream commit 32567c6d06cd1bb823215476355b48bb2002e1fd ]

Don't count a packet has been transmitted before it is done.

Fixes: af75078fece3 ("first public release")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Aman Singh <aman.deep.singh@intel.com>
---
 app/test-pmd/ieee1588fwd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-pmd/ieee1588fwd.c b/app/test-pmd/ieee1588fwd.c
index 5876aafa5b..4875257e4d 100644
--- a/app/test-pmd/ieee1588fwd.c
+++ b/app/test-pmd/ieee1588fwd.c
@@ -184,13 +184,13 @@ ieee1588_packet_fwd(struct fwd_stream *fs)
 
 	/* Forward PTP packet with hardware TX timestamp */
 	mb->ol_flags |= PKT_TX_IEEE1588_TMST;
-	fs->tx_packets += 1;
 	if (rte_eth_tx_burst(fs->rx_port, fs->tx_queue, &mb, 1) == 0) {
 		printf("Port %u sent PTP packet dropped\n", fs->rx_port);
 		fs->fwd_dropped += 1;
 		rte_pktmbuf_free(mb);
 		return;
 	}
+	fs->tx_packets += 1;
 
 	/*
 	 * Check the TX timestamp.
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:50.212298529 +0000
+++ 0010-app-testpmd-fix-packet-count-in-IEEE-1588-engine.patch	2023-03-15 22:44:49.523849003 +0000
@@ -1 +1 @@
-From 32567c6d06cd1bb823215476355b48bb2002e1fd Mon Sep 17 00:00:00 2001
+From fa73c89d4a4e1757d7ca668752f65731767c760c Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 32567c6d06cd1bb823215476355b48bb2002e1fd ]
+
@@ -9 +10,0 @@
-Cc: stable@dpdk.org
@@ -18 +19 @@
-index fc4e2d014c..896d5ef26a 100644
+index 5876aafa5b..4875257e4d 100644
@@ -24 +25 @@
- 	mb->ol_flags |= RTE_MBUF_F_TX_IEEE1588_TMST;
+ 	mb->ol_flags |= PKT_TX_IEEE1588_TMST;

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'app/testpmd: fix packet transmission in noisy VNF engine' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (8 preceding siblings ...)
  2023-03-15 22:46     ` patch 'app/testpmd: fix packet count in IEEE 1588 " luca.boccassi
@ 2023-03-15 22:46     ` luca.boccassi
  2023-03-15 22:46     ` patch 'net/nfp: fix getting RSS configuration' " luca.boccassi
                       ` (27 subsequent siblings)
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:46 UTC (permalink / raw)
  To: David Marchand; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From bad17c2433b7c934b81ed961bd4ddf78b9aa3521 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Mon, 20 Feb 2023 19:34:57 +0100
Subject: [PATCH] app/testpmd: fix packet transmission in noisy VNF engine

[ upstream commit c2acd2db16cba89f403a980da5f4b6764085b01d ]

nb_rx relates to the number of packets received from the driver.
nb_tx is the total number of packets transmitted by this forward engine.

Fix the retry stage, for dequeued packets, as it was incorrectly
passing nb_rx / nb_tx as bounds of the tmp_pkts[] array, and fix tx stats
accordingly.

Fixes: 3c156061b938 ("app/testpmd: add noisy neighbour forwarding mode")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 app/test-pmd/noisy_vnf.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/noisy_vnf.c b/app/test-pmd/noisy_vnf.c
index d70940006d..1be5f77efe 100644
--- a/app/test-pmd/noisy_vnf.c
+++ b/app/test-pmd/noisy_vnf.c
@@ -213,9 +213,10 @@ flush:
 		sent = rte_eth_tx_burst(fs->tx_port, fs->tx_queue,
 					 tmp_pkts, nb_deqd);
 		if (unlikely(sent < nb_deqd) && fs->retry_enabled)
-			nb_tx += do_retry(nb_rx, nb_tx, tmp_pkts, fs);
-		inc_tx_burst_stats(fs, nb_tx);
+			sent += do_retry(nb_deqd, sent, tmp_pkts, fs);
+		inc_tx_burst_stats(fs, sent);
 		fs->fwd_dropped += drop_pkts(tmp_pkts, nb_deqd, sent);
+		nb_tx += sent;
 		ncf->prev_time = rte_get_timer_cycles();
 	}
 }
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:50.259993645 +0000
+++ 0011-app-testpmd-fix-packet-transmission-in-noisy-VNF-eng.patch	2023-03-15 22:44:49.523849003 +0000
@@ -1 +1 @@
-From c2acd2db16cba89f403a980da5f4b6764085b01d Mon Sep 17 00:00:00 2001
+From bad17c2433b7c934b81ed961bd4ddf78b9aa3521 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit c2acd2db16cba89f403a980da5f4b6764085b01d ]
+
@@ -14 +15,0 @@
-Cc: stable@dpdk.org
@@ -23 +24 @@
-index ce5a3e5e69..0e72dc034f 100644
+index d70940006d..1be5f77efe 100644
@@ -26 +27 @@
-@@ -217,9 +217,10 @@ flush:
+@@ -213,9 +213,10 @@ flush:
@@ -38 +39 @@
- end:
+ }

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/nfp: fix getting RSS configuration' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (9 preceding siblings ...)
  2023-03-15 22:46     ` patch 'app/testpmd: fix packet transmission in noisy VNF " luca.boccassi
@ 2023-03-15 22:46     ` luca.boccassi
  2023-03-15 22:46     ` patch 'net/ixgbe: fix IPv6 mask in flow director' " luca.boccassi
                       ` (26 subsequent siblings)
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:46 UTC (permalink / raw)
  To: Long Wu; +Cc: Chaoyong He, Niklas Söderlund, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/1c5ef4ee290c42fc4d394f3d4fda873194c97036

Thanks.

Luca Boccassi

---
From 1c5ef4ee290c42fc4d394f3d4fda873194c97036 Mon Sep 17 00:00:00 2001
From: Long Wu <long.wu@corigine.com>
Date: Tue, 21 Feb 2023 13:52:22 +0800
Subject: [PATCH] net/nfp: fix getting RSS configuration
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit ef26b8a08cd2ba0b47d3ca71316ea6e865abb6fd ]

"NFP_NET_CFG_RSS_IPV4" and "NFP_NET_CFG_RSS_IPV6" represent that
firmware will calculate RSS base on L3 rather than UDP or TCP
information from packets. So the logic of return RSS configuration in
driver is wrong.

Modify code to return the right configuration.

Fixes: 934e4c60fbff ("nfp: add RSS")

Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_net.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index f4925e1879..4957cc7eda 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -2652,7 +2652,7 @@ nfp_net_rss_hash_conf_get(struct rte_eth_dev *dev,
 	cfg_rss_ctrl = nn_cfg_readl(hw, NFP_NET_CFG_RSS_CTRL);
 
 	if (cfg_rss_ctrl & NFP_NET_CFG_RSS_IPV4)
-		rss_hf |= ETH_RSS_NONFRAG_IPV4_TCP | ETH_RSS_NONFRAG_IPV4_UDP;
+		rss_hf |= ETH_RSS_IPV4;
 
 	if (cfg_rss_ctrl & NFP_NET_CFG_RSS_IPV4_TCP)
 		rss_hf |= ETH_RSS_NONFRAG_IPV4_TCP;
@@ -2667,7 +2667,7 @@ nfp_net_rss_hash_conf_get(struct rte_eth_dev *dev,
 		rss_hf |= ETH_RSS_NONFRAG_IPV6_UDP;
 
 	if (cfg_rss_ctrl & NFP_NET_CFG_RSS_IPV6)
-		rss_hf |= ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_NONFRAG_IPV6_UDP;
+		rss_hf |= ETH_RSS_IPV6;
 
 	/* Propagate current RSS hash functions to caller */
 	rss_conf->rss_hf = rss_hf;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:50.320472535 +0000
+++ 0012-net-nfp-fix-getting-RSS-configuration.patch	2023-03-15 22:44:49.531849171 +0000
@@ -1 +1 @@
-From ef26b8a08cd2ba0b47d3ca71316ea6e865abb6fd Mon Sep 17 00:00:00 2001
+From 1c5ef4ee290c42fc4d394f3d4fda873194c97036 Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit ef26b8a08cd2ba0b47d3ca71316ea6e865abb6fd ]
+
@@ -17 +18,0 @@
-Cc: stable@dpdk.org
@@ -23 +24 @@
- drivers/net/nfp/nfp_common.c | 4 ++--
+ drivers/net/nfp/nfp_net.c | 4 ++--
@@ -26,5 +27,5 @@
-diff --git a/drivers/net/nfp/nfp_common.c b/drivers/net/nfp/nfp_common.c
-index 837056cc12..5922bfea8e 100644
---- a/drivers/net/nfp/nfp_common.c
-+++ b/drivers/net/nfp/nfp_common.c
-@@ -1420,7 +1420,7 @@ nfp_net_rss_hash_conf_get(struct rte_eth_dev *dev,
+diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
+index f4925e1879..4957cc7eda 100644
+--- a/drivers/net/nfp/nfp_net.c
++++ b/drivers/net/nfp/nfp_net.c
+@@ -2652,7 +2652,7 @@ nfp_net_rss_hash_conf_get(struct rte_eth_dev *dev,
@@ -34,2 +35,2 @@
--		rss_hf |= RTE_ETH_RSS_NONFRAG_IPV4_TCP | RTE_ETH_RSS_NONFRAG_IPV4_UDP;
-+		rss_hf |= RTE_ETH_RSS_IPV4;
+-		rss_hf |= ETH_RSS_NONFRAG_IPV4_TCP | ETH_RSS_NONFRAG_IPV4_UDP;
++		rss_hf |= ETH_RSS_IPV4;
@@ -38,3 +39,3 @@
- 		rss_hf |= RTE_ETH_RSS_NONFRAG_IPV4_TCP;
-@@ -1435,7 +1435,7 @@ nfp_net_rss_hash_conf_get(struct rte_eth_dev *dev,
- 		rss_hf |= RTE_ETH_RSS_NONFRAG_IPV6_UDP;
+ 		rss_hf |= ETH_RSS_NONFRAG_IPV4_TCP;
+@@ -2667,7 +2667,7 @@ nfp_net_rss_hash_conf_get(struct rte_eth_dev *dev,
+ 		rss_hf |= ETH_RSS_NONFRAG_IPV6_UDP;
@@ -43,2 +44,2 @@
--		rss_hf |= RTE_ETH_RSS_NONFRAG_IPV4_UDP | RTE_ETH_RSS_NONFRAG_IPV6_UDP;
-+		rss_hf |= RTE_ETH_RSS_IPV6;
+-		rss_hf |= ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_NONFRAG_IPV6_UDP;
++		rss_hf |= ETH_RSS_IPV6;
@@ -46,2 +47,2 @@
- 	if (cfg_rss_ctrl & NFP_NET_CFG_RSS_IPV4_SCTP)
- 		rss_hf |= RTE_ETH_RSS_NONFRAG_IPV4_SCTP;
+ 	/* Propagate current RSS hash functions to caller */
+ 	rss_conf->rss_hf = rss_hf;

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/ixgbe: fix IPv6 mask in flow director' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (10 preceding siblings ...)
  2023-03-15 22:46     ` patch 'net/nfp: fix getting RSS configuration' " luca.boccassi
@ 2023-03-15 22:46     ` luca.boccassi
  2023-03-15 22:46     ` patch 'net/i40e: revert link status check on device start' " luca.boccassi
                       ` (25 subsequent siblings)
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:46 UTC (permalink / raw)
  To: Kaiwen Deng; +Cc: Song Jiale, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From a24c411c18a7601100e1263b85ec13d744e14de2 Mon Sep 17 00:00:00 2001
From: Kaiwen Deng <kaiwenx.deng@intel.com>
Date: Fri, 3 Mar 2023 12:52:26 +0800
Subject: [PATCH] net/ixgbe: fix IPv6 mask in flow director

[ upstream commit 444505f933f197bd064c7f801fa86e88d5edfce5 ]

Rules without addr mask cannot be created together in ixgbe
when setting IPv6 addr mask to default value as 0.

This commit is to change the default value of IPv6 addr mask as '0xFF'.

Fixes: cba954b7beda ("net/ixgbe: enable IPv6 mask in flow rules")
Fixes: 7d629cacedee ("net/ixgbe: enable IPv6 for consistent API")

Signed-off-by: Kaiwen Deng <kaiwenx.deng@intel.com>
Tested-by: Song Jiale <songx.jiale@intel.com>
---
 drivers/net/ixgbe/ixgbe_flow.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c
index 6d75ff73ef..7e5b684c5a 100644
--- a/drivers/net/ixgbe/ixgbe_flow.c
+++ b/drivers/net/ixgbe/ixgbe_flow.c
@@ -1645,10 +1645,6 @@ ixgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev,
 	memset(&rule->mask, 0xFF, sizeof(struct ixgbe_hw_fdir_mask));
 	rule->mask.vlan_tci_mask = 0;
 	rule->mask.flex_bytes_mask = 0;
-	rule->mask.dst_port_mask = 0;
-	rule->mask.src_port_mask = 0;
-	rule->mask.src_ipv6_mask = 0;
-	rule->mask.dst_ipv6_mask = 0;
 
 	/**
 	 * The first not void item should be
@@ -1922,9 +1918,9 @@ ixgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev,
 
 		/* check src addr mask */
 		for (j = 0; j < 16; j++) {
-			if (ipv6_mask->hdr.src_addr[j] == UINT8_MAX) {
-				rule->mask.src_ipv6_mask |= 1 << j;
-			} else if (ipv6_mask->hdr.src_addr[j] != 0) {
+			if (ipv6_mask->hdr.src_addr[j] == 0) {
+				rule->mask.src_ipv6_mask &= ~(1 << j);
+			} else if (ipv6_mask->hdr.src_addr[j] != UINT8_MAX) {
 				memset(rule, 0, sizeof(struct ixgbe_fdir_rule));
 				rte_flow_error_set(error, EINVAL,
 					RTE_FLOW_ERROR_TYPE_ITEM,
@@ -1935,9 +1931,9 @@ ixgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev,
 
 		/* check dst addr mask */
 		for (j = 0; j < 16; j++) {
-			if (ipv6_mask->hdr.dst_addr[j] == UINT8_MAX) {
-				rule->mask.dst_ipv6_mask |= 1 << j;
-			} else if (ipv6_mask->hdr.dst_addr[j] != 0) {
+			if (ipv6_mask->hdr.dst_addr[j] == 0) {
+				rule->mask.dst_ipv6_mask &= ~(1 << j);
+			} else if (ipv6_mask->hdr.dst_addr[j] != UINT8_MAX) {
 				memset(rule, 0, sizeof(struct ixgbe_fdir_rule));
 				rte_flow_error_set(error, EINVAL,
 					RTE_FLOW_ERROR_TYPE_ITEM,
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:50.370389227 +0000
+++ 0013-net-ixgbe-fix-IPv6-mask-in-flow-director.patch	2023-03-15 22:44:49.539849338 +0000
@@ -1 +1 @@
-From 444505f933f197bd064c7f801fa86e88d5edfce5 Mon Sep 17 00:00:00 2001
+From a24c411c18a7601100e1263b85ec13d744e14de2 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 444505f933f197bd064c7f801fa86e88d5edfce5 ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -18 +18,0 @@
- .mailmap                       |  1 +
@@ -20 +20 @@
- 2 files changed, 7 insertions(+), 10 deletions(-)
+ 1 file changed, 6 insertions(+), 10 deletions(-)
@@ -22,12 +21,0 @@
-diff --git a/.mailmap b/.mailmap
-index 69b6f4de1d..5b42f87d1e 100644
---- a/.mailmap
-+++ b/.mailmap
-@@ -1253,6 +1253,7 @@ Smadar Fuks <smadarf@marvell.com>
- Solal Pirelli <solal.pirelli@gmail.com>
- Solganik Alexander <sashas@lightbitslabs.com>
- Somnath Kotur <somnath.kotur@broadcom.com>
-+Song Jiale <songx.jiale@intel.com>
- Song Zhu <song.zhu@arm.com>
- Sony Chacko <sony.chacko@qlogic.com>
- Sotiris Salloumis <sotiris.salloumis@ericsson.com>
@@ -35 +23 @@
-index 79c84044af..eac81ee489 100644
+index 6d75ff73ef..7e5b684c5a 100644

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/i40e: revert link status check on device start' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (11 preceding siblings ...)
  2023-03-15 22:46     ` patch 'net/ixgbe: fix IPv6 mask in flow director' " luca.boccassi
@ 2023-03-15 22:46     ` luca.boccassi
  2023-03-15 22:46     ` patch 'net/nfp: fix MTU configuration order' " luca.boccassi
                       ` (24 subsequent siblings)
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:46 UTC (permalink / raw)
  To: David Marchand; +Cc: Simei Su, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From dd692f5dde53c2af1dfc50b2d3ffac031953e9e5 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Tue, 13 Dec 2022 10:18:37 +0100
Subject: [PATCH] net/i40e: revert link status check on device start

[ upstream commit a8ca8edf8c076c765c6d142ab4664a1f61414233 ]

The mentioned changes broke existing applications when the link status
of i40e ports is down at the time the port is started.
Revert those changes, the original issue will need a different fix.

Fixes: a4ba77367923 ("net/i40e: enable maximum frame size at port level")
Fixes: 2184f7cdeeaa ("net/i40e: fix max frame size config at port level")
Fixes: 719469f13b11 ("net/i40e: fix jumbo frame Rx with X722")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Simei Su <simei.su@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 50 +++++-----------------------------
 1 file changed, 7 insertions(+), 43 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index c5eb7ccddc..8eb90909b8 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -397,7 +397,6 @@ static int i40e_set_default_mac_addr(struct rte_eth_dev *dev,
 				      struct rte_ether_addr *mac_addr);
 
 static int i40e_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu);
-static void i40e_set_mac_max_frame(struct rte_eth_dev *dev, uint16_t size);
 
 static int i40e_ethertype_filter_convert(
 	const struct rte_eth_ethertype_filter *input,
@@ -1779,6 +1778,11 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused)
 	/* initialize mirror rule list */
 	TAILQ_INIT(&pf->mirror_list);
 
+	/* Set the max frame size to 0x2600 by default,
+	 * in case other drivers changed the default value.
+	 */
+	i40e_aq_set_mac_config(hw, I40E_FRAME_SIZE_MAX, TRUE, false, 0, NULL);
+
 	/* initialize RSS rule list */
 	TAILQ_INIT(&pf->rss_config_list);
 
@@ -2430,7 +2434,6 @@ i40e_dev_start(struct rte_eth_dev *dev)
 	uint32_t intr_vector = 0;
 	struct i40e_vsi *vsi;
 	uint16_t nb_rxq, nb_txq;
-	uint16_t max_frame_size;
 
 	hw->adapter_stopped = 0;
 
@@ -2572,9 +2575,6 @@ i40e_dev_start(struct rte_eth_dev *dev)
 			    "please call hierarchy_commit() "
 			    "before starting the port");
 
-	max_frame_size = dev->data->mtu + I40E_ETH_OVERHEAD;
-	i40e_set_mac_max_frame(dev, max_frame_size);
-
 	return I40E_SUCCESS;
 
 tx_err:
@@ -2942,9 +2942,6 @@ i40e_dev_set_link_down(struct rte_eth_dev *dev)
 	return i40e_phy_conf_link(hw, abilities, speed, false);
 }
 
-#define CHECK_INTERVAL             100  /* 100ms */
-#define MAX_REPEAT_TIME            10  /* 1s (10 * 100ms) in total */
-
 static __rte_always_inline void
 update_link_reg(struct i40e_hw *hw, struct rte_eth_link *link)
 {
@@ -3012,6 +3009,8 @@ static __rte_always_inline void
 update_link_aq(struct i40e_hw *hw, struct rte_eth_link *link,
 	bool enable_lse, int wait_to_complete)
 {
+#define CHECK_INTERVAL             100  /* 100ms */
+#define MAX_REPEAT_TIME            10  /* 1s (10 * 100ms) in total */
 	uint32_t rep_cnt = MAX_REPEAT_TIME;
 	struct i40e_link_status link_status;
 	int status;
@@ -6814,7 +6813,6 @@ i40e_dev_handle_aq_msg(struct rte_eth_dev *dev)
 			if (!ret)
 				rte_eth_dev_callback_process(dev,
 					RTE_ETH_EVENT_INTR_LSC, NULL);
-
 			break;
 		default:
 			PMD_DRV_LOG(DEBUG, "Request %u is not supported yet",
@@ -13132,40 +13130,6 @@ i40e_config_rss_filter(struct i40e_pf *pf,
 	return 0;
 }
 
-static void
-i40e_set_mac_max_frame(struct rte_eth_dev *dev, uint16_t size)
-{
-	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	uint32_t rep_cnt = MAX_REPEAT_TIME;
-	struct rte_eth_link link;
-	enum i40e_status_code status;
-	bool can_be_set = true;
-
-	/*
-	 * I40E_MEDIA_TYPE_BASET link up can be ignored
-	 * I40E_MEDIA_TYPE_BASET link down that hw->phy.media_type
-	 * is I40E_MEDIA_TYPE_UNKNOWN
-	 */
-	if (hw->phy.media_type != I40E_MEDIA_TYPE_BASET &&
-	    hw->phy.media_type != I40E_MEDIA_TYPE_UNKNOWN) {
-		do {
-			update_link_reg(hw, &link);
-			if (link.link_status)
-				break;
-			rte_delay_ms(CHECK_INTERVAL);
-		} while (--rep_cnt);
-		can_be_set = !!link.link_status;
-	}
-
-	if (can_be_set) {
-		status = i40e_aq_set_mac_config(hw, size, TRUE, 0, false, NULL);
-		if (status != I40E_SUCCESS)
-			PMD_DRV_LOG(ERR, "Failed to set max frame size at port level");
-	} else {
-		PMD_DRV_LOG(ERR, "Set max frame size at port level not applicable on link down");
-	}
-}
-
 RTE_LOG_REGISTER(i40e_logtype_init, pmd.net.i40e.init, NOTICE);
 RTE_LOG_REGISTER(i40e_logtype_driver, pmd.net.i40e.driver, NOTICE);
 #ifdef RTE_LIBRTE_I40E_DEBUG_RX
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:50.434530708 +0000
+++ 0014-net-i40e-revert-link-status-check-on-device-start.patch	2023-03-15 22:44:49.559849758 +0000
@@ -1 +1 @@
-From a8ca8edf8c076c765c6d142ab4664a1f61414233 Mon Sep 17 00:00:00 2001
+From dd692f5dde53c2af1dfc50b2d3ffac031953e9e5 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a8ca8edf8c076c765c6d142ab4664a1f61414233 ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
-index 7726a89d99..a982e42264 100644
+index c5eb7ccddc..8eb90909b8 100644
@@ -25 +26 @@
-@@ -387,7 +387,6 @@ static int i40e_set_default_mac_addr(struct rte_eth_dev *dev,
+@@ -397,7 +397,6 @@ static int i40e_set_default_mac_addr(struct rte_eth_dev *dev,
@@ -33,3 +34,3 @@
-@@ -1711,6 +1710,11 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused)
- 	 */
- 	i40e_add_tx_flow_control_drop_filter(pf);
+@@ -1779,6 +1778,11 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused)
+ 	/* initialize mirror rule list */
+ 	TAILQ_INIT(&pf->mirror_list);
@@ -45 +46 @@
-@@ -2328,7 +2332,6 @@ i40e_dev_start(struct rte_eth_dev *dev)
+@@ -2430,7 +2434,6 @@ i40e_dev_start(struct rte_eth_dev *dev)
@@ -53 +54 @@
-@@ -2467,9 +2470,6 @@ i40e_dev_start(struct rte_eth_dev *dev)
+@@ -2572,9 +2575,6 @@ i40e_dev_start(struct rte_eth_dev *dev)
@@ -63 +64 @@
-@@ -2809,9 +2809,6 @@ i40e_dev_set_link_down(struct rte_eth_dev *dev)
+@@ -2942,9 +2942,6 @@ i40e_dev_set_link_down(struct rte_eth_dev *dev)
@@ -73 +74 @@
-@@ -2878,6 +2875,8 @@ static __rte_always_inline void
+@@ -3012,6 +3009,8 @@ static __rte_always_inline void
@@ -82 +83 @@
-@@ -6738,7 +6737,6 @@ i40e_dev_handle_aq_msg(struct rte_eth_dev *dev)
+@@ -6814,7 +6813,6 @@ i40e_dev_handle_aq_msg(struct rte_eth_dev *dev)
@@ -90,2 +91,2 @@
-@@ -12123,40 +12121,6 @@ i40e_cloud_filter_qinq_create(struct i40e_pf *pf)
- 	return ret;
+@@ -13132,40 +13130,6 @@ i40e_config_rss_filter(struct i40e_pf *pf,
+ 	return 0;
@@ -128,3 +129,3 @@
- RTE_LOG_REGISTER_SUFFIX(i40e_logtype_init, init, NOTICE);
- RTE_LOG_REGISTER_SUFFIX(i40e_logtype_driver, driver, NOTICE);
- #ifdef RTE_ETHDEV_DEBUG_RX
+ RTE_LOG_REGISTER(i40e_logtype_init, pmd.net.i40e.init, NOTICE);
+ RTE_LOG_REGISTER(i40e_logtype_driver, pmd.net.i40e.driver, NOTICE);
+ #ifdef RTE_LIBRTE_I40E_DEBUG_RX

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/nfp: fix MTU configuration order' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (12 preceding siblings ...)
  2023-03-15 22:46     ` patch 'net/i40e: revert link status check on device start' " luca.boccassi
@ 2023-03-15 22:46     ` luca.boccassi
  2023-03-15 22:46     ` patch 'kvargs: add API documentation for process callback' " luca.boccassi
                       ` (23 subsequent siblings)
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:46 UTC (permalink / raw)
  To: Peng Zhang; +Cc: Chaoyong He, Niklas Söderlund, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From b7d178fc9ecdba3366318b6da83b5592dc1d3993 Mon Sep 17 00:00:00 2001
From: Peng Zhang <peng.zhang@corigine.com>
Date: Wed, 8 Mar 2023 10:33:18 +0800
Subject: [PATCH] net/nfp: fix MTU configuration order
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit 4352a3bcee3a4cc20c8accb71d683d5add3c6f80 ]

If rte_eth_dev_set_mtu() is called before rte_eth_rx_queue_setup() the
NFP driver setup fails. This is because the default values evaluated
when setting the MTU are initialized in the rte_eth_rx_queue_setup()
code path. Fix this by instead initializing the MTU default values in
the device initialization, in nfp_net_init() and the check also is
conducted in nfp_net_start(), so it doesn't influence the result.

This was found by using DPDK with OVS.

Fixes: dbad6f64f921 ("net/nfp: fix internal buffer size and MTU check")

Signed-off-by: Peng Zhang <peng.zhang@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_net.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index 4957cc7eda..ed1b4ff0bd 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -95,6 +95,8 @@ static int nfp_net_rss_hash_write(struct rte_eth_dev *dev,
 static int nfp_set_mac_addr(struct rte_eth_dev *dev,
 			     struct rte_ether_addr *mac_addr);
 
+#define DEFAULT_FLBUF_SIZE        9216
+
 /* The offset of the queue controller queues in the PCIe Target */
 #define NFP_PCIE_QUEUE(_q) (0x80000 + (NFP_QCP_QUEUE_ADDR_SZ * ((_q) & 0xff)))
 
@@ -2942,6 +2944,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
 	hw->cap = nn_cfg_readl(hw, NFP_NET_CFG_CAP);
 	hw->max_mtu = nn_cfg_readl(hw, NFP_NET_CFG_MAX_MTU);
 	hw->mtu = RTE_ETHER_MTU;
+	hw->flbufsz = DEFAULT_FLBUF_SIZE;
 
 	/* VLAN insertion is incompatible with LSOv2 */
 	if (hw->cap & NFP_NET_CFG_CTRL_LSO2)
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:50.497285420 +0000
+++ 0015-net-nfp-fix-MTU-configuration-order.patch	2023-03-15 22:44:49.563849842 +0000
@@ -1 +1 @@
-From 4352a3bcee3a4cc20c8accb71d683d5add3c6f80 Mon Sep 17 00:00:00 2001
+From b7d178fc9ecdba3366318b6da83b5592dc1d3993 Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit 4352a3bcee3a4cc20c8accb71d683d5add3c6f80 ]
+
@@ -19 +20,0 @@
-Cc: stable@dpdk.org
@@ -25,40 +26,10 @@
- drivers/net/nfp/flower/nfp_flower.c | 1 -
- drivers/net/nfp/nfp_common.c        | 4 ++--
- drivers/net/nfp/nfp_common.h        | 1 +
- drivers/net/nfp/nfp_ethdev.c        | 1 +
- drivers/net/nfp/nfp_ethdev_vf.c     | 1 +
- 5 files changed, 5 insertions(+), 3 deletions(-)
-
-diff --git a/drivers/net/nfp/flower/nfp_flower.c b/drivers/net/nfp/flower/nfp_flower.c
-index 2c797ae751..6f197396a4 100644
---- a/drivers/net/nfp/flower/nfp_flower.c
-+++ b/drivers/net/nfp/flower/nfp_flower.c
-@@ -24,7 +24,6 @@
- #include "nfp_flower_cmsg.h"
- 
- #define CTRL_VNIC_NB_DESC 512
--#define DEFAULT_FLBUF_SIZE 9216
- 
- static void
- nfp_pf_repr_enable_queues(struct rte_eth_dev *dev)
-diff --git a/drivers/net/nfp/nfp_common.c b/drivers/net/nfp/nfp_common.c
-index 5922bfea8e..5d92b476e2 100644
---- a/drivers/net/nfp/nfp_common.c
-+++ b/drivers/net/nfp/nfp_common.c
-@@ -1126,9 +1126,9 @@ nfp_net_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
- 		return -EBUSY;
- 	}
- 
--	/* MTU larger then current mbufsize not supported */
-+	/* MTU larger than current mbufsize not supported */
- 	if (mtu > hw->flbufsz) {
--		PMD_DRV_LOG(ERR, "MTU (%u) larger then current mbufsize (%u) not supported",
-+		PMD_DRV_LOG(ERR, "MTU (%u) larger than current mbufsize (%u) not supported",
- 			    mtu, hw->flbufsz);
- 		return -ERANGE;
- 	}
-diff --git a/drivers/net/nfp/nfp_common.h b/drivers/net/nfp/nfp_common.h
-index 49c89ac327..4486ffa72c 100644
---- a/drivers/net/nfp/nfp_common.h
-+++ b/drivers/net/nfp/nfp_common.h
-@@ -111,6 +111,7 @@ struct nfp_net_adapter;
+ drivers/net/nfp/nfp_net.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
+index 4957cc7eda..ed1b4ff0bd 100644
+--- a/drivers/net/nfp/nfp_net.c
++++ b/drivers/net/nfp/nfp_net.c
+@@ -95,6 +95,8 @@ static int nfp_net_rss_hash_write(struct rte_eth_dev *dev,
+ static int nfp_set_mac_addr(struct rte_eth_dev *dev,
+ 			     struct rte_ether_addr *mac_addr);
@@ -66,2 +36,0 @@
- /* Maximum supported NFP frame size (MTU + layer 2 headers) */
- #define NFP_FRAME_SIZE_MAX	10048
@@ -68,0 +38,3 @@
++
+ /* The offset of the queue controller queues in the PCIe Target */
+ #define NFP_PCIE_QUEUE(_q) (0x80000 + (NFP_QCP_QUEUE_ADDR_SZ * ((_q) & 0xff)))
@@ -70,19 +42 @@
- #include <linux/types.h>
- #include <rte_io.h>
-diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
-index 47d5dff16c..56fb8e8c73 100644
---- a/drivers/net/nfp/nfp_ethdev.c
-+++ b/drivers/net/nfp/nfp_ethdev.c
-@@ -603,6 +603,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
- 	hw->cap = nn_cfg_readl(hw, NFP_NET_CFG_CAP);
- 	hw->max_mtu = nn_cfg_readl(hw, NFP_NET_CFG_MAX_MTU);
- 	hw->mtu = RTE_ETHER_MTU;
-+	hw->flbufsz = DEFAULT_FLBUF_SIZE;
- 
- 	/* VLAN insertion is incompatible with LSOv2 */
- 	if (hw->cap & NFP_NET_CFG_CTRL_LSO2)
-diff --git a/drivers/net/nfp/nfp_ethdev_vf.c b/drivers/net/nfp/nfp_ethdev_vf.c
-index 7834b2ee0c..d69ac8cd37 100644
---- a/drivers/net/nfp/nfp_ethdev_vf.c
-+++ b/drivers/net/nfp/nfp_ethdev_vf.c
-@@ -365,6 +365,7 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev)
+@@ -2942,6 +2944,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev)

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'kvargs: add API documentation for process callback' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (13 preceding siblings ...)
  2023-03-15 22:46     ` patch 'net/nfp: fix MTU configuration order' " luca.boccassi
@ 2023-03-15 22:46     ` luca.boccassi
  2023-03-15 22:46     ` patch 'compressdev: fix empty devargs parsing' " luca.boccassi
                       ` (22 subsequent siblings)
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:46 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: Olivier Matz, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/0929f2bd19ef9c4a3775d392d37ac1459382c1cb

Thanks.

Luca Boccassi

---
From 0929f2bd19ef9c4a3775d392d37ac1459382c1cb Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Thu, 2 Mar 2023 07:50:04 +0000
Subject: [PATCH] kvargs: add API documentation for process callback

[ upstream commit 52ab17efdecf935792ee1d0cb749c0dbd536c083 ]

The rte_kvargs_process() is used to parse KV pairs, it also supports
to parse 'only keys' (e.g. socket_id) type. And the callback function
(which prototype is arg_handler_t) parameter 'value' is NULL when
parsing 'only keys'.

But there is no detailed definition of 'value' may be NULL, so this
patch adds it.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---
 lib/librte_kvargs/rte_kvargs.h | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/lib/librte_kvargs/rte_kvargs.h b/lib/librte_kvargs/rte_kvargs.h
index 5b2e164287..a53da40278 100644
--- a/lib/librte_kvargs/rte_kvargs.h
+++ b/lib/librte_kvargs/rte_kvargs.h
@@ -36,7 +36,19 @@ extern "C" {
 /** separator character used between key and value */
 #define RTE_KVARGS_KV_DELIM	"="
 
-/** Type of callback function used by rte_kvargs_process() */
+/**
+ * Callback prototype used by rte_kvargs_process().
+ *
+ * @param key
+ *   The key to consider, it will not be NULL.
+ * @param value
+ *   The value corresponding to the key, it may be NULL (e.g. only with key)
+ * @param opaque
+ *   An opaque pointer coming from the caller.
+ * @return
+ *   - >=0 handle key success.
+ *   - <0 on error.
+ */
 typedef int (*arg_handler_t)(const char *key, const char *value, void *opaque);
 
 /** A key/value association */
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:50.556810137 +0000
+++ 0016-kvargs-add-API-documentation-for-process-callback.patch	2023-03-15 22:44:49.567849926 +0000
@@ -1 +1 @@
-From 52ab17efdecf935792ee1d0cb749c0dbd536c083 Mon Sep 17 00:00:00 2001
+From 0929f2bd19ef9c4a3775d392d37ac1459382c1cb Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 52ab17efdecf935792ee1d0cb749c0dbd536c083 ]
+
@@ -14,2 +15,0 @@
-Cc: stable@dpdk.org
-
@@ -19 +19 @@
- lib/kvargs/rte_kvargs.h | 14 +++++++++++++-
+ lib/librte_kvargs/rte_kvargs.h | 14 +++++++++++++-
@@ -22,4 +22,4 @@
-diff --git a/lib/kvargs/rte_kvargs.h b/lib/kvargs/rte_kvargs.h
-index 359a9f5b09..4900b750bc 100644
---- a/lib/kvargs/rte_kvargs.h
-+++ b/lib/kvargs/rte_kvargs.h
+diff --git a/lib/librte_kvargs/rte_kvargs.h b/lib/librte_kvargs/rte_kvargs.h
+index 5b2e164287..a53da40278 100644
+--- a/lib/librte_kvargs/rte_kvargs.h
++++ b/lib/librte_kvargs/rte_kvargs.h

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'compressdev: fix empty devargs parsing' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (14 preceding siblings ...)
  2023-03-15 22:46     ` patch 'kvargs: add API documentation for process callback' " luca.boccassi
@ 2023-03-15 22:46     ` luca.boccassi
  2023-03-15 22:46     ` patch 'cryptodev: " luca.boccassi
                       ` (21 subsequent siblings)
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:46 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/8701203904167e08137f713910b1a2409d6305e8

Thanks.

Luca Boccassi

---
From 8701203904167e08137f713910b1a2409d6305e8 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Thu, 2 Mar 2023 07:50:05 +0000
Subject: [PATCH] compressdev: fix empty devargs parsing

[ upstream commit bb27182482d61777de6a38b16a1d2c692c2c3f8b ]

The rte_kvargs_process() was used to parse KV pairs, it also supports
to parse 'only keys' (e.g. socket_id) type. And the callback function
parameter 'value' is NULL when parsed 'only keys'.

This patch fixes segment fault in rte_compressdev_pmd_parse_uint_arg()
when parse input args with 'only keys' (e.g. socket_id).

For a similar reason, this patch fixes
rte_compressdev_pmd_parse_name_arg().

Fixes: ed7dd94f7f66 ("compressdev: add basic device management")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
---
 lib/librte_compressdev/rte_compressdev_pmd.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/librte_compressdev/rte_compressdev_pmd.c b/lib/librte_compressdev/rte_compressdev_pmd.c
index 7f500d76d4..6a11a396b7 100644
--- a/lib/librte_compressdev/rte_compressdev_pmd.c
+++ b/lib/librte_compressdev/rte_compressdev_pmd.c
@@ -20,6 +20,9 @@ rte_compressdev_pmd_parse_name_arg(const char *key __rte_unused,
 	struct rte_compressdev_pmd_init_params *params = extra_args;
 	int n;
 
+	if (value == NULL || extra_args == NULL)
+		return -EINVAL;
+
 	n = strlcpy(params->name, value, RTE_COMPRESSDEV_NAME_MAX_LEN);
 	if (n >= RTE_COMPRESSDEV_NAME_MAX_LEN)
 		return -EINVAL;
@@ -37,6 +40,9 @@ rte_compressdev_pmd_parse_uint_arg(const char *key __rte_unused,
 	int i;
 	char *end;
 
+	if (value == NULL || extra_args == NULL)
+		return -EINVAL;
+
 	errno = 0;
 	i = strtol(value, &end, 10);
 	if (*end != 0 || errno != 0 || i < 0)
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:50.606620404 +0000
+++ 0017-compressdev-fix-empty-devargs-parsing.patch	2023-03-15 22:44:49.567849926 +0000
@@ -1 +1 @@
-From bb27182482d61777de6a38b16a1d2c692c2c3f8b Mon Sep 17 00:00:00 2001
+From 8701203904167e08137f713910b1a2409d6305e8 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit bb27182482d61777de6a38b16a1d2c692c2c3f8b ]
+
@@ -17 +18,0 @@
-Cc: stable@dpdk.org
@@ -21 +22 @@
- lib/compressdev/rte_compressdev_pmd.c | 6 ++++++
+ lib/librte_compressdev/rte_compressdev_pmd.c | 6 ++++++
@@ -24,5 +25,5 @@
-diff --git a/lib/compressdev/rte_compressdev_pmd.c b/lib/compressdev/rte_compressdev_pmd.c
-index e139bc86e7..156bccd972 100644
---- a/lib/compressdev/rte_compressdev_pmd.c
-+++ b/lib/compressdev/rte_compressdev_pmd.c
-@@ -23,6 +23,9 @@ rte_compressdev_pmd_parse_name_arg(const char *key __rte_unused,
+diff --git a/lib/librte_compressdev/rte_compressdev_pmd.c b/lib/librte_compressdev/rte_compressdev_pmd.c
+index 7f500d76d4..6a11a396b7 100644
+--- a/lib/librte_compressdev/rte_compressdev_pmd.c
++++ b/lib/librte_compressdev/rte_compressdev_pmd.c
+@@ -20,6 +20,9 @@ rte_compressdev_pmd_parse_name_arg(const char *key __rte_unused,
@@ -38 +39 @@
-@@ -40,6 +43,9 @@ rte_compressdev_pmd_parse_uint_arg(const char *key __rte_unused,
+@@ -37,6 +40,9 @@ rte_compressdev_pmd_parse_uint_arg(const char *key __rte_unused,

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'cryptodev: fix empty devargs parsing' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (15 preceding siblings ...)
  2023-03-15 22:46     ` patch 'compressdev: fix empty devargs parsing' " luca.boccassi
@ 2023-03-15 22:46     ` luca.boccassi
  2023-03-15 22:46     ` patch 'net/virtio: " luca.boccassi
                       ` (20 subsequent siblings)
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:46 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: Akhil Goyal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/18cf7a4204c687686a03ef8f54fd725295a6f091

Thanks.

Luca Boccassi

---
From 18cf7a4204c687686a03ef8f54fd725295a6f091 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Thu, 2 Mar 2023 07:50:07 +0000
Subject: [PATCH] cryptodev: fix empty devargs parsing

[ upstream commit 8146454c56636ba8af5263b57e1c4a9f67fd4a39 ]

The rte_kvargs_process() was used to parse KV pairs, it also supports
to parse 'only keys' (e.g. socket_id) type. And the callback function
parameter 'value' is NULL when parsed 'only keys'.

This patch fixes segment fault in rte_cryptodev_pmd_parse_uint_arg()
when parse input args with 'only keys' (e.g. socket_id,
max_nb_queue_pairs).

For a similar reason, this patch fixes
rte_cryptodev_pmd_parse_name_arg().

Fixes: 9e6edea41805 ("cryptodev: add APIs to assist PMD initialisation")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
---
 lib/librte_cryptodev/rte_cryptodev_pmd.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/librte_cryptodev/rte_cryptodev_pmd.c b/lib/librte_cryptodev/rte_cryptodev_pmd.c
index 5445b015d9..d532ed8582 100644
--- a/lib/librte_cryptodev/rte_cryptodev_pmd.c
+++ b/lib/librte_cryptodev/rte_cryptodev_pmd.c
@@ -17,6 +17,9 @@ rte_cryptodev_pmd_parse_name_arg(const char *key __rte_unused,
 	struct rte_cryptodev_pmd_init_params *params = extra_args;
 	int n;
 
+	if (value == NULL || extra_args == NULL)
+		return -EINVAL;
+
 	n = strlcpy(params->name, value, RTE_CRYPTODEV_NAME_MAX_LEN);
 	if (n >= RTE_CRYPTODEV_NAME_MAX_LEN)
 		return -EINVAL;
@@ -33,6 +36,10 @@ rte_cryptodev_pmd_parse_uint_arg(const char *key __rte_unused,
 {
 	int i;
 	char *end;
+
+	if (value == NULL || extra_args == NULL)
+		return -EINVAL;
+
 	errno = 0;
 
 	i = strtol(value, &end, 10);
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:50.663876980 +0000
+++ 0018-cryptodev-fix-empty-devargs-parsing.patch	2023-03-15 22:44:49.571850010 +0000
@@ -1 +1 @@
-From 8146454c56636ba8af5263b57e1c4a9f67fd4a39 Mon Sep 17 00:00:00 2001
+From 18cf7a4204c687686a03ef8f54fd725295a6f091 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 8146454c56636ba8af5263b57e1c4a9f67fd4a39 ]
+
@@ -18 +19,0 @@
-Cc: stable@dpdk.org
@@ -23 +24 @@
- lib/cryptodev/cryptodev_pmd.c | 7 +++++++
+ lib/librte_cryptodev/rte_cryptodev_pmd.c | 7 +++++++
@@ -26,5 +27,5 @@
-diff --git a/lib/cryptodev/cryptodev_pmd.c b/lib/cryptodev/cryptodev_pmd.c
-index 77b269f312..d8073a601d 100644
---- a/lib/cryptodev/cryptodev_pmd.c
-+++ b/lib/cryptodev/cryptodev_pmd.c
-@@ -22,6 +22,9 @@ rte_cryptodev_pmd_parse_name_arg(const char *key __rte_unused,
+diff --git a/lib/librte_cryptodev/rte_cryptodev_pmd.c b/lib/librte_cryptodev/rte_cryptodev_pmd.c
+index 5445b015d9..d532ed8582 100644
+--- a/lib/librte_cryptodev/rte_cryptodev_pmd.c
++++ b/lib/librte_cryptodev/rte_cryptodev_pmd.c
+@@ -17,6 +17,9 @@ rte_cryptodev_pmd_parse_name_arg(const char *key __rte_unused,
@@ -40 +41 @@
-@@ -38,6 +41,10 @@ rte_cryptodev_pmd_parse_uint_arg(const char *key __rte_unused,
+@@ -33,6 +36,10 @@ rte_cryptodev_pmd_parse_uint_arg(const char *key __rte_unused,

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/virtio: fix empty devargs parsing' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (16 preceding siblings ...)
  2023-03-15 22:46     ` patch 'cryptodev: " luca.boccassi
@ 2023-03-15 22:46     ` luca.boccassi
  2023-03-15 22:46     ` patch 'raw/skeleton: " luca.boccassi
                       ` (19 subsequent siblings)
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:46 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/279024fc7c8b73769f52ae0735cd2db24714aef3

Thanks.

Luca Boccassi

---
From 279024fc7c8b73769f52ae0735cd2db24714aef3 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Thu, 2 Mar 2023 07:50:10 +0000
Subject: [PATCH] net/virtio: fix empty devargs parsing

[ upstream commit 1c1b35b59b4cee8836f34498b7c55b49de39d7b3 ]

The rte_kvargs_process() was used to parse KV pairs, it also supports
to parse 'only keys' (e.g. socket_id) type. And the callback function
parameter 'value' is NULL when parsed 'only keys'.

This patch fixes segment fault when parse input args with 'only keys'
(e.g. vectorized,vdpa).

Fixes: 4710e16a4a7b ("net/virtio: add parameter to enable vectorized path")
Fixes: 44d7b2e87b69 ("net/virtio: refactor devargs parsing")
Fixes: 440f03c25378 ("net/virtio: skip device probe in vDPA mode")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/net/virtio/virtio_ethdev.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index ce612f7400..011130c61f 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -2097,6 +2097,9 @@ eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev)
 static int vdpa_check_handler(__rte_unused const char *key,
 		const char *value, void *ret_val)
 {
+	if (value == NULL || ret_val == NULL)
+		return -EINVAL;
+
 	if (strcmp(value, "1") == 0)
 		*(int *)ret_val = 1;
 	else
@@ -2134,6 +2137,9 @@ virtio_dev_speed_capa_get(uint32_t speed)
 static int vectorized_check_handler(__rte_unused const char *key,
 		const char *value, void *ret_val)
 {
+	if (value == NULL || ret_val == NULL)
+		return -EINVAL;
+
 	if (strcmp(value, "1") == 0)
 		*(int *)ret_val = 1;
 	else
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:50.713282199 +0000
+++ 0019-net-virtio-fix-empty-devargs-parsing.patch	2023-03-15 22:44:49.575850093 +0000
@@ -1 +1 @@
-From 1c1b35b59b4cee8836f34498b7c55b49de39d7b3 Mon Sep 17 00:00:00 2001
+From 279024fc7c8b73769f52ae0735cd2db24714aef3 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 1c1b35b59b4cee8836f34498b7c55b49de39d7b3 ]
+
@@ -16 +17,0 @@
-Cc: stable@dpdk.org
@@ -21,3 +22,2 @@
- drivers/net/virtio/virtio_ethdev.c     | 3 +++
- drivers/net/virtio/virtio_pci_ethdev.c | 3 +++
- 2 files changed, 6 insertions(+)
+ drivers/net/virtio/virtio_ethdev.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
@@ -26 +26 @@
-index dc6856d749..ae84d313be 100644
+index ce612f7400..011130c61f 100644
@@ -29,2 +29,2 @@
-@@ -2056,6 +2056,9 @@ virtio_dev_speed_capa_get(uint32_t speed)
- static int vectorized_check_handler(__rte_unused const char *key,
+@@ -2097,6 +2097,9 @@ eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev)
+ static int vdpa_check_handler(__rte_unused const char *key,
@@ -39,6 +39,2 @@
-diff --git a/drivers/net/virtio/virtio_pci_ethdev.c b/drivers/net/virtio/virtio_pci_ethdev.c
-index abc63b0935..9b4b846f8a 100644
---- a/drivers/net/virtio/virtio_pci_ethdev.c
-+++ b/drivers/net/virtio/virtio_pci_ethdev.c
-@@ -148,6 +148,9 @@ eth_virtio_pci_uninit(struct rte_eth_dev *eth_dev)
- static int vdpa_check_handler(__rte_unused const char *key,
+@@ -2134,6 +2137,9 @@ virtio_dev_speed_capa_get(uint32_t speed)
+ static int vectorized_check_handler(__rte_unused const char *key,

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'raw/skeleton: fix empty devargs parsing' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (17 preceding siblings ...)
  2023-03-15 22:46     ` patch 'net/virtio: " luca.boccassi
@ 2023-03-15 22:46     ` luca.boccassi
  2023-03-15 22:46     ` patch 'kni: fix possible starvation when mbufs are exhausted' " luca.boccassi
                       ` (18 subsequent siblings)
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:46 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From bbedd033a8eb0c80f184b54507610decf179c52f Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Thu, 2 Mar 2023 07:50:12 +0000
Subject: [PATCH] raw/skeleton: fix empty devargs parsing

[ upstream commit 11da6149224a8de53d2ddd2aacba7b158cc4e3b4 ]

The rte_kvargs_process() was used to parse KV pairs, it also supports
to parse 'only keys' (e.g. socket_id) type. And the callback function
parameter 'value' is NULL when parsed 'only keys'.

This patch fixes segment fault when parse input args with 'only keys'
(e.g. self_test).

Fixes: 55ca1b0f2151 ("raw/skeleton: add test cases")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
---
 drivers/raw/skeleton/skeleton_rawdev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/raw/skeleton/skeleton_rawdev.c b/drivers/raw/skeleton/skeleton_rawdev.c
index aa3beaad18..ebb9075dd9 100644
--- a/drivers/raw/skeleton/skeleton_rawdev.c
+++ b/drivers/raw/skeleton/skeleton_rawdev.c
@@ -659,6 +659,8 @@ skeldev_get_selftest(const char *key __rte_unused,
 		     void *opaque)
 {
 	int *flag = opaque;
+	if (value == NULL || opaque == NULL)
+		return -EINVAL;
 	*flag = atoi(value);
 	return 0;
 }
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:50.783085494 +0000
+++ 0020-raw-skeleton-fix-empty-devargs-parsing.patch	2023-03-15 22:44:49.579850177 +0000
@@ -1 +1 @@
-From 11da6149224a8de53d2ddd2aacba7b158cc4e3b4 Mon Sep 17 00:00:00 2001
+From bbedd033a8eb0c80f184b54507610decf179c52f Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 11da6149224a8de53d2ddd2aacba7b158cc4e3b4 ]
+
@@ -14 +15,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
-index b2ca1cc5cd..53fe49f936 100644
+index aa3beaad18..ebb9075dd9 100644
@@ -25 +26 @@
-@@ -664,6 +664,8 @@ skeldev_get_selftest(const char *key __rte_unused,
+@@ -659,6 +659,8 @@ skeldev_get_selftest(const char *key __rte_unused,

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'kni: fix possible starvation when mbufs are exhausted' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (18 preceding siblings ...)
  2023-03-15 22:46     ` patch 'raw/skeleton: " luca.boccassi
@ 2023-03-15 22:46     ` luca.boccassi
  2023-03-15 22:46     ` patch 'cmdline: handle EOF as quit' " luca.boccassi
                       ` (17 subsequent siblings)
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:46 UTC (permalink / raw)
  To: Yangchao Zhou; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/5f3b9397db0710432b49e2c9cd709a84ac2e7265

Thanks.

Luca Boccassi

---
From 5f3b9397db0710432b49e2c9cd709a84ac2e7265 Mon Sep 17 00:00:00 2001
From: Yangchao Zhou <zhouyates@gmail.com>
Date: Fri, 30 Dec 2022 12:23:38 +0800
Subject: [PATCH] kni: fix possible starvation when mbufs are exhausted

[ upstream commit 676ed80ad98fcff39943d09b8fe21e2e01ae3d4a ]

In some scenarios, mbufs returned by rte_kni_rx_burst are not freed
immediately. So kni_allocate_mbufs may be failed, but we don't know.

Even worse, when alloc_q is completely exhausted, kni_net_tx in
rte_kni.ko will drop all tx packets. kni_allocate_mbufs is never
called again, even if the mbufs are eventually freed.

In this patch, we try to allocate mbufs for alloc_q when it is empty.

According to historical experience, the performance bottleneck of KNI
is offen the usleep_range of kni thread in rte_kni.ko.
The check of kni_fifo_count is trivial and the cost should be acceptable.

Fixes: 3e12a98fe397 ("kni: optimize Rx burst")

Signed-off-by: Yangchao Zhou <zhouyates@gmail.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 lib/librte_kni/rte_kni.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c
index 17e4487306..f86a11d829 100644
--- a/lib/librte_kni/rte_kni.c
+++ b/lib/librte_kni/rte_kni.c
@@ -635,8 +635,8 @@ rte_kni_rx_burst(struct rte_kni *kni, struct rte_mbuf **mbufs, unsigned int num)
 {
 	unsigned int ret = kni_fifo_get(kni->tx_q, (void **)mbufs, num);
 
-	/* If buffers removed, allocate mbufs and then put them into alloc_q */
-	if (ret)
+	/* If buffers removed or alloc_q is empty, allocate mbufs and then put them into alloc_q */
+	if (ret || (kni_fifo_count(kni->alloc_q) == 0))
 		kni_allocate_mbufs(kni);
 
 	return ret;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:50.839061593 +0000
+++ 0021-kni-fix-possible-starvation-when-mbufs-are-exhausted.patch	2023-03-15 22:44:49.579850177 +0000
@@ -1 +1 @@
-From 676ed80ad98fcff39943d09b8fe21e2e01ae3d4a Mon Sep 17 00:00:00 2001
+From 5f3b9397db0710432b49e2c9cd709a84ac2e7265 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 676ed80ad98fcff39943d09b8fe21e2e01ae3d4a ]
+
@@ -20 +21,0 @@
-Cc: stable@dpdk.org
@@ -25 +26 @@
- lib/kni/rte_kni.c | 4 ++--
+ lib/librte_kni/rte_kni.c | 4 ++--
@@ -28,5 +29,5 @@
-diff --git a/lib/kni/rte_kni.c b/lib/kni/rte_kni.c
-index 8ab6c47153..bfa6a001ff 100644
---- a/lib/kni/rte_kni.c
-+++ b/lib/kni/rte_kni.c
-@@ -634,8 +634,8 @@ rte_kni_rx_burst(struct rte_kni *kni, struct rte_mbuf **mbufs, unsigned int num)
+diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c
+index 17e4487306..f86a11d829 100644
+--- a/lib/librte_kni/rte_kni.c
++++ b/lib/librte_kni/rte_kni.c
+@@ -635,8 +635,8 @@ rte_kni_rx_burst(struct rte_kni *kni, struct rte_mbuf **mbufs, unsigned int num)

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'cmdline: handle EOF as quit' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (19 preceding siblings ...)
  2023-03-15 22:46     ` patch 'kni: fix possible starvation when mbufs are exhausted' " luca.boccassi
@ 2023-03-15 22:46     ` luca.boccassi
  2023-03-15 22:46     ` patch 'app/testpmd: cleanup cleanly from signal' " luca.boccassi
                       ` (16 subsequent siblings)
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:46 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/665af7d940592cf80b4ba37e18ee20bb547a57af

Thanks.

Luca Boccassi

---
From 665af7d940592cf80b4ba37e18ee20bb547a57af Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Fri, 3 Feb 2023 11:14:08 -0800
Subject: [PATCH] cmdline: handle EOF as quit

[ upstream commit 415549f1ccce62b82cb182175346904a65f74cec ]

If end of file is reached on input, then cmdline_poll() will
return 1 (ie file has something); and then the cmdline_in()
call to read will return 0. With the existing code,
caller has no way to tell that end of file has been reached
 and will retry forever.

A good way to handle this is to make end of file equivalent
to the quit command. Since no more input is possible at that
point.

Fixes: 067855e651d6 ("cmdline: add polling mode")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/librte_cmdline/cmdline.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/lib/librte_cmdline/cmdline.c b/lib/librte_cmdline/cmdline.c
index 79ea5f98c8..478bcfb161 100644
--- a/lib/librte_cmdline/cmdline.c
+++ b/lib/librte_cmdline/cmdline.c
@@ -205,9 +205,14 @@ cmdline_poll(struct cmdline *cl)
 		if (read_status < 0)
 			return read_status;
 
-		status = cmdline_in(cl, &c, 1);
-		if (status < 0 && cl->rdl.status != RDLINE_EXITED)
-			return status;
+		if (read_status == 0) {
+			/* end of file is implicit quit */
+			cmdline_quit(cl);
+		} else {
+			status = cmdline_in(cl, &c, 1);
+			if (status < 0 && cl->rdl.status != RDLINE_EXITED)
+				return status;
+		}
 	}
 
 	return cl->rdl.status;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:50.894361820 +0000
+++ 0022-cmdline-handle-EOF-as-quit.patch	2023-03-15 22:44:49.583850261 +0000
@@ -1 +1 @@
-From 415549f1ccce62b82cb182175346904a65f74cec Mon Sep 17 00:00:00 2001
+From 665af7d940592cf80b4ba37e18ee20bb547a57af Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 415549f1ccce62b82cb182175346904a65f74cec ]
+
@@ -17 +18,0 @@
-Cc: stable@dpdk.org
@@ -21 +22 @@
- lib/cmdline/cmdline.c | 11 ++++++++---
+ lib/librte_cmdline/cmdline.c | 11 ++++++++---
@@ -24,5 +25,5 @@
-diff --git a/lib/cmdline/cmdline.c b/lib/cmdline/cmdline.c
-index e1009ba4c4..8ad0690d85 100644
---- a/lib/cmdline/cmdline.c
-+++ b/lib/cmdline/cmdline.c
-@@ -197,9 +197,14 @@ cmdline_poll(struct cmdline *cl)
+diff --git a/lib/librte_cmdline/cmdline.c b/lib/librte_cmdline/cmdline.c
+index 79ea5f98c8..478bcfb161 100644
+--- a/lib/librte_cmdline/cmdline.c
++++ b/lib/librte_cmdline/cmdline.c
+@@ -205,9 +205,14 @@ cmdline_poll(struct cmdline *cl)

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'app/testpmd: cleanup cleanly from signal' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (20 preceding siblings ...)
  2023-03-15 22:46     ` patch 'cmdline: handle EOF as quit' " luca.boccassi
@ 2023-03-15 22:46     ` luca.boccassi
  2023-03-15 22:46     ` patch 'net/hns3: fix possible truncation of hash key when config' " luca.boccassi
                       ` (15 subsequent siblings)
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:46 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From c7154a7ed76d661a44b7d7948b4adce6810bfe45 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Fri, 3 Feb 2023 11:14:09 -0800
Subject: [PATCH] app/testpmd: cleanup cleanly from signal

[ upstream commit 0fd1386c30c3ad9365d7fdd2829bf7cb2e1b9dff ]

Do a clean shutdown of testpmd when a signal is received; instead of
having testpmd kill itself.  This fixes the problem where a signal could
be received in the middle of a PMD and then the signal handler would
call PMD's close routine leading to locking problems.

The cmdline structure no longer needs to be global it can
just be local to the prompt() function.

An added benefit is it gets rid of some Windows specific code.

Fixes: d9a191a00e81 ("app/testpmd: fix quitting in container")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 app/test-pmd/cmdline.c | 30 +++++++----------
 app/test-pmd/testpmd.c | 75 ++++++++++++++++++++----------------------
 app/test-pmd/testpmd.h |  1 +
 3 files changed, 48 insertions(+), 58 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 9f46570cc4..8a7300bcf9 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -71,8 +71,6 @@
 #include "cmdline_tm.h"
 #include "bpf_cmd.h"
 
-static struct cmdline *testpmd_cl;
-
 static void cmd_reconfig_device_queue(portid_t id, uint8_t dev, uint8_t queue);
 
 /* *** Help command with introduction. *** */
@@ -17199,31 +17197,25 @@ cmdline_read_from_file(const char *filename)
 void
 prompt(void)
 {
-	int ret;
+	struct cmdline *cl;
 	/* initialize non-constant commands */
 	cmd_set_fwd_mode_init();
 	cmd_set_fwd_retry_mode_init();
 
-	testpmd_cl = cmdline_stdin_new(main_ctx, "testpmd> ");
-	if (testpmd_cl == NULL)
+	cl = cmdline_stdin_new(main_ctx, "testpmd> ");
+	if (cl == NULL)
 		return;
 
-	ret = atexit(prompt_exit);
-	if (ret != 0)
-		printf("Cannot set exit function for cmdline\n");
+	/* loop until signal or quit command */
+	while (f_quit == 0 && cl_quit == 0) {
+		int status = cmdline_poll(cl);
 
-	cmdline_interact(testpmd_cl);
-	if (ret != 0)
-		cmdline_stdin_exit(testpmd_cl);
-}
-
-void
-prompt_exit(void)
-{
-	if (testpmd_cl != NULL) {
-		cmdline_quit(testpmd_cl);
-		cmdline_stdin_exit(testpmd_cl);
+		if (status < 0 || status == RDLINE_EXITED)
+			break;
 	}
+
+	cmdline_quit(cl);
+	cmdline_stdin_exit(cl);
 }
 
 static void
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index f22c05920f..a061e10385 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -10,6 +10,7 @@
 #include <time.h>
 #include <fcntl.h>
 #include <sys/mman.h>
+#include <sys/select.h>
 #include <sys/types.h>
 #include <errno.h>
 #include <stdbool.h>
@@ -216,7 +217,7 @@ uint16_t stats_period; /**< Period to show statistics (disabled by default) */
  * In container, it cannot terminate the process which running with 'stats-period'
  * option. Set flag to exit stats period loop after received SIGINT/SIGTERM.
  */
-static volatile uint8_t f_quit;
+volatile uint8_t f_quit;
 uint8_t cl_quit; /* Quit testpmd from cmdline. */
 
 /*
@@ -3826,13 +3827,6 @@ init_port(void)
 	memset(txring_numa, NUMA_NO_CONFIG, RTE_MAX_ETHPORTS);
 }
 
-static void
-force_quit(void)
-{
-	pmd_test_exit();
-	prompt_exit();
-}
-
 static void
 print_stats(void)
 {
@@ -3851,26 +3845,9 @@ print_stats(void)
 }
 
 static void
-signal_handler(int signum)
+signal_handler(int signum __rte_unused)
 {
-	if (signum == SIGINT || signum == SIGTERM) {
-		printf("\nSignal %d received, preparing to exit...\n",
-				signum);
-#ifdef RTE_LIB_PDUMP
-		/* uninitialize packet capture framework */
-		rte_pdump_uninit();
-#endif
-#ifdef RTE_LIB_LATENCYSTATS
-		if (latencystats_enabled != 0)
-			rte_latencystats_uninit();
-#endif
-		force_quit();
-		/* Set flag to indicate the force termination. */
-		f_quit = 1;
-		/* exit with the expected status */
-		signal(signum, SIG_DFL);
-		kill(getpid(), signum);
-	}
+	f_quit = 1;
 }
 
 int
@@ -4044,15 +4021,9 @@ main(int argc, char** argv)
 			start_packet_forwarding(0);
 		}
 		prompt();
-		pmd_test_exit();
 	} else
 #endif
 	{
-		char c;
-		int rc;
-
-		f_quit = 0;
-
 		printf("No commandline core given, start packet forwarding\n");
 		start_packet_forwarding(tx_first);
 		if (stats_period != 0) {
@@ -4075,15 +4046,41 @@ main(int argc, char** argv)
 				prev_time = cur_time;
 				sleep(1);
 			}
+		} else {
+			char c;
+			fd_set fds;
+
+			printf("Press enter to exit\n");
+
+			FD_ZERO(&fds);
+			FD_SET(0, &fds);
+
+			/* wait for signal or enter */
+			ret = select(1, &fds, NULL, NULL, NULL);
+			if (ret < 0 && errno != EINTR)
+				rte_exit(EXIT_FAILURE,
+					 "Select failed: %s\n",
+					 strerror(errno));
+
+			/* if got enter then consume it */
+			if (ret == 1 && read(0, &c, 1) < 0)
+				rte_exit(EXIT_FAILURE,
+					 "Read failed: %s\n",
+					 strerror(errno));
 		}
-
-		printf("Press enter to exit\n");
-		rc = read(0, &c, 1);
-		pmd_test_exit();
-		if (rc < 0)
-			return 1;
 	}
 
+	pmd_test_exit();
+
+#ifdef RTE_LIB_PDUMP
+	/* uninitialize packet capture framework */
+	rte_pdump_uninit();
+#endif
+#ifdef RTE_LIB_LATENCYSTATS
+	if (latencystats_enabled != 0)
+		rte_latencystats_uninit();
+#endif
+
 	ret = rte_eal_cleanup();
 	if (ret != 0)
 		rte_exit(EXIT_FAILURE,
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 76c2c55981..4ca1d59f09 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -25,6 +25,7 @@
 #define RTE_PORT_HANDLING       (uint16_t)3
 
 extern uint8_t cl_quit;
+extern volatile uint8_t f_quit;
 
 /*
  * It is used to allocate the memory for hash key.
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:50.950021147 +0000
+++ 0023-app-testpmd-cleanup-cleanly-from-signal.patch	2023-03-15 22:44:49.615850932 +0000
@@ -1 +1 @@
-From 0fd1386c30c3ad9365d7fdd2829bf7cb2e1b9dff Mon Sep 17 00:00:00 2001
+From c7154a7ed76d661a44b7d7948b4adce6810bfe45 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 0fd1386c30c3ad9365d7fdd2829bf7cb2e1b9dff ]
+
@@ -17 +18,0 @@
-Cc: stable@dpdk.org
@@ -22,2 +23,2 @@
- app/test-pmd/cmdline.c | 29 ++++++----------
- app/test-pmd/testpmd.c | 77 ++++++++++++++++++++----------------------
+ app/test-pmd/cmdline.c | 30 +++++++----------
+ app/test-pmd/testpmd.c | 75 ++++++++++++++++++++----------------------
@@ -25 +26 @@
- 3 files changed, 48 insertions(+), 59 deletions(-)
+ 3 files changed, 48 insertions(+), 58 deletions(-)
@@ -28 +29 @@
-index 02c72d06b7..6fa870dc32 100644
+index 9f46570cc4..8a7300bcf9 100644
@@ -31 +32 @@
-@@ -66,7 +66,6 @@
+@@ -71,8 +71,6 @@
@@ -36,4 +37,5 @@
- static cmdline_parse_ctx_t *main_ctx;
- static TAILQ_HEAD(, testpmd_driver_commands) driver_commands_head =
- 	TAILQ_HEAD_INITIALIZER(driver_commands_head);
-@@ -13033,28 +13032,22 @@ cmdline_read_from_file(const char *filename)
+-
+ static void cmd_reconfig_device_queue(portid_t id, uint8_t dev, uint8_t queue);
+ 
+ /* *** Help command with introduction. *** */
+@@ -17199,31 +17197,25 @@ cmdline_read_from_file(const char *filename)
@@ -44,0 +47,3 @@
+ 	/* initialize non-constant commands */
+ 	cmd_set_fwd_mode_init();
+ 	cmd_set_fwd_retry_mode_init();
@@ -54 +59 @@
--		fprintf(stderr, "Cannot set exit function for cmdline\n");
+-		printf("Cannot set exit function for cmdline\n");
@@ -78 +83 @@
- void
+ static void
@@ -80 +85 @@
-index 0032696608..2ce19ed47a 100644
+index f22c05920f..a061e10385 100644
@@ -83 +88,2 @@
-@@ -11,6 +11,7 @@
+@@ -10,6 +10,7 @@
+ #include <time.h>
@@ -85 +90,0 @@
- #ifndef RTE_EXEC_ENV_WINDOWS
@@ -88 +92,0 @@
- #endif
@@ -91 +95,2 @@
-@@ -231,7 +232,7 @@ unsigned int xstats_display_num; /**< Size of extended statistics to show */
+ #include <stdbool.h>
+@@ -216,7 +217,7 @@ uint16_t stats_period; /**< Period to show statistics (disabled by default) */
@@ -100 +105 @@
-@@ -4447,13 +4448,6 @@ init_port(void)
+@@ -3826,13 +3827,6 @@ init_port(void)
@@ -114 +119 @@
-@@ -4472,28 +4466,9 @@ print_stats(void)
+@@ -3851,26 +3845,9 @@ print_stats(void)
@@ -122,2 +127,2 @@
--		fprintf(stderr, "\nSignal %d received, preparing to exit...\n",
--			signum);
+-		printf("\nSignal %d received, preparing to exit...\n",
+-				signum);
@@ -136 +140,0 @@
--#ifndef RTE_EXEC_ENV_WINDOWS
@@ -139 +142,0 @@
--#endif
@@ -145 +148 @@
-@@ -4677,15 +4652,9 @@ main(int argc, char** argv)
+@@ -4044,15 +4021,9 @@ main(int argc, char** argv)
@@ -161 +164 @@
-@@ -4708,15 +4677,41 @@ main(int argc, char** argv)
+@@ -4075,15 +4046,41 @@ main(int argc, char** argv)
@@ -163 +166 @@
- 				rte_delay_us_sleep(US_PER_S);
+ 				sleep(1);
@@ -210 +213 @@
-index b9215720b6..bdfbfd36d3 100644
+index 76c2c55981..4ca1d59f09 100644
@@ -213 +216 @@
-@@ -34,6 +34,7 @@
+@@ -25,6 +25,7 @@

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/hns3: fix possible truncation of hash key when config' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (21 preceding siblings ...)
  2023-03-15 22:46     ` patch 'app/testpmd: cleanup cleanly from signal' " luca.boccassi
@ 2023-03-15 22:46     ` luca.boccassi
  2023-03-15 22:46     ` patch 'net/hns3: fix possible truncation of redirection table' " luca.boccassi
                       ` (14 subsequent siblings)
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:46 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From add16de717b4b9df71d3d554dab231179a234e2d Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Fri, 10 Mar 2023 17:35:03 +0800
Subject: [PATCH] net/hns3: fix possible truncation of hash key when config

[ upstream commit bb38316e738ad6009b3f20b3abfaf27ea8cb0202 ]

The hash key length of hns3 driver is obtained from firmware. If the
length is a multiple of HNS3_RSS_HASH_KEY_NUM (16), the last part
of hash key will be truncated.

Fixes: 88347111eb53 ("net/hns3: refactor set RSS hash algorithm and key interface")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_rss.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
index c38e12f79d..6478150f7b 100644
--- a/drivers/net/hns3/hns3_rss.c
+++ b/drivers/net/hns3/hns3_rss.c
@@ -301,7 +301,8 @@ hns3_set_rss_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
 		req->hash_config |= (hash_algo & HNS3_RSS_HASH_ALGO_MASK);
 		req->hash_config |= (idx << HNS3_RSS_HASH_KEY_OFFSET_B);
 
-		if (idx == max_bd_num - 1)
+		if (idx == max_bd_num - 1 &&
+		    (key_len % HNS3_RSS_HASH_KEY_NUM) != 0)
 			cur_key_size = key_len % HNS3_RSS_HASH_KEY_NUM;
 		else
 			cur_key_size = HNS3_RSS_HASH_KEY_NUM;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:51.020029637 +0000
+++ 0024-net-hns3-fix-possible-truncation-of-hash-key-when-co.patch	2023-03-15 22:44:49.615850932 +0000
@@ -1 +1 @@
-From bb38316e738ad6009b3f20b3abfaf27ea8cb0202 Mon Sep 17 00:00:00 2001
+From add16de717b4b9df71d3d554dab231179a234e2d Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit bb38316e738ad6009b3f20b3abfaf27ea8cb0202 ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index d6e0754273..2011c18b9b 100644
+index c38e12f79d..6478150f7b 100644
@@ -23 +24 @@
-@@ -301,7 +301,8 @@ hns3_rss_set_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
+@@ -301,7 +301,8 @@ hns3_set_rss_algo_key(struct hns3_hw *hw, uint8_t hash_algo,

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/hns3: fix possible truncation of redirection table' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (22 preceding siblings ...)
  2023-03-15 22:46     ` patch 'net/hns3: fix possible truncation of hash key when config' " luca.boccassi
@ 2023-03-15 22:46     ` luca.boccassi
  2023-03-15 22:46     ` patch 'net/hns3: use hardware config to report hash key' " luca.boccassi
                       ` (13 subsequent siblings)
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:46 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/4eb35e5bd4c23765a893cc0e0bee770fd6bf2063

Thanks.

Luca Boccassi

---
From 4eb35e5bd4c23765a893cc0e0bee770fd6bf2063 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Fri, 10 Mar 2023 17:35:04 +0800
Subject: [PATCH] net/hns3: fix possible truncation of redirection table

[ upstream commit 4729376e555b58a739e6e231d403ca3b029ad92c ]

The size of the redirection table is obtained from firmware. If the size
isn't a multiple of HNS3_RSS_CFG_TBL_SIZE, the redirection table from
user will be truncated.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_rss.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
index 6478150f7b..4926189588 100644
--- a/drivers/net/hns3/hns3_rss.c
+++ b/drivers/net/hns3/hns3_rss.c
@@ -329,6 +329,7 @@ int
 hns3_set_rss_indir_table(struct hns3_hw *hw, uint16_t *indir, uint16_t size)
 {
 	struct hns3_rss_indirection_table_cmd *req;
+	uint16_t max_bd_num, cfg_tbl_size;
 	struct hns3_cmd_desc desc;
 	uint8_t qid_msb_off;
 	uint8_t qid_msb_val;
@@ -337,14 +338,20 @@ hns3_set_rss_indir_table(struct hns3_hw *hw, uint16_t *indir, uint16_t size)
 	int ret;
 
 	req = (struct hns3_rss_indirection_table_cmd *)desc.data;
-
-	for (i = 0; i < size / HNS3_RSS_CFG_TBL_SIZE; i++) {
+	max_bd_num = DIV_ROUND_UP(size, HNS3_RSS_CFG_TBL_SIZE);
+	for (i = 0; i < max_bd_num; i++) {
 		hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_RSS_INDIR_TABLE,
 					  false);
 		req->start_table_index =
 				rte_cpu_to_le_16(i * HNS3_RSS_CFG_TBL_SIZE);
 		req->rss_set_bitmap = rte_cpu_to_le_16(HNS3_RSS_SET_BITMAP_MSK);
-		for (j = 0; j < HNS3_RSS_CFG_TBL_SIZE; j++) {
+
+		if (i == max_bd_num - 1 && (size % HNS3_RSS_CFG_TBL_SIZE) != 0)
+			cfg_tbl_size = size % HNS3_RSS_CFG_TBL_SIZE;
+		else
+			cfg_tbl_size = HNS3_RSS_CFG_TBL_SIZE;
+
+		for (j = 0; j < cfg_tbl_size; j++) {
 			q_id = indir[i * HNS3_RSS_CFG_TBL_SIZE + j];
 			req->rss_result_l[j] = q_id & 0xff;
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:51.081610436 +0000
+++ 0025-net-hns3-fix-possible-truncation-of-redirection-tabl.patch	2023-03-15 22:44:49.619851015 +0000
@@ -1 +1 @@
-From 4729376e555b58a739e6e231d403ca3b029ad92c Mon Sep 17 00:00:00 2001
+From 4eb35e5bd4c23765a893cc0e0bee770fd6bf2063 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 4729376e555b58a739e6e231d403ca3b029ad92c ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index 2011c18b9b..ed397587b5 100644
+index 6478150f7b..4926189588 100644

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/hns3: use hardware config to report hash key' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (23 preceding siblings ...)
  2023-03-15 22:46     ` patch 'net/hns3: fix possible truncation of redirection table' " luca.boccassi
@ 2023-03-15 22:46     ` luca.boccassi
  2023-03-15 22:46     ` patch 'net/hns3: use hardware config to report hash types' " luca.boccassi
                       ` (12 subsequent siblings)
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:46 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From a4362eaf1312d2eb3641b3b38b3eca4df9de74b5 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Fri, 10 Mar 2023 17:35:05 +0800
Subject: [PATCH] net/hns3: use hardware config to report hash key

[ upstream commit 7da415d27d8872a45a2d0cf9b5e66a8027c8f53c ]

Currently, hns3_dev_rss_hash_conf_get() interface reports RSS key from
the key maintained by driver. It's better to report the key from
hardware, which is more realistic.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_rss.c | 53 ++++++++++++++++++++++++++++++++++++-
 drivers/net/hns3/hns3_rss.h |  3 ++-
 2 files changed, 54 insertions(+), 2 deletions(-)

diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
index 4926189588..e624df073e 100644
--- a/drivers/net/hns3/hns3_rss.c
+++ b/drivers/net/hns3/hns3_rss.c
@@ -321,6 +321,48 @@ hns3_set_rss_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
 	return 0;
 }
 
+int
+hns3_rss_get_algo_key(struct hns3_hw *hw,  uint8_t *hash_algo,
+		      uint8_t *key, uint8_t key_len)
+{
+	struct hns3_rss_generic_config_cmd *req;
+	struct hns3_cmd_desc desc;
+	uint16_t cur_key_size;
+	uint16_t max_bd_num;
+	uint8_t *cur_key;
+	uint16_t idx;
+	int ret;
+
+	req = (struct hns3_rss_generic_config_cmd *)desc.data;
+	max_bd_num = DIV_ROUND_UP(key_len, HNS3_RSS_HASH_KEY_NUM);
+	for (idx = 0; idx < max_bd_num; idx++) {
+		hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_RSS_GENERIC_CONFIG,
+					  true);
+
+		req->hash_config |= (idx << HNS3_RSS_HASH_KEY_OFFSET_B);
+		ret = hns3_cmd_send(hw, &desc, 1);
+		if (ret) {
+			hns3_err(hw, "fail to obtain RSS algo and key from firmware, ret = %d",
+				 ret);
+			return ret;
+		}
+
+		if (idx == 0)
+			*hash_algo = req->hash_config & HNS3_RSS_HASH_ALGO_MASK;
+
+		if (idx == max_bd_num - 1 &&
+		    (key_len % HNS3_RSS_HASH_KEY_NUM) != 0)
+			cur_key_size = key_len % HNS3_RSS_HASH_KEY_NUM;
+		else
+			cur_key_size = HNS3_RSS_HASH_KEY_NUM;
+
+		cur_key = key + idx * HNS3_RSS_HASH_KEY_NUM;
+		memcpy(cur_key, req->hash_key, cur_key_size);
+	}
+
+	return 0;
+}
+
 /*
  * rss_indirection_table command function, opcode:0x0D07.
  * Used to configure the indirection table of rss.
@@ -550,13 +592,22 @@ hns3_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
 	struct hns3_adapter *hns = dev->data->dev_private;
 	struct hns3_hw *hw = &hns->hw;
 	struct hns3_rss_conf *rss_cfg = &hw->rss_info;
+	uint8_t hash_algo;
+	int ret;
 
 	rte_spinlock_lock(&hw->lock);
 	rss_conf->rss_hf = rss_cfg->conf.types;
 
 	/* Get the RSS Key required by the user */
 	if (rss_conf->rss_key && rss_conf->rss_key_len >= hw->rss_key_size) {
-		memcpy(rss_conf->rss_key, rss_cfg->key, hw->rss_key_size);
+		ret = hns3_rss_get_algo_key(hw, &hash_algo, rss_conf->rss_key,
+					    hw->rss_key_size);
+		if (ret != 0) {
+			rte_spinlock_unlock(&hw->lock);
+			hns3_err(hw, "obtain hash algo and key failed, ret = %d",
+				 ret);
+			return ret;
+		}
 		rss_conf->rss_key_len = hw->rss_key_size;
 	}
 	rte_spinlock_unlock(&hw->lock);
diff --git a/drivers/net/hns3/hns3_rss.h b/drivers/net/hns3/hns3_rss.h
index 636b6fdf3a..5af3005653 100644
--- a/drivers/net/hns3/hns3_rss.h
+++ b/drivers/net/hns3/hns3_rss.h
@@ -117,6 +117,7 @@ int hns3_set_rss_tuple_by_rss_hf(struct hns3_hw *hw, uint64_t rss_hf);
 int hns3_set_rss_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
 			  const uint8_t *key, uint8_t key_len);
 int hns3_restore_filter(struct hns3_adapter *hns);
-
+int hns3_rss_get_algo_key(struct hns3_hw *hw,  uint8_t *hash_algo,
+			  uint8_t *key, uint8_t key_len);
 
 #endif /* _HNS3_RSS_H_ */
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:51.137220608 +0000
+++ 0026-net-hns3-use-hardware-config-to-report-hash-key.patch	2023-03-15 22:44:49.623851099 +0000
@@ -1 +1 @@
-From 7da415d27d8872a45a2d0cf9b5e66a8027c8f53c Mon Sep 17 00:00:00 2001
+From a4362eaf1312d2eb3641b3b38b3eca4df9de74b5 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 7da415d27d8872a45a2d0cf9b5e66a8027c8f53c ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -21 +22 @@
-index ed397587b5..a8ea5150ab 100644
+index 4926189588..e624df073e 100644
@@ -24 +25 @@
-@@ -321,6 +321,48 @@ hns3_rss_set_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
+@@ -321,6 +321,48 @@ hns3_set_rss_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
@@ -98 +99 @@
-index d6f81996f4..be0141f602 100644
+index 636b6fdf3a..5af3005653 100644
@@ -101,3 +102,2 @@
-@@ -112,6 +112,7 @@ void hns3_rss_uninit(struct hns3_adapter *hns);
- int hns3_set_rss_tuple_by_rss_hf(struct hns3_hw *hw, uint64_t rss_hf);
- int hns3_rss_set_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
+@@ -117,6 +117,7 @@ int hns3_set_rss_tuple_by_rss_hf(struct hns3_hw *hw, uint64_t rss_hf);
+ int hns3_set_rss_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
@@ -104,0 +105 @@
+ int hns3_restore_filter(struct hns3_adapter *hns);
@@ -109 +110 @@
- #endif /* HNS3_RSS_H */
+ #endif /* _HNS3_RSS_H_ */

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/hns3: use hardware config to report hash types' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (24 preceding siblings ...)
  2023-03-15 22:46     ` patch 'net/hns3: use hardware config to report hash key' " luca.boccassi
@ 2023-03-15 22:46     ` luca.boccassi
  2023-03-15 22:46     ` patch 'net/hns3: use hardware config to report redirection table' " luca.boccassi
                       ` (11 subsequent siblings)
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:46 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/3aa8f6400b61ed6a210fb32ce7948b9f7893f8be

Thanks.

Luca Boccassi

---
From 3aa8f6400b61ed6a210fb32ce7948b9f7893f8be Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Fri, 10 Mar 2023 17:35:06 +0800
Subject: [PATCH] net/hns3: use hardware config to report hash types

[ upstream commit 406b25c7ffd2d84b1e09665872f69755c75e7d89 ]

Use the configuration in hardware to report hash types instead
of data maintained in software.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_rss.c | 260 ++++++++++++++++++++++++++++--------
 drivers/net/hns3/hns3_rss.h |   1 +
 2 files changed, 208 insertions(+), 53 deletions(-)

diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
index e624df073e..7c2b4bcd1f 100644
--- a/drivers/net/hns3/hns3_rss.c
+++ b/drivers/net/hns3/hns3_rss.c
@@ -70,6 +70,17 @@ enum hns3_tuple_field {
 	HNS3_RSS_FIELD_IPV6_FRAG_IP_S
 };
 
+#define HNS3_RSS_TUPLE_IPV4_TCP_M	GENMASK(3, 0)
+#define HNS3_RSS_TUPLE_IPV4_UDP_M	GENMASK(11, 8)
+#define HNS3_RSS_TUPLE_IPV4_SCTP_M	GENMASK(20, 16)
+#define HNS3_RSS_TUPLE_IPV4_NONF_M	GENMASK(25, 24)
+#define HNS3_RSS_TUPLE_IPV4_FLAG_M	GENMASK(27, 26)
+#define HNS3_RSS_TUPLE_IPV6_TCP_M	GENMASK(35, 32)
+#define HNS3_RSS_TUPLE_IPV6_UDP_M	GENMASK(43, 40)
+#define HNS3_RSS_TUPLE_IPV6_SCTP_M	GENMASK(52, 48)
+#define HNS3_RSS_TUPLE_IPV6_NONF_M	GENMASK(57, 56)
+#define HNS3_RSS_TUPLE_IPV6_FLAG_M	GENMASK(59, 58)
+
 enum hns3_rss_tuple_type {
 	HNS3_RSS_IP_TUPLE,
 	HNS3_RSS_IP_L4_TUPLE,
@@ -79,200 +90,249 @@ static const struct {
 	uint64_t rss_types;
 	uint16_t tuple_type;
 	uint64_t rss_field;
+	uint64_t tuple_mask;
 } hns3_set_tuple_table[] = {
 	/* IPV4-FRAG */
 	{ ETH_RSS_FRAG_IPV4 | ETH_RSS_L3_SRC_ONLY,
 	  HNS3_RSS_IP_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_FRAG_IP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_FRAG_IP_S),
+	  HNS3_RSS_TUPLE_IPV4_FLAG_M },
 	{ ETH_RSS_FRAG_IPV4 | ETH_RSS_L3_DST_ONLY,
 	  HNS3_RSS_IP_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_FRAG_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_FRAG_IP_D),
+	  HNS3_RSS_TUPLE_IPV4_FLAG_M },
 	{ ETH_RSS_FRAG_IPV4,
 	  HNS3_RSS_IP_TUPLE,
 	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_FRAG_IP_S) |
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_FRAG_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_FRAG_IP_D),
+	  HNS3_RSS_TUPLE_IPV4_FLAG_M },
 
 	/* IPV4 */
 	{ ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY,
 	  HNS3_RSS_IP_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_S),
+	  HNS3_RSS_TUPLE_IPV4_NONF_M },
 	{ ETH_RSS_IPV4 | ETH_RSS_L3_DST_ONLY,
 	  HNS3_RSS_IP_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_D),
+	  HNS3_RSS_TUPLE_IPV4_NONF_M },
 	{ ETH_RSS_IPV4,
 	  HNS3_RSS_IP_TUPLE,
 	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_S) |
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_D),
+	  HNS3_RSS_TUPLE_IPV4_NONF_M },
 
 	/* IPV4-OTHER */
 	{ ETH_RSS_NONFRAG_IPV4_OTHER | ETH_RSS_L3_SRC_ONLY,
 	  HNS3_RSS_IP_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_S),
+	  HNS3_RSS_TUPLE_IPV4_NONF_M },
 	{ ETH_RSS_NONFRAG_IPV4_OTHER | ETH_RSS_L3_DST_ONLY,
 	  HNS3_RSS_IP_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_D),
+	  HNS3_RSS_TUPLE_IPV4_NONF_M },
 	{ ETH_RSS_NONFRAG_IPV4_OTHER,
 	  HNS3_RSS_IP_TUPLE,
 	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_S) |
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_D),
+	  HNS3_RSS_TUPLE_IPV4_NONF_M },
 
 	/* IPV4-TCP */
 	{ ETH_RSS_NONFRAG_IPV4_TCP | ETH_RSS_L3_SRC_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_TCP_EN_IP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_TCP_EN_IP_S),
+	  HNS3_RSS_TUPLE_IPV4_TCP_M },
 	{ ETH_RSS_NONFRAG_IPV4_TCP | ETH_RSS_L3_DST_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_TCP_EN_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_TCP_EN_IP_D),
+	  HNS3_RSS_TUPLE_IPV4_TCP_M },
 	{ ETH_RSS_NONFRAG_IPV4_TCP | ETH_RSS_L4_SRC_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_TCP_EN_TCP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_TCP_EN_TCP_S),
+	  HNS3_RSS_TUPLE_IPV4_TCP_M },
 	{ ETH_RSS_NONFRAG_IPV4_TCP | ETH_RSS_L4_DST_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_TCP_EN_TCP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_TCP_EN_TCP_D),
+	  HNS3_RSS_TUPLE_IPV4_TCP_M },
 	{ ETH_RSS_NONFRAG_IPV4_TCP,
 	  HNS3_RSS_IP_L4_TUPLE,
 	  BIT_ULL(HNS3_RSS_FIELD_IPV4_TCP_EN_IP_S) |
 	  BIT_ULL(HNS3_RSS_FIELD_IPV4_TCP_EN_IP_D) |
 	  BIT_ULL(HNS3_RSS_FIELD_IPV4_TCP_EN_TCP_S) |
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_TCP_EN_TCP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_TCP_EN_TCP_D),
+	  HNS3_RSS_TUPLE_IPV4_TCP_M },
 
 	/* IPV4-UDP */
 	{ ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_L3_SRC_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_UDP_EN_IP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_UDP_EN_IP_S),
+	  HNS3_RSS_TUPLE_IPV4_UDP_M },
 	{ ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_L3_DST_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_UDP_EN_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_UDP_EN_IP_D),
+	  HNS3_RSS_TUPLE_IPV4_UDP_M },
 	{ ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_L4_SRC_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_UDP_EN_UDP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_UDP_EN_UDP_S),
+	  HNS3_RSS_TUPLE_IPV4_UDP_M },
 	{ ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_L4_DST_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_UDP_EN_UDP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_UDP_EN_UDP_D),
+	  HNS3_RSS_TUPLE_IPV4_UDP_M },
 	{ ETH_RSS_NONFRAG_IPV4_UDP,
 	  HNS3_RSS_IP_L4_TUPLE,
 	  BIT_ULL(HNS3_RSS_FIELD_IPV4_UDP_EN_IP_S) |
 	  BIT_ULL(HNS3_RSS_FIELD_IPV4_UDP_EN_IP_D) |
 	  BIT_ULL(HNS3_RSS_FIELD_IPV4_UDP_EN_UDP_S) |
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_UDP_EN_UDP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_UDP_EN_UDP_D),
+	  HNS3_RSS_TUPLE_IPV4_UDP_M },
 
 	/* IPV4-SCTP */
 	{ ETH_RSS_NONFRAG_IPV4_SCTP | ETH_RSS_L3_SRC_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_IP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_IP_S),
+	  HNS3_RSS_TUPLE_IPV4_SCTP_M },
 	{ ETH_RSS_NONFRAG_IPV4_SCTP | ETH_RSS_L3_DST_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_IP_D),
+	  HNS3_RSS_TUPLE_IPV4_SCTP_M },
 	{ ETH_RSS_NONFRAG_IPV4_SCTP | ETH_RSS_L4_SRC_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_S),
+	  HNS3_RSS_TUPLE_IPV4_SCTP_M },
 	{ ETH_RSS_NONFRAG_IPV4_SCTP | ETH_RSS_L4_DST_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_D),
+	  HNS3_RSS_TUPLE_IPV4_SCTP_M },
 	{ ETH_RSS_NONFRAG_IPV4_SCTP,
 	  HNS3_RSS_IP_L4_TUPLE,
 	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_IP_S) |
 	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_IP_D) |
 	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_S) |
 	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_D) |
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_VER) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_VER),
+	  HNS3_RSS_TUPLE_IPV4_SCTP_M },
 
 	/* IPV6-FRAG */
 	{ ETH_RSS_FRAG_IPV6 | ETH_RSS_L3_SRC_ONLY,
 	  HNS3_RSS_IP_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_FRAG_IP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_FRAG_IP_S),
+	  HNS3_RSS_TUPLE_IPV6_FLAG_M },
 	{ ETH_RSS_FRAG_IPV6 | ETH_RSS_L3_DST_ONLY,
 	  HNS3_RSS_IP_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_FRAG_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_FRAG_IP_D),
+	  HNS3_RSS_TUPLE_IPV6_FLAG_M },
 	{ ETH_RSS_FRAG_IPV6,
 	  HNS3_RSS_IP_TUPLE,
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_FRAG_IP_S) |
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_FRAG_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_FRAG_IP_D),
+	  HNS3_RSS_TUPLE_IPV6_FLAG_M },
 
 	/* IPV6 */
 	{ ETH_RSS_IPV6 | ETH_RSS_L3_SRC_ONLY,
 	  HNS3_RSS_IP_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_NONFRAG_IP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_NONFRAG_IP_S),
+	  HNS3_RSS_TUPLE_IPV6_NONF_M },
 	{ ETH_RSS_IPV6 | ETH_RSS_L3_DST_ONLY,
 	  HNS3_RSS_IP_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_NONFRAG_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_NONFRAG_IP_D),
+	  HNS3_RSS_TUPLE_IPV6_NONF_M },
 	{ ETH_RSS_IPV6,
 	  HNS3_RSS_IP_TUPLE,
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_NONFRAG_IP_S) |
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_NONFRAG_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_NONFRAG_IP_D),
+	  HNS3_RSS_TUPLE_IPV6_NONF_M },
 
 	/* IPV6-OTHER */
 	{ ETH_RSS_NONFRAG_IPV6_OTHER | ETH_RSS_L3_SRC_ONLY,
 	  HNS3_RSS_IP_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_NONFRAG_IP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_NONFRAG_IP_S),
+	  HNS3_RSS_TUPLE_IPV6_NONF_M },
 	{ ETH_RSS_NONFRAG_IPV6_OTHER | ETH_RSS_L3_DST_ONLY,
 	  HNS3_RSS_IP_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_NONFRAG_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_NONFRAG_IP_D),
+	  HNS3_RSS_TUPLE_IPV6_NONF_M },
 	{ ETH_RSS_NONFRAG_IPV6_OTHER,
 	  HNS3_RSS_IP_TUPLE,
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_NONFRAG_IP_S) |
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_NONFRAG_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_NONFRAG_IP_D),
+	  HNS3_RSS_TUPLE_IPV6_NONF_M },
 
 	/* IPV6-TCP */
 	{ ETH_RSS_NONFRAG_IPV6_TCP | ETH_RSS_L3_SRC_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_TCP_EN_IP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_TCP_EN_IP_S),
+	  HNS3_RSS_TUPLE_IPV6_TCP_M },
 	{ ETH_RSS_NONFRAG_IPV6_TCP | ETH_RSS_L3_DST_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_TCP_EN_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_TCP_EN_IP_D),
+	  HNS3_RSS_TUPLE_IPV6_TCP_M },
 	{ ETH_RSS_NONFRAG_IPV6_TCP | ETH_RSS_L4_SRC_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_TCP_EN_TCP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_TCP_EN_TCP_S),
+	  HNS3_RSS_TUPLE_IPV6_TCP_M },
 	{ ETH_RSS_NONFRAG_IPV6_TCP | ETH_RSS_L4_DST_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_TCP_EN_TCP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_TCP_EN_TCP_D),
+	  HNS3_RSS_TUPLE_IPV6_TCP_M },
 	{ ETH_RSS_NONFRAG_IPV6_TCP,
 	  HNS3_RSS_IP_L4_TUPLE,
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_TCP_EN_IP_S) |
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_TCP_EN_IP_D) |
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_TCP_EN_TCP_S) |
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_TCP_EN_TCP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_TCP_EN_TCP_D),
+	  HNS3_RSS_TUPLE_IPV6_TCP_M },
 
 	/* IPV6-UDP */
 	{ ETH_RSS_NONFRAG_IPV6_UDP | ETH_RSS_L3_SRC_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_UDP_EN_IP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_UDP_EN_IP_S),
+	  HNS3_RSS_TUPLE_IPV6_UDP_M },
 	{ ETH_RSS_NONFRAG_IPV6_UDP | ETH_RSS_L3_DST_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_UDP_EN_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_UDP_EN_IP_D),
+	  HNS3_RSS_TUPLE_IPV6_UDP_M },
 	{ ETH_RSS_NONFRAG_IPV6_UDP | ETH_RSS_L4_SRC_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_UDP_EN_UDP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_UDP_EN_UDP_S),
+	  HNS3_RSS_TUPLE_IPV6_UDP_M },
 	{ ETH_RSS_NONFRAG_IPV6_UDP | ETH_RSS_L4_DST_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_UDP_EN_UDP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_UDP_EN_UDP_D),
+	  HNS3_RSS_TUPLE_IPV6_UDP_M },
 	{ ETH_RSS_NONFRAG_IPV6_UDP,
 	  HNS3_RSS_IP_L4_TUPLE,
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_UDP_EN_IP_S) |
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_UDP_EN_IP_D) |
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_UDP_EN_UDP_S) |
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_UDP_EN_UDP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_UDP_EN_UDP_D),
+	  HNS3_RSS_TUPLE_IPV6_UDP_M },
 
 	/* IPV6-SCTP */
 	{ ETH_RSS_NONFRAG_IPV6_SCTP | ETH_RSS_L3_SRC_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_S),
+	  HNS3_RSS_TUPLE_IPV6_SCTP_M },
 	{ ETH_RSS_NONFRAG_IPV6_SCTP | ETH_RSS_L3_DST_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_D),
+	  HNS3_RSS_TUPLE_IPV6_SCTP_M },
 	{ ETH_RSS_NONFRAG_IPV6_SCTP | ETH_RSS_L4_SRC_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_S),
+	  HNS3_RSS_TUPLE_IPV6_SCTP_M },
 	{ ETH_RSS_NONFRAG_IPV6_SCTP | ETH_RSS_L4_DST_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_D),
+	  HNS3_RSS_TUPLE_IPV6_SCTP_M },
 	{ ETH_RSS_NONFRAG_IPV6_SCTP,
 	  HNS3_RSS_IP_L4_TUPLE,
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_S) |
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_D) |
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_D) |
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_S) |
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_VER) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_VER),
+	  HNS3_RSS_TUPLE_IPV6_SCTP_M },
 };
 
 /*
@@ -576,6 +636,96 @@ set_tuple_fail:
 	return ret;
 }
 
+int
+hns3_get_rss_tuple_field(struct hns3_hw *hw, uint64_t *tuple_fields)
+{
+	struct hns3_rss_input_tuple_cmd *req;
+	struct hns3_cmd_desc desc;
+	int ret;
+
+	hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_RSS_INPUT_TUPLE, true);
+	req = (struct hns3_rss_input_tuple_cmd *)desc.data;
+	ret = hns3_cmd_send(hw, &desc, 1);
+	if (ret != 0) {
+		hns3_err(hw, "fail to get RSS hash tuple fields from firmware, ret = %d",
+			 ret);
+		return ret;
+	}
+
+	*tuple_fields = rte_le_to_cpu_64(req->tuple_field);
+
+	return 0;
+}
+
+static uint64_t
+hns3_rss_tuple_fields_to_rss_hf(struct hns3_hw *hw, uint64_t tuple_fields)
+{
+	uint64_t ipv6_sctp_l4_mask =
+				BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_D) |
+				BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_S);
+	uint64_t rss_hf = 0;
+	uint64_t tuple_mask;
+	uint32_t i;
+
+	for (i = 0; i < RTE_DIM(hns3_set_tuple_table); i++) {
+		tuple_mask = hns3_set_tuple_table[i].tuple_mask;
+		/*
+		 * The RSS hash of the packet type is disabled if its tuples is
+		 * zero.
+		 */
+		if ((tuple_fields & tuple_mask) == 0)
+			continue;
+
+		/*
+		 * Some hardware don't support to use src/dst port fields to
+		 * hash for IPV6-SCTP packet.
+		 */
+		if ((hns3_set_tuple_table[i].rss_types &
+					ETH_RSS_NONFRAG_IPV6_SCTP) &&
+		    !hw->rss_info.ipv6_sctp_offload_supported)
+			tuple_mask &= ~ipv6_sctp_l4_mask;
+
+		/*
+		 * The framework (ethdev ops) or driver (rte flow API) ensure
+		 * that both L3_SRC/DST_ONLY and L4_SRC/DST_ONLY cannot be set
+		 * to driver at the same time. But if user doesn't specify
+		 * anything L3/L4_SRC/DST_ONLY, driver enables all tuple fields.
+		 * In this case, driver should not report L3/L4_SRC/DST_ONLY.
+		 */
+		if ((tuple_fields & tuple_mask) == tuple_mask) {
+			/* Skip the item enabled part tuples. */
+			if ((tuple_fields & hns3_set_tuple_table[i].rss_field) !=
+					tuple_mask)
+				continue;
+
+			rss_hf |= hns3_set_tuple_table[i].rss_types;
+			continue;
+		}
+
+		/* Match the item enabled part tuples.*/
+		if ((tuple_fields & hns3_set_tuple_table[i].rss_field) ==
+					hns3_set_tuple_table[i].rss_field)
+			rss_hf |= hns3_set_tuple_table[i].rss_types;
+	}
+
+	return rss_hf;
+}
+
+static int
+hns3_rss_hash_get_rss_hf(struct hns3_hw *hw, uint64_t *rss_hf)
+{
+	uint64_t tuple_fields;
+	int ret;
+
+	ret = hns3_get_rss_tuple_field(hw, &tuple_fields);
+	if (ret != 0)
+		return ret;
+
+	*rss_hf = hns3_rss_tuple_fields_to_rss_hf(hw, tuple_fields);
+
+	return 0;
+}
+
 /*
  * Get rss key and rss_hf types set of RSS hash configuration.
  * @param dev
@@ -591,28 +741,32 @@ hns3_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
 {
 	struct hns3_adapter *hns = dev->data->dev_private;
 	struct hns3_hw *hw = &hns->hw;
-	struct hns3_rss_conf *rss_cfg = &hw->rss_info;
 	uint8_t hash_algo;
 	int ret;
 
 	rte_spinlock_lock(&hw->lock);
-	rss_conf->rss_hf = rss_cfg->conf.types;
+	ret = hns3_rss_hash_get_rss_hf(hw, &rss_conf->rss_hf);
+	if (ret != 0) {
+		hns3_err(hw, "obtain hash tuples failed, ret = %d", ret);
+		goto out;
+	}
 
 	/* Get the RSS Key required by the user */
 	if (rss_conf->rss_key && rss_conf->rss_key_len >= hw->rss_key_size) {
 		ret = hns3_rss_get_algo_key(hw, &hash_algo, rss_conf->rss_key,
 					    hw->rss_key_size);
 		if (ret != 0) {
-			rte_spinlock_unlock(&hw->lock);
 			hns3_err(hw, "obtain hash algo and key failed, ret = %d",
 				 ret);
-			return ret;
+			goto out;
 		}
 		rss_conf->rss_key_len = hw->rss_key_size;
 	}
+
+out:
 	rte_spinlock_unlock(&hw->lock);
 
-	return 0;
+	return ret;
 }
 
 /*
diff --git a/drivers/net/hns3/hns3_rss.h b/drivers/net/hns3/hns3_rss.h
index 5af3005653..b724490fe2 100644
--- a/drivers/net/hns3/hns3_rss.h
+++ b/drivers/net/hns3/hns3_rss.h
@@ -114,6 +114,7 @@ int hns3_rss_reset_indir_table(struct hns3_hw *hw);
 int hns3_config_rss(struct hns3_adapter *hns);
 void hns3_rss_uninit(struct hns3_adapter *hns);
 int hns3_set_rss_tuple_by_rss_hf(struct hns3_hw *hw, uint64_t rss_hf);
+int hns3_get_rss_tuple_field(struct hns3_hw *hw, uint64_t *tuple_fields);
 int hns3_set_rss_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
 			  const uint8_t *key, uint8_t key_len);
 int hns3_restore_filter(struct hns3_adapter *hns);
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:51.190290473 +0000
+++ 0027-net-hns3-use-hardware-config-to-report-hash-types.patch	2023-03-15 22:44:49.623851099 +0000
@@ -1 +1 @@
-From 406b25c7ffd2d84b1e09665872f69755c75e7d89 Mon Sep 17 00:00:00 2001
+From 3aa8f6400b61ed6a210fb32ce7948b9f7893f8be Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 406b25c7ffd2d84b1e09665872f69755c75e7d89 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index a8ea5150ab..9addc00a67 100644
+index e624df073e..7c2b4bcd1f 100644
@@ -48 +49 @@
- 	{ RTE_ETH_RSS_FRAG_IPV4 | RTE_ETH_RSS_L3_SRC_ONLY,
+ 	{ ETH_RSS_FRAG_IPV4 | ETH_RSS_L3_SRC_ONLY,
@@ -53 +54 @@
- 	{ RTE_ETH_RSS_FRAG_IPV4 | RTE_ETH_RSS_L3_DST_ONLY,
+ 	{ ETH_RSS_FRAG_IPV4 | ETH_RSS_L3_DST_ONLY,
@@ -58 +59 @@
- 	{ RTE_ETH_RSS_FRAG_IPV4,
+ 	{ ETH_RSS_FRAG_IPV4,
@@ -66 +67 @@
- 	{ RTE_ETH_RSS_IPV4 | RTE_ETH_RSS_L3_SRC_ONLY,
+ 	{ ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY,
@@ -71 +72 @@
- 	{ RTE_ETH_RSS_IPV4 | RTE_ETH_RSS_L3_DST_ONLY,
+ 	{ ETH_RSS_IPV4 | ETH_RSS_L3_DST_ONLY,
@@ -76 +77 @@
- 	{ RTE_ETH_RSS_IPV4,
+ 	{ ETH_RSS_IPV4,
@@ -84 +85 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV4_OTHER | RTE_ETH_RSS_L3_SRC_ONLY,
+ 	{ ETH_RSS_NONFRAG_IPV4_OTHER | ETH_RSS_L3_SRC_ONLY,
@@ -89 +90 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV4_OTHER | RTE_ETH_RSS_L3_DST_ONLY,
+ 	{ ETH_RSS_NONFRAG_IPV4_OTHER | ETH_RSS_L3_DST_ONLY,
@@ -94 +95 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV4_OTHER,
+ 	{ ETH_RSS_NONFRAG_IPV4_OTHER,
@@ -102 +103 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV4_TCP | RTE_ETH_RSS_L3_SRC_ONLY,
+ 	{ ETH_RSS_NONFRAG_IPV4_TCP | ETH_RSS_L3_SRC_ONLY,
@@ -107 +108 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV4_TCP | RTE_ETH_RSS_L3_DST_ONLY,
+ 	{ ETH_RSS_NONFRAG_IPV4_TCP | ETH_RSS_L3_DST_ONLY,
@@ -112 +113 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV4_TCP | RTE_ETH_RSS_L4_SRC_ONLY,
+ 	{ ETH_RSS_NONFRAG_IPV4_TCP | ETH_RSS_L4_SRC_ONLY,
@@ -117 +118 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV4_TCP | RTE_ETH_RSS_L4_DST_ONLY,
+ 	{ ETH_RSS_NONFRAG_IPV4_TCP | ETH_RSS_L4_DST_ONLY,
@@ -122 +123 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV4_TCP,
+ 	{ ETH_RSS_NONFRAG_IPV4_TCP,
@@ -132 +133 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV4_UDP | RTE_ETH_RSS_L3_SRC_ONLY,
+ 	{ ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_L3_SRC_ONLY,
@@ -137 +138 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV4_UDP | RTE_ETH_RSS_L3_DST_ONLY,
+ 	{ ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_L3_DST_ONLY,
@@ -142 +143 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV4_UDP | RTE_ETH_RSS_L4_SRC_ONLY,
+ 	{ ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_L4_SRC_ONLY,
@@ -147 +148 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV4_UDP | RTE_ETH_RSS_L4_DST_ONLY,
+ 	{ ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_L4_DST_ONLY,
@@ -152 +153 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV4_UDP,
+ 	{ ETH_RSS_NONFRAG_IPV4_UDP,
@@ -162 +163 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV4_SCTP | RTE_ETH_RSS_L3_SRC_ONLY,
+ 	{ ETH_RSS_NONFRAG_IPV4_SCTP | ETH_RSS_L3_SRC_ONLY,
@@ -167 +168 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV4_SCTP | RTE_ETH_RSS_L3_DST_ONLY,
+ 	{ ETH_RSS_NONFRAG_IPV4_SCTP | ETH_RSS_L3_DST_ONLY,
@@ -172 +173 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV4_SCTP | RTE_ETH_RSS_L4_SRC_ONLY,
+ 	{ ETH_RSS_NONFRAG_IPV4_SCTP | ETH_RSS_L4_SRC_ONLY,
@@ -177 +178 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV4_SCTP | RTE_ETH_RSS_L4_DST_ONLY,
+ 	{ ETH_RSS_NONFRAG_IPV4_SCTP | ETH_RSS_L4_DST_ONLY,
@@ -182 +183 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV4_SCTP,
+ 	{ ETH_RSS_NONFRAG_IPV4_SCTP,
@@ -193 +194 @@
- 	{ RTE_ETH_RSS_FRAG_IPV6 | RTE_ETH_RSS_L3_SRC_ONLY,
+ 	{ ETH_RSS_FRAG_IPV6 | ETH_RSS_L3_SRC_ONLY,
@@ -198 +199 @@
- 	{ RTE_ETH_RSS_FRAG_IPV6 | RTE_ETH_RSS_L3_DST_ONLY,
+ 	{ ETH_RSS_FRAG_IPV6 | ETH_RSS_L3_DST_ONLY,
@@ -203 +204 @@
- 	{ RTE_ETH_RSS_FRAG_IPV6,
+ 	{ ETH_RSS_FRAG_IPV6,
@@ -211 +212 @@
- 	{ RTE_ETH_RSS_IPV6 | RTE_ETH_RSS_L3_SRC_ONLY,
+ 	{ ETH_RSS_IPV6 | ETH_RSS_L3_SRC_ONLY,
@@ -216 +217 @@
- 	{ RTE_ETH_RSS_IPV6 | RTE_ETH_RSS_L3_DST_ONLY,
+ 	{ ETH_RSS_IPV6 | ETH_RSS_L3_DST_ONLY,
@@ -221 +222 @@
- 	{ RTE_ETH_RSS_IPV6,
+ 	{ ETH_RSS_IPV6,
@@ -229 +230 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV6_OTHER | RTE_ETH_RSS_L3_SRC_ONLY,
+ 	{ ETH_RSS_NONFRAG_IPV6_OTHER | ETH_RSS_L3_SRC_ONLY,
@@ -234 +235 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV6_OTHER | RTE_ETH_RSS_L3_DST_ONLY,
+ 	{ ETH_RSS_NONFRAG_IPV6_OTHER | ETH_RSS_L3_DST_ONLY,
@@ -239 +240 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV6_OTHER,
+ 	{ ETH_RSS_NONFRAG_IPV6_OTHER,
@@ -247 +248 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV6_TCP | RTE_ETH_RSS_L3_SRC_ONLY,
+ 	{ ETH_RSS_NONFRAG_IPV6_TCP | ETH_RSS_L3_SRC_ONLY,
@@ -252 +253 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV6_TCP | RTE_ETH_RSS_L3_DST_ONLY,
+ 	{ ETH_RSS_NONFRAG_IPV6_TCP | ETH_RSS_L3_DST_ONLY,
@@ -257 +258 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV6_TCP | RTE_ETH_RSS_L4_SRC_ONLY,
+ 	{ ETH_RSS_NONFRAG_IPV6_TCP | ETH_RSS_L4_SRC_ONLY,
@@ -262 +263 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV6_TCP | RTE_ETH_RSS_L4_DST_ONLY,
+ 	{ ETH_RSS_NONFRAG_IPV6_TCP | ETH_RSS_L4_DST_ONLY,
@@ -267 +268 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV6_TCP,
+ 	{ ETH_RSS_NONFRAG_IPV6_TCP,
@@ -277 +278 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV6_UDP | RTE_ETH_RSS_L3_SRC_ONLY,
+ 	{ ETH_RSS_NONFRAG_IPV6_UDP | ETH_RSS_L3_SRC_ONLY,
@@ -282 +283 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV6_UDP | RTE_ETH_RSS_L3_DST_ONLY,
+ 	{ ETH_RSS_NONFRAG_IPV6_UDP | ETH_RSS_L3_DST_ONLY,
@@ -287 +288 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV6_UDP | RTE_ETH_RSS_L4_SRC_ONLY,
+ 	{ ETH_RSS_NONFRAG_IPV6_UDP | ETH_RSS_L4_SRC_ONLY,
@@ -292 +293 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV6_UDP | RTE_ETH_RSS_L4_DST_ONLY,
+ 	{ ETH_RSS_NONFRAG_IPV6_UDP | ETH_RSS_L4_DST_ONLY,
@@ -297 +298 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV6_UDP,
+ 	{ ETH_RSS_NONFRAG_IPV6_UDP,
@@ -307 +308 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV6_SCTP | RTE_ETH_RSS_L3_SRC_ONLY,
+ 	{ ETH_RSS_NONFRAG_IPV6_SCTP | ETH_RSS_L3_SRC_ONLY,
@@ -312 +313 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV6_SCTP | RTE_ETH_RSS_L3_DST_ONLY,
+ 	{ ETH_RSS_NONFRAG_IPV6_SCTP | ETH_RSS_L3_DST_ONLY,
@@ -317 +318 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV6_SCTP | RTE_ETH_RSS_L4_SRC_ONLY,
+ 	{ ETH_RSS_NONFRAG_IPV6_SCTP | ETH_RSS_L4_SRC_ONLY,
@@ -322 +323 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV6_SCTP | RTE_ETH_RSS_L4_DST_ONLY,
+ 	{ ETH_RSS_NONFRAG_IPV6_SCTP | ETH_RSS_L4_DST_ONLY,
@@ -327 +328 @@
- 	{ RTE_ETH_RSS_NONFRAG_IPV6_SCTP,
+ 	{ ETH_RSS_NONFRAG_IPV6_SCTP,
@@ -388 +389 @@
-+					RTE_ETH_RSS_NONFRAG_IPV6_SCTP) &&
++					ETH_RSS_NONFRAG_IPV6_SCTP) &&
@@ -475 +476 @@
-index be0141f602..17473e70e2 100644
+index 5af3005653..b724490fe2 100644
@@ -478 +479 @@
-@@ -110,6 +110,7 @@ int hns3_rss_reset_indir_table(struct hns3_hw *hw);
+@@ -114,6 +114,7 @@ int hns3_rss_reset_indir_table(struct hns3_hw *hw);
@@ -483 +484 @@
- int hns3_rss_set_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
+ int hns3_set_rss_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
@@ -485 +486 @@
- int hns3_rss_get_algo_key(struct hns3_hw *hw,  uint8_t *hash_algo,
+ int hns3_restore_filter(struct hns3_adapter *hns);

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/hns3: use hardware config to report redirection table' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (25 preceding siblings ...)
  2023-03-15 22:46     ` patch 'net/hns3: use hardware config to report hash types' " luca.boccassi
@ 2023-03-15 22:46     ` luca.boccassi
  2023-03-15 22:46     ` patch 'net/hns3: separate setting hash algorithm' " luca.boccassi
                       ` (10 subsequent siblings)
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:46 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From f1e6a8d8d020e08f73f9a79d18b500e8c649e1bc Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Fri, 10 Mar 2023 17:35:07 +0800
Subject: [PATCH] net/hns3: use hardware config to report redirection table

[ upstream commit d1e37d1c6916858314a2c67e6317b0bb6c691b36 ]

Currently, reta_query() API reports the redirection table from software.
This patch uses the one in hardware to report.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_cmd.h |  1 +
 drivers/net/hns3/hns3_rss.c | 65 ++++++++++++++++++++++++++++++++++---
 2 files changed, 62 insertions(+), 4 deletions(-)

diff --git a/drivers/net/hns3/hns3_cmd.h b/drivers/net/hns3/hns3_cmd.h
index 02bb6fa3c8..c5e7fc1064 100644
--- a/drivers/net/hns3/hns3_cmd.h
+++ b/drivers/net/hns3/hns3_cmd.h
@@ -579,6 +579,7 @@ struct hns3_rss_input_tuple_cmd {
 #define HNS3_RSS_CFG_TBL_SIZE_H		4
 #define HNS3_RSS_CFG_TBL_BW_H		2
 #define HNS3_RSS_CFG_TBL_BW_L		8
+#define HNS3_RSS_CFG_TBL_BW_H_M		0x3
 
 /* Configure the indirection table, opcode:0x0D07 */
 struct hns3_rss_indirection_table_cmd {
diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
index 7c2b4bcd1f..d36c1776bb 100644
--- a/drivers/net/hns3/hns3_rss.c
+++ b/drivers/net/hns3/hns3_rss.c
@@ -481,6 +481,54 @@ hns3_set_rss_indir_table(struct hns3_hw *hw, uint16_t *indir, uint16_t size)
 	return 0;
 }
 
+static int
+hns3_get_rss_indir_table(struct hns3_hw *hw, uint16_t *indir, uint16_t size)
+{
+	struct hns3_rss_indirection_table_cmd *req;
+	uint16_t max_bd_num, cfg_tbl_size;
+	uint8_t qid_msb_off, qid_msb_idx;
+	struct hns3_cmd_desc desc;
+	uint16_t q_id, q_hi, q_lo;
+	uint8_t rss_result_h;
+	uint16_t i, j;
+	int ret;
+
+	req = (struct hns3_rss_indirection_table_cmd *)desc.data;
+	max_bd_num = DIV_ROUND_UP(size, HNS3_RSS_CFG_TBL_SIZE);
+	for (i = 0; i < max_bd_num; i++) {
+		hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_RSS_INDIR_TABLE,
+					  true);
+		req->start_table_index =
+				rte_cpu_to_le_16(i * HNS3_RSS_CFG_TBL_SIZE);
+		ret = hns3_cmd_send(hw, &desc, 1);
+		if (ret) {
+			hns3_err(hw, "fail to get RSS indirection table from firmware, ret = %d",
+				 ret);
+			return ret;
+		}
+
+		if (i == max_bd_num - 1 && (size % HNS3_RSS_CFG_TBL_SIZE) != 0)
+			cfg_tbl_size = size % HNS3_RSS_CFG_TBL_SIZE;
+		else
+			cfg_tbl_size = HNS3_RSS_CFG_TBL_SIZE;
+
+		for (j = 0; j < cfg_tbl_size; j++) {
+			qid_msb_idx =
+				j * HNS3_RSS_CFG_TBL_BW_H / HNS3_BITS_PER_BYTE;
+			rss_result_h = req->rss_result_h[qid_msb_idx];
+			qid_msb_off =
+				j * HNS3_RSS_CFG_TBL_BW_H % HNS3_BITS_PER_BYTE;
+			q_hi = (rss_result_h >> qid_msb_off) &
+						HNS3_RSS_CFG_TBL_BW_H_M;
+			q_lo = req->rss_result_l[j];
+			q_id = (q_hi << HNS3_RSS_CFG_TBL_BW_L) | q_lo;
+			indir[i * HNS3_RSS_CFG_TBL_SIZE + j] = q_id;
+		}
+	}
+
+	return 0;
+}
+
 int
 hns3_rss_reset_indir_table(struct hns3_hw *hw)
 {
@@ -842,10 +890,11 @@ hns3_dev_rss_reta_query(struct rte_eth_dev *dev,
 			uint16_t reta_size)
 {
 	struct hns3_adapter *hns = dev->data->dev_private;
+	uint16_t reta_table[HNS3_RSS_IND_TBL_SIZE_MAX];
 	struct hns3_hw *hw = &hns->hw;
-	struct hns3_rss_conf *rss_cfg = &hw->rss_info;
 	uint16_t idx, shift;
 	uint16_t i;
+	int ret;
 
 	if (reta_size != hw->rss_ind_tbl_size) {
 		hns3_err(hw, "The size of hash lookup table configured (%u)"
@@ -854,14 +903,22 @@ hns3_dev_rss_reta_query(struct rte_eth_dev *dev,
 		return -EINVAL;
 	}
 	rte_spinlock_lock(&hw->lock);
+	ret = hns3_get_rss_indir_table(hw, reta_table, reta_size);
+	if (ret != 0) {
+		rte_spinlock_unlock(&hw->lock);
+		hns3_err(hw, "query RSS redirection table failed, ret = %d.",
+			 ret);
+		return ret;
+	}
+	rte_spinlock_unlock(&hw->lock);
+
 	for (i = 0; i < reta_size; i++) {
 		idx = i / RTE_RETA_GROUP_SIZE;
 		shift = i % RTE_RETA_GROUP_SIZE;
 		if (reta_conf[idx].mask & (1ULL << shift))
-			reta_conf[idx].reta[shift] =
-						rss_cfg->rss_indirection_tbl[i];
+			reta_conf[idx].reta[shift] = reta_table[i];
 	}
-	rte_spinlock_unlock(&hw->lock);
+
 	return 0;
 }
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:51.241381056 +0000
+++ 0028-net-hns3-use-hardware-config-to-report-redirection-t.patch	2023-03-15 22:44:49.627851183 +0000
@@ -1 +1 @@
-From d1e37d1c6916858314a2c67e6317b0bb6c691b36 Mon Sep 17 00:00:00 2001
+From f1e6a8d8d020e08f73f9a79d18b500e8c649e1bc Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit d1e37d1c6916858314a2c67e6317b0bb6c691b36 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index 994dfc48cc..eb394c9dec 100644
+index 02bb6fa3c8..c5e7fc1064 100644
@@ -23 +24 @@
-@@ -606,6 +606,7 @@ struct hns3_rss_input_tuple_cmd {
+@@ -579,6 +579,7 @@ struct hns3_rss_input_tuple_cmd {
@@ -32 +33 @@
-index 9addc00a67..7dc4e03d83 100644
+index 7c2b4bcd1f..d36c1776bb 100644
@@ -117,2 +118,2 @@
- 		idx = i / RTE_ETH_RETA_GROUP_SIZE;
- 		shift = i % RTE_ETH_RETA_GROUP_SIZE;
+ 		idx = i / RTE_RETA_GROUP_SIZE;
+ 		shift = i % RTE_RETA_GROUP_SIZE;

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/hns3: separate setting hash algorithm' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (26 preceding siblings ...)
  2023-03-15 22:46     ` patch 'net/hns3: use hardware config to report redirection table' " luca.boccassi
@ 2023-03-15 22:46     ` luca.boccassi
  2023-03-15 22:46     ` patch 'net/hns3: separate setting hash key' " luca.boccassi
                       ` (9 subsequent siblings)
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:46 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From cce3f130c3110daa464819213d233b0bd4847a71 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Fri, 10 Mar 2023 17:35:08 +0800
Subject: [PATCH] net/hns3: separate setting hash algorithm

[ upstream commit 1fcbef5ccb993b6028a3f8a68a7b01f9b8c67413 ]

Currently, the setting of hash algorithm comes from the
default configuration in driver and the rte_flow interface.
The hash algorithm that is set to hardware in both ways is
saved in hw->rss_info.conf.func.

But the 'func' in struct rte_flow_action_rss is usually used
in rte flow interface. And the ethdev ops interface may also
set hash algorithm in the future. It is not appropriate and
is a little messy for ethdev ops interface and driver default
configuration to use struct rte_flow_action_rss. So we have
to separate the RSS configuration from ethdev ops and rte
flow interface to make codes more easier to maintain.

This patch separates hash algorithm by following ways:
1) 'hash_algo' in struct hns3_rss_conf is used for ethdev ops
   interface or default configuration in driver.
2) Add a 'rte_flow_hash_algo' field in struct hns3_rss_conf
   to save algorithm from rte flow interface. The main reasons
   are as follows:
   Currently, only the last rule is used to restore the rte
   flow rule. If 'func' in RSS action is 'DEFAULT', it means
   that this rule doesn't modify algorithm and driver need to
   save current algorithm for restoring algorithm during reset
   phase.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_flow.c | 60 +++++++++++++++++++++---------------
 drivers/net/hns3/hns3_rss.c  | 14 +--------
 drivers/net/hns3/hns3_rss.h  |  1 +
 3 files changed, 37 insertions(+), 38 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 400054a9a2..cddf4e540c 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1406,30 +1406,40 @@ hns3_disable_rss(struct hns3_hw *hw)
 }
 
 static int
-hns3_parse_rss_algorithm(struct hns3_hw *hw, enum rte_eth_hash_function *func,
+hns3_parse_rss_algorithm(struct hns3_hw *hw, enum rte_eth_hash_function func,
 			 uint8_t *hash_algo)
 {
-	enum rte_eth_hash_function algo_func = *func;
-	switch (algo_func) {
-	case RTE_ETH_HASH_FUNCTION_DEFAULT:
-		/* Keep *hash_algo as what it used to be */
-		algo_func = hw->rss_info.conf.func;
-		break;
-	case RTE_ETH_HASH_FUNCTION_TOEPLITZ:
-		*hash_algo = HNS3_RSS_HASH_ALGO_TOEPLITZ;
-		break;
-	case RTE_ETH_HASH_FUNCTION_SIMPLE_XOR:
-		*hash_algo = HNS3_RSS_HASH_ALGO_SIMPLE;
-		break;
-	case RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ:
-		*hash_algo = HNS3_RSS_HASH_ALGO_SYMMETRIC_TOEP;
-		break;
-	default:
-		hns3_err(hw, "Invalid RSS algorithm configuration(%d)",
-			 algo_func);
-		return -EINVAL;
+	const uint8_t hash_func_map[] = {
+		[RTE_ETH_HASH_FUNCTION_DEFAULT] = HNS3_RSS_HASH_ALGO_TOEPLITZ,
+		[RTE_ETH_HASH_FUNCTION_TOEPLITZ] = HNS3_RSS_HASH_ALGO_TOEPLITZ,
+		[RTE_ETH_HASH_FUNCTION_SIMPLE_XOR] = HNS3_RSS_HASH_ALGO_SIMPLE,
+		[RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ] = HNS3_RSS_HASH_ALGO_SYMMETRIC_TOEP,
+	};
+	uint8_t key[HNS3_RSS_KEY_SIZE_MAX] = {0};
+	int ret;
+
+	if (func == RTE_ETH_HASH_FUNCTION_DEFAULT) {
+		ret = hns3_rss_get_algo_key(hw, hash_algo, key,
+					    hw->rss_key_size);
+		if (ret != 0) {
+			hns3_err(hw, "fail to get current RSS hash algorithm, ret = %d",
+				 ret);
+			return ret;
+		}
+
+		/*
+		 * During the phase of reset recovery, the hash algorithm
+		 * obtained from hardware may not be the one used(saved in
+		 * rte_flow_hash_algo) when this rule is delivered.
+		 */
+		if (__atomic_load_n((uint16_t *)&hw->reset.resetting, __ATOMIC_RELAXED) &&
+		    *hash_algo != hw->rss_info.rte_flow_hash_algo)
+			*hash_algo = hw->rss_info.rte_flow_hash_algo;
+
+		return 0;
 	}
-	*func = algo_func;
+
+	*hash_algo = hash_func_map[func];
 
 	return 0;
 }
@@ -1439,6 +1449,7 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
 {
 	uint8_t rss_key[HNS3_RSS_KEY_SIZE_MAX] = {0};
 	bool use_default_key = false;
+	uint8_t hash_algo;
 	int ret;
 
 	if (rss_config->key == NULL || rss_config->key_len != hw->rss_key_size) {
@@ -1448,18 +1459,17 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
 		use_default_key = true;
 	}
 
-	ret = hns3_parse_rss_algorithm(hw, &rss_config->func,
-				       &hw->rss_info.hash_algo);
+	ret = hns3_parse_rss_algorithm(hw, rss_config->func, &hash_algo);
 	if (ret)
 		return ret;
 
-	ret = hns3_set_rss_algo_key(hw, hw->rss_info.hash_algo,
+	ret = hns3_set_rss_algo_key(hw, hash_algo,
 				    use_default_key ? rss_key : rss_config->key,
 				    hw->rss_key_size);
 	if (ret)
 		return ret;
 
-	hw->rss_info.conf.func = rss_config->func;
+	hw->rss_info.rte_flow_hash_algo = hash_algo;
 
 	ret = hns3_set_rss_tuple_by_rss_hf(hw, rss_config->types);
 	if (ret)
diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
index d36c1776bb..4b5d6f6e2b 100644
--- a/drivers/net/hns3/hns3_rss.c
+++ b/drivers/net/hns3/hns3_rss.c
@@ -1027,7 +1027,7 @@ hns3_set_default_rss_args(struct hns3_hw *hw)
 	int i;
 
 	/* Default hash algorithm */
-	rss_cfg->conf.func = RTE_ETH_HASH_FUNCTION_TOEPLITZ;
+	rss_cfg->hash_algo = HNS3_RSS_HASH_ALGO_TOEPLITZ;
 
 	memcpy(rss_cfg->key, hns3_hash_key,
 		RTE_MIN(sizeof(hns3_hash_key), hw->rss_key_size));
@@ -1051,18 +1051,6 @@ hns3_config_rss(struct hns3_adapter *hns)
 
 	enum rte_eth_rx_mq_mode mq_mode = hw->data->dev_conf.rxmode.mq_mode;
 
-	switch (hw->rss_info.conf.func) {
-	case RTE_ETH_HASH_FUNCTION_SIMPLE_XOR:
-		hw->rss_info.hash_algo = HNS3_RSS_HASH_ALGO_SIMPLE;
-		break;
-	case RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ:
-		hw->rss_info.hash_algo = HNS3_RSS_HASH_ALGO_SYMMETRIC_TOEP;
-		break;
-	default:
-		hw->rss_info.hash_algo = HNS3_RSS_HASH_ALGO_TOEPLITZ;
-		break;
-	}
-
 	ret = hns3_set_rss_algo_key(hw, rss_cfg->hash_algo,
 				    hash_key, hw->rss_key_size);
 	if (ret)
diff --git a/drivers/net/hns3/hns3_rss.h b/drivers/net/hns3/hns3_rss.h
index b724490fe2..eee5c98278 100644
--- a/drivers/net/hns3/hns3_rss.h
+++ b/drivers/net/hns3/hns3_rss.h
@@ -46,6 +46,7 @@ struct hns3_rss_conf {
 	/* RSS parameters :algorithm, flow_types,  key, queue */
 	struct rte_flow_action_rss conf;
 	uint8_t hash_algo; /* hash function type defined by hardware */
+	uint8_t rte_flow_hash_algo;
 	uint8_t key[HNS3_RSS_KEY_SIZE_MAX];  /* Hash key */
 	uint16_t rss_indirection_tbl[HNS3_RSS_IND_TBL_SIZE_MAX];
 	uint16_t queue[HNS3_RSS_QUEUES_BUFFER_NUM]; /* Queues indices to use */
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:51.297852136 +0000
+++ 0029-net-hns3-separate-setting-hash-algorithm.patch	2023-03-15 22:44:49.635851351 +0000
@@ -1 +1 @@
-From 1fcbef5ccb993b6028a3f8a68a7b01f9b8c67413 Mon Sep 17 00:00:00 2001
+From cce3f130c3110daa464819213d233b0bd4847a71 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 1fcbef5ccb993b6028a3f8a68a7b01f9b8c67413 ]
+
@@ -32 +33,0 @@
-Cc: stable@dpdk.org
@@ -43 +44 @@
-index 881d70613c..2faeb9ca52 100644
+index 400054a9a2..cddf4e540c 100644
@@ -46 +47 @@
-@@ -1438,30 +1438,40 @@ hns3_disable_rss(struct hns3_hw *hw)
+@@ -1406,30 +1406,40 @@ hns3_disable_rss(struct hns3_hw *hw)
@@ -96 +97 @@
-+		if (__atomic_load_n(&hw->reset.resetting, __ATOMIC_RELAXED) &&
++		if (__atomic_load_n((uint16_t *)&hw->reset.resetting, __ATOMIC_RELAXED) &&
@@ -108 +109 @@
-@@ -1471,6 +1481,7 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
+@@ -1439,6 +1449,7 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
@@ -116 +117 @@
-@@ -1480,18 +1491,17 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
+@@ -1448,18 +1459,17 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
@@ -126,2 +127,2 @@
--	ret = hns3_rss_set_algo_key(hw, hw->rss_info.hash_algo,
-+	ret = hns3_rss_set_algo_key(hw, hash_algo,
+-	ret = hns3_set_rss_algo_key(hw, hw->rss_info.hash_algo,
++	ret = hns3_set_rss_algo_key(hw, hash_algo,
@@ -139 +140 @@
-index 7dc4e03d83..dcd42b554a 100644
+index d36c1776bb..4b5d6f6e2b 100644
@@ -142,2 +143,2 @@
-@@ -1022,7 +1022,7 @@ hns3_rss_set_default_args(struct hns3_hw *hw)
- 	uint16_t i;
+@@ -1027,7 +1027,7 @@ hns3_set_default_rss_args(struct hns3_hw *hw)
+ 	int i;
@@ -151 +152 @@
-@@ -1046,18 +1046,6 @@ hns3_config_rss(struct hns3_adapter *hns)
+@@ -1051,18 +1051,6 @@ hns3_config_rss(struct hns3_adapter *hns)
@@ -167 +168 @@
- 	ret = hns3_rss_set_algo_key(hw, rss_cfg->hash_algo,
+ 	ret = hns3_set_rss_algo_key(hw, rss_cfg->hash_algo,
@@ -171 +172 @@
-index 17473e70e2..6e679b709b 100644
+index b724490fe2..eee5c98278 100644
@@ -174 +175 @@
-@@ -42,6 +42,7 @@ struct hns3_rss_conf {
+@@ -46,6 +46,7 @@ struct hns3_rss_conf {

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/hns3: separate setting hash key' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (27 preceding siblings ...)
  2023-03-15 22:46     ` patch 'net/hns3: separate setting hash algorithm' " luca.boccassi
@ 2023-03-15 22:46     ` luca.boccassi
  2023-03-15 22:46     ` patch 'net/hns3: separate setting redirection table' " luca.boccassi
                       ` (8 subsequent siblings)
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:46 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/9e3cfd993627eb4d4c1292df7bf74ae9b8912dc0

Thanks.

Luca Boccassi

---
From 9e3cfd993627eb4d4c1292df7bf74ae9b8912dc0 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Fri, 10 Mar 2023 17:35:09 +0800
Subject: [PATCH] net/hns3: separate setting hash key

[ upstream commit fe9cc8b88babd0911d91dc194b35c7c352e2bf7b ]

The settings of hash key comes from the ethdev ops (like, dev_configure
and rss_hash_update) and rte_flow API. For the ethdev ops, driver has
to save it to rss_info::key in hns3_hw structure so as to it can be
restored when reset is triggered. While rte_flow API no need to use
this field to save, they has a global flow_rss_list to maintain all
rules which save hash key. And hash key can be restored by this rule
information during the reset phase.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_rss.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
index 4b5d6f6e2b..a67795b6ad 100644
--- a/drivers/net/hns3/hns3_rss.c
+++ b/drivers/net/hns3/hns3_rss.c
@@ -376,8 +376,7 @@ hns3_set_rss_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
 			return ret;
 		}
 	}
-	/* Update the shadow RSS key with user specified */
-	memcpy(hw->rss_info.key, key, hw->rss_key_size);
+
 	return 0;
 }
 
@@ -672,6 +671,8 @@ hns3_dev_rss_hash_update(struct rte_eth_dev *dev,
 					    key, hw->rss_key_size);
 		if (ret)
 			goto set_algo_key_fail;
+		/* Update the shadow RSS key with user specified */
+		memcpy(hw->rss_info.key, key, hw->rss_key_size);
 	}
 	rte_spinlock_unlock(&hw->lock);
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:51.350181617 +0000
+++ 0030-net-hns3-separate-setting-hash-key.patch	2023-03-15 22:44:49.635851351 +0000
@@ -1 +1 @@
-From fe9cc8b88babd0911d91dc194b35c7c352e2bf7b Mon Sep 17 00:00:00 2001
+From 9e3cfd993627eb4d4c1292df7bf74ae9b8912dc0 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit fe9cc8b88babd0911d91dc194b35c7c352e2bf7b ]
+
@@ -14,2 +15,0 @@
-Cc: stable@dpdk.org
-
@@ -23 +23 @@
-index dcd42b554a..401e3adfdf 100644
+index 4b5d6f6e2b..a67795b6ad 100644
@@ -26 +26 @@
-@@ -376,8 +376,7 @@ hns3_rss_set_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
+@@ -376,8 +376,7 @@ hns3_set_rss_algo_key(struct hns3_hw *hw, uint8_t hash_algo,

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/hns3: separate setting redirection table' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (28 preceding siblings ...)
  2023-03-15 22:46     ` patch 'net/hns3: separate setting hash key' " luca.boccassi
@ 2023-03-15 22:46     ` luca.boccassi
  2023-03-15 22:46     ` patch 'net/hns3: separate setting RSS types' " luca.boccassi
                       ` (7 subsequent siblings)
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:46 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From ff26a8777d14a2f99aa30f9f2b5ed961e9e0244a Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Fri, 10 Mar 2023 17:35:10 +0800
Subject: [PATCH] net/hns3: separate setting redirection table

[ upstream commit a421cb93462932717f23c5d8342381726e547ba6 ]

The settings of redirection table comes from the ethdev ops (like,
dev_configure and rss_hash_update) and rte_flow API. For the ethdev
ops, driver has to save it to rss_info::rss_indirection_tbl in hns3_hw
structure so as to it can be restored when reset is triggered.
While rte_flow API no need to use this field to save, they has a global
RSS flow list to maintain all rules which can be used to restore the
table during the reset phase.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_flow.c |  2 --
 drivers/net/hns3/hns3_rss.c  | 21 +++++++++++++--------
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index cddf4e540c..3aaebd3515 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1487,8 +1487,6 @@ hns3_update_indir_table(struct hns3_hw *hw,
 	uint32_t i;
 
 	/* Fill in redirection table */
-	memcpy(indir_tbl, hw->rss_info.rss_indirection_tbl,
-	       sizeof(hw->rss_info.rss_indirection_tbl));
 	for (i = 0, j = 0; i < hw->rss_ind_tbl_size; i++, j++) {
 		j %= num;
 		if (conf->queue[j] >= hw->alloc_rss_size) {
diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
index a67795b6ad..7f4655333b 100644
--- a/drivers/net/hns3/hns3_rss.c
+++ b/drivers/net/hns3/hns3_rss.c
@@ -473,10 +473,6 @@ hns3_set_rss_indir_table(struct hns3_hw *hw, uint16_t *indir, uint16_t size)
 		}
 	}
 
-	/* Update redirection table of hw */
-	memcpy(hw->rss_info.rss_indirection_tbl, indir,
-	       sizeof(uint16_t) * size);
-
 	return 0;
 }
 
@@ -542,8 +538,11 @@ hns3_rss_reset_indir_table(struct hns3_hw *hw)
 	}
 
 	ret = hns3_set_rss_indir_table(hw, lut, hw->rss_ind_tbl_size);
-	if (ret)
-		hns3_err(hw, "RSS uninit indir table failed: %d", ret);
+	if (ret != 0)
+		hns3_err(hw, "RSS uninit indir table failed, ret = %d.", ret);
+	else
+		memcpy(hw->rss_info.rss_indirection_tbl, lut,
+		       sizeof(uint16_t) * hw->rss_ind_tbl_size);
 	rte_free(lut);
 
 	return ret;
@@ -855,12 +854,12 @@ hns3_dev_rss_reta_update(struct rte_eth_dev *dev,
 		idx = i / RTE_RETA_GROUP_SIZE;
 		shift = i % RTE_RETA_GROUP_SIZE;
 		if (reta_conf[idx].reta[shift] >= hw->alloc_rss_size) {
-			rte_spinlock_unlock(&hw->lock);
 			hns3_err(hw, "queue id(%u) set to redirection table "
 				 "exceeds queue number(%u) allocated to a TC",
 				 reta_conf[idx].reta[shift],
 				 hw->alloc_rss_size);
-			return -EINVAL;
+			ret = -EINVAL;
+			goto out;
 		}
 
 		if (reta_conf[idx].mask & (1ULL << shift))
@@ -869,7 +868,13 @@ hns3_dev_rss_reta_update(struct rte_eth_dev *dev,
 
 	ret = hns3_set_rss_indir_table(hw, indirection_tbl,
 				       hw->rss_ind_tbl_size);
+	if (ret != 0)
+		goto out;
 
+	memcpy(rss_cfg->rss_indirection_tbl, indirection_tbl,
+	       sizeof(uint16_t) * hw->rss_ind_tbl_size);
+
+out:
 	rte_spinlock_unlock(&hw->lock);
 	return ret;
 }
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:51.407893211 +0000
+++ 0031-net-hns3-separate-setting-redirection-table.patch	2023-03-15 22:44:49.643851519 +0000
@@ -1 +1 @@
-From a421cb93462932717f23c5d8342381726e547ba6 Mon Sep 17 00:00:00 2001
+From ff26a8777d14a2f99aa30f9f2b5ed961e9e0244a Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a421cb93462932717f23c5d8342381726e547ba6 ]
+
@@ -14,2 +15,0 @@
-Cc: stable@dpdk.org
-
@@ -24 +24 @@
-index 2faeb9ca52..d5db09a263 100644
+index cddf4e540c..3aaebd3515 100644
@@ -27 +27 @@
-@@ -1519,8 +1519,6 @@ hns3_update_indir_table(struct hns3_hw *hw,
+@@ -1487,8 +1487,6 @@ hns3_update_indir_table(struct hns3_hw *hw,
@@ -37 +37 @@
-index 401e3adfdf..751033d98f 100644
+index a67795b6ad..7f4655333b 100644
@@ -66,2 +66,2 @@
- 		idx = i / RTE_ETH_RETA_GROUP_SIZE;
- 		shift = i % RTE_ETH_RETA_GROUP_SIZE;
+ 		idx = i / RTE_RETA_GROUP_SIZE;
+ 		shift = i % RTE_RETA_GROUP_SIZE;

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/hns3: separate setting RSS types' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (29 preceding siblings ...)
  2023-03-15 22:46     ` patch 'net/hns3: separate setting redirection table' " luca.boccassi
@ 2023-03-15 22:46     ` luca.boccassi
  2023-03-15 22:46     ` patch 'net/hns3: separate setting and clearing RSS rule' " luca.boccassi
                       ` (6 subsequent siblings)
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:46 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/7b870ee8535e5dae64601cc4b4a61e6da00200a0

Thanks.

Luca Boccassi

---
From 7b870ee8535e5dae64601cc4b4a61e6da00200a0 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Fri, 10 Mar 2023 17:35:11 +0800
Subject: [PATCH] net/hns3: separate setting RSS types

[ upstream commit 791e56935e488b8154a83daaf3952e1901ed7552 ]

The settings of RSS types comes from the ethdev ops (like, dev_configure
and rss_hash_update) and rte_flow API. For the ethdev ops, driver has to
save it so as to it can be restored when reset is triggered.
While rte_flow API no need to maintain this field, it can be restored by
the saved rule.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_flow.c |  3 ++-
 drivers/net/hns3/hns3_rss.c  | 22 ++++++++++++++--------
 drivers/net/hns3/hns3_rss.h  |  1 +
 3 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 3aaebd3515..f537526704 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1401,6 +1401,7 @@ hns3_disable_rss(struct hns3_hw *hw)
 	ret = hns3_set_rss_tuple_by_rss_hf(hw, 0);
 	if (ret)
 		return ret;
+	hw->rss_info.rss_hf = 0;
 
 	return 0;
 }
@@ -1548,7 +1549,7 @@ hns3_config_rss_filter(struct hns3_hw *hw,
 	/* Filter the unsupported flow types */
 	flow_types = conf->conf.types ?
 		     rss_flow_conf.types & HNS3_ETH_RSS_SUPPORT :
-		     hw->rss_info.conf.types;
+		     hw->rss_info.rss_hf;
 	if (flow_types != rss_flow_conf.types)
 		hns3_warn(hw, "modified RSS types based on hardware support,"
 			  " requested:0x%" PRIx64 " configured:0x%" PRIx64,
diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
index 7f4655333b..12a2f0e6f6 100644
--- a/drivers/net/hns3/hns3_rss.c
+++ b/drivers/net/hns3/hns3_rss.c
@@ -628,9 +628,6 @@ hns3_set_rss_tuple_by_rss_hf(struct hns3_hw *hw, uint64_t rss_hf)
 		return ret;
 	}
 
-	/* Update supported flow types when set tuple success */
-	hw->rss_info.conf.types = rss_hf;
-
 	return 0;
 }
 
@@ -648,7 +645,7 @@ hns3_dev_rss_hash_update(struct rte_eth_dev *dev,
 			 struct rte_eth_rss_conf *rss_conf)
 {
 	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	uint64_t rss_hf_bk = hw->rss_info.conf.types;
+	uint64_t rss_hf_bk = hw->rss_info.rss_hf;
 	uint8_t key_len = rss_conf->rss_key_len;
 	uint64_t rss_hf = rss_conf->rss_hf;
 	uint8_t *key = rss_conf->rss_key;
@@ -673,6 +670,7 @@ hns3_dev_rss_hash_update(struct rte_eth_dev *dev,
 		/* Update the shadow RSS key with user specified */
 		memcpy(hw->rss_info.key, key, hw->rss_key_size);
 	}
+	hw->rss_info.rss_hf = rss_hf;
 	rte_spinlock_unlock(&hw->lock);
 
 	return 0;
@@ -1035,6 +1033,7 @@ hns3_set_default_rss_args(struct hns3_hw *hw)
 	/* Default hash algorithm */
 	rss_cfg->hash_algo = HNS3_RSS_HASH_ALGO_TOEPLITZ;
 
+	hw->rss_info.rss_hf = 0;
 	memcpy(rss_cfg->key, hns3_hash_key,
 		RTE_MIN(sizeof(hns3_hash_key), hw->rss_key_size));
 
@@ -1072,15 +1071,22 @@ hns3_config_rss(struct hns3_adapter *hns)
 		return ret;
 
 	/*
-	 * When muli-queue RSS mode flag is not set or unsupported tuples are
+	 * When multi-queue RSS mode flag is not set or unsupported tuples are
 	 * set, disable all tuples.
 	 */
-	rss_hf = hw->rss_info.conf.types;
+	rss_hf = hw->rss_info.rss_hf;
 	if (!((uint32_t)mq_mode & ETH_MQ_RX_RSS_FLAG) ||
 	    !(rss_hf & HNS3_ETH_RSS_SUPPORT))
 		rss_hf = 0;
 
-	return hns3_set_rss_tuple_by_rss_hf(hw, rss_hf);
+	ret = hns3_set_rss_tuple_by_rss_hf(hw, rss_hf);
+	if (ret != 0) {
+		hns3_err(hw, "set RSS tuples failed, ret = %d.", ret);
+		return ret;
+	}
+	hw->rss_info.rss_hf = rss_hf;
+
+	return 0;
 }
 
 /*
@@ -1098,5 +1104,5 @@ hns3_rss_uninit(struct hns3_adapter *hns)
 		return;
 
 	/* Disable RSS */
-	hw->rss_info.conf.types = 0;
+	hw->rss_info.rss_hf = 0;
 }
diff --git a/drivers/net/hns3/hns3_rss.h b/drivers/net/hns3/hns3_rss.h
index eee5c98278..ffd76647c9 100644
--- a/drivers/net/hns3/hns3_rss.h
+++ b/drivers/net/hns3/hns3_rss.h
@@ -45,6 +45,7 @@ struct hns3_rss_tuple_cfg {
 struct hns3_rss_conf {
 	/* RSS parameters :algorithm, flow_types,  key, queue */
 	struct rte_flow_action_rss conf;
+	uint64_t rss_hf;
 	uint8_t hash_algo; /* hash function type defined by hardware */
 	uint8_t rte_flow_hash_algo;
 	uint8_t key[HNS3_RSS_KEY_SIZE_MAX];  /* Hash key */
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:51.459998963 +0000
+++ 0032-net-hns3-separate-setting-RSS-types.patch	2023-03-15 22:44:49.647851603 +0000
@@ -1 +1 @@
-From 791e56935e488b8154a83daaf3952e1901ed7552 Mon Sep 17 00:00:00 2001
+From 7b870ee8535e5dae64601cc4b4a61e6da00200a0 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 791e56935e488b8154a83daaf3952e1901ed7552 ]
+
@@ -12,2 +13,0 @@
-Cc: stable@dpdk.org
-
@@ -23 +23 @@
-index d5db09a263..21e00e515e 100644
+index 3aaebd3515..f537526704 100644
@@ -26 +26 @@
-@@ -1433,6 +1433,7 @@ hns3_disable_rss(struct hns3_hw *hw)
+@@ -1401,6 +1401,7 @@ hns3_disable_rss(struct hns3_hw *hw)
@@ -34 +34 @@
-@@ -1580,7 +1581,7 @@ hns3_config_rss_filter(struct hns3_hw *hw,
+@@ -1548,7 +1549,7 @@ hns3_config_rss_filter(struct hns3_hw *hw,
@@ -44 +44 @@
-index 751033d98f..f51d70a8e5 100644
+index 7f4655333b..12a2f0e6f6 100644
@@ -74 +74 @@
-@@ -1030,6 +1028,7 @@ hns3_rss_set_default_args(struct hns3_hw *hw)
+@@ -1035,6 +1033,7 @@ hns3_set_default_rss_args(struct hns3_hw *hw)
@@ -82 +82 @@
-@@ -1067,15 +1066,22 @@ hns3_config_rss(struct hns3_adapter *hns)
+@@ -1072,15 +1071,22 @@ hns3_config_rss(struct hns3_adapter *hns)
@@ -92 +92 @@
- 	if (!((uint32_t)mq_mode & RTE_ETH_MQ_RX_RSS_FLAG) ||
+ 	if (!((uint32_t)mq_mode & ETH_MQ_RX_RSS_FLAG) ||
@@ -108 +108 @@
-@@ -1093,5 +1099,5 @@ hns3_rss_uninit(struct hns3_adapter *hns)
+@@ -1098,5 +1104,5 @@ hns3_rss_uninit(struct hns3_adapter *hns)
@@ -116 +116 @@
-index 6e679b709b..21b90789d0 100644
+index eee5c98278..ffd76647c9 100644
@@ -119 +119 @@
-@@ -41,6 +41,7 @@
+@@ -45,6 +45,7 @@ struct hns3_rss_tuple_cfg {

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/hns3: separate setting and clearing RSS rule' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (30 preceding siblings ...)
  2023-03-15 22:46     ` patch 'net/hns3: separate setting RSS types' " luca.boccassi
@ 2023-03-15 22:46     ` luca.boccassi
  2023-03-15 22:46     ` patch 'net/hns3: use new RSS rule to configure hardware' " luca.boccassi
                       ` (5 subsequent siblings)
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:46 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/093e74c9a8f9f809a766c42ab547daeb2e41c7ca

Thanks.

Luca Boccassi

---
From 093e74c9a8f9f809a766c42ab547daeb2e41c7ca Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Fri, 10 Mar 2023 17:35:12 +0800
Subject: [PATCH] net/hns3: separate setting and clearing RSS rule

[ upstream commit 1c3aeb2be4b8ef8b18846883ebbb9320f62cf097 ]

Separate the setting and clearing of RSS rule.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_flow.c | 46 +++++++++++++++++-------------------
 1 file changed, 22 insertions(+), 24 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index f537526704..5f9e63f8dd 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1503,8 +1503,22 @@ hns3_update_indir_table(struct hns3_hw *hw,
 }
 
 static int
-hns3_config_rss_filter(struct hns3_hw *hw,
-		       const struct hns3_rss_conf *conf, bool add)
+hns3_reset_rss_filter(struct hns3_hw *hw, const struct hns3_rss_conf *conf)
+{
+	int ret;
+
+	if (!conf->valid)
+		return 0;
+
+	ret = hns3_disable_rss(hw);
+	if (ret)
+		hns3_err(hw, "RSS disable failed(%d)", ret);
+
+	return ret;
+}
+
+static int
+hns3_config_rss_filter(struct hns3_hw *hw, const struct hns3_rss_conf *conf)
 {
 	uint64_t flow_types;
 	uint16_t num;
@@ -1521,19 +1535,6 @@ hns3_config_rss_filter(struct hns3_hw *hw,
 		.queue = conf->conf.queue,
 	};
 
-	if (!add) {
-		if (!conf->valid)
-			return 0;
-
-		ret = hns3_disable_rss(hw);
-		if (ret) {
-			hns3_err(hw, "RSS disable failed(%d)", ret);
-			return ret;
-		}
-
-		return 0;
-	}
-
 	/* Set rx queues to use */
 	num = RTE_MIN(hw->data->nb_rx_queues, rss_flow_conf.queue_num);
 	if (rss_flow_conf.queue_num > num)
@@ -1574,8 +1575,7 @@ hns3_clear_rss_filter(struct rte_eth_dev *dev)
 	rss_filter_ptr = TAILQ_FIRST(&hw->flow_rss_list);
 	while (rss_filter_ptr) {
 		TAILQ_REMOVE(&hw->flow_rss_list, rss_filter_ptr, entries);
-		ret = hns3_config_rss_filter(hw, &rss_filter_ptr->filter_info,
-					     false);
+		ret = hns3_reset_rss_filter(hw, &rss_filter_ptr->filter_info);
 		if (ret)
 			rss_rule_fail_cnt++;
 		else
@@ -1605,7 +1605,7 @@ hns3_restore_rss_filter(struct hns3_hw *hw)
 		if (!filter->filter_info.valid)
 			continue;
 
-		ret = hns3_config_rss_filter(hw, &filter->filter_info, true);
+		ret = hns3_config_rss_filter(hw, &filter->filter_info);
 		if (ret != 0) {
 			hns3_err(hw, "restore RSS filter failed, ret=%d", ret);
 			goto out;
@@ -1649,8 +1649,7 @@ hns3_rss_action_is_dup(struct hns3_hw *hw,
 }
 
 static int
-hns3_flow_parse_rss(struct rte_eth_dev *dev,
-		    const struct hns3_rss_conf *conf, bool add)
+hns3_flow_parse_rss(struct rte_eth_dev *dev, const struct hns3_rss_conf *conf)
 {
 	struct hns3_adapter *hns = dev->data->dev_private;
 	struct hns3_hw *hw = &hns->hw;
@@ -1660,7 +1659,7 @@ hns3_flow_parse_rss(struct rte_eth_dev *dev,
 		return -EINVAL;
 	}
 
-	return hns3_config_rss_filter(hw, conf, add);
+	return hns3_config_rss_filter(hw, conf);
 }
 
 static int
@@ -1747,7 +1746,7 @@ hns3_flow_create_rss_rule(struct rte_eth_dev *dev,
 		}
 	}
 
-	ret = hns3_flow_parse_rss(dev, new_conf, true);
+	ret = hns3_flow_parse_rss(dev, new_conf);
 	if (ret != 0) {
 		rte_free(rss_filter_ptr);
 		return ret;
@@ -1927,8 +1926,7 @@ hns3_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow,
 		break;
 	case RTE_ETH_FILTER_HASH:
 		rss_filter_ptr = (struct hns3_rss_conf_ele *)flow->rule;
-		ret = hns3_config_rss_filter(hw, &rss_filter_ptr->filter_info,
-					     false);
+		ret = hns3_reset_rss_filter(hw, &rss_filter_ptr->filter_info);
 		if (ret)
 			return rte_flow_error_set(error, EIO,
 						  RTE_FLOW_ERROR_TYPE_HANDLE,
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:51.523374909 +0000
+++ 0033-net-hns3-separate-setting-and-clearing-RSS-rule.patch	2023-03-15 22:44:49.651851686 +0000
@@ -1 +1 @@
-From 1c3aeb2be4b8ef8b18846883ebbb9320f62cf097 Mon Sep 17 00:00:00 2001
+From 093e74c9a8f9f809a766c42ab547daeb2e41c7ca Mon Sep 17 00:00:00 2001
@@ -6 +6 @@
-Separate the setting and clearing of RSS rule.
+[ upstream commit 1c3aeb2be4b8ef8b18846883ebbb9320f62cf097 ]
@@ -8 +8 @@
-Cc: stable@dpdk.org
+Separate the setting and clearing of RSS rule.
@@ -17 +17 @@
-index 21e00e515e..4da98d7adc 100644
+index f537526704..5f9e63f8dd 100644
@@ -20 +20 @@
-@@ -1535,8 +1535,22 @@ hns3_update_indir_table(struct hns3_hw *hw,
+@@ -1503,8 +1503,22 @@ hns3_update_indir_table(struct hns3_hw *hw,
@@ -45 +45 @@
-@@ -1553,19 +1567,6 @@ hns3_config_rss_filter(struct hns3_hw *hw,
+@@ -1521,19 +1535,6 @@ hns3_config_rss_filter(struct hns3_hw *hw,
@@ -65 +65 @@
-@@ -1606,8 +1607,7 @@ hns3_clear_rss_filter(struct rte_eth_dev *dev)
+@@ -1574,8 +1575,7 @@ hns3_clear_rss_filter(struct rte_eth_dev *dev)
@@ -75 +75 @@
-@@ -1636,7 +1636,7 @@ hns3_restore_rss_filter(struct hns3_hw *hw)
+@@ -1605,7 +1605,7 @@ hns3_restore_rss_filter(struct hns3_hw *hw)
@@ -84 +84 @@
-@@ -1680,8 +1680,7 @@ hns3_rss_action_is_dup(struct hns3_hw *hw,
+@@ -1649,8 +1649,7 @@ hns3_rss_action_is_dup(struct hns3_hw *hw,
@@ -94 +94 @@
-@@ -1691,7 +1690,7 @@ hns3_flow_parse_rss(struct rte_eth_dev *dev,
+@@ -1660,7 +1659,7 @@ hns3_flow_parse_rss(struct rte_eth_dev *dev,
@@ -103 +103 @@
-@@ -1778,7 +1777,7 @@ hns3_flow_create_rss_rule(struct rte_eth_dev *dev,
+@@ -1747,7 +1746,7 @@ hns3_flow_create_rss_rule(struct rte_eth_dev *dev,
@@ -112 +112 @@
-@@ -1961,8 +1960,7 @@ hns3_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow,
+@@ -1927,8 +1926,7 @@ hns3_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow,

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/hns3: use new RSS rule to configure hardware' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (31 preceding siblings ...)
  2023-03-15 22:46     ` patch 'net/hns3: separate setting and clearing RSS rule' " luca.boccassi
@ 2023-03-15 22:46     ` luca.boccassi
  2023-03-15 22:46     ` patch 'net/hns3: save hash algo to RSS filter list node' " luca.boccassi
                       ` (4 subsequent siblings)
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:46 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/0b181e7369fa0850b223e875968b79d1e94d31ce

Thanks.

Luca Boccassi

---
From 0b181e7369fa0850b223e875968b79d1e94d31ce Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Fri, 10 Mar 2023 17:35:13 +0800
Subject: [PATCH] net/hns3: use new RSS rule to configure hardware

[ upstream commit 218a119a08e01f203f92b46334b6b2f03ff9765d ]

Remove redundant assignment and directly use new RSS rule to configure
hardware. Additionally, considering that the new rule configuration may
need to be modified, the 'const' of input parameter about it is removed.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_flow.c | 52 ++++++++++++++----------------------
 1 file changed, 20 insertions(+), 32 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 5f9e63f8dd..15f3172cbb 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1450,6 +1450,7 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
 {
 	uint8_t rss_key[HNS3_RSS_KEY_SIZE_MAX] = {0};
 	bool use_default_key = false;
+	uint64_t flow_types;
 	uint8_t hash_algo;
 	int ret;
 
@@ -1469,10 +1470,18 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
 				    hw->rss_key_size);
 	if (ret)
 		return ret;
-
 	hw->rss_info.rte_flow_hash_algo = hash_algo;
 
-	ret = hns3_set_rss_tuple_by_rss_hf(hw, rss_config->types);
+	/* Filter the unsupported flow types */
+	flow_types = rss_config->types ?
+		     rss_config->types & HNS3_ETH_RSS_SUPPORT :
+		     hw->rss_info.rss_hf;
+	if (flow_types != rss_config->types)
+		hns3_warn(hw, "modified RSS types based on hardware support,"
+			  " requested:0x%" PRIx64 " configured:0x%" PRIx64,
+			  rss_config->types, flow_types);
+
+	ret = hns3_set_rss_tuple_by_rss_hf(hw, flow_types);
 	if (ret)
 		hns3_err(hw, "Update RSS tuples by rss hf failed %d", ret);
 
@@ -1518,48 +1527,27 @@ hns3_reset_rss_filter(struct hns3_hw *hw, const struct hns3_rss_conf *conf)
 }
 
 static int
-hns3_config_rss_filter(struct hns3_hw *hw, const struct hns3_rss_conf *conf)
+hns3_config_rss_filter(struct hns3_hw *hw, struct hns3_rss_conf *conf)
 {
-	uint64_t flow_types;
+	struct rte_flow_action_rss *rss_act;
 	uint16_t num;
 	int ret;
 
-	struct rte_flow_action_rss rss_flow_conf = {
-		.func = conf->conf.func,
-		.level = conf->conf.level,
-		.types = conf->conf.types,
-		.key_len = conf->conf.key_len,
-		.queue_num = conf->conf.queue_num,
-		.key = conf->conf.key_len ?
-		    (void *)(uintptr_t)conf->conf.key : NULL,
-		.queue = conf->conf.queue,
-	};
-
+	rss_act = &conf->conf;
 	/* Set rx queues to use */
-	num = RTE_MIN(hw->data->nb_rx_queues, rss_flow_conf.queue_num);
-	if (rss_flow_conf.queue_num > num)
+	num = RTE_MIN(hw->data->nb_rx_queues, rss_act->queue_num);
+	if (rss_act->queue_num > num)
 		hns3_warn(hw, "Config queue numbers %u are beyond the scope of truncated",
-			  rss_flow_conf.queue_num);
+			  rss_act->queue_num);
 	hns3_info(hw, "Max of contiguous %u PF queues are configured", num);
 	if (num) {
-		ret = hns3_update_indir_table(hw, &rss_flow_conf, num);
+		ret = hns3_update_indir_table(hw, rss_act, num);
 		if (ret)
 			return ret;
 	}
 
-	/* Filter the unsupported flow types */
-	flow_types = conf->conf.types ?
-		     rss_flow_conf.types & HNS3_ETH_RSS_SUPPORT :
-		     hw->rss_info.rss_hf;
-	if (flow_types != rss_flow_conf.types)
-		hns3_warn(hw, "modified RSS types based on hardware support,"
-			  " requested:0x%" PRIx64 " configured:0x%" PRIx64,
-			  rss_flow_conf.types, flow_types);
-	/* Update the useful flow types */
-	rss_flow_conf.types = flow_types;
-
 	/* Set hash algorithm and flow types by the user's config */
-	return hns3_hw_rss_hash_set(hw, &rss_flow_conf);
+	return hns3_hw_rss_hash_set(hw, rss_act);
 }
 
 static int
@@ -1649,7 +1637,7 @@ hns3_rss_action_is_dup(struct hns3_hw *hw,
 }
 
 static int
-hns3_flow_parse_rss(struct rte_eth_dev *dev, const struct hns3_rss_conf *conf)
+hns3_flow_parse_rss(struct rte_eth_dev *dev, struct hns3_rss_conf *conf)
 {
 	struct hns3_adapter *hns = dev->data->dev_private;
 	struct hns3_hw *hw = &hns->hw;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:51.575719254 +0000
+++ 0034-net-hns3-use-new-RSS-rule-to-configure-hardware.patch	2023-03-15 22:44:49.651851686 +0000
@@ -1 +1 @@
-From 218a119a08e01f203f92b46334b6b2f03ff9765d Mon Sep 17 00:00:00 2001
+From 0b181e7369fa0850b223e875968b79d1e94d31ce Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 218a119a08e01f203f92b46334b6b2f03ff9765d ]
+
@@ -10,2 +11,0 @@
-Cc: stable@dpdk.org
-
@@ -19 +19 @@
-index 4da98d7adc..3700d073b1 100644
+index 5f9e63f8dd..15f3172cbb 100644
@@ -22 +22 @@
-@@ -1482,6 +1482,7 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
+@@ -1450,6 +1450,7 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
@@ -30 +30 @@
-@@ -1501,10 +1502,18 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
+@@ -1469,10 +1470,18 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
@@ -51 +51 @@
-@@ -1550,48 +1559,27 @@ hns3_reset_rss_filter(struct hns3_hw *hw, const struct hns3_rss_conf *conf)
+@@ -1518,48 +1527,27 @@ hns3_reset_rss_filter(struct hns3_hw *hw, const struct hns3_rss_conf *conf)
@@ -108 +108 @@
-@@ -1680,7 +1668,7 @@ hns3_rss_action_is_dup(struct hns3_hw *hw,
+@@ -1649,7 +1637,7 @@ hns3_rss_action_is_dup(struct hns3_hw *hw,

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/hns3: save hash algo to RSS filter list node' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (32 preceding siblings ...)
  2023-03-15 22:46     ` patch 'net/hns3: use new RSS rule to configure hardware' " luca.boccassi
@ 2023-03-15 22:46     ` luca.boccassi
  2023-03-15 22:46     ` patch 'net/hns3: allow adding queue buffer size hash rule' " luca.boccassi
                       ` (3 subsequent siblings)
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:46 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/49069daba240878ef2f9830fa55b6a91c8dbd7b1

Thanks.

Luca Boccassi

---
From 49069daba240878ef2f9830fa55b6a91c8dbd7b1 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Fri, 10 Mar 2023 17:35:14 +0800
Subject: [PATCH] net/hns3: save hash algo to RSS filter list node

[ upstream commit 9d34b8a181bf022fe3a3a3ae8511f3d921fc5c67 ]

Save hash algo from rte flow RSS rule to RSS filter list node
instead of struct hns3_rss_conf.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_flow.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 15f3172cbb..40a202db20 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1407,7 +1407,7 @@ hns3_disable_rss(struct hns3_hw *hw)
 }
 
 static int
-hns3_parse_rss_algorithm(struct hns3_hw *hw, enum rte_eth_hash_function func,
+hns3_parse_rss_algorithm(struct hns3_hw *hw, struct hns3_rss_conf *rss_conf,
 			 uint8_t *hash_algo)
 {
 	const uint8_t hash_func_map[] = {
@@ -1419,7 +1419,7 @@ hns3_parse_rss_algorithm(struct hns3_hw *hw, enum rte_eth_hash_function func,
 	uint8_t key[HNS3_RSS_KEY_SIZE_MAX] = {0};
 	int ret;
 
-	if (func == RTE_ETH_HASH_FUNCTION_DEFAULT) {
+	if (rss_conf->conf.func == RTE_ETH_HASH_FUNCTION_DEFAULT) {
 		ret = hns3_rss_get_algo_key(hw, hash_algo, key,
 					    hw->rss_key_size);
 		if (ret != 0) {
@@ -1434,20 +1434,21 @@ hns3_parse_rss_algorithm(struct hns3_hw *hw, enum rte_eth_hash_function func,
 		 * rte_flow_hash_algo) when this rule is delivered.
 		 */
 		if (__atomic_load_n((uint16_t *)&hw->reset.resetting, __ATOMIC_RELAXED) &&
-		    *hash_algo != hw->rss_info.rte_flow_hash_algo)
-			*hash_algo = hw->rss_info.rte_flow_hash_algo;
+		    *hash_algo != rss_conf->rte_flow_hash_algo)
+			*hash_algo = rss_conf->rte_flow_hash_algo;
 
 		return 0;
 	}
 
-	*hash_algo = hash_func_map[func];
+	*hash_algo = hash_func_map[rss_conf->conf.func];
 
 	return 0;
 }
 
 static int
-hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
+hns3_hw_rss_hash_set(struct hns3_hw *hw, struct hns3_rss_conf *conf)
 {
+	struct rte_flow_action_rss *rss_config = &conf->conf;
 	uint8_t rss_key[HNS3_RSS_KEY_SIZE_MAX] = {0};
 	bool use_default_key = false;
 	uint64_t flow_types;
@@ -1461,7 +1462,7 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
 		use_default_key = true;
 	}
 
-	ret = hns3_parse_rss_algorithm(hw, rss_config->func, &hash_algo);
+	ret = hns3_parse_rss_algorithm(hw, conf, &hash_algo);
 	if (ret)
 		return ret;
 
@@ -1470,7 +1471,7 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
 				    hw->rss_key_size);
 	if (ret)
 		return ret;
-	hw->rss_info.rte_flow_hash_algo = hash_algo;
+	conf->rte_flow_hash_algo = hash_algo;
 
 	/* Filter the unsupported flow types */
 	flow_types = rss_config->types ?
@@ -1547,7 +1548,7 @@ hns3_config_rss_filter(struct hns3_hw *hw, struct hns3_rss_conf *conf)
 	}
 
 	/* Set hash algorithm and flow types by the user's config */
-	return hns3_hw_rss_hash_set(hw, rss_act);
+	return hns3_hw_rss_hash_set(hw, conf);
 }
 
 static int
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:51.635473740 +0000
+++ 0035-net-hns3-save-hash-algo-to-RSS-filter-list-node.patch	2023-03-15 22:44:49.655851770 +0000
@@ -1 +1 @@
-From 9d34b8a181bf022fe3a3a3ae8511f3d921fc5c67 Mon Sep 17 00:00:00 2001
+From 49069daba240878ef2f9830fa55b6a91c8dbd7b1 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 9d34b8a181bf022fe3a3a3ae8511f3d921fc5c67 ]
+
@@ -9,2 +10,0 @@
-Cc: stable@dpdk.org
-
@@ -18 +18 @@
-index 3700d073b1..527874df44 100644
+index 15f3172cbb..40a202db20 100644
@@ -21 +21 @@
-@@ -1439,7 +1439,7 @@ hns3_disable_rss(struct hns3_hw *hw)
+@@ -1407,7 +1407,7 @@ hns3_disable_rss(struct hns3_hw *hw)
@@ -30 +30 @@
-@@ -1451,7 +1451,7 @@ hns3_parse_rss_algorithm(struct hns3_hw *hw, enum rte_eth_hash_function func,
+@@ -1419,7 +1419,7 @@ hns3_parse_rss_algorithm(struct hns3_hw *hw, enum rte_eth_hash_function func,
@@ -39 +39 @@
-@@ -1466,20 +1466,21 @@ hns3_parse_rss_algorithm(struct hns3_hw *hw, enum rte_eth_hash_function func,
+@@ -1434,20 +1434,21 @@ hns3_parse_rss_algorithm(struct hns3_hw *hw, enum rte_eth_hash_function func,
@@ -42 +42 @@
- 		if (__atomic_load_n(&hw->reset.resetting, __ATOMIC_RELAXED) &&
+ 		if (__atomic_load_n((uint16_t *)&hw->reset.resetting, __ATOMIC_RELAXED) &&
@@ -65 +65 @@
-@@ -1493,7 +1494,7 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
+@@ -1461,7 +1462,7 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
@@ -74 +74 @@
-@@ -1502,7 +1503,7 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
+@@ -1470,7 +1471,7 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
@@ -83 +83 @@
-@@ -1579,7 +1580,7 @@ hns3_config_rss_filter(struct hns3_hw *hw, struct hns3_rss_conf *conf)
+@@ -1547,7 +1548,7 @@ hns3_config_rss_filter(struct hns3_hw *hw, struct hns3_rss_conf *conf)

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/hns3: allow adding queue buffer size hash rule' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (33 preceding siblings ...)
  2023-03-15 22:46     ` patch 'net/hns3: save hash algo to RSS filter list node' " luca.boccassi
@ 2023-03-15 22:46     ` luca.boccassi
  2023-03-15 22:46     ` patch 'net/hns3: separate flow RSS config from RSS conf' " luca.boccassi
                       ` (2 subsequent siblings)
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:46 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/9026ba04f9b356e04f970198e399c8eae8b53c2c

Thanks.

Luca Boccassi

---
From 9026ba04f9b356e04f970198e399c8eae8b53c2c Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Fri, 10 Mar 2023 17:35:15 +0800
Subject: [PATCH] net/hns3: allow adding queue buffer size hash rule

[ upstream commit 8095bf3e6d8ca7349e0a15f95407acd2063e7be0 ]

The maximum queue number from RSS flow rule allowed depends on
the maximum queue number (512) under one TC instead of the one
of Rx/Tx queue so as to eliminate restrictions on user usage.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_rss.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/hns3/hns3_rss.h b/drivers/net/hns3/hns3_rss.h
index ffd76647c9..9300866b68 100644
--- a/drivers/net/hns3/hns3_rss.h
+++ b/drivers/net/hns3/hns3_rss.h
@@ -41,7 +41,8 @@ struct hns3_rss_tuple_cfg {
 	uint64_t rss_tuple_fields;
 };
 
-#define HNS3_RSS_QUEUES_BUFFER_NUM	64 /* Same as the Max rx/tx queue num */
+/* Same as the Max queue num under TC */
+#define HNS3_RSS_QUEUES_BUFFER_NUM	512
 struct hns3_rss_conf {
 	/* RSS parameters :algorithm, flow_types,  key, queue */
 	struct rte_flow_action_rss conf;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:51.688093675 +0000
+++ 0036-net-hns3-allow-adding-queue-buffer-size-hash-rule.patch	2023-03-15 22:44:49.659851854 +0000
@@ -1 +1 @@
-From 8095bf3e6d8ca7349e0a15f95407acd2063e7be0 Mon Sep 17 00:00:00 2001
+From 9026ba04f9b356e04f970198e399c8eae8b53c2c Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 8095bf3e6d8ca7349e0a15f95407acd2063e7be0 ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index 21b90789d0..cc0bb8431d 100644
+index ffd76647c9..9300866b68 100644
@@ -23,3 +24,3 @@
-@@ -37,7 +37,8 @@
- #define HNS3_RSS_HASH_ALGO_SYMMETRIC_TOEP 2
- #define HNS3_RSS_HASH_ALGO_MASK		0xf
+@@ -41,7 +41,8 @@ struct hns3_rss_tuple_cfg {
+ 	uint64_t rss_tuple_fields;
+ };

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'net/hns3: separate flow RSS config from RSS conf' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (34 preceding siblings ...)
  2023-03-15 22:46     ` patch 'net/hns3: allow adding queue buffer size hash rule' " luca.boccassi
@ 2023-03-15 22:46     ` luca.boccassi
  2023-03-15 22:46     ` patch 'app/crypto-perf: fix test file memory leak' " luca.boccassi
  2023-03-15 22:46     ` patch 'app/flow-perf: fix division or module by zero' " luca.boccassi
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:46 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/65a68c2c6f9076d849aafdcdbdaea91bf2414970

Thanks.

Luca Boccassi

---
From 65a68c2c6f9076d849aafdcdbdaea91bf2414970 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Fri, 10 Mar 2023 17:35:16 +0800
Subject: [PATCH] net/hns3: separate flow RSS config from RSS conf

[ upstream commit b93ad0cc7677881911e5fc3baa89e0a0bbd73c48 ]

Some RSS fields in struct hns3_rss_conf (e.g. conf, queue,
valid) are only used when create RSS flow rule, which is
unnecessary for RSS configuration information from ethdev
ops. This patch removes these fields from hns3_rss_conf
and add a new struct hns3_flow_rss_conf as rte flow
RSS filter list node element.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_fdir.h | 10 +++++++++-
 drivers/net/hns3/hns3_flow.c | 23 ++++++++++++-----------
 drivers/net/hns3/hns3_rss.h  |  5 -----
 3 files changed, 21 insertions(+), 17 deletions(-)

diff --git a/drivers/net/hns3/hns3_fdir.h b/drivers/net/hns3/hns3_fdir.h
index 2d533c30ec..11c2d82238 100644
--- a/drivers/net/hns3/hns3_fdir.h
+++ b/drivers/net/hns3/hns3_fdir.h
@@ -175,10 +175,18 @@ struct hns3_fdir_rule_ele {
 	struct hns3_fdir_rule fdir_conf;
 };
 
+struct hns3_flow_rss_conf {
+	struct rte_flow_action_rss conf;
+	uint8_t hash_algo;
+	uint8_t key[HNS3_RSS_KEY_SIZE_MAX];  /* Hash key */
+	uint16_t queue[HNS3_RSS_QUEUES_BUFFER_NUM]; /* Queues indices to use */
+	bool valid; /* check if RSS rule is valid */
+};
+
 /* rss filter list structure */
 struct hns3_rss_conf_ele {
 	TAILQ_ENTRY(hns3_rss_conf_ele) entries;
-	struct hns3_rss_conf filter_info;
+	struct hns3_flow_rss_conf filter_info;
 };
 
 /* hns3_flow memory list structure */
diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 40a202db20..47ea9f71e8 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1316,7 +1316,6 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev,
 {
 	struct hns3_adapter *hns = dev->data->dev_private;
 	struct hns3_hw *hw = &hns->hw;
-	struct hns3_rss_conf *rss_conf = &hw->rss_info;
 	const struct rte_flow_action_rss *rss;
 	const struct rte_flow_action *act;
 	uint32_t act_index = 0;
@@ -1331,7 +1330,7 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev,
 					  act, "no valid queues");
 	}
 
-	if (rss->queue_num > RTE_DIM(rss_conf->queue))
+	if (rss->queue_num > HNS3_RSS_QUEUES_BUFFER_NUM)
 		return rte_flow_error_set(error, ENOTSUP,
 					  RTE_FLOW_ERROR_TYPE_ACTION_CONF, act,
 					  "queue number configured exceeds "
@@ -1407,7 +1406,7 @@ hns3_disable_rss(struct hns3_hw *hw)
 }
 
 static int
-hns3_parse_rss_algorithm(struct hns3_hw *hw, struct hns3_rss_conf *rss_conf,
+hns3_parse_rss_algorithm(struct hns3_hw *hw, struct hns3_flow_rss_conf *rss_conf,
 			 uint8_t *hash_algo)
 {
 	const uint8_t hash_func_map[] = {
@@ -1434,8 +1433,8 @@ hns3_parse_rss_algorithm(struct hns3_hw *hw, struct hns3_rss_conf *rss_conf,
 		 * rte_flow_hash_algo) when this rule is delivered.
 		 */
 		if (__atomic_load_n((uint16_t *)&hw->reset.resetting, __ATOMIC_RELAXED) &&
-		    *hash_algo != rss_conf->rte_flow_hash_algo)
-			*hash_algo = rss_conf->rte_flow_hash_algo;
+		    *hash_algo != rss_conf->hash_algo)
+			*hash_algo = rss_conf->hash_algo;
 
 		return 0;
 	}
@@ -1446,7 +1445,7 @@ hns3_parse_rss_algorithm(struct hns3_hw *hw, struct hns3_rss_conf *rss_conf,
 }
 
 static int
-hns3_hw_rss_hash_set(struct hns3_hw *hw, struct hns3_rss_conf *conf)
+hns3_hw_rss_hash_set(struct hns3_hw *hw, struct hns3_flow_rss_conf *conf)
 {
 	struct rte_flow_action_rss *rss_config = &conf->conf;
 	uint8_t rss_key[HNS3_RSS_KEY_SIZE_MAX] = {0};
@@ -1471,7 +1470,7 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct hns3_rss_conf *conf)
 				    hw->rss_key_size);
 	if (ret)
 		return ret;
-	conf->rte_flow_hash_algo = hash_algo;
+	conf->hash_algo = hash_algo;
 
 	/* Filter the unsupported flow types */
 	flow_types = rss_config->types ?
@@ -1513,7 +1512,8 @@ hns3_update_indir_table(struct hns3_hw *hw,
 }
 
 static int
-hns3_reset_rss_filter(struct hns3_hw *hw, const struct hns3_rss_conf *conf)
+hns3_reset_rss_filter(struct hns3_hw *hw,
+		      const struct hns3_flow_rss_conf *conf)
 {
 	int ret;
 
@@ -1528,7 +1528,7 @@ hns3_reset_rss_filter(struct hns3_hw *hw, const struct hns3_rss_conf *conf)
 }
 
 static int
-hns3_config_rss_filter(struct hns3_hw *hw, struct hns3_rss_conf *conf)
+hns3_config_rss_filter(struct hns3_hw *hw, struct hns3_flow_rss_conf *conf)
 {
 	struct rte_flow_action_rss *rss_act;
 	uint16_t num;
@@ -1638,7 +1638,8 @@ hns3_rss_action_is_dup(struct hns3_hw *hw,
 }
 
 static int
-hns3_flow_parse_rss(struct rte_eth_dev *dev, struct hns3_rss_conf *conf)
+hns3_flow_parse_rss(struct rte_eth_dev *dev,
+		    struct hns3_flow_rss_conf *conf)
 {
 	struct hns3_adapter *hns = dev->data->dev_private;
 	struct hns3_hw *hw = &hns->hw;
@@ -1708,8 +1709,8 @@ hns3_flow_create_rss_rule(struct rte_eth_dev *dev,
 	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	const struct rte_flow_action_rss *rss_act;
 	struct hns3_rss_conf_ele *rss_filter_ptr;
+	struct hns3_flow_rss_conf *new_conf;
 	struct hns3_rss_conf_ele *filter_ptr;
-	struct hns3_rss_conf *new_conf;
 	int ret;
 
 	rss_filter_ptr = rte_zmalloc("hns3 rss filter",
diff --git a/drivers/net/hns3/hns3_rss.h b/drivers/net/hns3/hns3_rss.h
index 9300866b68..dfd07930f4 100644
--- a/drivers/net/hns3/hns3_rss.h
+++ b/drivers/net/hns3/hns3_rss.h
@@ -44,15 +44,10 @@ struct hns3_rss_tuple_cfg {
 /* Same as the Max queue num under TC */
 #define HNS3_RSS_QUEUES_BUFFER_NUM	512
 struct hns3_rss_conf {
-	/* RSS parameters :algorithm, flow_types,  key, queue */
-	struct rte_flow_action_rss conf;
 	uint64_t rss_hf;
 	uint8_t hash_algo; /* hash function type defined by hardware */
-	uint8_t rte_flow_hash_algo;
 	uint8_t key[HNS3_RSS_KEY_SIZE_MAX];  /* Hash key */
 	uint16_t rss_indirection_tbl[HNS3_RSS_IND_TBL_SIZE_MAX];
-	uint16_t queue[HNS3_RSS_QUEUES_BUFFER_NUM]; /* Queues indices to use */
-	bool valid; /* check if RSS rule is valid */
 	/*
 	 * For IPv6 SCTP packets type, check whether the NIC hardware support
 	 * RSS hash using the src/dst port as the input tuple. For Kunpeng920
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:51.748584250 +0000
+++ 0037-net-hns3-separate-flow-RSS-config-from-RSS-conf.patch	2023-03-15 22:44:49.663851938 +0000
@@ -1 +1 @@
-From b93ad0cc7677881911e5fc3baa89e0a0bbd73c48 Mon Sep 17 00:00:00 2001
+From 65a68c2c6f9076d849aafdcdbdaea91bf2414970 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b93ad0cc7677881911e5fc3baa89e0a0bbd73c48 ]
+
@@ -13,2 +14,0 @@
-Cc: stable@dpdk.org
-
@@ -17,0 +18 @@
+ drivers/net/hns3/hns3_fdir.h | 10 +++++++++-
@@ -19 +19,0 @@
- drivers/net/hns3/hns3_flow.h | 10 +++++++++-
@@ -22,0 +23,24 @@
+diff --git a/drivers/net/hns3/hns3_fdir.h b/drivers/net/hns3/hns3_fdir.h
+index 2d533c30ec..11c2d82238 100644
+--- a/drivers/net/hns3/hns3_fdir.h
++++ b/drivers/net/hns3/hns3_fdir.h
+@@ -175,10 +175,18 @@ struct hns3_fdir_rule_ele {
+ 	struct hns3_fdir_rule fdir_conf;
+ };
+ 
++struct hns3_flow_rss_conf {
++	struct rte_flow_action_rss conf;
++	uint8_t hash_algo;
++	uint8_t key[HNS3_RSS_KEY_SIZE_MAX];  /* Hash key */
++	uint16_t queue[HNS3_RSS_QUEUES_BUFFER_NUM]; /* Queues indices to use */
++	bool valid; /* check if RSS rule is valid */
++};
++
+ /* rss filter list structure */
+ struct hns3_rss_conf_ele {
+ 	TAILQ_ENTRY(hns3_rss_conf_ele) entries;
+-	struct hns3_rss_conf filter_info;
++	struct hns3_flow_rss_conf filter_info;
+ };
+ 
+ /* hns3_flow memory list structure */
@@ -24 +48 @@
-index 527874df44..89374816aa 100644
+index 40a202db20..47ea9f71e8 100644
@@ -27 +51 @@
-@@ -1359,7 +1359,6 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev,
+@@ -1316,7 +1316,6 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev,
@@ -35 +59 @@
-@@ -1374,7 +1373,7 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev,
+@@ -1331,7 +1330,7 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev,
@@ -44 +68 @@
-@@ -1439,7 +1438,7 @@ hns3_disable_rss(struct hns3_hw *hw)
+@@ -1407,7 +1406,7 @@ hns3_disable_rss(struct hns3_hw *hw)
@@ -53 +77 @@
-@@ -1466,8 +1465,8 @@ hns3_parse_rss_algorithm(struct hns3_hw *hw, struct hns3_rss_conf *rss_conf,
+@@ -1434,8 +1433,8 @@ hns3_parse_rss_algorithm(struct hns3_hw *hw, struct hns3_rss_conf *rss_conf,
@@ -56 +80 @@
- 		if (__atomic_load_n(&hw->reset.resetting, __ATOMIC_RELAXED) &&
+ 		if (__atomic_load_n((uint16_t *)&hw->reset.resetting, __ATOMIC_RELAXED) &&
@@ -64 +88 @@
-@@ -1478,7 +1477,7 @@ hns3_parse_rss_algorithm(struct hns3_hw *hw, struct hns3_rss_conf *rss_conf,
+@@ -1446,7 +1445,7 @@ hns3_parse_rss_algorithm(struct hns3_hw *hw, struct hns3_rss_conf *rss_conf,
@@ -73 +97 @@
-@@ -1503,7 +1502,7 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct hns3_rss_conf *conf)
+@@ -1471,7 +1470,7 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct hns3_rss_conf *conf)
@@ -82 +106 @@
-@@ -1545,7 +1544,8 @@ hns3_update_indir_table(struct hns3_hw *hw,
+@@ -1513,7 +1512,8 @@ hns3_update_indir_table(struct hns3_hw *hw,
@@ -92 +116 @@
-@@ -1560,7 +1560,7 @@ hns3_reset_rss_filter(struct hns3_hw *hw, const struct hns3_rss_conf *conf)
+@@ -1528,7 +1528,7 @@ hns3_reset_rss_filter(struct hns3_hw *hw, const struct hns3_rss_conf *conf)
@@ -101 +125 @@
-@@ -1669,7 +1669,8 @@ hns3_rss_action_is_dup(struct hns3_hw *hw,
+@@ -1638,7 +1638,8 @@ hns3_rss_action_is_dup(struct hns3_hw *hw,
@@ -111 +135 @@
-@@ -1739,8 +1740,8 @@ hns3_flow_create_rss_rule(struct rte_eth_dev *dev,
+@@ -1708,8 +1709,8 @@ hns3_flow_create_rss_rule(struct rte_eth_dev *dev,
@@ -121,24 +144,0 @@
-diff --git a/drivers/net/hns3/hns3_flow.h b/drivers/net/hns3/hns3_flow.h
-index e4b2fdf2e6..90126f2b6e 100644
---- a/drivers/net/hns3/hns3_flow.h
-+++ b/drivers/net/hns3/hns3_flow.h
-@@ -24,10 +24,18 @@ struct rte_flow {
- 	uint32_t counter_id;
- };
- 
-+struct hns3_flow_rss_conf {
-+	struct rte_flow_action_rss conf;
-+	uint8_t hash_algo;
-+	uint8_t key[HNS3_RSS_KEY_SIZE_MAX];  /* Hash key */
-+	uint16_t queue[HNS3_RSS_QUEUES_BUFFER_NUM]; /* Queues indices to use */
-+	bool valid; /* check if RSS rule is valid */
-+};
-+
- /* rss filter list structure */
- struct hns3_rss_conf_ele {
- 	TAILQ_ENTRY(hns3_rss_conf_ele) entries;
--	struct hns3_rss_conf filter_info;
-+	struct hns3_flow_rss_conf filter_info;
- };
- 
- /* hns3_flow memory list structure */
@@ -146 +146 @@
-index cc0bb8431d..d19730c69c 100644
+index 9300866b68..dfd07930f4 100644
@@ -149 +149 @@
-@@ -40,15 +40,10 @@
+@@ -44,15 +44,10 @@ struct hns3_rss_tuple_cfg {

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'app/crypto-perf: fix test file memory leak' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (35 preceding siblings ...)
  2023-03-15 22:46     ` patch 'net/hns3: separate flow RSS config from RSS conf' " luca.boccassi
@ 2023-03-15 22:46     ` luca.boccassi
  2023-03-15 22:46     ` patch 'app/flow-perf: fix division or module by zero' " luca.boccassi
  37 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:46 UTC (permalink / raw)
  To: Ciara Power; +Cc: Akhil Goyal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/59852707e77878d03d1253ffa2ab283055b790e0

Thanks.

Luca Boccassi

---
From 59852707e77878d03d1253ffa2ab283055b790e0 Mon Sep 17 00:00:00 2001
From: Ciara Power <ciara.power@intel.com>
Date: Fri, 10 Mar 2023 13:20:17 +0000
Subject: [PATCH] app/crypto-perf: fix test file memory leak

[ upstream commit 430c35730e09dea162b7830b4719285eb6f36364 ]

A memory leak was detected using the AddressSanitizer tool,
when running the crypto-perf application with a test vector file.

The strdup function used returns a pointer to a null-terminated byte
string, which must be freed after use. This patch frees the pointer in
an error case, and also after a successful run.

Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application")

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
---
 app/test-crypto-perf/cperf_options_parsing.c     | 1 +
 app/test-crypto-perf/cperf_test_vector_parsing.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/app/test-crypto-perf/cperf_options_parsing.c b/app/test-crypto-perf/cperf_options_parsing.c
index e84f56cfaa..372cae343a 100644
--- a/app/test-crypto-perf/cperf_options_parsing.c
+++ b/app/test-crypto-perf/cperf_options_parsing.c
@@ -496,6 +496,7 @@ parse_test_file(struct cperf_options *opts,
 	if (access(opts->test_file, F_OK) != -1)
 		return 0;
 	RTE_LOG(ERR, USER1, "Test vector file doesn't exist\n");
+	free(opts->test_file);
 
 	return -1;
 }
diff --git a/app/test-crypto-perf/cperf_test_vector_parsing.c b/app/test-crypto-perf/cperf_test_vector_parsing.c
index 1e9dfcfff0..1fe11df27b 100644
--- a/app/test-crypto-perf/cperf_test_vector_parsing.c
+++ b/app/test-crypto-perf/cperf_test_vector_parsing.c
@@ -28,6 +28,7 @@ free_test_vector(struct cperf_test_vector *vector, struct cperf_options *opts)
 		rte_free(vector->cipher_key.data);
 		rte_free(vector->auth_key.data);
 		rte_free(vector->ciphertext.data);
+		free(opts->test_file);
 	}
 
 	rte_free(vector);
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:51.800110186 +0000
+++ 0038-app-crypto-perf-fix-test-file-memory-leak.patch	2023-03-15 22:44:49.667852022 +0000
@@ -1 +1 @@
-From 430c35730e09dea162b7830b4719285eb6f36364 Mon Sep 17 00:00:00 2001
+From 59852707e77878d03d1253ffa2ab283055b790e0 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 430c35730e09dea162b7830b4719285eb6f36364 ]
+
@@ -14 +15,0 @@
-Cc: stable@dpdk.org
@@ -24 +25 @@
-index 8c9f632590..26136a52ae 100644
+index e84f56cfaa..372cae343a 100644
@@ -27 +28 @@
-@@ -519,6 +519,7 @@ parse_test_file(struct cperf_options *opts,
+@@ -496,6 +496,7 @@ parse_test_file(struct cperf_options *opts,
@@ -36 +37 @@
-index 98e46c3381..737d61d4af 100644
+index 1e9dfcfff0..1fe11df27b 100644
@@ -39 +40 @@
-@@ -30,6 +30,7 @@ free_test_vector(struct cperf_test_vector *vector, struct cperf_options *opts)
+@@ -28,6 +28,7 @@ free_test_vector(struct cperf_test_vector *vector, struct cperf_options *opts)

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'app/flow-perf: fix division or module by zero' has been queued to stable release 20.11.8
  2023-03-15 22:45   ` patch 'eal/windows: fix pedantic build' " luca.boccassi
                       ` (36 preceding siblings ...)
  2023-03-15 22:46     ` patch 'app/crypto-perf: fix test file memory leak' " luca.boccassi
@ 2023-03-15 22:46     ` luca.boccassi
  2023-03-22  0:41       ` patch 'raw/skeleton: fix selftest' " luca.boccassi
  37 siblings, 1 reply; 144+ messages in thread
From: luca.boccassi @ 2023-03-15 22:46 UTC (permalink / raw)
  To: Mohammad Iqbal Ahmad; +Cc: Wisam Jaddo, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/2e3d3e025d3f04065763e4c483b874c4da701e81

Thanks.

Luca Boccassi

---
From 2e3d3e025d3f04065763e4c483b874c4da701e81 Mon Sep 17 00:00:00 2001
From: Mohammad Iqbal Ahmad <mahmad@marvell.com>
Date: Tue, 24 Jan 2023 16:08:03 +0530
Subject: [PATCH] app/flow-perf: fix division or module by zero

[ upstream commit 132d39dcab370b2112e0a24ab1c94036b40b9557 ]

Fix division or module by zero reported by coverity scan.

Coverity issue: 373870
Fixes: bf3688f1e816 ("app/flow-perf: add insertion rate calculation")

Signed-off-by: Mohammad Iqbal Ahmad <mahmad@marvell.com>
Acked-by: Wisam Jaddo <wisamm@nvidia.com>
---
 app/test-flow-perf/main.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c
index 899f6c93b6..b05f70cfb6 100644
--- a/app/test-flow-perf/main.c
+++ b/app/test-flow-perf/main.c
@@ -709,13 +709,11 @@ args_parse(int argc, char **argv)
 			if (strcmp(lgopts[opt_idx].name,
 					"rules-batch") == 0) {
 				n = atoi(optarg);
-				if (n >= DEFAULT_RULES_BATCH)
+				if (n > 0)
 					rules_batch = n;
-				else {
+				else
 					rte_exit(EXIT_FAILURE,
-						"rules_batch should be >= %d\n",
-						DEFAULT_RULES_BATCH);
-				}
+							"flow rules-batch should be > 0\n");
 			}
 			if (strcmp(lgopts[opt_idx].name,
 					"rules-count") == 0) {
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-15 22:44:51.856028877 +0000
+++ 0039-app-flow-perf-fix-division-or-module-by-zero.patch	2023-03-15 22:44:49.667852022 +0000
@@ -1 +1 @@
-From 132d39dcab370b2112e0a24ab1c94036b40b9557 Mon Sep 17 00:00:00 2001
+From 2e3d3e025d3f04065763e4c483b874c4da701e81 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 132d39dcab370b2112e0a24ab1c94036b40b9557 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -15,3 +16,2 @@
- .mailmap                  | 1 +
- app/test-flow-perf/main.c | 7 ++++++-
- 2 files changed, 7 insertions(+), 1 deletion(-)
+ app/test-flow-perf/main.c | 8 +++-----
+ 1 file changed, 3 insertions(+), 5 deletions(-)
@@ -19,12 +18,0 @@
-diff --git a/.mailmap b/.mailmap
-index aaa15deff9..4018f0fc47 100644
---- a/.mailmap
-+++ b/.mailmap
-@@ -924,6 +924,7 @@ Mitch Williams <mitch.a.williams@intel.com>
- Mit Matelske <mit@pt.net>
- Mohamad Noor Alim Hussin <mohamad.noor.alim.hussin@intel.com>
- Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
-+Mohammad Iqbal Ahmad <mahmad@marvell.com>
- Mohammed Gamal <mgamal@redhat.com>
- Mohsin Kazmi <mohsin.kazmi14@gmail.com>
- Mohsin Mazhar Shaikh <mohsinmazhar_shaikh@trendmicro.com>
@@ -32 +20 @@
-index 4a9206803a..e0ef78a840 100644
+index 899f6c93b6..b05f70cfb6 100644
@@ -35,2 +23 @@
-@@ -848,7 +848,12 @@ args_parse(int argc, char **argv)
- 			/* Control */
+@@ -709,13 +709,11 @@ args_parse(int argc, char **argv)
@@ -39,2 +26,2 @@
--				rules_batch = atoi(optarg);
-+				n = atoi(optarg);
+ 				n = atoi(optarg);
+-				if (n >= DEFAULT_RULES_BATCH)
@@ -42 +29,2 @@
-+					rules_batch = n;
+ 					rules_batch = n;
+-				else {
@@ -44 +32,4 @@
-+					rte_exit(EXIT_FAILURE,
+ 					rte_exit(EXIT_FAILURE,
+-						"rules_batch should be >= %d\n",
+-						DEFAULT_RULES_BATCH);
+-				}

^ permalink raw reply	[flat|nested] 144+ messages in thread

* Re: patch 'vhost: fix OOB access for invalid vhost ID' has been queued to stable release 20.11.8
  2023-03-15 22:45     ` patch 'vhost: fix OOB access for invalid vhost ID' " luca.boccassi
@ 2023-03-16  9:27       ` Luca Boccassi
  2023-03-16  9:56         ` David Marchand
  0 siblings, 1 reply; 144+ messages in thread
From: Luca Boccassi @ 2023-03-16  9:27 UTC (permalink / raw)
  To: David Marchand; +Cc: Maxime Coquelin, dpdk stable

On Wed, 15 Mar 2023 at 22:46, <luca.boccassi@gmail.com> wrote:
>
> Hi,
>
> FYI, your patch has been queued to stable release 20.11.8
>
> Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
> It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable
>
> This queued commit can be viewed at:
> https://github.com/bluca/dpdk-stable/commit/145ffdbb7ea750f4d3b17446bde22a805957ad71
>
> Thanks.
>
> Luca Boccassi
>
> ---
> From 145ffdbb7ea750f4d3b17446bde22a805957ad71 Mon Sep 17 00:00:00 2001
> From: David Marchand <david.marchand@redhat.com>
> Date: Mon, 27 Feb 2023 11:59:27 +0100
> Subject: [PATCH] vhost: fix OOB access for invalid vhost ID
>
> [ upstream commit 1c80a404fd82b816d5c3ebb7cd9e89804ac63984 ]
>
> The net/vhost pmd currently provides a -1 vid when disabling interrupt
> after a virtio port got disconnected.
>
> This can be caught when running with ASan.
>
> First, start dpdk-l3fwd-power in interrupt mode with a net/vhost port.
>
> $ ./build-clang/examples/dpdk-l3fwd-power -l0,1 --in-memory \
>         -a 0000:00:00.0 \
>         --vdev net_vhost0,iface=plop.sock,client=1\
>         -- \
>         -p 0x1 \
>         --interrupt-only \
>         --config '(0,0,1)' \
>         --parse-ptype 0
>
> Then start testpmd with virtio-user.
>
> $ ./build-clang/app/dpdk-testpmd -l0,2 --single-file-segment --in-memory \
>         -a 0000:00:00.0 \
>         --vdev net_virtio_user0,path=plop.sock,server=1 \
>         -- \
>         -i
>
> Finally stop testpmd.
> ASan then splats in dpdk-l3fwd-power:
>
> =================================================================
> ==3641005==ERROR: AddressSanitizer: global-buffer-overflow on address
>         0x000005ed0778 at pc 0x000001270f81 bp 0x7fddbd2eee20
>         sp 0x7fddbd2eee18
> READ of size 8 at 0x000005ed0778 thread T2
>     #0 0x1270f80 in get_device .../lib/vhost/vhost.h:801:27
>     #1 0x1270f80 in rte_vhost_get_vhost_vring .../lib/vhost/vhost.c:951:8
>     #2 0x3ac95cb in eth_rxq_intr_disable
>         .../drivers/net/vhost/rte_eth_vhost.c:647:8
>     #3 0x170e0bf in rte_eth_dev_rx_intr_disable
>         .../lib/ethdev/rte_ethdev.c:5443:25
>     #4 0xf72ba7 in turn_on_off_intr .../examples/l3fwd-power/main.c:881:4
>     #5 0xf71045 in main_intr_loop .../examples/l3fwd-power/main.c:1061:6
>     #6 0x17f9292 in eal_thread_loop
>         .../lib/eal/common/eal_common_thread.c:210:9
>     #7 0x18373f5 in eal_worker_thread_loop .../lib/eal/linux/eal.c:915:2
>     #8 0x7fddc16ae12c in start_thread (/lib64/libc.so.6+0x8b12c)
>         (BuildId: 81daba31ee66dbd63efdc4252a872949d874d136)
>     #9 0x7fddc172fbbf in __GI___clone3 (/lib64/libc.so.6+0x10cbbf)
>         (BuildId: 81daba31ee66dbd63efdc4252a872949d874d136)
>
> 0x000005ed0778 is located 8 bytes to the left of global variable
>         'vhost_devices' defined in '.../lib/vhost/vhost.c:24'
>         (0x5ed0780) of size 8192
> 0x000005ed0778 is located 20 bytes to the right of global variable
>         'vhost_config_log_level' defined in '.../lib/vhost/vhost.c:2174'
>         (0x5ed0760) of size 4
> SUMMARY: AddressSanitizer: global-buffer-overflow
>         .../lib/vhost/vhost.h:801:27 in get_device
> Shadow bytes around the buggy address:
>   0x000080bd2090: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
>   0x000080bd20a0: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
>   0x000080bd20b0: f9 f9 f9 f9 00 f9 f9 f9 00 f9 f9 f9 00 f9 f9 f9
>   0x000080bd20c0: 00 00 00 00 00 00 00 f9 f9 f9 f9 f9 04 f9 f9 f9
>   0x000080bd20d0: 00 00 00 00 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 00
> =>0x000080bd20e0: 00 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9 04 f9 f9[f9]
>   0x000080bd20f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>   0x000080bd2100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>   0x000080bd2110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>   0x000080bd2120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>   0x000080bd2130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> Shadow byte legend (one shadow byte represents 8 application bytes):
>   Addressable:           00
>   Partially addressable: 01 02 03 04 05 06 07
>   Heap left redzone:       fa
>   Freed heap region:       fd
>   Stack left redzone:      f1
>   Stack mid redzone:       f2
>   Stack right redzone:     f3
>   Stack after return:      f5
>   Stack use after scope:   f8
>   Global redzone:          f9
>   Global init order:       f6
>   Poisoned by user:        f7
>   Container overflow:      fc
>   Array cookie:            ac
>   Intra object redzone:    bb
>   ASan internal:           fe
>   Left alloca redzone:     ca
>   Right alloca redzone:    cb
> Thread T2 created by T0 here:
>     #0 0xe98996 in __interceptor_pthread_create
>         (.examples/dpdk-l3fwd-power+0xe98996)
>         (BuildId: d0b984a3b0287b9e0f301b73426fa921aeecca3a)
>     #1 0x1836767 in eal_worker_thread_create .../lib/eal/linux/eal.c:952:6
>     #2 0x1834b83 in rte_eal_init .../lib/eal/linux/eal.c:1257:9
>     #3 0xf68902 in main .../examples/l3fwd-power/main.c:2496:8
>     #4 0x7fddc164a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f)
>         (BuildId: 81daba31ee66dbd63efdc4252a872949d874d136)
>
> ==3641005==ABORTING
>
> More generally, any application passing an incorrect vid would trigger
> such an OOB access.
>
> Fixes: 4796ad63ba1f ("examples/vhost: import userspace vhost application")
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
>  lib/librte_vhost/vhost.h | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
> index 92b67a2c6f..ee4e5317d0 100644
> --- a/lib/librte_vhost/vhost.h
> +++ b/lib/librte_vhost/vhost.h
> @@ -663,7 +663,10 @@ hva_to_gpa(struct virtio_net *dev, uint64_t vva, uint64_t len)
>  static __rte_always_inline struct virtio_net *
>  get_device(int vid)
>  {
> -       struct virtio_net *dev = vhost_devices[vid];
> +       struct virtio_net *dev = NULL;
> +
> +       if (likely(vid >= 0 && vid < RTE_MAX_VHOST_DEVICE))
> +               dev = vhost_devices[vid];
>
>         if (unlikely(!dev)) {
>                 VHOST_LOG_CONFIG(ERR,
> --
> 2.39.2
>
> ---
>   Diff of the applied patch vs upstream commit (please double-check if non-empty:
> ---
> --- -   2023-03-15 22:44:50.000737881 +0000
> +++ 0006-vhost-fix-OOB-access-for-invalid-vhost-ID.patch        2023-03-15 22:44:49.507848667 +0000
> @@ -1 +1 @@
> -From 1c80a404fd82b816d5c3ebb7cd9e89804ac63984 Mon Sep 17 00:00:00 2001
> +From 145ffdbb7ea750f4d3b17446bde22a805957ad71 Mon Sep 17 00:00:00 2001
> @@ -5,0 +6,2 @@
> +[ upstream commit 1c80a404fd82b816d5c3ebb7cd9e89804ac63984 ]
> +
> @@ -109 +110,0 @@
> -Cc: stable@dpdk.org
> @@ -114 +115 @@
> - lib/vhost/vhost.h | 5 ++++-
> + lib/librte_vhost/vhost.h | 5 ++++-
> @@ -117,5 +118,5 @@
> -diff --git a/lib/vhost/vhost.h b/lib/vhost/vhost.h
> -index 5750f0c005..954c0ac197 100644
> ---- a/lib/vhost/vhost.h
> -+++ b/lib/vhost/vhost.h
> -@@ -798,7 +798,10 @@ hva_to_gpa(struct virtio_net *dev, uint64_t vva, uint64_t len)
> +diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
> +index 92b67a2c6f..ee4e5317d0 100644
> +--- a/lib/librte_vhost/vhost.h
> ++++ b/lib/librte_vhost/vhost.h
> +@@ -663,7 +663,10 @@ hva_to_gpa(struct virtio_net *dev, uint64_t vva, uint64_t len)
> @@ -132 +133 @@
> -               VHOST_LOG_CONFIG("device", ERR, "(%d) device not found.\n", vid);
> +               VHOST_LOG_CONFIG(ERR,

I actually had to drop this as it doesn't build (forgot to drop this
and the revert)

^ permalink raw reply	[flat|nested] 144+ messages in thread

* Re: patch 'vhost: fix OOB access for invalid vhost ID' has been queued to stable release 20.11.8
  2023-03-16  9:27       ` Luca Boccassi
@ 2023-03-16  9:56         ` David Marchand
  2023-03-16 10:30           ` Kevin Traynor
  0 siblings, 1 reply; 144+ messages in thread
From: David Marchand @ 2023-03-16  9:56 UTC (permalink / raw)
  To: Luca Boccassi; +Cc: Maxime Coquelin, dpdk stable

On Thu, Mar 16, 2023 at 10:27 AM Luca Boccassi <luca.boccassi@gmail.com> wrote:
>
> On Wed, 15 Mar 2023 at 22:46, <luca.boccassi@gmail.com> wrote:
> >
> > Hi,
> >
> > FYI, your patch has been queued to stable release 20.11.8
> >
> > Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
> > It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable
> >
> > This queued commit can be viewed at:
> > https://github.com/bluca/dpdk-stable/commit/145ffdbb7ea750f4d3b17446bde22a805957ad71
> >
> > Thanks.
> >
> > Luca Boccassi
> >
> > ---
> > From 145ffdbb7ea750f4d3b17446bde22a805957ad71 Mon Sep 17 00:00:00 2001
> > From: David Marchand <david.marchand@redhat.com>
> > Date: Mon, 27 Feb 2023 11:59:27 +0100
> > Subject: [PATCH] vhost: fix OOB access for invalid vhost ID
> >
> > [ upstream commit 1c80a404fd82b816d5c3ebb7cd9e89804ac63984 ]
> >
> > The net/vhost pmd currently provides a -1 vid when disabling interrupt
> > after a virtio port got disconnected.
> >
> > This can be caught when running with ASan.
> >
> > First, start dpdk-l3fwd-power in interrupt mode with a net/vhost port.
> >
> > $ ./build-clang/examples/dpdk-l3fwd-power -l0,1 --in-memory \
> >         -a 0000:00:00.0 \
> >         --vdev net_vhost0,iface=plop.sock,client=1\
> >         -- \
> >         -p 0x1 \
> >         --interrupt-only \
> >         --config '(0,0,1)' \
> >         --parse-ptype 0
> >
> > Then start testpmd with virtio-user.
> >
> > $ ./build-clang/app/dpdk-testpmd -l0,2 --single-file-segment --in-memory \
> >         -a 0000:00:00.0 \
> >         --vdev net_virtio_user0,path=plop.sock,server=1 \
> >         -- \
> >         -i
> >
> > Finally stop testpmd.
> > ASan then splats in dpdk-l3fwd-power:
> >
> > =================================================================
> > ==3641005==ERROR: AddressSanitizer: global-buffer-overflow on address
> >         0x000005ed0778 at pc 0x000001270f81 bp 0x7fddbd2eee20
> >         sp 0x7fddbd2eee18
> > READ of size 8 at 0x000005ed0778 thread T2
> >     #0 0x1270f80 in get_device .../lib/vhost/vhost.h:801:27
> >     #1 0x1270f80 in rte_vhost_get_vhost_vring .../lib/vhost/vhost.c:951:8
> >     #2 0x3ac95cb in eth_rxq_intr_disable
> >         .../drivers/net/vhost/rte_eth_vhost.c:647:8
> >     #3 0x170e0bf in rte_eth_dev_rx_intr_disable
> >         .../lib/ethdev/rte_ethdev.c:5443:25
> >     #4 0xf72ba7 in turn_on_off_intr .../examples/l3fwd-power/main.c:881:4
> >     #5 0xf71045 in main_intr_loop .../examples/l3fwd-power/main.c:1061:6
> >     #6 0x17f9292 in eal_thread_loop
> >         .../lib/eal/common/eal_common_thread.c:210:9
> >     #7 0x18373f5 in eal_worker_thread_loop .../lib/eal/linux/eal.c:915:2
> >     #8 0x7fddc16ae12c in start_thread (/lib64/libc.so.6+0x8b12c)
> >         (BuildId: 81daba31ee66dbd63efdc4252a872949d874d136)
> >     #9 0x7fddc172fbbf in __GI___clone3 (/lib64/libc.so.6+0x10cbbf)
> >         (BuildId: 81daba31ee66dbd63efdc4252a872949d874d136)
> >
> > 0x000005ed0778 is located 8 bytes to the left of global variable
> >         'vhost_devices' defined in '.../lib/vhost/vhost.c:24'
> >         (0x5ed0780) of size 8192
> > 0x000005ed0778 is located 20 bytes to the right of global variable
> >         'vhost_config_log_level' defined in '.../lib/vhost/vhost.c:2174'
> >         (0x5ed0760) of size 4
> > SUMMARY: AddressSanitizer: global-buffer-overflow
> >         .../lib/vhost/vhost.h:801:27 in get_device
> > Shadow bytes around the buggy address:
> >   0x000080bd2090: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
> >   0x000080bd20a0: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
> >   0x000080bd20b0: f9 f9 f9 f9 00 f9 f9 f9 00 f9 f9 f9 00 f9 f9 f9
> >   0x000080bd20c0: 00 00 00 00 00 00 00 f9 f9 f9 f9 f9 04 f9 f9 f9
> >   0x000080bd20d0: 00 00 00 00 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 00
> > =>0x000080bd20e0: 00 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9 04 f9 f9[f9]
> >   0x000080bd20f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> >   0x000080bd2100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> >   0x000080bd2110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> >   0x000080bd2120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> >   0x000080bd2130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> > Shadow byte legend (one shadow byte represents 8 application bytes):
> >   Addressable:           00
> >   Partially addressable: 01 02 03 04 05 06 07
> >   Heap left redzone:       fa
> >   Freed heap region:       fd
> >   Stack left redzone:      f1
> >   Stack mid redzone:       f2
> >   Stack right redzone:     f3
> >   Stack after return:      f5
> >   Stack use after scope:   f8
> >   Global redzone:          f9
> >   Global init order:       f6
> >   Poisoned by user:        f7
> >   Container overflow:      fc
> >   Array cookie:            ac
> >   Intra object redzone:    bb
> >   ASan internal:           fe
> >   Left alloca redzone:     ca
> >   Right alloca redzone:    cb
> > Thread T2 created by T0 here:
> >     #0 0xe98996 in __interceptor_pthread_create
> >         (.examples/dpdk-l3fwd-power+0xe98996)
> >         (BuildId: d0b984a3b0287b9e0f301b73426fa921aeecca3a)
> >     #1 0x1836767 in eal_worker_thread_create .../lib/eal/linux/eal.c:952:6
> >     #2 0x1834b83 in rte_eal_init .../lib/eal/linux/eal.c:1257:9
> >     #3 0xf68902 in main .../examples/l3fwd-power/main.c:2496:8
> >     #4 0x7fddc164a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f)
> >         (BuildId: 81daba31ee66dbd63efdc4252a872949d874d136)
> >
> > ==3641005==ABORTING
> >
> > More generally, any application passing an incorrect vid would trigger
> > such an OOB access.
> >
> > Fixes: 4796ad63ba1f ("examples/vhost: import userspace vhost application")
> >
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
> > Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> > ---
> >  lib/librte_vhost/vhost.h | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
> > index 92b67a2c6f..ee4e5317d0 100644
> > --- a/lib/librte_vhost/vhost.h
> > +++ b/lib/librte_vhost/vhost.h
> > @@ -663,7 +663,10 @@ hva_to_gpa(struct virtio_net *dev, uint64_t vva, uint64_t len)
> >  static __rte_always_inline struct virtio_net *
> >  get_device(int vid)
> >  {
> > -       struct virtio_net *dev = vhost_devices[vid];
> > +       struct virtio_net *dev = NULL;
> > +
> > +       if (likely(vid >= 0 && vid < RTE_MAX_VHOST_DEVICE))
> > +               dev = vhost_devices[vid];
> >
> >         if (unlikely(!dev)) {
> >                 VHOST_LOG_CONFIG(ERR,
> > --
> > 2.39.2
> >
> > ---
> >   Diff of the applied patch vs upstream commit (please double-check if non-empty:
> > ---
> > --- -   2023-03-15 22:44:50.000737881 +0000
> > +++ 0006-vhost-fix-OOB-access-for-invalid-vhost-ID.patch        2023-03-15 22:44:49.507848667 +0000
> > @@ -1 +1 @@
> > -From 1c80a404fd82b816d5c3ebb7cd9e89804ac63984 Mon Sep 17 00:00:00 2001
> > +From 145ffdbb7ea750f4d3b17446bde22a805957ad71 Mon Sep 17 00:00:00 2001
> > @@ -5,0 +6,2 @@
> > +[ upstream commit 1c80a404fd82b816d5c3ebb7cd9e89804ac63984 ]
> > +
> > @@ -109 +110,0 @@
> > -Cc: stable@dpdk.org
> > @@ -114 +115 @@
> > - lib/vhost/vhost.h | 5 ++++-
> > + lib/librte_vhost/vhost.h | 5 ++++-
> > @@ -117,5 +118,5 @@
> > -diff --git a/lib/vhost/vhost.h b/lib/vhost/vhost.h
> > -index 5750f0c005..954c0ac197 100644
> > ---- a/lib/vhost/vhost.h
> > -+++ b/lib/vhost/vhost.h
> > -@@ -798,7 +798,10 @@ hva_to_gpa(struct virtio_net *dev, uint64_t vva, uint64_t len)
> > +diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
> > +index 92b67a2c6f..ee4e5317d0 100644
> > +--- a/lib/librte_vhost/vhost.h
> > ++++ b/lib/librte_vhost/vhost.h
> > +@@ -663,7 +663,10 @@ hva_to_gpa(struct virtio_net *dev, uint64_t vva, uint64_t len)
> > @@ -132 +133 @@
> > -               VHOST_LOG_CONFIG("device", ERR, "(%d) device not found.\n", vid);
> > +               VHOST_LOG_CONFIG(ERR,
>
> I actually had to drop this as it doesn't build (forgot to drop this
> and the revert)

MAX_VHOST_DEVICE has been renamed as RTE_MAX_VHOST_DEVICE.
So I guess the build issue comes from using RTE_MAX_VHOST_DEVICE.

Can you have a try?


-- 
David Marchand


^ permalink raw reply	[flat|nested] 144+ messages in thread

* Re: patch 'vhost: fix OOB access for invalid vhost ID' has been queued to stable release 20.11.8
  2023-03-16  9:56         ` David Marchand
@ 2023-03-16 10:30           ` Kevin Traynor
  2023-03-16 10:36             ` Luca Boccassi
  0 siblings, 1 reply; 144+ messages in thread
From: Kevin Traynor @ 2023-03-16 10:30 UTC (permalink / raw)
  To: David Marchand, Luca Boccassi; +Cc: Maxime Coquelin, dpdk stable

On 16/03/2023 09:56, David Marchand wrote:
> On Thu, Mar 16, 2023 at 10:27 AM Luca Boccassi <luca.boccassi@gmail.com> wrote:
>>
>> On Wed, 15 Mar 2023 at 22:46, <luca.boccassi@gmail.com> wrote:
>>>
>>> Hi,
>>>
>>> FYI, your patch has been queued to stable release 20.11.8
>>>
>>> Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
>>> It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable
>>>
>>> This queued commit can be viewed at:
>>> https://github.com/bluca/dpdk-stable/commit/145ffdbb7ea750f4d3b17446bde22a805957ad71
>>>
>>> Thanks.
>>>
>>> Luca Boccassi
>>>
>>> ---
>>>  From 145ffdbb7ea750f4d3b17446bde22a805957ad71 Mon Sep 17 00:00:00 2001
>>> From: David Marchand <david.marchand@redhat.com>
>>> Date: Mon, 27 Feb 2023 11:59:27 +0100
>>> Subject: [PATCH] vhost: fix OOB access for invalid vhost ID
>>>
>>> [ upstream commit 1c80a404fd82b816d5c3ebb7cd9e89804ac63984 ]
>>>
>>> The net/vhost pmd currently provides a -1 vid when disabling interrupt
>>> after a virtio port got disconnected.
>>>
>>> This can be caught when running with ASan.
>>>
>>> First, start dpdk-l3fwd-power in interrupt mode with a net/vhost port.
>>>
>>> $ ./build-clang/examples/dpdk-l3fwd-power -l0,1 --in-memory \
>>>          -a 0000:00:00.0 \
>>>          --vdev net_vhost0,iface=plop.sock,client=1\
>>>          -- \
>>>          -p 0x1 \
>>>          --interrupt-only \
>>>          --config '(0,0,1)' \
>>>          --parse-ptype 0
>>>
>>> Then start testpmd with virtio-user.
>>>
>>> $ ./build-clang/app/dpdk-testpmd -l0,2 --single-file-segment --in-memory \
>>>          -a 0000:00:00.0 \
>>>          --vdev net_virtio_user0,path=plop.sock,server=1 \
>>>          -- \
>>>          -i
>>>
>>> Finally stop testpmd.
>>> ASan then splats in dpdk-l3fwd-power:
>>>
>>> =================================================================
>>> ==3641005==ERROR: AddressSanitizer: global-buffer-overflow on address
>>>          0x000005ed0778 at pc 0x000001270f81 bp 0x7fddbd2eee20
>>>          sp 0x7fddbd2eee18
>>> READ of size 8 at 0x000005ed0778 thread T2
>>>      #0 0x1270f80 in get_device .../lib/vhost/vhost.h:801:27
>>>      #1 0x1270f80 in rte_vhost_get_vhost_vring .../lib/vhost/vhost.c:951:8
>>>      #2 0x3ac95cb in eth_rxq_intr_disable
>>>          .../drivers/net/vhost/rte_eth_vhost.c:647:8
>>>      #3 0x170e0bf in rte_eth_dev_rx_intr_disable
>>>          .../lib/ethdev/rte_ethdev.c:5443:25
>>>      #4 0xf72ba7 in turn_on_off_intr .../examples/l3fwd-power/main.c:881:4
>>>      #5 0xf71045 in main_intr_loop .../examples/l3fwd-power/main.c:1061:6
>>>      #6 0x17f9292 in eal_thread_loop
>>>          .../lib/eal/common/eal_common_thread.c:210:9
>>>      #7 0x18373f5 in eal_worker_thread_loop .../lib/eal/linux/eal.c:915:2
>>>      #8 0x7fddc16ae12c in start_thread (/lib64/libc.so.6+0x8b12c)
>>>          (BuildId: 81daba31ee66dbd63efdc4252a872949d874d136)
>>>      #9 0x7fddc172fbbf in __GI___clone3 (/lib64/libc.so.6+0x10cbbf)
>>>          (BuildId: 81daba31ee66dbd63efdc4252a872949d874d136)
>>>
>>> 0x000005ed0778 is located 8 bytes to the left of global variable
>>>          'vhost_devices' defined in '.../lib/vhost/vhost.c:24'
>>>          (0x5ed0780) of size 8192
>>> 0x000005ed0778 is located 20 bytes to the right of global variable
>>>          'vhost_config_log_level' defined in '.../lib/vhost/vhost.c:2174'
>>>          (0x5ed0760) of size 4
>>> SUMMARY: AddressSanitizer: global-buffer-overflow
>>>          .../lib/vhost/vhost.h:801:27 in get_device
>>> Shadow bytes around the buggy address:
>>>    0x000080bd2090: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
>>>    0x000080bd20a0: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
>>>    0x000080bd20b0: f9 f9 f9 f9 00 f9 f9 f9 00 f9 f9 f9 00 f9 f9 f9
>>>    0x000080bd20c0: 00 00 00 00 00 00 00 f9 f9 f9 f9 f9 04 f9 f9 f9
>>>    0x000080bd20d0: 00 00 00 00 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 00
>>> =>0x000080bd20e0: 00 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9 04 f9 f9[f9]
>>>    0x000080bd20f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>>>    0x000080bd2100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>>>    0x000080bd2110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>>>    0x000080bd2120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>>>    0x000080bd2130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>>> Shadow byte legend (one shadow byte represents 8 application bytes):
>>>    Addressable:           00
>>>    Partially addressable: 01 02 03 04 05 06 07
>>>    Heap left redzone:       fa
>>>    Freed heap region:       fd
>>>    Stack left redzone:      f1
>>>    Stack mid redzone:       f2
>>>    Stack right redzone:     f3
>>>    Stack after return:      f5
>>>    Stack use after scope:   f8
>>>    Global redzone:          f9
>>>    Global init order:       f6
>>>    Poisoned by user:        f7
>>>    Container overflow:      fc
>>>    Array cookie:            ac
>>>    Intra object redzone:    bb
>>>    ASan internal:           fe
>>>    Left alloca redzone:     ca
>>>    Right alloca redzone:    cb
>>> Thread T2 created by T0 here:
>>>      #0 0xe98996 in __interceptor_pthread_create
>>>          (.examples/dpdk-l3fwd-power+0xe98996)
>>>          (BuildId: d0b984a3b0287b9e0f301b73426fa921aeecca3a)
>>>      #1 0x1836767 in eal_worker_thread_create .../lib/eal/linux/eal.c:952:6
>>>      #2 0x1834b83 in rte_eal_init .../lib/eal/linux/eal.c:1257:9
>>>      #3 0xf68902 in main .../examples/l3fwd-power/main.c:2496:8
>>>      #4 0x7fddc164a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f)
>>>          (BuildId: 81daba31ee66dbd63efdc4252a872949d874d136)
>>>
>>> ==3641005==ABORTING
>>>
>>> More generally, any application passing an incorrect vid would trigger
>>> such an OOB access.
>>>
>>> Fixes: 4796ad63ba1f ("examples/vhost: import userspace vhost application")
>>>
>>> Signed-off-by: David Marchand <david.marchand@redhat.com>
>>> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
>>> ---
>>>   lib/librte_vhost/vhost.h | 5 ++++-
>>>   1 file changed, 4 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
>>> index 92b67a2c6f..ee4e5317d0 100644
>>> --- a/lib/librte_vhost/vhost.h
>>> +++ b/lib/librte_vhost/vhost.h
>>> @@ -663,7 +663,10 @@ hva_to_gpa(struct virtio_net *dev, uint64_t vva, uint64_t len)
>>>   static __rte_always_inline struct virtio_net *
>>>   get_device(int vid)
>>>   {
>>> -       struct virtio_net *dev = vhost_devices[vid];
>>> +       struct virtio_net *dev = NULL;
>>> +
>>> +       if (likely(vid >= 0 && vid < RTE_MAX_VHOST_DEVICE))
>>> +               dev = vhost_devices[vid];
>>>
>>>          if (unlikely(!dev)) {
>>>                  VHOST_LOG_CONFIG(ERR,
>>> --
>>> 2.39.2
>>>
>>> ---
>>>    Diff of the applied patch vs upstream commit (please double-check if non-empty:
>>> ---
>>> --- -   2023-03-15 22:44:50.000737881 +0000
>>> +++ 0006-vhost-fix-OOB-access-for-invalid-vhost-ID.patch        2023-03-15 22:44:49.507848667 +0000
>>> @@ -1 +1 @@
>>> -From 1c80a404fd82b816d5c3ebb7cd9e89804ac63984 Mon Sep 17 00:00:00 2001
>>> +From 145ffdbb7ea750f4d3b17446bde22a805957ad71 Mon Sep 17 00:00:00 2001
>>> @@ -5,0 +6,2 @@
>>> +[ upstream commit 1c80a404fd82b816d5c3ebb7cd9e89804ac63984 ]
>>> +
>>> @@ -109 +110,0 @@
>>> -Cc: stable@dpdk.org
>>> @@ -114 +115 @@
>>> - lib/vhost/vhost.h | 5 ++++-
>>> + lib/librte_vhost/vhost.h | 5 ++++-
>>> @@ -117,5 +118,5 @@
>>> -diff --git a/lib/vhost/vhost.h b/lib/vhost/vhost.h
>>> -index 5750f0c005..954c0ac197 100644
>>> ---- a/lib/vhost/vhost.h
>>> -+++ b/lib/vhost/vhost.h
>>> -@@ -798,7 +798,10 @@ hva_to_gpa(struct virtio_net *dev, uint64_t vva, uint64_t len)
>>> +diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
>>> +index 92b67a2c6f..ee4e5317d0 100644
>>> +--- a/lib/librte_vhost/vhost.h
>>> ++++ b/lib/librte_vhost/vhost.h
>>> +@@ -663,7 +663,10 @@ hva_to_gpa(struct virtio_net *dev, uint64_t vva, uint64_t len)
>>> @@ -132 +133 @@
>>> -               VHOST_LOG_CONFIG("device", ERR, "(%d) device not found.\n", vid);
>>> +               VHOST_LOG_CONFIG(ERR,
>>
>> I actually had to drop this as it doesn't build (forgot to drop this
>> and the revert)
> 
> MAX_VHOST_DEVICE has been renamed as RTE_MAX_VHOST_DEVICE.
> So I guess the build issue comes from using RTE_MAX_VHOST_DEVICE.
> 
> Can you have a try?
> 
> 

You can cherry-pick from 
https://git.dpdk.org/dpdk-stable/commit/?h=21.11-staging&id=7a4cda6e20f9a6e27b015aad864685440a70af84


^ permalink raw reply	[flat|nested] 144+ messages in thread

* Re: patch 'vhost: fix OOB access for invalid vhost ID' has been queued to stable release 20.11.8
  2023-03-16 10:30           ` Kevin Traynor
@ 2023-03-16 10:36             ` Luca Boccassi
  2023-03-16 10:50               ` David Marchand
  0 siblings, 1 reply; 144+ messages in thread
From: Luca Boccassi @ 2023-03-16 10:36 UTC (permalink / raw)
  To: Kevin Traynor; +Cc: David Marchand, Maxime Coquelin, dpdk stable

On Thu, 16 Mar 2023 at 10:30, Kevin Traynor <ktraynor@redhat.com> wrote:
>
> On 16/03/2023 09:56, David Marchand wrote:
> > On Thu, Mar 16, 2023 at 10:27 AM Luca Boccassi <luca.boccassi@gmail.com> wrote:
> >>
> >> On Wed, 15 Mar 2023 at 22:46, <luca.boccassi@gmail.com> wrote:
> >>>
> >>> Hi,
> >>>
> >>> FYI, your patch has been queued to stable release 20.11.8
> >>>
> >>> Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
> >>> It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable
> >>>
> >>> This queued commit can be viewed at:
> >>> https://github.com/bluca/dpdk-stable/commit/145ffdbb7ea750f4d3b17446bde22a805957ad71
> >>>
> >>> Thanks.
> >>>
> >>> Luca Boccassi
> >>>
> >>> ---
> >>>  From 145ffdbb7ea750f4d3b17446bde22a805957ad71 Mon Sep 17 00:00:00 2001
> >>> From: David Marchand <david.marchand@redhat.com>
> >>> Date: Mon, 27 Feb 2023 11:59:27 +0100
> >>> Subject: [PATCH] vhost: fix OOB access for invalid vhost ID
> >>>
> >>> [ upstream commit 1c80a404fd82b816d5c3ebb7cd9e89804ac63984 ]
> >>>
> >>> The net/vhost pmd currently provides a -1 vid when disabling interrupt
> >>> after a virtio port got disconnected.
> >>>
> >>> This can be caught when running with ASan.
> >>>
> >>> First, start dpdk-l3fwd-power in interrupt mode with a net/vhost port.
> >>>
> >>> $ ./build-clang/examples/dpdk-l3fwd-power -l0,1 --in-memory \
> >>>          -a 0000:00:00.0 \
> >>>          --vdev net_vhost0,iface=plop.sock,client=1\
> >>>          -- \
> >>>          -p 0x1 \
> >>>          --interrupt-only \
> >>>          --config '(0,0,1)' \
> >>>          --parse-ptype 0
> >>>
> >>> Then start testpmd with virtio-user.
> >>>
> >>> $ ./build-clang/app/dpdk-testpmd -l0,2 --single-file-segment --in-memory \
> >>>          -a 0000:00:00.0 \
> >>>          --vdev net_virtio_user0,path=plop.sock,server=1 \
> >>>          -- \
> >>>          -i
> >>>
> >>> Finally stop testpmd.
> >>> ASan then splats in dpdk-l3fwd-power:
> >>>
> >>> =================================================================
> >>> ==3641005==ERROR: AddressSanitizer: global-buffer-overflow on address
> >>>          0x000005ed0778 at pc 0x000001270f81 bp 0x7fddbd2eee20
> >>>          sp 0x7fddbd2eee18
> >>> READ of size 8 at 0x000005ed0778 thread T2
> >>>      #0 0x1270f80 in get_device .../lib/vhost/vhost.h:801:27
> >>>      #1 0x1270f80 in rte_vhost_get_vhost_vring .../lib/vhost/vhost.c:951:8
> >>>      #2 0x3ac95cb in eth_rxq_intr_disable
> >>>          .../drivers/net/vhost/rte_eth_vhost.c:647:8
> >>>      #3 0x170e0bf in rte_eth_dev_rx_intr_disable
> >>>          .../lib/ethdev/rte_ethdev.c:5443:25
> >>>      #4 0xf72ba7 in turn_on_off_intr .../examples/l3fwd-power/main.c:881:4
> >>>      #5 0xf71045 in main_intr_loop .../examples/l3fwd-power/main.c:1061:6
> >>>      #6 0x17f9292 in eal_thread_loop
> >>>          .../lib/eal/common/eal_common_thread.c:210:9
> >>>      #7 0x18373f5 in eal_worker_thread_loop .../lib/eal/linux/eal.c:915:2
> >>>      #8 0x7fddc16ae12c in start_thread (/lib64/libc.so.6+0x8b12c)
> >>>          (BuildId: 81daba31ee66dbd63efdc4252a872949d874d136)
> >>>      #9 0x7fddc172fbbf in __GI___clone3 (/lib64/libc.so.6+0x10cbbf)
> >>>          (BuildId: 81daba31ee66dbd63efdc4252a872949d874d136)
> >>>
> >>> 0x000005ed0778 is located 8 bytes to the left of global variable
> >>>          'vhost_devices' defined in '.../lib/vhost/vhost.c:24'
> >>>          (0x5ed0780) of size 8192
> >>> 0x000005ed0778 is located 20 bytes to the right of global variable
> >>>          'vhost_config_log_level' defined in '.../lib/vhost/vhost.c:2174'
> >>>          (0x5ed0760) of size 4
> >>> SUMMARY: AddressSanitizer: global-buffer-overflow
> >>>          .../lib/vhost/vhost.h:801:27 in get_device
> >>> Shadow bytes around the buggy address:
> >>>    0x000080bd2090: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
> >>>    0x000080bd20a0: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
> >>>    0x000080bd20b0: f9 f9 f9 f9 00 f9 f9 f9 00 f9 f9 f9 00 f9 f9 f9
> >>>    0x000080bd20c0: 00 00 00 00 00 00 00 f9 f9 f9 f9 f9 04 f9 f9 f9
> >>>    0x000080bd20d0: 00 00 00 00 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 00
> >>> =>0x000080bd20e0: 00 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9 04 f9 f9[f9]
> >>>    0x000080bd20f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> >>>    0x000080bd2100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> >>>    0x000080bd2110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> >>>    0x000080bd2120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> >>>    0x000080bd2130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> >>> Shadow byte legend (one shadow byte represents 8 application bytes):
> >>>    Addressable:           00
> >>>    Partially addressable: 01 02 03 04 05 06 07
> >>>    Heap left redzone:       fa
> >>>    Freed heap region:       fd
> >>>    Stack left redzone:      f1
> >>>    Stack mid redzone:       f2
> >>>    Stack right redzone:     f3
> >>>    Stack after return:      f5
> >>>    Stack use after scope:   f8
> >>>    Global redzone:          f9
> >>>    Global init order:       f6
> >>>    Poisoned by user:        f7
> >>>    Container overflow:      fc
> >>>    Array cookie:            ac
> >>>    Intra object redzone:    bb
> >>>    ASan internal:           fe
> >>>    Left alloca redzone:     ca
> >>>    Right alloca redzone:    cb
> >>> Thread T2 created by T0 here:
> >>>      #0 0xe98996 in __interceptor_pthread_create
> >>>          (.examples/dpdk-l3fwd-power+0xe98996)
> >>>          (BuildId: d0b984a3b0287b9e0f301b73426fa921aeecca3a)
> >>>      #1 0x1836767 in eal_worker_thread_create .../lib/eal/linux/eal.c:952:6
> >>>      #2 0x1834b83 in rte_eal_init .../lib/eal/linux/eal.c:1257:9
> >>>      #3 0xf68902 in main .../examples/l3fwd-power/main.c:2496:8
> >>>      #4 0x7fddc164a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f)
> >>>          (BuildId: 81daba31ee66dbd63efdc4252a872949d874d136)
> >>>
> >>> ==3641005==ABORTING
> >>>
> >>> More generally, any application passing an incorrect vid would trigger
> >>> such an OOB access.
> >>>
> >>> Fixes: 4796ad63ba1f ("examples/vhost: import userspace vhost application")
> >>>
> >>> Signed-off-by: David Marchand <david.marchand@redhat.com>
> >>> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> >>> ---
> >>>   lib/librte_vhost/vhost.h | 5 ++++-
> >>>   1 file changed, 4 insertions(+), 1 deletion(-)
> >>>
> >>> diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
> >>> index 92b67a2c6f..ee4e5317d0 100644
> >>> --- a/lib/librte_vhost/vhost.h
> >>> +++ b/lib/librte_vhost/vhost.h
> >>> @@ -663,7 +663,10 @@ hva_to_gpa(struct virtio_net *dev, uint64_t vva, uint64_t len)
> >>>   static __rte_always_inline struct virtio_net *
> >>>   get_device(int vid)
> >>>   {
> >>> -       struct virtio_net *dev = vhost_devices[vid];
> >>> +       struct virtio_net *dev = NULL;
> >>> +
> >>> +       if (likely(vid >= 0 && vid < RTE_MAX_VHOST_DEVICE))
> >>> +               dev = vhost_devices[vid];
> >>>
> >>>          if (unlikely(!dev)) {
> >>>                  VHOST_LOG_CONFIG(ERR,
> >>> --
> >>> 2.39.2
> >>>
> >>> ---
> >>>    Diff of the applied patch vs upstream commit (please double-check if non-empty:
> >>> ---
> >>> --- -   2023-03-15 22:44:50.000737881 +0000
> >>> +++ 0006-vhost-fix-OOB-access-for-invalid-vhost-ID.patch        2023-03-15 22:44:49.507848667 +0000
> >>> @@ -1 +1 @@
> >>> -From 1c80a404fd82b816d5c3ebb7cd9e89804ac63984 Mon Sep 17 00:00:00 2001
> >>> +From 145ffdbb7ea750f4d3b17446bde22a805957ad71 Mon Sep 17 00:00:00 2001
> >>> @@ -5,0 +6,2 @@
> >>> +[ upstream commit 1c80a404fd82b816d5c3ebb7cd9e89804ac63984 ]
> >>> +
> >>> @@ -109 +110,0 @@
> >>> -Cc: stable@dpdk.org
> >>> @@ -114 +115 @@
> >>> - lib/vhost/vhost.h | 5 ++++-
> >>> + lib/librte_vhost/vhost.h | 5 ++++-
> >>> @@ -117,5 +118,5 @@
> >>> -diff --git a/lib/vhost/vhost.h b/lib/vhost/vhost.h
> >>> -index 5750f0c005..954c0ac197 100644
> >>> ---- a/lib/vhost/vhost.h
> >>> -+++ b/lib/vhost/vhost.h
> >>> -@@ -798,7 +798,10 @@ hva_to_gpa(struct virtio_net *dev, uint64_t vva, uint64_t len)
> >>> +diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
> >>> +index 92b67a2c6f..ee4e5317d0 100644
> >>> +--- a/lib/librte_vhost/vhost.h
> >>> ++++ b/lib/librte_vhost/vhost.h
> >>> +@@ -663,7 +663,10 @@ hva_to_gpa(struct virtio_net *dev, uint64_t vva, uint64_t len)
> >>> @@ -132 +133 @@
> >>> -               VHOST_LOG_CONFIG("device", ERR, "(%d) device not found.\n", vid);
> >>> +               VHOST_LOG_CONFIG(ERR,
> >>
> >> I actually had to drop this as it doesn't build (forgot to drop this
> >> and the revert)
> >
> > MAX_VHOST_DEVICE has been renamed as RTE_MAX_VHOST_DEVICE.
> > So I guess the build issue comes from using RTE_MAX_VHOST_DEVICE.
> >
> > Can you have a try?
> >
> >
>
> You can cherry-pick from
> https://git.dpdk.org/dpdk-stable/commit/?h=21.11-staging&id=7a4cda6e20f9a6e27b015aad864685440a70af84

Thanks, this works, I was dead sure I had checked if there was a
simple rename, probably fat-fingered it.

^ permalink raw reply	[flat|nested] 144+ messages in thread

* Re: patch 'vhost: fix OOB access for invalid vhost ID' has been queued to stable release 20.11.8
  2023-03-16 10:36             ` Luca Boccassi
@ 2023-03-16 10:50               ` David Marchand
  0 siblings, 0 replies; 144+ messages in thread
From: David Marchand @ 2023-03-16 10:50 UTC (permalink / raw)
  To: Luca Boccassi; +Cc: Kevin Traynor, Maxime Coquelin, dpdk stable

On Thu, Mar 16, 2023 at 11:36 AM Luca Boccassi <luca.boccassi@gmail.com> wrote:
> > > MAX_VHOST_DEVICE has been renamed as RTE_MAX_VHOST_DEVICE.
> > > So I guess the build issue comes from using RTE_MAX_VHOST_DEVICE.
> > >
> > > Can you have a try?
> > >
> > >
> >
> > You can cherry-pick from
> > https://git.dpdk.org/dpdk-stable/commit/?h=21.11-staging&id=7a4cda6e20f9a6e27b015aad864685440a70af84
>
> Thanks, this works, I was dead sure I had checked if there was a
> simple rename, probably fat-fingered it.
>

Cool that it works.

This rename is not easy to spot.. it is hidden as part of a feature
see 53d3f4778c1d ("vhost: integrate dmadev in asynchronous
data-path").


-- 
David Marchand


^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'raw/skeleton: fix selftest' has been queued to stable release 20.11.8
  2023-03-15 22:46     ` patch 'app/flow-perf: fix division or module by zero' " luca.boccassi
@ 2023-03-22  0:41       ` luca.boccassi
  2023-03-22  0:41         ` patch 'ring: silence GCC 12 warnings' " luca.boccassi
                           ` (17 more replies)
  0 siblings, 18 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-22  0:41 UTC (permalink / raw)
  To: David Marchand; +Cc: Yu Jiang, Hemant Agrawal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/23/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/7a7e6c5bb80b87768e0d18d9da2c5bc30fb6f9b5

Thanks.

Luca Boccassi

---
From 7a7e6c5bb80b87768e0d18d9da2c5bc30fb6f9b5 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Fri, 10 Mar 2023 15:26:03 +0100
Subject: [PATCH] raw/skeleton: fix selftest

[ upstream commit 365ec3c4fe599048c67cc79817ae9dfa090753cc ]

ASan reported issues in this driver.

rte_rawdev_obj_t context object points at a uint16_t.
skeleton_rawdev_enqueue_bufs() and skeleton_rawdev_dequeue_bufs() were
incorrectly casting to an int.

The enqueue/dequeue selftest had a leak on the enqueued string and was
wrong in passing a rte_rawdev_buf pointer array.
Fix this by allocating buffers on the stack and check that returned
string is the expected one.

Bugzilla ID: 999
Fixes: 61c592a8d035 ("raw/skeleton: introduce skeleton rawdev driver")
Fixes: 55ca1b0f2151 ("raw/skeleton: add test cases")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Tested-by:  Yu Jiang <yux.jiang@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/raw/skeleton/skeleton_rawdev.c      |  4 +-
 drivers/raw/skeleton/skeleton_rawdev_test.c | 46 +++++++++------------
 2 files changed, 21 insertions(+), 29 deletions(-)

diff --git a/drivers/raw/skeleton/skeleton_rawdev.c b/drivers/raw/skeleton/skeleton_rawdev.c
index ebb9075dd9..11d0beefbd 100644
--- a/drivers/raw/skeleton/skeleton_rawdev.c
+++ b/drivers/raw/skeleton/skeleton_rawdev.c
@@ -421,7 +421,7 @@ static int skeleton_rawdev_enqueue_bufs(struct rte_rawdev *dev,
 	 * help in complex implementation which require more information than
 	 * just an integer - for example, a queue-pair.
 	 */
-	q_id = *((int *)context);
+	q_id = *((uint16_t *)context);
 
 	for (i = 0; i < count; i++)
 		queue_buf[q_id].bufs[i] = buffers[i]->buf_addr;
@@ -443,7 +443,7 @@ static int skeleton_rawdev_dequeue_bufs(struct rte_rawdev *dev,
 	 * help in complex implementation which require more information than
 	 * just an integer - for example, a queue-pair.
 	 */
-	q_id = *((int *)context);
+	q_id = *((uint16_t *)context);
 
 	for (i = 0; i < count; i++)
 		buffers[i]->buf_addr = queue_buf[q_id].bufs[i];
diff --git a/drivers/raw/skeleton/skeleton_rawdev_test.c b/drivers/raw/skeleton/skeleton_rawdev_test.c
index 484468eeb4..cad05ed60f 100644
--- a/drivers/raw/skeleton/skeleton_rawdev_test.c
+++ b/drivers/raw/skeleton/skeleton_rawdev_test.c
@@ -368,42 +368,34 @@ static int
 test_rawdev_enqdeq(void)
 {
 	int ret;
-	unsigned int count = 1;
 	uint16_t queue_id = 0;
-	struct rte_rawdev_buf buffers[1];
-	struct rte_rawdev_buf *deq_buffers = NULL;
+	struct rte_rawdev_buf buffer;
+	struct rte_rawdev_buf *buffers[1];
+	struct rte_rawdev_buf deq_buffer;
+	struct rte_rawdev_buf *deq_buffers[1];
 
-	buffers[0].buf_addr = malloc(strlen(TEST_DEV_NAME) + 3);
-	if (!buffers[0].buf_addr)
-		goto cleanup;
-	snprintf(buffers[0].buf_addr, strlen(TEST_DEV_NAME) + 2, "%s%d",
+	buffers[0] = &buffer;
+	buffer.buf_addr = malloc(strlen(TEST_DEV_NAME) + 3);
+	if (!buffer.buf_addr)
+		return TEST_FAILED;
+	snprintf(buffer.buf_addr, strlen(TEST_DEV_NAME) + 2, "%s%d",
 		 TEST_DEV_NAME, 0);
 
-	ret = rte_rawdev_enqueue_buffers(test_dev_id,
-					 (struct rte_rawdev_buf **)&buffers,
-					 count, &queue_id);
-	RTE_TEST_ASSERT_EQUAL((unsigned int)ret, count,
+	ret = rte_rawdev_enqueue_buffers(test_dev_id, buffers,
+					 RTE_DIM(buffers), &queue_id);
+	RTE_TEST_ASSERT_EQUAL((unsigned int)ret, RTE_DIM(buffers),
 			      "Unable to enqueue buffers");
 
-	deq_buffers = malloc(sizeof(struct rte_rawdev_buf) * count);
-	if (!deq_buffers)
-		goto cleanup;
-
-	ret = rte_rawdev_dequeue_buffers(test_dev_id,
-					(struct rte_rawdev_buf **)&deq_buffers,
-					count, &queue_id);
-	RTE_TEST_ASSERT_EQUAL((unsigned int)ret, count,
+	deq_buffers[0] = &deq_buffer;
+	ret = rte_rawdev_dequeue_buffers(test_dev_id, deq_buffers,
+					RTE_DIM(deq_buffers), &queue_id);
+	RTE_TEST_ASSERT_EQUAL((unsigned int)ret, RTE_DIM(buffers),
 			      "Unable to dequeue buffers");
+	RTE_TEST_ASSERT_EQUAL(deq_buffers[0]->buf_addr, buffers[0]->buf_addr,
+			      "Did not retrieve expected object");
 
-	if (deq_buffers)
-		free(deq_buffers);
-
+	free(buffer.buf_addr);
 	return TEST_SUCCESS;
-cleanup:
-	if (buffers[0].buf_addr)
-		free(buffers[0].buf_addr);
-
-	return TEST_FAILED;
 }
 
 static void skeldev_test_run(int (*setup)(void),
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-21 21:56:37.117329432 +0000
+++ 0001-raw-skeleton-fix-selftest.patch	2023-03-21 21:56:37.004805629 +0000
@@ -1 +1 @@
-From 365ec3c4fe599048c67cc79817ae9dfa090753cc Mon Sep 17 00:00:00 2001
+From 7a7e6c5bb80b87768e0d18d9da2c5bc30fb6f9b5 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 365ec3c4fe599048c67cc79817ae9dfa090753cc ]
+
@@ -20 +21,0 @@
-Cc: stable@dpdk.org
@@ -27,2 +28,2 @@
- drivers/raw/skeleton/skeleton_rawdev_test.c | 44 +++++++++------------
- 2 files changed, 21 insertions(+), 27 deletions(-)
+ drivers/raw/skeleton/skeleton_rawdev_test.c | 46 +++++++++------------
+ 2 files changed, 21 insertions(+), 29 deletions(-)
@@ -31 +32 @@
-index 53fe49f936..6e99d35536 100644
+index ebb9075dd9..11d0beefbd 100644
@@ -34 +35 @@
-@@ -428,7 +428,7 @@ static int skeleton_rawdev_enqueue_bufs(struct rte_rawdev *dev,
+@@ -421,7 +421,7 @@ static int skeleton_rawdev_enqueue_bufs(struct rte_rawdev *dev,
@@ -43 +44 @@
-@@ -450,7 +450,7 @@ static int skeleton_rawdev_dequeue_bufs(struct rte_rawdev *dev,
+@@ -443,7 +443,7 @@ static int skeleton_rawdev_dequeue_bufs(struct rte_rawdev *dev,
@@ -53 +54 @@
-index ca15c49990..b7a7f623aa 100644
+index 484468eeb4..cad05ed60f 100644
@@ -56 +57 @@
-@@ -370,40 +370,34 @@ static int
+@@ -368,42 +368,34 @@ static int
@@ -105 +106,2 @@
--	free(deq_buffers);
+-	if (deq_buffers)
+-		free(deq_buffers);
@@ -110 +112,2 @@
--	free(buffers[0].buf_addr);
+-	if (buffers[0].buf_addr)
+-		free(buffers[0].buf_addr);

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'ring: silence GCC 12 warnings' has been queued to stable release 20.11.8
  2023-03-22  0:41       ` patch 'raw/skeleton: fix selftest' " luca.boccassi
@ 2023-03-22  0:41         ` luca.boccassi
  2023-03-22  0:41         ` patch 'reorder: fix sequence number mbuf field register' " luca.boccassi
                           ` (16 subsequent siblings)
  17 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-22  0:41 UTC (permalink / raw)
  To: Kevin Traynor; +Cc: David Marchand, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/23/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/9bbcaea1b25828632afe2bb44d1f3a565e00d8dc

Thanks.

Luca Boccassi

---
From 9bbcaea1b25828632afe2bb44d1f3a565e00d8dc Mon Sep 17 00:00:00 2001
From: Kevin Traynor <ktraynor@redhat.com>
Date: Tue, 20 Dec 2022 10:52:17 +0000
Subject: [PATCH] ring: silence GCC 12 warnings
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit dea4c5415506b3c1996cc56dcf15ffb5f6f1d49c ]

gcc 12.2.1 on Fedora 37 is giving stringop-overread and stringop-overflow
warnings when compiled with --buildtype=debug e.g. [1].

They look similar to the overflow issues previously squashed in rte_memcpy
commit b5b3ea803e47 ("eal/x86: ignore gcc 10 stringop-overflow warnings").

Squash these warnings, waiting for a cleaner fix.

[1]
lib/ring/rte_ring_elem_pvt.h:100:25: error:
	‘memcpy’ reading 32 bytes from a region of size 4
	[-Werror=stringop-overread]
100 |               memcpy((void *)(ring + idx),
    |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
101 |                       (const void *)(obj + i), 32);
    |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

lib/ring/rte_ring_elem_pvt.h:234:25: error:
	‘memcpy’ writing 32 bytes into a region of size 4
	overflows the destination [-Werror=stringop-overflow=]
234 |               memcpy((void *)(obj + i), (void *)(ring + idx), 32);
    |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/librte_ring/rte_ring_elem.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/librte_ring/rte_ring_elem.h b/lib/librte_ring/rte_ring_elem.h
index b79ba5cb7f..0685969d14 100644
--- a/lib/librte_ring/rte_ring_elem.h
+++ b/lib/librte_ring/rte_ring_elem.h
@@ -104,6 +104,12 @@ ssize_t rte_ring_get_memsize_elem(unsigned int esize, unsigned int count);
 struct rte_ring *rte_ring_create_elem(const char *name, unsigned int esize,
 			unsigned int count, int socket_id, unsigned int flags);
 
+#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 120000)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-overflow"
+#pragma GCC diagnostic ignored "-Wstringop-overread"
+#endif
+
 static __rte_always_inline void
 __rte_ring_enqueue_elems_32(struct rte_ring *r, const uint32_t size,
 		uint32_t idx, const void *obj_table, uint32_t n)
@@ -1076,6 +1082,10 @@ rte_ring_dequeue_burst_elem(struct rte_ring *r, void *obj_table,
 	return 0;
 }
 
+#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 120000)
+#pragma GCC diagnostic pop
+#endif
+
 #ifdef ALLOW_EXPERIMENTAL_API
 #include <rte_ring_peek.h>
 #include <rte_ring_peek_zc.h>
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-21 21:56:37.147319081 +0000
+++ 0002-ring-silence-GCC-12-warnings.patch	2023-03-21 21:56:37.004805629 +0000
@@ -1 +1 @@
-From dea4c5415506b3c1996cc56dcf15ffb5f6f1d49c Mon Sep 17 00:00:00 2001
+From 9bbcaea1b25828632afe2bb44d1f3a565e00d8dc Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit dea4c5415506b3c1996cc56dcf15ffb5f6f1d49c ]
+
@@ -32,2 +33,0 @@
-Cc: stable@dpdk.org
-
@@ -37 +37 @@
- lib/ring/rte_ring_elem_pvt.h | 10 ++++++++++
+ lib/librte_ring/rte_ring_elem.h | 10 ++++++++++
@@ -40,7 +40,7 @@
-diff --git a/lib/ring/rte_ring_elem_pvt.h b/lib/ring/rte_ring_elem_pvt.h
-index 83788c56e6..e24e4492ff 100644
---- a/lib/ring/rte_ring_elem_pvt.h
-+++ b/lib/ring/rte_ring_elem_pvt.h
-@@ -10,6 +10,12 @@
- #ifndef _RTE_RING_ELEM_PVT_H_
- #define _RTE_RING_ELEM_PVT_H_
+diff --git a/lib/librte_ring/rte_ring_elem.h b/lib/librte_ring/rte_ring_elem.h
+index b79ba5cb7f..0685969d14 100644
+--- a/lib/librte_ring/rte_ring_elem.h
++++ b/lib/librte_ring/rte_ring_elem.h
+@@ -104,6 +104,12 @@ ssize_t rte_ring_get_memsize_elem(unsigned int esize, unsigned int count);
+ struct rte_ring *rte_ring_create_elem(const char *name, unsigned int esize,
+ 			unsigned int count, int socket_id, unsigned int flags);
@@ -57,2 +57,2 @@
-@@ -382,4 +388,8 @@ end:
- 	return n;
+@@ -1076,6 +1082,10 @@ rte_ring_dequeue_burst_elem(struct rte_ring *r, void *obj_table,
+ 	return 0;
@@ -65 +65,3 @@
- #endif /* _RTE_RING_ELEM_PVT_H_ */
+ #ifdef ALLOW_EXPERIMENTAL_API
+ #include <rte_ring_peek.h>
+ #include <rte_ring_peek_zc.h>

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'reorder: fix sequence number mbuf field register' has been queued to stable release 20.11.8
  2023-03-22  0:41       ` patch 'raw/skeleton: fix selftest' " luca.boccassi
  2023-03-22  0:41         ` patch 'ring: silence GCC 12 warnings' " luca.boccassi
@ 2023-03-22  0:41         ` luca.boccassi
  2023-03-22  0:41         ` patch 'test: fix segment length in packet generator' " luca.boccassi
                           ` (15 subsequent siblings)
  17 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-22  0:41 UTC (permalink / raw)
  To: Volodymyr Fialko; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/23/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From fca297ca06833f852cf1880a2147daa6cdd59a8f Mon Sep 17 00:00:00 2001
From: Volodymyr Fialko <vfialko@marvell.com>
Date: Mon, 13 Mar 2023 14:04:28 +0100
Subject: [PATCH] reorder: fix sequence number mbuf field register

[ upstream commit ec87595f4de01cb81878874d209fa03e6963b3e4 ]

It's possible to initialize reorder buffer with user allocated memory via
rte_reorder_init() function. In such case, rte_reorder_create() is not
required and reorder dynamic field in rte_mbuf will not be registered.

Both reorder lib and mbuf dynamic field are using `rte_mcfg_tailq`
read/write lock for synchronization. To avoid deadlocking, move reorder
buffer initialization before queue insertion.

Fixes: 01f3496695b5 ("reorder: switch sequence number to dynamic mbuf field")

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
---
 lib/librte_reorder/rte_reorder.c | 95 ++++++++++++++++++++------------
 lib/librte_reorder/rte_reorder.h |  1 +
 2 files changed, 62 insertions(+), 34 deletions(-)

diff --git a/lib/librte_reorder/rte_reorder.c b/lib/librte_reorder/rte_reorder.c
index a5b9663aa5..5d4fab17ff 100644
--- a/lib/librte_reorder/rte_reorder.c
+++ b/lib/librte_reorder/rte_reorder.c
@@ -61,6 +61,11 @@ rte_reorder_init(struct rte_reorder_buffer *b, unsigned int bufsize,
 {
 	const unsigned int min_bufsize = sizeof(*b) +
 					(2 * size * sizeof(struct rte_mbuf *));
+	static const struct rte_mbuf_dynfield reorder_seqn_dynfield_desc = {
+		.name = RTE_REORDER_SEQN_DYNFIELD_NAME,
+		.size = sizeof(rte_reorder_seqn_t),
+		.align = __alignof__(rte_reorder_seqn_t),
+	};
 
 	if (b == NULL) {
 		RTE_LOG(ERR, REORDER, "Invalid reorder buffer parameter:"
@@ -87,6 +92,15 @@ rte_reorder_init(struct rte_reorder_buffer *b, unsigned int bufsize,
 		return NULL;
 	}
 
+	rte_reorder_seqn_dynfield_offset = rte_mbuf_dynfield_register(&reorder_seqn_dynfield_desc);
+	if (rte_reorder_seqn_dynfield_offset < 0) {
+		RTE_LOG(ERR, REORDER,
+			"Failed to register mbuf field for reorder sequence number, rte_errno: %i\n",
+			rte_errno);
+		rte_errno = ENOMEM;
+		return NULL;
+	}
+
 	memset(b, 0, bufsize);
 	strlcpy(b->name, name, sizeof(b->name));
 	b->memsize = bufsize;
@@ -99,21 +113,45 @@ rte_reorder_init(struct rte_reorder_buffer *b, unsigned int bufsize,
 	return b;
 }
 
+/*
+ * Insert new entry into global list.
+ * Returns pointer to already inserted entry if such exists, or to newly inserted one.
+ */
+static struct rte_tailq_entry *
+rte_reorder_entry_insert(struct rte_tailq_entry *new_te)
+{
+	struct rte_reorder_list *reorder_list;
+	struct rte_reorder_buffer *b, *nb;
+	struct rte_tailq_entry *te;
+
+	rte_mcfg_tailq_write_lock();
+
+	reorder_list = RTE_TAILQ_CAST(rte_reorder_tailq.head, rte_reorder_list);
+	/* guarantee there's no existing */
+	TAILQ_FOREACH(te, reorder_list, next) {
+		b = (struct rte_reorder_buffer *) te->data;
+		nb = (struct rte_reorder_buffer *) new_te->data;
+		if (strncmp(nb->name, b->name, RTE_REORDER_NAMESIZE) == 0)
+			break;
+	}
+
+	if (te == NULL) {
+		TAILQ_INSERT_TAIL(reorder_list, new_te, next);
+		te = new_te;
+	}
+
+	rte_mcfg_tailq_write_unlock();
+
+	return te;
+}
+
 struct rte_reorder_buffer*
 rte_reorder_create(const char *name, unsigned socket_id, unsigned int size)
 {
 	struct rte_reorder_buffer *b = NULL;
-	struct rte_tailq_entry *te;
-	struct rte_reorder_list *reorder_list;
+	struct rte_tailq_entry *te, *te_inserted;
 	const unsigned int bufsize = sizeof(struct rte_reorder_buffer) +
 					(2 * size * sizeof(struct rte_mbuf *));
-	static const struct rte_mbuf_dynfield reorder_seqn_dynfield_desc = {
-		.name = RTE_REORDER_SEQN_DYNFIELD_NAME,
-		.size = sizeof(rte_reorder_seqn_t),
-		.align = __alignof__(rte_reorder_seqn_t),
-	};
-
-	reorder_list = RTE_TAILQ_CAST(rte_reorder_tailq.head, rte_reorder_list);
 
 	/* Check user arguments. */
 	if (!rte_is_power_of_2(size)) {
@@ -129,32 +167,12 @@ rte_reorder_create(const char *name, unsigned socket_id, unsigned int size)
 		return NULL;
 	}
 
-	rte_reorder_seqn_dynfield_offset =
-		rte_mbuf_dynfield_register(&reorder_seqn_dynfield_desc);
-	if (rte_reorder_seqn_dynfield_offset < 0) {
-		RTE_LOG(ERR, REORDER, "Failed to register mbuf field for reorder sequence number\n");
-		rte_errno = ENOMEM;
-		return NULL;
-	}
-
-	rte_mcfg_tailq_write_lock();
-
-	/* guarantee there's no existing */
-	TAILQ_FOREACH(te, reorder_list, next) {
-		b = (struct rte_reorder_buffer *) te->data;
-		if (strncmp(name, b->name, RTE_REORDER_NAMESIZE) == 0)
-			break;
-	}
-	if (te != NULL)
-		goto exit;
-
 	/* allocate tailq entry */
 	te = rte_zmalloc("REORDER_TAILQ_ENTRY", sizeof(*te), 0);
 	if (te == NULL) {
 		RTE_LOG(ERR, REORDER, "Failed to allocate tailq entry\n");
 		rte_errno = ENOMEM;
-		b = NULL;
-		goto exit;
+		return NULL;
 	}
 
 	/* Allocate memory to store the reorder buffer structure. */
@@ -163,14 +181,23 @@ rte_reorder_create(const char *name, unsigned socket_id, unsigned int size)
 		RTE_LOG(ERR, REORDER, "Memzone allocation failed\n");
 		rte_errno = ENOMEM;
 		rte_free(te);
+		return NULL;
 	} else {
-		rte_reorder_init(b, bufsize, name, size);
+		if (rte_reorder_init(b, bufsize, name, size) == NULL) {
+			rte_free(b);
+			rte_free(te);
+			return NULL;
+		}
 		te->data = (void *)b;
-		TAILQ_INSERT_TAIL(reorder_list, te, next);
 	}
 
-exit:
-	rte_mcfg_tailq_write_unlock();
+	te_inserted = rte_reorder_entry_insert(te);
+	if (te_inserted != te) {
+		rte_free(b);
+		rte_free(te);
+		return te_inserted->data;
+	}
+
 	return b;
 }
 
diff --git a/lib/librte_reorder/rte_reorder.h b/lib/librte_reorder/rte_reorder.h
index 9de0240374..4d4ea31e41 100644
--- a/lib/librte_reorder/rte_reorder.h
+++ b/lib/librte_reorder/rte_reorder.h
@@ -81,6 +81,7 @@ rte_reorder_create(const char *name, unsigned socket_id, unsigned int size);
  *   The initialized reorder buffer instance, or NULL on error
  *   On error case, rte_errno will be set appropriately:
  *    - EINVAL - invalid parameters
+ *    - ENOMEM - not enough memory to register dynamic field
  */
 struct rte_reorder_buffer *
 rte_reorder_init(struct rte_reorder_buffer *b, unsigned int bufsize,
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-21 21:56:37.182035599 +0000
+++ 0003-reorder-fix-sequence-number-mbuf-field-register.patch	2023-03-21 21:56:37.008805712 +0000
@@ -1 +1 @@
-From ec87595f4de01cb81878874d209fa03e6963b3e4 Mon Sep 17 00:00:00 2001
+From fca297ca06833f852cf1880a2147daa6cdd59a8f Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit ec87595f4de01cb81878874d209fa03e6963b3e4 ]
+
@@ -15 +16,0 @@
-Cc: stable@dpdk.org
@@ -19,2 +20,2 @@
- lib/reorder/rte_reorder.c | 95 +++++++++++++++++++++++++--------------
- lib/reorder/rte_reorder.h |  1 +
+ lib/librte_reorder/rte_reorder.c | 95 ++++++++++++++++++++------------
+ lib/librte_reorder/rte_reorder.h |  1 +
@@ -23,4 +24,4 @@
-diff --git a/lib/reorder/rte_reorder.c b/lib/reorder/rte_reorder.c
-index 9026403ea6..4bf36f6df6 100644
---- a/lib/reorder/rte_reorder.c
-+++ b/lib/reorder/rte_reorder.c
+diff --git a/lib/librte_reorder/rte_reorder.c b/lib/librte_reorder/rte_reorder.c
+index a5b9663aa5..5d4fab17ff 100644
+--- a/lib/librte_reorder/rte_reorder.c
++++ b/lib/librte_reorder/rte_reorder.c
@@ -172,5 +173,5 @@
-diff --git a/lib/reorder/rte_reorder.h b/lib/reorder/rte_reorder.h
-index 7ed5f66a2e..f1207f72a9 100644
---- a/lib/reorder/rte_reorder.h
-+++ b/lib/reorder/rte_reorder.h
-@@ -82,6 +82,7 @@ rte_reorder_create(const char *name, unsigned socket_id, unsigned int size);
+diff --git a/lib/librte_reorder/rte_reorder.h b/lib/librte_reorder/rte_reorder.h
+index 9de0240374..4d4ea31e41 100644
+--- a/lib/librte_reorder/rte_reorder.h
++++ b/lib/librte_reorder/rte_reorder.h
+@@ -81,6 +81,7 @@ rte_reorder_create(const char *name, unsigned socket_id, unsigned int size);

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'test: fix segment length in packet generator' has been queued to stable release 20.11.8
  2023-03-22  0:41       ` patch 'raw/skeleton: fix selftest' " luca.boccassi
  2023-03-22  0:41         ` patch 'ring: silence GCC 12 warnings' " luca.boccassi
  2023-03-22  0:41         ` patch 'reorder: fix sequence number mbuf field register' " luca.boccassi
@ 2023-03-22  0:41         ` luca.boccassi
  2023-03-22  0:41         ` patch 'test/mbuf: fix test with mbuf debug enabled' " luca.boccassi
                           ` (14 subsequent siblings)
  17 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-22  0:41 UTC (permalink / raw)
  To: Zhuobin Huang; +Cc: David Marchand, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/23/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/5e6d899166d0e85d3111f2c51b7c542dc93b1b88

Thanks.

Luca Boccassi

---
From 5e6d899166d0e85d3111f2c51b7c542dc93b1b88 Mon Sep 17 00:00:00 2001
From: Zhuobin Huang <zobin1999@gmail.com>
Date: Mon, 6 Mar 2023 14:51:56 +0800
Subject: [PATCH] test: fix segment length in packet generator

[ upstream commit b88b8af25e7cbb267584bd4c36d3615c4b20109f ]

Assign correct data length to each segments according to the given
pkt_len and nb_pkt_segs, instead of using pkt_len as the data_len
of every packet segment.

Fixes: a9c9e9698d5e ("app/test: allow to create packets of different sizes")

Signed-off-by: Zhuobin Huang <zobin1999@gmail.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
---
 app/test/packet_burst_generator.c | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/app/test/packet_burst_generator.c b/app/test/packet_burst_generator.c
index 0fd7290b0e..121eaf4da6 100644
--- a/app/test/packet_burst_generator.c
+++ b/app/test/packet_burst_generator.c
@@ -262,11 +262,11 @@ generate_packet_burst(struct rte_mempool *mp, struct rte_mbuf **pkts_burst,
 		void *ip_hdr, uint8_t ipv4, struct rte_udp_hdr *udp_hdr,
 		int nb_pkt_per_burst, uint8_t pkt_len, uint8_t nb_pkt_segs)
 {
-	int i, nb_pkt = 0;
-	size_t eth_hdr_size;
-
+	const uint8_t pkt_seg_data_len = pkt_len / nb_pkt_segs;
 	struct rte_mbuf *pkt_seg;
 	struct rte_mbuf *pkt;
+	size_t eth_hdr_size;
+	int i, nb_pkt = 0;
 
 	for (nb_pkt = 0; nb_pkt < nb_pkt_per_burst; nb_pkt++) {
 		pkt = rte_pktmbuf_alloc(mp);
@@ -277,7 +277,7 @@ nomore_mbuf:
 			break;
 		}
 
-		pkt->data_len = pkt_len;
+		pkt->data_len = pkt_seg_data_len;
 		pkt_seg = pkt;
 		for (i = 1; i < nb_pkt_segs; i++) {
 			pkt_seg->next = rte_pktmbuf_alloc(mp);
@@ -287,7 +287,10 @@ nomore_mbuf:
 				goto nomore_mbuf;
 			}
 			pkt_seg = pkt_seg->next;
-			pkt_seg->data_len = pkt_len;
+			if (i != nb_pkt_segs - 1)
+				pkt_seg->data_len = pkt_seg_data_len;
+			else
+				pkt_seg->data_len = pkt_seg_data_len + pkt_len % nb_pkt_segs;
 		}
 		pkt_seg->next = NULL; /* Last segment of packet. */
 
@@ -343,11 +346,11 @@ generate_packet_burst_proto(struct rte_mempool *mp,
 		uint8_t ipv4, uint8_t proto, void *proto_hdr,
 		int nb_pkt_per_burst, uint8_t pkt_len, uint8_t nb_pkt_segs)
 {
-	int i, nb_pkt = 0;
-	size_t eth_hdr_size;
-
+	const uint8_t pkt_seg_data_len = pkt_len / nb_pkt_segs;
 	struct rte_mbuf *pkt_seg;
 	struct rte_mbuf *pkt;
+	size_t eth_hdr_size;
+	int i, nb_pkt = 0;
 
 	for (nb_pkt = 0; nb_pkt < nb_pkt_per_burst; nb_pkt++) {
 		pkt = rte_pktmbuf_alloc(mp);
@@ -358,7 +361,7 @@ nomore_mbuf:
 			break;
 		}
 
-		pkt->data_len = pkt_len;
+		pkt->data_len = pkt_seg_data_len;
 		pkt_seg = pkt;
 		for (i = 1; i < nb_pkt_segs; i++) {
 			pkt_seg->next = rte_pktmbuf_alloc(mp);
@@ -368,7 +371,10 @@ nomore_mbuf:
 				goto nomore_mbuf;
 			}
 			pkt_seg = pkt_seg->next;
-			pkt_seg->data_len = pkt_len;
+			if (i != nb_pkt_segs - 1)
+				pkt_seg->data_len = pkt_seg_data_len;
+			else
+				pkt_seg->data_len = pkt_seg_data_len + pkt_len % nb_pkt_segs;
 		}
 		pkt_seg->next = NULL; /* Last segment of packet. */
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-21 21:56:37.217270782 +0000
+++ 0004-test-fix-segment-length-in-packet-generator.patch	2023-03-21 21:56:37.008805712 +0000
@@ -1 +1 @@
-From b88b8af25e7cbb267584bd4c36d3615c4b20109f Mon Sep 17 00:00:00 2001
+From 5e6d899166d0e85d3111f2c51b7c542dc93b1b88 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b88b8af25e7cbb267584bd4c36d3615c4b20109f ]
+
@@ -15 +16,0 @@
- .mailmap                          |  1 +
@@ -17 +18 @@
- 2 files changed, 17 insertions(+), 10 deletions(-)
+ 1 file changed, 16 insertions(+), 10 deletions(-)
@@ -19,12 +19,0 @@
-diff --git a/.mailmap b/.mailmap
-index 4018f0fc47..6a56239c3a 100644
---- a/.mailmap
-+++ b/.mailmap
-@@ -1584,6 +1584,7 @@ Zhipeng Lu <luzhipeng@cestc.cn>
- Zhirun Yan <zhirun.yan@intel.com>
- Zhiwei He <zhiwei.he@intel.com>
- Zhiyong Yang <zhiyong.yang@intel.com>
-+Zhuobin Huang <zobin1999@gmail.com>
- Zi Hu <huzilucky@gmail.com>
- Zijie Pan <zijie.pan@6wind.com>
- Ziyang Xuan <xuanziyang2@huawei.com>
@@ -32 +21 @@
-index 6b42b9b83b..867a88da00 100644
+index 0fd7290b0e..121eaf4da6 100644
@@ -35 +24 @@
-@@ -263,11 +263,11 @@ generate_packet_burst(struct rte_mempool *mp, struct rte_mbuf **pkts_burst,
+@@ -262,11 +262,11 @@ generate_packet_burst(struct rte_mempool *mp, struct rte_mbuf **pkts_burst,
@@ -50 +39 @@
-@@ -278,7 +278,7 @@ nomore_mbuf:
+@@ -277,7 +277,7 @@ nomore_mbuf:
@@ -59 +48 @@
-@@ -288,7 +288,10 @@ nomore_mbuf:
+@@ -287,7 +287,10 @@ nomore_mbuf:
@@ -71 +60 @@
-@@ -344,11 +347,11 @@ generate_packet_burst_proto(struct rte_mempool *mp,
+@@ -343,11 +346,11 @@ generate_packet_burst_proto(struct rte_mempool *mp,
@@ -86 +75 @@
-@@ -359,7 +362,7 @@ nomore_mbuf:
+@@ -358,7 +361,7 @@ nomore_mbuf:
@@ -95 +84 @@
-@@ -369,7 +372,10 @@ nomore_mbuf:
+@@ -368,7 +371,10 @@ nomore_mbuf:

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'test/mbuf: fix test with mbuf debug enabled' has been queued to stable release 20.11.8
  2023-03-22  0:41       ` patch 'raw/skeleton: fix selftest' " luca.boccassi
                           ` (2 preceding siblings ...)
  2023-03-22  0:41         ` patch 'test: fix segment length in packet generator' " luca.boccassi
@ 2023-03-22  0:41         ` luca.boccassi
  2023-03-22  0:41         ` patch 'app/testpmd: cleanup cleanly from signal' " luca.boccassi
                           ` (13 subsequent siblings)
  17 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-22  0:41 UTC (permalink / raw)
  To: Pavel Ivashchenko; +Cc: Olivier Matz, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/23/23. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
From b32127e63c8add92b7685f44de81818d9514f08b Mon Sep 17 00:00:00 2001
From: Pavel Ivashchenko <pivashchenko@nfware.com>
Date: Thu, 16 Mar 2023 22:14:56 +0300
Subject: [PATCH] test/mbuf: fix test with mbuf debug enabled

[ upstream commit ce5440e0350df101443aa4d0e96bea0a06ef9364 ]

How to reproduce:

1. Define RTE_LIBRTE_MBUF_DEBUG
2. MALLOC_PERTURB_=178 DPDK_TEST=mbuf_autotest gdb --args
	obj-x86_64-linux-gnu/app/test/dpdk-test
	--file-prefix=mbuf_autotest

   PANIC in rte_mbuf_sanity_check():
   bad pkt_len

   ...
   #6  0x00007ffff7d3d4cc in rte_mbuf_sanity_check
	(m=m@entry=0x17f8c3400, is_header=is_header@entry=1)
	at ../lib/mbuf/rte_mbuf.c:384
   #7  0x0000555555653d57 in rte_pktmbuf_free (m=0x17f8c3400)
	at ../lib/mbuf/rte_mbuf.h:1385
   #8  0x000055555565c7a6 in test_nb_segs_and_next_reset ()
	at ../app/test/test_mbuf.c:2752
   #9  test_mbuf () at ../app/test/test_mbuf.c:2967
   ...

   (gdb) frame 6
   #6  0x00007ffff7d3d4cc in rte_mbuf_sanity_check
	(m=m@entry=0x17f8c3400, is_header=is_header@entry=1)
	at ../lib/mbuf/rte_mbuf.c:384
   384			rte_panic("%s\n", reason);
   (gdb) p/d m->pkt_len
   $4 = 1500

Fixes: efc6f9104c80 ("mbuf: fix reset on mbuf free")

Signed-off-by: Pavel Ivashchenko <pivashchenko@nfware.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---
 app/test/test_mbuf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
index 8f6abf5875..9f851da162 100644
--- a/app/test/test_mbuf.c
+++ b/app/test/test_mbuf.c
@@ -2744,6 +2744,7 @@ test_nb_segs_and_next_reset(void)
 
 	/* split m0 chain in two, between m1 and m2 */
 	m0->nb_segs = 2;
+	m0->pkt_len -= m2->data_len;
 	m1->next = NULL;
 	m2->nb_segs = 1;
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-21 21:56:37.254078678 +0000
+++ 0005-test-mbuf-fix-test-with-mbuf-debug-enabled.patch	2023-03-21 21:56:37.012805796 +0000
@@ -1 +1 @@
-From ce5440e0350df101443aa4d0e96bea0a06ef9364 Mon Sep 17 00:00:00 2001
+From b32127e63c8add92b7685f44de81818d9514f08b Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit ce5440e0350df101443aa4d0e96bea0a06ef9364 ]
+
@@ -36 +37,0 @@
-Cc: stable@dpdk.org
@@ -45 +46 @@
-index 81a6632d11..8d8d3b9386 100644
+index 8f6abf5875..9f851da162 100644

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'app/testpmd: cleanup cleanly from signal' has been queued to stable release 20.11.8
  2023-03-22  0:41       ` patch 'raw/skeleton: fix selftest' " luca.boccassi
                           ` (3 preceding siblings ...)
  2023-03-22  0:41         ` patch 'test/mbuf: fix test with mbuf debug enabled' " luca.boccassi
@ 2023-03-22  0:41         ` luca.boccassi
  2023-03-22  0:41         ` patch 'app/testpmd: fix interactive mode on Windows' " luca.boccassi
                           ` (12 subsequent siblings)
  17 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-22  0:41 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/23/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/288b168640441ac2662abc069b462e73db8c59a7

Thanks.

Luca Boccassi

---
From 288b168640441ac2662abc069b462e73db8c59a7 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Fri, 3 Feb 2023 11:14:09 -0800
Subject: [PATCH] app/testpmd: cleanup cleanly from signal

[ upstream commit 0fd1386c30c3ad9365d7fdd2829bf7cb2e1b9dff ]

Do a clean shutdown of testpmd when a signal is received; instead of
having testpmd kill itself.  This fixes the problem where a signal could
be received in the middle of a PMD and then the signal handler would
call PMD's close routine leading to locking problems.

The cmdline structure no longer needs to be global it can
just be local to the prompt() function.

An added benefit is it gets rid of some Windows specific code.

Fixes: d9a191a00e81 ("app/testpmd: fix quitting in container")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 app/test-pmd/cmdline.c | 30 +++++++----------
 app/test-pmd/testpmd.c | 75 ++++++++++++++++++++----------------------
 app/test-pmd/testpmd.h |  1 +
 3 files changed, 48 insertions(+), 58 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 9f46570cc4..8a7300bcf9 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -71,8 +71,6 @@
 #include "cmdline_tm.h"
 #include "bpf_cmd.h"
 
-static struct cmdline *testpmd_cl;
-
 static void cmd_reconfig_device_queue(portid_t id, uint8_t dev, uint8_t queue);
 
 /* *** Help command with introduction. *** */
@@ -17199,31 +17197,25 @@ cmdline_read_from_file(const char *filename)
 void
 prompt(void)
 {
-	int ret;
+	struct cmdline *cl;
 	/* initialize non-constant commands */
 	cmd_set_fwd_mode_init();
 	cmd_set_fwd_retry_mode_init();
 
-	testpmd_cl = cmdline_stdin_new(main_ctx, "testpmd> ");
-	if (testpmd_cl == NULL)
+	cl = cmdline_stdin_new(main_ctx, "testpmd> ");
+	if (cl == NULL)
 		return;
 
-	ret = atexit(prompt_exit);
-	if (ret != 0)
-		printf("Cannot set exit function for cmdline\n");
+	/* loop until signal or quit command */
+	while (f_quit == 0 && cl_quit == 0) {
+		int status = cmdline_poll(cl);
 
-	cmdline_interact(testpmd_cl);
-	if (ret != 0)
-		cmdline_stdin_exit(testpmd_cl);
-}
-
-void
-prompt_exit(void)
-{
-	if (testpmd_cl != NULL) {
-		cmdline_quit(testpmd_cl);
-		cmdline_stdin_exit(testpmd_cl);
+		if (status < 0 || status == RDLINE_EXITED)
+			break;
 	}
+
+	cmdline_quit(cl);
+	cmdline_stdin_exit(cl);
 }
 
 static void
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index f22c05920f..a061e10385 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -10,6 +10,7 @@
 #include <time.h>
 #include <fcntl.h>
 #include <sys/mman.h>
+#include <sys/select.h>
 #include <sys/types.h>
 #include <errno.h>
 #include <stdbool.h>
@@ -216,7 +217,7 @@ uint16_t stats_period; /**< Period to show statistics (disabled by default) */
  * In container, it cannot terminate the process which running with 'stats-period'
  * option. Set flag to exit stats period loop after received SIGINT/SIGTERM.
  */
-static volatile uint8_t f_quit;
+volatile uint8_t f_quit;
 uint8_t cl_quit; /* Quit testpmd from cmdline. */
 
 /*
@@ -3826,13 +3827,6 @@ init_port(void)
 	memset(txring_numa, NUMA_NO_CONFIG, RTE_MAX_ETHPORTS);
 }
 
-static void
-force_quit(void)
-{
-	pmd_test_exit();
-	prompt_exit();
-}
-
 static void
 print_stats(void)
 {
@@ -3851,26 +3845,9 @@ print_stats(void)
 }
 
 static void
-signal_handler(int signum)
+signal_handler(int signum __rte_unused)
 {
-	if (signum == SIGINT || signum == SIGTERM) {
-		printf("\nSignal %d received, preparing to exit...\n",
-				signum);
-#ifdef RTE_LIB_PDUMP
-		/* uninitialize packet capture framework */
-		rte_pdump_uninit();
-#endif
-#ifdef RTE_LIB_LATENCYSTATS
-		if (latencystats_enabled != 0)
-			rte_latencystats_uninit();
-#endif
-		force_quit();
-		/* Set flag to indicate the force termination. */
-		f_quit = 1;
-		/* exit with the expected status */
-		signal(signum, SIG_DFL);
-		kill(getpid(), signum);
-	}
+	f_quit = 1;
 }
 
 int
@@ -4044,15 +4021,9 @@ main(int argc, char** argv)
 			start_packet_forwarding(0);
 		}
 		prompt();
-		pmd_test_exit();
 	} else
 #endif
 	{
-		char c;
-		int rc;
-
-		f_quit = 0;
-
 		printf("No commandline core given, start packet forwarding\n");
 		start_packet_forwarding(tx_first);
 		if (stats_period != 0) {
@@ -4075,15 +4046,41 @@ main(int argc, char** argv)
 				prev_time = cur_time;
 				sleep(1);
 			}
+		} else {
+			char c;
+			fd_set fds;
+
+			printf("Press enter to exit\n");
+
+			FD_ZERO(&fds);
+			FD_SET(0, &fds);
+
+			/* wait for signal or enter */
+			ret = select(1, &fds, NULL, NULL, NULL);
+			if (ret < 0 && errno != EINTR)
+				rte_exit(EXIT_FAILURE,
+					 "Select failed: %s\n",
+					 strerror(errno));
+
+			/* if got enter then consume it */
+			if (ret == 1 && read(0, &c, 1) < 0)
+				rte_exit(EXIT_FAILURE,
+					 "Read failed: %s\n",
+					 strerror(errno));
 		}
-
-		printf("Press enter to exit\n");
-		rc = read(0, &c, 1);
-		pmd_test_exit();
-		if (rc < 0)
-			return 1;
 	}
 
+	pmd_test_exit();
+
+#ifdef RTE_LIB_PDUMP
+	/* uninitialize packet capture framework */
+	rte_pdump_uninit();
+#endif
+#ifdef RTE_LIB_LATENCYSTATS
+	if (latencystats_enabled != 0)
+		rte_latencystats_uninit();
+#endif
+
 	ret = rte_eal_cleanup();
 	if (ret != 0)
 		rte_exit(EXIT_FAILURE,
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 76c2c55981..4ca1d59f09 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -25,6 +25,7 @@
 #define RTE_PORT_HANDLING       (uint16_t)3
 
 extern uint8_t cl_quit;
+extern volatile uint8_t f_quit;
 
 /*
  * It is used to allocate the memory for hash key.
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-21 21:56:37.291492843 +0000
+++ 0006-app-testpmd-cleanup-cleanly-from-signal.patch	2023-03-21 21:56:37.036806297 +0000
@@ -1 +1 @@
-From 0fd1386c30c3ad9365d7fdd2829bf7cb2e1b9dff Mon Sep 17 00:00:00 2001
+From 288b168640441ac2662abc069b462e73db8c59a7 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 0fd1386c30c3ad9365d7fdd2829bf7cb2e1b9dff ]
+
@@ -17 +18,0 @@
-Cc: stable@dpdk.org
@@ -22,2 +23,2 @@
- app/test-pmd/cmdline.c | 29 ++++++----------
- app/test-pmd/testpmd.c | 77 ++++++++++++++++++++----------------------
+ app/test-pmd/cmdline.c | 30 +++++++----------
+ app/test-pmd/testpmd.c | 75 ++++++++++++++++++++----------------------
@@ -25 +26 @@
- 3 files changed, 48 insertions(+), 59 deletions(-)
+ 3 files changed, 48 insertions(+), 58 deletions(-)
@@ -28 +29 @@
-index 02c72d06b7..6fa870dc32 100644
+index 9f46570cc4..8a7300bcf9 100644
@@ -31 +32 @@
-@@ -66,7 +66,6 @@
+@@ -71,8 +71,6 @@
@@ -36,4 +37,5 @@
- static cmdline_parse_ctx_t *main_ctx;
- static TAILQ_HEAD(, testpmd_driver_commands) driver_commands_head =
- 	TAILQ_HEAD_INITIALIZER(driver_commands_head);
-@@ -13033,28 +13032,22 @@ cmdline_read_from_file(const char *filename)
+-
+ static void cmd_reconfig_device_queue(portid_t id, uint8_t dev, uint8_t queue);
+ 
+ /* *** Help command with introduction. *** */
+@@ -17199,31 +17197,25 @@ cmdline_read_from_file(const char *filename)
@@ -44,0 +47,3 @@
+ 	/* initialize non-constant commands */
+ 	cmd_set_fwd_mode_init();
+ 	cmd_set_fwd_retry_mode_init();
@@ -54 +59 @@
--		fprintf(stderr, "Cannot set exit function for cmdline\n");
+-		printf("Cannot set exit function for cmdline\n");
@@ -78 +83 @@
- void
+ static void
@@ -80 +85 @@
-index 0032696608..2ce19ed47a 100644
+index f22c05920f..a061e10385 100644
@@ -83 +88,2 @@
-@@ -11,6 +11,7 @@
+@@ -10,6 +10,7 @@
+ #include <time.h>
@@ -85 +90,0 @@
- #ifndef RTE_EXEC_ENV_WINDOWS
@@ -88 +92,0 @@
- #endif
@@ -91 +95,2 @@
-@@ -231,7 +232,7 @@ unsigned int xstats_display_num; /**< Size of extended statistics to show */
+ #include <stdbool.h>
+@@ -216,7 +217,7 @@ uint16_t stats_period; /**< Period to show statistics (disabled by default) */
@@ -100 +105 @@
-@@ -4447,13 +4448,6 @@ init_port(void)
+@@ -3826,13 +3827,6 @@ init_port(void)
@@ -114 +119 @@
-@@ -4472,28 +4466,9 @@ print_stats(void)
+@@ -3851,26 +3845,9 @@ print_stats(void)
@@ -122,2 +127,2 @@
--		fprintf(stderr, "\nSignal %d received, preparing to exit...\n",
--			signum);
+-		printf("\nSignal %d received, preparing to exit...\n",
+-				signum);
@@ -136 +140,0 @@
--#ifndef RTE_EXEC_ENV_WINDOWS
@@ -139 +142,0 @@
--#endif
@@ -145 +148 @@
-@@ -4677,15 +4652,9 @@ main(int argc, char** argv)
+@@ -4044,15 +4021,9 @@ main(int argc, char** argv)
@@ -161 +164 @@
-@@ -4708,15 +4677,41 @@ main(int argc, char** argv)
+@@ -4075,15 +4046,41 @@ main(int argc, char** argv)
@@ -163 +166 @@
- 				rte_delay_us_sleep(US_PER_S);
+ 				sleep(1);
@@ -210 +213 @@
-index b9215720b6..bdfbfd36d3 100644
+index 76c2c55981..4ca1d59f09 100644
@@ -213 +216 @@
-@@ -34,6 +34,7 @@
+@@ -25,6 +25,7 @@

^ permalink raw reply	[flat|nested] 144+ messages in thread

* patch 'app/testpmd: fix interactive mode on Windows' has been queued to stable release 20.11.8
  2023-03-22  0:41       ` patch 'raw/skeleton: fix selftest' " luca.boccassi
                           ` (4 preceding siblings ...)
  2023-03-22  0:41         ` patch 'app/testpmd: cleanup cleanly from signal' " luca.boccassi
@ 2023-03-22  0:41         ` luca.boccassi
  2023-03-22  0:41         ` patch 'app/compress-perf: fix remaining data for ops' " luca.boccassi
                           ` (11 subsequent siblings)
  17 siblings, 0 replies; 144+ messages in thread
From: luca.boccassi @ 2023-03-22  0:41 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Olivier Matz, dpdk stable

Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/23/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/4451959edc6959c1bfbac4f1aa8195eacdcae649

Thanks.

Luca Boccassi

---
From 4451959edc6959c1bfbac4f1aa8195eacdcae649 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Fri, 17 Mar 2023 09:59:41 -0700
Subject: [PATCH] app/testpmd: fix interactive mode on Windows

[ upstream commit f1d0993e034e39968a2c80a8561b46c260c27487 ]

The cmdline_poll() function is broken and was not fully tested,
go back to using cmdline_interact().

Instead, use sigaction() to cancel read character on Unix OS's
and a new helper to cancel I/O on Windows.

Bugzilla ID: 1180
Fixes: 0fd1386c30c3 ("app/testpmd: cleanup cleanly from signal")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---
 app/test-pmd/cmdline.c                  | 26 ++++++++++++-------------
 app/test-pmd/testpmd.c                  | 11 +++++++++++
 lib/librte_cmdline/cmdline.c            |  1 +
 lib/librte_cmdline/cmdline_os_unix.c    |  6 ++++++
 lib/librte_cmdline/cmdline_os_windows.c | 14 +++++++++++++
 lib/librte_cmdline/cmdline_private.h    |  3 +++
 6 files changed, 48 insertions(+), 13 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 8a7300bcf9..422db4f6bc 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -72,6 +72,7 @@
 #include "bpf_cmd.h"
 
 static void cmd_reconfig_device_queue(portid_t id, uint8_t dev, uint8_t queue);
+static struct cmdline *testpmd_cl;
 
 /* *** Help command with introduction. *** */
 struct cmd_help_brief_result {
@@ -17193,29 +17194,28 @@ cmdline_read_from_file(const char *filename)
 	printf("Read CLI commands from %s\n", filename);
 }
 
+void
+prompt_exit(void)
+{
+	cmdline_quit(testpmd_cl);
+}
+
 /* prompt function, called from main on MAIN lcore */
 void
 prompt(void)
 {
-	struct cmdline *cl;
-	/* initialize non-constant commands */
 	cmd_set_fwd_mode_init();
 	cmd_set_fwd_retry_mode_init();
 
-	cl = cmdline_stdin_new(main_ctx, "testpmd> ");
-	if (cl == NULL)
+	testpmd_cl = cmdline_stdin_new(main_ctx, "testpmd> ");
+	if (testpmd_cl == NULL) {
+		fprintf(stderr,
+			"Failed to create stdin based cmdline context\n");
 		return;
-
-	/* loop until signal or quit command */
-	while (f_quit == 0 && cl_quit == 0) {
-		int status = cmdline_poll(cl);
-
-		if (status < 0 || status == RDLINE_EXITED)
-			break;
 	}
 
-	cmdline_quit(cl);
-	cmdline_stdin_exit(cl);
+	cmdline_interact(testpmd_cl);
+	cmdline_stdin_exit(testpmd_cl);
 }
 
 static void
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index a061e10385..568b9f7390 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -3848,6 +3848,7 @@ static void
 signal_handler(int signum __rte_unused)
 {
 	f_quit = 1;
+	prompt_exit();
 }
 
 int
@@ -3858,8 +3859,18 @@ main(int argc, char** argv)
 	uint16_t count;
 	int ret;
 
+#ifdef RTE_EXEC_ENV_WINDOWS
 	signal(SIGINT, signal_handler);
 	signal(SIGTERM, signal_handler);
+#else
+	/* Want read() not to be restarted on signal */
+	struct sigaction action = {
+		.sa_handler = signal_handler,
+	};
+
+	sigaction(SIGINT, &action, NULL);
+	sigaction(SIGTERM, &action, NULL);
+#endif
 
 	testpmd_logtype = rte_log_register("testpmd");
 	if (testpmd_logtype < 0)
diff --git a/lib/librte_cmdline/cmdline.c b/lib/librte_cmdline/cmdline.c
index 478bcfb161..713e39d9c3 100644
--- a/lib/librte_cmdline/cmdline.c
+++ b/lib/librte_cmdline/cmdline.c
@@ -181,6 +181,7 @@ cmdline_quit(struct cmdline *cl)
 {
 	if (!cl)
 		return;
+	cmdline_cancel(cl);
 	rdline_quit(&cl->rdl);
 }
 
diff --git a/lib/librte_cmdline/cmdline_os_unix.c b/lib/librte_cmdline/cmdline_os_unix.c
index 64a945a34f..9a4ec4e334 100644
--- a/lib/librte_cmdline/cmdline_os_unix.c
+++ b/lib/librte_cmdline/cmdline_os_unix.c
@@ -51,3 +51,9 @@ cmdline_vdprintf(int fd, const char *format, va_list op)
 {
 	return vdprintf(fd, format, op);
 }
+
+/* This function is not needed on Linux, instead use sigaction() */
+void
+cmdline_cancel(__rte_unused struct cmdline *cl)
+{
+}
diff --git a/lib/librte_cmdline/cmdline_os_windows.c b/lib/librte_cmdline/cmdline_os_windows.c
index e9585c9eea..80b2cbec98 100644
--- a/lib/librte_cmdline/cmdline_os_windows.c
+++ b/lib/librte_cmdline/cmdline_os_windows.c
@@ -205,3 +205,17 @@ cmdline_vdprintf(int fd, const char *format, va_list op)
 
 	return ret;
 }
+
+void
+cmdline_cancel(struct cmdline *cl)
+{
+	if (!cl)
+		return;
+
+	/* force the outstanding read on console to exit */
+	if (cl->oldterm.is_console_input) {
+		HANDLE handle = (HANDLE)_get_osfhandle(cl->s_in);
+
+		CancelIoEx(handle, NULL);
+	}
+}
diff --git a/lib/librte_cmdline/cmdline_private.h b/lib/librte_cmdline/cmdline_private.h
index a8a6ee9e69..1951286533 100644
--- a/lib/librte_cmdline/cmdline_private.h
+++ b/lib/librte_cmdline/cmdline_private.h
@@ -46,6 +46,9 @@ int cmdline_poll_char(struct cmdline *cl);
 /* Read one character from input. */
 ssize_t cmdline_read_char(struct cmdline *cl, char *c);
 
+/* Force current cmdline read to unblock. */
+void cmdline_cancel(struct cmdline *cl);
+
 /* vdprintf(3) */
 __rte_format_printf(2, 0)
 int cmdline_vdprintf(int fd, const char *format, va_list op);
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-21 21:56:37.339601531 +0000
+++ 0007-app-testpmd-fix-interactive-mode-on-Windows.patch	2023-03-21 21:56:37.056806715 +0000
@@ -1 +1 @@
-From f1d0993e034e39968a2c80a8561b46c260c27487 Mon Sep 17 00:00:00 2001
+From 4451959edc6959c1bfbac4f1aa8195eacdcae649 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit f1d0993e034e39968a2c80a8561b46c260c27487 ]
+
@@ -14 +15,0 @@
-Cc: stable@dpdk.org
@@ -19,7 +20,7 @@
- app/test-pmd/cmdline.c           | 26 +++++++++++++-------------
- app/test-pmd/testpmd.c           | 11 +++++++++++
- lib/cmdline/cmdline.c            |  1 +
- lib/cmdline/cmdline_os_unix.c    |  6 ++++++
- lib/cmdline/cmdline_os_windows.c | 14 ++++++++++++++
- lib/cmdline/cmdline_private.h    |  5 ++++-
- 6 files changed, 49 insertions(+), 14 deletions(-)
+ app/test-pmd/cmdline.c                  | 26 ++++++++++++-------------
+ app/test-pmd/testpmd.c                  | 11 +++++++++++
+ lib/librte_cmdline/cmdline.c            |  1 +
+ lib/librte_cmdline/cmdline_os_unix.c    |  6 ++++++
+ lib/librte_cmdline/cmdline_os_windows.c | 14 +++++++++++++
+ lib/librte_cmdline/cmdline_private.h    |  3 +++
+ 6 files changed, 48 insertions(+), 13 deletions(-)
@@ -28 +29 @@
-index 6fa870dc32..7b20bef4e9 100644
+index 8a7300bcf9..422db4f6bc 100644
@@ -31,2 +32 @@
-@@ -66,6 +66,7 @@
- #include "cmdline_tm.h"
+@@ -72,6 +72,7 @@
@@ -34,0 +35 @@
+ static void cmd_reconfig_device_queue(portid_t id, uint8_t dev, uint8_t queue);
@@ -36,4 +37,4 @@
- static cmdline_parse_ctx_t *main_ctx;
- static TAILQ_HEAD(, testpmd_driver_commands) driver_commands_head =
- 	TAILQ_HEAD_INITIALIZER(driver_commands_head);
-@@ -13028,26 +13029,25 @@ cmdline_read_from_file(const char *filename)
+ 
+ /* *** Help command with introduction. *** */
+ struct cmd_help_brief_result {
+@@ -17193,29 +17194,28 @@ cmdline_read_from_file(const char *filename)
@@ -54 +55,4 @@
--
+-	/* initialize non-constant commands */
+ 	cmd_set_fwd_mode_init();
+ 	cmd_set_fwd_retry_mode_init();
+ 
@@ -77 +81 @@
- void
+ static void
@@ -79 +83 @@
-index 2ce19ed47a..5cb6f92523 100644
+index a061e10385..568b9f7390 100644
@@ -82 +86 @@
-@@ -4469,6 +4469,7 @@ static void
+@@ -3848,6 +3848,7 @@ static void
@@ -90 +94 @@
-@@ -4479,8 +4480,18 @@ main(int argc, char** argv)
+@@ -3858,8 +3859,18 @@ main(int argc, char** argv)
@@ -109,5 +113,5 @@
-diff --git a/lib/cmdline/cmdline.c b/lib/cmdline/cmdline.c
-index 8ad0690d85..355c7d8ca6 100644
---- a/lib/cmdline/cmdline.c
-+++ b/lib/cmdline/cmdline.c
-@@ -173,6 +173,7 @@ cmdline_quit(struct cmdline *cl)
+diff --git a/lib/librte_cmdline/cmdline.c b/lib/librte_cmdline/cmdline.c
+index 478bcfb161..713e39d9c3 100644
+--- a/lib/librte_cmdline/cmdline.c
++++ b/lib/librte_cmdline/cmdline.c
+@@ -181,6 +181,7 @@ cmdline_quit(struct cmdline *cl)
@@ -121 +125 @@
-diff --git a/lib/cmdline/cmdline_os_unix.c b/lib/cmdline/cmdline_os_unix.c
+diff --git a/lib/librte_cmdline/cmdline_os_unix.c b/lib/librte_cmdline/cmdline_os_unix.c
@@ -123,2 +127,2 @@
---- a/lib/cmdline/cmdline_os_unix.c
-+++ b/lib/cmdline/cmdline_os_unix.c
+--- a/lib/librte_cmdline/cmdline_os_unix.c
++++ b/lib/librte_cmdline/cmdline_os_unix.c
@@ -135,5 +139,5 @@
-diff --git a/lib/cmdline/cmdline_os_windows.c b/lib/cmdline/cmdline_os_windows.c
-index 73ed9ba290..80863bfc8a 100644
---- a/lib/cmdline/cmdline_os_windows.c
-+++ b/lib/cmdline/cmdline_os_windows.c
-@@ -203,3 +203,17 @@ cmdline_vdprintf(int fd, cons