patches for DPDK stable branches
 help / color / mirror / Atom feed
* patch 'malloc: fix allocation of almost hugepage size' has been queued to stable release 21.11.2
@ 2022-06-24 16:10 Kevin Traynor
  2022-06-24 16:10 ` patch 'net/octeontx: fix port close' " Kevin Traynor
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: Kevin Traynor @ 2022-06-24 16:10 UTC (permalink / raw)
  To: Fidaullah Noonari; +Cc: Dmitry Kozlyuk, dpdk stable

Hi,

FYI, your patch has been queued to stable release 21.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/27/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

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

Thanks.

Kevin

---
From bee8c21938d05fd5e3721fd6ccbd31f777eae908 Mon Sep 17 00:00:00 2001
From: Fidaullah Noonari <fidaullah.noonari@emumba.com>
Date: Wed, 25 May 2022 10:18:37 +0500
Subject: [PATCH] malloc: fix allocation of almost hugepage size

[ upstream commit ce2f7d472e80c1b6779f230a1c7b137157f5ff3d ]

If called to allocate memory of size is between multiple of hugepage
size minus malloc_header_len and hugepage size, rte_malloc fails.

This fix replaces malloc_elem_trailer_len with malloc_elem_overhead in
try_expand_heap() to include malloc_elem_header_len when calculating
n_seg.

Bugzilla ID: 800
Fixes: 07dcbfe0101f ("malloc: support multiprocess memory hotplug")

Signed-off-by: Fidaullah Noonari <fidaullah.noonari@emumba.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
---
 lib/eal/common/malloc_heap.c | 2 +-
 lib/eal/common/malloc_mp.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/eal/common/malloc_heap.c b/lib/eal/common/malloc_heap.c
index 1ca01e0901..55063ccf81 100644
--- a/lib/eal/common/malloc_heap.c
+++ b/lib/eal/common/malloc_heap.c
@@ -403,5 +403,5 @@ try_expand_heap_primary(struct malloc_heap *heap, uint64_t pg_sz,
 
 	alloc_sz = RTE_ALIGN_CEIL(align + elt_size +
-			MALLOC_ELEM_TRAILER_LEN, pg_sz);
+			MALLOC_ELEM_OVERHEAD, pg_sz);
 	n_segs = alloc_sz / pg_sz;
 
diff --git a/lib/eal/common/malloc_mp.c b/lib/eal/common/malloc_mp.c
index 2e597a17a2..774bd1132f 100644
--- a/lib/eal/common/malloc_mp.c
+++ b/lib/eal/common/malloc_mp.c
@@ -252,5 +252,5 @@ handle_alloc_request(const struct malloc_mp_req *m,
 
 	alloc_sz = RTE_ALIGN_CEIL(ar->align + ar->elt_size +
-			MALLOC_ELEM_TRAILER_LEN, ar->page_sz);
+			MALLOC_ELEM_OVERHEAD, ar->page_sz);
 	n_segs = alloc_sz / ar->page_sz;
 
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-24 16:54:05.627213201 +0100
+++ 0001-malloc-fix-allocation-of-almost-hugepage-size.patch	2022-06-24 16:54:05.518164987 +0100
@@ -1 +1 @@
-From ce2f7d472e80c1b6779f230a1c7b137157f5ff3d Mon Sep 17 00:00:00 2001
+From bee8c21938d05fd5e3721fd6ccbd31f777eae908 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit ce2f7d472e80c1b6779f230a1c7b137157f5ff3d ]
+
@@ -15 +16,0 @@
-Cc: stable@dpdk.org
@@ -25 +26 @@
-index a3d26fcbea..27a52266ad 100644
+index 1ca01e0901..55063ccf81 100644
@@ -28 +29 @@
-@@ -404,5 +404,5 @@ try_expand_heap_primary(struct malloc_heap *heap, uint64_t pg_sz,
+@@ -403,5 +403,5 @@ try_expand_heap_primary(struct malloc_heap *heap, uint64_t pg_sz,
@@ -36 +37 @@
-index 207b90847e..2b8eb51067 100644
+index 2e597a17a2..774bd1132f 100644
@@ -39 +40 @@
-@@ -251,5 +251,5 @@ handle_alloc_request(const struct malloc_mp_req *m,
+@@ -252,5 +252,5 @@ handle_alloc_request(const struct malloc_mp_req *m,


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

* patch 'net/octeontx: fix port close' has been queued to stable release 21.11.2
  2022-06-24 16:10 patch 'malloc: fix allocation of almost hugepage size' has been queued to stable release 21.11.2 Kevin Traynor
@ 2022-06-24 16:10 ` Kevin Traynor
  2022-06-24 16:10 ` patch 'common/cnxk: fix decrypt packet count register update' " Kevin Traynor
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Kevin Traynor @ 2022-06-24 16:10 UTC (permalink / raw)
  To: Harman Kalra; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 21.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/27/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

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

Thanks.

Kevin

---
From 614cd42ac083ec72e1f425976bfd7d36f6a39f74 Mon Sep 17 00:00:00 2001
From: Harman Kalra <hkalra@marvell.com>
Date: Tue, 24 May 2022 14:12:26 +0530
Subject: [PATCH] net/octeontx: fix port close

[ upstream commit 39e07170331f869c581ce4d3cdc0360f7b6b444a ]

Segmentation fault has been observed while closing the ethernet
port. Reason for the segfault is, eth port close also shuts down
event device while other ethernet port is still using the event
device.

Fixes: da6c687471a3 ("net/octeontx: add start and stop support")

Signed-off-by: Harman Kalra <hkalra@marvell.com>
---
 drivers/net/octeontx/octeontx_ethdev.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c
index b47472ebbd..f879a0c9fc 100644
--- a/drivers/net/octeontx/octeontx_ethdev.c
+++ b/drivers/net/octeontx/octeontx_ethdev.c
@@ -27,4 +27,9 @@
 #include "octeontx_logs.h"
 
+/* Useful in stopping/closing event device if no of
+ * eth ports are using it.
+ */
+uint16_t evdev_refcnt;
+
 struct evdev_priv_data {
 	OFFLOAD_FLAGS; /*Sequence should not be changed */
@@ -492,5 +497,9 @@ octeontx_dev_close(struct rte_eth_dev *dev)
 		return 0;
 
-	rte_event_dev_close(nic->evdev);
+	/* Stopping/closing event device once all eth ports are closed. */
+	if (__atomic_sub_fetch(&evdev_refcnt, 1, __ATOMIC_ACQUIRE) == 0) {
+		rte_event_dev_stop(nic->evdev);
+		rte_event_dev_close(nic->evdev);
+	}
 
 	octeontx_dev_flow_ctrl_fini(dev);
@@ -672,6 +681,4 @@ octeontx_dev_stop(struct rte_eth_dev *dev)
 	PMD_INIT_FUNC_TRACE();
 
-	rte_event_dev_stop(nic->evdev);
-
 	ret = octeontx_port_stop(nic);
 	if (ret < 0) {
@@ -1335,4 +1342,5 @@ octeontx_create(struct rte_vdev_device *dev, int port, uint8_t evdev,
 	nic->port_id = port;
 	nic->evdev = evdev;
+	__atomic_add_fetch(&evdev_refcnt, 1, __ATOMIC_ACQUIRE);
 
 	res = octeontx_port_open(nic);
@@ -1584,4 +1592,5 @@ octeontx_probe(struct rte_vdev_device *dev)
 	}
 
+	__atomic_store_n(&evdev_refcnt, 0, __ATOMIC_RELEASE);
 	/*
 	 * Do 1:1 links for ports & queues. All queues would be mapped to
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-24 16:54:05.649230070 +0100
+++ 0002-net-octeontx-fix-port-close.patch	2022-06-24 16:54:05.520164992 +0100
@@ -1 +1 @@
-From 39e07170331f869c581ce4d3cdc0360f7b6b444a Mon Sep 17 00:00:00 2001
+From 614cd42ac083ec72e1f425976bfd7d36f6a39f74 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 39e07170331f869c581ce4d3cdc0360f7b6b444a ]
+
@@ -12 +13,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index f5ea9de8ef..6469fd0a96 100644
+index b47472ebbd..f879a0c9fc 100644
@@ -51 +52 @@
-@@ -1334,4 +1341,5 @@ octeontx_create(struct rte_vdev_device *dev, int port, uint8_t evdev,
+@@ -1335,4 +1342,5 @@ octeontx_create(struct rte_vdev_device *dev, int port, uint8_t evdev,
@@ -57 +58 @@
-@@ -1583,4 +1591,5 @@ octeontx_probe(struct rte_vdev_device *dev)
+@@ -1584,4 +1592,5 @@ octeontx_probe(struct rte_vdev_device *dev)


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

* patch 'common/cnxk: fix decrypt packet count register update' has been queued to stable release 21.11.2
  2022-06-24 16:10 patch 'malloc: fix allocation of almost hugepage size' has been queued to stable release 21.11.2 Kevin Traynor
  2022-06-24 16:10 ` patch 'net/octeontx: fix port close' " Kevin Traynor
@ 2022-06-24 16:10 ` Kevin Traynor
  2022-06-24 16:10 ` patch 'common/cnxk: handle ROC model init failure' " Kevin Traynor
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Kevin Traynor @ 2022-06-24 16:10 UTC (permalink / raw)
  To: Rahul Bhansali; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 21.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/27/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

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

Thanks.

Kevin

---
From 3a66cbb6955690e3cb3de94cdc72f33890e334eb Mon Sep 17 00:00:00 2001
From: Rahul Bhansali <rbhansali@marvell.com>
Date: Fri, 20 May 2022 10:52:29 +0530
Subject: [PATCH] common/cnxk: fix decrypt packet count register update

[ upstream commit 9595e3aef699796161ab90a5b69a99d6416e3dcf ]

Corrects the CPT decrypt packet counter register.

Fixes: b1a22e5d4f ("common/cnxk: add CPT diagnostics")

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
---
 drivers/common/cnxk/roc_cpt_debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/common/cnxk/roc_cpt_debug.c b/drivers/common/cnxk/roc_cpt_debug.c
index 847d969268..be6ddb56aa 100644
--- a/drivers/common/cnxk/roc_cpt_debug.c
+++ b/drivers/common/cnxk/roc_cpt_debug.c
@@ -201,5 +201,5 @@ cpt_lf_print(struct roc_cpt_lf *lf)
 	plt_print("    Decrypted byte count:\t%" PRIu64, reg_val);
 
-	reg_val = plt_read64(lf->rbase + CPT_LF_CTX_ENC_PKT_CNT);
+	reg_val = plt_read64(lf->rbase + CPT_LF_CTX_DEC_PKT_CNT);
 	plt_print("    Decrypted packet count:\t%" PRIu64, reg_val);
 }
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-24 16:54:05.670030228 +0100
+++ 0003-common-cnxk-fix-decrypt-packet-count-register-update.patch	2022-06-24 16:54:05.521164995 +0100
@@ -1 +1 @@
-From 9595e3aef699796161ab90a5b69a99d6416e3dcf Mon Sep 17 00:00:00 2001
+From 3a66cbb6955690e3cb3de94cdc72f33890e334eb Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 9595e3aef699796161ab90a5b69a99d6416e3dcf ]
+
@@ -9 +10,0 @@
-Cc: stable@dpdk.org


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

* patch 'common/cnxk: handle ROC model init failure' has been queued to stable release 21.11.2
  2022-06-24 16:10 patch 'malloc: fix allocation of almost hugepage size' has been queued to stable release 21.11.2 Kevin Traynor
  2022-06-24 16:10 ` patch 'net/octeontx: fix port close' " Kevin Traynor
  2022-06-24 16:10 ` patch 'common/cnxk: fix decrypt packet count register update' " Kevin Traynor
@ 2022-06-24 16:10 ` Kevin Traynor
  2022-06-24 16:10 ` patch 'net/qede: fix build with GCC 13' " Kevin Traynor
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Kevin Traynor @ 2022-06-24 16:10 UTC (permalink / raw)
  To: Hanumanth Pothula; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 21.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/27/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

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

Thanks.

Kevin

---
From 760f94b15a5d168f6dfee1d841ad276d9c47f224 Mon Sep 17 00:00:00 2001
From: Hanumanth Pothula <hpothula@marvell.com>
Date: Fri, 10 Jun 2022 13:44:14 +0530
Subject: [PATCH] common/cnxk: handle ROC model init failure

[ upstream commit 5f27618bea73240ac4e71e9ed9bb14b25c95505d ]

Return with error on fail to initialize ROC model.

Fixes: 014a9e222bac ("common/cnxk: add model init and IO handling API")

Signed-off-by: Hanumanth Pothula <hpothula@marvell.com>
---
 drivers/common/cnxk/roc_platform.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/common/cnxk/roc_platform.c b/drivers/common/cnxk/roc_platform.c
index 74dbdeceb9..6cf0c4113e 100644
--- a/drivers/common/cnxk/roc_platform.c
+++ b/drivers/common/cnxk/roc_platform.c
@@ -38,5 +38,9 @@ roc_plt_init(void)
 				return -ENOMEM;
 			}
-			roc_model_init(mz->addr);
+			if (roc_model_init(mz->addr)) {
+				plt_err("Failed to init roc_model");
+				rte_memzone_free(mz);
+				return -EINVAL;
+			}
 		}
 	} else {
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-24 16:54:05.689762833 +0100
+++ 0004-common-cnxk-handle-ROC-model-init-failure.patch	2022-06-24 16:54:05.521164995 +0100
@@ -1 +1 @@
-From 5f27618bea73240ac4e71e9ed9bb14b25c95505d Mon Sep 17 00:00:00 2001
+From 760f94b15a5d168f6dfee1d841ad276d9c47f224 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 5f27618bea73240ac4e71e9ed9bb14b25c95505d ]
+
@@ -9 +10,0 @@
-Cc: stable@dpdk.org
@@ -17 +18 @@
-index ebb6225f4d..ce0f9b870c 100644
+index 74dbdeceb9..6cf0c4113e 100644


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

* patch 'net/qede: fix build with GCC 13' has been queued to stable release 21.11.2
  2022-06-24 16:10 patch 'malloc: fix allocation of almost hugepage size' has been queued to stable release 21.11.2 Kevin Traynor
                   ` (2 preceding siblings ...)
  2022-06-24 16:10 ` patch 'common/cnxk: handle ROC model init failure' " Kevin Traynor
@ 2022-06-24 16:10 ` Kevin Traynor
  2022-06-24 16:10 ` patch 'net/ice: fix race condition in Rx timestamp' " Kevin Traynor
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Kevin Traynor @ 2022-06-24 16:10 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Devendra Singh Rawat, dpdk stable

Hi,

FYI, your patch has been queued to stable release 21.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/27/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

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

Thanks.

Kevin

---
From f294a3dbb08eaf03c52073394861328b3f8f7837 Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit@xilinx.com>
Date: Thu, 16 Jun 2022 18:02:09 +0100
Subject: [PATCH] net/qede: fix build with GCC 13
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit 721ef3f54578e33905f75c7196439981dc264289 ]

Reproduced with "gcc (GCC) 13.0.0 20220616 (experimental)"

Build error:
In file included from ../drivers/net/qede/qede_debug.c:9:
../drivers/net/qede/qede_debug.c: In function ‘qed_grc_dump_addr_range’:
../drivers/net/qede/base/ecore.h:95:17:
	warning: overflow in conversion from ‘int’ to ‘u8’
	{aka ‘unsigned char’} changes value from ‘(int)vf_id << 8 | 128’
	to ‘128’ [-Woverflow]
   95 |                 ((_value & _name##_MASK) << _name##_SHIFT)
      |                 ^
../drivers/net/qede/qede_debug.c:1907:31:
	note: in expansion of macro ‘FIELD_VALUE’
 1907 |         fid = FIELD_VALUE(PXP_PRETEND_CONCRETE_FID_VFVALID, 1)
      |               ^~~~~~~~~~~

To prevent overflow converting 'fib' to uint16_t,
while updating it also updated 'vf_id' to 16 bit too.

Fixes: ec55c118792b ("net/qede: add infrastructure for debug data collection")

Signed-off-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
Acked-by: Devendra Singh Rawat <dsinghrawat@marvell.com>
---
 drivers/net/qede/qede_debug.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/qede/qede_debug.c b/drivers/net/qede/qede_debug.c
index 9383a6d677..18f2d988fb 100644
--- a/drivers/net/qede/qede_debug.c
+++ b/drivers/net/qede/qede_debug.c
@@ -1810,5 +1810,6 @@ static u32 qed_grc_dump_addr_range(struct ecore_hwfn *p_hwfn,
 {
 	struct dbg_tools_data *dev_data = &p_hwfn->dbg_info;
-	u8 port_id = 0, pf_id = 0, vf_id = 0, fid = 0;
+	u8 port_id = 0, pf_id = 0;
+	u16 vf_id = 0, fid = 0;
 	bool read_using_dmae = false;
 	u32 thresh;
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-24 16:54:05.712295593 +0100
+++ 0005-net-qede-fix-build-with-GCC-13.patch	2022-06-24 16:54:05.530165019 +0100
@@ -1 +1 @@
-From 721ef3f54578e33905f75c7196439981dc264289 Mon Sep 17 00:00:00 2001
+From f294a3dbb08eaf03c52073394861328b3f8f7837 Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit 721ef3f54578e33905f75c7196439981dc264289 ]
+
@@ -29 +30,0 @@
-Cc: stable@dpdk.org


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

* patch 'net/ice: fix race condition in Rx timestamp' has been queued to stable release 21.11.2
  2022-06-24 16:10 patch 'malloc: fix allocation of almost hugepage size' has been queued to stable release 21.11.2 Kevin Traynor
                   ` (3 preceding siblings ...)
  2022-06-24 16:10 ` patch 'net/qede: fix build with GCC 13' " Kevin Traynor
@ 2022-06-24 16:10 ` Kevin Traynor
  2022-06-24 16:10 ` patch 'net/ice/base: fix build with GCC 12' " Kevin Traynor
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Kevin Traynor @ 2022-06-24 16:10 UTC (permalink / raw)
  To: Simei Su; +Cc: Qi Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 21.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/27/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

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

Thanks.

Kevin

---
From f361d278e7fd1939f91ee85c0fc4d60d1c867292 Mon Sep 17 00:00:00 2001
From: Simei Su <simei.su@intel.com>
Date: Wed, 8 Jun 2022 10:46:01 +0800
Subject: [PATCH] net/ice: fix race condition in Rx timestamp

[ upstream commit 3d6502ee01a92f445f84af6e0660c5a0044acc35 ]

In multi-cores cases for Rx timestamp offload, to avoid phc time being
frequently overwritten, move related variables from ice_adapter to
ice_rx_queue structure, and each queue will handle timestamp calculation
by itself.

Fixes: 953e74e6b73a ("net/ice: enable Rx timestamp on flex descriptor")
Fixes: 5543827fc6df ("net/ice: improve performance of Rx timestamp offload")

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ice/ice_ethdev.h |  3 ---
 drivers/net/ice/ice_rxtx.c   | 48 ++++++++++++++++++------------------
 drivers/net/ice/ice_rxtx.h   |  3 +++
 3 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h
index 56e53a6df3..ac56c3cc60 100644
--- a/drivers/net/ice/ice_ethdev.h
+++ b/drivers/net/ice/ice_ethdev.h
@@ -530,7 +530,4 @@ struct ice_adapter {
 	bool ptp_ena;
 	uint64_t time_hw;
-	uint32_t hw_time_high; /* high 32 bits of timestamp */
-	uint32_t hw_time_low; /* low 32 bits of timestamp */
-	uint64_t hw_time_update; /* SW time of HW record updating */
 	struct ice_fdir_prof_info fdir_prof_info[ICE_MAX_PTGS];
 	struct ice_rss_prof_info rss_prof_info[ICE_MAX_PTGS];
diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index 91cdc560f2..71e5c6f5d6 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -1594,5 +1594,5 @@ ice_rx_scan_hw_ring(struct ice_rx_queue *rxq)
 		uint64_t sw_cur_time = rte_get_timer_cycles() / (rte_get_timer_hz() / 1000);
 
-		if (unlikely(sw_cur_time - ad->hw_time_update > 4))
+		if (unlikely(sw_cur_time - rxq->hw_time_update > 4))
 			is_tsinit = 1;
 	}
@@ -1638,14 +1638,14 @@ ice_rx_scan_hw_ring(struct ice_rx_queue *rxq)
 					ts_ns = ice_tstamp_convert_32b_64b(hw, ad, 1,
 									   rxq->time_high);
-					ad->hw_time_low = (uint32_t)ts_ns;
-					ad->hw_time_high = (uint32_t)(ts_ns >> 32);
+					rxq->hw_time_low = (uint32_t)ts_ns;
+					rxq->hw_time_high = (uint32_t)(ts_ns >> 32);
 					is_tsinit = false;
 				} else {
-					if (rxq->time_high < ad->hw_time_low)
-						ad->hw_time_high += 1;
-					ts_ns = (uint64_t)ad->hw_time_high << 32 | rxq->time_high;
-					ad->hw_time_low = rxq->time_high;
+					if (rxq->time_high < rxq->hw_time_low)
+						rxq->hw_time_high += 1;
+					ts_ns = (uint64_t)rxq->hw_time_high << 32 | rxq->time_high;
+					rxq->hw_time_low = rxq->time_high;
 				}
-				ad->hw_time_update = rte_get_timer_cycles() /
+				rxq->hw_time_update = rte_get_timer_cycles() /
 						     (rte_get_timer_hz() / 1000);
 				*RTE_MBUF_DYNFIELD(mb,
@@ -1860,5 +1860,5 @@ ice_recv_scattered_pkts(void *rx_queue,
 		uint64_t sw_cur_time = rte_get_timer_cycles() / (rte_get_timer_hz() / 1000);
 
-		if (unlikely(sw_cur_time - ad->hw_time_update > 4))
+		if (unlikely(sw_cur_time - rxq->hw_time_update > 4))
 			is_tsinit = true;
 	}
@@ -1980,14 +1980,14 @@ ice_recv_scattered_pkts(void *rx_queue,
 			if (unlikely(is_tsinit)) {
 				ts_ns = ice_tstamp_convert_32b_64b(hw, ad, 1, rxq->time_high);
-				ad->hw_time_low = (uint32_t)ts_ns;
-				ad->hw_time_high = (uint32_t)(ts_ns >> 32);
+				rxq->hw_time_low = (uint32_t)ts_ns;
+				rxq->hw_time_high = (uint32_t)(ts_ns >> 32);
 				is_tsinit = false;
 			} else {
-				if (rxq->time_high < ad->hw_time_low)
-					ad->hw_time_high += 1;
-				ts_ns = (uint64_t)ad->hw_time_high << 32 | rxq->time_high;
-				ad->hw_time_low = rxq->time_high;
+				if (rxq->time_high < rxq->hw_time_low)
+					rxq->hw_time_high += 1;
+				ts_ns = (uint64_t)rxq->hw_time_high << 32 | rxq->time_high;
+				rxq->hw_time_low = rxq->time_high;
 			}
-			ad->hw_time_update = rte_get_timer_cycles() /
+			rxq->hw_time_update = rte_get_timer_cycles() /
 					     (rte_get_timer_hz() / 1000);
 			*RTE_MBUF_DYNFIELD(rxm,
@@ -2370,5 +2370,5 @@ ice_recv_pkts(void *rx_queue,
 		uint64_t sw_cur_time = rte_get_timer_cycles() / (rte_get_timer_hz() / 1000);
 
-		if (unlikely(sw_cur_time - ad->hw_time_update > 4))
+		if (unlikely(sw_cur_time - rxq->hw_time_update > 4))
 			is_tsinit = 1;
 	}
@@ -2431,14 +2431,14 @@ ice_recv_pkts(void *rx_queue,
 			if (unlikely(is_tsinit)) {
 				ts_ns = ice_tstamp_convert_32b_64b(hw, ad, 1, rxq->time_high);
-				ad->hw_time_low = (uint32_t)ts_ns;
-				ad->hw_time_high = (uint32_t)(ts_ns >> 32);
+				rxq->hw_time_low = (uint32_t)ts_ns;
+				rxq->hw_time_high = (uint32_t)(ts_ns >> 32);
 				is_tsinit = false;
 			} else {
-				if (rxq->time_high < ad->hw_time_low)
-					ad->hw_time_high += 1;
-				ts_ns = (uint64_t)ad->hw_time_high << 32 | rxq->time_high;
-				ad->hw_time_low = rxq->time_high;
+				if (rxq->time_high < rxq->hw_time_low)
+					rxq->hw_time_high += 1;
+				ts_ns = (uint64_t)rxq->hw_time_high << 32 | rxq->time_high;
+				rxq->hw_time_low = rxq->time_high;
 			}
-			ad->hw_time_update = rte_get_timer_cycles() /
+			rxq->hw_time_update = rte_get_timer_cycles() /
 					     (rte_get_timer_hz() / 1000);
 			*RTE_MBUF_DYNFIELD(rxm,
diff --git a/drivers/net/ice/ice_rxtx.h b/drivers/net/ice/ice_rxtx.h
index bb18a01951..f5337d5284 100644
--- a/drivers/net/ice/ice_rxtx.h
+++ b/drivers/net/ice/ice_rxtx.h
@@ -96,4 +96,7 @@ struct ice_rx_queue {
 	uint32_t hw_register_set;
 	const struct rte_memzone *mz;
+	uint32_t hw_time_high; /* high 32 bits of timestamp */
+	uint32_t hw_time_low; /* low 32 bits of timestamp */
+	uint64_t hw_time_update; /* SW time of HW record updating */
 };
 
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-24 16:54:05.739953049 +0100
+++ 0006-net-ice-fix-race-condition-in-Rx-timestamp.patch	2022-06-24 16:54:05.535165033 +0100
@@ -1 +1 @@
-From 3d6502ee01a92f445f84af6e0660c5a0044acc35 Mon Sep 17 00:00:00 2001
+From f361d278e7fd1939f91ee85c0fc4d60d1c867292 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 3d6502ee01a92f445f84af6e0660c5a0044acc35 ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -24 +25 @@
-index f9f4a1c71b..c257bb23d3 100644
+index 56e53a6df3..ac56c3cc60 100644
@@ -27 +28 @@
-@@ -607,7 +607,4 @@ struct ice_adapter {
+@@ -530,7 +530,4 @@ struct ice_adapter {
@@ -36 +37 @@
-index 975ab55749..bfb3a16ae2 100644
+index 91cdc560f2..71e5c6f5d6 100644
@@ -39 +40 @@
-@@ -1596,5 +1596,5 @@ ice_rx_scan_hw_ring(struct ice_rx_queue *rxq)
+@@ -1594,5 +1594,5 @@ ice_rx_scan_hw_ring(struct ice_rx_queue *rxq)
@@ -46 +47 @@
-@@ -1640,14 +1640,14 @@ ice_rx_scan_hw_ring(struct ice_rx_queue *rxq)
+@@ -1638,14 +1638,14 @@ ice_rx_scan_hw_ring(struct ice_rx_queue *rxq)
@@ -68 +69 @@
-@@ -1862,5 +1862,5 @@ ice_recv_scattered_pkts(void *rx_queue,
+@@ -1860,5 +1860,5 @@ ice_recv_scattered_pkts(void *rx_queue,
@@ -75 +76 @@
-@@ -1982,14 +1982,14 @@ ice_recv_scattered_pkts(void *rx_queue,
+@@ -1980,14 +1980,14 @@ ice_recv_scattered_pkts(void *rx_queue,
@@ -97 +98 @@
-@@ -2372,5 +2372,5 @@ ice_recv_pkts(void *rx_queue,
+@@ -2370,5 +2370,5 @@ ice_recv_pkts(void *rx_queue,
@@ -104 +105 @@
-@@ -2433,14 +2433,14 @@ ice_recv_pkts(void *rx_queue,
+@@ -2431,14 +2431,14 @@ ice_recv_pkts(void *rx_queue,


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

* patch 'net/ice/base: fix build with GCC 12' has been queued to stable release 21.11.2
  2022-06-24 16:10 patch 'malloc: fix allocation of almost hugepage size' has been queued to stable release 21.11.2 Kevin Traynor
                   ` (4 preceding siblings ...)
  2022-06-24 16:10 ` patch 'net/ice: fix race condition in Rx timestamp' " Kevin Traynor
@ 2022-06-24 16:10 ` Kevin Traynor
  2022-06-24 16:10 ` patch 'net/qede: " Kevin Traynor
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Kevin Traynor @ 2022-06-24 16:10 UTC (permalink / raw)
  To: Wenxuan Wu; +Cc: Qi Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 21.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/27/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

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

Thanks.

Kevin

---
From cca0819d488f62311320a08fbd669a21fccf4818 Mon Sep 17 00:00:00 2001
From: Wenxuan Wu <wenxuanx.wu@intel.com>
Date: Thu, 23 Jun 2022 17:01:05 +0800
Subject: [PATCH] net/ice/base: fix build with GCC 12

[ upstream commit 3e87e12dc8bcb1d06dafcb302b056fee51deb090 ]

GCC 12 with -O2 flag would raise the following warning:
../drivers/net/ice/base/ice_switch.c:7220:61: error: writing 1 byte into a
region of size 0 [-Werror=stringop-overflow=]
 7220 |           buf[recps].content.lkup_indx[i + 1] = entry->fv_idx[i];
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~

This patch changed the type of fv_idx in struct ice_recp_grp_entry to
align with its callers which are also u8 type.

Fixes: 04b8ec1ea807 ("net/ice/base: add protocol structures and defines")

Signed-off-by: Wenxuan Wu <wenxuanx.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ice/base/ice_flex_pipe.c     | 2 +-
 drivers/net/ice/base/ice_flex_pipe.h     | 2 +-
 drivers/net/ice/base/ice_protocol_type.h | 2 +-
 drivers/net/ice/base/ice_switch.h        | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ice/base/ice_flex_pipe.c b/drivers/net/ice/base/ice_flex_pipe.c
index f6a29f87c5..3918169001 100644
--- a/drivers/net/ice/base/ice_flex_pipe.c
+++ b/drivers/net/ice/base/ice_flex_pipe.c
@@ -2565,5 +2565,5 @@ ice_destroy_tunnel_end:
  */
 enum ice_status
-ice_find_prot_off(struct ice_hw *hw, enum ice_block blk, u8 prof, u16 fv_idx,
+ice_find_prot_off(struct ice_hw *hw, enum ice_block blk, u8 prof, u8 fv_idx,
 		  u8 *prot, u16 *off)
 {
diff --git a/drivers/net/ice/base/ice_flex_pipe.h b/drivers/net/ice/base/ice_flex_pipe.h
index 23ba45564a..ab897de4f3 100644
--- a/drivers/net/ice/base/ice_flex_pipe.h
+++ b/drivers/net/ice/base/ice_flex_pipe.h
@@ -26,5 +26,5 @@ ice_acquire_change_lock(struct ice_hw *hw, enum ice_aq_res_access_type access);
 void ice_release_change_lock(struct ice_hw *hw);
 enum ice_status
-ice_find_prot_off(struct ice_hw *hw, enum ice_block blk, u8 prof, u16 fv_idx,
+ice_find_prot_off(struct ice_hw *hw, enum ice_block blk, u8 prof, u8 fv_idx,
 		  u8 *prot, u16 *off);
 enum ice_status
diff --git a/drivers/net/ice/base/ice_protocol_type.h b/drivers/net/ice/base/ice_protocol_type.h
index 7dcc983707..d27ef46713 100644
--- a/drivers/net/ice/base/ice_protocol_type.h
+++ b/drivers/net/ice/base/ice_protocol_type.h
@@ -424,5 +424,5 @@ struct ice_recp_grp_entry {
 	u16 rid;
 	u8 chain_idx;
-	u16 fv_idx[ICE_NUM_WORDS_RECIPE];
+	u8 fv_idx[ICE_NUM_WORDS_RECIPE];
 	u16 fv_mask[ICE_NUM_WORDS_RECIPE];
 	struct ice_pref_recipe_group r_group;
diff --git a/drivers/net/ice/base/ice_switch.h b/drivers/net/ice/base/ice_switch.h
index a2b3c80107..c67cd09d21 100644
--- a/drivers/net/ice/base/ice_switch.h
+++ b/drivers/net/ice/base/ice_switch.h
@@ -204,5 +204,5 @@ struct ice_fltr_info {
 struct ice_update_recipe_lkup_idx_params {
 	u16 rid;
-	u16 fv_idx;
+	u8 fv_idx;
 	bool ignore_valid;
 	u16 mask;
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-24 16:54:05.765927441 +0100
+++ 0007-net-ice-base-fix-build-with-GCC-12.patch	2022-06-24 16:54:05.541165049 +0100
@@ -1 +1 @@
-From 3e87e12dc8bcb1d06dafcb302b056fee51deb090 Mon Sep 17 00:00:00 2001
+From cca0819d488f62311320a08fbd669a21fccf4818 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 3e87e12dc8bcb1d06dafcb302b056fee51deb090 ]
+
@@ -16 +17,0 @@
-Cc: stable@dpdk.org
@@ -50 +51 @@
-index 8fb95a8a8d..74107de988 100644
+index 7dcc983707..d27ef46713 100644
@@ -53 +54 @@
-@@ -425,5 +425,5 @@ struct ice_recp_grp_entry {
+@@ -424,5 +424,5 @@ struct ice_recp_grp_entry {


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

* patch 'net/qede: fix build with GCC 12' has been queued to stable release 21.11.2
  2022-06-24 16:10 patch 'malloc: fix allocation of almost hugepage size' has been queued to stable release 21.11.2 Kevin Traynor
                   ` (5 preceding siblings ...)
  2022-06-24 16:10 ` patch 'net/ice/base: fix build with GCC 12' " Kevin Traynor
@ 2022-06-24 16:10 ` Kevin Traynor
  2022-06-24 16:10 ` patch 'net/mlx5: fix build with clang 14' " Kevin Traynor
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Kevin Traynor @ 2022-06-24 16:10 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 21.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/27/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

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

Thanks.

Kevin

---
From e4939398dfe939e8f1c91c04734ea83f335a8d37 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Tue, 7 Jun 2022 10:17:40 -0700
Subject: [PATCH] net/qede: fix build with GCC 12

[ upstream commit 4200c4d62586985d70ad69ed7bee526a282b8777 ]

The x86 version of rte_memcpy can cause warnings. The driver does
not need to use rte_memcpy for everything. Standard memcpy is
just as fast and safer; the compiler and static analysis tools
treat memcpy specially.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/qede/base/bcm_osal.h |  3 +--
 drivers/net/qede/qede_ethdev.c   |  2 +-
 drivers/net/qede/qede_filter.c   | 16 ++++++----------
 drivers/net/qede/qede_main.c     | 13 ++++++-------
 drivers/net/qede/qede_sriov.c    |  6 +++---
 5 files changed, 17 insertions(+), 23 deletions(-)

diff --git a/drivers/net/qede/base/bcm_osal.h b/drivers/net/qede/base/bcm_osal.h
index c5b5399282..9ea579bfc8 100644
--- a/drivers/net/qede/base/bcm_osal.h
+++ b/drivers/net/qede/base/bcm_osal.h
@@ -15,5 +15,4 @@
 #include <rte_malloc.h>
 #include <rte_atomic.h>
-#include <rte_memcpy.h>
 #include <rte_log.h>
 #include <rte_cycles.h>
@@ -100,5 +99,5 @@ typedef intptr_t osal_int_ptr_t;
 #define OSAL_VFREE(dev, memory) OSAL_FREE(dev, memory)
 #define OSAL_MEM_ZERO(mem, size) bzero(mem, size)
-#define OSAL_MEMCPY(dst, src, size) rte_memcpy(dst, src, size)
+#define OSAL_MEMCPY(dst, src, size) memcpy(dst, src, size)
 #define OSAL_MEMCMP(s1, s2, size) memcmp(s1, s2, size)
 #define OSAL_MEMSET(dst, val, length) \
diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index a1122a297e..2a3123f0c8 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -359,5 +359,5 @@ static void
 qede_alloc_etherdev(struct qede_dev *qdev, struct qed_dev_eth_info *info)
 {
-	rte_memcpy(&qdev->dev_info, info, sizeof(*info));
+	qdev->dev_info = *info;
 	qdev->ops = qed_ops;
 }
diff --git a/drivers/net/qede/qede_filter.c b/drivers/net/qede/qede_filter.c
index 440440423a..ca3165d972 100644
--- a/drivers/net/qede/qede_filter.c
+++ b/drivers/net/qede/qede_filter.c
@@ -389,8 +389,6 @@ qede_arfs_construct_pkt(struct rte_eth_dev *eth_dev,
 			rte_cpu_to_be_32(QEDE_FDIR_IPV6_DEFAULT_VTC_FLOW);
 
-		rte_memcpy(&ip6->src_addr, arfs->tuple.src_ipv6,
-			   IPV6_ADDR_LEN);
-		rte_memcpy(&ip6->dst_addr, arfs->tuple.dst_ipv6,
-			   IPV6_ADDR_LEN);
+		memcpy(&ip6->src_addr, arfs->tuple.src_ipv6, IPV6_ADDR_LEN);
+		memcpy(&ip6->dst_addr, arfs->tuple.dst_ipv6, IPV6_ADDR_LEN);
 		len += sizeof(struct rte_ipv6_hdr);
 		params->ipv6 = true;
@@ -822,10 +820,8 @@ qede_flow_parse_pattern(__rte_unused struct rte_eth_dev *dev,
 
 				spec = pattern->spec;
-				rte_memcpy(flow->entry.tuple.src_ipv6,
-					   spec->hdr.src_addr,
-					   IPV6_ADDR_LEN);
-				rte_memcpy(flow->entry.tuple.dst_ipv6,
-					   spec->hdr.dst_addr,
-					   IPV6_ADDR_LEN);
+				memcpy(flow->entry.tuple.src_ipv6,
+				       spec->hdr.src_addr, IPV6_ADDR_LEN);
+				memcpy(flow->entry.tuple.dst_ipv6,
+				       spec->hdr.dst_addr, IPV6_ADDR_LEN);
 				flow->entry.tuple.eth_proto =
 					RTE_ETHER_TYPE_IPV6;
diff --git a/drivers/net/qede/qede_main.c b/drivers/net/qede/qede_main.c
index 2d1f70693a..c5afdb00d5 100644
--- a/drivers/net/qede/qede_main.c
+++ b/drivers/net/qede/qede_main.c
@@ -374,5 +374,5 @@ qed_fill_dev_info(struct ecore_dev *edev, struct qed_dev_info *dev_info)
 	dev_info->dev_type = edev->type;
 
-	rte_memcpy(&dev_info->hw_mac, &edev->hwfns[0].hw_info.hw_mac_addr,
+	memcpy(&dev_info->hw_mac, &edev->hwfns[0].hw_info.hw_mac_addr,
 	       RTE_ETHER_ADDR_LEN);
 
@@ -442,5 +442,5 @@ qed_fill_eth_dev_info(struct ecore_dev *edev, struct qed_dev_eth_info *info)
 					 max_vf_vlan_filters;
 
-		rte_memcpy(&info->port_mac, &edev->hwfns[0].hw_info.hw_mac_addr,
+		memcpy(&info->port_mac, &edev->hwfns[0].hw_info.hw_mac_addr,
 			   RTE_ETHER_ADDR_LEN);
 	} else {
@@ -473,5 +473,5 @@ static void qed_set_name(struct ecore_dev *edev, char name[NAME_SIZE])
 	int i;
 
-	rte_memcpy(edev->name, name, NAME_SIZE);
+	memcpy(edev->name, name, NAME_SIZE);
 	for_each_hwfn(edev, i) {
 		snprintf(edev->hwfns[i].name, NAME_SIZE, "%s-%d", name, i);
@@ -515,8 +515,7 @@ static void qed_fill_link(struct ecore_hwfn *hwfn,
 	/* Prepare source inputs */
 	if (IS_PF(hwfn->p_dev)) {
-		rte_memcpy(&params, ecore_mcp_get_link_params(hwfn),
-		       sizeof(params));
-		rte_memcpy(&link, ecore_mcp_get_link_state(hwfn), sizeof(link));
-		rte_memcpy(&link_caps, ecore_mcp_get_link_capabilities(hwfn),
+		memcpy(&params, ecore_mcp_get_link_params(hwfn), sizeof(params));
+		memcpy(&link, ecore_mcp_get_link_state(hwfn), sizeof(link));
+		memcpy(&link_caps, ecore_mcp_get_link_capabilities(hwfn),
 		       sizeof(link_caps));
 	} else {
diff --git a/drivers/net/qede/qede_sriov.c b/drivers/net/qede/qede_sriov.c
index 0b99a8d6fe..937d339fb8 100644
--- a/drivers/net/qede/qede_sriov.c
+++ b/drivers/net/qede/qede_sriov.c
@@ -204,8 +204,8 @@ void qed_inform_vf_link_state(struct ecore_hwfn *hwfn)
 		return;
 
-	rte_memcpy(&params, ecore_mcp_get_link_params(lead_hwfn),
+	memcpy(&params, ecore_mcp_get_link_params(lead_hwfn),
 		   sizeof(params));
-	rte_memcpy(&link, ecore_mcp_get_link_state(lead_hwfn), sizeof(link));
-	rte_memcpy(&caps, ecore_mcp_get_link_capabilities(lead_hwfn),
+	memcpy(&link, ecore_mcp_get_link_state(lead_hwfn), sizeof(link));
+	memcpy(&caps, ecore_mcp_get_link_capabilities(lead_hwfn),
 		   sizeof(caps));
 
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-24 16:54:05.792742098 +0100
+++ 0008-net-qede-fix-build-with-GCC-12.patch	2022-06-24 16:54:05.545165060 +0100
@@ -1 +1 @@
-From 4200c4d62586985d70ad69ed7bee526a282b8777 Mon Sep 17 00:00:00 2001
+From e4939398dfe939e8f1c91c04734ea83f335a8d37 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 4200c4d62586985d70ad69ed7bee526a282b8777 ]
+
@@ -11,2 +12,0 @@
-Cc: stable@dpdk.org
-
@@ -40 +40 @@
-index ea6b71f093..a4923670d6 100644
+index a1122a297e..2a3123f0c8 100644
@@ -81 +81 @@
-index ad101194d6..03039038ad 100644
+index 2d1f70693a..c5afdb00d5 100644
@@ -84 +84 @@
-@@ -373,5 +373,5 @@ qed_fill_dev_info(struct ecore_dev *edev, struct qed_dev_info *dev_info)
+@@ -374,5 +374,5 @@ qed_fill_dev_info(struct ecore_dev *edev, struct qed_dev_info *dev_info)
@@ -91 +91 @@
-@@ -441,5 +441,5 @@ qed_fill_eth_dev_info(struct ecore_dev *edev, struct qed_dev_eth_info *info)
+@@ -442,5 +442,5 @@ qed_fill_eth_dev_info(struct ecore_dev *edev, struct qed_dev_eth_info *info)
@@ -98 +98 @@
-@@ -472,5 +472,5 @@ static void qed_set_name(struct ecore_dev *edev, char name[NAME_SIZE])
+@@ -473,5 +473,5 @@ static void qed_set_name(struct ecore_dev *edev, char name[NAME_SIZE])
@@ -105 +105 @@
-@@ -514,8 +514,7 @@ static void qed_fill_link(struct ecore_hwfn *hwfn,
+@@ -515,8 +515,7 @@ static void qed_fill_link(struct ecore_hwfn *hwfn,


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

* patch 'net/mlx5: fix build with clang 14' has been queued to stable release 21.11.2
  2022-06-24 16:10 patch 'malloc: fix allocation of almost hugepage size' has been queued to stable release 21.11.2 Kevin Traynor
                   ` (6 preceding siblings ...)
  2022-06-24 16:10 ` patch 'net/qede: " Kevin Traynor
@ 2022-06-24 16:10 ` Kevin Traynor
  2022-06-24 16:10 ` patch 'net/mlx5: fix RSS expansion for patterns with ICMP item' " Kevin Traynor
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Kevin Traynor @ 2022-06-24 16:10 UTC (permalink / raw)
  To: Ali Alnubani; +Cc: Thomas Monjalon, Viacheslav Ovsiienko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 21.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/27/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

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

Thanks.

Kevin

---
From de9fa7b4538ef1f143821e32098c32b7ec9d3bfe Mon Sep 17 00:00:00 2001
From: Ali Alnubani <alialnu@nvidia.com>
Date: Wed, 11 May 2022 19:41:09 +0300
Subject: [PATCH] net/mlx5: fix build with clang 14

[ upstream commit bae645a23a41c7656928b742e0418fbf41095202 ]

Use fgets instead of fscanf to resolve the following warning
reported by clang 14.0.0 in Fedora 37 (Rawhide):

drivers/net/mlx5/linux/mlx5_ethdev_os.c:1137:52: error:
  'fscanf' may overflow; destination buffer in argument 3 has size 16,
  but the corresponding specifier may require size 17
  [-Werror,-Wfortify-source]
  ret = fscanf(file, "%" RTE_STR(IF_NAMESIZE) "s", port_name);

Fixes: 63d1db710fbc ("net/mlx5: fix unlimited parsing of switch info")

Signed-off-by: Ali Alnubani <alialnu@nvidia.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/linux/mlx5_ethdev_os.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/mlx5/linux/mlx5_ethdev_os.c b/drivers/net/mlx5/linux/mlx5_ethdev_os.c
index b5819cc656..fadcbd7ef7 100644
--- a/drivers/net/mlx5/linux/mlx5_ethdev_os.c
+++ b/drivers/net/mlx5/linux/mlx5_ethdev_os.c
@@ -1119,5 +1119,4 @@ mlx5_sysfs_switch_info(unsigned int ifindex, struct mlx5_switch_info *info)
 	bool device_dir = false;
 	char c;
-	int ret;
 
 	if (!if_indextoname(ifindex, ifname)) {
@@ -1135,8 +1134,7 @@ mlx5_sysfs_switch_info(unsigned int ifindex, struct mlx5_switch_info *info)
 	file = fopen(phys_port_name, "rb");
 	if (file != NULL) {
-		ret = fscanf(file, "%" RTE_STR(IF_NAMESIZE) "s", port_name);
-		fclose(file);
-		if (ret == 1)
+		if (fgets(port_name, IF_NAMESIZE, file) != NULL)
 			mlx5_translate_port_name(port_name, &data);
+		fclose(file);
 	}
 	file = fopen(phys_switch_id, "rb");
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-24 16:54:05.818645272 +0100
+++ 0009-net-mlx5-fix-build-with-clang-14.patch	2022-06-24 16:54:05.546165063 +0100
@@ -1 +1 @@
-From bae645a23a41c7656928b742e0418fbf41095202 Mon Sep 17 00:00:00 2001
+From de9fa7b4538ef1f143821e32098c32b7ec9d3bfe Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit bae645a23a41c7656928b742e0418fbf41095202 ]
+
@@ -16 +17,0 @@
-Cc: stable@dpdk.org
@@ -26 +27 @@
-index 8d30ad0994..2a1cf04431 100644
+index b5819cc656..fadcbd7ef7 100644


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

* patch 'net/mlx5: fix RSS expansion for patterns with ICMP item' has been queued to stable release 21.11.2
  2022-06-24 16:10 patch 'malloc: fix allocation of almost hugepage size' has been queued to stable release 21.11.2 Kevin Traynor
                   ` (7 preceding siblings ...)
  2022-06-24 16:10 ` patch 'net/mlx5: fix build with clang 14' " Kevin Traynor
@ 2022-06-24 16:10 ` Kevin Traynor
  2022-06-24 16:10 ` patch 'net/mlx5: add limitation for E-Switch Manager match' " Kevin Traynor
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Kevin Traynor @ 2022-06-24 16:10 UTC (permalink / raw)
  To: Gregory Etelson; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 21.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/27/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

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

Thanks.

Kevin

---
From fac54fde60c2e54756207c34e5b23cb9ceaf27c6 Mon Sep 17 00:00:00 2001
From: Gregory Etelson <getelson@nvidia.com>
Date: Fri, 17 Jun 2022 08:22:38 +0300
Subject: [PATCH] net/mlx5: fix RSS expansion for patterns with ICMP item

[ upstream commit 57d6a458a8b8d2f41598b6f8f8d9459b34d1dd8f ]

MLX5 PMD RSS expansion implementation added L4 UDP or TCP
headers after ICMP.
For example:
ETH / IPv4 / ICMP expanded into  ETH / IPv4 / ICMP / {UDP | TCP}
ETH / IPv6 / ICMPv6 expanded into  ETH / IPv6 / ICMPv6 / {UDP | TCP}

The patch updates PMD expansion scheme to handle ICMP and ICMPv6 types
as non-expandable for RSS.

Fixes: c7870bfe09dc ("ethdev: move RSS expansion code to mlx5 driver")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow.c | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 3574358c72..94fb2d8c95 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -150,4 +150,6 @@ mlx5_flow_is_rss_expandable_item(const struct rte_flow_item *item)
 	case RTE_FLOW_ITEM_TYPE_UDP:
 	case RTE_FLOW_ITEM_TYPE_TCP:
+	case RTE_FLOW_ITEM_TYPE_ICMP:
+	case RTE_FLOW_ITEM_TYPE_ICMP6:
 	case RTE_FLOW_ITEM_TYPE_VXLAN:
 	case RTE_FLOW_ITEM_TYPE_NVGRE:
@@ -559,7 +561,9 @@ enum mlx5_expansion {
 	MLX5_EXPANSION_OUTER_IPV4_UDP,
 	MLX5_EXPANSION_OUTER_IPV4_TCP,
+	MLX5_EXPANSION_OUTER_IPV4_ICMP,
 	MLX5_EXPANSION_OUTER_IPV6,
 	MLX5_EXPANSION_OUTER_IPV6_UDP,
 	MLX5_EXPANSION_OUTER_IPV6_TCP,
+	MLX5_EXPANSION_OUTER_IPV6_ICMP6,
 	MLX5_EXPANSION_VXLAN,
 	MLX5_EXPANSION_STD_VXLAN,
@@ -575,7 +579,9 @@ enum mlx5_expansion {
 	MLX5_EXPANSION_IPV4_UDP,
 	MLX5_EXPANSION_IPV4_TCP,
+	MLX5_EXPANSION_IPV4_ICMP,
 	MLX5_EXPANSION_IPV6,
 	MLX5_EXPANSION_IPV6_UDP,
 	MLX5_EXPANSION_IPV6_TCP,
+	MLX5_EXPANSION_IPV6_ICMP6,
 	MLX5_EXPANSION_IPV6_FRAG_EXT,
 	MLX5_EXPANSION_GTP,
@@ -612,4 +618,5 @@ static const struct mlx5_flow_expand_node mlx5_support_expansion[] = {
 			(MLX5_EXPANSION_OUTER_IPV4_UDP,
 			 MLX5_EXPANSION_OUTER_IPV4_TCP,
+			 MLX5_EXPANSION_OUTER_IPV4_ICMP,
 			 MLX5_EXPANSION_GRE,
 			 MLX5_EXPANSION_NVGRE,
@@ -633,8 +640,12 @@ static const struct mlx5_flow_expand_node mlx5_support_expansion[] = {
 		.rss_types = RTE_ETH_RSS_NONFRAG_IPV4_TCP,
 	},
+	[MLX5_EXPANSION_OUTER_IPV4_ICMP] = {
+		.type = RTE_FLOW_ITEM_TYPE_ICMP,
+	},
 	[MLX5_EXPANSION_OUTER_IPV6] = {
 		.next = MLX5_FLOW_EXPAND_RSS_NEXT
 			(MLX5_EXPANSION_OUTER_IPV6_UDP,
 			 MLX5_EXPANSION_OUTER_IPV6_TCP,
+			 MLX5_EXPANSION_OUTER_IPV6_ICMP6,
 			 MLX5_EXPANSION_IPV4,
 			 MLX5_EXPANSION_IPV6,
@@ -658,4 +669,7 @@ static const struct mlx5_flow_expand_node mlx5_support_expansion[] = {
 		.rss_types = RTE_ETH_RSS_NONFRAG_IPV6_TCP,
 	},
+	[MLX5_EXPANSION_OUTER_IPV6_ICMP6] = {
+		.type = RTE_FLOW_ITEM_TYPE_ICMP6,
+	},
 	[MLX5_EXPANSION_VXLAN] = {
 		.next = MLX5_FLOW_EXPAND_RSS_NEXT(MLX5_EXPANSION_ETH,
@@ -717,5 +731,6 @@ static const struct mlx5_flow_expand_node mlx5_support_expansion[] = {
 	[MLX5_EXPANSION_IPV4] = {
 		.next = MLX5_FLOW_EXPAND_RSS_NEXT(MLX5_EXPANSION_IPV4_UDP,
-						  MLX5_EXPANSION_IPV4_TCP),
+						  MLX5_EXPANSION_IPV4_TCP,
+						  MLX5_EXPANSION_IPV4_ICMP),
 		.type = RTE_FLOW_ITEM_TYPE_IPV4,
 		.rss_types = RTE_ETH_RSS_IPV4 | RTE_ETH_RSS_FRAG_IPV4 |
@@ -730,7 +745,11 @@ static const struct mlx5_flow_expand_node mlx5_support_expansion[] = {
 		.rss_types = RTE_ETH_RSS_NONFRAG_IPV4_TCP,
 	},
+	[MLX5_EXPANSION_IPV4_ICMP] = {
+		.type = RTE_FLOW_ITEM_TYPE_ICMP,
+	},
 	[MLX5_EXPANSION_IPV6] = {
 		.next = MLX5_FLOW_EXPAND_RSS_NEXT(MLX5_EXPANSION_IPV6_UDP,
 						  MLX5_EXPANSION_IPV6_TCP,
+						  MLX5_EXPANSION_IPV6_ICMP6,
 						  MLX5_EXPANSION_IPV6_FRAG_EXT),
 		.type = RTE_FLOW_ITEM_TYPE_IPV6,
@@ -749,4 +768,7 @@ static const struct mlx5_flow_expand_node mlx5_support_expansion[] = {
 		.type = RTE_FLOW_ITEM_TYPE_IPV6_FRAG_EXT,
 	},
+	[MLX5_EXPANSION_IPV6_ICMP6] = {
+		.type = RTE_FLOW_ITEM_TYPE_ICMP6,
+	},
 	[MLX5_EXPANSION_GTP] = {
 		.next = MLX5_FLOW_EXPAND_RSS_NEXT(MLX5_EXPANSION_IPV4,
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-24 16:54:05.841280764 +0100
+++ 0010-net-mlx5-fix-RSS-expansion-for-patterns-with-ICMP-it.patch	2022-06-24 16:54:05.554165084 +0100
@@ -1 +1 @@
-From 57d6a458a8b8d2f41598b6f8f8d9459b34d1dd8f Mon Sep 17 00:00:00 2001
+From fac54fde60c2e54756207c34e5b23cb9ceaf27c6 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 57d6a458a8b8d2f41598b6f8f8d9459b34d1dd8f ]
+
@@ -16 +17,0 @@
-Cc: stable@dpdk.org
@@ -25 +26 @@
-index 090de0366b..900ec8e4bc 100644
+index 3574358c72..94fb2d8c95 100644
@@ -28 +29,2 @@
-@@ -151,4 +151,6 @@ mlx5_flow_is_rss_expandable_item(const struct rte_flow_item *item)
+@@ -150,4 +150,6 @@ mlx5_flow_is_rss_expandable_item(const struct rte_flow_item *item)
+ 	case RTE_FLOW_ITEM_TYPE_UDP:
@@ -30 +31,0 @@
- 	case RTE_FLOW_ITEM_TYPE_ESP:
@@ -35 +36,2 @@
-@@ -564,8 +566,10 @@ enum mlx5_expansion {
+@@ -559,7 +561,9 @@ enum mlx5_expansion {
+ 	MLX5_EXPANSION_OUTER_IPV4_UDP,
@@ -37 +38,0 @@
- 	MLX5_EXPANSION_OUTER_IPV4_ESP,
@@ -42 +42,0 @@
- 	MLX5_EXPANSION_OUTER_IPV6_ESP,
@@ -46 +46,2 @@
-@@ -582,8 +586,10 @@ enum mlx5_expansion {
+@@ -575,7 +579,9 @@ enum mlx5_expansion {
+ 	MLX5_EXPANSION_IPV4_UDP,
@@ -48 +48,0 @@
- 	MLX5_EXPANSION_IPV4_ESP,
@@ -53 +52,0 @@
- 	MLX5_EXPANSION_IPV6_ESP,
@@ -57 +56,2 @@
-@@ -621,4 +627,5 @@ static const struct mlx5_flow_expand_node mlx5_support_expansion[] = {
+@@ -612,4 +618,5 @@ static const struct mlx5_flow_expand_node mlx5_support_expansion[] = {
+ 			(MLX5_EXPANSION_OUTER_IPV4_UDP,
@@ -59 +58,0 @@
- 			 MLX5_EXPANSION_OUTER_IPV4_ESP,
@@ -63,2 +62,2 @@
-@@ -646,4 +653,7 @@ static const struct mlx5_flow_expand_node mlx5_support_expansion[] = {
- 		.rss_types = RTE_ETH_RSS_ESP,
+@@ -633,8 +640,12 @@ static const struct mlx5_flow_expand_node mlx5_support_expansion[] = {
+ 		.rss_types = RTE_ETH_RSS_NONFRAG_IPV4_TCP,
@@ -71 +70 @@
-@@ -651,4 +661,5 @@ static const struct mlx5_flow_expand_node mlx5_support_expansion[] = {
+ 			(MLX5_EXPANSION_OUTER_IPV6_UDP,
@@ -73 +71,0 @@
- 			 MLX5_EXPANSION_OUTER_IPV6_ESP,
@@ -77,2 +75,2 @@
-@@ -676,4 +687,7 @@ static const struct mlx5_flow_expand_node mlx5_support_expansion[] = {
- 		.rss_types = RTE_ETH_RSS_ESP,
+@@ -658,4 +669,7 @@ static const struct mlx5_flow_expand_node mlx5_support_expansion[] = {
+ 		.rss_types = RTE_ETH_RSS_NONFRAG_IPV6_TCP,
@@ -85 +83,2 @@
-@@ -736,5 +750,6 @@ static const struct mlx5_flow_expand_node mlx5_support_expansion[] = {
+@@ -717,5 +731,6 @@ static const struct mlx5_flow_expand_node mlx5_support_expansion[] = {
+ 	[MLX5_EXPANSION_IPV4] = {
@@ -87,3 +86,2 @@
- 						  MLX5_EXPANSION_IPV4_TCP,
--						  MLX5_EXPANSION_IPV4_ESP),
-+						  MLX5_EXPANSION_IPV4_ESP,
+-						  MLX5_EXPANSION_IPV4_TCP),
++						  MLX5_EXPANSION_IPV4_TCP,
@@ -93,2 +91,2 @@
-@@ -753,8 +768,12 @@ static const struct mlx5_flow_expand_node mlx5_support_expansion[] = {
- 		.rss_types = RTE_ETH_RSS_ESP,
+@@ -730,7 +745,11 @@ static const struct mlx5_flow_expand_node mlx5_support_expansion[] = {
+ 		.rss_types = RTE_ETH_RSS_NONFRAG_IPV4_TCP,
@@ -102 +99,0 @@
- 						  MLX5_EXPANSION_IPV6_ESP,
@@ -106 +103 @@
-@@ -777,4 +796,7 @@ static const struct mlx5_flow_expand_node mlx5_support_expansion[] = {
+@@ -749,4 +768,7 @@ static const struct mlx5_flow_expand_node mlx5_support_expansion[] = {


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

* patch 'net/mlx5: add limitation for E-Switch Manager match' has been queued to stable release 21.11.2
  2022-06-24 16:10 patch 'malloc: fix allocation of almost hugepage size' has been queued to stable release 21.11.2 Kevin Traynor
                   ` (8 preceding siblings ...)
  2022-06-24 16:10 ` patch 'net/mlx5: fix RSS expansion for patterns with ICMP item' " Kevin Traynor
@ 2022-06-24 16:10 ` Kevin Traynor
  2022-06-24 16:10 ` patch 'net/mlx5: fix metering on E-Switch Manager' " Kevin Traynor
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Kevin Traynor @ 2022-06-24 16:10 UTC (permalink / raw)
  To: Shun Hao; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 21.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/27/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

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

Thanks.

Kevin

---
From aa8fb4afda77b0e0161f296a3f511cc0c8b5835e Mon Sep 17 00:00:00 2001
From: Shun Hao <shunh@nvidia.com>
Date: Sun, 19 Jun 2022 06:21:27 +0300
Subject: [PATCH] net/mlx5: add limitation for E-Switch Manager match

[ upstream commit 68e9925c30a1a311a945ea72f23a08ce3deebdce ]

For BF with old FW which doesn't expose the E-Switch Manager vport ID,
E-Switch Manager port matching works correctly only when BF is in
embedded CPU mode.

This patch adds the limitation description.

Fixes: a564038699f9 ("net/mlx5: support E-Switch manager egress traffic match")

Signed-off-by: Shun Hao <shunh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 doc/guides/nics/mlx5.rst        |  6 ++++++
 drivers/net/mlx5/mlx5_flow.h    |  4 ++++
 drivers/net/mlx5/mlx5_flow_dv.c | 10 ++++++++--
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst
index b3f1673b55..7a616784eb 100644
--- a/doc/guides/nics/mlx5.rst
+++ b/doc/guides/nics/mlx5.rst
@@ -361,4 +361,10 @@ Limitations
   - must specify PF port action (packet redirection from VF to PF).
 
+- E-Switch Manager matching:
+
+  - For Bluefield with old FW
+    which doesn't expose the E-Switch Manager vport ID in the capability,
+    matching E-Switch Manager should be used only in Bluefield embedded CPU mode.
+
 - Raw encapsulation:
 
diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h
index 64335b8670..3e34b1c08a 100644
--- a/drivers/net/mlx5/mlx5_flow.h
+++ b/drivers/net/mlx5/mlx5_flow.h
@@ -1767,3 +1767,7 @@ mlx5_get_tof(const struct rte_flow_item *items,
 	     const struct rte_flow_action *actions,
 	     enum mlx5_tof_rule_type *rule_type);
+
+#define MLX5_PF_VPORT_ID 0
+#define MLX5_ECPF_VPORT_ID 0xFFFE
+
 #endif /* RTE_PMD_MLX5_FLOW_H_ */
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index b6f552bc62..1ceb6a0cd7 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -100,4 +100,5 @@ flow_dv_get_esw_manager_vport_id(struct rte_eth_dev *dev)
 	struct mlx5_common_device *cdev = priv->sh->cdev;
 
+	/* New FW exposes E-Switch Manager vport ID, can use it directly. */
 	if (cdev->config.hca_attr.esw_mgr_vport_id_valid)
 		return (int16_t)cdev->config.hca_attr.esw_mgr_vport_id;
@@ -109,7 +110,12 @@ flow_dv_get_esw_manager_vport_id(struct rte_eth_dev *dev)
 	case PCI_DEVICE_ID_MELLANOX_CONNECTX6DXBF:
 	case PCI_DEVICE_ID_MELLANOX_CONNECTX7BF:
-		return (int16_t)0xfffe;
+	/*
+	 * In old FW which doesn't expose the E-Switch Manager vport ID in the capability,
+	 * only the BF embedded CPUs control the E-Switch Manager port. Hence,
+	 * ECPF vport ID is selected and not the host port (0) in any BF case.
+	 */
+		return (int16_t)MLX5_ECPF_VPORT_ID;
 	default:
-		return 0;
+		return MLX5_PF_VPORT_ID;
 	}
 }
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-24 16:54:05.871645776 +0100
+++ 0011-net-mlx5-add-limitation-for-E-Switch-Manager-match.patch	2022-06-24 16:54:05.571165130 +0100
@@ -1 +1 @@
-From 68e9925c30a1a311a945ea72f23a08ce3deebdce Mon Sep 17 00:00:00 2001
+From aa8fb4afda77b0e0161f296a3f511cc0c8b5835e Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 68e9925c30a1a311a945ea72f23a08ce3deebdce ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -24 +25 @@
-index 4cd693ab4a..915467d58a 100644
+index b3f1673b55..7a616784eb 100644
@@ -27 +28 @@
-@@ -359,4 +359,10 @@ Limitations
+@@ -361,4 +361,10 @@ Limitations
@@ -39 +40 @@
-index f00c033fc5..7300390070 100644
+index 64335b8670..3e34b1c08a 100644
@@ -42,3 +43,3 @@
-@@ -2077,3 +2077,7 @@ size_t flow_dv_get_item_hdr_len(const enum rte_flow_item_type item_type);
- int flow_dv_convert_encap_data(const struct rte_flow_item *items, uint8_t *buf,
- 			   size_t *size, struct rte_flow_error *error);
+@@ -1767,3 +1767,7 @@ mlx5_get_tof(const struct rte_flow_item *items,
+ 	     const struct rte_flow_action *actions,
+ 	     enum mlx5_tof_rule_type *rule_type);
@@ -51 +52 @@
-index 65b02b20ce..09f662bdcf 100644
+index b6f552bc62..1ceb6a0cd7 100644


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

* patch 'net/mlx5: fix metering on E-Switch Manager' has been queued to stable release 21.11.2
  2022-06-24 16:10 patch 'malloc: fix allocation of almost hugepage size' has been queued to stable release 21.11.2 Kevin Traynor
                   ` (9 preceding siblings ...)
  2022-06-24 16:10 ` patch 'net/mlx5: add limitation for E-Switch Manager match' " Kevin Traynor
@ 2022-06-24 16:10 ` Kevin Traynor
  2022-06-24 16:10 ` patch 'net/mlx5: fix stack buffer overflow in drop action' " Kevin Traynor
  2022-06-24 16:10 ` patch 'doc: fix flow integrity hardware support in mlx5 guide' " Kevin Traynor
  12 siblings, 0 replies; 14+ messages in thread
From: Kevin Traynor @ 2022-06-24 16:10 UTC (permalink / raw)
  To: Shun Hao; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 21.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/27/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

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

Thanks.

Kevin

---
From f8b370bbb4bfb1b25ed19713113d8ff0d9905741 Mon Sep 17 00:00:00 2001
From: Shun Hao <shunh@nvidia.com>
Date: Sun, 19 Jun 2022 06:21:28 +0300
Subject: [PATCH] net/mlx5: fix metering on E-Switch Manager

[ upstream commit 92b3c68e9f103d1e2449f8572854bb16bd736637 ]

When meter is used by E-Switch Manager port, there's an error that
cannot get correct port ID.

This patch fixes this by using specific parsing process to get port
ID for E-Switch Manager.

Fixes: 3c481324baf3 ("net/mlx5: fix meter flow direction check")

Signed-off-by: Shun Hao <shunh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow.c    | 93 ++++++++++++++++++++++++++++-----
 drivers/net/mlx5/mlx5_flow.h    |  6 +++
 drivers/net/mlx5/mlx5_flow_dv.c | 46 ++--------------
 3 files changed, 91 insertions(+), 54 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 94fb2d8c95..42de516bfd 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -5058,5 +5058,5 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
 	struct rte_flow_action *hw_mtr_action;
 	struct rte_flow_action *action_pre_head = NULL;
-	int32_t flow_src_port = priv->representor_id;
+	uint16_t flow_src_port = priv->representor_id;
 	bool mtr_first;
 	uint8_t mtr_id_offset = priv->mtr_reg_share ? MLX5_MTR_COLOR_BITS : 0;
@@ -5072,20 +5072,10 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
 	tag_item = sfx_items++;
 	for (; items->type != RTE_FLOW_ITEM_TYPE_END; items++) {
-		struct mlx5_priv *port_priv;
-		const struct rte_flow_item_port_id *pid_v;
 		int item_type = items->type;
 
 		switch (item_type) {
 		case RTE_FLOW_ITEM_TYPE_PORT_ID:
-			pid_v = items->spec;
-			MLX5_ASSERT(pid_v);
-			port_priv = mlx5_port_to_eswitch_info(pid_v->id, false);
-			if (!port_priv)
-				return rte_flow_error_set(error,
-						rte_errno,
-						RTE_FLOW_ERROR_TYPE_ITEM_SPEC,
-						pid_v,
-						"Failed to get port info.");
-			flow_src_port = port_priv->representor_id;
+			if (mlx5_flow_get_item_vport_id(dev, items, &flow_src_port, error))
+				return -rte_errno;
 			if (!fm->def_policy && wks->policy->is_hierarchy &&
 			    flow_src_port != priv->representor_id) {
@@ -10165,2 +10155,79 @@ mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority,
 	return  res;
 }
+
+/**
+ * Get the E-Switch Manager vport id.
+ *
+ * @param[in] dev
+ *   Pointer to the Ethernet device structure.
+ *
+ * @return
+ *   The vport id.
+ */
+int16_t mlx5_flow_get_esw_manager_vport_id(struct rte_eth_dev *dev)
+{
+	struct mlx5_priv *priv = dev->data->dev_private;
+	struct mlx5_common_device *cdev = priv->sh->cdev;
+
+	/* New FW exposes E-Switch Manager vport ID, can use it directly. */
+	if (cdev->config.hca_attr.esw_mgr_vport_id_valid)
+		return (int16_t)cdev->config.hca_attr.esw_mgr_vport_id;
+
+	if (priv->pci_dev == NULL)
+		return 0;
+	switch (priv->pci_dev->id.device_id) {
+	case PCI_DEVICE_ID_MELLANOX_CONNECTX5BF:
+	case PCI_DEVICE_ID_MELLANOX_CONNECTX6DXBF:
+	case PCI_DEVICE_ID_MELLANOX_CONNECTX7BF:
+	/*
+	 * In old FW which doesn't expose the E-Switch Manager vport ID in the capability,
+	 * only the BF embedded CPUs control the E-Switch Manager port. Hence,
+	 * ECPF vport ID is selected and not the host port (0) in any BF case.
+	 */
+		return (int16_t)MLX5_ECPF_VPORT_ID;
+	default:
+		return MLX5_PF_VPORT_ID;
+	}
+}
+
+/**
+ * Parse item to get the vport id.
+ *
+ * @param[in] dev
+ *   Pointer to the Ethernet device structure.
+ * @param[in] item
+ *   The src port id match item.
+ * @param[out] vport_id
+ *   Pointer to put the vport id.
+ * @param[out] error
+ *   Pointer to error structure.
+ *
+ * @return
+ *   0 on success, a negative errno value otherwise and rte_errno is set.
+ */
+int mlx5_flow_get_item_vport_id(struct rte_eth_dev *dev,
+				const struct rte_flow_item *item,
+				uint16_t *vport_id,
+				struct rte_flow_error *error)
+{
+	struct mlx5_priv *port_priv;
+	const struct rte_flow_item_port_id *pid_v;
+
+	if (item->type != RTE_FLOW_ITEM_TYPE_PORT_ID)
+		return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM_SPEC,
+					  NULL, "Incorrect item type.");
+	pid_v = item->spec;
+	if (!pid_v)
+		return 0;
+	if (pid_v->id == MLX5_PORT_ESW_MGR) {
+		*vport_id = mlx5_flow_get_esw_manager_vport_id(dev);
+	} else {
+		port_priv = mlx5_port_to_eswitch_info(pid_v->id, false);
+		if (!port_priv)
+			return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM_SPEC,
+						  NULL, "Failed to get port info.");
+		*vport_id = port_priv->representor_id;
+	}
+
+	return 0;
+}
diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h
index 3e34b1c08a..29ccb98351 100644
--- a/drivers/net/mlx5/mlx5_flow.h
+++ b/drivers/net/mlx5/mlx5_flow.h
@@ -1771,3 +1771,9 @@ mlx5_get_tof(const struct rte_flow_item *items,
 #define MLX5_ECPF_VPORT_ID 0xFFFE
 
+int16_t mlx5_flow_get_esw_manager_vport_id(struct rte_eth_dev *dev);
+int mlx5_flow_get_item_vport_id(struct rte_eth_dev *dev,
+				const struct rte_flow_item *item,
+				uint16_t *vport_id,
+				struct rte_flow_error *error);
+
 #endif /* RTE_PMD_MLX5_FLOW_H_ */
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 1ceb6a0cd7..dfa0dc0aad 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -94,31 +94,4 @@ flow_dv_jump_tbl_resource_release(struct rte_eth_dev *dev,
 				  uint32_t rix_jump);
 
-static int16_t
-flow_dv_get_esw_manager_vport_id(struct rte_eth_dev *dev)
-{
-	struct mlx5_priv *priv = dev->data->dev_private;
-	struct mlx5_common_device *cdev = priv->sh->cdev;
-
-	/* New FW exposes E-Switch Manager vport ID, can use it directly. */
-	if (cdev->config.hca_attr.esw_mgr_vport_id_valid)
-		return (int16_t)cdev->config.hca_attr.esw_mgr_vport_id;
-
-	if (priv->pci_dev == NULL)
-		return 0;
-	switch (priv->pci_dev->id.device_id) {
-	case PCI_DEVICE_ID_MELLANOX_CONNECTX5BF:
-	case PCI_DEVICE_ID_MELLANOX_CONNECTX6DXBF:
-	case PCI_DEVICE_ID_MELLANOX_CONNECTX7BF:
-	/*
-	 * In old FW which doesn't expose the E-Switch Manager vport ID in the capability,
-	 * only the BF embedded CPUs control the E-Switch Manager port. Hence,
-	 * ECPF vport ID is selected and not the host port (0) in any BF case.
-	 */
-		return (int16_t)MLX5_ECPF_VPORT_ID;
-	default:
-		return MLX5_PF_VPORT_ID;
-	}
-}
-
 /**
  * Initialize flow attributes structure according to flow items' types.
@@ -5245,19 +5218,10 @@ mlx5_flow_validate_action_meter(struct rte_eth_dev *dev,
 			struct mlx5_priv *policy_port_priv =
 					mtr_policy->dev->data->dev_private;
-			int32_t flow_src_port = priv->representor_id;
+			uint16_t flow_src_port = priv->representor_id;
 
 			if (port_id_item) {
-				const struct rte_flow_item_port_id *spec =
-							port_id_item->spec;
-				struct mlx5_priv *port_priv =
-					mlx5_port_to_eswitch_info(spec->id,
-								  false);
-				if (!port_priv)
-					return rte_flow_error_set(error,
-						rte_errno,
-						RTE_FLOW_ERROR_TYPE_ITEM_SPEC,
-						spec,
-						"Failed to get port info.");
-				flow_src_port = port_priv->representor_id;
+				if (mlx5_flow_get_item_vport_id(dev, port_id_item,
+								&flow_src_port, error))
+					return -rte_errno;
 			}
 			if (flow_src_port != policy_port_priv->representor_id)
@@ -9785,5 +9749,5 @@ flow_dv_translate_item_port_id(struct rte_eth_dev *dev, void *matcher,
 	if (pid_v && pid_v->id == MLX5_PORT_ESW_MGR) {
 		flow_dv_translate_item_source_vport(matcher, key,
-			flow_dv_get_esw_manager_vport_id(dev), 0xffff);
+			mlx5_flow_get_esw_manager_vport_id(dev), 0xffff);
 		return 0;
 	}
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-24 16:54:05.908056719 +0100
+++ 0012-net-mlx5-fix-metering-on-E-Switch-Manager.patch	2022-06-24 16:54:05.594165193 +0100
@@ -1 +1 @@
-From 92b3c68e9f103d1e2449f8572854bb16bd736637 Mon Sep 17 00:00:00 2001
+From f8b370bbb4bfb1b25ed19713113d8ff0d9905741 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 92b3c68e9f103d1e2449f8572854bb16bd736637 ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -20,2 +21,2 @@
- drivers/net/mlx5/mlx5_flow_dv.c | 48 +++--------------
- 3 files changed, 92 insertions(+), 55 deletions(-)
+ drivers/net/mlx5/mlx5_flow_dv.c | 46 ++--------------
+ 3 files changed, 91 insertions(+), 54 deletions(-)
@@ -24 +25 @@
-index 900ec8e4bc..8c93a3f2e5 100644
+index 94fb2d8c95..42de516bfd 100644
@@ -27 +28 @@
-@@ -5320,5 +5320,5 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
+@@ -5058,5 +5058,5 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
@@ -34 +35 @@
-@@ -5334,20 +5334,10 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
+@@ -5072,20 +5072,10 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
@@ -57 +58 @@
-@@ -10978,2 +10968,79 @@ mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority,
+@@ -10165,2 +10155,79 @@ mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority,
@@ -138 +139 @@
-index 7300390070..4c233cd94a 100644
+index 3e34b1c08a..29ccb98351 100644
@@ -141 +142 @@
-@@ -2081,3 +2081,9 @@ int flow_dv_convert_encap_data(const struct rte_flow_item *items, uint8_t *buf,
+@@ -1771,3 +1771,9 @@ mlx5_get_tof(const struct rte_flow_item *items,
@@ -152 +153 @@
-index 09f662bdcf..09349a021b 100644
+index 1ceb6a0cd7..dfa0dc0aad 100644
@@ -187 +188 @@
-@@ -5335,19 +5308,10 @@ mlx5_flow_validate_action_meter(struct rte_eth_dev *dev,
+@@ -5245,19 +5218,10 @@ mlx5_flow_validate_action_meter(struct rte_eth_dev *dev,
@@ -211 +212 @@
-@@ -10048,5 +10012,5 @@ flow_dv_translate_item_port_id(struct rte_eth_dev *dev, void *matcher,
+@@ -9785,5 +9749,5 @@ flow_dv_translate_item_port_id(struct rte_eth_dev *dev, void *matcher,
@@ -216,7 +216,0 @@
- 		return 0;
- 	}
-@@ -10119,5 +10083,5 @@ flow_dv_translate_item_represented_port(struct rte_eth_dev *dev, void *matcher,
- 	if (pid_v && pid_v->port_id == UINT16_MAX) {
- 		flow_dv_translate_item_source_vport(matcher, key,
--			flow_dv_get_esw_manager_vport_id(dev), UINT16_MAX);
-+			mlx5_flow_get_esw_manager_vport_id(dev), UINT16_MAX);


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

* patch 'net/mlx5: fix stack buffer overflow in drop action' has been queued to stable release 21.11.2
  2022-06-24 16:10 patch 'malloc: fix allocation of almost hugepage size' has been queued to stable release 21.11.2 Kevin Traynor
                   ` (10 preceding siblings ...)
  2022-06-24 16:10 ` patch 'net/mlx5: fix metering on E-Switch Manager' " Kevin Traynor
@ 2022-06-24 16:10 ` Kevin Traynor
  2022-06-24 16:10 ` patch 'doc: fix flow integrity hardware support in mlx5 guide' " Kevin Traynor
  12 siblings, 0 replies; 14+ messages in thread
From: Kevin Traynor @ 2022-06-24 16:10 UTC (permalink / raw)
  To: Yunjian Wang; +Cc: Viacheslav Ovsiienko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 21.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/27/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

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

Thanks.

Kevin

---
From 02017fcad3748e8f32e7e022572d524ae0a9fd71 Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian@huawei.com>
Date: Fri, 24 Dec 2021 11:06:19 +0800
Subject: [PATCH] net/mlx5: fix stack buffer overflow in drop action

[ upstream commit a73b78554aee830605c8d8714239dc53fa443d5e ]

The mlx5_drop_action_create function use mlx5_malloc for allocating
'hrxq', but don't allocate for 'rss_key'. This is wrong and it can
cause buffer overflow.

Detected with address sanitizer:
0 (/usr/lib64/libasan.so.4+0x7b8e2)
1 in mlx5_devx_tir_attr_set ../drivers/net/mlx5/mlx5_devx.c:765
2 in mlx5_devx_hrxq_new ../drivers/net/mlx5/mlx5_devx.c:800
3 in mlx5_devx_drop_action_create ../drivers/net/mlx5/mlx5_devx.c:1051
4 in mlx5_drop_action_create ../drivers/net/mlx5/mlx5_rxq.c:2846
5 in mlx5_dev_spawn ../drivers/net/mlx5/linux/mlx5_os.c:1743
6 in mlx5_os_pci_probe_pf ../drivers/net/mlx5/linux/mlx5_os.c:2501
7 in mlx5_os_pci_probe ../drivers/net/mlx5/linux/mlx5_os.c:2647
8 in mlx5_os_net_probe ../drivers/net/mlx5/linux/mlx5_os.c:2722
9 in drivers_probe ../drivers/common/mlx5/mlx5_common.c:657
10 in mlx5_common_dev_probe ../drivers/common/mlx5/mlx5_common.c:711
11 in mlx5_common_pci_probe ../drivers/common/mlx5/mlx5_common_pci.c:150
12 in rte_pci_probe_one_driver ../drivers/bus/pci/pci_common.c:269
13 in pci_probe_all_drivers ../drivers/bus/pci/pci_common.c:353
14 in pci_probe ../drivers/bus/pci/pci_common.c:380
15 in rte_bus_probe ../lib/eal/common/eal_common_bus.c:72
16 in rte_eal_init ../lib/eal/linux/eal.c:1286
17 in main ../app/test-pmd/testpmd.c:4112

Fixes: 0c762e81da9b ("net/mlx5: share Rx queue drop action code")

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/mlx5_rxq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 4f32ae3b8d..807aaf2fc9 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -2918,5 +2918,5 @@ mlx5_drop_action_create(struct rte_eth_dev *dev)
 	if (priv->drop_queue.hrxq)
 		return priv->drop_queue.hrxq;
-	hrxq = mlx5_malloc(MLX5_MEM_ZERO, sizeof(*hrxq), 0, SOCKET_ID_ANY);
+	hrxq = mlx5_malloc(MLX5_MEM_ZERO, sizeof(*hrxq) + MLX5_RSS_HASH_KEY_LEN, 0, SOCKET_ID_ANY);
 	if (!hrxq) {
 		DRV_LOG(WARNING,
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-24 16:54:05.948741925 +0100
+++ 0013-net-mlx5-fix-stack-buffer-overflow-in-drop-action.patch	2022-06-24 16:54:05.596165198 +0100
@@ -1 +1 @@
-From a73b78554aee830605c8d8714239dc53fa443d5e Mon Sep 17 00:00:00 2001
+From 02017fcad3748e8f32e7e022572d524ae0a9fd71 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a73b78554aee830605c8d8714239dc53fa443d5e ]
+
@@ -31 +32,0 @@
-Cc: stable@dpdk.org
@@ -40 +41 @@
-index a2d03f9f67..eaf23d0df4 100644
+index 4f32ae3b8d..807aaf2fc9 100644
@@ -43 +44 @@
-@@ -3079,5 +3079,5 @@ mlx5_drop_action_create(struct rte_eth_dev *dev)
+@@ -2918,5 +2918,5 @@ mlx5_drop_action_create(struct rte_eth_dev *dev)


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

* patch 'doc: fix flow integrity hardware support in mlx5 guide' has been queued to stable release 21.11.2
  2022-06-24 16:10 patch 'malloc: fix allocation of almost hugepage size' has been queued to stable release 21.11.2 Kevin Traynor
                   ` (11 preceding siblings ...)
  2022-06-24 16:10 ` patch 'net/mlx5: fix stack buffer overflow in drop action' " Kevin Traynor
@ 2022-06-24 16:10 ` Kevin Traynor
  12 siblings, 0 replies; 14+ messages in thread
From: Kevin Traynor @ 2022-06-24 16:10 UTC (permalink / raw)
  To: Gregory Etelson; +Cc: Viacheslav Ovsiienko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 21.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/27/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

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

Thanks.

Kevin

---
From 0de69e279d74e63554b0582617c998c237c10a2b Mon Sep 17 00:00:00 2001
From: Gregory Etelson <getelson@nvidia.com>
Date: Thu, 16 Jun 2022 11:43:14 +0300
Subject: [PATCH] doc: fix flow integrity hardware support in mlx5 guide

[ upstream commit 261d96b29e27aa69bd39ad76432f8a50c50ba817 ]

Current MLX5 PMD documentation says that entire `ConnectX-6` family
supports flow integrity feature.

Flow integrity offload is not supported on vanilla `ConnectX-6`.
It is available on `ConnectX-6 Dx`, `ConnectX-6 Lx` and
`BlueField 2`.

Fixes: 79f8952783d0 ("net/mlx5: support integrity flow item")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 doc/guides/nics/mlx5.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst
index 7a616784eb..bcbaa97dae 100644
--- a/doc/guides/nics/mlx5.rst
+++ b/doc/guides/nics/mlx5.rst
@@ -477,5 +477,5 @@ Limitations
 - Integrity:
 
-  - Integrity offload is enabled for **ConnectX-6** family.
+  - Integrity offload is enabled starting from **ConnectX-6 Dx**.
   - Verification bits provided by the hardware are ``l3_ok``, ``ipv4_csum_ok``, ``l4_ok``, ``l4_csum_ok``.
   - ``level`` value 0 references outer headers.
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-24 16:54:05.984622279 +0100
+++ 0014-doc-fix-flow-integrity-hardware-support-in-mlx5-guid.patch	2022-06-24 16:54:05.598165203 +0100
@@ -1 +1 @@
-From 261d96b29e27aa69bd39ad76432f8a50c50ba817 Mon Sep 17 00:00:00 2001
+From 0de69e279d74e63554b0582617c998c237c10a2b Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 261d96b29e27aa69bd39ad76432f8a50c50ba817 ]
+
@@ -14 +15,0 @@
-Cc: stable@dpdk.org
@@ -23 +24 @@
-index 915467d58a..bc2bd2c8a6 100644
+index 7a616784eb..bcbaa97dae 100644


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

end of thread, other threads:[~2022-06-24 16:10 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-24 16:10 patch 'malloc: fix allocation of almost hugepage size' has been queued to stable release 21.11.2 Kevin Traynor
2022-06-24 16:10 ` patch 'net/octeontx: fix port close' " Kevin Traynor
2022-06-24 16:10 ` patch 'common/cnxk: fix decrypt packet count register update' " Kevin Traynor
2022-06-24 16:10 ` patch 'common/cnxk: handle ROC model init failure' " Kevin Traynor
2022-06-24 16:10 ` patch 'net/qede: fix build with GCC 13' " Kevin Traynor
2022-06-24 16:10 ` patch 'net/ice: fix race condition in Rx timestamp' " Kevin Traynor
2022-06-24 16:10 ` patch 'net/ice/base: fix build with GCC 12' " Kevin Traynor
2022-06-24 16:10 ` patch 'net/qede: " Kevin Traynor
2022-06-24 16:10 ` patch 'net/mlx5: fix build with clang 14' " Kevin Traynor
2022-06-24 16:10 ` patch 'net/mlx5: fix RSS expansion for patterns with ICMP item' " Kevin Traynor
2022-06-24 16:10 ` patch 'net/mlx5: add limitation for E-Switch Manager match' " Kevin Traynor
2022-06-24 16:10 ` patch 'net/mlx5: fix metering on E-Switch Manager' " Kevin Traynor
2022-06-24 16:10 ` patch 'net/mlx5: fix stack buffer overflow in drop action' " Kevin Traynor
2022-06-24 16:10 ` patch 'doc: fix flow integrity hardware support in mlx5 guide' " Kevin Traynor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).