patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10
@ 2021-08-10 15:38 christian.ehrhardt
  2021-08-10 15:38 ` [dpdk-stable] patch 'net/bnxt: check access to possible null pointer' " christian.ehrhardt
                   ` (100 more replies)
  0 siblings, 101 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:38 UTC (permalink / raw)
  To: Ivan Ilchenko
  Cc: Andy Moreton, Andrew Rybchenko, Cristian Dumitrescu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/c7fc0792f6b55255d2ee1c1fecad4d0a73cab28f

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From c7fc0792f6b55255d2ee1c1fecad4d0a73cab28f Mon Sep 17 00:00:00 2001
From: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Date: Wed, 2 Jun 2021 12:49:22 +0300
Subject: [PATCH] bitmap: fix buffer overrun in bitmap init

[ upstream commit 1ffd3bc1252ee871398dad227cd651658dc76939 ]

Bitmap initialization function is allowed to memset()
caller-provided buffer with number of bytes exceeded
this buffer size. This happens due to wrong comparison
sign between buffer size and number of bytes required
to initialize bitmap.

Fixes: 602c9ca33a4 ("sched: bitmap is now dynamically allocated")

Reported-by: Andy Moreton <amoreton@xilinx.com>
Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
 lib/librte_eal/common/include/rte_bitmap.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/librte_eal/common/include/rte_bitmap.h b/lib/librte_eal/common/include/rte_bitmap.h
index 6b846f251b..9f9465ab12 100644
--- a/lib/librte_eal/common/include/rte_bitmap.h
+++ b/lib/librte_eal/common/include/rte_bitmap.h
@@ -185,9 +185,8 @@ rte_bitmap_init(uint32_t n_bits, uint8_t *mem, uint32_t mem_size)
 	size = __rte_bitmap_get_memory_footprint(n_bits,
 		&array1_byte_offset, &array1_slabs,
 		&array2_byte_offset, &array2_slabs);
-	if (size < mem_size) {
+	if (size > mem_size)
 		return NULL;
-	}
 
 	/* Setup bitmap */
 	memset(mem, 0, size);
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:13.158582860 +0200
+++ 0001-bitmap-fix-buffer-overrun-in-bitmap-init.patch	2021-08-10 15:11:12.886637147 +0200
@@ -1 +1 @@
-From 1ffd3bc1252ee871398dad227cd651658dc76939 Mon Sep 17 00:00:00 2001
+From c7fc0792f6b55255d2ee1c1fecad4d0a73cab28f Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 1ffd3bc1252ee871398dad227cd651658dc76939 ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -21 +22 @@
- lib/eal/include/rte_bitmap.h | 3 +--
+ lib/librte_eal/common/include/rte_bitmap.h | 3 +--
@@ -24,4 +25,4 @@
-diff --git a/lib/eal/include/rte_bitmap.h b/lib/eal/include/rte_bitmap.h
-index 9e2b8f2cbf..e4623bb176 100644
---- a/lib/eal/include/rte_bitmap.h
-+++ b/lib/eal/include/rte_bitmap.h
+diff --git a/lib/librte_eal/common/include/rte_bitmap.h b/lib/librte_eal/common/include/rte_bitmap.h
+index 6b846f251b..9f9465ab12 100644
+--- a/lib/librte_eal/common/include/rte_bitmap.h
++++ b/lib/librte_eal/common/include/rte_bitmap.h

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

* [dpdk-stable] patch 'net/bnxt: check access to possible null pointer' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
@ 2021-08-10 15:38 ` christian.ehrhardt
  2021-08-10 15:38 ` [dpdk-stable] patch 'net/bnxt: fix error messages in VNIC prepare' " christian.ehrhardt
                   ` (99 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:38 UTC (permalink / raw)
  To: Thierry Herbelot; +Cc: Ajit Khaparde, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/839b753bfcd68c4d628527c869fae708f2deb680

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 839b753bfcd68c4d628527c869fae708f2deb680 Mon Sep 17 00:00:00 2001
From: Thierry Herbelot <thierry.herbelot@6wind.com>
Date: Mon, 24 May 2021 11:00:38 +0200
Subject: [PATCH] net/bnxt: check access to possible null pointer

[ upstream commit dc59260fb68960ab4296d974370594f6ea31ab9f ]

Check that pointers are valid before using them.

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

Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_irq.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c
index 40e1b0c980..93779f4e0c 100644
--- a/drivers/net/bnxt/bnxt_irq.c
+++ b/drivers/net/bnxt/bnxt_irq.c
@@ -21,11 +21,14 @@ void bnxt_int_handler(void *param)
 {
 	struct rte_eth_dev *eth_dev = (struct rte_eth_dev *)param;
 	struct bnxt *bp = eth_dev->data->dev_private;
-	struct bnxt_cp_ring_info *cpr = bp->async_cp_ring;
+	struct bnxt_cp_ring_info *cpr;
 	struct cmpl_base *cmp;
 	uint32_t raw_cons;
 	uint32_t cons;
 
+	if (bp == NULL)
+		return;
+	cpr = bp->async_cp_ring;
 	if (cpr == NULL)
 		return;
 
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:13.183648054 +0200
+++ 0002-net-bnxt-check-access-to-possible-null-pointer.patch	2021-08-10 15:11:12.886637147 +0200
@@ -1 +1 @@
-From dc59260fb68960ab4296d974370594f6ea31ab9f Mon Sep 17 00:00:00 2001
+From 839b753bfcd68c4d628527c869fae708f2deb680 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit dc59260fb68960ab4296d974370594f6ea31ab9f ]
+
@@ -9 +10,0 @@
-Cc: stable@dpdk.org
@@ -18 +19 @@
-index 8abbadb3d1..fd8b8fac98 100644
+index 40e1b0c980..93779f4e0c 100644

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

* [dpdk-stable] patch 'net/bnxt: fix error messages in VNIC prepare' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
  2021-08-10 15:38 ` [dpdk-stable] patch 'net/bnxt: check access to possible null pointer' " christian.ehrhardt
@ 2021-08-10 15:38 ` christian.ehrhardt
  2021-08-10 15:38 ` [dpdk-stable] patch 'net/bnxt: set flow error when free filter not available' " christian.ehrhardt
                   ` (98 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:38 UTC (permalink / raw)
  To: Kalesh AP; +Cc: Somnath Kotur, Ajit Khaparde, Venkat Duvvuru, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/3e3ef06de595856b72bd7cf9b958d52c20f112bf

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 3e3ef06de595856b72bd7cf9b958d52c20f112bf Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Date: Mon, 31 May 2021 12:56:36 +0530
Subject: [PATCH] net/bnxt: fix error messages in VNIC prepare

[ upstream commit 52b0e588eb18f90bf2423e59cbb3ec58c490eb67 ]

The bnxt_vnic_prep() can fail due to multiple reasons.
But when bnxt_vnic_prep() fails, PMD is not returning
the actual error/string to the application.

Fix it by moving the "rte_flow_error_set" to bnxt_vnic_prep()
to set the actual error code.

Fixes: d24610f7bfda ("net/bnxt: allow flow creation when RSS is enabled")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
---
 drivers/net/bnxt/bnxt_flow.c | 66 ++++++++++++++++++++++--------------
 1 file changed, 40 insertions(+), 26 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
index bcddda4518..41be6b5d81 100644
--- a/drivers/net/bnxt/bnxt_flow.c
+++ b/drivers/net/bnxt/bnxt_flow.c
@@ -916,32 +916,46 @@ bnxt_get_l2_filter(struct bnxt *bp, struct bnxt_filter_info *nf,
 	return l2_filter;
 }
 
-static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic)
+static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic,
+			  const struct rte_flow_action *act,
+			  struct rte_flow_error *error)
 {
 	struct rte_eth_conf *dev_conf = &bp->eth_dev->data->dev_conf;
 	uint64_t rx_offloads = dev_conf->rxmode.offloads;
 	int rc;
 
 	if (bp->nr_vnics > bp->max_vnics - 1)
-		return -ENOMEM;
+		return rte_flow_error_set(error, EINVAL,
+					  RTE_FLOW_ERROR_TYPE_ATTR_GROUP,
+					  NULL,
+					  "Group id is invalid");
 
 	rc = bnxt_vnic_grp_alloc(bp, vnic);
 	if (rc)
-		goto ret;
+		return rte_flow_error_set(error, -rc,
+					  RTE_FLOW_ERROR_TYPE_ACTION,
+					  act,
+					  "Failed to alloc VNIC group");
 
 	rc = bnxt_hwrm_vnic_alloc(bp, vnic);
 	if (rc) {
-		PMD_DRV_LOG(ERR, "HWRM vnic alloc failure rc: %x\n", rc);
+		rte_flow_error_set(error, -rc,
+				   RTE_FLOW_ERROR_TYPE_ACTION,
+				   act,
+				   "Failed to alloc VNIC");
 		goto ret;
 	}
+
 	bp->nr_vnics++;
 
 	/* RSS context is required only when there is more than one RSS ring */
 	if (vnic->rx_queue_cnt > 1) {
 		rc = bnxt_hwrm_vnic_ctx_alloc(bp, vnic, 0 /* ctx_idx 0 */);
 		if (rc) {
-			PMD_DRV_LOG(ERR,
-				    "HWRM vnic ctx alloc failure: %x\n", rc);
+			rte_flow_error_set(error, -rc,
+					   RTE_FLOW_ERROR_TYPE_ACTION,
+					   act,
+					   "Failed to alloc VNIC context");
 			goto ret;
 		}
 	} else {
@@ -954,10 +968,24 @@ static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic)
 		vnic->vlan_strip = false;
 
 	rc = bnxt_hwrm_vnic_cfg(bp, vnic);
-	if (rc)
+	if (rc) {
+		rte_flow_error_set(error, -rc,
+				   RTE_FLOW_ERROR_TYPE_ACTION,
+				   act,
+				   "Failed to configure VNIC");
 		goto ret;
+	}
 
-	bnxt_hwrm_vnic_plcmode_cfg(bp, vnic);
+	rc = bnxt_hwrm_vnic_plcmode_cfg(bp, vnic);
+	if (rc) {
+		rte_flow_error_set(error, -rc,
+				   RTE_FLOW_ERROR_TYPE_ACTION,
+				   act,
+				   "Failed to configure VNIC plcmode");
+		goto ret;
+	}
+
+	return 0;
 
 ret:
 	return rc;
@@ -1129,16 +1157,9 @@ bnxt_validate_and_parse_flow(struct rte_eth_dev *dev,
 
 		PMD_DRV_LOG(DEBUG, "VNIC found\n");
 
-		rc = bnxt_vnic_prep(bp, vnic);
-		if (rc)  {
-			rte_flow_error_set(error,
-					   EINVAL,
-					   RTE_FLOW_ERROR_TYPE_ACTION,
-					   act,
-					   "VNIC prep fail");
-			rc = -rte_errno;
+		rc = bnxt_vnic_prep(bp, vnic, act, error);
+		if (rc)
 			goto ret;
-		}
 
 		PMD_DRV_LOG(DEBUG,
 			    "vnic[%d] = %p vnic->fw_grp_ids = %p\n",
@@ -1348,16 +1369,9 @@ use_vnic:
 		vnic->end_grp_id = rss->queue[rss->queue_num - 1];
 		vnic->func_default = 0;	//This is not a default VNIC.
 
-		rc = bnxt_vnic_prep(bp, vnic);
-		if (rc) {
-			rte_flow_error_set(error,
-					   EINVAL,
-					   RTE_FLOW_ERROR_TYPE_ACTION,
-					   act,
-					   "VNIC prep fail");
-			rc = -rte_errno;
+		rc = bnxt_vnic_prep(bp, vnic, act, error);
+		if (rc)
 			goto ret;
-		}
 
 		PMD_DRV_LOG(DEBUG,
 			    "vnic[%d] = %p vnic->fw_grp_ids = %p\n",
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:13.215310562 +0200
+++ 0003-net-bnxt-fix-error-messages-in-VNIC-prepare.patch	2021-08-10 15:11:12.890637177 +0200
@@ -1 +1 @@
-From 52b0e588eb18f90bf2423e59cbb3ec58c490eb67 Mon Sep 17 00:00:00 2001
+From 3e3ef06de595856b72bd7cf9b958d52c20f112bf Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 52b0e588eb18f90bf2423e59cbb3ec58c490eb67 ]
+
@@ -14 +15,0 @@
-Cc: stable@dpdk.org
@@ -25 +26 @@
-index 73fd24cd9a..66012b8057 100644
+index bcddda4518..41be6b5d81 100644
@@ -28 +29 @@
-@@ -919,32 +919,46 @@ bnxt_get_l2_filter(struct bnxt *bp, struct bnxt_filter_info *nf,
+@@ -916,32 +916,46 @@ bnxt_get_l2_filter(struct bnxt *bp, struct bnxt_filter_info *nf,
@@ -81 +82 @@
-@@ -957,10 +971,24 @@ static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic)
+@@ -954,10 +968,24 @@ static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic)
@@ -108 +109 @@
-@@ -1142,16 +1170,9 @@ start:
+@@ -1129,16 +1157,9 @@ bnxt_validate_and_parse_flow(struct rte_eth_dev *dev,
@@ -127 +128 @@
-@@ -1362,16 +1383,9 @@ skip_vnic_alloc:
+@@ -1348,16 +1369,9 @@ use_vnic:

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

* [dpdk-stable] patch 'net/bnxt: set flow error when free filter not available' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
  2021-08-10 15:38 ` [dpdk-stable] patch 'net/bnxt: check access to possible null pointer' " christian.ehrhardt
  2021-08-10 15:38 ` [dpdk-stable] patch 'net/bnxt: fix error messages in VNIC prepare' " christian.ehrhardt
@ 2021-08-10 15:38 ` christian.ehrhardt
  2021-08-10 15:38 ` [dpdk-stable] patch 'net/bnxt: remove unnecessary code' " christian.ehrhardt
                   ` (97 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:38 UTC (permalink / raw)
  To: Kalesh AP; +Cc: Ajit Khaparde, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/efb741b14dcda254455bd82fe0a4b897725f5ad6

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From efb741b14dcda254455bd82fe0a4b897725f5ad6 Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Date: Mon, 31 May 2021 12:56:37 +0530
Subject: [PATCH] net/bnxt: set flow error when free filter not available

[ upstream commit 94df7953ac6599c2887b859de19c541e5b5830d9 ]

In bnxt_flow_validate(), when bnxt_get_unused_filter() fails due to
no filter resources available, driver is not setting flow error using
"rte_flow_error_set".

Also, fixed the error code.

Fixes: 5ef3b79fdfe6 ("net/bnxt: support flow filter ops")

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

diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
index 41be6b5d81..ec36c6787e 100644
--- a/drivers/net/bnxt/bnxt_flow.c
+++ b/drivers/net/bnxt/bnxt_flow.c
@@ -1514,9 +1514,11 @@ bnxt_flow_validate(struct rte_eth_dev *dev,
 
 	filter = bnxt_get_unused_filter(bp);
 	if (filter == NULL) {
-		PMD_DRV_LOG(ERR, "Not enough resources for a new flow.\n");
+		rte_flow_error_set(error, ENOSPC,
+				   RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
+				   "Not enough resources for a new flow");
 		bnxt_release_flow_lock(bp);
-		return -ENOMEM;
+		return -ENOSPC;
 	}
 
 	ret = bnxt_validate_and_parse_flow(dev, pattern, actions, attr,
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:13.248000594 +0200
+++ 0004-net-bnxt-set-flow-error-when-free-filter-not-availab.patch	2021-08-10 15:11:12.894637205 +0200
@@ -1 +1 @@
-From 94df7953ac6599c2887b859de19c541e5b5830d9 Mon Sep 17 00:00:00 2001
+From efb741b14dcda254455bd82fe0a4b897725f5ad6 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 94df7953ac6599c2887b859de19c541e5b5830d9 ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -23 +24 @@
-index 66012b8057..9b4780773a 100644
+index 41be6b5d81..ec36c6787e 100644
@@ -26 +27 @@
-@@ -1550,9 +1550,11 @@ bnxt_flow_validate(struct rte_eth_dev *dev,
+@@ -1514,9 +1514,11 @@ bnxt_flow_validate(struct rte_eth_dev *dev,

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

* [dpdk-stable] patch 'net/bnxt: remove unnecessary code' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (2 preceding siblings ...)
  2021-08-10 15:38 ` [dpdk-stable] patch 'net/bnxt: set flow error when free filter not available' " christian.ehrhardt
@ 2021-08-10 15:38 ` christian.ehrhardt
  2021-08-10 15:38 ` [dpdk-stable] patch 'net/bnxt: fix error handling in VNIC prepare' " christian.ehrhardt
                   ` (96 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:38 UTC (permalink / raw)
  To: Kalesh AP; +Cc: Venkat Duvvuru, Ajit Khaparde, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/e3f51b8a460220553f2ed0d3f6a8d15ac6d7ca72

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From e3f51b8a460220553f2ed0d3f6a8d15ac6d7ca72 Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Date: Mon, 31 May 2021 12:56:38 +0530
Subject: [PATCH] net/bnxt: remove unnecessary code

[ upstream commit b93fe4db51c102f5fdb775c28b998197e6fb75c7 ]

Also removed a log message which does not convey any
useful information.

Fixes: d24610f7bfda ("net/bnxt: allow flow creation when RSS is enabled")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_flow.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
index ec36c6787e..c3f360d47a 100644
--- a/drivers/net/bnxt/bnxt_flow.c
+++ b/drivers/net/bnxt/bnxt_flow.c
@@ -950,7 +950,7 @@ static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic,
 
 	/* RSS context is required only when there is more than one RSS ring */
 	if (vnic->rx_queue_cnt > 1) {
-		rc = bnxt_hwrm_vnic_ctx_alloc(bp, vnic, 0 /* ctx_idx 0 */);
+		rc = bnxt_hwrm_vnic_ctx_alloc(bp, vnic, 0);
 		if (rc) {
 			rte_flow_error_set(error, -rc,
 					   RTE_FLOW_ERROR_TYPE_ACTION,
@@ -958,8 +958,6 @@ static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic,
 					   "Failed to alloc VNIC context");
 			goto ret;
 		}
-	} else {
-		PMD_DRV_LOG(DEBUG, "No RSS context required\n");
 	}
 
 	if (rx_offloads & DEV_RX_OFFLOAD_VLAN_STRIP)
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:13.284615426 +0200
+++ 0005-net-bnxt-remove-unnecessary-code.patch	2021-08-10 15:11:12.894637205 +0200
@@ -1 +1 @@
-From b93fe4db51c102f5fdb775c28b998197e6fb75c7 Mon Sep 17 00:00:00 2001
+From e3f51b8a460220553f2ed0d3f6a8d15ac6d7ca72 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b93fe4db51c102f5fdb775c28b998197e6fb75c7 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index 9b4780773a..d23f8cff6c 100644
+index ec36c6787e..c3f360d47a 100644
@@ -23 +24 @@
-@@ -953,7 +953,7 @@ static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic,
+@@ -950,7 +950,7 @@ static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic,
@@ -32 +33 @@
-@@ -961,8 +961,6 @@ static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic,
+@@ -958,8 +958,6 @@ static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic,

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

* [dpdk-stable] patch 'net/bnxt: fix error handling in VNIC prepare' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (3 preceding siblings ...)
  2021-08-10 15:38 ` [dpdk-stable] patch 'net/bnxt: remove unnecessary code' " christian.ehrhardt
@ 2021-08-10 15:38 ` christian.ehrhardt
  2021-08-10 15:38 ` [dpdk-stable] patch 'net/bnxt: set flow error after tunnel redirection free' " christian.ehrhardt
                   ` (95 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:38 UTC (permalink / raw)
  To: Kalesh AP; +Cc: Somnath Kotur, Ajit Khaparde, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/ec9a4839b5a2e2c53cab9e52d8d8518c5529e9cd

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From ec9a4839b5a2e2c53cab9e52d8d8518c5529e9cd Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Date: Mon, 31 May 2021 12:56:39 +0530
Subject: [PATCH] net/bnxt: fix error handling in VNIC prepare

[ upstream commit 4171ac66e5d3e2cef0f8e619b75883f9fe5adf12 ]

Resources should be freed on error conditions. i.e, VNIC and
VNIC context created in HW and memory allocated in
bnxt_vnic_grp_alloc() should be freed.

Added a new function bnxt_vnic_destroy() to do the cleanup.
This lightweight function can be used in flow destroy/flush
path to avoid duplicate code as well.

Fixes: d24610f7bfda ("net/bnxt: allow flow creation when RSS is enabled")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_flow.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
index c3f360d47a..82203c2411 100644
--- a/drivers/net/bnxt/bnxt_flow.c
+++ b/drivers/net/bnxt/bnxt_flow.c
@@ -916,6 +916,19 @@ bnxt_get_l2_filter(struct bnxt *bp, struct bnxt_filter_info *nf,
 	return l2_filter;
 }
 
+static void bnxt_vnic_cleanup(struct bnxt *bp, struct bnxt_vnic_info *vnic)
+{
+	if (vnic->rx_queue_cnt > 1)
+		bnxt_hwrm_vnic_ctx_free(bp, vnic);
+
+	bnxt_hwrm_vnic_free(bp, vnic);
+
+	rte_free(vnic->fw_grp_ids);
+	vnic->fw_grp_ids = NULL;
+
+	vnic->rx_queue_cnt = 0;
+}
+
 static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic,
 			  const struct rte_flow_action *act,
 			  struct rte_flow_error *error)
@@ -946,8 +959,6 @@ static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic,
 		goto ret;
 	}
 
-	bp->nr_vnics++;
-
 	/* RSS context is required only when there is more than one RSS ring */
 	if (vnic->rx_queue_cnt > 1) {
 		rc = bnxt_hwrm_vnic_ctx_alloc(bp, vnic, 0);
@@ -983,9 +994,12 @@ static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic,
 		goto ret;
 	}
 
+	bp->nr_vnics++;
+
 	return 0;
 
 ret:
+	bnxt_vnic_cleanup(bp, vnic);
 	return rc;
 }
 
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:13.317989320 +0200
+++ 0006-net-bnxt-fix-error-handling-in-VNIC-prepare.patch	2021-08-10 15:11:12.898637234 +0200
@@ -1 +1 @@
-From 4171ac66e5d3e2cef0f8e619b75883f9fe5adf12 Mon Sep 17 00:00:00 2001
+From ec9a4839b5a2e2c53cab9e52d8d8518c5529e9cd Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 4171ac66e5d3e2cef0f8e619b75883f9fe5adf12 ]
+
@@ -15 +16,0 @@
-Cc: stable@dpdk.org
@@ -25 +26 @@
-index d23f8cff6c..03c71732e7 100644
+index c3f360d47a..82203c2411 100644
@@ -28 +29 @@
-@@ -919,6 +919,19 @@ bnxt_get_l2_filter(struct bnxt *bp, struct bnxt_filter_info *nf,
+@@ -916,6 +916,19 @@ bnxt_get_l2_filter(struct bnxt *bp, struct bnxt_filter_info *nf,
@@ -48 +49 @@
-@@ -949,8 +962,6 @@ static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic,
+@@ -946,8 +959,6 @@ static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic,
@@ -57 +58 @@
-@@ -986,9 +997,12 @@ static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic,
+@@ -983,9 +994,12 @@ static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic,

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

* [dpdk-stable] patch 'net/bnxt: set flow error after tunnel redirection free' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (4 preceding siblings ...)
  2021-08-10 15:38 ` [dpdk-stable] patch 'net/bnxt: fix error handling in VNIC prepare' " christian.ehrhardt
@ 2021-08-10 15:38 ` christian.ehrhardt
  2021-08-10 15:38 ` [dpdk-stable] patch 'net/bnxt: use common function to free VNIC resource' " christian.ehrhardt
                   ` (94 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:38 UTC (permalink / raw)
  To: Kalesh AP; +Cc: Somnath Kotur, Ajit Khaparde, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/f6e2a4d566083c7f264c985e063e480ee5e6661e

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From f6e2a4d566083c7f264c985e063e480ee5e6661e Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Date: Mon, 31 May 2021 12:56:40 +0530
Subject: [PATCH] net/bnxt: set flow error after tunnel redirection free

[ upstream commit 25ee03f532b35e261bced83d1d0635d7271d6c9b ]

During flow destroy, when bnxt_hwrm_tunnel_redirect_free() fails,
driver is not setting flow error using "rte_flow_error_set".

Fixes: 11e5e19695c7 ("net/bnxt: support redirecting tunnel packets to VF")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_flow.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
index 82203c2411..faaf0d0479 100644
--- a/drivers/net/bnxt/bnxt_flow.c
+++ b/drivers/net/bnxt/bnxt_flow.c
@@ -1860,12 +1860,20 @@ static int bnxt_handle_tunnel_redirect_destroy(struct bnxt *bp,
 		/* Tunnel doesn't belong to this VF, so don't send HWRM
 		 * cmd, just delete the flow from driver
 		 */
-		if (bp->fw_fid != (tun_dst_fid + bp->first_vf_id))
+		if (bp->fw_fid != (tun_dst_fid + bp->first_vf_id)) {
 			PMD_DRV_LOG(ERR,
 				    "Tunnel does not belong to this VF, skip hwrm_tunnel_redirect_free\n");
-		else
+		} else {
 			ret = bnxt_hwrm_tunnel_redirect_free(bp,
 							filter->tunnel_type);
+			if (ret) {
+				rte_flow_error_set(error, -ret,
+						   RTE_FLOW_ERROR_TYPE_HANDLE,
+						   NULL,
+						   "Unable to free tunnel redirection");
+				return ret;
+			}
+		}
 	}
 	return ret;
 }
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:13.357524755 +0200
+++ 0007-net-bnxt-set-flow-error-after-tunnel-redirection-fre.patch	2021-08-10 15:11:12.898637234 +0200
@@ -1 +1 @@
-From 25ee03f532b35e261bced83d1d0635d7271d6c9b Mon Sep 17 00:00:00 2001
+From f6e2a4d566083c7f264c985e063e480ee5e6661e Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 25ee03f532b35e261bced83d1d0635d7271d6c9b ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index 03c71732e7..ed201a3552 100644
+index 82203c2411..faaf0d0479 100644
@@ -23 +24 @@
-@@ -1969,12 +1969,20 @@ static int bnxt_handle_tunnel_redirect_destroy(struct bnxt *bp,
+@@ -1860,12 +1860,20 @@ static int bnxt_handle_tunnel_redirect_destroy(struct bnxt *bp,

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

* [dpdk-stable] patch 'net/bnxt: use common function to free VNIC resource' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (5 preceding siblings ...)
  2021-08-10 15:38 ` [dpdk-stable] patch 'net/bnxt: set flow error after tunnel redirection free' " christian.ehrhardt
@ 2021-08-10 15:38 ` christian.ehrhardt
  2021-08-10 15:38 ` [dpdk-stable] patch 'net/bnxt: fix check for PTP support in FW' " christian.ehrhardt
                   ` (93 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:38 UTC (permalink / raw)
  To: Kalesh AP; +Cc: Somnath Kotur, Ajit Khaparde, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/024de731711286fdbad0d1a453d7caead139534a

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 024de731711286fdbad0d1a453d7caead139534a Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Date: Mon, 31 May 2021 12:56:41 +0530
Subject: [PATCH] net/bnxt: use common function to free VNIC resource

[ upstream commit 3e3fecf4b81e243d7e532bce416ebb2524901f7e ]

Use the function bnxt_vnic_destroy() to destroy VNIC resources
and thereby eliminate few duplicate code.

Fixes: 8d0a244b40b2 ("net/bnxt: cleanup VNIC after flow validate")
Fixes: 49d0709b257f ("net/bnxt: delete and flush L2 filters cleanly")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_flow.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
index faaf0d0479..29b59eca41 100644
--- a/drivers/net/bnxt/bnxt_flow.c
+++ b/drivers/net/bnxt/bnxt_flow.c
@@ -1541,10 +1541,7 @@ bnxt_flow_validate(struct rte_eth_dev *dev,
 	vnic = find_matching_vnic(bp, filter);
 	if (vnic) {
 		if (STAILQ_EMPTY(&vnic->filter)) {
-			rte_free(vnic->fw_grp_ids);
-			bnxt_hwrm_vnic_ctx_free(bp, vnic);
-			bnxt_hwrm_vnic_free(bp, vnic);
-			vnic->rx_queue_cnt = 0;
+			bnxt_vnic_cleanup(bp, vnic);
 			bp->nr_vnics--;
 			PMD_DRV_LOG(DEBUG, "Free VNIC\n");
 		}
@@ -1926,12 +1923,7 @@ done:
 		 */
 		if (vnic && !vnic->func_default &&
 		    STAILQ_EMPTY(&vnic->flow_list)) {
-			rte_free(vnic->fw_grp_ids);
-			if (vnic->rx_queue_cnt > 1)
-				bnxt_hwrm_vnic_ctx_free(bp, vnic);
-
-			bnxt_hwrm_vnic_free(bp, vnic);
-			vnic->rx_queue_cnt = 0;
+			bnxt_vnic_cleanup(bp, vnic);
 			bp->nr_vnics--;
 		}
 	} else {
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:13.393809344 +0200
+++ 0008-net-bnxt-use-common-function-to-free-VNIC-resource.patch	2021-08-10 15:11:12.902637262 +0200
@@ -1 +1 @@
-From 3e3fecf4b81e243d7e532bce416ebb2524901f7e Mon Sep 17 00:00:00 2001
+From 024de731711286fdbad0d1a453d7caead139534a Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 3e3fecf4b81e243d7e532bce416ebb2524901f7e ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -21 +22 @@
-index ed201a3552..59489b591a 100644
+index faaf0d0479..29b59eca41 100644
@@ -24 +25 @@
-@@ -1577,10 +1577,7 @@ bnxt_flow_validate(struct rte_eth_dev *dev,
+@@ -1541,10 +1541,7 @@ bnxt_flow_validate(struct rte_eth_dev *dev,
@@ -36 +37 @@
-@@ -2045,12 +2042,7 @@ done:
+@@ -1926,12 +1923,7 @@ done:

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

* [dpdk-stable] patch 'net/bnxt: fix check for PTP support in FW' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (6 preceding siblings ...)
  2021-08-10 15:38 ` [dpdk-stable] patch 'net/bnxt: use common function to free VNIC resource' " christian.ehrhardt
@ 2021-08-10 15:38 ` christian.ehrhardt
  2021-08-10 15:38 ` [dpdk-stable] patch 'net/bnxt: improve probing log message' " christian.ehrhardt
                   ` (92 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:38 UTC (permalink / raw)
  To: Kalesh AP; +Cc: Somnath Kotur, Ajit Khaparde, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/831b94f05dbe2fafb96e999ba8119ab76150b5a7

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 831b94f05dbe2fafb96e999ba8119ab76150b5a7 Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Date: Mon, 31 May 2021 12:56:42 +0530
Subject: [PATCH] net/bnxt: fix check for PTP support in FW

[ upstream commit a642112c91246b035dfa6d6f5bc52b0603c44952 ]

On Thor, driver must use HWRM to access the timestamp information.
Driver should not advertise PTP support to application
if PTP information is not available via HWRM commands.

Fixes: 6cbd89f9f3d8 ("net/bnxt: support PTP for Thor")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index d1f6d2317e..0701347003 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -551,9 +551,13 @@ static int bnxt_hwrm_ptp_qcfg(struct bnxt *bp)
 
 	HWRM_CHECK_RESULT();
 
-	if (!BNXT_CHIP_THOR(bp) &&
-	    !(resp->flags & HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_DIRECT_ACCESS))
-		return 0;
+	if (BNXT_CHIP_THOR(bp)) {
+		if (!(resp->flags & HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_HWRM_ACCESS))
+			return 0;
+	} else {
+		if (!(resp->flags & HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_DIRECT_ACCESS))
+			return 0;
+	}
 
 	if (resp->flags & HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_ONE_STEP_TX_TS)
 		bp->flags |= BNXT_FLAG_FW_CAP_ONE_STEP_TX_TS;
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:13.430176297 +0200
+++ 0009-net-bnxt-fix-check-for-PTP-support-in-FW.patch	2021-08-10 15:11:12.906637292 +0200
@@ -1 +1 @@
-From a642112c91246b035dfa6d6f5bc52b0603c44952 Mon Sep 17 00:00:00 2001
+From 831b94f05dbe2fafb96e999ba8119ab76150b5a7 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a642112c91246b035dfa6d6f5bc52b0603c44952 ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -21 +22 @@
-index c6c0af28cb..a65ac6c0ec 100644
+index d1f6d2317e..0701347003 100644
@@ -24 +25 @@
-@@ -750,9 +750,13 @@ static int bnxt_hwrm_ptp_qcfg(struct bnxt *bp)
+@@ -551,9 +551,13 @@ static int bnxt_hwrm_ptp_qcfg(struct bnxt *bp)
@@ -28 +29 @@
--	if (!BNXT_CHIP_P5(bp) &&
+-	if (!BNXT_CHIP_THOR(bp) &&
@@ -31 +32 @@
-+	if (BNXT_CHIP_P5(bp)) {
++	if (BNXT_CHIP_THOR(bp)) {

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

* [dpdk-stable] patch 'net/bnxt: improve probing log message' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (7 preceding siblings ...)
  2021-08-10 15:38 ` [dpdk-stable] patch 'net/bnxt: fix check for PTP support in FW' " christian.ehrhardt
@ 2021-08-10 15:38 ` christian.ehrhardt
  2021-08-10 15:38 ` [dpdk-stable] patch 'net/iavf: fix RSS key access out of bound' " christian.ehrhardt
                   ` (91 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:38 UTC (permalink / raw)
  To: Kalesh AP; +Cc: Somnath Kotur, Ajit Khaparde, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/97f233a7dca1eca3521996060101c83d07d7e4a5

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 97f233a7dca1eca3521996060101c83d07d7e4a5 Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Date: Mon, 31 May 2021 12:56:43 +0530
Subject: [PATCH] net/bnxt: improve probing log message

[ upstream commit 4a8ac3768fcf2e7e45684397b9d585fe994cc997 ]

The existing log message is missing a space. Modified it to
a more meaningful log as part of this change.

Before this patch:

bnxt_dev_init(): bnxtfound at mem D67E0000, node addr 0x2101112000M

With this patch:

bnxt_dev_init(): Found bnxt device at mem D67E0000, node addr 0x2101112000M

Fixes: 1bf01f5135f8 ("net/bnxt: prevent device access when device is in reset")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 5ca03170a0..7f5045c55f 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -5141,7 +5141,8 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
 		goto error_free;
 
 	PMD_DRV_LOG(INFO,
-		    DRV_MODULE_NAME "found at mem %" PRIX64 ", node addr %pM\n",
+		    "Found %s device at mem %" PRIX64 ", node addr %pM\n",
+		    DRV_MODULE_NAME,
 		    pci_dev->mem_resource[0].phys_addr,
 		    pci_dev->mem_resource[0].addr);
 
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:13.472599789 +0200
+++ 0010-net-bnxt-improve-probing-log-message.patch	2021-08-10 15:11:12.910637320 +0200
@@ -1 +1 @@
-From 4a8ac3768fcf2e7e45684397b9d585fe994cc997 Mon Sep 17 00:00:00 2001
+From 97f233a7dca1eca3521996060101c83d07d7e4a5 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 4a8ac3768fcf2e7e45684397b9d585fe994cc997 ]
+
@@ -18 +19,0 @@
-Cc: stable@dpdk.org
@@ -28 +29 @@
-index c72a968ffa..2545bfc877 100644
+index 5ca03170a0..7f5045c55f 100644
@@ -31 +32 @@
-@@ -5791,7 +5791,8 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev, void *params __rte_unused)
+@@ -5141,7 +5141,8 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)

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

* [dpdk-stable] patch 'net/iavf: fix RSS key access out of bound' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (8 preceding siblings ...)
  2021-08-10 15:38 ` [dpdk-stable] patch 'net/bnxt: improve probing log message' " christian.ehrhardt
@ 2021-08-10 15:38 ` christian.ehrhardt
  2021-08-10 15:38 ` [dpdk-stable] patch 'doc: fix default burst size in testpmd' " christian.ehrhardt
                   ` (90 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:38 UTC (permalink / raw)
  To: Haiyue Wang; +Cc: Beilei Xing, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/e818762474aea4d0b9e53d16aeba6e86aa9f53e6

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From e818762474aea4d0b9e53d16aeba6e86aa9f53e6 Mon Sep 17 00:00:00 2001
From: Haiyue Wang <haiyue.wang@intel.com>
Date: Wed, 19 May 2021 15:59:33 +0800
Subject: [PATCH] net/iavf: fix RSS key access out of bound

[ upstream commit 8ce5678f28a80871c9f4ef41ef52ba206ef5a17f ]

The array rss_key has size 'vf->vf_res->rss_key_size', the array index
should be less than that.

Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
---
 drivers/net/iavf/iavf_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 10eb3322eb..d7d14ee11a 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -199,7 +199,7 @@ iavf_init_rss(struct iavf_adapter *adapter)
 	/* configure RSS key */
 	if (!rss_conf->rss_key) {
 		/* Calculate the default hash key */
-		for (i = 0; i <= vf->vf_res->rss_key_size; i++)
+		for (i = 0; i < vf->vf_res->rss_key_size; i++)
 			vf->rss_key[i] = (uint8_t)rte_rand();
 	} else
 		rte_memcpy(vf->rss_key, rss_conf->rss_key,
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:13.510423053 +0200
+++ 0011-net-iavf-fix-RSS-key-access-out-of-bound.patch	2021-08-10 15:11:12.914637350 +0200
@@ -1 +1 @@
-From 8ce5678f28a80871c9f4ef41ef52ba206ef5a17f Mon Sep 17 00:00:00 2001
+From e818762474aea4d0b9e53d16aeba6e86aa9f53e6 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 8ce5678f28a80871c9f4ef41ef52ba206ef5a17f ]
+
@@ -9 +10,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
-index a7ef7a6d4d..5290588b17 100644
+index 10eb3322eb..d7d14ee11a 100644
@@ -22 +23 @@
-@@ -366,7 +366,7 @@ iavf_init_rss(struct iavf_adapter *adapter)
+@@ -199,7 +199,7 @@ iavf_init_rss(struct iavf_adapter *adapter)

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

* [dpdk-stable] patch 'doc: fix default burst size in testpmd' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (9 preceding siblings ...)
  2021-08-10 15:38 ` [dpdk-stable] patch 'net/iavf: fix RSS key access out of bound' " christian.ehrhardt
@ 2021-08-10 15:38 ` christian.ehrhardt
  2021-08-10 15:38 ` [dpdk-stable] patch 'devtools: fix file listing in maintainers check' " christian.ehrhardt
                   ` (89 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:38 UTC (permalink / raw)
  To: Ajit Khaparde; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/848d502d037115255a7737a96343615c38b67f46

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 848d502d037115255a7737a96343615c38b67f46 Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Fri, 28 May 2021 10:45:29 -0700
Subject: [PATCH] doc: fix default burst size in testpmd

[ upstream commit 478614ee1f62e172c4d4770f157fc9bbb6563523 ]

Default burst size in testpmd has been changed from 16 to 32
for some time now. But the documentation had not been updated.

Fixes: 836853d3d4cf7 ("app/testpmd: increase default burst size to 32")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 doc/guides/prog_guide/writing_efficient_code.rst | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/doc/guides/prog_guide/writing_efficient_code.rst b/doc/guides/prog_guide/writing_efficient_code.rst
index 849f63efe7..88e6bde047 100644
--- a/doc/guides/prog_guide/writing_efficient_code.rst
+++ b/doc/guides/prog_guide/writing_efficient_code.rst
@@ -143,20 +143,21 @@ In order to achieve higher throughput,
 the DPDK attempts to aggregate the cost of processing each packet individually by processing packets in bursts.
 
 Using the testpmd application as an example,
-the burst size can be set on the command line to a value of 16 (also the default value).
-This allows the application to request 16 packets at a time from the PMD.
+the burst size can be set on the command line to a value of 32 (also the default value).
+This allows the application to request 32 packets at a time from the PMD.
 The testpmd application then immediately attempts to transmit all the packets that were received,
-in this case, all 16 packets.
+in this case, all 32 packets.
 
 The packets are not transmitted until the tail pointer is updated on the corresponding TX queue of the network port.
 This behavior is desirable when tuning for high throughput because
-the cost of tail pointer updates to both the RX and TX queues can be spread across 16 packets,
+the cost of tail pointer updates to both the RX and TX queues can be spread
+across 32 packets,
 effectively hiding the relatively slow MMIO cost of writing to the PCIe* device.
 However, this is not very desirable when tuning for low latency because
-the first packet that was received must also wait for another 15 packets to be received.
-It cannot be transmitted until the other 15 packets have also been processed because
+the first packet that was received must also wait for another 31 packets to be received.
+It cannot be transmitted until the other 31 packets have also been processed because
 the NIC will not know to transmit the packets until the TX tail pointer has been updated,
-which is not done until all 16 packets have been processed for transmission.
+which is not done until all 32 packets have been processed for transmission.
 
 To consistently achieve low latency, even under heavy system load,
 the application developer should avoid processing packets in bunches.
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:13.550661632 +0200
+++ 0012-doc-fix-default-burst-size-in-testpmd.patch	2021-08-10 15:11:12.914637350 +0200
@@ -1 +1 @@
-From 478614ee1f62e172c4d4770f157fc9bbb6563523 Mon Sep 17 00:00:00 2001
+From 848d502d037115255a7737a96343615c38b67f46 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 478614ee1f62e172c4d4770f157fc9bbb6563523 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -18 +19 @@
-index 7baeaae431..a61e8320ae 100644
+index 849f63efe7..88e6bde047 100644

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

* [dpdk-stable] patch 'devtools: fix file listing in maintainers check' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (10 preceding siblings ...)
  2021-08-10 15:38 ` [dpdk-stable] patch 'doc: fix default burst size in testpmd' " christian.ehrhardt
@ 2021-08-10 15:38 ` christian.ehrhardt
  2021-08-10 15:38 ` [dpdk-stable] patch 'vhost/crypto: check request pointer before dereference' " christian.ehrhardt
                   ` (88 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:38 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/4406ca174cebbe080afa5b8d901ce5dab451045d

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 4406ca174cebbe080afa5b8d901ce5dab451045d Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas@monjalon.net>
Date: Tue, 15 Jun 2021 14:49:49 +0200
Subject: [PATCH] devtools: fix file listing in maintainers check

[ upstream commit 2d333c4ac3bf4a1d236bf24bb33fa1df58e6009b ]

When having multiple working trees, the main one has a .git directory
while attached trees have a .git file.
Thus the git check should work for both file and directory.

In the case there is no working tree (.git not readable), the command
"find" is used and should be able to list paths with wildcards.
Wildcards work only as shell expansion in the case of file paths,
so the quotes must be removed.

Fixes: 27c2ce563216 ("maintainers: start a Linux-style file")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 devtools/check-maintainers.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/devtools/check-maintainers.sh b/devtools/check-maintainers.sh
index 85a300f0a0..49d38fbf13 100755
--- a/devtools/check-maintainers.sh
+++ b/devtools/check-maintainers.sh
@@ -15,10 +15,10 @@ files () # <path> [<path> ...]
 	if [ -z "$1" ] ; then
 		return
 	fi
-	if [ -d .git ] ; then
+	if [ -r .git ] ; then
 		git ls-files "$1"
 	else
-		find "$1" -type f |
+		find $1 -type f |
 		sed 's,^\./,,'
 	fi |
 	# if not ended by /
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:13.593468325 +0200
+++ 0013-devtools-fix-file-listing-in-maintainers-check.patch	2021-08-10 15:11:12.914637350 +0200
@@ -1 +1 @@
-From 2d333c4ac3bf4a1d236bf24bb33fa1df58e6009b Mon Sep 17 00:00:00 2001
+From 4406ca174cebbe080afa5b8d901ce5dab451045d Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 2d333c4ac3bf4a1d236bf24bb33fa1df58e6009b ]
+
@@ -16 +17,0 @@
-Cc: stable@dpdk.org
@@ -24 +25 @@
-index df3f740b6e..71697bb352 100755
+index 85a300f0a0..49d38fbf13 100755

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

* [dpdk-stable] patch 'vhost/crypto: check request pointer before dereference' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (11 preceding siblings ...)
  2021-08-10 15:38 ` [dpdk-stable] patch 'devtools: fix file listing in maintainers check' " christian.ehrhardt
@ 2021-08-10 15:38 ` christian.ehrhardt
  2021-08-10 15:38 ` [dpdk-stable] patch 'kni: fix mbuf allocation for kernel side use' " christian.ehrhardt
                   ` (87 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:38 UTC (permalink / raw)
  To: Thierry Herbelot; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/a8400e9443c5265694ef13eb7f8786e4438da4e1

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From a8400e9443c5265694ef13eb7f8786e4438da4e1 Mon Sep 17 00:00:00 2001
From: Thierry Herbelot <thierry.herbelot@6wind.com>
Date: Mon, 24 May 2021 11:08:21 +0200
Subject: [PATCH] vhost/crypto: check request pointer before dereference

[ upstream commit 9cfbe67691f02e3f66f6a6804a5ce266830e1f3f ]

Use vc_req only after it was checked not to be NULL.

Fixes: 2d962bb736521 ("vhost/crypto: fix possible TOCTOU attack")

Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 lib/librte_vhost/vhost_crypto.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/librte_vhost/vhost_crypto.c b/lib/librte_vhost/vhost_crypto.c
index e08f9c6d75..0439b12bc7 100644
--- a/lib/librte_vhost/vhost_crypto.c
+++ b/lib/librte_vhost/vhost_crypto.c
@@ -1338,13 +1338,15 @@ vhost_crypto_finalize_one_request(struct rte_crypto_op *op,
 	struct rte_mbuf *m_src = op->sym->m_src;
 	struct rte_mbuf *m_dst = op->sym->m_dst;
 	struct vhost_crypto_data_req *vc_req = rte_mbuf_to_priv(m_src);
-	struct vhost_virtqueue *vq = vc_req->vq;
-	uint16_t used_idx = vc_req->desc_idx, desc_idx;
+	struct vhost_virtqueue *vq;
+	uint16_t used_idx, desc_idx;
 
 	if (unlikely(!vc_req)) {
 		VC_LOG_ERR("Failed to retrieve vc_req");
 		return NULL;
 	}
+	vq = vc_req->vq;
+	used_idx = vc_req->desc_idx;
 
 	if (old_vq && (vq != old_vq))
 		return vq;
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:13.629367131 +0200
+++ 0014-vhost-crypto-check-request-pointer-before-dereferenc.patch	2021-08-10 15:11:12.914637350 +0200
@@ -1 +1 @@
-From 9cfbe67691f02e3f66f6a6804a5ce266830e1f3f Mon Sep 17 00:00:00 2001
+From a8400e9443c5265694ef13eb7f8786e4438da4e1 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 9cfbe67691f02e3f66f6a6804a5ce266830e1f3f ]
+
@@ -9 +10,0 @@
-Cc: stable@dpdk.org
@@ -14 +15 @@
- lib/vhost/vhost_crypto.c | 6 ++++--
+ lib/librte_vhost/vhost_crypto.c | 6 ++++--
@@ -17,5 +18,5 @@
-diff --git a/lib/vhost/vhost_crypto.c b/lib/vhost/vhost_crypto.c
-index 6689c52df2..926b5c0bd9 100644
---- a/lib/vhost/vhost_crypto.c
-+++ b/lib/vhost/vhost_crypto.c
-@@ -1337,13 +1337,15 @@ vhost_crypto_finalize_one_request(struct rte_crypto_op *op,
+diff --git a/lib/librte_vhost/vhost_crypto.c b/lib/librte_vhost/vhost_crypto.c
+index e08f9c6d75..0439b12bc7 100644
+--- a/lib/librte_vhost/vhost_crypto.c
++++ b/lib/librte_vhost/vhost_crypto.c
+@@ -1338,13 +1338,15 @@ vhost_crypto_finalize_one_request(struct rte_crypto_op *op,

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

* [dpdk-stable] patch 'kni: fix mbuf allocation for kernel side use' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (12 preceding siblings ...)
  2021-08-10 15:38 ` [dpdk-stable] patch 'vhost/crypto: check request pointer before dereference' " christian.ehrhardt
@ 2021-08-10 15:38 ` christian.ehrhardt
  2021-08-10 15:38 ` [dpdk-stable] patch 'kni: fix crash on userspace VA for segmented packets' " christian.ehrhardt
                   ` (86 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:38 UTC (permalink / raw)
  To: Yunjian Wang; +Cc: Cheng Liu, Ferruh Yigit, Ajit Khaparde, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/4b9355f4d0fa3a07fc2f601fc826facec95a004f

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 4b9355f4d0fa3a07fc2f601fc826facec95a004f Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian@huawei.com>
Date: Tue, 22 Jun 2021 20:44:29 +0800
Subject: [PATCH] kni: fix mbuf allocation for kernel side use

[ upstream commit 0db3d5551abe94bb8a7030c1b90496b290ddb7f4 ]

In kni_allocate_mbufs(), we alloc mbuf for alloc_q as this code.
allocq_free = (kni->alloc_q->read - kni->alloc_q->write - 1) \
		& (MAX_MBUF_BURST_NUM - 1);
The value of allocq_free maybe zero, for example :
The ring size is 1024. After init, write = read = 0. Then we fill
kni->alloc_q to full. At this time, write = 1023, read = 0.

Then the kernel send 32 packets to userspace. At this time, write
= 1023, read = 32. And then the userspace receive this 32 packets.
Then fill the kni->alloc_q, (32 - 1023 - 1) & 31 = 0, fill nothing.
...
Then the kernel send 32 packets to userspace. At this time, write
= 1023, read = 992. And then the userspace receive this 32 packets.
Then fill the kni->alloc_q, (992 - 1023 - 1) & 31 = 0, fill nothing.

Then the kernel send 32 packets to userspace. The kni->alloc_q only
has 31 mbufs and will drop one packet.

Absolutely, this is a special scene. Normally, it will fill some
mbufs everytime, but may not enough for the kernel to use.

In this patch, we always keep the kni->alloc_q to full for the kernel
to use.

Fixes: 49da4e82cf94 ("kni: allocate no more mbuf than empty slots in queue")

Signed-off-by: Cheng Liu <liucheng11@huawei.com>
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 lib/librte_kni/rte_kni.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c
index bcf82cc2d5..e96adc14b5 100644
--- a/lib/librte_kni/rte_kni.c
+++ b/lib/librte_kni/rte_kni.c
@@ -674,8 +674,9 @@ kni_allocate_mbufs(struct rte_kni *kni)
 		return;
 	}
 
-	allocq_free = (kni->alloc_q->read - kni->alloc_q->write - 1)
-			& (MAX_MBUF_BURST_NUM - 1);
+	allocq_free = kni_fifo_free_count(kni->alloc_q);
+	allocq_free = (allocq_free > MAX_MBUF_BURST_NUM) ?
+		MAX_MBUF_BURST_NUM : allocq_free;
 	for (i = 0; i < allocq_free; i++) {
 		pkts[i] = rte_pktmbuf_alloc(kni->pktmbuf_pool);
 		if (unlikely(pkts[i] == NULL)) {
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:13.672319693 +0200
+++ 0015-kni-fix-mbuf-allocation-for-kernel-side-use.patch	2021-08-10 15:11:12.914637350 +0200
@@ -1 +1 @@
-From 0db3d5551abe94bb8a7030c1b90496b290ddb7f4 Mon Sep 17 00:00:00 2001
+From 4b9355f4d0fa3a07fc2f601fc826facec95a004f Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 0db3d5551abe94bb8a7030c1b90496b290ddb7f4 ]
+
@@ -31 +32,0 @@
-Cc: stable@dpdk.org
@@ -38 +39 @@
- lib/kni/rte_kni.c | 5 +++--
+ lib/librte_kni/rte_kni.c | 5 +++--
@@ -41,5 +42,5 @@
-diff --git a/lib/kni/rte_kni.c b/lib/kni/rte_kni.c
-index 9dae6a8d7c..eb24b0d0ae 100644
---- a/lib/kni/rte_kni.c
-+++ b/lib/kni/rte_kni.c
-@@ -677,8 +677,9 @@ kni_allocate_mbufs(struct rte_kni *kni)
+diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c
+index bcf82cc2d5..e96adc14b5 100644
+--- a/lib/librte_kni/rte_kni.c
++++ b/lib/librte_kni/rte_kni.c
+@@ -674,8 +674,9 @@ kni_allocate_mbufs(struct rte_kni *kni)

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

* [dpdk-stable] patch 'kni: fix crash on userspace VA for segmented packets' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (13 preceding siblings ...)
  2021-08-10 15:38 ` [dpdk-stable] patch 'kni: fix mbuf allocation for kernel side use' " christian.ehrhardt
@ 2021-08-10 15:38 ` christian.ehrhardt
  2021-08-10 15:38 ` [dpdk-stable] patch 'flow_classify: fix leaking rules on delete' " christian.ehrhardt
                   ` (85 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:38 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Ajit Khaparde, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/d4cd1ffd337c746eecca578abb93dfcde5dcada0

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From d4cd1ffd337c746eecca578abb93dfcde5dcada0 Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit@intel.com>
Date: Tue, 22 Jun 2021 13:29:56 +0100
Subject: [PATCH] kni: fix crash on userspace VA for segmented packets

[ upstream commit 9b83a7ed2ac160aca64eed4d45102aadf26bc053 ]

When IOVA=VA, address translation for segmented packets is wrong, it
assumes the address in the mbuf->next is physical address, not VA
address.

Fixing the address translation to work both PA & VA mode.

Fixes: e73831dc6c26 ("kni: support userspace VA")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 kernel/linux/kni/kni_net.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/linux/kni/kni_net.c b/kernel/linux/kni/kni_net.c
index c82c881a2c..c8bad5f197 100644
--- a/kernel/linux/kni/kni_net.c
+++ b/kernel/linux/kni/kni_net.c
@@ -223,7 +223,7 @@ kni_fifo_trans_pa2va(struct kni_dev *kni,
 					break;
 
 				prev_kva = kva;
-				kva = pa2kva(kva->next);
+				kva = get_kva(kni, kva->next);
 				/* Convert physical address to virtual address */
 				prev_kva->next = pa2va(prev_kva->next, kva);
 			}
@@ -400,7 +400,7 @@ kni_net_rx_normal(struct kni_dev *kni)
 					break;
 
 				prev_kva = kva;
-				kva = pa2kva(kva->next);
+				kva = get_kva(kni, kva->next);
 				data_kva = kva2data_kva(kva);
 				/* Convert physical address to virtual address */
 				prev_kva->next = pa2va(prev_kva->next, kva);
@@ -479,7 +479,7 @@ kni_net_rx_lo_fifo(struct kni_dev *kni)
 			kni->va[i] = pa2va(kni->pa[i], kva);
 
 			while (kva->next) {
-				next_kva = pa2kva(kva->next);
+				next_kva = get_kva(kni, kva->next);
 				/* Convert physical address to virtual address */
 				kva->next = pa2va(kva->next, next_kva);
 				kva = next_kva;
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:13.710515565 +0200
+++ 0016-kni-fix-crash-on-userspace-VA-for-segmented-packets.patch	2021-08-10 15:11:12.918637378 +0200
@@ -1 +1 @@
-From 9b83a7ed2ac160aca64eed4d45102aadf26bc053 Mon Sep 17 00:00:00 2001
+From d4cd1ffd337c746eecca578abb93dfcde5dcada0 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 9b83a7ed2ac160aca64eed4d45102aadf26bc053 ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
-index f259327954..611719b5ee 100644
+index c82c881a2c..c8bad5f197 100644
@@ -25 +26 @@
-@@ -245,7 +245,7 @@ kni_fifo_trans_pa2va(struct kni_dev *kni,
+@@ -223,7 +223,7 @@ kni_fifo_trans_pa2va(struct kni_dev *kni,
@@ -34 +35 @@
-@@ -422,7 +422,7 @@ kni_net_rx_normal(struct kni_dev *kni)
+@@ -400,7 +400,7 @@ kni_net_rx_normal(struct kni_dev *kni)
@@ -43 +44 @@
-@@ -501,7 +501,7 @@ kni_net_rx_lo_fifo(struct kni_dev *kni)
+@@ -479,7 +479,7 @@ kni_net_rx_lo_fifo(struct kni_dev *kni)

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

* [dpdk-stable] patch 'flow_classify: fix leaking rules on delete' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (14 preceding siblings ...)
  2021-08-10 15:38 ` [dpdk-stable] patch 'kni: fix crash on userspace VA for segmented packets' " christian.ehrhardt
@ 2021-08-10 15:38 ` christian.ehrhardt
  2021-08-10 15:38 ` [dpdk-stable] patch 'rib: fix max depth IPv6 lookup' " christian.ehrhardt
                   ` (84 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:38 UTC (permalink / raw)
  To: Owen Hilyard; +Cc: Bernard Iremonger, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/0c6d3c0f8d17aa8da850dcc695aefc037152c11f

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 0c6d3c0f8d17aa8da850dcc695aefc037152c11f Mon Sep 17 00:00:00 2001
From: Owen Hilyard <ohilyard@iol.unh.edu>
Date: Wed, 23 Jun 2021 13:07:07 -0400
Subject: [PATCH] flow_classify: fix leaking rules on delete

[ upstream commit 016441e3c770b65774d658c94a82c5bf5ed826fe ]

Rules in a classify table were not freed if the table
had a delete function.

Fixes: be41ac2a330f ("flow_classify: introduce flow classify library")

Signed-off-by: Owen Hilyard <ohilyard@iol.unh.edu>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 lib/librte_flow_classify/rte_flow_classify.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_flow_classify/rte_flow_classify.c b/lib/librte_flow_classify/rte_flow_classify.c
index 5ff585803b..c7c57e17b6 100644
--- a/lib/librte_flow_classify/rte_flow_classify.c
+++ b/lib/librte_flow_classify/rte_flow_classify.c
@@ -584,12 +584,12 @@ rte_flow_classify_table_entry_delete(struct rte_flow_classifier *cls,
 						&rule->u.key.key_del,
 						&rule->key_found,
 						&rule->entry);
-
+				if (ret == 0)
+					free(rule);
 				return ret;
 			}
 		}
 	}
-	free(rule);
 	return ret;
 }
 
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:13.745844069 +0200
+++ 0017-flow_classify-fix-leaking-rules-on-delete.patch	2021-08-10 15:11:12.918637378 +0200
@@ -1 +1 @@
-From 016441e3c770b65774d658c94a82c5bf5ed826fe Mon Sep 17 00:00:00 2001
+From 0c6d3c0f8d17aa8da850dcc695aefc037152c11f Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 016441e3c770b65774d658c94a82c5bf5ed826fe ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -15 +16 @@
- lib/flow_classify/rte_flow_classify.c | 4 ++--
+ lib/librte_flow_classify/rte_flow_classify.c | 4 ++--
@@ -18,5 +19,5 @@
-diff --git a/lib/flow_classify/rte_flow_classify.c b/lib/flow_classify/rte_flow_classify.c
-index f125267e8f..d3ba2ed227 100644
---- a/lib/flow_classify/rte_flow_classify.c
-+++ b/lib/flow_classify/rte_flow_classify.c
-@@ -579,12 +579,12 @@ rte_flow_classify_table_entry_delete(struct rte_flow_classifier *cls,
+diff --git a/lib/librte_flow_classify/rte_flow_classify.c b/lib/librte_flow_classify/rte_flow_classify.c
+index 5ff585803b..c7c57e17b6 100644
+--- a/lib/librte_flow_classify/rte_flow_classify.c
++++ b/lib/librte_flow_classify/rte_flow_classify.c
+@@ -584,12 +584,12 @@ rte_flow_classify_table_entry_delete(struct rte_flow_classifier *cls,

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

* [dpdk-stable] patch 'rib: fix max depth IPv6 lookup' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (15 preceding siblings ...)
  2021-08-10 15:38 ` [dpdk-stable] patch 'flow_classify: fix leaking rules on delete' " christian.ehrhardt
@ 2021-08-10 15:38 ` christian.ehrhardt
  2021-08-10 15:38 ` [dpdk-stable] patch 'tests/eal: fix memory leak' " christian.ehrhardt
                   ` (83 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:38 UTC (permalink / raw)
  To: Owen Hilyard; +Cc: Vladimir Medvedkin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/cb4043684101d319f6bc789a2228f53e79b2af84

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From cb4043684101d319f6bc789a2228f53e79b2af84 Mon Sep 17 00:00:00 2001
From: Owen Hilyard <ohilyard@iol.unh.edu>
Date: Wed, 23 Jun 2021 11:17:29 -0400
Subject: [PATCH] rib: fix max depth IPv6 lookup

[ upstream commit 03b8372a9a73a6b3dce4ce6b447ea37c398a4685 ]

ASAN found a stack buffer overflow in lib/rib/rte_rib6.c:get_dir.
The fix for the stack buffer overflow was to make sure depth
was always < 128, since when depth = 128 it caused the index
into the ip address to be 16, which read off the end of the array.

While trying to solve the buffer overflow, I noticed that a few
changes could be made to remove the for loop entirely.

Fixes: f7e861e21c46 ("rib: support IPv6")

Signed-off-by: Owen Hilyard <ohilyard@iol.unh.edu>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
---
 lib/librte_rib/rte_rib6.c | 29 +++++++++++++++++++++--------
 1 file changed, 21 insertions(+), 8 deletions(-)

diff --git a/lib/librte_rib/rte_rib6.c b/lib/librte_rib/rte_rib6.c
index 78b8dcfd94..6d265c2773 100644
--- a/lib/librte_rib/rte_rib6.c
+++ b/lib/librte_rib/rte_rib6.c
@@ -79,20 +79,33 @@ is_covered(const uint8_t ip1[RTE_RIB6_IPV6_ADDR_SIZE],
 static inline int
 get_dir(const uint8_t ip[RTE_RIB6_IPV6_ADDR_SIZE], uint8_t depth)
 {
-	int i = 0;
-	uint8_t p_depth, msk;
-
-	for (p_depth = depth; p_depth >= 8; p_depth -= 8)
-		i++;
-
-	msk = 1 << (7 - p_depth);
-	return (ip[i] & msk) != 0;
+	uint8_t index, msk;
+
+	/*
+	 * depth & 127 clamps depth to values that will not
+	 * read off the end of ip.
+	 * depth is the number of bits deep into ip to traverse, and
+	 * is incremented in blocks of 8 (1 byte). This means the last
+	 * 3 bits are irrelevant to what the index of ip should be.
+	 */
+	index = (depth & (UINT8_MAX - 1)) / CHAR_BIT;
+
+	/*
+	 * msk is the bitmask used to extract the bit used to decide the
+	 * direction of the next step of the binary search.
+	 */
+	msk = 1 << (7 - (depth & 7));
+
+	return (ip[index] & msk) != 0;
 }
 
 static inline struct rte_rib6_node *
 get_nxt_node(struct rte_rib6_node *node,
 	const uint8_t ip[RTE_RIB6_IPV6_ADDR_SIZE])
 {
+	if (node->depth == RIB6_MAXDEPTH)
+		return NULL;
+
 	return (get_dir(ip, node->depth)) ? node->right : node->left;
 }
 
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:13.783471546 +0200
+++ 0018-rib-fix-max-depth-IPv6-lookup.patch	2021-08-10 15:11:12.918637378 +0200
@@ -1 +1 @@
-From 03b8372a9a73a6b3dce4ce6b447ea37c398a4685 Mon Sep 17 00:00:00 2001
+From cb4043684101d319f6bc789a2228f53e79b2af84 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 03b8372a9a73a6b3dce4ce6b447ea37c398a4685 ]
+
@@ -15 +16,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
- lib/rib/rte_rib6.c | 29 +++++++++++++++++++++--------
+ lib/librte_rib/rte_rib6.c | 29 +++++++++++++++++++++--------
@@ -23,4 +24,4 @@
-diff --git a/lib/rib/rte_rib6.c b/lib/rib/rte_rib6.c
-index f6c55ee454..96424e9c9f 100644
---- a/lib/rib/rte_rib6.c
-+++ b/lib/rib/rte_rib6.c
+diff --git a/lib/librte_rib/rte_rib6.c b/lib/librte_rib/rte_rib6.c
+index 78b8dcfd94..6d265c2773 100644
+--- a/lib/librte_rib/rte_rib6.c
++++ b/lib/librte_rib/rte_rib6.c

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

* [dpdk-stable] patch 'tests/eal: fix memory leak' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (16 preceding siblings ...)
  2021-08-10 15:38 ` [dpdk-stable] patch 'rib: fix max depth IPv6 lookup' " christian.ehrhardt
@ 2021-08-10 15:38 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'common/mlx5: fix Netlink port name padding in probing' " christian.ehrhardt
                   ` (82 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:38 UTC (permalink / raw)
  To: Owen Hilyard; +Cc: David Marchand, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/7e5dd0be04b33db9932143099908df8c37bd9b07

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 7e5dd0be04b33db9932143099908df8c37bd9b07 Mon Sep 17 00:00:00 2001
From: Owen Hilyard <ohilyard@iol.unh.edu>
Date: Wed, 16 Jun 2021 12:24:52 -0400
Subject: [PATCH] tests/eal: fix memory leak

[ upstream commit 80731e4b5b44036d05ae9b36432b6f2fd9f49d3b ]

The directory steam was not closed when the hugepage action was
HUGEPAGE_CHECK_EXISTS. This caused a memory leak in some parts of
the unit tests.

Fixes: 45f1b6e8680a ("app: add new tests on eal flags")

Signed-off-by: Owen Hilyard <ohilyard@iol.unh.edu>
Reviewed-by: David Marchand <david.marchand@redhat.com>
---
 app/test/test_eal_flags.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c
index 5b2c0f5cdb..654bebff6f 100644
--- a/app/test/test_eal_flags.c
+++ b/app/test/test_eal_flags.c
@@ -125,6 +125,7 @@ process_hugefiles(const char * prefix, enum hugepage_action action)
 			case HUGEPAGE_CHECK_EXISTS:
 				{
 					/* file exists, return */
+					closedir(hugepage_dir);
 					result = 1;
 					goto end;
 				}
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:13.817771508 +0200
+++ 0019-tests-eal-fix-memory-leak.patch	2021-08-10 15:11:12.918637378 +0200
@@ -1 +1 @@
-From 80731e4b5b44036d05ae9b36432b6f2fd9f49d3b Mon Sep 17 00:00:00 2001
+From 7e5dd0be04b33db9932143099908df8c37bd9b07 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 80731e4b5b44036d05ae9b36432b6f2fd9f49d3b ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index 932fbe3d08..b4880ee802 100644
+index 5b2c0f5cdb..654bebff6f 100644
@@ -23 +24 @@
-@@ -124,6 +124,7 @@ process_hugefiles(const char * prefix, enum hugepage_action action)
+@@ -125,6 +125,7 @@ process_hugefiles(const char * prefix, enum hugepage_action action)

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

* [dpdk-stable] patch 'common/mlx5: fix Netlink port name padding in probing' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (17 preceding siblings ...)
  2021-08-10 15:38 ` [dpdk-stable] patch 'tests/eal: fix memory leak' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'app/test: fix IPv6 header initialization' " christian.ehrhardt
                   ` (81 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Viacheslav Ovsiienko; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/479de253642b9ffc6592cf71efb7bb835a1c646c

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 479de253642b9ffc6592cf71efb7bb835a1c646c Mon Sep 17 00:00:00 2001
From: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Date: Sat, 19 Jun 2021 16:56:28 +0300
Subject: [PATCH] common/mlx5: fix Netlink port name padding in probing

[ upstream commit 568d97c09ca00e52fd7805ef0cab522250dac18b ]

On some kernels the string attributes within Netlink
reply messages might be not padded with zeroes (in cases
when string length is aligned with 4-byte boundary).
While device probing, the physical port name was wrongly recognized,
causing a probing failure.

Fixes: 30a86157f6d5 ("net/mlx5: support PF representor")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_nl.c | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_nl.c b/drivers/net/mlx5/mlx5_nl.c
index 64580b9e6a..668affb0b1 100644
--- a/drivers/net/mlx5/mlx5_nl.c
+++ b/drivers/net/mlx5/mlx5_nl.c
@@ -30,6 +30,8 @@
 #define MLX5_SEND_BUF_SIZE 32768
 /* Receive buffer size for the Netlink socket */
 #define MLX5_RECV_BUF_SIZE 32768
+/* Maximal physical port name length. */
+#define MLX5_PHYS_PORT_NAME_MAX 128
 
 /** Parameters of VLAN devices created by driver. */
 #define MLX5_VMWA_VLAN_DEVICE_PFX "evmlx"
@@ -1029,6 +1031,7 @@ mlx5_nl_switch_info_cb(struct nlmsghdr *nh, void *arg)
 	size_t off = NLMSG_LENGTH(sizeof(struct ifinfomsg));
 	bool switch_id_set = false;
 	bool num_vf_set = false;
+	int len;
 
 	if (nh->nlmsg_type != RTM_NEWLINK)
 		goto error;
@@ -1044,7 +1047,24 @@ mlx5_nl_switch_info_cb(struct nlmsghdr *nh, void *arg)
 			num_vf_set = true;
 			break;
 		case IFLA_PHYS_PORT_NAME:
-			mlx5_translate_port_name((char *)payload, &info);
+			len = RTA_PAYLOAD(ra);
+			/* Some kernels do not pad attributes with zero. */
+			if (len > 0 && len < MLX5_PHYS_PORT_NAME_MAX) {
+				char name[MLX5_PHYS_PORT_NAME_MAX];
+
+				/*
+				 * We can't just patch the message with padding
+				 * zero - it might corrupt the following items
+				 * in the message, we have to copy the string
+				 * by attribute length and pad the copied one.
+				 */
+				memcpy(name, payload, len);
+				name[len] = 0;
+				mlx5_translate_port_name(name, &info);
+			} else {
+				info.name_type =
+					MLX5_PHYS_PORT_NAME_TYPE_UNKNOWN;
+			}
 			break;
 		case IFLA_PHYS_SWITCH_ID:
 			info.switch_id = 0;
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:13.853478648 +0200
+++ 0020-common-mlx5-fix-Netlink-port-name-padding-in-probing.patch	2021-08-10 15:11:12.922637408 +0200
@@ -1 +1 @@
-From 568d97c09ca00e52fd7805ef0cab522250dac18b Mon Sep 17 00:00:00 2001
+From 479de253642b9ffc6592cf71efb7bb835a1c646c Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 568d97c09ca00e52fd7805ef0cab522250dac18b ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -18 +19 @@
- drivers/common/mlx5/linux/mlx5_nl.c | 22 +++++++++++++++++++++-
+ drivers/net/mlx5/mlx5_nl.c | 22 +++++++++++++++++++++-
@@ -21,5 +22,5 @@
-diff --git a/drivers/common/mlx5/linux/mlx5_nl.c b/drivers/common/mlx5/linux/mlx5_nl.c
-index f0d04f9473..3f1912d078 100644
---- a/drivers/common/mlx5/linux/mlx5_nl.c
-+++ b/drivers/common/mlx5/linux/mlx5_nl.c
-@@ -33,6 +33,8 @@
+diff --git a/drivers/net/mlx5/mlx5_nl.c b/drivers/net/mlx5/mlx5_nl.c
+index 64580b9e6a..668affb0b1 100644
+--- a/drivers/net/mlx5/mlx5_nl.c
++++ b/drivers/net/mlx5/mlx5_nl.c
+@@ -30,6 +30,8 @@
@@ -34 +35 @@
-@@ -1191,6 +1193,7 @@ mlx5_nl_switch_info_cb(struct nlmsghdr *nh, void *arg)
+@@ -1029,6 +1031,7 @@ mlx5_nl_switch_info_cb(struct nlmsghdr *nh, void *arg)
@@ -42 +43 @@
-@@ -1206,7 +1209,24 @@ mlx5_nl_switch_info_cb(struct nlmsghdr *nh, void *arg)
+@@ -1044,7 +1047,24 @@ mlx5_nl_switch_info_cb(struct nlmsghdr *nh, void *arg)

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

* [dpdk-stable] patch 'app/test: fix IPv6 header initialization' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (18 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'common/mlx5: fix Netlink port name padding in probing' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'test/mbuf: fix virtual address conversion' " christian.ehrhardt
                   ` (80 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Lance Richardson; +Cc: David Marchand, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/4deebdea168dc1b8aee05db881f0633788418b6b

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 4deebdea168dc1b8aee05db881f0633788418b6b Mon Sep 17 00:00:00 2001
From: Lance Richardson <lance.richardson@broadcom.com>
Date: Fri, 26 Mar 2021 12:37:32 -0400
Subject: [PATCH] app/test: fix IPv6 header initialization

[ upstream commit a906371d2758df7260640873d93f888724759448 ]

Fix two issues found when writing PMD unit tests for HW ptype and
L4 checksum offload:

   - The version field in the IPv6 header was being set to zero,
     which prevented hardware from recognizing it as IPv6. The
     IP version field is now set to six.
   - The payload_len field was being initialized using host byte
     order, which (among other things) resulted in incorrect L4
     checksum computation. The payload_len field is now set using
     network (big-endian) byte order.

Fixes: 92073ef961ee ("bond: unit tests")

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
---
 app/test/packet_burst_generator.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/test/packet_burst_generator.c b/app/test/packet_burst_generator.c
index c05ea7ad51..0fd7290b0e 100644
--- a/app/test/packet_burst_generator.c
+++ b/app/test/packet_burst_generator.c
@@ -142,8 +142,8 @@ uint16_t
 initialize_ipv6_header(struct rte_ipv6_hdr *ip_hdr, uint8_t *src_addr,
 		uint8_t *dst_addr, uint16_t pkt_data_len)
 {
-	ip_hdr->vtc_flow = 0;
-	ip_hdr->payload_len = pkt_data_len;
+	ip_hdr->vtc_flow = rte_cpu_to_be_32(0x60000000); /* Set version to 6. */
+	ip_hdr->payload_len = rte_cpu_to_be_16(pkt_data_len);
 	ip_hdr->proto = IPPROTO_UDP;
 	ip_hdr->hop_limits = IP_DEFTTL;
 
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:13.888301454 +0200
+++ 0021-app-test-fix-IPv6-header-initialization.patch	2021-08-10 15:11:12.922637408 +0200
@@ -1 +1 @@
-From a906371d2758df7260640873d93f888724759448 Mon Sep 17 00:00:00 2001
+From 4deebdea168dc1b8aee05db881f0633788418b6b Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a906371d2758df7260640873d93f888724759448 ]
+
@@ -18 +19,0 @@
-Cc: stable@dpdk.org

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

* [dpdk-stable] patch 'test/mbuf: fix virtual address conversion' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (19 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'app/test: fix IPv6 header initialization' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/octeontx2: fix flow creation limit on CN98xx' " christian.ehrhardt
                   ` (79 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Olivier Matz; +Cc: Zhihong Peng, David Marchand, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/fc6e2aa74a7400c4b4d38051fbcccc346db74af1

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From fc6e2aa74a7400c4b4d38051fbcccc346db74af1 Mon Sep 17 00:00:00 2001
From: Olivier Matz <olivier.matz@6wind.com>
Date: Mon, 5 Jul 2021 09:27:34 +0200
Subject: [PATCH] test/mbuf: fix virtual address conversion

[ upstream commit eb3fea3cdebbd860b6094e21aae589746e13c22a ]

Seen with address sanitizer.

rte_mempool_virt2iova() can only be used on mempool elements. In this case,
it is incorrect, and rte_mem_virt2iova() has to be used.

Bugzilla ID: 737
Fixes: 7b295dceea07 ("test/mbuf: add unit test cases")

Reported-by: Zhihong Peng <zhihongx.peng@intel.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
---
 app/test/test_mbuf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
index a5bd1693b2..3224272eaa 100644
--- a/app/test/test_mbuf.c
+++ b/app/test/test_mbuf.c
@@ -2344,7 +2344,7 @@ test_pktmbuf_ext_shinfo_init_helper(struct rte_mempool *pktmbuf_pool)
 	if (rte_mbuf_refcnt_read(m) != 1)
 		GOTO_FAIL("%s: Invalid refcnt in mbuf\n", __func__);
 
-	buf_iova = rte_mempool_virt2iova(ext_buf_addr);
+	buf_iova = rte_mem_virt2iova(ext_buf_addr);
 	rte_pktmbuf_attach_extbuf(m, ext_buf_addr, buf_iova, buf_len,
 		ret_shinfo);
 	if (m->ol_flags != EXT_ATTACHED_MBUF)
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:13.924437706 +0200
+++ 0022-test-mbuf-fix-virtual-address-conversion.patch	2021-08-10 15:11:12.926637435 +0200
@@ -1 +1 @@
-From eb3fea3cdebbd860b6094e21aae589746e13c22a Mon Sep 17 00:00:00 2001
+From fc6e2aa74a7400c4b4d38051fbcccc346db74af1 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit eb3fea3cdebbd860b6094e21aae589746e13c22a ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -23 +24 @@
-index 8e0561eabb..9a248dfaea 100644
+index a5bd1693b2..3224272eaa 100644
@@ -26 +27 @@
-@@ -2363,7 +2363,7 @@ test_pktmbuf_ext_shinfo_init_helper(struct rte_mempool *pktmbuf_pool)
+@@ -2344,7 +2344,7 @@ test_pktmbuf_ext_shinfo_init_helper(struct rte_mempool *pktmbuf_pool)

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

* [dpdk-stable] patch 'net/octeontx2: fix flow creation limit on CN98xx' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (20 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'test/mbuf: fix virtual address conversion' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/octeontx2: use runtime LSO format indices' " christian.ehrhardt
                   ` (78 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Satheesh Paul; +Cc: Jerin Jacob, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/65a9e807b302fc3842bde7684c20449fa9b16281

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 65a9e807b302fc3842bde7684c20449fa9b16281 Mon Sep 17 00:00:00 2001
From: Satheesh Paul <psatheesh@marvell.com>
Date: Tue, 1 Jun 2021 15:55:51 +0530
Subject: [PATCH] net/octeontx2: fix flow creation limit on CN98xx

[ upstream commit b65db6a879bd09799b96aed09a49458ae1b3644b ]

CN96xx and CN98xx have 4096 and 16384 MCAM entries respectively.
Aligning the code with the same numbers.

Fixes: 092b3834185 ("net/octeontx2: add flow init and fini")

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
---
 drivers/common/octeontx2/otx2_dev.h |  3 +++
 drivers/net/octeontx2/otx2_flow.c   | 16 ++++++++++++++--
 drivers/net/octeontx2/otx2_flow.h   |  1 -
 3 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/drivers/common/octeontx2/otx2_dev.h b/drivers/common/octeontx2/otx2_dev.h
index 7d9839c334..61d8ff6e41 100644
--- a/drivers/common/octeontx2/otx2_dev.h
+++ b/drivers/common/octeontx2/otx2_dev.h
@@ -46,6 +46,9 @@
 	((RVU_PCI_REV_MAJOR(otx2_dev_revid(dev)) == 0x0) &&	\
 	 (RVU_PCI_REV_MIDR_ID(otx2_dev_revid(dev)) == 0x0))
 
+#define otx2_dev_is_98xx(dev)                                   \
+	 (RVU_PCI_REV_MIDR_ID(otx2_dev_revid(dev)) == 0x3)
+
 struct otx2_dev;
 
 /* Link status callback */
diff --git a/drivers/net/octeontx2/otx2_flow.c b/drivers/net/octeontx2/otx2_flow.c
index c9886c9705..0930244da4 100644
--- a/drivers/net/octeontx2/otx2_flow.c
+++ b/drivers/net/octeontx2/otx2_flow.c
@@ -810,12 +810,23 @@ done:
 	return rc;
 }
 
+#define OTX2_MCAM_TOT_ENTRIES_96XX (4096)
+#define OTX2_MCAM_TOT_ENTRIES_98XX (16384)
+
+static int otx2_mcam_tot_entries(struct otx2_eth_dev *dev)
+{
+	if (otx2_dev_is_98xx(dev))
+		return OTX2_MCAM_TOT_ENTRIES_98XX;
+	else
+		return OTX2_MCAM_TOT_ENTRIES_96XX;
+}
+
 int
 otx2_flow_init(struct otx2_eth_dev *hw)
 {
 	uint8_t *mem = NULL, *nix_mem = NULL, *npc_mem = NULL;
 	struct otx2_npc_flow_info *npc = &hw->npc_flow;
-	uint32_t bmap_sz;
+	uint32_t bmap_sz, tot_mcam_entries = 0;
 	int rc = 0, idx;
 
 	rc = flow_fetch_kex_cfg(hw);
@@ -826,7 +837,8 @@ otx2_flow_init(struct otx2_eth_dev *hw)
 
 	rte_atomic32_init(&npc->mark_actions);
 
-	npc->mcam_entries = NPC_MCAM_TOT_ENTRIES >> npc->keyw[NPC_MCAM_RX];
+	tot_mcam_entries = otx2_mcam_tot_entries(hw);
+	npc->mcam_entries = tot_mcam_entries >> npc->keyw[NPC_MCAM_RX];
 	/* Free, free_rev, live and live_rev entries */
 	bmap_sz = rte_bitmap_get_memory_footprint(npc->mcam_entries);
 	mem = rte_zmalloc(NULL, 4 * bmap_sz * npc->flow_max_priority,
diff --git a/drivers/net/octeontx2/otx2_flow.h b/drivers/net/octeontx2/otx2_flow.h
index df78f41d3b..e618664ca7 100644
--- a/drivers/net/octeontx2/otx2_flow.h
+++ b/drivers/net/octeontx2/otx2_flow.h
@@ -34,7 +34,6 @@ enum {
 /* 32 bytes from LDATA_CFG & 32 bytes from FLAGS_CFG */
 #define NPC_MAX_EXTRACT_DATA_LEN	(64)
 #define NPC_LDATA_LFLAG_LEN		(16)
-#define NPC_MCAM_TOT_ENTRIES		(4096)
 #define NPC_MAX_KEY_NIBBLES		(31)
 /* Nibble offsets */
 #define NPC_LAYER_KEYX_SZ		(3)
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:13.964653538 +0200
+++ 0023-net-octeontx2-fix-flow-creation-limit-on-CN98xx.patch	2021-08-10 15:11:12.926637435 +0200
@@ -1 +1 @@
-From b65db6a879bd09799b96aed09a49458ae1b3644b Mon Sep 17 00:00:00 2001
+From 65a9e807b302fc3842bde7684c20449fa9b16281 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b65db6a879bd09799b96aed09a49458ae1b3644b ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -21 +22 @@
-index cd4fe517db..9d8dcca791 100644
+index 7d9839c334..61d8ff6e41 100644
@@ -24,2 +25,2 @@
-@@ -55,6 +55,9 @@
- 	 (RVU_PCI_REV_MINOR(otx2_dev_revid(dev)) == 0x0) &&	\
+@@ -46,6 +46,9 @@
+ 	((RVU_PCI_REV_MAJOR(otx2_dev_revid(dev)) == 0x0) &&	\
@@ -35 +36 @@
-index 1c90d753ff..6df0732189 100644
+index c9886c9705..0930244da4 100644
@@ -38 +39 @@
-@@ -1003,12 +1003,23 @@ done:
+@@ -810,12 +810,23 @@ done:
@@ -63 +64,2 @@
-@@ -1020,7 +1031,8 @@ otx2_flow_init(struct otx2_eth_dev *hw)
+@@ -826,7 +837,8 @@ otx2_flow_init(struct otx2_eth_dev *hw)
+ 
@@ -65 +66,0 @@
- 	npc->vtag_actions = 0;
@@ -74 +75 @@
-index 82a5064d90..790e6ef1e8 100644
+index df78f41d3b..e618664ca7 100644
@@ -77 +78 @@
-@@ -35,7 +35,6 @@ enum {
+@@ -34,7 +34,6 @@ enum {

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

* [dpdk-stable] patch 'net/octeontx2: use runtime LSO format indices' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (21 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/octeontx2: fix flow creation limit on CN98xx' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/ice/base: fix first profile mask' " christian.ehrhardt
                   ` (77 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Nithin Dabilpuram; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/bc88f4ccfedf1d37d011f5ceb17f6cb7f3f983c2

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From bc88f4ccfedf1d37d011f5ceb17f6cb7f3f983c2 Mon Sep 17 00:00:00 2001
From: Nithin Dabilpuram <ndabilpuram@marvell.com>
Date: Fri, 18 Jun 2021 18:36:06 +0530
Subject: [PATCH] net/octeontx2: use runtime LSO format indices

[ upstream commit 56cabfbf4affde4117652cba3c6235d1a40f4205 ]

Currently LSO formats setup initially are expected to be
compile time constants and start from 0.

Change the logic in slow and fast path so that LSO format indexes
are only determined runtime.

Fixes: 3b635472a998 ("net/octeontx2: support TSO offload")

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
---
 drivers/event/octeontx2/otx2_worker.h |  2 +-
 drivers/net/octeontx2/otx2_ethdev.c   | 72 +++++++++++++++------------
 drivers/net/octeontx2/otx2_ethdev.h   | 13 ++++-
 drivers/net/octeontx2/otx2_tx.c       |  8 ++-
 drivers/net/octeontx2/otx2_tx.h       | 12 +++--
 5 files changed, 67 insertions(+), 40 deletions(-)

diff --git a/drivers/event/octeontx2/otx2_worker.h b/drivers/event/octeontx2/otx2_worker.h
index 7d161c85ee..b35a9cf247 100644
--- a/drivers/event/octeontx2/otx2_worker.h
+++ b/drivers/event/octeontx2/otx2_worker.h
@@ -270,7 +270,7 @@ otx2_ssogws_prepare_pkt(const struct otx2_eth_txq *txq, struct rte_mbuf *m,
 			uint64_t *cmd, const uint32_t flags)
 {
 	otx2_lmt_mov(cmd, txq->cmd, otx2_nix_tx_ext_subs(flags));
-	otx2_nix_xmit_prepare(m, cmd, flags);
+	otx2_nix_xmit_prepare(m, cmd, flags, txq->lso_tun_fmt);
 }
 
 static __rte_always_inline uint16_t
diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c
index c952373be4..edd46eae48 100644
--- a/drivers/net/octeontx2/otx2_ethdev.c
+++ b/drivers/net/octeontx2/otx2_ethdev.c
@@ -1098,6 +1098,7 @@ otx2_nix_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t sq,
 	txq->qconf.nb_desc = nb_desc;
 	memcpy(&txq->qconf.conf.tx, tx_conf, sizeof(struct rte_eth_txconf));
 
+	txq->lso_tun_fmt = dev->lso_tun_fmt;
 	otx2_nix_form_default_desc(txq);
 
 	otx2_nix_dbg("sq=%d fc=%p offload=0x%" PRIx64 " sqb=0x%" PRIx64 ""
@@ -1448,7 +1449,7 @@ nix_setup_lso_formats(struct otx2_eth_dev *dev)
 	struct otx2_mbox *mbox = dev->mbox;
 	struct nix_lso_format_cfg_rsp *rsp;
 	struct nix_lso_format_cfg *req;
-	uint8_t base;
+	uint8_t *fmt;
 	int rc;
 
 	/* Skip if TSO was not requested */
@@ -1463,11 +1464,9 @@ nix_setup_lso_formats(struct otx2_eth_dev *dev)
 	if (rc)
 		return rc;
 
-	base = rsp->lso_format_idx;
-	if (base != NIX_LSO_FORMAT_IDX_TSOV4)
+	if (rsp->lso_format_idx != NIX_LSO_FORMAT_IDX_TSOV4)
 		return -EFAULT;
-	dev->lso_base_idx = base;
-	otx2_nix_dbg("tcpv4 lso fmt=%u", base);
+	otx2_nix_dbg("tcpv4 lso fmt=%u", rsp->lso_format_idx);
 
 
 	/*
@@ -1479,9 +1478,9 @@ nix_setup_lso_formats(struct otx2_eth_dev *dev)
 	if (rc)
 		return rc;
 
-	if (rsp->lso_format_idx != base + 1)
+	if (rsp->lso_format_idx != NIX_LSO_FORMAT_IDX_TSOV6)
 		return -EFAULT;
-	otx2_nix_dbg("tcpv6 lso fmt=%u\n", base + 1);
+	otx2_nix_dbg("tcpv6 lso fmt=%u\n", rsp->lso_format_idx);
 
 	/*
 	 * IPv4/UDP/TUN HDR/IPv4/TCP LSO
@@ -1492,9 +1491,8 @@ nix_setup_lso_formats(struct otx2_eth_dev *dev)
 	if (rc)
 		return rc;
 
-	if (rsp->lso_format_idx != base + 2)
-		return -EFAULT;
-	otx2_nix_dbg("udp tun v4v4 fmt=%u\n", base + 2);
+	dev->lso_udp_tun_idx[NIX_LSO_TUN_V4V4] = rsp->lso_format_idx;
+	otx2_nix_dbg("udp tun v4v4 fmt=%u\n", rsp->lso_format_idx);
 
 	/*
 	 * IPv4/UDP/TUN HDR/IPv6/TCP LSO
@@ -1505,9 +1503,8 @@ nix_setup_lso_formats(struct otx2_eth_dev *dev)
 	if (rc)
 		return rc;
 
-	if (rsp->lso_format_idx != base + 3)
-		return -EFAULT;
-	otx2_nix_dbg("udp tun v4v6 fmt=%u\n", base + 3);
+	dev->lso_udp_tun_idx[NIX_LSO_TUN_V4V6] = rsp->lso_format_idx;
+	otx2_nix_dbg("udp tun v4v6 fmt=%u\n", rsp->lso_format_idx);
 
 	/*
 	 * IPv6/UDP/TUN HDR/IPv4/TCP LSO
@@ -1518,9 +1515,8 @@ nix_setup_lso_formats(struct otx2_eth_dev *dev)
 	if (rc)
 		return rc;
 
-	if (rsp->lso_format_idx != base + 4)
-		return -EFAULT;
-	otx2_nix_dbg("udp tun v6v4 fmt=%u\n", base + 4);
+	dev->lso_udp_tun_idx[NIX_LSO_TUN_V6V4] = rsp->lso_format_idx;
+	otx2_nix_dbg("udp tun v6v4 fmt=%u\n", rsp->lso_format_idx);
 
 	/*
 	 * IPv6/UDP/TUN HDR/IPv6/TCP LSO
@@ -1530,9 +1526,9 @@ nix_setup_lso_formats(struct otx2_eth_dev *dev)
 	rc = otx2_mbox_process_msg(mbox, (void *)&rsp);
 	if (rc)
 		return rc;
-	if (rsp->lso_format_idx != base + 5)
-		return -EFAULT;
-	otx2_nix_dbg("udp tun v6v6 fmt=%u\n", base + 5);
+
+	dev->lso_udp_tun_idx[NIX_LSO_TUN_V6V6] = rsp->lso_format_idx;
+	otx2_nix_dbg("udp tun v6v6 fmt=%u\n", rsp->lso_format_idx);
 
 	/*
 	 * IPv4/TUN HDR/IPv4/TCP LSO
@@ -1543,9 +1539,8 @@ nix_setup_lso_formats(struct otx2_eth_dev *dev)
 	if (rc)
 		return rc;
 
-	if (rsp->lso_format_idx != base + 6)
-		return -EFAULT;
-	otx2_nix_dbg("tun v4v4 fmt=%u\n", base + 6);
+	dev->lso_tun_idx[NIX_LSO_TUN_V4V4] = rsp->lso_format_idx;
+	otx2_nix_dbg("tun v4v4 fmt=%u\n", rsp->lso_format_idx);
 
 	/*
 	 * IPv4/TUN HDR/IPv6/TCP LSO
@@ -1556,9 +1551,8 @@ nix_setup_lso_formats(struct otx2_eth_dev *dev)
 	if (rc)
 		return rc;
 
-	if (rsp->lso_format_idx != base + 7)
-		return -EFAULT;
-	otx2_nix_dbg("tun v4v6 fmt=%u\n", base + 7);
+	dev->lso_tun_idx[NIX_LSO_TUN_V4V6] = rsp->lso_format_idx;
+	otx2_nix_dbg("tun v4v6 fmt=%u\n", rsp->lso_format_idx);
 
 	/*
 	 * IPv6/TUN HDR/IPv4/TCP LSO
@@ -1569,9 +1563,8 @@ nix_setup_lso_formats(struct otx2_eth_dev *dev)
 	if (rc)
 		return rc;
 
-	if (rsp->lso_format_idx != base + 8)
-		return -EFAULT;
-	otx2_nix_dbg("tun v6v4 fmt=%u\n", base + 8);
+	dev->lso_tun_idx[NIX_LSO_TUN_V6V4] = rsp->lso_format_idx;
+	otx2_nix_dbg("tun v6v4 fmt=%u\n", rsp->lso_format_idx);
 
 	/*
 	 * IPv6/TUN HDR/IPv6/TCP LSO
@@ -1581,9 +1574,26 @@ nix_setup_lso_formats(struct otx2_eth_dev *dev)
 	rc = otx2_mbox_process_msg(mbox, (void *)&rsp);
 	if (rc)
 		return rc;
-	if (rsp->lso_format_idx != base + 9)
-		return -EFAULT;
-	otx2_nix_dbg("tun v6v6 fmt=%u\n", base + 9);
+
+	dev->lso_tun_idx[NIX_LSO_TUN_V6V6] = rsp->lso_format_idx;
+	otx2_nix_dbg("tun v6v6 fmt=%u\n", rsp->lso_format_idx);
+
+	/* Save all tun formats into u64 for fast path.
+	 * Lower 32bit has non-udp tunnel formats.
+	 * Upper 32bit has udp tunnel formats.
+	 */
+	fmt = dev->lso_tun_idx;
+	dev->lso_tun_fmt = ((uint64_t)fmt[NIX_LSO_TUN_V4V4] |
+			    (uint64_t)fmt[NIX_LSO_TUN_V4V6] << 8 |
+			    (uint64_t)fmt[NIX_LSO_TUN_V6V4] << 16 |
+			    (uint64_t)fmt[NIX_LSO_TUN_V6V6] << 24);
+
+	fmt = dev->lso_udp_tun_idx;
+	dev->lso_tun_fmt |= ((uint64_t)fmt[NIX_LSO_TUN_V4V4] << 32 |
+			     (uint64_t)fmt[NIX_LSO_TUN_V4V6] << 40 |
+			     (uint64_t)fmt[NIX_LSO_TUN_V6V4] << 48 |
+			     (uint64_t)fmt[NIX_LSO_TUN_V6V6] << 56);
+
 	return 0;
 }
 
diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index 6855200fb2..848a1dff85 100644
--- a/drivers/net/octeontx2/otx2_ethdev.h
+++ b/drivers/net/octeontx2/otx2_ethdev.h
@@ -171,6 +171,14 @@ enum nix_q_size_e {
 	nix_q_size_max
 };
 
+enum nix_lso_tun_type {
+	NIX_LSO_TUN_V4V4,
+	NIX_LSO_TUN_V4V6,
+	NIX_LSO_TUN_V6V4,
+	NIX_LSO_TUN_V6V6,
+	NIX_LSO_TUN_MAX,
+};
+
 struct otx2_qint {
 	struct rte_eth_dev *eth_dev;
 	uint8_t qintx;
@@ -265,7 +273,9 @@ struct otx2_eth_dev {
 	uint8_t tx_chan_cnt;
 	uint8_t lso_tsov4_idx;
 	uint8_t lso_tsov6_idx;
-	uint8_t lso_base_idx;
+	uint8_t lso_udp_tun_idx[NIX_LSO_TUN_MAX];
+	uint8_t lso_tun_idx[NIX_LSO_TUN_MAX];
+	uint64_t lso_tun_fmt;
 	uint8_t mac_addr[RTE_ETHER_ADDR_LEN];
 	uint8_t mkex_pfl_name[MKEX_NAME_LEN];
 	uint8_t max_mac_entries;
@@ -339,6 +349,7 @@ struct otx2_eth_txq {
 	rte_iova_t fc_iova;
 	uint16_t sqes_per_sqb_log2;
 	int16_t nb_sqb_bufs_adj;
+	uint64_t lso_tun_fmt;
 	MARKER slow_path_start;
 	uint16_t nb_sqb_bufs;
 	uint16_t sq;
diff --git a/drivers/net/octeontx2/otx2_tx.c b/drivers/net/octeontx2/otx2_tx.c
index fa533000ed..f498a90d16 100644
--- a/drivers/net/octeontx2/otx2_tx.c
+++ b/drivers/net/octeontx2/otx2_tx.c
@@ -27,6 +27,7 @@ nix_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 	struct otx2_eth_txq *txq = tx_queue; uint16_t i;
 	const rte_iova_t io_addr = txq->io_addr;
 	void *lmt_addr = txq->lmt_addr;
+	uint64_t lso_tun_fmt;
 
 	NIX_XMIT_FC_OR_RETURN(txq, pkts);
 
@@ -34,6 +35,7 @@ nix_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 
 	/* Perform header writes before barrier for TSO */
 	if (flags & NIX_TX_OFFLOAD_TSO_F) {
+		lso_tun_fmt = txq->lso_tun_fmt;
 		for (i = 0; i < pkts; i++)
 			otx2_nix_xmit_prepare_tso(tx_pkts[i], flags);
 	}
@@ -42,7 +44,7 @@ nix_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 	rte_cio_wmb();
 
 	for (i = 0; i < pkts; i++) {
-		otx2_nix_xmit_prepare(tx_pkts[i], cmd, flags);
+		otx2_nix_xmit_prepare(tx_pkts[i], cmd, flags, lso_tun_fmt);
 		/* Passing no of segdw as 4: HDR + EXT + SG + SMEM */
 		otx2_nix_xmit_prepare_tstamp(cmd, &txq->cmd[0],
 					     tx_pkts[i]->ol_flags, 4, flags);
@@ -62,6 +64,7 @@ nix_xmit_pkts_mseg(void *tx_queue, struct rte_mbuf **tx_pkts,
 	struct otx2_eth_txq *txq = tx_queue; uint64_t i;
 	const rte_iova_t io_addr = txq->io_addr;
 	void *lmt_addr = txq->lmt_addr;
+	uint64_t lso_tun_fmt;
 	uint16_t segdw;
 
 	NIX_XMIT_FC_OR_RETURN(txq, pkts);
@@ -70,6 +73,7 @@ nix_xmit_pkts_mseg(void *tx_queue, struct rte_mbuf **tx_pkts,
 
 	/* Perform header writes before barrier for TSO */
 	if (flags & NIX_TX_OFFLOAD_TSO_F) {
+		lso_tun_fmt = txq->lso_tun_fmt;
 		for (i = 0; i < pkts; i++)
 			otx2_nix_xmit_prepare_tso(tx_pkts[i], flags);
 	}
@@ -78,7 +82,7 @@ nix_xmit_pkts_mseg(void *tx_queue, struct rte_mbuf **tx_pkts,
 	rte_cio_wmb();
 
 	for (i = 0; i < pkts; i++) {
-		otx2_nix_xmit_prepare(tx_pkts[i], cmd, flags);
+		otx2_nix_xmit_prepare(tx_pkts[i], cmd, flags, lso_tun_fmt);
 		segdw = otx2_nix_prepare_mseg(tx_pkts[i], cmd, flags);
 		otx2_nix_xmit_prepare_tstamp(cmd, &txq->cmd[0],
 					     tx_pkts[i]->ol_flags, segdw,
diff --git a/drivers/net/octeontx2/otx2_tx.h b/drivers/net/octeontx2/otx2_tx.h
index 04e859bacd..c13c4c2c2f 100644
--- a/drivers/net/octeontx2/otx2_tx.h
+++ b/drivers/net/octeontx2/otx2_tx.h
@@ -196,7 +196,8 @@ otx2_nix_xmit_prepare_tso(struct rte_mbuf *m, const uint64_t flags)
 }
 
 static __rte_always_inline void
-otx2_nix_xmit_prepare(struct rte_mbuf *m, uint64_t *cmd, const uint16_t flags)
+otx2_nix_xmit_prepare(struct rte_mbuf *m, uint64_t *cmd, const uint16_t flags,
+		      const uint64_t lso_tun_fmt)
 {
 	struct nix_send_ext_s *send_hdr_ext;
 	struct nix_send_hdr_s *send_hdr;
@@ -338,14 +339,15 @@ otx2_nix_xmit_prepare(struct rte_mbuf *m, uint64_t *cmd, const uint16_t flags)
 		    (ol_flags & PKT_TX_TUNNEL_MASK)) {
 			const uint8_t is_udp_tun = (NIX_UDP_TUN_BITMASK >>
 				((ol_flags & PKT_TX_TUNNEL_MASK) >> 45)) & 0x1;
+			uint8_t shift = is_udp_tun ? 32 : 0;
+
+			shift += (!!(ol_flags & PKT_TX_OUTER_IPV6) << 4);
+			shift += (!!(ol_flags & PKT_TX_IPV6) << 3);
 
 			w1.il4type = NIX_SENDL4TYPE_TCP_CKSUM;
 			w1.ol4type = is_udp_tun ? NIX_SENDL4TYPE_UDP_CKSUM : 0;
 			/* Update format for UDP tunneled packet */
-			send_hdr_ext->w0.lso_format += is_udp_tun ? 2 : 6;
-
-			send_hdr_ext->w0.lso_format +=
-				!!(ol_flags & PKT_TX_OUTER_IPV6) << 1;
+			send_hdr_ext->w0.lso_format = (lso_tun_fmt >> shift);
 		}
 	}
 
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:13.998688086 +0200
+++ 0024-net-octeontx2-use-runtime-LSO-format-indices.patch	2021-08-10 15:11:12.930637465 +0200
@@ -1 +1 @@
-From 56cabfbf4affde4117652cba3c6235d1a40f4205 Mon Sep 17 00:00:00 2001
+From bc88f4ccfedf1d37d011f5ceb17f6cb7f3f983c2 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 56cabfbf4affde4117652cba3c6235d1a40f4205 ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -25 +26 @@
-index fd149be919..3e36dcece1 100644
+index 7d161c85ee..b35a9cf247 100644
@@ -28 +29 @@
-@@ -264,7 +264,7 @@ otx2_ssogws_prepare_pkt(const struct otx2_eth_txq *txq, struct rte_mbuf *m,
+@@ -270,7 +270,7 @@ otx2_ssogws_prepare_pkt(const struct otx2_eth_txq *txq, struct rte_mbuf *m,
@@ -38 +39 @@
-index 0834de0cb1..0a420c1fb1 100644
+index c952373be4..edd46eae48 100644
@@ -41 +42 @@
-@@ -1326,6 +1326,7 @@ otx2_nix_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t sq,
+@@ -1098,6 +1098,7 @@ otx2_nix_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t sq,
@@ -49 +50 @@
-@@ -1676,7 +1677,7 @@ nix_setup_lso_formats(struct otx2_eth_dev *dev)
+@@ -1448,7 +1449,7 @@ nix_setup_lso_formats(struct otx2_eth_dev *dev)
@@ -58 +59 @@
-@@ -1691,11 +1692,9 @@ nix_setup_lso_formats(struct otx2_eth_dev *dev)
+@@ -1463,11 +1464,9 @@ nix_setup_lso_formats(struct otx2_eth_dev *dev)
@@ -72 +73 @@
-@@ -1707,9 +1706,9 @@ nix_setup_lso_formats(struct otx2_eth_dev *dev)
+@@ -1479,9 +1478,9 @@ nix_setup_lso_formats(struct otx2_eth_dev *dev)
@@ -84 +85 @@
-@@ -1720,9 +1719,8 @@ nix_setup_lso_formats(struct otx2_eth_dev *dev)
+@@ -1492,9 +1491,8 @@ nix_setup_lso_formats(struct otx2_eth_dev *dev)
@@ -96 +97 @@
-@@ -1733,9 +1731,8 @@ nix_setup_lso_formats(struct otx2_eth_dev *dev)
+@@ -1505,9 +1503,8 @@ nix_setup_lso_formats(struct otx2_eth_dev *dev)
@@ -108 +109 @@
-@@ -1746,9 +1743,8 @@ nix_setup_lso_formats(struct otx2_eth_dev *dev)
+@@ -1518,9 +1515,8 @@ nix_setup_lso_formats(struct otx2_eth_dev *dev)
@@ -120 +121 @@
-@@ -1758,9 +1754,9 @@ nix_setup_lso_formats(struct otx2_eth_dev *dev)
+@@ -1530,9 +1526,9 @@ nix_setup_lso_formats(struct otx2_eth_dev *dev)
@@ -133 +134 @@
-@@ -1771,9 +1767,8 @@ nix_setup_lso_formats(struct otx2_eth_dev *dev)
+@@ -1543,9 +1539,8 @@ nix_setup_lso_formats(struct otx2_eth_dev *dev)
@@ -145 +146 @@
-@@ -1784,9 +1779,8 @@ nix_setup_lso_formats(struct otx2_eth_dev *dev)
+@@ -1556,9 +1551,8 @@ nix_setup_lso_formats(struct otx2_eth_dev *dev)
@@ -157 +158 @@
-@@ -1797,9 +1791,8 @@ nix_setup_lso_formats(struct otx2_eth_dev *dev)
+@@ -1569,9 +1563,8 @@ nix_setup_lso_formats(struct otx2_eth_dev *dev)
@@ -169 +170 @@
-@@ -1809,9 +1802,26 @@ nix_setup_lso_formats(struct otx2_eth_dev *dev)
+@@ -1581,9 +1574,26 @@ nix_setup_lso_formats(struct otx2_eth_dev *dev)
@@ -200 +201 @@
-index ac50da7b18..381e6b6cb3 100644
+index 6855200fb2..848a1dff85 100644
@@ -203 +204 @@
-@@ -182,6 +182,14 @@ enum nix_q_size_e {
+@@ -171,6 +171,14 @@ enum nix_q_size_e {
@@ -218 +219 @@
-@@ -276,7 +284,9 @@ struct otx2_eth_dev {
+@@ -265,7 +273,9 @@ struct otx2_eth_dev {
@@ -229 +230 @@
-@@ -359,6 +369,7 @@ struct otx2_eth_txq {
+@@ -339,6 +349,7 @@ struct otx2_eth_txq {
@@ -234 +235 @@
- 	RTE_MARKER slow_path_start;
+ 	MARKER slow_path_start;
@@ -238 +239 @@
-index 439c46f61c..ff299f00b9 100644
+index fa533000ed..f498a90d16 100644
@@ -257,2 +258,2 @@
-@@ -45,7 +47,7 @@ nix_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
- 		rte_io_wmb();
+@@ -42,7 +44,7 @@ nix_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
+ 	rte_cio_wmb();
@@ -266 +267 @@
-@@ -65,6 +67,7 @@ nix_xmit_pkts_mseg(void *tx_queue, struct rte_mbuf **tx_pkts,
+@@ -62,6 +64,7 @@ nix_xmit_pkts_mseg(void *tx_queue, struct rte_mbuf **tx_pkts,
@@ -274 +275 @@
-@@ -73,6 +76,7 @@ nix_xmit_pkts_mseg(void *tx_queue, struct rte_mbuf **tx_pkts,
+@@ -70,6 +73,7 @@ nix_xmit_pkts_mseg(void *tx_queue, struct rte_mbuf **tx_pkts,
@@ -282,2 +283,2 @@
-@@ -84,7 +88,7 @@ nix_xmit_pkts_mseg(void *tx_queue, struct rte_mbuf **tx_pkts,
- 		rte_io_wmb();
+@@ -78,7 +82,7 @@ nix_xmit_pkts_mseg(void *tx_queue, struct rte_mbuf **tx_pkts,
+ 	rte_cio_wmb();
@@ -292 +293 @@
-index a97b160677..486248dff7 100644
+index 04e859bacd..c13c4c2c2f 100644
@@ -295 +296 @@
-@@ -197,7 +197,8 @@ otx2_nix_xmit_prepare_tso(struct rte_mbuf *m, const uint64_t flags)
+@@ -196,7 +196,8 @@ otx2_nix_xmit_prepare_tso(struct rte_mbuf *m, const uint64_t flags)
@@ -305 +306 @@
-@@ -339,14 +340,15 @@ otx2_nix_xmit_prepare(struct rte_mbuf *m, uint64_t *cmd, const uint16_t flags)
+@@ -338,14 +339,15 @@ otx2_nix_xmit_prepare(struct rte_mbuf *m, uint64_t *cmd, const uint16_t flags)

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

* [dpdk-stable] patch 'net/ice/base: fix first profile mask' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (22 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/octeontx2: use runtime LSO format indices' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'vhost: fix missing memory table NUMA realloc' " christian.ehrhardt
                   ` (76 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Wenjun Wu; +Cc: Qi Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/75d705fba918351f0af0c2f66821b81c79ac39dc

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 75d705fba918351f0af0c2f66821b81c79ac39dc Mon Sep 17 00:00:00 2001
From: Wenjun Wu <wenjun1.wu@intel.com>
Date: Mon, 21 Jun 2021 16:59:23 +0800
Subject: [PATCH] net/ice/base: fix first profile mask

[ upstream commit 148fdf2d3537cfbb912e9c619ace7205741d9a25 ]

Since each PF does not share the same structure space, the first
mask value should start at 0 instead of hw->pf_id * per_pf to avoid
address overflow. Otherwise, address space will overlap when
masks.first + masks.count > ICE_PROF_MASK_COUNT, and it may lead to
unexpected variable assignment, which causes segmentation fault.

Fixes: 9467486f179f ("net/ice/base: enable masking for RSS and FD field vectors")

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ice/base/ice_flex_pipe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ice/base/ice_flex_pipe.c b/drivers/net/ice/base/ice_flex_pipe.c
index cc95a2e0d0..eb0d784745 100644
--- a/drivers/net/ice/base/ice_flex_pipe.c
+++ b/drivers/net/ice/base/ice_flex_pipe.c
@@ -2953,7 +2953,7 @@ static void ice_init_prof_masks(struct ice_hw *hw, enum ice_block blk)
 	per_pf = ICE_PROF_MASK_COUNT / hw->dev_caps.num_funcs;
 
 	hw->blk[blk].masks.count = per_pf;
-	hw->blk[blk].masks.first = hw->pf_id * per_pf;
+	hw->blk[blk].masks.first = 0;
 
 	ice_memset(hw->blk[blk].masks.masks, 0,
 		   sizeof(hw->blk[blk].masks.masks), ICE_NONDMA_MEM);
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:14.042482292 +0200
+++ 0025-net-ice-base-fix-first-profile-mask.patch	2021-08-10 15:11:12.934637493 +0200
@@ -1 +1 @@
-From 148fdf2d3537cfbb912e9c619ace7205741d9a25 Mon Sep 17 00:00:00 2001
+From 75d705fba918351f0af0c2f66821b81c79ac39dc Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 148fdf2d3537cfbb912e9c619ace7205741d9a25 ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
-index b3cea731f3..829d88bba6 100644
+index cc95a2e0d0..eb0d784745 100644
@@ -25 +26 @@
-@@ -3432,7 +3432,7 @@ static void ice_init_prof_masks(struct ice_hw *hw, enum ice_block blk)
+@@ -2953,7 +2953,7 @@ static void ice_init_prof_masks(struct ice_hw *hw, enum ice_block blk)

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

* [dpdk-stable] patch 'vhost: fix missing memory table NUMA realloc' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (23 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/ice/base: fix first profile mask' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'vhost: fix missing guest pages " christian.ehrhardt
                   ` (75 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Maxime Coquelin; +Cc: David Marchand, Chenbo Xia, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/354836674a9f7aa25649209f09c645fdb1eaf7e7

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 354836674a9f7aa25649209f09c645fdb1eaf7e7 Mon Sep 17 00:00:00 2001
From: Maxime Coquelin <maxime.coquelin@redhat.com>
Date: Tue, 29 Jun 2021 18:11:27 +0200
Subject: [PATCH] vhost: fix missing memory table NUMA realloc

[ upstream commit 8119ca9114b2ab2d42732e2a8b5cb31c47ed4eb3 ]

When the guest allocates virtqueues on a different NUMA node
than the one the Vhost metadata are allocated, both the Vhost
device struct and the virtqueues struct are reallocated.

However, reallocating the Vhost memory table was missing, which
likely causes at least one cross-NUMA accesses for every burst
of packets.

This patch reallocates this table on the same NUMA node as the
other metadata.

Fixes: 552e8fd3d2b4 ("vhost: simplify memory regions handling")

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

diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index dc1e312d84..54079a9efc 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -498,8 +498,8 @@ vhost_user_set_vring_num(struct virtio_net **pdev,
 }
 
 /*
- * Reallocate virtio_dev and vhost_virtqueue data structure to make them on the
- * same numa node as the memory of vring descriptor.
+ * Reallocate virtio_dev, vhost_virtqueue and related data structures to
+ * make them on the same numa node as the memory of vring descriptor.
  */
 #ifdef RTE_LIBRTE_VHOST_NUMA
 static struct virtio_net*
@@ -593,6 +593,9 @@ numa_realloc(struct virtio_net *dev, int index)
 		goto out;
 	}
 	if (oldnode != newnode) {
+		struct rte_vhost_memory *old_mem;
+		ssize_t mem_size;
+
 		RTE_LOG(INFO, VHOST_CONFIG,
 			"reallocate dev from %d to %d node\n",
 			oldnode, newnode);
@@ -604,6 +607,18 @@ numa_realloc(struct virtio_net *dev, int index)
 
 		memcpy(dev, old_dev, sizeof(*dev));
 		rte_free(old_dev);
+
+		mem_size = sizeof(struct rte_vhost_memory) +
+			sizeof(struct rte_vhost_mem_region) * dev->mem->nregions;
+		old_mem = dev->mem;
+		dev->mem = rte_malloc_socket(NULL, mem_size, 0, newnode);
+		if (!dev->mem) {
+			dev->mem = old_mem;
+			goto out;
+		}
+
+		memcpy(dev->mem, old_mem, mem_size);
+		rte_free(old_mem);
 	}
 
 out:
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:14.080158255 +0200
+++ 0026-vhost-fix-missing-memory-table-NUMA-realloc.patch	2021-08-10 15:11:12.938637523 +0200
@@ -1 +1 @@
-From 8119ca9114b2ab2d42732e2a8b5cb31c47ed4eb3 Mon Sep 17 00:00:00 2001
+From 354836674a9f7aa25649209f09c645fdb1eaf7e7 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 8119ca9114b2ab2d42732e2a8b5cb31c47ed4eb3 ]
+
@@ -18 +19,0 @@
-Cc: stable@dpdk.org
@@ -24 +25 @@
- lib/vhost/vhost_user.c | 19 +++++++++++++++++--
+ lib/librte_vhost/vhost_user.c | 19 +++++++++++++++++--
@@ -27,5 +28,5 @@
-diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c
-index 8f0eba6412..b5a84f3dcd 100644
---- a/lib/vhost/vhost_user.c
-+++ b/lib/vhost/vhost_user.c
-@@ -473,8 +473,8 @@ vhost_user_set_vring_num(struct virtio_net **pdev,
+diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
+index dc1e312d84..54079a9efc 100644
+--- a/lib/librte_vhost/vhost_user.c
++++ b/lib/librte_vhost/vhost_user.c
+@@ -498,8 +498,8 @@ vhost_user_set_vring_num(struct virtio_net **pdev,
@@ -42 +43 @@
-@@ -557,6 +557,9 @@ numa_realloc(struct virtio_net *dev, int index)
+@@ -593,6 +593,9 @@ numa_realloc(struct virtio_net *dev, int index)
@@ -49 +50 @@
- 		VHOST_LOG_CONFIG(INFO,
+ 		RTE_LOG(INFO, VHOST_CONFIG,
@@ -52 +53 @@
-@@ -568,6 +571,18 @@ numa_realloc(struct virtio_net *dev, int index)
+@@ -604,6 +607,18 @@ numa_realloc(struct virtio_net *dev, int index)

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

* [dpdk-stable] patch 'vhost: fix missing guest pages table NUMA realloc' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (24 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'vhost: fix missing memory table NUMA realloc' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'mempool/octeontx2: fix shift calculation' " christian.ehrhardt
                   ` (74 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Maxime Coquelin; +Cc: Chenbo Xia, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/eb35473b23045d32d4abd4d31ca36483e37953df

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From eb35473b23045d32d4abd4d31ca36483e37953df Mon Sep 17 00:00:00 2001
From: Maxime Coquelin <maxime.coquelin@redhat.com>
Date: Tue, 29 Jun 2021 18:11:28 +0200
Subject: [PATCH] vhost: fix missing guest pages table NUMA realloc

[ upstream commit 57589cdfd784e6704ded490d80038584d6ade9df ]

When the guest allocates virtqueues on a different NUMA node
than the one the Vhost metadata are allocated, both the Vhost
device struct and the virtqueues struct are reallocated.

However, reallocating the guest pages table was missing, which
likely causes at least one cross-NUMA accesses for every burst
of packets.

This patch reallocates this table on the same NUMA node as the
other metadata.

Fixes: e246896178e6 ("vhost: get guest/host physical address mappings")

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
---
 lib/librte_vhost/vhost_user.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index 54079a9efc..c016114e75 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -594,7 +594,8 @@ numa_realloc(struct virtio_net *dev, int index)
 	}
 	if (oldnode != newnode) {
 		struct rte_vhost_memory *old_mem;
-		ssize_t mem_size;
+		struct guest_page *old_gp;
+		ssize_t mem_size, gp_size;
 
 		RTE_LOG(INFO, VHOST_CONFIG,
 			"reallocate dev from %d to %d node\n",
@@ -619,6 +620,17 @@ numa_realloc(struct virtio_net *dev, int index)
 
 		memcpy(dev->mem, old_mem, mem_size);
 		rte_free(old_mem);
+
+		gp_size = dev->max_guest_pages * sizeof(*dev->guest_pages);
+		old_gp = dev->guest_pages;
+		dev->guest_pages = rte_malloc_socket(NULL, gp_size, RTE_CACHE_LINE_SIZE, newnode);
+		if (!dev->guest_pages) {
+			dev->guest_pages = old_gp;
+			goto out;
+		}
+
+		memcpy(dev->guest_pages, old_gp, gp_size);
+		rte_free(old_gp);
 	}
 
 out:
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:14.116402406 +0200
+++ 0027-vhost-fix-missing-guest-pages-table-NUMA-realloc.patch	2021-08-10 15:11:12.942637551 +0200
@@ -1 +1 @@
-From 57589cdfd784e6704ded490d80038584d6ade9df Mon Sep 17 00:00:00 2001
+From eb35473b23045d32d4abd4d31ca36483e37953df Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 57589cdfd784e6704ded490d80038584d6ade9df ]
+
@@ -18 +19,0 @@
-Cc: stable@dpdk.org
@@ -23 +24 @@
- lib/vhost/vhost_user.c | 14 +++++++++++++-
+ lib/librte_vhost/vhost_user.c | 14 +++++++++++++-
@@ -26,5 +27,5 @@
-diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c
-index b5a84f3dcd..5fb055ea2e 100644
---- a/lib/vhost/vhost_user.c
-+++ b/lib/vhost/vhost_user.c
-@@ -558,7 +558,8 @@ numa_realloc(struct virtio_net *dev, int index)
+diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
+index 54079a9efc..c016114e75 100644
+--- a/lib/librte_vhost/vhost_user.c
++++ b/lib/librte_vhost/vhost_user.c
+@@ -594,7 +594,8 @@ numa_realloc(struct virtio_net *dev, int index)
@@ -38 +39 @@
- 		VHOST_LOG_CONFIG(INFO,
+ 		RTE_LOG(INFO, VHOST_CONFIG,
@@ -40 +41 @@
-@@ -583,6 +584,17 @@ numa_realloc(struct virtio_net *dev, int index)
+@@ -619,6 +620,17 @@ numa_realloc(struct virtio_net *dev, int index)

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

* [dpdk-stable] patch 'mempool/octeontx2: fix shift calculation' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (25 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'vhost: fix missing guest pages " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'drivers/net: fix memzone allocations for DMA memory' " christian.ehrhardt
                   ` (73 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Pavan Nikhilesh; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/004151c375ffd9c6f422d593e35932e083013d8b

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 004151c375ffd9c6f422d593e35932e083013d8b Mon Sep 17 00:00:00 2001
From: Pavan Nikhilesh <pbhagavatula@marvell.com>
Date: Tue, 15 Jun 2021 00:54:24 +0530
Subject: [PATCH] mempool/octeontx2: fix shift calculation

[ upstream commit 43d89404950bb4d8e0efbcaebf734a0a722c2dbb ]

Shift is used to generate an 8-bit saturate value from the current
aura used count. The shift value should be derived from the log2 of
block count if it is greater than 256 else the shift should be 0.

Fixes: 7bcc47cbe2fa ("mempool/octeontx2: add mempool alloc op")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 drivers/mempool/octeontx2/otx2_mempool_ops.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mempool/octeontx2/otx2_mempool_ops.c b/drivers/mempool/octeontx2/otx2_mempool_ops.c
index 18bdb0b4c4..f4d50c29ca 100644
--- a/drivers/mempool/octeontx2/otx2_mempool_ops.c
+++ b/drivers/mempool/octeontx2/otx2_mempool_ops.c
@@ -533,7 +533,8 @@ npa_lf_aura_pool_pair_alloc(struct otx2_npa_lf *lf, const uint32_t block_size,
 	/* Update aura fields */
 	aura->pool_addr = pool_id;/* AF will translate to associated poolctx */
 	aura->ena = 1;
-	aura->shift = __builtin_clz(block_count) - 8;
+	aura->shift = rte_log2_u32(block_count);
+	aura->shift = aura->shift < 8 ? 0 : aura->shift - 8;
 	aura->limit = block_count;
 	aura->pool_caching = 1;
 	aura->err_int_ena = BIT(NPA_AURA_ERR_INT_AURA_ADD_OVER);
@@ -548,7 +549,8 @@ npa_lf_aura_pool_pair_alloc(struct otx2_npa_lf *lf, const uint32_t block_size,
 	pool->ena = 1;
 	pool->buf_size = block_size / OTX2_ALIGN;
 	pool->stack_max_pages = stack_size;
-	pool->shift = __builtin_clz(block_count) - 8;
+	pool->shift = rte_log2_u32(block_count);
+	pool->shift = pool->shift < 8 ? 0 : pool->shift - 8;
 	pool->ptr_start = 0;
 	pool->ptr_end = ~0;
 	pool->stack_caching = 1;
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:14.151849489 +0200
+++ 0028-mempool-octeontx2-fix-shift-calculation.patch	2021-08-10 15:11:12.942637551 +0200
@@ -1 +1 @@
-From 43d89404950bb4d8e0efbcaebf734a0a722c2dbb Mon Sep 17 00:00:00 2001
+From 004151c375ffd9c6f422d593e35932e083013d8b Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 43d89404950bb4d8e0efbcaebf734a0a722c2dbb ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
-index 9ff71bcf6b..d827fd8c7b 100644
+index 18bdb0b4c4..f4d50c29ca 100644
@@ -22 +23 @@
-@@ -611,7 +611,8 @@ npa_lf_aura_pool_pair_alloc(struct otx2_npa_lf *lf, const uint32_t block_size,
+@@ -533,7 +533,8 @@ npa_lf_aura_pool_pair_alloc(struct otx2_npa_lf *lf, const uint32_t block_size,
@@ -32 +33 @@
-@@ -626,7 +627,8 @@ npa_lf_aura_pool_pair_alloc(struct otx2_npa_lf *lf, const uint32_t block_size,
+@@ -548,7 +549,8 @@ npa_lf_aura_pool_pair_alloc(struct otx2_npa_lf *lf, const uint32_t block_size,

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

* [dpdk-stable] patch 'drivers/net: fix memzone allocations for DMA memory' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (26 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'mempool/octeontx2: fix shift calculation' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/hns3: increase VF reset retry maximum' " christian.ehrhardt
                   ` (72 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: David Marchand; +Cc: Min Hu, Haiyue Wang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/9e9fa80269c4149159457c04714a91d7ae1bcef2

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 9e9fa80269c4149159457c04714a91d7ae1bcef2 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Tue, 6 Jul 2021 10:57:50 +0200
Subject: [PATCH] drivers/net: fix memzone allocations for DMA memory

[ upstream commit d07fc02fb4b38c0dded75d2d21b976d68b494f0e ]

Caught by code review.

Using a random name for memzone allocations can result in init failures
in the unlikely case that a name collision occurs.
Use a simple sequential generator on 64 bits.

Fixes: 3f50f072ff06 ("i40e: fix memzone freeing")
Fixes: 22b123a36d07 ("net/avf: initialize PMD")
Fixes: 5f0978e96220 ("net/ice/base: add OS specific implementation")
Fixes: 737f30e1c3ab ("net/hns3: support command interface with firmware")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
---
 drivers/net/hns3/hns3_cmd.c      | 4 +++-
 drivers/net/i40e/i40e_ethdev.c   | 4 +++-
 drivers/net/iavf/iavf_ethdev.c   | 4 +++-
 drivers/net/ice/base/ice_osdep.h | 5 +++--
 4 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/net/hns3/hns3_cmd.c b/drivers/net/hns3/hns3_cmd.c
index ef03d31b22..07a3185f6b 100644
--- a/drivers/net/hns3/hns3_cmd.c
+++ b/drivers/net/hns3/hns3_cmd.c
@@ -59,10 +59,12 @@ static int
 hns3_allocate_dma_mem(struct hns3_hw *hw, struct hns3_cmq_ring *ring,
 		      uint64_t size, uint32_t alignment)
 {
+	static uint64_t hns3_dma_memzone_id;
 	const struct rte_memzone *mz = NULL;
 	char z_name[RTE_MEMZONE_NAMESIZE];
 
-	snprintf(z_name, sizeof(z_name), "hns3_dma_%" PRIu64, rte_rand());
+	snprintf(z_name, sizeof(z_name), "hns3_dma_%" PRIu64,
+		__atomic_fetch_add(&hns3_dma_memzone_id, 1, __ATOMIC_RELAXED));
 	mz = rte_memzone_reserve_bounded(z_name, size, SOCKET_ID_ANY,
 					 RTE_MEMZONE_IOVA_CONTIG, alignment,
 					 RTE_PGSIZE_2M);
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index d825ef7296..e057f16e46 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -4604,13 +4604,15 @@ i40e_allocate_dma_mem_d(__attribute__((unused)) struct i40e_hw *hw,
 			u64 size,
 			u32 alignment)
 {
+	static uint64_t i40e_dma_memzone_id;
 	const struct rte_memzone *mz = NULL;
 	char z_name[RTE_MEMZONE_NAMESIZE];
 
 	if (!mem)
 		return I40E_ERR_PARAM;
 
-	snprintf(z_name, sizeof(z_name), "i40e_dma_%"PRIu64, rte_rand());
+	snprintf(z_name, sizeof(z_name), "i40e_dma_%" PRIu64,
+		__atomic_fetch_add(&i40e_dma_memzone_id, 1, __ATOMIC_RELAXED));
 	mz = rte_memzone_reserve_bounded(z_name, size, SOCKET_ID_ANY,
 			RTE_MEMZONE_IOVA_CONTIG, alignment, RTE_PGSIZE_2M);
 	if (!mz)
diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index d7d14ee11a..7d4b6b915c 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -1544,13 +1544,15 @@ iavf_allocate_dma_mem_d(__rte_unused struct iavf_hw *hw,
 		       u64 size,
 		       u32 alignment)
 {
+	static uint64_t iavf_dma_memzone_id;
 	const struct rte_memzone *mz = NULL;
 	char z_name[RTE_MEMZONE_NAMESIZE];
 
 	if (!mem)
 		return IAVF_ERR_PARAM;
 
-	snprintf(z_name, sizeof(z_name), "iavf_dma_%"PRIu64, rte_rand());
+	snprintf(z_name, sizeof(z_name), "iavf_dma_%" PRIu64,
+		__atomic_fetch_add(&iavf_dma_memzone_id, 1, __ATOMIC_RELAXED));
 	mz = rte_memzone_reserve_bounded(z_name, size, SOCKET_ID_ANY,
 			RTE_MEMZONE_IOVA_CONTIG, alignment, RTE_PGSIZE_2M);
 	if (!mz)
diff --git a/drivers/net/ice/base/ice_osdep.h b/drivers/net/ice/base/ice_osdep.h
index ba0c57e1a9..5970c918d1 100644
--- a/drivers/net/ice/base/ice_osdep.h
+++ b/drivers/net/ice/base/ice_osdep.h
@@ -21,7 +21,6 @@
 #include <rte_cycles.h>
 #include <rte_spinlock.h>
 #include <rte_log.h>
-#include <rte_random.h>
 #include <rte_io.h>
 
 #include "ice_alloc.h"
@@ -241,13 +240,15 @@ static inline void *
 ice_alloc_dma_mem(__attribute__((unused)) struct ice_hw *hw,
 		  struct ice_dma_mem *mem, u64 size)
 {
+	static uint64_t ice_dma_memzone_id;
 	const struct rte_memzone *mz = NULL;
 	char z_name[RTE_MEMZONE_NAMESIZE];
 
 	if (!mem)
 		return NULL;
 
-	snprintf(z_name, sizeof(z_name), "ice_dma_%"PRIu64, rte_rand());
+	snprintf(z_name, sizeof(z_name), "ice_dma_%" PRIu64,
+		__atomic_fetch_add(&ice_dma_memzone_id, 1, __ATOMIC_RELAXED));
 	mz = rte_memzone_reserve_bounded(z_name, size, SOCKET_ID_ANY, 0,
 					 0, RTE_PGSIZE_2M);
 	if (!mz)
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:14.188230281 +0200
+++ 0029-drivers-net-fix-memzone-allocations-for-DMA-memory.patch	2021-08-10 15:11:12.954637638 +0200
@@ -1 +1 @@
-From d07fc02fb4b38c0dded75d2d21b976d68b494f0e Mon Sep 17 00:00:00 2001
+From 9e9fa80269c4149159457c04714a91d7ae1bcef2 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit d07fc02fb4b38c0dded75d2d21b976d68b494f0e ]
+
@@ -16 +17,0 @@
-Cc: stable@dpdk.org
@@ -22 +22,0 @@
- drivers/common/iavf/iavf_impl.c  | 5 +++--
@@ -24,0 +25 @@
+ drivers/net/iavf/iavf_ethdev.c   | 4 +++-
@@ -26 +27 @@
- 4 files changed, 12 insertions(+), 6 deletions(-)
+ 4 files changed, 12 insertions(+), 5 deletions(-)
@@ -28,29 +28,0 @@
-diff --git a/drivers/common/iavf/iavf_impl.c b/drivers/common/iavf/iavf_impl.c
-index 0c7d5c0dae..8919b0e7c3 100644
---- a/drivers/common/iavf/iavf_impl.c
-+++ b/drivers/common/iavf/iavf_impl.c
-@@ -6,7 +6,6 @@
- #include <inttypes.h>
- 
- #include <rte_common.h>
--#include <rte_random.h>
- #include <rte_malloc.h>
- #include <rte_memzone.h>
- 
-@@ -19,13 +18,15 @@ iavf_allocate_dma_mem_d(__rte_unused struct iavf_hw *hw,
- 			u64 size,
- 			u32 alignment)
- {
-+	static uint64_t iavf_dma_memzone_id;
- 	const struct rte_memzone *mz = NULL;
- 	char z_name[RTE_MEMZONE_NAMESIZE];
- 
- 	if (!mem)
- 		return IAVF_ERR_PARAM;
- 
--	snprintf(z_name, sizeof(z_name), "iavf_dma_%"PRIu64, rte_rand());
-+	snprintf(z_name, sizeof(z_name), "iavf_dma_%" PRIu64,
-+		__atomic_fetch_add(&iavf_dma_memzone_id, 1, __ATOMIC_RELAXED));
- 	mz = rte_memzone_reserve_bounded(z_name, size, SOCKET_ID_ANY,
- 					 RTE_MEMZONE_IOVA_CONTIG, alignment,
- 					 RTE_PGSIZE_2M);
@@ -58 +30 @@
-index 44a4e2860d..175d48d14b 100644
+index ef03d31b22..07a3185f6b 100644
@@ -61 +33 @@
-@@ -44,10 +44,12 @@ static int
+@@ -59,10 +59,12 @@ static int
@@ -76 +48 @@
-index 5b0a7f2537..7b230e2ed1 100644
+index d825ef7296..e057f16e46 100644
@@ -79 +51 @@
-@@ -4554,13 +4554,15 @@ i40e_allocate_dma_mem_d(__rte_unused struct i40e_hw *hw,
+@@ -4604,13 +4604,15 @@ i40e_allocate_dma_mem_d(__attribute__((unused)) struct i40e_hw *hw,
@@ -95,0 +68,21 @@
+diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
+index d7d14ee11a..7d4b6b915c 100644
+--- a/drivers/net/iavf/iavf_ethdev.c
++++ b/drivers/net/iavf/iavf_ethdev.c
+@@ -1544,13 +1544,15 @@ iavf_allocate_dma_mem_d(__rte_unused struct iavf_hw *hw,
+ 		       u64 size,
+ 		       u32 alignment)
+ {
++	static uint64_t iavf_dma_memzone_id;
+ 	const struct rte_memzone *mz = NULL;
+ 	char z_name[RTE_MEMZONE_NAMESIZE];
+ 
+ 	if (!mem)
+ 		return IAVF_ERR_PARAM;
+ 
+-	snprintf(z_name, sizeof(z_name), "iavf_dma_%"PRIu64, rte_rand());
++	snprintf(z_name, sizeof(z_name), "iavf_dma_%" PRIu64,
++		__atomic_fetch_add(&iavf_dma_memzone_id, 1, __ATOMIC_RELAXED));
+ 	mz = rte_memzone_reserve_bounded(z_name, size, SOCKET_ID_ANY,
+ 			RTE_MEMZONE_IOVA_CONTIG, alignment, RTE_PGSIZE_2M);
+ 	if (!mz)
@@ -97 +90 @@
-index 878c5597d4..154fe96e93 100644
+index ba0c57e1a9..5970c918d1 100644
@@ -108,2 +101,2 @@
-@@ -260,13 +259,15 @@ static inline void *
- ice_alloc_dma_mem(__rte_unused struct ice_hw *hw,
+@@ -241,13 +240,15 @@ static inline void *
+ ice_alloc_dma_mem(__attribute__((unused)) struct ice_hw *hw,

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

* [dpdk-stable] patch 'net/hns3: increase VF reset retry maximum' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (27 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'drivers/net: fix memzone allocations for DMA memory' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/hns3: fix delay for waiting to stop Rx/Tx' " christian.ehrhardt
                   ` (71 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Hongbo Zheng; +Cc: Min Hu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/ba81e4b31721957e9140494f7ccc4149962de6d5

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From ba81e4b31721957e9140494f7ccc4149962de6d5 Mon Sep 17 00:00:00 2001
From: Hongbo Zheng <zhenghongbo3@huawei.com>
Date: Sun, 13 Jun 2021 10:31:51 +0800
Subject: [PATCH] net/hns3: increase VF reset retry maximum

[ upstream commit b25987fa7e25b3ba852f9433d22761c006884205 ]

When the device is very busy, VF reset may have to be
retried many times to succeed, leading to the current
max reset fail retry count not enough.

Modify max reset fail retry count to 30 to enhance
the reliability of reset function.

Fixes: 2790c6464725 ("net/hns3: support device reset")

Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 drivers/net/hns3/hns3_intr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/hns3/hns3_intr.c b/drivers/net/hns3/hns3_intr.c
index 3c754cccd2..44038788fc 100644
--- a/drivers/net/hns3/hns3_intr.c
+++ b/drivers/net/hns3/hns3_intr.c
@@ -855,7 +855,7 @@ hns3_clear_reset_level(struct hns3_hw *hw, uint64_t *levels)
 static bool
 hns3_reset_err_handle(struct hns3_adapter *hns)
 {
-#define MAX_RESET_FAIL_CNT 5
+#define MAX_RESET_FAIL_CNT 30
 
 	struct hns3_hw *hw = &hns->hw;
 
@@ -949,7 +949,7 @@ hns3_reset_pre(struct hns3_adapter *hns)
 static int
 hns3_reset_post(struct hns3_adapter *hns)
 {
-#define TIMEOUT_RETRIES_CNT	5
+#define TIMEOUT_RETRIES_CNT	30
 	struct hns3_hw *hw = &hns->hw;
 	struct timeval tv_delta;
 	struct timeval tv;
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:14.228618741 +0200
+++ 0030-net-hns3-increase-VF-reset-retry-maximum.patch	2021-08-10 15:11:12.954637638 +0200
@@ -1 +1 @@
-From b25987fa7e25b3ba852f9433d22761c006884205 Mon Sep 17 00:00:00 2001
+From ba81e4b31721957e9140494f7ccc4149962de6d5 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b25987fa7e25b3ba852f9433d22761c006884205 ]
+
@@ -14 +15,0 @@
-Cc: stable@dpdk.org
@@ -23 +24 @@
-index 6bdb17f622..0b307fdd1d 100644
+index 3c754cccd2..44038788fc 100644
@@ -26 +27 @@
-@@ -2582,7 +2582,7 @@ hns3_clear_reset_level(struct hns3_hw *hw, uint64_t *levels)
+@@ -855,7 +855,7 @@ hns3_clear_reset_level(struct hns3_hw *hw, uint64_t *levels)
@@ -35 +36 @@
-@@ -2676,7 +2676,7 @@ hns3_reset_pre(struct hns3_adapter *hns)
+@@ -949,7 +949,7 @@ hns3_reset_pre(struct hns3_adapter *hns)

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

* [dpdk-stable] patch 'net/hns3: fix delay for waiting to stop Rx/Tx' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (28 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/hns3: increase VF reset retry maximum' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-11  9:02   ` Christian Ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/hns3: fix VLAN strip log' " christian.ehrhardt
                   ` (70 subsequent siblings)
  100 siblings, 1 reply; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Huisong Li; +Cc: Min Hu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/249c35152a9bcd6d4c4b52776602750552dcf294

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 249c35152a9bcd6d4c4b52776602750552dcf294 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Sun, 13 Jun 2021 10:31:52 +0800
Subject: [PATCH] net/hns3: fix delay for waiting to stop Rx/Tx

[ upstream commit 4d8cce267840556cec8483c61f8cfbf25873496d ]

When the primary process executes dev_stop or is being reset, the packet
sending and receiving functions is changed. In this moment, the primary
process requests secondary processes to change their Rx/Tx functions, and
delays a period of time in case of crashes when queues are still in use.
The delay time depends on the number of queues actually used, instead of
the maximum number of queues supported by the device.

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

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 drivers/net/hns3/hns3_ethdev.c    | 1184 ++++++++++++++++++++++++++++-
 drivers/net/hns3/hns3_ethdev_vf.c |    4 +-
 2 files changed, 1184 insertions(+), 4 deletions(-)

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index ac82e0b5ef..e1bc55682c 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -4742,7 +4742,7 @@ hns3_dev_stop(struct rte_eth_dev *dev)
 	/* Disable datapath on secondary process. */
 	hns3_mp_req_stop_rxtx(dev);
 	/* Prevent crashes when queues are still in use. */
-	rte_delay_ms(hw->tqps_num);
+	rte_delay_ms(hw->cfg_max_queues);
 
 	rte_spinlock_lock(&hw->lock);
 	if (rte_atomic16_read(&hw->reset.resetting) == 0) {
@@ -5130,10 +5130,1190 @@ hns3_get_reset_level(struct hns3_adapter *hns, uint64_t *levels)
 		reset_level = HNS3_IMP_RESET;
 	else if (hns3_atomic_test_bit(HNS3_GLOBAL_RESET, levels))
 		reset_level = HNS3_GLOBAL_RESET;
+<<<<<<< HEAD
 	else if (hns3_atomic_test_bit(HNS3_FUNC_RESET, levels))
 		reset_level = HNS3_FUNC_RESET;
 	else if (hns3_atomic_test_bit(HNS3_FLR_RESET, levels))
 		reset_level = HNS3_FLR_RESET;
+||||||| constructed merge base
+	else if (hns3_atomic_test_bit(HNS3_FUNC_RESET, levels))
+		reset_level = HNS3_FUNC_RESET;
+	else if (hns3_atomic_test_bit(HNS3_FLR_RESET, levels))
+		reset_level = HNS3_FLR_RESET;
+
+	if (hw->reset.level != HNS3_NONE_RESET && reset_level < hw->reset.level)
+		return HNS3_NONE_RESET;
+
+	return reset_level;
+}
+
+static void
+hns3_record_imp_error(struct hns3_adapter *hns)
+{
+	struct hns3_hw *hw = &hns->hw;
+	uint32_t reg_val;
+
+	reg_val = hns3_read_dev(hw, HNS3_VECTOR0_OTER_EN_REG);
+	if (hns3_get_bit(reg_val, HNS3_VECTOR0_IMP_RD_POISON_B)) {
+		hns3_warn(hw, "Detected IMP RD poison!");
+		hns3_set_bit(reg_val, HNS3_VECTOR0_IMP_RD_POISON_B, 0);
+		hns3_write_dev(hw, HNS3_VECTOR0_OTER_EN_REG, reg_val);
+	}
+
+	if (hns3_get_bit(reg_val, HNS3_VECTOR0_IMP_CMDQ_ERR_B)) {
+		hns3_warn(hw, "Detected IMP CMDQ error!");
+		hns3_set_bit(reg_val, HNS3_VECTOR0_IMP_CMDQ_ERR_B, 0);
+		hns3_write_dev(hw, HNS3_VECTOR0_OTER_EN_REG, reg_val);
+	}
+}
+
+static int
+hns3_prepare_reset(struct hns3_adapter *hns)
+{
+	struct hns3_hw *hw = &hns->hw;
+	uint32_t reg_val;
+	int ret;
+
+	switch (hw->reset.level) {
+	case HNS3_FUNC_RESET:
+		ret = hns3_func_reset_cmd(hw, HNS3_PF_FUNC_ID);
+		if (ret)
+			return ret;
+
+		/*
+		 * After performaning pf reset, it is not necessary to do the
+		 * mailbox handling or send any command to firmware, because
+		 * any mailbox handling or command to firmware is only valid
+		 * after hns3_cmd_init is called.
+		 */
+		__atomic_store_n(&hw->reset.disable_cmd, 1, __ATOMIC_RELAXED);
+		hw->reset.stats.request_cnt++;
+		break;
+	case HNS3_IMP_RESET:
+		hns3_record_imp_error(hns);
+		reg_val = hns3_read_dev(hw, HNS3_VECTOR0_OTER_EN_REG);
+		hns3_write_dev(hw, HNS3_VECTOR0_OTER_EN_REG, reg_val |
+			       BIT(HNS3_VECTOR0_IMP_RESET_INT_B));
+		break;
+	default:
+		break;
+	}
+	return 0;
+}
+
+static int
+hns3_set_rst_done(struct hns3_hw *hw)
+{
+	struct hns3_pf_rst_done_cmd *req;
+	struct hns3_cmd_desc desc;
+
+	req = (struct hns3_pf_rst_done_cmd *)desc.data;
+	hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_PF_RST_DONE, false);
+	req->pf_rst_done |= HNS3_PF_RESET_DONE_BIT;
+	return hns3_cmd_send(hw, &desc, 1);
+}
+
+static int
+hns3_stop_service(struct hns3_adapter *hns)
+{
+	struct hns3_hw *hw = &hns->hw;
+	struct rte_eth_dev *eth_dev;
+
+	eth_dev = &rte_eth_devices[hw->data->port_id];
+	hw->mac.link_status = ETH_LINK_DOWN;
+	if (hw->adapter_state == HNS3_NIC_STARTED) {
+		rte_eal_alarm_cancel(hns3_service_handler, eth_dev);
+		hns3_update_linkstatus_and_event(hw, false);
+	}
+
+	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);
+
+	rte_spinlock_lock(&hw->lock);
+	if (hns->hw.adapter_state == HNS3_NIC_STARTED ||
+	    hw->adapter_state == HNS3_NIC_STOPPING) {
+		hns3_enable_all_queues(hw, false);
+		hns3_do_stop(hns);
+		hw->reset.mbuf_deferred_free = true;
+	} else
+		hw->reset.mbuf_deferred_free = false;
+
+	/*
+	 * It is cumbersome for hardware to pick-and-choose entries for deletion
+	 * from table space. Hence, for function reset software intervention is
+	 * required to delete the entries
+	 */
+	if (__atomic_load_n(&hw->reset.disable_cmd, __ATOMIC_RELAXED) == 0)
+		hns3_configure_all_mc_mac_addr(hns, true);
+	rte_spinlock_unlock(&hw->lock);
+
+	return 0;
+}
+
+static int
+hns3_start_service(struct hns3_adapter *hns)
+{
+	struct hns3_hw *hw = &hns->hw;
+	struct rte_eth_dev *eth_dev;
+
+	if (hw->reset.level == HNS3_IMP_RESET ||
+	    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);
+	if (hw->adapter_state == HNS3_NIC_STARTED) {
+		/*
+		 * This API parent function already hold the hns3_hw.lock, the
+		 * hns3_service_handler may report lse, in bonding application
+		 * it will call driver's ops which may acquire the hns3_hw.lock
+		 * again, thus lead to deadlock.
+		 * We defer calls hns3_service_handler to avoid the deadlock.
+		 */
+		rte_eal_alarm_set(HNS3_SERVICE_QUICK_INTERVAL,
+				  hns3_service_handler, eth_dev);
+
+		/* Enable interrupt of all rx queues before enabling queues */
+		hns3_dev_all_rx_queue_intr_enable(hw, true);
+		/*
+		 * Enable state of each rxq and txq will be recovered after
+		 * reset, so we need to restore them before enable all tqps;
+		 */
+		hns3_restore_tqp_enable_state(hw);
+		/*
+		 * When finished the initialization, enable queues to receive
+		 * and transmit packets.
+		 */
+		hns3_enable_all_queues(hw, true);
+	}
+
+	return 0;
+}
+
+static int
+hns3_restore_conf(struct hns3_adapter *hns)
+{
+	struct hns3_hw *hw = &hns->hw;
+	int ret;
+
+	ret = hns3_configure_all_mac_addr(hns, false);
+	if (ret)
+		return ret;
+
+	ret = hns3_configure_all_mc_mac_addr(hns, false);
+	if (ret)
+		goto err_mc_mac;
+
+	ret = hns3_dev_promisc_restore(hns);
+	if (ret)
+		goto err_promisc;
+
+	ret = hns3_restore_vlan_table(hns);
+	if (ret)
+		goto err_promisc;
+
+	ret = hns3_restore_vlan_conf(hns);
+	if (ret)
+		goto err_promisc;
+
+	ret = hns3_restore_all_fdir_filter(hns);
+	if (ret)
+		goto err_promisc;
+
+	ret = hns3_restore_ptp(hns);
+	if (ret)
+		goto err_promisc;
+
+	ret = hns3_restore_rx_interrupt(hw);
+	if (ret)
+		goto err_promisc;
+
+	ret = hns3_restore_gro_conf(hw);
+	if (ret)
+		goto err_promisc;
+
+	ret = hns3_restore_fec(hw);
+	if (ret)
+		goto err_promisc;
+
+	if (hns->hw.adapter_state == HNS3_NIC_STARTED) {
+		ret = hns3_do_start(hns, false);
+		if (ret)
+			goto err_promisc;
+		hns3_info(hw, "hns3 dev restart successful!");
+	} else if (hw->adapter_state == HNS3_NIC_STOPPING)
+		hw->adapter_state = HNS3_NIC_CONFIGURED;
+	return 0;
+
+err_promisc:
+	hns3_configure_all_mc_mac_addr(hns, true);
+err_mc_mac:
+	hns3_configure_all_mac_addr(hns, true);
+	return ret;
+}
+
+static void
+hns3_reset_service(void *param)
+{
+	struct hns3_adapter *hns = (struct hns3_adapter *)param;
+	struct hns3_hw *hw = &hns->hw;
+	enum hns3_reset_level reset_level;
+	struct timeval tv_delta;
+	struct timeval tv_start;
+	struct timeval tv;
+	uint64_t msec;
+	int ret;
+
+	/*
+	 * The interrupt is not triggered within the delay time.
+	 * The interrupt may have been lost. It is necessary to handle
+	 * the interrupt to recover from the error.
+	 */
+	if (__atomic_load_n(&hw->reset.schedule, __ATOMIC_RELAXED) ==
+			    SCHEDULE_DEFERRED) {
+		__atomic_store_n(&hw->reset.schedule, SCHEDULE_REQUESTED,
+				  __ATOMIC_RELAXED);
+		hns3_err(hw, "Handling interrupts in delayed tasks");
+		hns3_interrupt_handler(&rte_eth_devices[hw->data->port_id]);
+		reset_level = hns3_get_reset_level(hns, &hw->reset.pending);
+		if (reset_level == HNS3_NONE_RESET) {
+			hns3_err(hw, "No reset level is set, try IMP reset");
+			hns3_atomic_set_bit(HNS3_IMP_RESET, &hw->reset.pending);
+		}
+	}
+	__atomic_store_n(&hw->reset.schedule, SCHEDULE_NONE, __ATOMIC_RELAXED);
+
+	/*
+	 * Check if there is any ongoing reset in the hardware. This status can
+	 * be checked from reset_pending. If there is then, we need to wait for
+	 * hardware to complete reset.
+	 *    a. If we are able to figure out in reasonable time that hardware
+	 *       has fully resetted then, we can proceed with driver, client
+	 *       reset.
+	 *    b. else, we can come back later to check this status so re-sched
+	 *       now.
+	 */
+	reset_level = hns3_get_reset_level(hns, &hw->reset.pending);
+	if (reset_level != HNS3_NONE_RESET) {
+		hns3_clock_gettime(&tv_start);
+		ret = hns3_reset_process(hns, reset_level);
+		hns3_clock_gettime(&tv);
+		timersub(&tv, &tv_start, &tv_delta);
+		msec = hns3_clock_calctime_ms(&tv_delta);
+		if (msec > HNS3_RESET_PROCESS_MS)
+			hns3_err(hw, "%d handle long time delta %" PRIu64
+				     " ms time=%ld.%.6ld",
+				 hw->reset.level, msec,
+				 tv.tv_sec, tv.tv_usec);
+		if (ret == -EAGAIN)
+			return;
+	}
+
+	/* Check if we got any *new* reset requests to be honored */
+	reset_level = hns3_get_reset_level(hns, &hw->reset.request);
+	if (reset_level != HNS3_NONE_RESET)
+		hns3_msix_process(hns, reset_level);
+}
+
+static unsigned int
+hns3_get_speed_capa_num(uint16_t device_id)
+{
+	unsigned int num;
+
+	switch (device_id) {
+	case HNS3_DEV_ID_25GE:
+	case HNS3_DEV_ID_25GE_RDMA:
+		num = 2;
+		break;
+	case HNS3_DEV_ID_100G_RDMA_MACSEC:
+	case HNS3_DEV_ID_200G_RDMA:
+		num = 1;
+		break;
+	default:
+		num = 0;
+		break;
+	}
+
+	return num;
+}
+
+static int
+hns3_get_speed_fec_capa(struct rte_eth_fec_capa *speed_fec_capa,
+			uint16_t device_id)
+{
+	switch (device_id) {
+	case HNS3_DEV_ID_25GE:
+	/* fallthrough */
+	case HNS3_DEV_ID_25GE_RDMA:
+		speed_fec_capa[0].speed = speed_fec_capa_tbl[1].speed;
+		speed_fec_capa[0].capa = speed_fec_capa_tbl[1].capa;
+
+		/* In HNS3 device, the 25G NIC is compatible with 10G rate */
+		speed_fec_capa[1].speed = speed_fec_capa_tbl[0].speed;
+		speed_fec_capa[1].capa = speed_fec_capa_tbl[0].capa;
+		break;
+	case HNS3_DEV_ID_100G_RDMA_MACSEC:
+		speed_fec_capa[0].speed = speed_fec_capa_tbl[4].speed;
+		speed_fec_capa[0].capa = speed_fec_capa_tbl[4].capa;
+		break;
+	case HNS3_DEV_ID_200G_RDMA:
+		speed_fec_capa[0].speed = speed_fec_capa_tbl[5].speed;
+		speed_fec_capa[0].capa = speed_fec_capa_tbl[5].capa;
+		break;
+	default:
+		return -ENOTSUP;
+	}
+
+	return 0;
+}
+
+static int
+hns3_fec_get_capability(struct rte_eth_dev *dev,
+			struct rte_eth_fec_capa *speed_fec_capa,
+			unsigned int num)
+{
+	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
+	uint16_t device_id = pci_dev->id.device_id;
+	unsigned int capa_num;
+	int ret;
+
+	capa_num = hns3_get_speed_capa_num(device_id);
+	if (capa_num == 0) {
+		hns3_err(hw, "device(0x%x) is not supported by hns3 PMD",
+			 device_id);
+		return -ENOTSUP;
+	}
+
+	if (speed_fec_capa == NULL || num < capa_num)
+		return capa_num;
+
+	ret = hns3_get_speed_fec_capa(speed_fec_capa, device_id);
+	if (ret)
+		return -ENOTSUP;
+
+	return capa_num;
+}
+
+static int
+get_current_fec_auto_state(struct hns3_hw *hw, uint8_t *state)
+{
+	struct hns3_config_fec_cmd *req;
+	struct hns3_cmd_desc desc;
+	int ret;
+
+	/*
+	 * CMD(HNS3_OPC_CONFIG_FEC_MODE) read is not supported
+	 * in device of link speed
+	 * below 10 Gbps.
+	 */
+	if (hw->mac.link_speed < ETH_SPEED_NUM_10G) {
+		*state = 0;
+		return 0;
+	}
+
+	hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_CONFIG_FEC_MODE, true);
+	req = (struct hns3_config_fec_cmd *)desc.data;
+	ret = hns3_cmd_send(hw, &desc, 1);
+	if (ret) {
+		hns3_err(hw, "get current fec auto state failed, ret = %d",
+			 ret);
+		return ret;
+	}
+
+	*state = req->fec_mode & (1U << HNS3_MAC_CFG_FEC_AUTO_EN_B);
+	return 0;
+}
+
+static int
+hns3_fec_get_internal(struct hns3_hw *hw, uint32_t *fec_capa)
+{
+	struct hns3_sfp_info_cmd *resp;
+	uint32_t tmp_fec_capa;
+	uint8_t auto_state;
+	struct hns3_cmd_desc desc;
+	int ret;
+
+	/*
+	 * If link is down and AUTO is enabled, AUTO is returned, otherwise,
+	 * configured FEC mode is returned.
+	 * If link is up, current FEC mode is returned.
+	 */
+	if (hw->mac.link_status == ETH_LINK_DOWN) {
+		ret = get_current_fec_auto_state(hw, &auto_state);
+		if (ret)
+			return ret;
+
+		if (auto_state == 0x1) {
+			*fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(AUTO);
+			return 0;
+		}
+	}
+
+	hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_GET_SFP_INFO, true);
+	resp = (struct hns3_sfp_info_cmd *)desc.data;
+	resp->query_type = HNS3_ACTIVE_QUERY;
+
+	ret = hns3_cmd_send(hw, &desc, 1);
+	if (ret == -EOPNOTSUPP) {
+		hns3_err(hw, "IMP do not support get FEC, ret = %d", ret);
+		return ret;
+	} else if (ret) {
+		hns3_err(hw, "get FEC failed, ret = %d", ret);
+		return ret;
+	}
+
+	/*
+	 * FEC mode order defined in hns3 hardware is inconsistend with
+	 * that defined in the ethdev library. So the sequence needs
+	 * to be converted.
+	 */
+	switch (resp->active_fec) {
+	case HNS3_HW_FEC_MODE_NOFEC:
+		tmp_fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(NOFEC);
+		break;
+	case HNS3_HW_FEC_MODE_BASER:
+		tmp_fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(BASER);
+		break;
+	case HNS3_HW_FEC_MODE_RS:
+		tmp_fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(RS);
+		break;
+	default:
+		tmp_fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(NOFEC);
+		break;
+	}
+
+	*fec_capa = tmp_fec_capa;
+	return 0;
+}
+
+static int
+hns3_fec_get(struct rte_eth_dev *dev, uint32_t *fec_capa)
+{
+	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+
+	return hns3_fec_get_internal(hw, fec_capa);
+}
+
+static int
+hns3_set_fec_hw(struct hns3_hw *hw, uint32_t mode)
+{
+	struct hns3_config_fec_cmd *req;
+	struct hns3_cmd_desc desc;
+	int ret;
+
+	hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_CONFIG_FEC_MODE, false);
+
+	req = (struct hns3_config_fec_cmd *)desc.data;
+	switch (mode) {
+	case RTE_ETH_FEC_MODE_CAPA_MASK(NOFEC):
+		hns3_set_field(req->fec_mode, HNS3_MAC_CFG_FEC_MODE_M,
+				HNS3_MAC_CFG_FEC_MODE_S, HNS3_MAC_FEC_OFF);
+		break;
+	case RTE_ETH_FEC_MODE_CAPA_MASK(BASER):
+		hns3_set_field(req->fec_mode, HNS3_MAC_CFG_FEC_MODE_M,
+				HNS3_MAC_CFG_FEC_MODE_S, HNS3_MAC_FEC_BASER);
+		break;
+	case RTE_ETH_FEC_MODE_CAPA_MASK(RS):
+		hns3_set_field(req->fec_mode, HNS3_MAC_CFG_FEC_MODE_M,
+				HNS3_MAC_CFG_FEC_MODE_S, HNS3_MAC_FEC_RS);
+		break;
+	case RTE_ETH_FEC_MODE_CAPA_MASK(AUTO):
+		hns3_set_bit(req->fec_mode, HNS3_MAC_CFG_FEC_AUTO_EN_B, 1);
+		break;
+	default:
+		return 0;
+	}
+	ret = hns3_cmd_send(hw, &desc, 1);
+	if (ret)
+		hns3_err(hw, "set fec mode failed, ret = %d", ret);
+
+	return ret;
+}
+
+static uint32_t
+get_current_speed_fec_cap(struct hns3_hw *hw, struct rte_eth_fec_capa *fec_capa)
+{
+	struct hns3_mac *mac = &hw->mac;
+	uint32_t cur_capa;
+
+	switch (mac->link_speed) {
+	case ETH_SPEED_NUM_10G:
+		cur_capa = fec_capa[1].capa;
+		break;
+	case ETH_SPEED_NUM_25G:
+	case ETH_SPEED_NUM_100G:
+	case ETH_SPEED_NUM_200G:
+		cur_capa = fec_capa[0].capa;
+		break;
+	default:
+		cur_capa = 0;
+		break;
+	}
+
+	return cur_capa;
+}
+
+static bool
+is_fec_mode_one_bit_set(uint32_t mode)
+{
+	int cnt = 0;
+	uint8_t i;
+
+	for (i = 0; i < sizeof(mode); i++)
+		if (mode >> i & 0x1)
+			cnt++;
+
+	return cnt == 1 ? true : false;
+}
+
+static int
+hns3_fec_set(struct rte_eth_dev *dev, uint32_t mode)
+{
+#define FEC_CAPA_NUM 2
+	struct hns3_adapter *hns = dev->data->dev_private;
+	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(hns);
+	struct hns3_pf *pf = &hns->pf;
+
+	struct rte_eth_fec_capa fec_capa[FEC_CAPA_NUM];
+	uint32_t cur_capa;
+	uint32_t num = FEC_CAPA_NUM;
+	int ret;
+
+	ret = hns3_fec_get_capability(dev, fec_capa, num);
+	if (ret < 0)
+		return ret;
+
+	/* HNS3 PMD driver only support one bit set mode, e.g. 0x1, 0x4 */
+	if (!is_fec_mode_one_bit_set(mode)) {
+		hns3_err(hw, "FEC mode(0x%x) not supported in HNS3 PMD, "
+			     "FEC mode should be only one bit set", mode);
+		return -EINVAL;
+	}
+
+	/*
+	 * Check whether the configured mode is within the FEC capability.
+	 * If not, the configured mode will not be supported.
+	 */
+	cur_capa = get_current_speed_fec_cap(hw, fec_capa);
+	if (!(cur_capa & mode)) {
+		hns3_err(hw, "unsupported FEC mode = 0x%x", mode);
+		return -EINVAL;
+	}
+
+	rte_spinlock_lock(&hw->lock);
+	ret = hns3_set_fec_hw(hw, mode);
+	if (ret) {
+		rte_spinlock_unlock(&hw->lock);
+		return ret;
+	}
+
+	pf->fec_mode = mode;
+	rte_spinlock_unlock(&hw->lock);
+
+	return 0;
+}
+
+static int
+hns3_restore_fec(struct hns3_hw *hw)
+{
+	struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
+	struct hns3_pf *pf = &hns->pf;
+	uint32_t mode = pf->fec_mode;
+	int ret;
+=======
+	else if (hns3_atomic_test_bit(HNS3_FUNC_RESET, levels))
+		reset_level = HNS3_FUNC_RESET;
+	else if (hns3_atomic_test_bit(HNS3_FLR_RESET, levels))
+		reset_level = HNS3_FLR_RESET;
+
+	if (hw->reset.level != HNS3_NONE_RESET && reset_level < hw->reset.level)
+		return HNS3_NONE_RESET;
+
+	return reset_level;
+}
+
+static void
+hns3_record_imp_error(struct hns3_adapter *hns)
+{
+	struct hns3_hw *hw = &hns->hw;
+	uint32_t reg_val;
+
+	reg_val = hns3_read_dev(hw, HNS3_VECTOR0_OTER_EN_REG);
+	if (hns3_get_bit(reg_val, HNS3_VECTOR0_IMP_RD_POISON_B)) {
+		hns3_warn(hw, "Detected IMP RD poison!");
+		hns3_set_bit(reg_val, HNS3_VECTOR0_IMP_RD_POISON_B, 0);
+		hns3_write_dev(hw, HNS3_VECTOR0_OTER_EN_REG, reg_val);
+	}
+
+	if (hns3_get_bit(reg_val, HNS3_VECTOR0_IMP_CMDQ_ERR_B)) {
+		hns3_warn(hw, "Detected IMP CMDQ error!");
+		hns3_set_bit(reg_val, HNS3_VECTOR0_IMP_CMDQ_ERR_B, 0);
+		hns3_write_dev(hw, HNS3_VECTOR0_OTER_EN_REG, reg_val);
+	}
+}
+
+static int
+hns3_prepare_reset(struct hns3_adapter *hns)
+{
+	struct hns3_hw *hw = &hns->hw;
+	uint32_t reg_val;
+	int ret;
+
+	switch (hw->reset.level) {
+	case HNS3_FUNC_RESET:
+		ret = hns3_func_reset_cmd(hw, HNS3_PF_FUNC_ID);
+		if (ret)
+			return ret;
+
+		/*
+		 * After performaning pf reset, it is not necessary to do the
+		 * mailbox handling or send any command to firmware, because
+		 * any mailbox handling or command to firmware is only valid
+		 * after hns3_cmd_init is called.
+		 */
+		__atomic_store_n(&hw->reset.disable_cmd, 1, __ATOMIC_RELAXED);
+		hw->reset.stats.request_cnt++;
+		break;
+	case HNS3_IMP_RESET:
+		hns3_record_imp_error(hns);
+		reg_val = hns3_read_dev(hw, HNS3_VECTOR0_OTER_EN_REG);
+		hns3_write_dev(hw, HNS3_VECTOR0_OTER_EN_REG, reg_val |
+			       BIT(HNS3_VECTOR0_IMP_RESET_INT_B));
+		break;
+	default:
+		break;
+	}
+	return 0;
+}
+
+static int
+hns3_set_rst_done(struct hns3_hw *hw)
+{
+	struct hns3_pf_rst_done_cmd *req;
+	struct hns3_cmd_desc desc;
+
+	req = (struct hns3_pf_rst_done_cmd *)desc.data;
+	hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_PF_RST_DONE, false);
+	req->pf_rst_done |= HNS3_PF_RESET_DONE_BIT;
+	return hns3_cmd_send(hw, &desc, 1);
+}
+
+static int
+hns3_stop_service(struct hns3_adapter *hns)
+{
+	struct hns3_hw *hw = &hns->hw;
+	struct rte_eth_dev *eth_dev;
+
+	eth_dev = &rte_eth_devices[hw->data->port_id];
+	hw->mac.link_status = ETH_LINK_DOWN;
+	if (hw->adapter_state == HNS3_NIC_STARTED) {
+		rte_eal_alarm_cancel(hns3_service_handler, eth_dev);
+		hns3_update_linkstatus_and_event(hw, false);
+	}
+
+	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);
+
+	rte_spinlock_lock(&hw->lock);
+	if (hns->hw.adapter_state == HNS3_NIC_STARTED ||
+	    hw->adapter_state == HNS3_NIC_STOPPING) {
+		hns3_enable_all_queues(hw, false);
+		hns3_do_stop(hns);
+		hw->reset.mbuf_deferred_free = true;
+	} else
+		hw->reset.mbuf_deferred_free = false;
+
+	/*
+	 * It is cumbersome for hardware to pick-and-choose entries for deletion
+	 * from table space. Hence, for function reset software intervention is
+	 * required to delete the entries
+	 */
+	if (__atomic_load_n(&hw->reset.disable_cmd, __ATOMIC_RELAXED) == 0)
+		hns3_configure_all_mc_mac_addr(hns, true);
+	rte_spinlock_unlock(&hw->lock);
+
+	return 0;
+}
+
+static int
+hns3_start_service(struct hns3_adapter *hns)
+{
+	struct hns3_hw *hw = &hns->hw;
+	struct rte_eth_dev *eth_dev;
+
+	if (hw->reset.level == HNS3_IMP_RESET ||
+	    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);
+	if (hw->adapter_state == HNS3_NIC_STARTED) {
+		/*
+		 * This API parent function already hold the hns3_hw.lock, the
+		 * hns3_service_handler may report lse, in bonding application
+		 * it will call driver's ops which may acquire the hns3_hw.lock
+		 * again, thus lead to deadlock.
+		 * We defer calls hns3_service_handler to avoid the deadlock.
+		 */
+		rte_eal_alarm_set(HNS3_SERVICE_QUICK_INTERVAL,
+				  hns3_service_handler, eth_dev);
+
+		/* Enable interrupt of all rx queues before enabling queues */
+		hns3_dev_all_rx_queue_intr_enable(hw, true);
+		/*
+		 * Enable state of each rxq and txq will be recovered after
+		 * reset, so we need to restore them before enable all tqps;
+		 */
+		hns3_restore_tqp_enable_state(hw);
+		/*
+		 * When finished the initialization, enable queues to receive
+		 * and transmit packets.
+		 */
+		hns3_enable_all_queues(hw, true);
+	}
+
+	return 0;
+}
+
+static int
+hns3_restore_conf(struct hns3_adapter *hns)
+{
+	struct hns3_hw *hw = &hns->hw;
+	int ret;
+
+	ret = hns3_configure_all_mac_addr(hns, false);
+	if (ret)
+		return ret;
+
+	ret = hns3_configure_all_mc_mac_addr(hns, false);
+	if (ret)
+		goto err_mc_mac;
+
+	ret = hns3_dev_promisc_restore(hns);
+	if (ret)
+		goto err_promisc;
+
+	ret = hns3_restore_vlan_table(hns);
+	if (ret)
+		goto err_promisc;
+
+	ret = hns3_restore_vlan_conf(hns);
+	if (ret)
+		goto err_promisc;
+
+	ret = hns3_restore_all_fdir_filter(hns);
+	if (ret)
+		goto err_promisc;
+
+	ret = hns3_restore_ptp(hns);
+	if (ret)
+		goto err_promisc;
+
+	ret = hns3_restore_rx_interrupt(hw);
+	if (ret)
+		goto err_promisc;
+
+	ret = hns3_restore_gro_conf(hw);
+	if (ret)
+		goto err_promisc;
+
+	ret = hns3_restore_fec(hw);
+	if (ret)
+		goto err_promisc;
+
+	if (hns->hw.adapter_state == HNS3_NIC_STARTED) {
+		ret = hns3_do_start(hns, false);
+		if (ret)
+			goto err_promisc;
+		hns3_info(hw, "hns3 dev restart successful!");
+	} else if (hw->adapter_state == HNS3_NIC_STOPPING)
+		hw->adapter_state = HNS3_NIC_CONFIGURED;
+	return 0;
+
+err_promisc:
+	hns3_configure_all_mc_mac_addr(hns, true);
+err_mc_mac:
+	hns3_configure_all_mac_addr(hns, true);
+	return ret;
+}
+
+static void
+hns3_reset_service(void *param)
+{
+	struct hns3_adapter *hns = (struct hns3_adapter *)param;
+	struct hns3_hw *hw = &hns->hw;
+	enum hns3_reset_level reset_level;
+	struct timeval tv_delta;
+	struct timeval tv_start;
+	struct timeval tv;
+	uint64_t msec;
+	int ret;
+
+	/*
+	 * The interrupt is not triggered within the delay time.
+	 * The interrupt may have been lost. It is necessary to handle
+	 * the interrupt to recover from the error.
+	 */
+	if (__atomic_load_n(&hw->reset.schedule, __ATOMIC_RELAXED) ==
+			    SCHEDULE_DEFERRED) {
+		__atomic_store_n(&hw->reset.schedule, SCHEDULE_REQUESTED,
+				  __ATOMIC_RELAXED);
+		hns3_err(hw, "Handling interrupts in delayed tasks");
+		hns3_interrupt_handler(&rte_eth_devices[hw->data->port_id]);
+		reset_level = hns3_get_reset_level(hns, &hw->reset.pending);
+		if (reset_level == HNS3_NONE_RESET) {
+			hns3_err(hw, "No reset level is set, try IMP reset");
+			hns3_atomic_set_bit(HNS3_IMP_RESET, &hw->reset.pending);
+		}
+	}
+	__atomic_store_n(&hw->reset.schedule, SCHEDULE_NONE, __ATOMIC_RELAXED);
+
+	/*
+	 * Check if there is any ongoing reset in the hardware. This status can
+	 * be checked from reset_pending. If there is then, we need to wait for
+	 * hardware to complete reset.
+	 *    a. If we are able to figure out in reasonable time that hardware
+	 *       has fully resetted then, we can proceed with driver, client
+	 *       reset.
+	 *    b. else, we can come back later to check this status so re-sched
+	 *       now.
+	 */
+	reset_level = hns3_get_reset_level(hns, &hw->reset.pending);
+	if (reset_level != HNS3_NONE_RESET) {
+		hns3_clock_gettime(&tv_start);
+		ret = hns3_reset_process(hns, reset_level);
+		hns3_clock_gettime(&tv);
+		timersub(&tv, &tv_start, &tv_delta);
+		msec = hns3_clock_calctime_ms(&tv_delta);
+		if (msec > HNS3_RESET_PROCESS_MS)
+			hns3_err(hw, "%d handle long time delta %" PRIu64
+				     " ms time=%ld.%.6ld",
+				 hw->reset.level, msec,
+				 tv.tv_sec, tv.tv_usec);
+		if (ret == -EAGAIN)
+			return;
+	}
+
+	/* Check if we got any *new* reset requests to be honored */
+	reset_level = hns3_get_reset_level(hns, &hw->reset.request);
+	if (reset_level != HNS3_NONE_RESET)
+		hns3_msix_process(hns, reset_level);
+}
+
+static unsigned int
+hns3_get_speed_capa_num(uint16_t device_id)
+{
+	unsigned int num;
+
+	switch (device_id) {
+	case HNS3_DEV_ID_25GE:
+	case HNS3_DEV_ID_25GE_RDMA:
+		num = 2;
+		break;
+	case HNS3_DEV_ID_100G_RDMA_MACSEC:
+	case HNS3_DEV_ID_200G_RDMA:
+		num = 1;
+		break;
+	default:
+		num = 0;
+		break;
+	}
+
+	return num;
+}
+
+static int
+hns3_get_speed_fec_capa(struct rte_eth_fec_capa *speed_fec_capa,
+			uint16_t device_id)
+{
+	switch (device_id) {
+	case HNS3_DEV_ID_25GE:
+	/* fallthrough */
+	case HNS3_DEV_ID_25GE_RDMA:
+		speed_fec_capa[0].speed = speed_fec_capa_tbl[1].speed;
+		speed_fec_capa[0].capa = speed_fec_capa_tbl[1].capa;
+
+		/* In HNS3 device, the 25G NIC is compatible with 10G rate */
+		speed_fec_capa[1].speed = speed_fec_capa_tbl[0].speed;
+		speed_fec_capa[1].capa = speed_fec_capa_tbl[0].capa;
+		break;
+	case HNS3_DEV_ID_100G_RDMA_MACSEC:
+		speed_fec_capa[0].speed = speed_fec_capa_tbl[4].speed;
+		speed_fec_capa[0].capa = speed_fec_capa_tbl[4].capa;
+		break;
+	case HNS3_DEV_ID_200G_RDMA:
+		speed_fec_capa[0].speed = speed_fec_capa_tbl[5].speed;
+		speed_fec_capa[0].capa = speed_fec_capa_tbl[5].capa;
+		break;
+	default:
+		return -ENOTSUP;
+	}
+
+	return 0;
+}
+
+static int
+hns3_fec_get_capability(struct rte_eth_dev *dev,
+			struct rte_eth_fec_capa *speed_fec_capa,
+			unsigned int num)
+{
+	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
+	uint16_t device_id = pci_dev->id.device_id;
+	unsigned int capa_num;
+	int ret;
+
+	capa_num = hns3_get_speed_capa_num(device_id);
+	if (capa_num == 0) {
+		hns3_err(hw, "device(0x%x) is not supported by hns3 PMD",
+			 device_id);
+		return -ENOTSUP;
+	}
+
+	if (speed_fec_capa == NULL || num < capa_num)
+		return capa_num;
+
+	ret = hns3_get_speed_fec_capa(speed_fec_capa, device_id);
+	if (ret)
+		return -ENOTSUP;
+
+	return capa_num;
+}
+
+static int
+get_current_fec_auto_state(struct hns3_hw *hw, uint8_t *state)
+{
+	struct hns3_config_fec_cmd *req;
+	struct hns3_cmd_desc desc;
+	int ret;
+
+	/*
+	 * CMD(HNS3_OPC_CONFIG_FEC_MODE) read is not supported
+	 * in device of link speed
+	 * below 10 Gbps.
+	 */
+	if (hw->mac.link_speed < ETH_SPEED_NUM_10G) {
+		*state = 0;
+		return 0;
+	}
+
+	hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_CONFIG_FEC_MODE, true);
+	req = (struct hns3_config_fec_cmd *)desc.data;
+	ret = hns3_cmd_send(hw, &desc, 1);
+	if (ret) {
+		hns3_err(hw, "get current fec auto state failed, ret = %d",
+			 ret);
+		return ret;
+	}
+
+	*state = req->fec_mode & (1U << HNS3_MAC_CFG_FEC_AUTO_EN_B);
+	return 0;
+}
+
+static int
+hns3_fec_get_internal(struct hns3_hw *hw, uint32_t *fec_capa)
+{
+	struct hns3_sfp_info_cmd *resp;
+	uint32_t tmp_fec_capa;
+	uint8_t auto_state;
+	struct hns3_cmd_desc desc;
+	int ret;
+
+	/*
+	 * If link is down and AUTO is enabled, AUTO is returned, otherwise,
+	 * configured FEC mode is returned.
+	 * If link is up, current FEC mode is returned.
+	 */
+	if (hw->mac.link_status == ETH_LINK_DOWN) {
+		ret = get_current_fec_auto_state(hw, &auto_state);
+		if (ret)
+			return ret;
+
+		if (auto_state == 0x1) {
+			*fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(AUTO);
+			return 0;
+		}
+	}
+
+	hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_GET_SFP_INFO, true);
+	resp = (struct hns3_sfp_info_cmd *)desc.data;
+	resp->query_type = HNS3_ACTIVE_QUERY;
+
+	ret = hns3_cmd_send(hw, &desc, 1);
+	if (ret == -EOPNOTSUPP) {
+		hns3_err(hw, "IMP do not support get FEC, ret = %d", ret);
+		return ret;
+	} else if (ret) {
+		hns3_err(hw, "get FEC failed, ret = %d", ret);
+		return ret;
+	}
+
+	/*
+	 * FEC mode order defined in hns3 hardware is inconsistend with
+	 * that defined in the ethdev library. So the sequence needs
+	 * to be converted.
+	 */
+	switch (resp->active_fec) {
+	case HNS3_HW_FEC_MODE_NOFEC:
+		tmp_fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(NOFEC);
+		break;
+	case HNS3_HW_FEC_MODE_BASER:
+		tmp_fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(BASER);
+		break;
+	case HNS3_HW_FEC_MODE_RS:
+		tmp_fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(RS);
+		break;
+	default:
+		tmp_fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(NOFEC);
+		break;
+	}
+
+	*fec_capa = tmp_fec_capa;
+	return 0;
+}
+
+static int
+hns3_fec_get(struct rte_eth_dev *dev, uint32_t *fec_capa)
+{
+	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+
+	return hns3_fec_get_internal(hw, fec_capa);
+}
+
+static int
+hns3_set_fec_hw(struct hns3_hw *hw, uint32_t mode)
+{
+	struct hns3_config_fec_cmd *req;
+	struct hns3_cmd_desc desc;
+	int ret;
+
+	hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_CONFIG_FEC_MODE, false);
+
+	req = (struct hns3_config_fec_cmd *)desc.data;
+	switch (mode) {
+	case RTE_ETH_FEC_MODE_CAPA_MASK(NOFEC):
+		hns3_set_field(req->fec_mode, HNS3_MAC_CFG_FEC_MODE_M,
+				HNS3_MAC_CFG_FEC_MODE_S, HNS3_MAC_FEC_OFF);
+		break;
+	case RTE_ETH_FEC_MODE_CAPA_MASK(BASER):
+		hns3_set_field(req->fec_mode, HNS3_MAC_CFG_FEC_MODE_M,
+				HNS3_MAC_CFG_FEC_MODE_S, HNS3_MAC_FEC_BASER);
+		break;
+	case RTE_ETH_FEC_MODE_CAPA_MASK(RS):
+		hns3_set_field(req->fec_mode, HNS3_MAC_CFG_FEC_MODE_M,
+				HNS3_MAC_CFG_FEC_MODE_S, HNS3_MAC_FEC_RS);
+		break;
+	case RTE_ETH_FEC_MODE_CAPA_MASK(AUTO):
+		hns3_set_bit(req->fec_mode, HNS3_MAC_CFG_FEC_AUTO_EN_B, 1);
+		break;
+	default:
+		return 0;
+	}
+	ret = hns3_cmd_send(hw, &desc, 1);
+	if (ret)
+		hns3_err(hw, "set fec mode failed, ret = %d", ret);
+
+	return ret;
+}
+
+static uint32_t
+get_current_speed_fec_cap(struct hns3_hw *hw, struct rte_eth_fec_capa *fec_capa)
+{
+	struct hns3_mac *mac = &hw->mac;
+	uint32_t cur_capa;
+
+	switch (mac->link_speed) {
+	case ETH_SPEED_NUM_10G:
+		cur_capa = fec_capa[1].capa;
+		break;
+	case ETH_SPEED_NUM_25G:
+	case ETH_SPEED_NUM_100G:
+	case ETH_SPEED_NUM_200G:
+		cur_capa = fec_capa[0].capa;
+		break;
+	default:
+		cur_capa = 0;
+		break;
+	}
+
+	return cur_capa;
+}
+
+static bool
+is_fec_mode_one_bit_set(uint32_t mode)
+{
+	int cnt = 0;
+	uint8_t i;
+
+	for (i = 0; i < sizeof(mode); i++)
+		if (mode >> i & 0x1)
+			cnt++;
+
+	return cnt == 1 ? true : false;
+}
+
+static int
+hns3_fec_set(struct rte_eth_dev *dev, uint32_t mode)
+{
+#define FEC_CAPA_NUM 2
+	struct hns3_adapter *hns = dev->data->dev_private;
+	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(hns);
+	struct hns3_pf *pf = &hns->pf;
+
+	struct rte_eth_fec_capa fec_capa[FEC_CAPA_NUM];
+	uint32_t cur_capa;
+	uint32_t num = FEC_CAPA_NUM;
+	int ret;
+
+	ret = hns3_fec_get_capability(dev, fec_capa, num);
+	if (ret < 0)
+		return ret;
+
+	/* HNS3 PMD driver only support one bit set mode, e.g. 0x1, 0x4 */
+	if (!is_fec_mode_one_bit_set(mode)) {
+		hns3_err(hw, "FEC mode(0x%x) not supported in HNS3 PMD, "
+			     "FEC mode should be only one bit set", mode);
+		return -EINVAL;
+	}
+
+	/*
+	 * Check whether the configured mode is within the FEC capability.
+	 * If not, the configured mode will not be supported.
+	 */
+	cur_capa = get_current_speed_fec_cap(hw, fec_capa);
+	if (!(cur_capa & mode)) {
+		hns3_err(hw, "unsupported FEC mode = 0x%x", mode);
+		return -EINVAL;
+	}
+
+	rte_spinlock_lock(&hw->lock);
+	ret = hns3_set_fec_hw(hw, mode);
+	if (ret) {
+		rte_spinlock_unlock(&hw->lock);
+		return ret;
+	}
+
+	pf->fec_mode = mode;
+	rte_spinlock_unlock(&hw->lock);
+
+	return 0;
+}
+
+static int
+hns3_restore_fec(struct hns3_hw *hw)
+{
+	struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
+	struct hns3_pf *pf = &hns->pf;
+	uint32_t mode = pf->fec_mode;
+	int ret;
+>>>>>>> net/hns3: fix delay for waiting to stop Rx/Tx
 
 	if (hw->reset.level != HNS3_NONE_RESET && reset_level < hw->reset.level)
 		return HNS3_NONE_RESET;
@@ -5201,7 +6381,7 @@ hns3_stop_service(struct hns3_adapter *hns)
 	rte_wmb();
 	/* Disable datapath on secondary process. */
 	hns3_mp_req_stop_rxtx(eth_dev);
-	rte_delay_ms(hw->tqps_num);
+	rte_delay_ms(hw->cfg_max_queues);
 
 	rte_spinlock_lock(&hw->lock);
 	if (hns->hw.adapter_state == HNS3_NIC_STARTED ||
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
index a7b6188eea..eb3edf3464 100644
--- a/drivers/net/hns3/hns3_ethdev_vf.c
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
@@ -1631,7 +1631,7 @@ hns3vf_dev_stop(struct rte_eth_dev *dev)
 	/* Disable datapath on secondary process. */
 	hns3_mp_req_stop_rxtx(dev);
 	/* Prevent crashes when queues are still in use. */
-	rte_delay_ms(hw->tqps_num);
+	rte_delay_ms(hw->cfg_max_queues);
 
 	rte_spinlock_lock(&hw->lock);
 	if (rte_atomic16_read(&hw->reset.resetting) == 0) {
@@ -2005,7 +2005,7 @@ hns3vf_stop_service(struct hns3_adapter *hns)
 	rte_wmb();
 	/* Disable datapath on secondary process. */
 	hns3_mp_req_stop_rxtx(eth_dev);
-	rte_delay_ms(hw->tqps_num);
+	rte_delay_ms(hw->cfg_max_queues);
 
 	rte_spinlock_lock(&hw->lock);
 	if (hw->adapter_state == HNS3_NIC_STARTED ||
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:14.264171339 +0200
+++ 0031-net-hns3-fix-delay-for-waiting-to-stop-Rx-Tx.patch	2021-08-10 15:11:12.962637696 +0200
@@ -1 +1 @@
-From 4d8cce267840556cec8483c61f8cfbf25873496d Mon Sep 17 00:00:00 2001
+From 249c35152a9bcd6d4c4b52776602750552dcf294 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 4d8cce267840556cec8483c61f8cfbf25873496d ]
+
@@ -14 +15,0 @@
-Cc: stable@dpdk.org
@@ -19,3 +20,3 @@
- drivers/net/hns3/hns3_ethdev.c    | 4 ++--
- drivers/net/hns3/hns3_ethdev_vf.c | 4 ++--
- 2 files changed, 4 insertions(+), 4 deletions(-)
+ drivers/net/hns3/hns3_ethdev.c    | 1184 ++++++++++++++++++++++++++++-
+ drivers/net/hns3/hns3_ethdev_vf.c |    4 +-
+ 2 files changed, 1184 insertions(+), 4 deletions(-)
@@ -24 +25 @@
-index 20491305e7..dff265828e 100644
+index ac82e0b5ef..e1bc55682c 100644
@@ -27 +28 @@
-@@ -5895,7 +5895,7 @@ hns3_dev_stop(struct rte_eth_dev *dev)
+@@ -4742,7 +4742,7 @@ hns3_dev_stop(struct rte_eth_dev *dev)
@@ -35,2 +36,1193 @@
- 	if (__atomic_load_n(&hw->reset.resetting, __ATOMIC_RELAXED) == 0) {
-@@ -6511,7 +6511,7 @@ hns3_stop_service(struct hns3_adapter *hns)
+ 	if (rte_atomic16_read(&hw->reset.resetting) == 0) {
+@@ -5130,10 +5130,1190 @@ hns3_get_reset_level(struct hns3_adapter *hns, uint64_t *levels)
+ 		reset_level = HNS3_IMP_RESET;
+ 	else if (hns3_atomic_test_bit(HNS3_GLOBAL_RESET, levels))
+ 		reset_level = HNS3_GLOBAL_RESET;
++<<<<<<< HEAD
+ 	else if (hns3_atomic_test_bit(HNS3_FUNC_RESET, levels))
+ 		reset_level = HNS3_FUNC_RESET;
+ 	else if (hns3_atomic_test_bit(HNS3_FLR_RESET, levels))
+ 		reset_level = HNS3_FLR_RESET;
++||||||| constructed merge base
++	else if (hns3_atomic_test_bit(HNS3_FUNC_RESET, levels))
++		reset_level = HNS3_FUNC_RESET;
++	else if (hns3_atomic_test_bit(HNS3_FLR_RESET, levels))
++		reset_level = HNS3_FLR_RESET;
++
++	if (hw->reset.level != HNS3_NONE_RESET && reset_level < hw->reset.level)
++		return HNS3_NONE_RESET;
++
++	return reset_level;
++}
++
++static void
++hns3_record_imp_error(struct hns3_adapter *hns)
++{
++	struct hns3_hw *hw = &hns->hw;
++	uint32_t reg_val;
++
++	reg_val = hns3_read_dev(hw, HNS3_VECTOR0_OTER_EN_REG);
++	if (hns3_get_bit(reg_val, HNS3_VECTOR0_IMP_RD_POISON_B)) {
++		hns3_warn(hw, "Detected IMP RD poison!");
++		hns3_set_bit(reg_val, HNS3_VECTOR0_IMP_RD_POISON_B, 0);
++		hns3_write_dev(hw, HNS3_VECTOR0_OTER_EN_REG, reg_val);
++	}
++
++	if (hns3_get_bit(reg_val, HNS3_VECTOR0_IMP_CMDQ_ERR_B)) {
++		hns3_warn(hw, "Detected IMP CMDQ error!");
++		hns3_set_bit(reg_val, HNS3_VECTOR0_IMP_CMDQ_ERR_B, 0);
++		hns3_write_dev(hw, HNS3_VECTOR0_OTER_EN_REG, reg_val);
++	}
++}
++
++static int
++hns3_prepare_reset(struct hns3_adapter *hns)
++{
++	struct hns3_hw *hw = &hns->hw;
++	uint32_t reg_val;
++	int ret;
++
++	switch (hw->reset.level) {
++	case HNS3_FUNC_RESET:
++		ret = hns3_func_reset_cmd(hw, HNS3_PF_FUNC_ID);
++		if (ret)
++			return ret;
++
++		/*
++		 * After performaning pf reset, it is not necessary to do the
++		 * mailbox handling or send any command to firmware, because
++		 * any mailbox handling or command to firmware is only valid
++		 * after hns3_cmd_init is called.
++		 */
++		__atomic_store_n(&hw->reset.disable_cmd, 1, __ATOMIC_RELAXED);
++		hw->reset.stats.request_cnt++;
++		break;
++	case HNS3_IMP_RESET:
++		hns3_record_imp_error(hns);
++		reg_val = hns3_read_dev(hw, HNS3_VECTOR0_OTER_EN_REG);
++		hns3_write_dev(hw, HNS3_VECTOR0_OTER_EN_REG, reg_val |
++			       BIT(HNS3_VECTOR0_IMP_RESET_INT_B));
++		break;
++	default:
++		break;
++	}
++	return 0;
++}
++
++static int
++hns3_set_rst_done(struct hns3_hw *hw)
++{
++	struct hns3_pf_rst_done_cmd *req;
++	struct hns3_cmd_desc desc;
++
++	req = (struct hns3_pf_rst_done_cmd *)desc.data;
++	hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_PF_RST_DONE, false);
++	req->pf_rst_done |= HNS3_PF_RESET_DONE_BIT;
++	return hns3_cmd_send(hw, &desc, 1);
++}
++
++static int
++hns3_stop_service(struct hns3_adapter *hns)
++{
++	struct hns3_hw *hw = &hns->hw;
++	struct rte_eth_dev *eth_dev;
++
++	eth_dev = &rte_eth_devices[hw->data->port_id];
++	hw->mac.link_status = ETH_LINK_DOWN;
++	if (hw->adapter_state == HNS3_NIC_STARTED) {
++		rte_eal_alarm_cancel(hns3_service_handler, eth_dev);
++		hns3_update_linkstatus_and_event(hw, false);
++	}
++
++	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);
++
++	rte_spinlock_lock(&hw->lock);
++	if (hns->hw.adapter_state == HNS3_NIC_STARTED ||
++	    hw->adapter_state == HNS3_NIC_STOPPING) {
++		hns3_enable_all_queues(hw, false);
++		hns3_do_stop(hns);
++		hw->reset.mbuf_deferred_free = true;
++	} else
++		hw->reset.mbuf_deferred_free = false;
++
++	/*
++	 * It is cumbersome for hardware to pick-and-choose entries for deletion
++	 * from table space. Hence, for function reset software intervention is
++	 * required to delete the entries
++	 */
++	if (__atomic_load_n(&hw->reset.disable_cmd, __ATOMIC_RELAXED) == 0)
++		hns3_configure_all_mc_mac_addr(hns, true);
++	rte_spinlock_unlock(&hw->lock);
++
++	return 0;
++}
++
++static int
++hns3_start_service(struct hns3_adapter *hns)
++{
++	struct hns3_hw *hw = &hns->hw;
++	struct rte_eth_dev *eth_dev;
++
++	if (hw->reset.level == HNS3_IMP_RESET ||
++	    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);
++	if (hw->adapter_state == HNS3_NIC_STARTED) {
++		/*
++		 * This API parent function already hold the hns3_hw.lock, the
++		 * hns3_service_handler may report lse, in bonding application
++		 * it will call driver's ops which may acquire the hns3_hw.lock
++		 * again, thus lead to deadlock.
++		 * We defer calls hns3_service_handler to avoid the deadlock.
++		 */
++		rte_eal_alarm_set(HNS3_SERVICE_QUICK_INTERVAL,
++				  hns3_service_handler, eth_dev);
++
++		/* Enable interrupt of all rx queues before enabling queues */
++		hns3_dev_all_rx_queue_intr_enable(hw, true);
++		/*
++		 * Enable state of each rxq and txq will be recovered after
++		 * reset, so we need to restore them before enable all tqps;
++		 */
++		hns3_restore_tqp_enable_state(hw);
++		/*
++		 * When finished the initialization, enable queues to receive
++		 * and transmit packets.
++		 */
++		hns3_enable_all_queues(hw, true);
++	}
++
++	return 0;
++}
++
++static int
++hns3_restore_conf(struct hns3_adapter *hns)
++{
++	struct hns3_hw *hw = &hns->hw;
++	int ret;
++
++	ret = hns3_configure_all_mac_addr(hns, false);
++	if (ret)
++		return ret;
++
++	ret = hns3_configure_all_mc_mac_addr(hns, false);
++	if (ret)
++		goto err_mc_mac;
++
++	ret = hns3_dev_promisc_restore(hns);
++	if (ret)
++		goto err_promisc;
++
++	ret = hns3_restore_vlan_table(hns);
++	if (ret)
++		goto err_promisc;
++
++	ret = hns3_restore_vlan_conf(hns);
++	if (ret)
++		goto err_promisc;
++
++	ret = hns3_restore_all_fdir_filter(hns);
++	if (ret)
++		goto err_promisc;
++
++	ret = hns3_restore_ptp(hns);
++	if (ret)
++		goto err_promisc;
++
++	ret = hns3_restore_rx_interrupt(hw);
++	if (ret)
++		goto err_promisc;
++
++	ret = hns3_restore_gro_conf(hw);
++	if (ret)
++		goto err_promisc;
++
++	ret = hns3_restore_fec(hw);
++	if (ret)
++		goto err_promisc;
++
++	if (hns->hw.adapter_state == HNS3_NIC_STARTED) {
++		ret = hns3_do_start(hns, false);
++		if (ret)
++			goto err_promisc;
++		hns3_info(hw, "hns3 dev restart successful!");
++	} else if (hw->adapter_state == HNS3_NIC_STOPPING)
++		hw->adapter_state = HNS3_NIC_CONFIGURED;
++	return 0;
++
++err_promisc:
++	hns3_configure_all_mc_mac_addr(hns, true);
++err_mc_mac:
++	hns3_configure_all_mac_addr(hns, true);
++	return ret;
++}
++
++static void
++hns3_reset_service(void *param)
++{
++	struct hns3_adapter *hns = (struct hns3_adapter *)param;
++	struct hns3_hw *hw = &hns->hw;
++	enum hns3_reset_level reset_level;
++	struct timeval tv_delta;
++	struct timeval tv_start;
++	struct timeval tv;
++	uint64_t msec;
++	int ret;
++
++	/*
++	 * The interrupt is not triggered within the delay time.
++	 * The interrupt may have been lost. It is necessary to handle
++	 * the interrupt to recover from the error.
++	 */
++	if (__atomic_load_n(&hw->reset.schedule, __ATOMIC_RELAXED) ==
++			    SCHEDULE_DEFERRED) {
++		__atomic_store_n(&hw->reset.schedule, SCHEDULE_REQUESTED,
++				  __ATOMIC_RELAXED);
++		hns3_err(hw, "Handling interrupts in delayed tasks");
++		hns3_interrupt_handler(&rte_eth_devices[hw->data->port_id]);
++		reset_level = hns3_get_reset_level(hns, &hw->reset.pending);
++		if (reset_level == HNS3_NONE_RESET) {
++			hns3_err(hw, "No reset level is set, try IMP reset");
++			hns3_atomic_set_bit(HNS3_IMP_RESET, &hw->reset.pending);
++		}
++	}
++	__atomic_store_n(&hw->reset.schedule, SCHEDULE_NONE, __ATOMIC_RELAXED);
++
++	/*
++	 * Check if there is any ongoing reset in the hardware. This status can
++	 * be checked from reset_pending. If there is then, we need to wait for
++	 * hardware to complete reset.
++	 *    a. If we are able to figure out in reasonable time that hardware
++	 *       has fully resetted then, we can proceed with driver, client
++	 *       reset.
++	 *    b. else, we can come back later to check this status so re-sched
++	 *       now.
++	 */
++	reset_level = hns3_get_reset_level(hns, &hw->reset.pending);
++	if (reset_level != HNS3_NONE_RESET) {
++		hns3_clock_gettime(&tv_start);
++		ret = hns3_reset_process(hns, reset_level);
++		hns3_clock_gettime(&tv);
++		timersub(&tv, &tv_start, &tv_delta);
++		msec = hns3_clock_calctime_ms(&tv_delta);
++		if (msec > HNS3_RESET_PROCESS_MS)
++			hns3_err(hw, "%d handle long time delta %" PRIu64
++				     " ms time=%ld.%.6ld",
++				 hw->reset.level, msec,
++				 tv.tv_sec, tv.tv_usec);
++		if (ret == -EAGAIN)
++			return;
++	}
++
++	/* Check if we got any *new* reset requests to be honored */
++	reset_level = hns3_get_reset_level(hns, &hw->reset.request);
++	if (reset_level != HNS3_NONE_RESET)
++		hns3_msix_process(hns, reset_level);
++}
++
++static unsigned int
++hns3_get_speed_capa_num(uint16_t device_id)
++{
++	unsigned int num;
++
++	switch (device_id) {
++	case HNS3_DEV_ID_25GE:
++	case HNS3_DEV_ID_25GE_RDMA:
++		num = 2;
++		break;
++	case HNS3_DEV_ID_100G_RDMA_MACSEC:
++	case HNS3_DEV_ID_200G_RDMA:
++		num = 1;
++		break;
++	default:
++		num = 0;
++		break;
++	}
++
++	return num;
++}
++
++static int
++hns3_get_speed_fec_capa(struct rte_eth_fec_capa *speed_fec_capa,
++			uint16_t device_id)
++{
++	switch (device_id) {
++	case HNS3_DEV_ID_25GE:
++	/* fallthrough */
++	case HNS3_DEV_ID_25GE_RDMA:
++		speed_fec_capa[0].speed = speed_fec_capa_tbl[1].speed;
++		speed_fec_capa[0].capa = speed_fec_capa_tbl[1].capa;
++
++		/* In HNS3 device, the 25G NIC is compatible with 10G rate */
++		speed_fec_capa[1].speed = speed_fec_capa_tbl[0].speed;
++		speed_fec_capa[1].capa = speed_fec_capa_tbl[0].capa;
++		break;
++	case HNS3_DEV_ID_100G_RDMA_MACSEC:
++		speed_fec_capa[0].speed = speed_fec_capa_tbl[4].speed;
++		speed_fec_capa[0].capa = speed_fec_capa_tbl[4].capa;
++		break;
++	case HNS3_DEV_ID_200G_RDMA:
++		speed_fec_capa[0].speed = speed_fec_capa_tbl[5].speed;
++		speed_fec_capa[0].capa = speed_fec_capa_tbl[5].capa;
++		break;
++	default:
++		return -ENOTSUP;
++	}
++
++	return 0;
++}
++
++static int
++hns3_fec_get_capability(struct rte_eth_dev *dev,
++			struct rte_eth_fec_capa *speed_fec_capa,
++			unsigned int num)
++{
++	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
++	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
++	uint16_t device_id = pci_dev->id.device_id;
++	unsigned int capa_num;
++	int ret;
++
++	capa_num = hns3_get_speed_capa_num(device_id);
++	if (capa_num == 0) {
++		hns3_err(hw, "device(0x%x) is not supported by hns3 PMD",
++			 device_id);
++		return -ENOTSUP;
++	}
++
++	if (speed_fec_capa == NULL || num < capa_num)
++		return capa_num;
++
++	ret = hns3_get_speed_fec_capa(speed_fec_capa, device_id);
++	if (ret)
++		return -ENOTSUP;
++
++	return capa_num;
++}
++
++static int
++get_current_fec_auto_state(struct hns3_hw *hw, uint8_t *state)
++{
++	struct hns3_config_fec_cmd *req;
++	struct hns3_cmd_desc desc;
++	int ret;
++
++	/*
++	 * CMD(HNS3_OPC_CONFIG_FEC_MODE) read is not supported
++	 * in device of link speed
++	 * below 10 Gbps.
++	 */
++	if (hw->mac.link_speed < ETH_SPEED_NUM_10G) {
++		*state = 0;
++		return 0;
++	}
++
++	hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_CONFIG_FEC_MODE, true);
++	req = (struct hns3_config_fec_cmd *)desc.data;
++	ret = hns3_cmd_send(hw, &desc, 1);
++	if (ret) {
++		hns3_err(hw, "get current fec auto state failed, ret = %d",
++			 ret);
++		return ret;
++	}
++
++	*state = req->fec_mode & (1U << HNS3_MAC_CFG_FEC_AUTO_EN_B);
++	return 0;
++}
++
++static int
++hns3_fec_get_internal(struct hns3_hw *hw, uint32_t *fec_capa)
++{
++	struct hns3_sfp_info_cmd *resp;
++	uint32_t tmp_fec_capa;
++	uint8_t auto_state;
++	struct hns3_cmd_desc desc;
++	int ret;
++
++	/*
++	 * If link is down and AUTO is enabled, AUTO is returned, otherwise,
++	 * configured FEC mode is returned.
++	 * If link is up, current FEC mode is returned.
++	 */
++	if (hw->mac.link_status == ETH_LINK_DOWN) {
++		ret = get_current_fec_auto_state(hw, &auto_state);
++		if (ret)
++			return ret;
++
++		if (auto_state == 0x1) {
++			*fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(AUTO);
++			return 0;
++		}
++	}
++
++	hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_GET_SFP_INFO, true);
++	resp = (struct hns3_sfp_info_cmd *)desc.data;
++	resp->query_type = HNS3_ACTIVE_QUERY;
++
++	ret = hns3_cmd_send(hw, &desc, 1);
++	if (ret == -EOPNOTSUPP) {
++		hns3_err(hw, "IMP do not support get FEC, ret = %d", ret);
++		return ret;
++	} else if (ret) {
++		hns3_err(hw, "get FEC failed, ret = %d", ret);
++		return ret;
++	}
++
++	/*
++	 * FEC mode order defined in hns3 hardware is inconsistend with
++	 * that defined in the ethdev library. So the sequence needs
++	 * to be converted.
++	 */
++	switch (resp->active_fec) {
++	case HNS3_HW_FEC_MODE_NOFEC:
++		tmp_fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(NOFEC);
++		break;
++	case HNS3_HW_FEC_MODE_BASER:
++		tmp_fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(BASER);
++		break;
++	case HNS3_HW_FEC_MODE_RS:
++		tmp_fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(RS);
++		break;
++	default:
++		tmp_fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(NOFEC);
++		break;
++	}
++
++	*fec_capa = tmp_fec_capa;
++	return 0;
++}
++
++static int
++hns3_fec_get(struct rte_eth_dev *dev, uint32_t *fec_capa)
++{
++	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
++
++	return hns3_fec_get_internal(hw, fec_capa);
++}
++
++static int
++hns3_set_fec_hw(struct hns3_hw *hw, uint32_t mode)
++{
++	struct hns3_config_fec_cmd *req;
++	struct hns3_cmd_desc desc;
++	int ret;
++
++	hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_CONFIG_FEC_MODE, false);
++
++	req = (struct hns3_config_fec_cmd *)desc.data;
++	switch (mode) {
++	case RTE_ETH_FEC_MODE_CAPA_MASK(NOFEC):
++		hns3_set_field(req->fec_mode, HNS3_MAC_CFG_FEC_MODE_M,
++				HNS3_MAC_CFG_FEC_MODE_S, HNS3_MAC_FEC_OFF);
++		break;
++	case RTE_ETH_FEC_MODE_CAPA_MASK(BASER):
++		hns3_set_field(req->fec_mode, HNS3_MAC_CFG_FEC_MODE_M,
++				HNS3_MAC_CFG_FEC_MODE_S, HNS3_MAC_FEC_BASER);
++		break;
++	case RTE_ETH_FEC_MODE_CAPA_MASK(RS):
++		hns3_set_field(req->fec_mode, HNS3_MAC_CFG_FEC_MODE_M,
++				HNS3_MAC_CFG_FEC_MODE_S, HNS3_MAC_FEC_RS);
++		break;
++	case RTE_ETH_FEC_MODE_CAPA_MASK(AUTO):
++		hns3_set_bit(req->fec_mode, HNS3_MAC_CFG_FEC_AUTO_EN_B, 1);
++		break;
++	default:
++		return 0;
++	}
++	ret = hns3_cmd_send(hw, &desc, 1);
++	if (ret)
++		hns3_err(hw, "set fec mode failed, ret = %d", ret);
++
++	return ret;
++}
++
++static uint32_t
++get_current_speed_fec_cap(struct hns3_hw *hw, struct rte_eth_fec_capa *fec_capa)
++{
++	struct hns3_mac *mac = &hw->mac;
++	uint32_t cur_capa;
++
++	switch (mac->link_speed) {
++	case ETH_SPEED_NUM_10G:
++		cur_capa = fec_capa[1].capa;
++		break;
++	case ETH_SPEED_NUM_25G:
++	case ETH_SPEED_NUM_100G:
++	case ETH_SPEED_NUM_200G:
++		cur_capa = fec_capa[0].capa;
++		break;
++	default:
++		cur_capa = 0;
++		break;
++	}
++
++	return cur_capa;
++}
++
++static bool
++is_fec_mode_one_bit_set(uint32_t mode)
++{
++	int cnt = 0;
++	uint8_t i;
++
++	for (i = 0; i < sizeof(mode); i++)
++		if (mode >> i & 0x1)
++			cnt++;
++
++	return cnt == 1 ? true : false;
++}
++
++static int
++hns3_fec_set(struct rte_eth_dev *dev, uint32_t mode)
++{
++#define FEC_CAPA_NUM 2
++	struct hns3_adapter *hns = dev->data->dev_private;
++	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(hns);
++	struct hns3_pf *pf = &hns->pf;
++
++	struct rte_eth_fec_capa fec_capa[FEC_CAPA_NUM];
++	uint32_t cur_capa;
++	uint32_t num = FEC_CAPA_NUM;
++	int ret;
++
++	ret = hns3_fec_get_capability(dev, fec_capa, num);
++	if (ret < 0)
++		return ret;
++
++	/* HNS3 PMD driver only support one bit set mode, e.g. 0x1, 0x4 */
++	if (!is_fec_mode_one_bit_set(mode)) {
++		hns3_err(hw, "FEC mode(0x%x) not supported in HNS3 PMD, "
++			     "FEC mode should be only one bit set", mode);
++		return -EINVAL;
++	}
++
++	/*
++	 * Check whether the configured mode is within the FEC capability.
++	 * If not, the configured mode will not be supported.
++	 */
++	cur_capa = get_current_speed_fec_cap(hw, fec_capa);
++	if (!(cur_capa & mode)) {
++		hns3_err(hw, "unsupported FEC mode = 0x%x", mode);
++		return -EINVAL;
++	}
++
++	rte_spinlock_lock(&hw->lock);
++	ret = hns3_set_fec_hw(hw, mode);
++	if (ret) {
++		rte_spinlock_unlock(&hw->lock);
++		return ret;
++	}
++
++	pf->fec_mode = mode;
++	rte_spinlock_unlock(&hw->lock);
++
++	return 0;
++}
++
++static int
++hns3_restore_fec(struct hns3_hw *hw)
++{
++	struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
++	struct hns3_pf *pf = &hns->pf;
++	uint32_t mode = pf->fec_mode;
++	int ret;
++=======
++	else if (hns3_atomic_test_bit(HNS3_FUNC_RESET, levels))
++		reset_level = HNS3_FUNC_RESET;
++	else if (hns3_atomic_test_bit(HNS3_FLR_RESET, levels))
++		reset_level = HNS3_FLR_RESET;
++
++	if (hw->reset.level != HNS3_NONE_RESET && reset_level < hw->reset.level)
++		return HNS3_NONE_RESET;
++
++	return reset_level;
++}
++
++static void
++hns3_record_imp_error(struct hns3_adapter *hns)
++{
++	struct hns3_hw *hw = &hns->hw;
++	uint32_t reg_val;
++
++	reg_val = hns3_read_dev(hw, HNS3_VECTOR0_OTER_EN_REG);
++	if (hns3_get_bit(reg_val, HNS3_VECTOR0_IMP_RD_POISON_B)) {
++		hns3_warn(hw, "Detected IMP RD poison!");
++		hns3_set_bit(reg_val, HNS3_VECTOR0_IMP_RD_POISON_B, 0);
++		hns3_write_dev(hw, HNS3_VECTOR0_OTER_EN_REG, reg_val);
++	}
++
++	if (hns3_get_bit(reg_val, HNS3_VECTOR0_IMP_CMDQ_ERR_B)) {
++		hns3_warn(hw, "Detected IMP CMDQ error!");
++		hns3_set_bit(reg_val, HNS3_VECTOR0_IMP_CMDQ_ERR_B, 0);
++		hns3_write_dev(hw, HNS3_VECTOR0_OTER_EN_REG, reg_val);
++	}
++}
++
++static int
++hns3_prepare_reset(struct hns3_adapter *hns)
++{
++	struct hns3_hw *hw = &hns->hw;
++	uint32_t reg_val;
++	int ret;
++
++	switch (hw->reset.level) {
++	case HNS3_FUNC_RESET:
++		ret = hns3_func_reset_cmd(hw, HNS3_PF_FUNC_ID);
++		if (ret)
++			return ret;
++
++		/*
++		 * After performaning pf reset, it is not necessary to do the
++		 * mailbox handling or send any command to firmware, because
++		 * any mailbox handling or command to firmware is only valid
++		 * after hns3_cmd_init is called.
++		 */
++		__atomic_store_n(&hw->reset.disable_cmd, 1, __ATOMIC_RELAXED);
++		hw->reset.stats.request_cnt++;
++		break;
++	case HNS3_IMP_RESET:
++		hns3_record_imp_error(hns);
++		reg_val = hns3_read_dev(hw, HNS3_VECTOR0_OTER_EN_REG);
++		hns3_write_dev(hw, HNS3_VECTOR0_OTER_EN_REG, reg_val |
++			       BIT(HNS3_VECTOR0_IMP_RESET_INT_B));
++		break;
++	default:
++		break;
++	}
++	return 0;
++}
++
++static int
++hns3_set_rst_done(struct hns3_hw *hw)
++{
++	struct hns3_pf_rst_done_cmd *req;
++	struct hns3_cmd_desc desc;
++
++	req = (struct hns3_pf_rst_done_cmd *)desc.data;
++	hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_PF_RST_DONE, false);
++	req->pf_rst_done |= HNS3_PF_RESET_DONE_BIT;
++	return hns3_cmd_send(hw, &desc, 1);
++}
++
++static int
++hns3_stop_service(struct hns3_adapter *hns)
++{
++	struct hns3_hw *hw = &hns->hw;
++	struct rte_eth_dev *eth_dev;
++
++	eth_dev = &rte_eth_devices[hw->data->port_id];
++	hw->mac.link_status = ETH_LINK_DOWN;
++	if (hw->adapter_state == HNS3_NIC_STARTED) {
++		rte_eal_alarm_cancel(hns3_service_handler, eth_dev);
++		hns3_update_linkstatus_and_event(hw, false);
++	}
++
++	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);
++
++	rte_spinlock_lock(&hw->lock);
++	if (hns->hw.adapter_state == HNS3_NIC_STARTED ||
++	    hw->adapter_state == HNS3_NIC_STOPPING) {
++		hns3_enable_all_queues(hw, false);
++		hns3_do_stop(hns);
++		hw->reset.mbuf_deferred_free = true;
++	} else
++		hw->reset.mbuf_deferred_free = false;
++
++	/*
++	 * It is cumbersome for hardware to pick-and-choose entries for deletion
++	 * from table space. Hence, for function reset software intervention is
++	 * required to delete the entries
++	 */
++	if (__atomic_load_n(&hw->reset.disable_cmd, __ATOMIC_RELAXED) == 0)
++		hns3_configure_all_mc_mac_addr(hns, true);
++	rte_spinlock_unlock(&hw->lock);
++
++	return 0;
++}
++
++static int
++hns3_start_service(struct hns3_adapter *hns)
++{
++	struct hns3_hw *hw = &hns->hw;
++	struct rte_eth_dev *eth_dev;
++
++	if (hw->reset.level == HNS3_IMP_RESET ||
++	    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);
++	if (hw->adapter_state == HNS3_NIC_STARTED) {
++		/*
++		 * This API parent function already hold the hns3_hw.lock, the
++		 * hns3_service_handler may report lse, in bonding application
++		 * it will call driver's ops which may acquire the hns3_hw.lock
++		 * again, thus lead to deadlock.
++		 * We defer calls hns3_service_handler to avoid the deadlock.
++		 */
++		rte_eal_alarm_set(HNS3_SERVICE_QUICK_INTERVAL,
++				  hns3_service_handler, eth_dev);
++
++		/* Enable interrupt of all rx queues before enabling queues */
++		hns3_dev_all_rx_queue_intr_enable(hw, true);
++		/*
++		 * Enable state of each rxq and txq will be recovered after
++		 * reset, so we need to restore them before enable all tqps;
++		 */
++		hns3_restore_tqp_enable_state(hw);
++		/*
++		 * When finished the initialization, enable queues to receive
++		 * and transmit packets.
++		 */
++		hns3_enable_all_queues(hw, true);
++	}
++
++	return 0;
++}
++
++static int
++hns3_restore_conf(struct hns3_adapter *hns)
++{
++	struct hns3_hw *hw = &hns->hw;
++	int ret;
++
++	ret = hns3_configure_all_mac_addr(hns, false);
++	if (ret)
++		return ret;
++
++	ret = hns3_configure_all_mc_mac_addr(hns, false);
++	if (ret)
++		goto err_mc_mac;
++
++	ret = hns3_dev_promisc_restore(hns);
++	if (ret)
++		goto err_promisc;
++
++	ret = hns3_restore_vlan_table(hns);
++	if (ret)
++		goto err_promisc;
++
++	ret = hns3_restore_vlan_conf(hns);
++	if (ret)
++		goto err_promisc;
++
++	ret = hns3_restore_all_fdir_filter(hns);
++	if (ret)
++		goto err_promisc;
++
++	ret = hns3_restore_ptp(hns);
++	if (ret)
++		goto err_promisc;
++
++	ret = hns3_restore_rx_interrupt(hw);
++	if (ret)
++		goto err_promisc;
++
++	ret = hns3_restore_gro_conf(hw);
++	if (ret)
++		goto err_promisc;
++
++	ret = hns3_restore_fec(hw);
++	if (ret)
++		goto err_promisc;
++
++	if (hns->hw.adapter_state == HNS3_NIC_STARTED) {
++		ret = hns3_do_start(hns, false);
++		if (ret)
++			goto err_promisc;
++		hns3_info(hw, "hns3 dev restart successful!");
++	} else if (hw->adapter_state == HNS3_NIC_STOPPING)
++		hw->adapter_state = HNS3_NIC_CONFIGURED;
++	return 0;
++
++err_promisc:
++	hns3_configure_all_mc_mac_addr(hns, true);
++err_mc_mac:
++	hns3_configure_all_mac_addr(hns, true);
++	return ret;
++}
++
++static void
++hns3_reset_service(void *param)
++{
++	struct hns3_adapter *hns = (struct hns3_adapter *)param;
++	struct hns3_hw *hw = &hns->hw;
++	enum hns3_reset_level reset_level;
++	struct timeval tv_delta;
++	struct timeval tv_start;
++	struct timeval tv;
++	uint64_t msec;
++	int ret;
++
++	/*
++	 * The interrupt is not triggered within the delay time.
++	 * The interrupt may have been lost. It is necessary to handle
++	 * the interrupt to recover from the error.
++	 */
++	if (__atomic_load_n(&hw->reset.schedule, __ATOMIC_RELAXED) ==
++			    SCHEDULE_DEFERRED) {
++		__atomic_store_n(&hw->reset.schedule, SCHEDULE_REQUESTED,
++				  __ATOMIC_RELAXED);
++		hns3_err(hw, "Handling interrupts in delayed tasks");
++		hns3_interrupt_handler(&rte_eth_devices[hw->data->port_id]);
++		reset_level = hns3_get_reset_level(hns, &hw->reset.pending);
++		if (reset_level == HNS3_NONE_RESET) {
++			hns3_err(hw, "No reset level is set, try IMP reset");
++			hns3_atomic_set_bit(HNS3_IMP_RESET, &hw->reset.pending);
++		}
++	}
++	__atomic_store_n(&hw->reset.schedule, SCHEDULE_NONE, __ATOMIC_RELAXED);
++
++	/*
++	 * Check if there is any ongoing reset in the hardware. This status can
++	 * be checked from reset_pending. If there is then, we need to wait for
++	 * hardware to complete reset.
++	 *    a. If we are able to figure out in reasonable time that hardware
++	 *       has fully resetted then, we can proceed with driver, client
++	 *       reset.
++	 *    b. else, we can come back later to check this status so re-sched
++	 *       now.
++	 */
++	reset_level = hns3_get_reset_level(hns, &hw->reset.pending);
++	if (reset_level != HNS3_NONE_RESET) {
++		hns3_clock_gettime(&tv_start);
++		ret = hns3_reset_process(hns, reset_level);
++		hns3_clock_gettime(&tv);
++		timersub(&tv, &tv_start, &tv_delta);
++		msec = hns3_clock_calctime_ms(&tv_delta);
++		if (msec > HNS3_RESET_PROCESS_MS)
++			hns3_err(hw, "%d handle long time delta %" PRIu64
++				     " ms time=%ld.%.6ld",
++				 hw->reset.level, msec,
++				 tv.tv_sec, tv.tv_usec);
++		if (ret == -EAGAIN)
++			return;
++	}
++
++	/* Check if we got any *new* reset requests to be honored */
++	reset_level = hns3_get_reset_level(hns, &hw->reset.request);
++	if (reset_level != HNS3_NONE_RESET)
++		hns3_msix_process(hns, reset_level);
++}
++
++static unsigned int
++hns3_get_speed_capa_num(uint16_t device_id)
++{
++	unsigned int num;
++
++	switch (device_id) {
++	case HNS3_DEV_ID_25GE:
++	case HNS3_DEV_ID_25GE_RDMA:
++		num = 2;
++		break;
++	case HNS3_DEV_ID_100G_RDMA_MACSEC:
++	case HNS3_DEV_ID_200G_RDMA:
++		num = 1;
++		break;
++	default:
++		num = 0;
++		break;
++	}
++
++	return num;
++}
++
++static int
++hns3_get_speed_fec_capa(struct rte_eth_fec_capa *speed_fec_capa,
++			uint16_t device_id)
++{
++	switch (device_id) {
++	case HNS3_DEV_ID_25GE:
++	/* fallthrough */
++	case HNS3_DEV_ID_25GE_RDMA:
++		speed_fec_capa[0].speed = speed_fec_capa_tbl[1].speed;
++		speed_fec_capa[0].capa = speed_fec_capa_tbl[1].capa;
++
++		/* In HNS3 device, the 25G NIC is compatible with 10G rate */
++		speed_fec_capa[1].speed = speed_fec_capa_tbl[0].speed;
++		speed_fec_capa[1].capa = speed_fec_capa_tbl[0].capa;
++		break;
++	case HNS3_DEV_ID_100G_RDMA_MACSEC:
++		speed_fec_capa[0].speed = speed_fec_capa_tbl[4].speed;
++		speed_fec_capa[0].capa = speed_fec_capa_tbl[4].capa;
++		break;
++	case HNS3_DEV_ID_200G_RDMA:
++		speed_fec_capa[0].speed = speed_fec_capa_tbl[5].speed;
++		speed_fec_capa[0].capa = speed_fec_capa_tbl[5].capa;
++		break;
++	default:
++		return -ENOTSUP;
++	}
++
++	return 0;
++}
++
++static int
++hns3_fec_get_capability(struct rte_eth_dev *dev,
++			struct rte_eth_fec_capa *speed_fec_capa,
++			unsigned int num)
++{
++	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
++	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
++	uint16_t device_id = pci_dev->id.device_id;
++	unsigned int capa_num;
++	int ret;
++
++	capa_num = hns3_get_speed_capa_num(device_id);
++	if (capa_num == 0) {
++		hns3_err(hw, "device(0x%x) is not supported by hns3 PMD",
++			 device_id);
++		return -ENOTSUP;
++	}
++
++	if (speed_fec_capa == NULL || num < capa_num)
++		return capa_num;
++
++	ret = hns3_get_speed_fec_capa(speed_fec_capa, device_id);
++	if (ret)
++		return -ENOTSUP;
++
++	return capa_num;
++}
++
++static int
++get_current_fec_auto_state(struct hns3_hw *hw, uint8_t *state)
++{
++	struct hns3_config_fec_cmd *req;
++	struct hns3_cmd_desc desc;
++	int ret;
++
++	/*
++	 * CMD(HNS3_OPC_CONFIG_FEC_MODE) read is not supported
++	 * in device of link speed
++	 * below 10 Gbps.
++	 */
++	if (hw->mac.link_speed < ETH_SPEED_NUM_10G) {
++		*state = 0;
++		return 0;
++	}
++
++	hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_CONFIG_FEC_MODE, true);
++	req = (struct hns3_config_fec_cmd *)desc.data;
++	ret = hns3_cmd_send(hw, &desc, 1);
++	if (ret) {
++		hns3_err(hw, "get current fec auto state failed, ret = %d",
++			 ret);
++		return ret;
++	}
++
++	*state = req->fec_mode & (1U << HNS3_MAC_CFG_FEC_AUTO_EN_B);
++	return 0;
++}
++
++static int
++hns3_fec_get_internal(struct hns3_hw *hw, uint32_t *fec_capa)
++{
++	struct hns3_sfp_info_cmd *resp;
++	uint32_t tmp_fec_capa;
++	uint8_t auto_state;
++	struct hns3_cmd_desc desc;
++	int ret;
++
++	/*
++	 * If link is down and AUTO is enabled, AUTO is returned, otherwise,
++	 * configured FEC mode is returned.
++	 * If link is up, current FEC mode is returned.
++	 */
++	if (hw->mac.link_status == ETH_LINK_DOWN) {
++		ret = get_current_fec_auto_state(hw, &auto_state);
++		if (ret)
++			return ret;
++
++		if (auto_state == 0x1) {
++			*fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(AUTO);
++			return 0;
++		}
++	}
++
++	hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_GET_SFP_INFO, true);
++	resp = (struct hns3_sfp_info_cmd *)desc.data;
++	resp->query_type = HNS3_ACTIVE_QUERY;
++
++	ret = hns3_cmd_send(hw, &desc, 1);
++	if (ret == -EOPNOTSUPP) {
++		hns3_err(hw, "IMP do not support get FEC, ret = %d", ret);
++		return ret;
++	} else if (ret) {
++		hns3_err(hw, "get FEC failed, ret = %d", ret);
++		return ret;
++	}
++
++	/*
++	 * FEC mode order defined in hns3 hardware is inconsistend with
++	 * that defined in the ethdev library. So the sequence needs
++	 * to be converted.
++	 */
++	switch (resp->active_fec) {
++	case HNS3_HW_FEC_MODE_NOFEC:
++		tmp_fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(NOFEC);
++		break;
++	case HNS3_HW_FEC_MODE_BASER:
++		tmp_fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(BASER);
++		break;
++	case HNS3_HW_FEC_MODE_RS:
++		tmp_fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(RS);
++		break;
++	default:
++		tmp_fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(NOFEC);
++		break;
++	}
++
++	*fec_capa = tmp_fec_capa;
++	return 0;
++}
++
++static int
++hns3_fec_get(struct rte_eth_dev *dev, uint32_t *fec_capa)
++{
++	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
++
++	return hns3_fec_get_internal(hw, fec_capa);
++}
++
++static int
++hns3_set_fec_hw(struct hns3_hw *hw, uint32_t mode)
++{
++	struct hns3_config_fec_cmd *req;
++	struct hns3_cmd_desc desc;
++	int ret;
++
++	hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_CONFIG_FEC_MODE, false);
++
++	req = (struct hns3_config_fec_cmd *)desc.data;
++	switch (mode) {
++	case RTE_ETH_FEC_MODE_CAPA_MASK(NOFEC):
++		hns3_set_field(req->fec_mode, HNS3_MAC_CFG_FEC_MODE_M,
++				HNS3_MAC_CFG_FEC_MODE_S, HNS3_MAC_FEC_OFF);
++		break;
++	case RTE_ETH_FEC_MODE_CAPA_MASK(BASER):
++		hns3_set_field(req->fec_mode, HNS3_MAC_CFG_FEC_MODE_M,
++				HNS3_MAC_CFG_FEC_MODE_S, HNS3_MAC_FEC_BASER);
++		break;
++	case RTE_ETH_FEC_MODE_CAPA_MASK(RS):
++		hns3_set_field(req->fec_mode, HNS3_MAC_CFG_FEC_MODE_M,
++				HNS3_MAC_CFG_FEC_MODE_S, HNS3_MAC_FEC_RS);
++		break;
++	case RTE_ETH_FEC_MODE_CAPA_MASK(AUTO):
++		hns3_set_bit(req->fec_mode, HNS3_MAC_CFG_FEC_AUTO_EN_B, 1);
++		break;
++	default:
++		return 0;
++	}
++	ret = hns3_cmd_send(hw, &desc, 1);
++	if (ret)
++		hns3_err(hw, "set fec mode failed, ret = %d", ret);
++
++	return ret;
++}
++
++static uint32_t
++get_current_speed_fec_cap(struct hns3_hw *hw, struct rte_eth_fec_capa *fec_capa)
++{
++	struct hns3_mac *mac = &hw->mac;
++	uint32_t cur_capa;
++
++	switch (mac->link_speed) {
++	case ETH_SPEED_NUM_10G:
++		cur_capa = fec_capa[1].capa;
++		break;
++	case ETH_SPEED_NUM_25G:
++	case ETH_SPEED_NUM_100G:
++	case ETH_SPEED_NUM_200G:
++		cur_capa = fec_capa[0].capa;
++		break;
++	default:
++		cur_capa = 0;
++		break;
++	}
++
++	return cur_capa;
++}
++
++static bool
++is_fec_mode_one_bit_set(uint32_t mode)
++{
++	int cnt = 0;
++	uint8_t i;
++
++	for (i = 0; i < sizeof(mode); i++)
++		if (mode >> i & 0x1)
++			cnt++;
++
++	return cnt == 1 ? true : false;
++}
++
++static int
++hns3_fec_set(struct rte_eth_dev *dev, uint32_t mode)
++{
++#define FEC_CAPA_NUM 2
++	struct hns3_adapter *hns = dev->data->dev_private;
++	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(hns);
++	struct hns3_pf *pf = &hns->pf;
++
++	struct rte_eth_fec_capa fec_capa[FEC_CAPA_NUM];
++	uint32_t cur_capa;
++	uint32_t num = FEC_CAPA_NUM;
++	int ret;
++
++	ret = hns3_fec_get_capability(dev, fec_capa, num);
++	if (ret < 0)
++		return ret;
++
++	/* HNS3 PMD driver only support one bit set mode, e.g. 0x1, 0x4 */
++	if (!is_fec_mode_one_bit_set(mode)) {
++		hns3_err(hw, "FEC mode(0x%x) not supported in HNS3 PMD, "
++			     "FEC mode should be only one bit set", mode);
++		return -EINVAL;
++	}
++
++	/*
++	 * Check whether the configured mode is within the FEC capability.
++	 * If not, the configured mode will not be supported.
++	 */
++	cur_capa = get_current_speed_fec_cap(hw, fec_capa);
++	if (!(cur_capa & mode)) {
++		hns3_err(hw, "unsupported FEC mode = 0x%x", mode);
++		return -EINVAL;
++	}
++
++	rte_spinlock_lock(&hw->lock);
++	ret = hns3_set_fec_hw(hw, mode);
++	if (ret) {
++		rte_spinlock_unlock(&hw->lock);
++		return ret;
++	}
++
++	pf->fec_mode = mode;
++	rte_spinlock_unlock(&hw->lock);
++
++	return 0;
++}
++
++static int
++hns3_restore_fec(struct hns3_hw *hw)
++{
++	struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
++	struct hns3_pf *pf = &hns->pf;
++	uint32_t mode = pf->fec_mode;
++	int ret;
++>>>>>>> net/hns3: fix delay for waiting to stop Rx/Tx
+ 
+ 	if (hw->reset.level != HNS3_NONE_RESET && reset_level < hw->reset.level)
+ 		return HNS3_NONE_RESET;
+@@ -5201,7 +6381,7 @@ hns3_stop_service(struct hns3_adapter *hns)
@@ -46 +1238 @@
-index 41dd8ee129..7a5c162964 100644
+index a7b6188eea..eb3edf3464 100644
@@ -49 +1241 @@
-@@ -2107,7 +2107,7 @@ hns3vf_dev_stop(struct rte_eth_dev *dev)
+@@ -1631,7 +1631,7 @@ hns3vf_dev_stop(struct rte_eth_dev *dev)
@@ -57,2 +1249,2 @@
- 	if (__atomic_load_n(&hw->reset.resetting, __ATOMIC_RELAXED) == 0) {
-@@ -2558,7 +2558,7 @@ hns3vf_stop_service(struct hns3_adapter *hns)
+ 	if (rte_atomic16_read(&hw->reset.resetting) == 0) {
+@@ -2005,7 +2005,7 @@ hns3vf_stop_service(struct hns3_adapter *hns)

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

* [dpdk-stable] patch 'net/hns3: fix VLAN strip log' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (29 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/hns3: fix delay for waiting to stop Rx/Tx' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/pfe: remove unnecessary null check' " christian.ehrhardt
                   ` (69 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Chengchang Tang; +Cc: Min Hu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/55d20504dec8569755be0aeb6948513ae23ba690

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 55d20504dec8569755be0aeb6948513ae23ba690 Mon Sep 17 00:00:00 2001
From: Chengchang Tang <tangchengchang@huawei.com>
Date: Sun, 13 Jun 2021 10:31:54 +0800
Subject: [PATCH] net/hns3: fix VLAN strip log

[ upstream commit d8c497c55a3b13a0ec6ef8614af0ced46c372eb9 ]

When the current VLAN stripping is set, the log print always prompts
that the enabling fails, bug if may actually be the disabling failure.

Fixes: 411d23b9eafb ("net/hns3: support VLAN")

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 drivers/net/hns3/hns3_ethdev.c    | 3 ++-
 drivers/net/hns3/hns3_ethdev_vf.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index e1bc55682c..96e7faf2ce 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -523,7 +523,8 @@ hns3_en_hw_strip_rxvtag(struct hns3_adapter *hns, bool enable)
 
 	ret = hns3_set_vlan_rx_offload_cfg(hns, &rxvlan_cfg);
 	if (ret) {
-		hns3_err(hw, "enable strip rx vtag failed, ret =%d", ret);
+		hns3_err(hw, "%s strip rx vtag failed, ret = %d.",
+				enable ? "enable" : "disable", ret);
 		return ret;
 	}
 
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
index eb3edf3464..e63704429c 100644
--- a/drivers/net/hns3/hns3_ethdev_vf.c
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
@@ -1194,7 +1194,8 @@ hns3vf_en_hw_strip_rxvtag(struct hns3_hw *hw, bool enable)
 	ret = hns3_send_mbx_msg(hw, HNS3_MBX_SET_VLAN, HNS3_MBX_VLAN_RX_OFF_CFG,
 				&msg_data, sizeof(msg_data), false, NULL, 0);
 	if (ret)
-		hns3_err(hw, "vf enable strip failed, ret =%d", ret);
+		hns3_err(hw, "vf %s strip failed, ret = %d.",
+				enable ? "enable" : "disable", ret);
 
 	return ret;
 }
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:14.304151600 +0200
+++ 0032-net-hns3-fix-VLAN-strip-log.patch	2021-08-10 15:11:12.970637754 +0200
@@ -1 +1 @@
-From d8c497c55a3b13a0ec6ef8614af0ced46c372eb9 Mon Sep 17 00:00:00 2001
+From 55d20504dec8569755be0aeb6948513ae23ba690 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit d8c497c55a3b13a0ec6ef8614af0ced46c372eb9 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index ad25aa69d7..ff219b8b52 100644
+index e1bc55682c..96e7faf2ce 100644
@@ -23 +24 @@
-@@ -640,7 +640,8 @@ hns3_en_hw_strip_rxvtag(struct hns3_adapter *hns, bool enable)
+@@ -523,7 +523,8 @@ hns3_en_hw_strip_rxvtag(struct hns3_adapter *hns, bool enable)
@@ -34 +35 @@
-index 74f93dcb15..c5f320fc5b 100644
+index eb3edf3464..e63704429c 100644
@@ -37 +38 @@
-@@ -1606,7 +1606,8 @@ hns3vf_en_hw_strip_rxvtag(struct hns3_hw *hw, bool enable)
+@@ -1194,7 +1194,8 @@ hns3vf_en_hw_strip_rxvtag(struct hns3_hw *hw, bool enable)

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

* [dpdk-stable] patch 'net/pfe: remove unnecessary null check' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (30 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/hns3: fix VLAN strip log' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'ethdev: fix doc of flow action' " christian.ehrhardt
                   ` (68 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Thierry Herbelot; +Cc: Gagandeep Singh, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/704a3314ef03076bfa9ba120a74de97578f6a01f

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 704a3314ef03076bfa9ba120a74de97578f6a01f Mon Sep 17 00:00:00 2001
From: Thierry Herbelot <thierry.herbelot@6wind.com>
Date: Mon, 24 May 2021 11:37:54 +0200
Subject: [PATCH] net/pfe: remove unnecessary null check

[ upstream commit 01bfb518a39b91da7896abe579bcf72d06935bf5 ]

ethdev library does the check of dev before calling the link update.

Fixes: acd4818ea2a45 ("net/pfe: add link status update")

Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
Acked-by: Gagandeep Singh <g.singh@nxp.com>
---
 drivers/net/pfe/pfe_ethdev.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/net/pfe/pfe_ethdev.c b/drivers/net/pfe/pfe_ethdev.c
index fa3c0ce0fe..4e2ba0565f 100644
--- a/drivers/net/pfe/pfe_ethdev.c
+++ b/drivers/net/pfe/pfe_ethdev.c
@@ -583,11 +583,6 @@ pfe_eth_link_update(struct rte_eth_dev *dev, int wait_to_complete __rte_unused)
 	struct rte_eth_link link, old;
 	unsigned int lstatus = 1;
 
-	if (dev == NULL) {
-		PFE_PMD_ERR("Invalid device in link_update.\n");
-		return 0;
-	}
-
 	memset(&old, 0, sizeof(old));
 	memset(&link, 0, sizeof(struct rte_eth_link));
 
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:14.343734353 +0200
+++ 0033-net-pfe-remove-unnecessary-null-check.patch	2021-08-10 15:11:12.970637754 +0200
@@ -1 +1 @@
-From 01bfb518a39b91da7896abe579bcf72d06935bf5 Mon Sep 17 00:00:00 2001
+From 704a3314ef03076bfa9ba120a74de97578f6a01f Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 01bfb518a39b91da7896abe579bcf72d06935bf5 ]
+
@@ -9 +10,0 @@
-Cc: stable@dpdk.org
@@ -18 +19 @@
-index 3135466713..feec4d10a2 100644
+index fa3c0ce0fe..4e2ba0565f 100644
@@ -21 +22 @@
-@@ -582,11 +582,6 @@ pfe_eth_link_update(struct rte_eth_dev *dev, int wait_to_complete __rte_unused)
+@@ -583,11 +583,6 @@ pfe_eth_link_update(struct rte_eth_dev *dev, int wait_to_complete __rte_unused)

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

* [dpdk-stable] patch 'ethdev: fix doc of flow action' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (31 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/pfe: remove unnecessary null check' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'app/testpmd: change port link speed without stopping all' " christian.ehrhardt
                   ` (67 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Jan Viktorin; +Cc: Ori Kam, Aman Deep Singh, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/cb835fac3fb4b300166daeba74941d60765e4a4d

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From cb835fac3fb4b300166daeba74941d60765e4a4d Mon Sep 17 00:00:00 2001
From: Jan Viktorin <viktorin@cesnet.cz>
Date: Wed, 23 Jun 2021 11:18:25 +0200
Subject: [PATCH] ethdev: fix doc of flow action

[ upstream commit 56912ddef2b067a402dc648019938d354237c25a ]

The struct rte_flow_action was missing from DPDK API documentation.

Fixes: 3850cf0c8c37 ("ethdev: add tunnel encap/decap actions")

Signed-off-by: Jan Viktorin <viktorin@cesnet.cz>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Aman Deep Singh <aman.deep.singh@intel.com>
---
 lib/librte_ethdev/rte_flow.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
index c32cd40434..12f69b6365 100644
--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -2558,7 +2558,7 @@ rte_flow_dynf_metadata_set(struct rte_mbuf *m, uint32_t v)
 	*RTE_FLOW_DYNF_METADATA(m) = v;
 }
 
-/*
+/**
  * Definition of a single action.
  *
  * A list of actions is terminated by a END action.
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:14.379727658 +0200
+++ 0034-ethdev-fix-doc-of-flow-action.patch	2021-08-10 15:11:12.970637754 +0200
@@ -1 +1 @@
-From 56912ddef2b067a402dc648019938d354237c25a Mon Sep 17 00:00:00 2001
+From cb835fac3fb4b300166daeba74941d60765e4a4d Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 56912ddef2b067a402dc648019938d354237c25a ]
+
@@ -9 +10,0 @@
-Cc: stable@dpdk.org
@@ -15 +16 @@
- lib/ethdev/rte_flow.h | 2 +-
+ lib/librte_ethdev/rte_flow.h | 2 +-
@@ -18,5 +19,5 @@
-diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
-index 961a5884fe..70f455d47d 100644
---- a/lib/ethdev/rte_flow.h
-+++ b/lib/ethdev/rte_flow.h
-@@ -3278,7 +3278,7 @@ rte_flow_dynf_metadata_set(struct rte_mbuf *m, uint32_t v)
+diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
+index c32cd40434..12f69b6365 100644
+--- a/lib/librte_ethdev/rte_flow.h
++++ b/lib/librte_ethdev/rte_flow.h
+@@ -2558,7 +2558,7 @@ rte_flow_dynf_metadata_set(struct rte_mbuf *m, uint32_t v)

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

* [dpdk-stable] patch 'app/testpmd: change port link speed without stopping all' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (32 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'ethdev: fix doc of flow action' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'crypto/qat: fix Arm build with special memcpy' " christian.ehrhardt
                   ` (66 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Huisong Li; +Cc: Min Hu, Ferruh Yigit, Xiaoyun Li, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/ed4de94768fbd47b0ce3b512e2bd93d79d20d75d

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From ed4de94768fbd47b0ce3b512e2bd93d79d20d75d Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Wed, 28 Apr 2021 16:36:59 +0800
Subject: [PATCH] app/testpmd: change port link speed without stopping all

[ upstream commit 8ec87289e5eb0af241e01dfded5b7b5e163c5b25 ]

When we use the following cmd to modify the link speed of specified
port: "port config <port_id> speed xxx duplex xxx", we have to stop
all ports. It's not necessary.

Fixes: 82113036e4e5 ("ethdev: redesign link speed config")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
---
 app/test-pmd/cmdline.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 077d860401..3eedb82486 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -1704,13 +1704,13 @@ cmd_config_speed_specific_parsed(void *parsed_result,
 	struct cmd_config_speed_specific *res = parsed_result;
 	uint32_t link_speed;
 
-	if (!all_ports_stopped()) {
-		printf("Please stop all ports first\n");
+	if (port_id_is_invalid(res->id, ENABLED_WARN))
 		return;
-	}
 
-	if (port_id_is_invalid(res->id, ENABLED_WARN))
+	if (!port_is_stopped(res->id)) {
+		printf("Please stop port %d first\n", res->id);
 		return;
+	}
 
 	if (parse_and_check_speed_duplex(res->value1, res->value2,
 			&link_speed) < 0)
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:14.417958634 +0200
+++ 0035-app-testpmd-change-port-link-speed-without-stopping-.patch	2021-08-10 15:11:12.986637869 +0200
@@ -1 +1 @@
-From 8ec87289e5eb0af241e01dfded5b7b5e163c5b25 Mon Sep 17 00:00:00 2001
+From ed4de94768fbd47b0ce3b512e2bd93d79d20d75d Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 8ec87289e5eb0af241e01dfded5b7b5e163c5b25 ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
-index bfd2fb9240..8468018cf3 100644
+index 077d860401..3eedb82486 100644
@@ -25 +26 @@
-@@ -1619,13 +1619,13 @@ cmd_config_speed_specific_parsed(void *parsed_result,
+@@ -1704,13 +1704,13 @@ cmd_config_speed_specific_parsed(void *parsed_result,

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

* [dpdk-stable] patch 'crypto/qat: fix Arm build with special memcpy' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (33 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'app/testpmd: change port link speed without stopping all' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'app/crypto-perf: fix out-of-place mempool allocation' " christian.ehrhardt
                   ` (65 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Feifei Wang
  Cc: Ruifeng Wang, Honnappa Nagarahalli, Adam Dybkowski, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/a65cf4d87891d6f9ae9f3e140b6dd0171d3c6699

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From a65cf4d87891d6f9ae9f3e140b6dd0171d3c6699 Mon Sep 17 00:00:00 2001
From: Feifei Wang <feifei.wang2@arm.com>
Date: Fri, 21 May 2021 10:00:04 +0800
Subject: [PATCH] crypto/qat: fix Arm build with special memcpy
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit c316efc3cf90fba1b673373669096ad6a3e39cc4 ]

In Arm platform, when "RTE_ARCH_ARM64_MEMCPY" is set as true, gcc will
report variable uninitialized warning:

../drivers/crypto/qat/qat_sym_session.c: In function ‘partial_hash_compute’:
../lib/eal/include/generic/rte_byteorder.h:241:24: warning:
‘<U35a0>’ may be used uninitialized in this function
	[-Wmaybe-uninitialized]
	241 | #define rte_bswap32(x) __builtin_bswap32(x)
	...

This is because "digest" will be initialized by "rte_memcpy" function
rather than "memcpy" if "RTE_ARCH_ARM64_MEMCPY" is set as true.
Furthermore, 'rte_memcpy' will initialize 'digest' with two steps
by invoking rte_mov_x functions. For example:

partial_hash_sha1 -> rte_memcpy -> rte_memcpy_ge16_lt_128 ->
step 1: rte_mov16(dst,src )
step 2: rte_mov16(dst - 16 + n, src - 16 + n)

However, gcc compiler cannot identify this multi-step initialization,
then it will report warning.

To fix this, use "memset" to initialize "digest".

Fixes: cd7fc8a84b48 ("eal/arm64: optimize memcpy")

Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
---
 drivers/crypto/qat/qat_sym_session.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/crypto/qat/qat_sym_session.c b/drivers/crypto/qat/qat_sym_session.c
index 8545be2791..ab12c99716 100644
--- a/drivers/crypto/qat/qat_sym_session.c
+++ b/drivers/crypto/qat/qat_sym_session.c
@@ -1164,6 +1164,9 @@ static int partial_hash_compute(enum icp_qat_hw_auth_algo hash_alg,
 	uint64_t *hash_state_out_be64;
 	int i;
 
+	/* Initialize to avoid gcc warning */
+	memset(digest, 0, sizeof(digest));
+
 	digest_size = qat_hash_get_digest_size(hash_alg);
 	if (digest_size <= 0)
 		return -EFAULT;
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:14.463095664 +0200
+++ 0036-crypto-qat-fix-Arm-build-with-special-memcpy.patch	2021-08-10 15:11:12.986637869 +0200
@@ -1 +1 @@
-From c316efc3cf90fba1b673373669096ad6a3e39cc4 Mon Sep 17 00:00:00 2001
+From a65cf4d87891d6f9ae9f3e140b6dd0171d3c6699 Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit c316efc3cf90fba1b673373669096ad6a3e39cc4 ]
+
@@ -34 +35,0 @@
-Cc: stable@dpdk.org
@@ -45 +46 @@
-index 231b1640da..e22dd3600c 100644
+index 8545be2791..ab12c99716 100644
@@ -48 +49 @@
-@@ -1196,6 +1196,9 @@ static int partial_hash_compute(enum icp_qat_hw_auth_algo hash_alg,
+@@ -1164,6 +1164,9 @@ static int partial_hash_compute(enum icp_qat_hw_auth_algo hash_alg,

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

* [dpdk-stable] patch 'app/crypto-perf: fix out-of-place mempool allocation' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (34 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'crypto/qat: fix Arm build with special memcpy' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'test/crypto: fix mbuf reset after null check' " christian.ehrhardt
                   ` (64 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Kai Ji; +Cc: Fan Zhang, Pablo de Lara, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/c83dbe298320ae348fab74f302ec3b2389d0d179

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From c83dbe298320ae348fab74f302ec3b2389d0d179 Mon Sep 17 00:00:00 2001
From: Kai Ji <kai.ji@intel.com>
Date: Mon, 24 May 2021 17:46:27 +0100
Subject: [PATCH] app/crypto-perf: fix out-of-place mempool allocation

[ upstream commit c84e324e7ccb995b596c34a8a2c8a9c7cf51e3d2 ]

Add missing rte_mbuf size in mempool allocation for
out-of-place operation.

Fixes: bf9d6702eca9 ("app/crypto-perf: use single mempool")

Signed-off-by: Kai Ji <kai.ji@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 app/test-crypto-perf/cperf_test_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-crypto-perf/cperf_test_common.c b/app/test-crypto-perf/cperf_test_common.c
index 85603eed5b..b7347ad499 100644
--- a/app/test-crypto-perf/cperf_test_common.c
+++ b/app/test-crypto-perf/cperf_test_common.c
@@ -194,7 +194,7 @@ cperf_alloc_common_memory(const struct cperf_options *options,
 				(mbuf_size * segments_nb);
 		params.dst_buf_offset = *dst_buf_offset;
 		/* Destination buffer will be one segment only */
-		obj_size += max_size;
+		obj_size += max_size + sizeof(struct rte_mbuf);
 	}
 
 	*pool = rte_mempool_create_empty(pool_name,
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:14.496173624 +0200
+++ 0037-app-crypto-perf-fix-out-of-place-mempool-allocation.patch	2021-08-10 15:11:12.986637869 +0200
@@ -1 +1 @@
-From c84e324e7ccb995b596c34a8a2c8a9c7cf51e3d2 Mon Sep 17 00:00:00 2001
+From c83dbe298320ae348fab74f302ec3b2389d0d179 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit c84e324e7ccb995b596c34a8a2c8a9c7cf51e3d2 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index 058e0ba564..12925c7f22 100644
+index 85603eed5b..b7347ad499 100644

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

* [dpdk-stable] patch 'test/crypto: fix mbuf reset after null check' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (35 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'app/crypto-perf: fix out-of-place mempool allocation' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'test/crypto: fix typo in AES case' " christian.ehrhardt
                   ` (63 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Thierry Herbelot; +Cc: Akhil Goyal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/9ab830c078d0a89f1f604b5149935e0ed7b55d68

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 9ab830c078d0a89f1f604b5149935e0ed7b55d68 Mon Sep 17 00:00:00 2001
From: Thierry Herbelot <thierry.herbelot@6wind.com>
Date: Mon, 24 May 2021 11:01:13 +0200
Subject: [PATCH] test/crypto: fix mbuf reset after null check

[ upstream commit 2b81eb2c992b2e3728b8866cf6199cfd3b5fd776 ]

Use m only after it was checked not to be NULL.

Fixes: 202d375c60bc1 ("app/test: add cryptodev unit and performance tests")

Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
---
 app/test/test_cryptodev.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 1047c5e038..7686c7caec 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -112,10 +112,11 @@ setup_test_string(struct rte_mempool *mpool,
 	struct rte_mbuf *m = rte_pktmbuf_alloc(mpool);
 	size_t t_len = len - (blocksize ? (len % blocksize) : 0);
 
-	memset(m->buf_addr, 0, m->buf_len);
 	if (m) {
-		char *dst = rte_pktmbuf_append(m, t_len);
+		char *dst;
 
+		memset(m->buf_addr, 0, m->buf_len);
+		dst = rte_pktmbuf_append(m, t_len);
 		if (!dst) {
 			rte_pktmbuf_free(m);
 			return NULL;
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:14.529973531 +0200
+++ 0038-test-crypto-fix-mbuf-reset-after-null-check.patch	2021-08-10 15:11:12.994637927 +0200
@@ -1 +1 @@
-From 2b81eb2c992b2e3728b8866cf6199cfd3b5fd776 Mon Sep 17 00:00:00 2001
+From 9ab830c078d0a89f1f604b5149935e0ed7b55d68 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 2b81eb2c992b2e3728b8866cf6199cfd3b5fd776 ]
+
@@ -9 +10,0 @@
-Cc: stable@dpdk.org
@@ -18 +19 @@
-index ead8c6e3dc..dd1669e007 100644
+index 1047c5e038..7686c7caec 100644
@@ -21 +22 @@
-@@ -135,10 +135,11 @@ setup_test_string(struct rte_mempool *mpool,
+@@ -112,10 +112,11 @@ setup_test_string(struct rte_mempool *mpool,

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

* [dpdk-stable] patch 'test/crypto: fix typo in AES case' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (36 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'test/crypto: fix mbuf reset after null check' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'test/crypto: fix typo in ESN " christian.ehrhardt
                   ` (62 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Rebecca Troy; +Cc: Ciara Power, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/0fc9a8165447379f6eba18b2f634b008a37d2048

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 0fc9a8165447379f6eba18b2f634b008a37d2048 Mon Sep 17 00:00:00 2001
From: Rebecca Troy <rebecca.troy@intel.com>
Date: Thu, 1 Jul 2021 09:22:38 +0000
Subject: [PATCH] test/crypto: fix typo in AES case

[ upstream commit 9d33cad1f6b34a21a17f5ed0a56a5fbc13429b81 ]

Fixed typo in the testcase description for AES in the crypto
unit test suite by changing the word 'Scater' to 'Scatter'.

Fixes: c9c9c4ed8746 ("app/test: check scatter-gather for crypto drivers")

Signed-off-by: Rebecca Troy <rebecca.troy@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
---
 app/test/test_cryptodev_aes_test_vectors.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test/test_cryptodev_aes_test_vectors.h b/app/test/test_cryptodev_aes_test_vectors.h
index 66994b659a..2b5d4175c3 100644
--- a/app/test/test_cryptodev_aes_test_vectors.h
+++ b/app/test/test_cryptodev_aes_test_vectors.h
@@ -2212,7 +2212,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
 			BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX2
 	},
 	{
-		.test_descr = "AES-192-CBC Encryption Scater gather",
+		.test_descr = "AES-192-CBC Encryption Scatter gather",
 		.test_data = &aes_test_data_10,
 		.op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT,
 		.feature_mask = BLOCKCIPHER_TEST_FEATURE_SG |
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:14.567808907 +0200
+++ 0039-test-crypto-fix-typo-in-AES-case.patch	2021-08-10 15:11:12.998637955 +0200
@@ -1 +1 @@
-From 9d33cad1f6b34a21a17f5ed0a56a5fbc13429b81 Mon Sep 17 00:00:00 2001
+From 0fc9a8165447379f6eba18b2f634b008a37d2048 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 9d33cad1f6b34a21a17f5ed0a56a5fbc13429b81 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
-index ec53874d9f..e404050701 100644
+index 66994b659a..2b5d4175c3 100644
@@ -22,2 +23,2 @@
-@@ -3223,7 +3223,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
- 		.op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT,
+@@ -2212,7 +2212,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
+ 			BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX2

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

* [dpdk-stable] patch 'test/crypto: fix typo in ESN case' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (37 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'test/crypto: fix typo in AES case' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'crypto/mvsam: fix AES-GCM session parameters' " christian.ehrhardt
                   ` (61 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Rebecca Troy; +Cc: Hemant Agrawal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/8d9d3a44d10bcd2b6cf1638af70819fa1585d0ed

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 8d9d3a44d10bcd2b6cf1638af70819fa1585d0ed Mon Sep 17 00:00:00 2001
From: Rebecca Troy <rebecca.troy@intel.com>
Date: Thu, 1 Jul 2021 10:39:09 +0000
Subject: [PATCH] test/crypto: fix typo in ESN case

[ upstream commit 5da550e4408e03a7f06dfcfa9639ce969d141d73 ]

Fixed typo in the crypto unit test ESN function name by
replacing the word 'encryt' with the correct word 'encrypt'.

test_authenticated_encryt_with_esn is now called
test_authenticated_encrypt_with_esn.

Fixes: 699741912d71 ("test/crypto: add case for auth only trailer")

Signed-off-by: Rebecca Troy <rebecca.troy@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 app/test/test_cryptodev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 7686c7caec..42c573664b 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -11212,7 +11212,7 @@ test_authenticated_decryption_fail_when_corruption(
 }
 
 static int
-test_authenticated_encryt_with_esn(
+test_authenticated_encrypt_with_esn(
 		struct crypto_testsuite_params *ts_params,
 		struct crypto_unittest_params *ut_params,
 		const struct test_crypto_vector *reference)
@@ -11877,7 +11877,7 @@ auth_decryption_AES128CBC_HMAC_SHA1_fail_tag_corrupt(void)
 static int
 auth_encrypt_AES128CBC_HMAC_SHA1_esn_check(void)
 {
-	return test_authenticated_encryt_with_esn(
+	return test_authenticated_encrypt_with_esn(
 			&testsuite_params,
 			&unittest_params,
 			&aes128cbc_hmac_sha1_aad_test_vector);
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:14.601284642 +0200
+++ 0040-test-crypto-fix-typo-in-ESN-case.patch	2021-08-10 15:11:13.006638012 +0200
@@ -1 +1 @@
-From 5da550e4408e03a7f06dfcfa9639ce969d141d73 Mon Sep 17 00:00:00 2001
+From 8d9d3a44d10bcd2b6cf1638af70819fa1585d0ed Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 5da550e4408e03a7f06dfcfa9639ce969d141d73 ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
-index 2a55534dae..2fa720d7b2 100644
+index 7686c7caec..42c573664b 100644
@@ -25 +26 @@
-@@ -12602,7 +12602,7 @@ test_authenticated_decryption_fail_when_corruption(
+@@ -11212,7 +11212,7 @@ test_authenticated_decryption_fail_when_corruption(
@@ -34 +35 @@
-@@ -13389,7 +13389,7 @@ auth_decryption_AES128CBC_HMAC_SHA1_fail_tag_corrupt(void)
+@@ -11877,7 +11877,7 @@ auth_decryption_AES128CBC_HMAC_SHA1_fail_tag_corrupt(void)

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

* [dpdk-stable] patch 'crypto/mvsam: fix AES-GCM session parameters' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (38 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'test/crypto: fix typo in ESN " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'crypto/mvsam: fix capabilities' " christian.ehrhardt
                   ` (60 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Dana Vardi; +Cc: Liron Himi, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/d127198bed96dc5c8fd6b5602ca0c0f854ff72c8

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From d127198bed96dc5c8fd6b5602ca0c0f854ff72c8 Mon Sep 17 00:00:00 2001
From: Dana Vardi <danat@marvell.com>
Date: Thu, 1 Jul 2021 09:58:12 +0300
Subject: [PATCH] crypto/mvsam: fix AES-GCM session parameters

[ upstream commit 22918d8400dc9e69ce889aed03066c4547e3fae6 ]

For AEAD session and AES-GCM mode, IV offset will
set to include the Nonce.
In addition, the following operations order will define:
first encryption and then authentication.

Fixes: 8a61c83af2fa ("crypto/mrvl: add mrvl crypto driver")

Signed-off-by: Dana Vardi <danat@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Tested-by: Liron Himi <lironh@marvell.com>
---
 drivers/crypto/mvsam/rte_mrvl_pmd.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/crypto/mvsam/rte_mrvl_pmd.c b/drivers/crypto/mvsam/rte_mrvl_pmd.c
index 63782ce974..e01b357943 100644
--- a/drivers/crypto/mvsam/rte_mrvl_pmd.c
+++ b/drivers/crypto/mvsam/rte_mrvl_pmd.c
@@ -361,6 +361,14 @@ mrvl_crypto_set_aead_session_parameters(struct mrvl_crypto_session *sess,
 	sess->sam_sess_params.cipher_mode =
 		aead_map[aead_xform->aead.algo].cipher_mode;
 
+	if (sess->sam_sess_params.cipher_mode == SAM_CIPHER_GCM) {
+		/* IV must include nonce for all counter modes */
+		sess->cipher_iv_offset = aead_xform->cipher.iv.offset;
+
+		/* Set order of authentication then encryption to 0 in GCM */
+		sess->sam_sess_params.u.basic.auth_then_encrypt = 0;
+	}
+
 	/* Assume IV will be passed together with data. */
 	sess->sam_sess_params.cipher_iv = NULL;
 
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:14.644458162 +0200
+++ 0041-crypto-mvsam-fix-AES-GCM-session-parameters.patch	2021-08-10 15:11:13.006638012 +0200
@@ -1 +1 @@
-From 22918d8400dc9e69ce889aed03066c4547e3fae6 Mon Sep 17 00:00:00 2001
+From d127198bed96dc5c8fd6b5602ca0c0f854ff72c8 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 22918d8400dc9e69ce889aed03066c4547e3fae6 ]
+
@@ -12 +13,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
-index b2cfa710f5..ba5cb28654 100644
+index 63782ce974..e01b357943 100644
@@ -25 +26 @@
-@@ -360,6 +360,14 @@ mrvl_crypto_set_aead_session_parameters(struct mrvl_crypto_session *sess,
+@@ -361,6 +361,14 @@ mrvl_crypto_set_aead_session_parameters(struct mrvl_crypto_session *sess,

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

* [dpdk-stable] patch 'crypto/mvsam: fix capabilities' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (39 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'crypto/mvsam: fix AES-GCM session parameters' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'crypto/mvsam: fix session data reset' " christian.ehrhardt
                   ` (59 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Michael Shamis; +Cc: Liron Himi, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/819f3a8a413a953a259af03f0b9ce7d5af5f080c

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 819f3a8a413a953a259af03f0b9ce7d5af5f080c Mon Sep 17 00:00:00 2001
From: Michael Shamis <michaelsh@marvell.com>
Date: Thu, 1 Jul 2021 09:58:53 +0300
Subject: [PATCH] crypto/mvsam: fix capabilities

[ upstream commit 62f7513e2a2a7677b1f335e53c44316f171511e0 ]

Increased AAD max size up to 64B and allowed AAD increment step
1B according to EIP197 token HW limitation.
In addition, some capabilities were found incorrect due to
running FIPS tests. The patch fix the capabilities.

Fixes: 8a61c83af2f ("crypto/mrvl: add mrvl crypto driver")
Fixes: 2c22aa4f8f6 ("crypto/mvsam: update hash digest sizes")
Fixes: a84226fc055 ("crypto/mvsam: support HMAC SHA224")

Signed-off-by: Michael Shamis <michaelsh@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Tested-by: Liron Himi <lironh@marvell.com>
---
 drivers/crypto/mvsam/rte_mrvl_pmd_ops.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c b/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
index 2dfaa0b113..bf9c1200ef 100644
--- a/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
+++ b/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
@@ -111,7 +111,7 @@ static const struct rte_cryptodev_capabilities
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 28,
+					.min = 12,
 					.max = 28,
 					.increment = 0
 				},
@@ -232,7 +232,7 @@ static const struct rte_cryptodev_capabilities
 				},
 				.digest_size = {
 					.min = 12,
-					.max = 48,
+					.max = 64,
 					.increment = 4
 				},
 			}, }
@@ -252,7 +252,7 @@ static const struct rte_cryptodev_capabilities
 				},
 				.digest_size = {
 					.min = 12,
-					.max = 48,
+					.max = 64,
 					.increment = 0
 				},
 			}, }
@@ -336,9 +336,9 @@ static const struct rte_cryptodev_capabilities
 					.increment = 0
 				},
 				.aad_size = {
-					.min = 8,
-					.max = 12,
-					.increment = 4
+					.min = 0,
+					.max = 64,
+					.increment = 1
 				},
 				.iv_size = {
 					.min = 12,
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:14.678763501 +0200
+++ 0042-crypto-mvsam-fix-capabilities.patch	2021-08-10 15:11:13.006638012 +0200
@@ -1 +1 @@
-From 62f7513e2a2a7677b1f335e53c44316f171511e0 Mon Sep 17 00:00:00 2001
+From 819f3a8a413a953a259af03f0b9ce7d5af5f080c Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 62f7513e2a2a7677b1f335e53c44316f171511e0 ]
+
@@ -14 +15,0 @@
-Cc: stable@dpdk.org
@@ -24 +25 @@
-index c61bdca369..527ddef0cf 100644
+index 2dfaa0b113..bf9c1200ef 100644

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

* [dpdk-stable] patch 'crypto/mvsam: fix session data reset' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (40 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'crypto/mvsam: fix capabilities' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'crypto/mvsam: fix options parsing' " christian.ehrhardt
                   ` (58 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Dana Vardi; +Cc: Michael Shamis, Liron Himi, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/ed613ddf67e692bf43cb0d5cfd4a58a46ff9b439

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From ed613ddf67e692bf43cb0d5cfd4a58a46ff9b439 Mon Sep 17 00:00:00 2001
From: Dana Vardi <danat@marvell.com>
Date: Thu, 1 Jul 2021 09:59:20 +0300
Subject: [PATCH] crypto/mvsam: fix session data reset

[ upstream commit 03e73e8572f112bd3714cd90c491a6570330189c ]

This patch fix wrong clear memory session pointer.

When call mrvl_crypto_pmd_sym_session_clear function,
it might cause the following error:
CRYPTODEV: set_sym_session_private_data() line 497:
Set private data for driver 1 not allowed

This fix set zeroes to mrvl_crypto_session pointer instead to
rte_cryptodev_sym_session pointer, and will verify that
rte_cryptodev_sym_session pointer will not lose data such as
nb_drivers.

Bugzilla ID: 646
Fixes: 8a61c83af2fa ("crypto/mrvl: add mrvl crypto driver")

Signed-off-by: Dana Vardi <danat@marvell.com>
Reviewed-by: Michael Shamis <michaelsh@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
---
 drivers/crypto/mvsam/rte_mrvl_pmd_ops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c b/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
index bf9c1200ef..f92a97bd31 100644
--- a/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
+++ b/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
@@ -804,7 +804,7 @@ mrvl_crypto_pmd_sym_session_clear(struct rte_cryptodev *dev,
 			MRVL_LOG(ERR, "Error while destroying session!");
 		}
 
-		memset(sess, 0, sizeof(struct mrvl_crypto_session));
+		memset(mrvl_sess, 0, sizeof(struct mrvl_crypto_session));
 		struct rte_mempool *sess_mp = rte_mempool_from_obj(sess_priv);
 		set_sym_session_private_data(sess, index, NULL);
 		rte_mempool_put(sess_mp, sess_priv);
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:14.711775103 +0200
+++ 0043-crypto-mvsam-fix-session-data-reset.patch	2021-08-10 15:11:13.006638012 +0200
@@ -1 +1 @@
-From 03e73e8572f112bd3714cd90c491a6570330189c Mon Sep 17 00:00:00 2001
+From ed613ddf67e692bf43cb0d5cfd4a58a46ff9b439 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 03e73e8572f112bd3714cd90c491a6570330189c ]
+
@@ -20 +21,0 @@
-Cc: stable@dpdk.org
@@ -30 +31 @@
-index 527ddef0cf..4eb7ec97d1 100644
+index bf9c1200ef..f92a97bd31 100644
@@ -33 +34 @@
-@@ -793,7 +793,7 @@ mrvl_crypto_pmd_sym_session_clear(struct rte_cryptodev *dev,
+@@ -804,7 +804,7 @@ mrvl_crypto_pmd_sym_session_clear(struct rte_cryptodev *dev,

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

* [dpdk-stable] patch 'crypto/mvsam: fix options parsing' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (41 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'crypto/mvsam: fix session data reset' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'ipc: stop mp control thread on cleanup' " christian.ehrhardt
                   ` (57 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Dana Vardi; +Cc: Liron Himi, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/538280baa1406ded07bb1e591642d547823f2cc6

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 538280baa1406ded07bb1e591642d547823f2cc6 Mon Sep 17 00:00:00 2001
From: Dana Vardi <danat@marvell.com>
Date: Thu, 1 Jul 2021 10:00:43 +0300
Subject: [PATCH] crypto/mvsam: fix options parsing

[ upstream commit 325ce224ffd16d67d5370c2f28a267aabd6690a9 ]

This patch fix the input arguments assignment to the correct
parameters in mrvl_pmd_init_params struct.

Fixes: 25b05a1c806 ("crypto/mvsam: parse max number of sessions")

Signed-off-by: Dana Vardi <danat@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
---
 drivers/crypto/mvsam/rte_mrvl_pmd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/mvsam/rte_mrvl_pmd.c b/drivers/crypto/mvsam/rte_mrvl_pmd.c
index e01b357943..e335ca7ba1 100644
--- a/drivers/crypto/mvsam/rte_mrvl_pmd.c
+++ b/drivers/crypto/mvsam/rte_mrvl_pmd.c
@@ -925,14 +925,14 @@ mrvl_pmd_parse_input_args(struct mrvl_pmd_init_params *params,
 		ret = rte_kvargs_process(kvlist,
 					 RTE_CRYPTODEV_PMD_NAME_ARG,
 					 &parse_name_arg,
-					 &params->common);
+					 &params->common.name);
 		if (ret < 0)
 			goto free_kvlist;
 
 		ret = rte_kvargs_process(kvlist,
 					 MRVL_PMD_MAX_NB_SESS_ARG,
 					 &parse_integer_arg,
-					 params);
+					 &params->max_nb_sessions);
 		if (ret < 0)
 			goto free_kvlist;
 
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:14.743769017 +0200
+++ 0044-crypto-mvsam-fix-options-parsing.patch	2021-08-10 15:11:13.006638012 +0200
@@ -1 +1 @@
-From 325ce224ffd16d67d5370c2f28a267aabd6690a9 Mon Sep 17 00:00:00 2001
+From 538280baa1406ded07bb1e591642d547823f2cc6 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 325ce224ffd16d67d5370c2f28a267aabd6690a9 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
-index ba5cb28654..b82533ef42 100644
+index e01b357943..e335ca7ba1 100644
@@ -22 +23 @@
-@@ -924,14 +924,14 @@ mrvl_pmd_parse_input_args(struct mrvl_pmd_init_params *params,
+@@ -925,14 +925,14 @@ mrvl_pmd_parse_input_args(struct mrvl_pmd_init_params *params,

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

* [dpdk-stable] patch 'ipc: stop mp control thread on cleanup' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (42 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'crypto/mvsam: fix options parsing' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'power: fix namespace for internal struct' " christian.ehrhardt
                   ` (56 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: David Marchand; +Cc: Owen Hilyard, Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/b39b348769f1fe968957001523d57d973ee0eb3c

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From b39b348769f1fe968957001523d57d973ee0eb3c Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Wed, 7 Jul 2021 13:02:29 +0200
Subject: [PATCH] ipc: stop mp control thread on cleanup

[ upstream commit e7885281ded1dbda63dcf3f6eb3640131113a6eb ]

When calling rte_eal_cleanup, the mp channel cleanup routine only sets
mp_fd to -1 leaving the rte_mp_handle control thread running.
This control thread can spew warnings on reading on an invalid fd.
This is especially noticed with ASAN enabled.

To handle this situation, set mp_fd to -1 to signal the control thread
it should exit, but since this thread might be sleeping on the socket,
cancel the thread too.

Fixes: 85d6815fa6d0 ("eal: close multi-process socket during cleanup")

Reported-by: Owen Hilyard <ohilyard@iol.unh.edu>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 lib/librte_eal/common/eal_common_proc.c | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/lib/librte_eal/common/eal_common_proc.c b/lib/librte_eal/common/eal_common_proc.c
index 922569f3f5..ac2ddb01a5 100644
--- a/lib/librte_eal/common/eal_common_proc.c
+++ b/lib/librte_eal/common/eal_common_proc.c
@@ -34,6 +34,7 @@
 #include "eal_internal_cfg.h"
 
 static int mp_fd = -1;
+static pthread_t mp_handle_tid;
 static char mp_filter[PATH_MAX];   /* Filter for secondary process sockets */
 static char mp_dir_path[PATH_MAX]; /* The directory path for all mp sockets */
 static pthread_mutex_t mp_mutex_action = PTHREAD_MUTEX_INITIALIZER;
@@ -376,7 +377,7 @@ mp_handle(void *arg __rte_unused)
 	struct mp_msg_internal msg;
 	struct sockaddr_un sa;
 
-	while (1) {
+	while (mp_fd >= 0) {
 		if (read_msg(&msg, &sa) == 0)
 			process_msg(&msg, &sa);
 	}
@@ -560,14 +561,11 @@ open_socket_fd(void)
 }
 
 static void
-close_socket_fd(void)
+close_socket_fd(int fd)
 {
 	char path[PATH_MAX];
 
-	if (mp_fd < 0)
-		return;
-
-	close(mp_fd);
+	close(fd);
 	create_socket_path(peer_name, path, sizeof(path));
 	unlink(path);
 }
@@ -577,7 +575,6 @@ rte_mp_channel_init(void)
 {
 	char path[PATH_MAX];
 	int dir_fd;
-	pthread_t mp_handle_tid;
 
 	/* in no shared files mode, we do not have secondary processes support,
 	 * so no need to initialize IPC.
@@ -636,7 +633,16 @@ rte_mp_channel_init(void)
 void
 rte_mp_channel_cleanup(void)
 {
-	close_socket_fd();
+	int fd;
+
+	if (mp_fd < 0)
+		return;
+
+	fd = mp_fd;
+	mp_fd = -1;
+	pthread_cancel(mp_handle_tid);
+	pthread_join(mp_handle_tid, NULL);
+	close_socket_fd(fd);
 }
 
 /**
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:14.776332726 +0200
+++ 0045-ipc-stop-mp-control-thread-on-cleanup.patch	2021-08-10 15:11:13.010638042 +0200
@@ -1 +1 @@
-From e7885281ded1dbda63dcf3f6eb3640131113a6eb Mon Sep 17 00:00:00 2001
+From b39b348769f1fe968957001523d57d973ee0eb3c Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit e7885281ded1dbda63dcf3f6eb3640131113a6eb ]
+
@@ -16 +17,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
- lib/eal/common/eal_common_proc.c | 22 ++++++++++++++--------
+ lib/librte_eal/common/eal_common_proc.c | 22 ++++++++++++++--------
@@ -25,5 +26,5 @@
-diff --git a/lib/eal/common/eal_common_proc.c b/lib/eal/common/eal_common_proc.c
-index dc4a2efa82..ebd0f6673b 100644
---- a/lib/eal/common/eal_common_proc.c
-+++ b/lib/eal/common/eal_common_proc.c
-@@ -35,6 +35,7 @@
+diff --git a/lib/librte_eal/common/eal_common_proc.c b/lib/librte_eal/common/eal_common_proc.c
+index 922569f3f5..ac2ddb01a5 100644
+--- a/lib/librte_eal/common/eal_common_proc.c
++++ b/lib/librte_eal/common/eal_common_proc.c
+@@ -34,6 +34,7 @@
@@ -37 +38 @@
-@@ -383,7 +384,7 @@ mp_handle(void *arg __rte_unused)
+@@ -376,7 +377,7 @@ mp_handle(void *arg __rte_unused)
@@ -46 +47 @@
-@@ -567,14 +568,11 @@ open_socket_fd(void)
+@@ -560,14 +561,11 @@ open_socket_fd(void)
@@ -63 +64 @@
-@@ -584,7 +582,6 @@ rte_mp_channel_init(void)
+@@ -577,7 +575,6 @@ rte_mp_channel_init(void)
@@ -68,2 +68,0 @@
- 	const struct internal_config *internal_conf =
- 		eal_get_internal_configuration();
@@ -71 +70,3 @@
-@@ -645,7 +642,16 @@ rte_mp_channel_init(void)
+ 	/* in no shared files mode, we do not have secondary processes support,
+ 	 * so no need to initialize IPC.
+@@ -636,7 +633,16 @@ rte_mp_channel_init(void)

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

* [dpdk-stable] patch 'power: fix namespace for internal struct' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (43 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'ipc: stop mp control thread on cleanup' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/bnxt: cleanup code' " christian.ehrhardt
                   ` (55 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Anatoly Burakov; +Cc: David Hunt, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/4b0cbc869ae8c882ab15d1c8ae8247832afe05da

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 4b0cbc869ae8c882ab15d1c8ae8247832afe05da Mon Sep 17 00:00:00 2001
From: Anatoly Burakov <anatoly.burakov@intel.com>
Date: Thu, 8 Jul 2021 16:38:22 +0100
Subject: [PATCH] power: fix namespace for internal struct

[ upstream commit 02a6d683113428f87e2375ba249b9c40ae46ff79 ]

Currently, ACPI code uses rte_power_info as the struct name, which
gives the appearance that this is an externally visible API. Fix to
use internal namespace.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
---
 lib/librte_power/power_acpi_cpufreq.c | 34 +++++++++++++--------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/lib/librte_power/power_acpi_cpufreq.c b/lib/librte_power/power_acpi_cpufreq.c
index 63859bcd70..9b31112348 100644
--- a/lib/librte_power/power_acpi_cpufreq.c
+++ b/lib/librte_power/power_acpi_cpufreq.c
@@ -78,7 +78,7 @@ enum power_state {
 /**
  * Power info per lcore.
  */
-struct rte_power_info {
+struct acpi_power_info {
 	unsigned int lcore_id;                   /**< Logical core id */
 	uint32_t freqs[RTE_MAX_LCORE_FREQS]; /**< Frequency array */
 	uint32_t nb_freqs;                   /**< number of available freqs */
@@ -90,14 +90,14 @@ struct rte_power_info {
 	uint16_t turbo_enable;               /**< Turbo Boost enable/disable */
 } __rte_cache_aligned;
 
-static struct rte_power_info lcore_power_info[RTE_MAX_LCORE];
+static struct acpi_power_info lcore_power_info[RTE_MAX_LCORE];
 
 /**
  * It is to set specific freq for specific logical core, according to the index
  * of supported frequencies.
  */
 static int
-set_freq_internal(struct rte_power_info *pi, uint32_t idx)
+set_freq_internal(struct acpi_power_info *pi, uint32_t idx)
 {
 	if (idx >= RTE_MAX_LCORE_FREQS || idx >= pi->nb_freqs) {
 		RTE_LOG(ERR, POWER, "Invalid frequency index %u, which "
@@ -133,7 +133,7 @@ set_freq_internal(struct rte_power_info *pi, uint32_t idx)
  * governor will be saved for rolling back.
  */
 static int
-power_set_governor_userspace(struct rte_power_info *pi)
+power_set_governor_userspace(struct acpi_power_info *pi)
 {
 	FILE *f;
 	int ret = -1;
@@ -189,7 +189,7 @@ out:
  * sys file.
  */
 static int
-power_get_available_freqs(struct rte_power_info *pi)
+power_get_available_freqs(struct acpi_power_info *pi)
 {
 	FILE *f;
 	int ret = -1, i, count;
@@ -259,7 +259,7 @@ out:
  * It is to fopen the sys file for the future setting the lcore frequency.
  */
 static int
-power_init_for_setting_freq(struct rte_power_info *pi)
+power_init_for_setting_freq(struct acpi_power_info *pi)
 {
 	FILE *f;
 	char fullpath[PATH_MAX];
@@ -293,7 +293,7 @@ out:
 int
 power_acpi_cpufreq_init(unsigned int lcore_id)
 {
-	struct rte_power_info *pi;
+	struct acpi_power_info *pi;
 
 	if (lcore_id >= RTE_MAX_LCORE) {
 		RTE_LOG(ERR, POWER, "Lcore id %u can not exceeds %u\n",
@@ -355,7 +355,7 @@ fail:
  * needed by writing the sys file.
  */
 static int
-power_set_governor_original(struct rte_power_info *pi)
+power_set_governor_original(struct acpi_power_info *pi)
 {
 	FILE *f;
 	int ret = -1;
@@ -401,7 +401,7 @@ out:
 int
 power_acpi_cpufreq_exit(unsigned int lcore_id)
 {
-	struct rte_power_info *pi;
+	struct acpi_power_info *pi;
 
 	if (lcore_id >= RTE_MAX_LCORE) {
 		RTE_LOG(ERR, POWER, "Lcore id %u can not exceeds %u\n",
@@ -443,7 +443,7 @@ fail:
 uint32_t
 power_acpi_cpufreq_freqs(unsigned int lcore_id, uint32_t *freqs, uint32_t num)
 {
-	struct rte_power_info *pi;
+	struct acpi_power_info *pi;
 
 	if (lcore_id >= RTE_MAX_LCORE) {
 		RTE_LOG(ERR, POWER, "Invalid lcore ID\n");
@@ -490,7 +490,7 @@ power_acpi_cpufreq_set_freq(unsigned int lcore_id, uint32_t index)
 int
 power_acpi_cpufreq_freq_down(unsigned int lcore_id)
 {
-	struct rte_power_info *pi;
+	struct acpi_power_info *pi;
 
 	if (lcore_id >= RTE_MAX_LCORE) {
 		RTE_LOG(ERR, POWER, "Invalid lcore ID\n");
@@ -508,7 +508,7 @@ power_acpi_cpufreq_freq_down(unsigned int lcore_id)
 int
 power_acpi_cpufreq_freq_up(unsigned int lcore_id)
 {
-	struct rte_power_info *pi;
+	struct acpi_power_info *pi;
 
 	if (lcore_id >= RTE_MAX_LCORE) {
 		RTE_LOG(ERR, POWER, "Invalid lcore ID\n");
@@ -549,7 +549,7 @@ power_acpi_cpufreq_freq_max(unsigned int lcore_id)
 int
 power_acpi_cpufreq_freq_min(unsigned int lcore_id)
 {
-	struct rte_power_info *pi;
+	struct acpi_power_info *pi;
 
 	if (lcore_id >= RTE_MAX_LCORE) {
 		RTE_LOG(ERR, POWER, "Invalid lcore ID\n");
@@ -566,7 +566,7 @@ power_acpi_cpufreq_freq_min(unsigned int lcore_id)
 int
 power_acpi_turbo_status(unsigned int lcore_id)
 {
-	struct rte_power_info *pi;
+	struct acpi_power_info *pi;
 
 	if (lcore_id >= RTE_MAX_LCORE) {
 		RTE_LOG(ERR, POWER, "Invalid lcore ID\n");
@@ -582,7 +582,7 @@ power_acpi_turbo_status(unsigned int lcore_id)
 int
 power_acpi_enable_turbo(unsigned int lcore_id)
 {
-	struct rte_power_info *pi;
+	struct acpi_power_info *pi;
 
 	if (lcore_id >= RTE_MAX_LCORE) {
 		RTE_LOG(ERR, POWER, "Invalid lcore ID\n");
@@ -615,7 +615,7 @@ power_acpi_enable_turbo(unsigned int lcore_id)
 int
 power_acpi_disable_turbo(unsigned int lcore_id)
 {
-	struct rte_power_info *pi;
+	struct acpi_power_info *pi;
 
 	if (lcore_id >= RTE_MAX_LCORE) {
 		RTE_LOG(ERR, POWER, "Invalid lcore ID\n");
@@ -642,7 +642,7 @@ power_acpi_disable_turbo(unsigned int lcore_id)
 int power_acpi_get_capabilities(unsigned int lcore_id,
 		struct rte_power_core_capabilities *caps)
 {
-	struct rte_power_info *pi;
+	struct acpi_power_info *pi;
 
 	if (lcore_id >= RTE_MAX_LCORE) {
 		RTE_LOG(ERR, POWER, "Invalid lcore ID\n");
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:14.810048247 +0200
+++ 0046-power-fix-namespace-for-internal-struct.patch	2021-08-10 15:11:13.010638042 +0200
@@ -1 +1 @@
-From 02a6d683113428f87e2375ba249b9c40ae46ff79 Mon Sep 17 00:00:00 2001
+From 4b0cbc869ae8c882ab15d1c8ae8247832afe05da Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 02a6d683113428f87e2375ba249b9c40ae46ff79 ]
+
@@ -13 +15 @@
- lib/power/power_acpi_cpufreq.c | 34 +++++++++++++++++-----------------
+ lib/librte_power/power_acpi_cpufreq.c | 34 +++++++++++++--------------
@@ -16,4 +18,4 @@
-diff --git a/lib/power/power_acpi_cpufreq.c b/lib/power/power_acpi_cpufreq.c
-index d028a9947f..1b8c69cc8b 100644
---- a/lib/power/power_acpi_cpufreq.c
-+++ b/lib/power/power_acpi_cpufreq.c
+diff --git a/lib/librte_power/power_acpi_cpufreq.c b/lib/librte_power/power_acpi_cpufreq.c
+index 63859bcd70..9b31112348 100644
+--- a/lib/librte_power/power_acpi_cpufreq.c
++++ b/lib/librte_power/power_acpi_cpufreq.c
@@ -73 +75 @@
-@@ -299,7 +299,7 @@ power_acpi_cpufreq_check_supported(void)
+@@ -293,7 +293,7 @@ out:
@@ -79 +80,0 @@
- 	uint32_t exp_state;
@@ -82 +83,2 @@
-@@ -374,7 +374,7 @@ fail:
+ 		RTE_LOG(ERR, POWER, "Lcore id %u can not exceeds %u\n",
+@@ -355,7 +355,7 @@ fail:
@@ -91 +93 @@
-@@ -420,7 +420,7 @@ out:
+@@ -401,7 +401,7 @@ out:
@@ -97 +98,0 @@
- 	uint32_t exp_state;
@@ -100 +101,2 @@
-@@ -475,7 +475,7 @@ fail:
+ 		RTE_LOG(ERR, POWER, "Lcore id %u can not exceeds %u\n",
+@@ -443,7 +443,7 @@ fail:
@@ -109 +111 @@
-@@ -522,7 +522,7 @@ power_acpi_cpufreq_set_freq(unsigned int lcore_id, uint32_t index)
+@@ -490,7 +490,7 @@ power_acpi_cpufreq_set_freq(unsigned int lcore_id, uint32_t index)
@@ -118 +120 @@
-@@ -540,7 +540,7 @@ power_acpi_cpufreq_freq_down(unsigned int lcore_id)
+@@ -508,7 +508,7 @@ power_acpi_cpufreq_freq_down(unsigned int lcore_id)
@@ -127 +129 @@
-@@ -581,7 +581,7 @@ power_acpi_cpufreq_freq_max(unsigned int lcore_id)
+@@ -549,7 +549,7 @@ power_acpi_cpufreq_freq_max(unsigned int lcore_id)
@@ -136 +138 @@
-@@ -598,7 +598,7 @@ power_acpi_cpufreq_freq_min(unsigned int lcore_id)
+@@ -566,7 +566,7 @@ power_acpi_cpufreq_freq_min(unsigned int lcore_id)
@@ -145 +147 @@
-@@ -614,7 +614,7 @@ power_acpi_turbo_status(unsigned int lcore_id)
+@@ -582,7 +582,7 @@ power_acpi_turbo_status(unsigned int lcore_id)
@@ -154 +156 @@
-@@ -647,7 +647,7 @@ power_acpi_enable_turbo(unsigned int lcore_id)
+@@ -615,7 +615,7 @@ power_acpi_enable_turbo(unsigned int lcore_id)
@@ -163 +165 @@
-@@ -674,7 +674,7 @@ power_acpi_disable_turbo(unsigned int lcore_id)
+@@ -642,7 +642,7 @@ power_acpi_disable_turbo(unsigned int lcore_id)

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

* [dpdk-stable] patch 'net/bnxt: cleanup code' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (44 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'power: fix namespace for internal struct' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/bnxt: fix typo in log message' " christian.ehrhardt
                   ` (54 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Kalesh AP; +Cc: Ajit Khaparde, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/f21240d13a040bf074c17e4fe269050cce8c7848

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From f21240d13a040bf074c17e4fe269050cce8c7848 Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Date: Wed, 9 Jun 2021 08:43:29 +0530
Subject: [PATCH] net/bnxt: cleanup code

[ upstream commit 8879ece56832b7f2dd5e5ee10f36e848089f09df ]

This is a cleanup commit and no functional change.

1. use macros instead of hard coded values
2. remove unnecessary comments

Fixes: 5cd0e2889c43 ("net/bnxt: support NIC Partitioning")
Fixes: 2ba07b7dbd9d ("net/bnxt: set the hash key size")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 3 +--
 drivers/net/bnxt/bnxt_hwrm.c   | 5 ++---
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 7f5045c55f..90cee73e51 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -530,7 +530,7 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
 	dev_info->max_rx_queues = max_rx_rings;
 	dev_info->max_tx_queues = max_rx_rings;
 	dev_info->reta_size = bnxt_rss_hash_tbl_size(bp);
-	dev_info->hash_key_size = 40;
+	dev_info->hash_key_size = HW_HASH_KEY_SIZE;
 	max_vnics = bp->max_vnics;
 
 	/* MTU specifics */
@@ -1469,7 +1469,6 @@ static int bnxt_reta_query_op(struct rte_eth_dev *eth_dev,
 	if (rc)
 		return rc;
 
-	/* Retrieve from the default VNIC */
 	if (!vnic)
 		return -EINVAL;
 	if (!vnic->rss_table)
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 0701347003..23c5f7c3a2 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -2938,7 +2938,6 @@ error:
 	return rc;
 }
 
-/* JIRA 22088 */
 int bnxt_hwrm_func_qcfg(struct bnxt *bp, uint16_t *mtu)
 {
 	struct hwrm_func_qcfg_input req = {0};
@@ -2953,8 +2952,8 @@ int bnxt_hwrm_func_qcfg(struct bnxt *bp, uint16_t *mtu)
 
 	HWRM_CHECK_RESULT();
 
-	/* Hard Coded.. 0xfff VLAN ID mask */
-	bp->vlan = rte_le_to_cpu_16(resp->vlan) & 0xfff;
+	bp->vlan = rte_le_to_cpu_16(resp->vlan) & ETH_VLAN_ID_MAX;
+
 	flags = rte_le_to_cpu_16(resp->flags);
 	if (BNXT_PF(bp) && (flags & HWRM_FUNC_QCFG_OUTPUT_FLAGS_MULTI_HOST))
 		bp->flags |= BNXT_FLAG_MULTI_HOST;
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:14.844513926 +0200
+++ 0047-net-bnxt-cleanup-code.patch	2021-08-10 15:11:13.018638100 +0200
@@ -1 +1 @@
-From 8879ece56832b7f2dd5e5ee10f36e848089f09df Mon Sep 17 00:00:00 2001
+From f21240d13a040bf074c17e4fe269050cce8c7848 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 8879ece56832b7f2dd5e5ee10f36e848089f09df ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -19,2 +20,2 @@
- drivers/net/bnxt/bnxt_hwrm.c   | 4 +---
- 2 files changed, 2 insertions(+), 5 deletions(-)
+ drivers/net/bnxt/bnxt_hwrm.c   | 5 ++---
+ 2 files changed, 3 insertions(+), 5 deletions(-)
@@ -23 +24 @@
-index 1579d797ce..e7fc254173 100644
+index 7f5045c55f..90cee73e51 100644
@@ -26 +27 @@
-@@ -966,7 +966,7 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
+@@ -530,7 +530,7 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
@@ -35 +36 @@
-@@ -2071,7 +2071,6 @@ static int bnxt_reta_query_op(struct rte_eth_dev *eth_dev,
+@@ -1469,7 +1469,6 @@ static int bnxt_reta_query_op(struct rte_eth_dev *eth_dev,
@@ -44 +45 @@
-index be595487e5..13c2b88104 100644
+index 0701347003..23c5f7c3a2 100644
@@ -47 +48 @@
-@@ -3313,7 +3313,6 @@ error:
+@@ -2938,7 +2938,6 @@ error:
@@ -55 +56 @@
-@@ -3330,8 +3329,7 @@ int bnxt_hwrm_func_qcfg(struct bnxt *bp, uint16_t *mtu)
+@@ -2953,8 +2952,8 @@ int bnxt_hwrm_func_qcfg(struct bnxt *bp, uint16_t *mtu)
@@ -62,3 +63,4 @@
- 
- 	svif_info = rte_le_to_cpu_16(resp->svif_info);
- 	if (svif_info & HWRM_FUNC_QCFG_OUTPUT_SVIF_INFO_SVIF_VALID)
++
+ 	flags = rte_le_to_cpu_16(resp->flags);
+ 	if (BNXT_PF(bp) && (flags & HWRM_FUNC_QCFG_OUTPUT_FLAGS_MULTI_HOST))
+ 		bp->flags |= BNXT_FLAG_MULTI_HOST;

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

* [dpdk-stable] patch 'net/bnxt: fix typo in log message' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (45 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/bnxt: cleanup code' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/bnxt: fix Tx descriptor status implementation' " christian.ehrhardt
                   ` (53 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Kalesh AP; +Cc: Somnath Kotur, Ajit Khaparde, Venkat Duvvuru, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/5c8a709f4d71208f8fa5c35f7816bf25e036b208

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 5c8a709f4d71208f8fa5c35f7816bf25e036b208 Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Date: Wed, 9 Jun 2021 08:43:30 +0530
Subject: [PATCH] net/bnxt: fix typo in log message

[ upstream commit a3a1db0abf9bedf65c716802db458ded03c800b1 ]

In bnxt_rss_hash_update_op, check for valid RSS hashkey length is
made against size HW_HASH_KEY_SIZE(40). But the failure log says
"Invalid hashkey length, should be 16 bytes".

Fixes: 91aee9711ee3 ("net/bnxt: validate RSS hash key length")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 90cee73e51..3d07efd0f0 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -1550,7 +1550,8 @@ static int bnxt_rss_hash_update_op(struct rte_eth_dev *eth_dev,
 
 	if (rss_conf->rss_key_len != HW_HASH_KEY_SIZE) {
 		PMD_DRV_LOG(ERR,
-			    "Invalid hashkey length, should be 16 bytes\n");
+			    "Invalid hashkey length, should be %d bytes\n",
+			    HW_HASH_KEY_SIZE);
 		return -EINVAL;
 	}
 	memcpy(vnic->rss_hash_key, rss_conf->rss_key, rss_conf->rss_key_len);
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:14.887387144 +0200
+++ 0048-net-bnxt-fix-typo-in-log-message.patch	2021-08-10 15:11:13.022638128 +0200
@@ -1 +1 @@
-From a3a1db0abf9bedf65c716802db458ded03c800b1 Mon Sep 17 00:00:00 2001
+From 5c8a709f4d71208f8fa5c35f7816bf25e036b208 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a3a1db0abf9bedf65c716802db458ded03c800b1 ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
-index e7fc254173..70d10b9341 100644
+index 90cee73e51..3d07efd0f0 100644
@@ -25 +26 @@
-@@ -2152,7 +2152,8 @@ static int bnxt_rss_hash_update_op(struct rte_eth_dev *eth_dev,
+@@ -1550,7 +1550,8 @@ static int bnxt_rss_hash_update_op(struct rte_eth_dev *eth_dev,

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

* [dpdk-stable] patch 'net/bnxt: fix Tx descriptor status implementation' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (46 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/bnxt: fix typo in log message' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/bnxt: fix scalar Tx completion handling' " christian.ehrhardt
                   ` (52 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Lance Richardson; +Cc: Ajit Khaparde, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/cca90b556a33225f9713e46ad1de83cd2f4e1512

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From cca90b556a33225f9713e46ad1de83cd2f4e1512 Mon Sep 17 00:00:00 2001
From: Lance Richardson <lance.richardson@broadcom.com>
Date: Wed, 16 Jun 2021 13:55:21 -0400
Subject: [PATCH] net/bnxt: fix Tx descriptor status implementation

[ upstream commit ce5c57ac01af038b930d5164df2cb16193e238ec ]

With Tx completion batching, a single transmit completion
can correspond to one or more transmit descriptors, adjust
implementation to account for this.

RTE_ETH_TX_DESC_DONE should be returned for descriptors that
are available for use instead of RTE_ETH_TX_DESC_UNAVAIL.

Fixes: 5735eb241947 ("net/bnxt: support Tx batching")
Fixes: 478ed3bb7b9d ("net/bnxt: support Tx descriptor status")

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 54 +++++++++++++++++++---------------
 1 file changed, 31 insertions(+), 23 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 3d07efd0f0..c3a8b68885 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -2597,41 +2597,49 @@ static int
 bnxt_tx_descriptor_status_op(void *tx_queue, uint16_t offset)
 {
 	struct bnxt_tx_queue *txq = (struct bnxt_tx_queue *)tx_queue;
-	struct bnxt_tx_ring_info *txr;
-	struct bnxt_cp_ring_info *cpr;
-	struct bnxt_sw_tx_bd *tx_buf;
-	struct tx_pkt_cmpl *txcmp;
-	uint32_t cons, cp_cons;
+	struct bnxt_cp_ring_info *cpr = txq->cp_ring;
+	uint32_t ring_mask, raw_cons, nb_tx_pkts = 0;
+	struct bnxt_ring *cp_ring_struct;
+	struct cmpl_base *cp_desc_ring;
 	int rc;
 
-	if (!txq)
-		return -EINVAL;
-
 	rc = is_bnxt_in_error(txq->bp);
 	if (rc)
 		return rc;
 
-	cpr = txq->cp_ring;
-	txr = txq->tx_ring;
-
 	if (offset >= txq->nb_tx_desc)
 		return -EINVAL;
 
-	cons = RING_CMP(cpr->cp_ring_struct, offset);
-	txcmp = (struct tx_pkt_cmpl *)&cpr->cp_desc_ring[cons];
-	cp_cons = cpr->cp_raw_cons;
+	/* Return "desc done" if descriptor is available for use. */
+	if (bnxt_tx_bds_in_hw(txq) <= offset)
+		return RTE_ETH_TX_DESC_DONE;
 
-	if (cons > cp_cons) {
-		if (CMPL_VALID(txcmp, cpr->valid))
-			return RTE_ETH_TX_DESC_UNAVAIL;
-	} else {
-		if (CMPL_VALID(txcmp, !cpr->valid))
-			return RTE_ETH_TX_DESC_UNAVAIL;
+	raw_cons = cpr->cp_raw_cons;
+	cp_desc_ring = cpr->cp_desc_ring;
+	cp_ring_struct = cpr->cp_ring_struct;
+	ring_mask = cpr->cp_ring_struct->ring_mask;
+
+	/* Check to see if hw has posted a completion for the descriptor. */
+	while (1) {
+		struct tx_cmpl *txcmp;
+		uint32_t cons;
+
+		cons = RING_CMPL(ring_mask, raw_cons);
+		txcmp = (struct tx_cmpl *)&cp_desc_ring[cons];
+
+		if (!CMP_VALID(txcmp, raw_cons, cp_ring_struct))
+			break;
+
+		if (CMP_TYPE(txcmp) == TX_CMPL_TYPE_TX_L2)
+			nb_tx_pkts += rte_le_to_cpu_32(txcmp->opaque);
+
+		if (nb_tx_pkts > offset)
+			return RTE_ETH_TX_DESC_DONE;
+
+		raw_cons = NEXT_RAW_CMP(raw_cons);
 	}
-	tx_buf = &txr->tx_buf_ring[cons];
-	if (tx_buf->mbuf == NULL)
-		return RTE_ETH_TX_DESC_DONE;
 
+	/* Descriptor is pending transmit, not yet completed by hardware. */
 	return RTE_ETH_TX_DESC_FULL;
 }
 
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:14.924065675 +0200
+++ 0049-net-bnxt-fix-Tx-descriptor-status-implementation.patch	2021-08-10 15:11:13.026638158 +0200
@@ -1 +1 @@
-From ce5c57ac01af038b930d5164df2cb16193e238ec Mon Sep 17 00:00:00 2001
+From cca90b556a33225f9713e46ad1de83cd2f4e1512 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit ce5c57ac01af038b930d5164df2cb16193e238ec ]
+
@@ -15 +16,0 @@
-Cc: stable@dpdk.org
@@ -24 +25 @@
-index 74ade93b71..4d51a209f9 100644
+index 3d07efd0f0..c3a8b68885 100644
@@ -27 +28 @@
-@@ -3296,41 +3296,49 @@ static int
+@@ -2597,41 +2597,49 @@ static int
@@ -33 +34 @@
--	struct rte_mbuf **tx_buf;
+-	struct bnxt_sw_tx_bd *tx_buf;
@@ -93 +94 @@
--	if (*tx_buf == NULL)
+-	if (tx_buf->mbuf == NULL)

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

* [dpdk-stable] patch 'net/bnxt: fix scalar Tx completion handling' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (47 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/bnxt: fix Tx descriptor status implementation' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/bnxt: fix Rx interrupt setting' " christian.ehrhardt
                   ` (51 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Lance Richardson; +Cc: Ajit Khaparde, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/b2af7f5effd596659e41375c1087c0b2ac6836bc

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From b2af7f5effd596659e41375c1087c0b2ac6836bc Mon Sep 17 00:00:00 2001
From: Lance Richardson <lance.richardson@broadcom.com>
Date: Wed, 16 Jun 2021 13:55:22 -0400
Subject: [PATCH] net/bnxt: fix scalar Tx completion handling

[ upstream commit 2b5a36f4df0c00407117ed6f8f9444dd943b4f4c ]

Preserve the raw (unmasked) transmit completion ring
consumer index.

Remove cache prefetches that have no measurable performance
benefit.

Fixes: c7de4195cc4c ("net/bnxt: modify ring index logic")

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_txr.c | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c
index a3543e7cea..892f8c1a4c 100644
--- a/drivers/net/bnxt/bnxt_txr.c
+++ b/drivers/net/bnxt/bnxt_txr.c
@@ -398,30 +398,26 @@ static void bnxt_tx_cmp(struct bnxt_tx_queue *txq, int nr_pkts)
 
 static int bnxt_handle_tx_cp(struct bnxt_tx_queue *txq)
 {
+	uint32_t nb_tx_pkts = 0, cons, ring_mask, opaque;
 	struct bnxt_cp_ring_info *cpr = txq->cp_ring;
 	uint32_t raw_cons = cpr->cp_raw_cons;
-	uint32_t cons;
-	uint32_t nb_tx_pkts = 0;
+	struct bnxt_ring *cp_ring_struct;
 	struct tx_cmpl *txcmp;
-	struct cmpl_base *cp_desc_ring = cpr->cp_desc_ring;
-	struct bnxt_ring *cp_ring_struct = cpr->cp_ring_struct;
-	uint32_t ring_mask = cp_ring_struct->ring_mask;
-	uint32_t opaque = 0;
 
 	if (bnxt_tx_bds_in_hw(txq) < txq->tx_free_thresh)
 		return 0;
 
+	cp_ring_struct = cpr->cp_ring_struct;
+	ring_mask = cp_ring_struct->ring_mask;
+
 	do {
 		cons = RING_CMPL(ring_mask, raw_cons);
 		txcmp = (struct tx_cmpl *)&cpr->cp_desc_ring[cons];
-		rte_prefetch_non_temporal(&cp_desc_ring[(cons + 2) &
-							ring_mask]);
 
-		if (!CMPL_VALID(txcmp, cpr->valid))
+		if (!CMP_VALID(txcmp, raw_cons, cp_ring_struct))
 			break;
-		opaque = rte_cpu_to_le_32(txcmp->opaque);
-		NEXT_CMPL(cpr, cons, cpr->valid, 1);
-		rte_prefetch0(&cp_desc_ring[cons]);
+
+		opaque = rte_le_to_cpu_32(txcmp->opaque);
 
 		if (CMP_TYPE(txcmp) == TX_CMPL_TYPE_TX_L2)
 			nb_tx_pkts += opaque;
@@ -429,9 +425,11 @@ static int bnxt_handle_tx_cp(struct bnxt_tx_queue *txq)
 			RTE_LOG_DP(ERR, PMD,
 					"Unhandled CMP type %02x\n",
 					CMP_TYPE(txcmp));
-		raw_cons = cons;
+		raw_cons = NEXT_RAW_CMP(raw_cons);
 	} while (nb_tx_pkts < ring_mask);
 
+	cpr->valid = !!(raw_cons & cp_ring_struct->ring_size);
+
 	if (nb_tx_pkts) {
 		bnxt_tx_cmp(txq, nb_tx_pkts);
 		cpr->cp_raw_cons = raw_cons;
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:14.960344021 +0200
+++ 0050-net-bnxt-fix-scalar-Tx-completion-handling.patch	2021-08-10 15:11:13.026638158 +0200
@@ -1 +1 @@
-From 2b5a36f4df0c00407117ed6f8f9444dd943b4f4c Mon Sep 17 00:00:00 2001
+From b2af7f5effd596659e41375c1087c0b2ac6836bc Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 2b5a36f4df0c00407117ed6f8f9444dd943b4f4c ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
-index 27459960de..54eaab34a0 100644
+index a3543e7cea..892f8c1a4c 100644
@@ -25 +26 @@
-@@ -444,30 +444,26 @@ static void bnxt_tx_cmp(struct bnxt_tx_queue *txq, int nr_pkts)
+@@ -398,30 +398,26 @@ static void bnxt_tx_cmp(struct bnxt_tx_queue *txq, int nr_pkts)
@@ -64 +65 @@
-@@ -475,9 +471,11 @@ static int bnxt_handle_tx_cp(struct bnxt_tx_queue *txq)
+@@ -429,9 +425,11 @@ static int bnxt_handle_tx_cp(struct bnxt_tx_queue *txq)
@@ -75,2 +76,2 @@
- 		if (txq->offloads & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
- 			bnxt_tx_cmp_fast(txq, nb_tx_pkts);
+ 		bnxt_tx_cmp(txq, nb_tx_pkts);
+ 		cpr->cp_raw_cons = raw_cons;

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

* [dpdk-stable] patch 'net/bnxt: fix Rx interrupt setting' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (48 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/bnxt: fix scalar Tx completion handling' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'doc: add limitation for ConnectX-4 with L2 in mlx5 guide' " christian.ehrhardt
                   ` (50 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Ajit Khaparde; +Cc: Lance Richardson, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/38821d3caf7fed6102fb72510d165e1cdb133e3a

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 38821d3caf7fed6102fb72510d165e1cdb133e3a Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Tue, 25 May 2021 10:35:22 -0700
Subject: [PATCH] net/bnxt: fix Rx interrupt setting

[ upstream commit 5ba7c65864223c6ed27df0f861b9d700cfc9a51d ]

Don't set rxq interrupt config
Applications can set the rxq interrupt config to 1 or 0 as needed.
If an application is not interested in handling Rx interrupts and
prefers to poll Rx rings, there is no need for the PMD to set this
config option to 1.

Fixes: 1fe427fd08ee ("net/bnxt: support enable/disable interrupt")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index c3a8b68885..b3e95f72a0 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -569,7 +569,6 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
 	};
 	eth_dev->data->dev_conf.intr_conf.lsc = 1;
 
-	eth_dev->data->dev_conf.intr_conf.rxq = 1;
 	dev_info->rx_desc_lim.nb_min = BNXT_MIN_RING_DESC;
 	dev_info->rx_desc_lim.nb_max = BNXT_MAX_RX_RING_DESC;
 	dev_info->tx_desc_lim.nb_min = BNXT_MIN_RING_DESC;
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:14.993064423 +0200
+++ 0051-net-bnxt-fix-Rx-interrupt-setting.patch	2021-08-10 15:11:13.030638186 +0200
@@ -1 +1 @@
-From 5ba7c65864223c6ed27df0f861b9d700cfc9a51d Mon Sep 17 00:00:00 2001
+From 38821d3caf7fed6102fb72510d165e1cdb133e3a Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 5ba7c65864223c6ed27df0f861b9d700cfc9a51d ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
-index 495c6cd21e..ed09f1bf52 100644
+index c3a8b68885..b3e95f72a0 100644
@@ -25 +26 @@
-@@ -1011,7 +1011,6 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
+@@ -569,7 +569,6 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,

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

* [dpdk-stable] patch 'doc: add limitation for ConnectX-4 with L2 in mlx5 guide' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (49 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/bnxt: fix Rx interrupt setting' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/mlx5: fix match MPLS over GRE with key' " christian.ehrhardt
                   ` (49 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Dmitry Kozlyuk; +Cc: Viacheslav Ovsiienko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/9910c05442d047432d15c8721726dabdc88b478c

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 9910c05442d047432d15c8721726dabdc88b478c Mon Sep 17 00:00:00 2001
From: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Date: Wed, 30 Jun 2021 10:01:06 +0300
Subject: [PATCH] doc: add limitation for ConnectX-4 with L2 in mlx5 guide

[ upstream commit e60561cc955ac01512a35ca309793e351cef3c9b ]

ConnectX-4 and ConnectX-4 Lx NICs require all L2 headers of transmitted
packets to be inlined. By default only first 18 bytes are inlined,
which is insufficient if additional encapsulation is used, like Q-in-Q.
Thus, default settings caused such traffic to be dropepd on Tx.
Document a recommendation to increase inlined data size in such cases.

Fixes: 505f1fe426d3 ("net/mlx5: add Tx devargs")

Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Reviewed-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 doc/guides/nics/mlx5.rst | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst
index bbad7d0d5b..3ce4fda641 100644
--- a/doc/guides/nics/mlx5.rst
+++ b/doc/guides/nics/mlx5.rst
@@ -498,6 +498,13 @@ Run-time configuration
   it is not recommended and may prevent NIC from sending packets over
   some configurations.
 
+  For ConnectX-4 and ConnectX-4 Lx NICs, automatically configured value
+  is insufficient for some traffic, because they require at least all L2 headers
+  to be inlined. For example, Q-in-Q adds 4 bytes to default 18 bytes
+  of Ethernet and VLAN, thus ``txq_inline_min`` must be set to 22.
+  MPLS would add 4 bytes per label. Final value must account for all possible
+  L2 encapsulation headers used in particular environment.
+
   Please, note, this minimal data inlining disengages eMPW feature (Enhanced
   Multi-Packet Write), because last one does not support partial packet inlining.
   This is not very critical due to minimal data inlining is mostly required
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:15.032307837 +0200
+++ 0052-doc-add-limitation-for-ConnectX-4-with-L2-in-mlx5-gu.patch	2021-08-10 15:11:13.030638186 +0200
@@ -1 +1 @@
-From e60561cc955ac01512a35ca309793e351cef3c9b Mon Sep 17 00:00:00 2001
+From 9910c05442d047432d15c8721726dabdc88b478c Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit e60561cc955ac01512a35ca309793e351cef3c9b ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
-index 0d96eec2bb..5b4bb13914 100644
+index bbad7d0d5b..3ce4fda641 100644
@@ -25 +26 @@
-@@ -700,6 +700,13 @@ Driver options
+@@ -498,6 +498,13 @@ Run-time configuration

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

* [dpdk-stable] patch 'net/mlx5: fix match MPLS over GRE with key' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (50 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'doc: add limitation for ConnectX-4 with L2 in mlx5 guide' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'common/mlx5: fix Netlink receive message buffer size' " christian.ehrhardt
                   ` (48 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Xiaoyu Min; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/c685b39b909cc09459301dad68040233fcda1fe7

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From c685b39b909cc09459301dad68040233fcda1fe7 Mon Sep 17 00:00:00 2001
From: Xiaoyu Min <jackmin@nvidia.com>
Date: Thu, 1 Jul 2021 13:54:56 +0800
Subject: [PATCH] net/mlx5: fix match MPLS over GRE with key

[ upstream commit 4b1cb50a86b73dceade317be4541f2c176c7ca5b ]

Currently PMD needs previous layer information in order to set
corresponding match field for MPLSoGRE or MPLSoUDP.

GRE_KEY item is missing as supported previous layer when translate
item MPLS, which causes flow[1] cannot match MPLS over GRE traffic.

According to RFC4023, MPLS over GRE tunnel with optional key
field needs to be supported too.

By adding missing GRE_KEY as supported previous layer fix problem.

[1]:
flow create 0 ingress pattern eth / ipv6 / gre k_bit is 1 / gre_key /
mpls label is 966138 / end actions queue index 1 / mark id 0xa / end

Fixes: a7a0365565a4 ("net/mlx5: match GRE key and present bits")

Signed-off-by: Xiaoyu Min <jackmin@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 42ae1bbe2c..5f0d720d69 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -6221,6 +6221,8 @@ flow_dv_translate_item_mpls(void *matcher, void *key,
 			 MLX5_UDP_PORT_MPLS);
 		break;
 	case MLX5_FLOW_LAYER_GRE:
+		/* Fall-through. */
+	case MLX5_FLOW_LAYER_GRE_KEY:
 		MLX5_SET(fte_match_set_misc, misc_m, gre_protocol, 0xffff);
 		MLX5_SET(fte_match_set_misc, misc_v, gre_protocol,
 			 RTE_ETHER_TYPE_MPLS);
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:15.066446077 +0200
+++ 0053-net-mlx5-fix-match-MPLS-over-GRE-with-key.patch	2021-08-10 15:11:13.038638243 +0200
@@ -1 +1 @@
-From 4b1cb50a86b73dceade317be4541f2c176c7ca5b Mon Sep 17 00:00:00 2001
+From c685b39b909cc09459301dad68040233fcda1fe7 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 4b1cb50a86b73dceade317be4541f2c176c7ca5b ]
+
@@ -22 +23,0 @@
-Cc: stable@dpdk.org
@@ -31 +32 @@
-index 4758b9f2cb..0209a3e8e6 100644
+index 42ae1bbe2c..5f0d720d69 100644
@@ -34 +35 @@
-@@ -9064,6 +9064,8 @@ flow_dv_translate_item_mpls(void *matcher, void *key,
+@@ -6221,6 +6221,8 @@ flow_dv_translate_item_mpls(void *matcher, void *key,

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

* [dpdk-stable] patch 'common/mlx5: fix Netlink receive message buffer size' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (51 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/mlx5: fix match MPLS over GRE with key' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-11  9:26   ` Christian Ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/mlx5: remove unsupported flow item MPLS over IP' " christian.ehrhardt
                   ` (47 subsequent siblings)
  100 siblings, 1 reply; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Viacheslav Ovsiienko; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/6af6af1640a7cd555e22dea6f12f497b82bb0761

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 6af6af1640a7cd555e22dea6f12f497b82bb0761 Mon Sep 17 00:00:00 2001
From: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Date: Thu, 1 Jul 2021 10:31:33 +0300
Subject: [PATCH] common/mlx5: fix Netlink receive message buffer size

[ upstream commit 32d1e4dbadba4bc3523d8b354458a4b979e5c2e6 ]

If there are many VFs the Netlink message length sent by kernel
in reply to RTM_GETLINK request can be large. We should query
the size of message being received in advance and allocate
the large enough buffer to handle these large messages.

Fixes: ccdcba53a3f4 ("net/mlx5: use Netlink to add/remove MAC addresses")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/mlx5_nl.c | 69 ++++++++++++++++++++++++++++++--------
 1 file changed, 55 insertions(+), 14 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_nl.c b/drivers/net/mlx5/mlx5_nl.c
index 668affb0b1..8d5478d9f5 100644
--- a/drivers/net/mlx5/mlx5_nl.c
+++ b/drivers/net/mlx5/mlx5_nl.c
@@ -128,8 +128,8 @@ int
 mlx5_nl_init(int protocol)
 {
 	int fd;
-	int sndbuf_size = MLX5_SEND_BUF_SIZE;
-	int rcvbuf_size = MLX5_RECV_BUF_SIZE;
+	int buf_size;
+	socklen_t opt_size;
 	struct sockaddr_nl local = {
 		.nl_family = AF_NETLINK,
 	};
@@ -140,16 +140,36 @@ mlx5_nl_init(int protocol)
 		rte_errno = errno;
 		return -rte_errno;
 	}
-	ret = setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &sndbuf_size, sizeof(int));
+	opt_size = sizeof(buf_size);
+	ret = getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &buf_size, &opt_size);
 	if (ret == -1) {
 		rte_errno = errno;
 		goto error;
 	}
-	ret = setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &rcvbuf_size, sizeof(int));
+	DRV_LOG(DEBUG, "Netlink socket send buffer: %d", buf_size);
+	if (buf_size < MLX5_SEND_BUF_SIZE) {
+		ret = setsockopt(fd, SOL_SOCKET, SO_SNDBUF,
+				 &buf_size, sizeof(buf_size));
+		if (ret == -1) {
+			rte_errno = errno;
+			goto error;
+		}
+	}
+	opt_size = sizeof(buf_size);
+	ret = getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &buf_size, &opt_size);
 	if (ret == -1) {
 		rte_errno = errno;
 		goto error;
 	}
+	DRV_LOG(DEBUG, "Netlink socket recv buffer: %d", buf_size);
+	if (buf_size < MLX5_RECV_BUF_SIZE) {
+		ret = setsockopt(fd, SOL_SOCKET, SO_RCVBUF,
+				 &buf_size, sizeof(buf_size));
+		if (ret == -1) {
+			rte_errno = errno;
+			goto error;
+		}
+	}
 	ret = bind(fd, (struct sockaddr *)&local, sizeof(local));
 	if (ret == -1) {
 		rte_errno = errno;
@@ -271,11 +291,7 @@ mlx5_nl_recv(int nlsk_fd, uint32_t sn, int (*cb)(struct nlmsghdr *, void *arg),
 	     void *arg)
 {
 	struct sockaddr_nl sa;
-	void *buf = malloc(MLX5_RECV_BUF_SIZE);
-	struct iovec iov = {
-		.iov_base = buf,
-		.iov_len = MLX5_RECV_BUF_SIZE,
-	};
+	struct iovec iov;
 	struct msghdr msg = {
 		.msg_name = &sa,
 		.msg_namelen = sizeof(sa),
@@ -283,18 +299,43 @@ mlx5_nl_recv(int nlsk_fd, uint32_t sn, int (*cb)(struct nlmsghdr *, void *arg),
 		/* One message at a time */
 		.msg_iovlen = 1,
 	};
+	void *buf = NULL;
 	int multipart = 0;
 	int ret = 0;
 
-	if (!buf) {
-		rte_errno = ENOMEM;
-		return -rte_errno;
-	}
 	do {
 		struct nlmsghdr *nh;
-		int recv_bytes = 0;
+		int recv_bytes;
 
 		do {
+			/* Query length of incoming message. */
+			iov.iov_base = NULL;
+			iov.iov_len = 0;
+			recv_bytes = recvmsg(nlsk_fd, &msg,
+					     MSG_PEEK | MSG_TRUNC);
+			if (recv_bytes < 0) {
+				rte_errno = errno;
+				ret = -rte_errno;
+				goto exit;
+			}
+			if (recv_bytes == 0) {
+				rte_errno = ENODATA;
+				ret = -rte_errno;
+				goto exit;
+			}
+			/* Allocate buffer to fetch the message. */
+			if (recv_bytes < MLX5_RECV_BUF_SIZE)
+				recv_bytes = MLX5_RECV_BUF_SIZE;
+			mlx5_free(buf);
+			buf = mlx5_malloc(0, recv_bytes, 0, SOCKET_ID_ANY);
+			if (!buf) {
+				rte_errno = ENOMEM;
+				ret = -rte_errno;
+				goto exit;
+			}
+			/* Fetch the message. */
+			iov.iov_base = buf;
+			iov.iov_len = recv_bytes;
 			recv_bytes = recvmsg(nlsk_fd, &msg, 0);
 			if (recv_bytes == -1) {
 				rte_errno = errno;
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:15.121954386 +0200
+++ 0054-common-mlx5-fix-Netlink-receive-message-buffer-size.patch	2021-08-10 15:11:13.038638243 +0200
@@ -1 +1 @@
-From 32d1e4dbadba4bc3523d8b354458a4b979e5c2e6 Mon Sep 17 00:00:00 2001
+From 6af6af1640a7cd555e22dea6f12f497b82bb0761 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 32d1e4dbadba4bc3523d8b354458a4b979e5c2e6 ]
+
@@ -12 +13,0 @@
-Cc: stable@dpdk.org
@@ -16 +17 @@
- drivers/common/mlx5/linux/mlx5_nl.c | 69 +++++++++++++++++++++++------
+ drivers/net/mlx5/mlx5_nl.c | 69 ++++++++++++++++++++++++++++++--------
@@ -19,5 +20,5 @@
-diff --git a/drivers/common/mlx5/linux/mlx5_nl.c b/drivers/common/mlx5/linux/mlx5_nl.c
-index 3f1912d078..dc8dafd0a8 100644
---- a/drivers/common/mlx5/linux/mlx5_nl.c
-+++ b/drivers/common/mlx5/linux/mlx5_nl.c
-@@ -189,8 +189,8 @@ int
+diff --git a/drivers/net/mlx5/mlx5_nl.c b/drivers/net/mlx5/mlx5_nl.c
+index 668affb0b1..8d5478d9f5 100644
+--- a/drivers/net/mlx5/mlx5_nl.c
++++ b/drivers/net/mlx5/mlx5_nl.c
+@@ -128,8 +128,8 @@ int
@@ -34 +35 @@
-@@ -201,16 +201,36 @@ mlx5_nl_init(int protocol)
+@@ -140,16 +140,36 @@ mlx5_nl_init(int protocol)
@@ -73 +74 @@
-@@ -332,11 +352,7 @@ mlx5_nl_recv(int nlsk_fd, uint32_t sn, int (*cb)(struct nlmsghdr *, void *arg),
+@@ -271,11 +291,7 @@ mlx5_nl_recv(int nlsk_fd, uint32_t sn, int (*cb)(struct nlmsghdr *, void *arg),
@@ -77 +78 @@
--	void *buf = mlx5_malloc(0, MLX5_RECV_BUF_SIZE, 0, SOCKET_ID_ANY);
+-	void *buf = malloc(MLX5_RECV_BUF_SIZE);
@@ -86 +87 @@
-@@ -344,18 +360,43 @@ mlx5_nl_recv(int nlsk_fd, uint32_t sn, int (*cb)(struct nlmsghdr *, void *arg),
+@@ -283,18 +299,43 @@ mlx5_nl_recv(int nlsk_fd, uint32_t sn, int (*cb)(struct nlmsghdr *, void *arg),

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

* [dpdk-stable] patch 'net/mlx5: remove unsupported flow item MPLS over IP' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (52 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'common/mlx5: fix Netlink receive message buffer size' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/ice: fix memzone leak when firmware is missing' " christian.ehrhardt
                   ` (46 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Xiaoyu Min; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/55b8b2f9e12ec0ddab7b9a4945bea0ea01c252f3

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 55b8b2f9e12ec0ddab7b9a4945bea0ea01c252f3 Mon Sep 17 00:00:00 2001
From: Xiaoyu Min <jackmin@nvidia.com>
Date: Fri, 2 Jul 2021 16:34:46 +0800
Subject: [PATCH] net/mlx5: remove unsupported flow item MPLS over IP

[ upstream commit 14ad99d78a466bd5fb796cb9c147d2a315cbe318 ]

HW doesn't support match MPLS over IP traffic.

Remove related code.

Fixes: d1abe664ddde ("net/mlx5: add MPLS to Direct Verbs flow engine")

Signed-off-by: Xiaoyu Min <jackmin@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow.c    | 5 ++---
 drivers/net/mlx5/mlx5_flow_dv.c | 3 ---
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 7bc0cc2662..65064ffb07 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -2224,9 +2224,8 @@ mlx5_flow_validate_item_mpls(struct rte_eth_dev *dev __rte_unused,
 					  "MPLS not supported or"
 					  " disabled in firmware"
 					  " configuration.");
-	/* MPLS over IP, UDP, GRE is allowed */
-	if (!(prev_layer & (MLX5_FLOW_LAYER_OUTER_L3 |
-			    MLX5_FLOW_LAYER_OUTER_L4_UDP |
+	/* MPLS over UDP, GRE is allowed */
+	if (!(prev_layer & (MLX5_FLOW_LAYER_OUTER_L4_UDP |
 			    MLX5_FLOW_LAYER_GRE |
 			    MLX5_FLOW_LAYER_GRE_KEY)))
 		return rte_flow_error_set(error, EINVAL,
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 5f0d720d69..a021ac9d20 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -6228,9 +6228,6 @@ flow_dv_translate_item_mpls(void *matcher, void *key,
 			 RTE_ETHER_TYPE_MPLS);
 		break;
 	default:
-		MLX5_SET(fte_match_set_lyr_2_4, headers_m, ip_protocol, 0xff);
-		MLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_protocol,
-			 IPPROTO_MPLS);
 		break;
 	}
 	if (!in_mpls_v)
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:15.160524337 +0200
+++ 0055-net-mlx5-remove-unsupported-flow-item-MPLS-over-IP.patch	2021-08-10 15:11:13.046638301 +0200
@@ -1 +1 @@
-From 14ad99d78a466bd5fb796cb9c147d2a315cbe318 Mon Sep 17 00:00:00 2001
+From 55b8b2f9e12ec0ddab7b9a4945bea0ea01c252f3 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 14ad99d78a466bd5fb796cb9c147d2a315cbe318 ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -21 +22 @@
-index 667ae3fd97..dc41e8b1b7 100644
+index 7bc0cc2662..65064ffb07 100644
@@ -24 +25 @@
-@@ -2923,9 +2923,8 @@ mlx5_flow_validate_item_mpls(struct rte_eth_dev *dev __rte_unused,
+@@ -2224,9 +2224,8 @@ mlx5_flow_validate_item_mpls(struct rte_eth_dev *dev __rte_unused,
@@ -37 +38 @@
-index 6ffdaf188c..6c8adb3481 100644
+index 5f0d720d69..a021ac9d20 100644
@@ -40 +41 @@
-@@ -9076,9 +9076,6 @@ flow_dv_translate_item_mpls(void *matcher, void *key,
+@@ -6228,9 +6228,6 @@ flow_dv_translate_item_mpls(void *matcher, void *key,

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

* [dpdk-stable] patch 'net/ice: fix memzone leak when firmware is missing' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (53 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/mlx5: remove unsupported flow item MPLS over IP' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/i40e: fix descriptor scan on Arm' " christian.ehrhardt
                   ` (45 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: David Marchand; +Cc: Haiyue Wang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/7d6ae8ccc63ae4030bf2eeaf11c1628c7cd9e2f6

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 7d6ae8ccc63ae4030bf2eeaf11c1628c7cd9e2f6 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Tue, 6 Jul 2021 16:12:37 +0200
Subject: [PATCH] net/ice: fix memzone leak when firmware is missing

[ upstream commit 850989f9381902e36d44c2c4c7409ad703ef99cb ]

Caught by our QE.
When the firmware is missing, memzones were not released.

$ dpdk-testpmd -c 0x1f -a 0:0:0.0 -- -i
...

testpmd> dump_memzone
...
Zone 6: name:<RTE_METRICS>, len:0x15040, virt:0x1661b24c0, socket_id:0,
flags:0
physical segments used:
  addr: 0x140000000 iova: 0x140000000 len: 0x40000000 pagesz: 0x40000000

testpmd> port attach 0000:5e:00.0
Attaching a new port...
EAL: Using IOMMU type 1 (Type 1)
EAL: Probe PCI driver: net_ice (8086:159b) device: 0000:5e:00.0 (socket 0)
ice_load_pkg(): failed to open file: /lib/firmware/intel/ice/ddp/ice.pkg

ice_dev_init(): Failed to load the DDP package,Use safe-mode-support=1 to
 enter Safe Mode
EAL: Releasing PCI mapped resource for 0000:5e:00.0
EAL: Calling pci_unmap_resource for 0000:5e:00.0 at 0x2200000000
EAL: Calling pci_unmap_resource for 0000:5e:00.0 at 0x2202000000
EAL: Driver cannot attach the device (0000:5e:00.0)
EAL: Failed to attach device on primary process
testpmd: Failed to attach port 0000:5e:00.0

testpmd> dump_memzone
...
Zone 139: name:<ice_dma_17168374657430093156>, len:0x1000,
  virt:0x1660ed800, socket_id:0, flags:0 physical segments used:
  addr: 0x140000000 iova: 0x140000000 len: 0x40000000 pagesz: 0x40000000

With 20 tries attaching a net/ice port, we would end up with:

EAL: Probe PCI driver: net_ice (8086:159b) device: 0000:5e:00.0 (socket 0)
EAL: memzone_reserve_aligned_thread_unsafe(): Number of requested memzone
  segments exceeds RTE_MAX_MEMZONE
ice_dev_init(): Failed to initialize HW

Fixes: a4c8c48fe3f4 ("net/ice: load OS default package")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
---
 drivers/net/ice/ice_ethdev.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 4e15ed54bf..4bd2bd39b1 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2195,7 +2195,7 @@ ice_dev_init(struct rte_eth_dev *dev)
 		if (ad->devargs.safe_mode_support == 0) {
 			PMD_INIT_LOG(ERR, "Failed to load the DDP package,"
 					"Use safe-mode-support=1 to enter Safe Mode");
-			return ret;
+			goto err_init_fw;
 		}
 
 		PMD_INIT_LOG(WARNING, "Failed to load the DDP package,"
@@ -2287,10 +2287,11 @@ err_msix_pool_init:
 	rte_free(dev->data->mac_addrs);
 	dev->data->mac_addrs = NULL;
 err_init_mac:
-	ice_sched_cleanup_all(hw);
-	rte_free(hw->port_info);
-	ice_shutdown_all_ctrlq(hw);
 	rte_free(pf->proto_xtr);
+#ifndef RTE_EXEC_ENV_WINDOWS
+err_init_fw:
+#endif
+	ice_deinit_hw(hw);
 
 	return ret;
 }
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:15.221385957 +0200
+++ 0056-net-ice-fix-memzone-leak-when-firmware-is-missing.patch	2021-08-10 15:11:13.050638331 +0200
@@ -1 +1 @@
-From 850989f9381902e36d44c2c4c7409ad703ef99cb Mon Sep 17 00:00:00 2001
+From 7d6ae8ccc63ae4030bf2eeaf11c1628c7cd9e2f6 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 850989f9381902e36d44c2c4c7409ad703ef99cb ]
+
@@ -48 +49,0 @@
-Cc: stable@dpdk.org
@@ -57 +58 @@
-index aec19b6521..a4cd39c954 100644
+index 4e15ed54bf..4bd2bd39b1 100644
@@ -60 +61 @@
-@@ -2069,7 +2069,7 @@ ice_dev_init(struct rte_eth_dev *dev)
+@@ -2195,7 +2195,7 @@ ice_dev_init(struct rte_eth_dev *dev)
@@ -69 +70 @@
-@@ -2159,10 +2159,11 @@ err_msix_pool_init:
+@@ -2287,10 +2287,11 @@ err_msix_pool_init:

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

* [dpdk-stable] patch 'net/i40e: fix descriptor scan on Arm' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (54 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/ice: fix memzone leak when firmware is missing' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/ixgbe: fix flow entry access after freeing' " christian.ehrhardt
                   ` (44 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Joyce Kong; +Cc: Ruifeng Wang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/b8cbdcef10df924b95dd4280cbd26a6f18eff20b

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From b8cbdcef10df924b95dd4280cbd26a6f18eff20b Mon Sep 17 00:00:00 2001
From: Joyce Kong <joyce.kong@arm.com>
Date: Tue, 6 Jul 2021 01:54:03 -0500
Subject: [PATCH] net/i40e: fix descriptor scan on Arm

[ upstream commit 65b2ec7b4f6bca9c7436681141d2974c7960d208 ]

For Arm platforms, reading descs can get re-ordered, then the
status of DD bits will be discontinuous, so add the logic to
only process continuous descs by checking DD bits.

Fixes: 4861cde46116 ("i40e: new poll mode driver")

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 drivers/net/i40e/i40e_rxtx.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 4dc828357f..582dc5a3e4 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -417,7 +417,7 @@ i40e_rx_scan_hw_ring(struct i40e_rx_queue *rxq)
 	uint16_t pkt_len;
 	uint64_t qword1;
 	uint32_t rx_status;
-	int32_t s[I40E_LOOK_AHEAD], nb_dd;
+	int32_t s[I40E_LOOK_AHEAD], var, nb_dd;
 	int32_t i, j, nb_rx = 0;
 	uint64_t pkt_flags;
 	uint32_t *ptype_tbl = rxq->vsi->adapter->ptype_tbl;
@@ -450,8 +450,18 @@ i40e_rx_scan_hw_ring(struct i40e_rx_queue *rxq)
 		rte_smp_rmb();
 
 		/* Compute how many status bits were set */
-		for (j = 0, nb_dd = 0; j < I40E_LOOK_AHEAD; j++)
-			nb_dd += s[j] & (1 << I40E_RX_DESC_STATUS_DD_SHIFT);
+		for (j = 0, nb_dd = 0; j < I40E_LOOK_AHEAD; j++) {
+			var = s[j] & (1 << I40E_RX_DESC_STATUS_DD_SHIFT);
+#ifdef RTE_ARCH_ARM
+			/* For Arm platforms, only compute continuous status bits */
+			if (var)
+				nb_dd += 1;
+			else
+				break;
+#else
+			nb_dd += var;
+#endif
+		}
 
 		nb_rx += nb_dd;
 
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:15.253497281 +0200
+++ 0057-net-i40e-fix-descriptor-scan-on-Arm.patch	2021-08-10 15:11:13.054638359 +0200
@@ -1 +1 @@
-From 65b2ec7b4f6bca9c7436681141d2974c7960d208 Mon Sep 17 00:00:00 2001
+From b8cbdcef10df924b95dd4280cbd26a6f18eff20b Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 65b2ec7b4f6bca9c7436681141d2974c7960d208 ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index 8d65f287f4..e518409fe5 100644
+index 4dc828357f..582dc5a3e4 100644
@@ -23 +24 @@
-@@ -452,7 +452,7 @@ i40e_rx_scan_hw_ring(struct i40e_rx_queue *rxq)
+@@ -417,7 +417,7 @@ i40e_rx_scan_hw_ring(struct i40e_rx_queue *rxq)
@@ -32 +33 @@
-@@ -485,8 +485,18 @@ i40e_rx_scan_hw_ring(struct i40e_rx_queue *rxq)
+@@ -450,8 +450,18 @@ i40e_rx_scan_hw_ring(struct i40e_rx_queue *rxq)

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

* [dpdk-stable] patch 'net/ixgbe: fix flow entry access after freeing' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (55 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/i40e: fix descriptor scan on Arm' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/octeontx/base: fix debug build with clang' " christian.ehrhardt
                   ` (43 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Dapeng Yu; +Cc: Haiyue Wang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/f9a4c1efae931cdbd9c6afa01a4bda77ae4e1e34

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From f9a4c1efae931cdbd9c6afa01a4bda77ae4e1e34 Mon Sep 17 00:00:00 2001
From: Dapeng Yu <dapengx.yu@intel.com>
Date: Fri, 9 Jul 2021 11:14:59 +0800
Subject: [PATCH] net/ixgbe: fix flow entry access after freeing

[ upstream commit 75e4023dd7ad3b37ad2843635b38436d91613c86 ]

The original code use a heap pointer after it is freed.
This patch fix it.

Fixes: a14de8b498d1 ("net/ixgbe: destroy consistent filter")

Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
Reviewed-by: Haiyue Wang <haiyue.wang@intel.com>
---
 drivers/net/ixgbe/ixgbe_flow.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c
index d539951896..6bc2767ea1 100644
--- a/drivers/net/ixgbe/ixgbe_flow.c
+++ b/drivers/net/ixgbe/ixgbe_flow.c
@@ -3437,6 +3437,7 @@ ixgbe_flow_destroy(struct rte_eth_dev *dev,
 			TAILQ_REMOVE(&ixgbe_flow_list,
 				ixgbe_flow_mem_ptr, entries);
 			rte_free(ixgbe_flow_mem_ptr);
+			break;
 		}
 	}
 	rte_free(flow);
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:15.293221458 +0200
+++ 0058-net-ixgbe-fix-flow-entry-access-after-freeing.patch	2021-08-10 15:11:13.054638359 +0200
@@ -1 +1 @@
-From 75e4023dd7ad3b37ad2843635b38436d91613c86 Mon Sep 17 00:00:00 2001
+From f9a4c1efae931cdbd9c6afa01a4bda77ae4e1e34 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 75e4023dd7ad3b37ad2843635b38436d91613c86 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
-index 0b10e91a9b..511b612f7f 100644
+index d539951896..6bc2767ea1 100644

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

* [dpdk-stable] patch 'net/octeontx/base: fix debug build with clang' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (56 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/ixgbe: fix flow entry access after freeing' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'test/power: fix CPU frequency when turbo enabled' " christian.ehrhardt
                   ` (42 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: David Marchand; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/69180666f1d05bc858f3651cb2619790a5807543

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 69180666f1d05bc858f3651cb2619790a5807543 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Fri, 9 Jul 2021 11:32:29 +0530
Subject: [PATCH] net/octeontx/base: fix debug build with clang

[ upstream commit 5898abedeb847590ce3cf800e907c5035866e09b ]

Remove conflicting declaration of this symbol.

Fixes: d0d654986018 ("net/octeontx: support event Rx adapter")

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 drivers/net/octeontx/base/octeontx_pkivf.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/octeontx/base/octeontx_pkivf.h b/drivers/net/octeontx/base/octeontx_pkivf.h
index d541dc3bd9..ae5ffadf49 100644
--- a/drivers/net/octeontx/base/octeontx_pkivf.h
+++ b/drivers/net/octeontx/base/octeontx_pkivf.h
@@ -346,7 +346,6 @@ int octeontx_pki_port_open(int port);
 int octeontx_pki_port_hash_config(int port, pki_hash_cfg_t *hash_cfg);
 int octeontx_pki_port_pktbuf_config(int port, pki_pktbuf_cfg_t *buf_cfg);
 int octeontx_pki_port_create_qos(int port, pki_qos_cfg_t *qos_cfg);
-int octeontx_pki_port_close(int port);
 int octeontx_pki_port_errchk_config(int port, pki_errchk_cfg_t *cfg);
 
 #endif /* __OCTEONTX_PKI_H__ */
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:15.330757172 +0200
+++ 0059-net-octeontx-base-fix-debug-build-with-clang.patch	2021-08-10 15:11:13.054638359 +0200
@@ -1 +1 @@
-From 5898abedeb847590ce3cf800e907c5035866e09b Mon Sep 17 00:00:00 2001
+From 69180666f1d05bc858f3651cb2619790a5807543 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 5898abedeb847590ce3cf800e907c5035866e09b ]
+
@@ -9 +10,0 @@
-Cc: stable@dpdk.org
@@ -17 +18 @@
-index d41eaa57ed..8c86841ea6 100644
+index d541dc3bd9..ae5ffadf49 100644
@@ -20 +21 @@
-@@ -362,7 +362,6 @@ int octeontx_pki_port_open(int port);
+@@ -346,7 +346,6 @@ int octeontx_pki_port_open(int port);
@@ -26,2 +27,2 @@
- int octeontx_pki_port_vlan_fltr_config(int port,
- 				pki_port_vlan_filter_config_t *fltr_cfg);
+ 
+ #endif /* __OCTEONTX_PKI_H__ */

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

* [dpdk-stable] patch 'test/power: fix CPU frequency when turbo enabled' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (57 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/octeontx/base: fix debug build with clang' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-11  9:59   ` Christian Ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/virtio: fix aarch32 build' " christian.ehrhardt
                   ` (41 subsequent siblings)
  100 siblings, 1 reply; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Richael Zhuang; +Cc: David Hunt, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/4da3e8a9f04a9c2f820b8270b25b09cca79ed739

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 4da3e8a9f04a9c2f820b8270b25b09cca79ed739 Mon Sep 17 00:00:00 2001
From: Richael Zhuang <richael.zhuang@arm.com>
Date: Fri, 9 Jul 2021 18:55:48 +0800
Subject: [PATCH] test/power: fix CPU frequency when turbo enabled

[ upstream commit 29343b9030e38e8c3519ba01cb66724d45b13dc8 ]

On arm platform, the value in "/sys/.../cpuinfo_cur_freq" may not
be exactly the same as what was set when using CPPC cpufreq driver.
For other cpufreq driver, no need to round it currently, or else
this check will fail with turbo enabled. For example, with acpi_cpufreq,
cpuinfo_cur_freq can be 2401000 which is equal to freqs[0].It should
not be rounded to 2400000.

Fixes: 606a234c6d360 ("test/power: round CPU frequency to check")

Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Acked-by: David Hunt <david.hunt@intel.com>
---
 app/test/test_power_cpufreq.c | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/app/test/test_power_cpufreq.c b/app/test/test_power_cpufreq.c
index d0c7e60ca5..e5bf3b3367 100644
--- a/app/test/test_power_cpufreq.c
+++ b/app/test/test_power_cpufreq.c
@@ -55,7 +55,9 @@ check_cur_freq(unsigned int lcore_id, uint32_t idx, bool turbo)
 	FILE *f;
 	char fullpath[PATH_MAX];
 	char buf[BUFSIZ];
+	enum power_management_env env;
 	uint32_t cur_freq;
+	uint32_t freq_conv;
 	int ret = -1;
 	int i;
 
@@ -80,15 +82,18 @@ check_cur_freq(unsigned int lcore_id, uint32_t idx, bool turbo)
 			goto fail_all;
 
 		cur_freq = strtoul(buf, NULL, TEST_POWER_CONVERT_TO_DECIMAL);
-
-		/* convert the frequency to nearest 100000 value
-		 * Ex: if cur_freq=1396789 then freq_conv=1400000
-		 * Ex: if cur_freq=800030 then freq_conv=800000
-		 */
-		unsigned int freq_conv = 0;
-		freq_conv = (cur_freq + TEST_FREQ_ROUNDING_DELTA)
-					/ TEST_ROUND_FREQ_TO_N_100000;
-		freq_conv = freq_conv * TEST_ROUND_FREQ_TO_N_100000;
+		freq_conv = cur_freq;
+
+		env = rte_power_get_env();
+		if (env == PM_ENV_CPPC_CPUFREQ) {
+			/* convert the frequency to nearest 100000 value
+			 * Ex: if cur_freq=1396789 then freq_conv=1400000
+			 * Ex: if cur_freq=800030 then freq_conv=800000
+			 */
+			freq_conv = (cur_freq + TEST_FREQ_ROUNDING_DELTA)
+						/ TEST_ROUND_FREQ_TO_N_100000;
+			freq_conv = freq_conv * TEST_ROUND_FREQ_TO_N_100000;
+		}
 
 		if (turbo)
 			ret = (freqs[idx] <= freq_conv ? 0 : -1);
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:15.364486251 +0200
+++ 0060-test-power-fix-CPU-frequency-when-turbo-enabled.patch	2021-08-10 15:11:13.054638359 +0200
@@ -1 +1 @@
-From 29343b9030e38e8c3519ba01cb66724d45b13dc8 Mon Sep 17 00:00:00 2001
+From 4da3e8a9f04a9c2f820b8270b25b09cca79ed739 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 29343b9030e38e8c3519ba01cb66724d45b13dc8 ]
+
@@ -14 +15,0 @@
-Cc: stable@dpdk.org
@@ -23 +24 @@
-index 8516df4ca6..b8fc53925c 100644
+index d0c7e60ca5..e5bf3b3367 100644

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

* [dpdk-stable] patch 'net/virtio: fix aarch32 build' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (58 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'test/power: fix CPU frequency when turbo enabled' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/bonding: fix error message on flow verify' " christian.ehrhardt
                   ` (40 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Juraj Linkeš; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/0336eaa63ab370157d76073c6bc32948c8c4b47a

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 0336eaa63ab370157d76073c6bc32948c8c4b47a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juraj=20Linke=C5=A1?= <juraj.linkes@pantheon.tech>
Date: Wed, 7 Jul 2021 15:25:39 +0200
Subject: [PATCH] net/virtio: fix aarch32 build
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit 143b6270b05cf6693f47f692bf890f7f16f9bfd1 ]

NEON vector path of the PMD needs aarch64 support. But it was
enabled for aarch32 build as well because aarch32 build had
cpu_family set to aarch64. So build for aarch32 will fail due
to unsupported intrinsics.

Fix aarch32 build by updating meson file to exclude NEON vector
implementation for aarch32.

Fixes: 749799482a72 ("net/virtio: add to meson build")

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/net/virtio/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/virtio/meson.build b/drivers/net/virtio/meson.build
index 04c7fdf25d..a99365807f 100644
--- a/drivers/net/virtio/meson.build
+++ b/drivers/net/virtio/meson.build
@@ -13,7 +13,7 @@ if arch_subdir == 'x86'
 	sources += files('virtio_rxtx_simple_sse.c')
 elif arch_subdir == 'ppc_64'
 	sources += files('virtio_rxtx_simple_altivec.c')
-elif arch_subdir == 'arm' and host_machine.cpu_family().startswith('aarch64')
+elif arch_subdir == 'arm' and dpdk_conf.get('RTE_ARCH_64')
 	sources += files('virtio_rxtx_simple_neon.c')
 endif
 
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:15.402374417 +0200
+++ 0061-net-virtio-fix-aarch32-build.patch	2021-08-10 15:11:13.058638389 +0200
@@ -1 +1 @@
-From 143b6270b05cf6693f47f692bf890f7f16f9bfd1 Mon Sep 17 00:00:00 2001
+From 0336eaa63ab370157d76073c6bc32948c8c4b47a Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit 143b6270b05cf6693f47f692bf890f7f16f9bfd1 ]
+
@@ -18 +19,0 @@
-Cc: stable@dpdk.org
@@ -27 +28 @@
-index 81b0a61baf..01a333ada2 100644
+index 04c7fdf25d..a99365807f 100644
@@ -30,4 +31,4 @@
-@@ -41,7 +41,7 @@ if arch_subdir == 'x86'
-     sources += files('virtio_rxtx_simple_sse.c')
- elif arch_subdir == 'ppc'
-     sources += files('virtio_rxtx_simple_altivec.c')
+@@ -13,7 +13,7 @@ if arch_subdir == 'x86'
+ 	sources += files('virtio_rxtx_simple_sse.c')
+ elif arch_subdir == 'ppc_64'
+ 	sources += files('virtio_rxtx_simple_altivec.c')
@@ -36,2 +37 @@
-     sources += files('virtio_rxtx_packed.c')
-     sources += files('virtio_rxtx_simple_neon.c')
+ 	sources += files('virtio_rxtx_simple_neon.c')
@@ -38,0 +39 @@
+ 

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

* [dpdk-stable] patch 'net/bonding: fix error message on flow verify' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (59 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/virtio: fix aarch32 build' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/bonding: check flow setting' " christian.ehrhardt
                   ` (39 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Martin Havlik; +Cc: Min Hu, Andrew Rybchenko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/0d201efa284156695782ab65e293ebb8cc39eebf

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 0d201efa284156695782ab65e293ebb8cc39eebf Mon Sep 17 00:00:00 2001
From: Martin Havlik <xhavli56@stud.fit.vutbr.cz>
Date: Tue, 22 Jun 2021 11:25:28 +0200
Subject: [PATCH] net/bonding: fix error message on flow verify

[ upstream commit cb8dc97f9d7e48f6ac0f79587133ec6213ed1d18 ]

Return value is now saved to errval and log message on error reports
correct function name, doesn't use q_id which was out of context,
and uses up-to-date errval.

Fixes: 112891cd27e5 ("net/bonding: add dedicated HW queues for LACP control")

Signed-off-by: Martin Havlik <xhavli56@stud.fit.vutbr.cz>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 56e18bad9e..2ad36f42cf 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -1791,12 +1791,13 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev,
 				!= 0)
 			return errval;
 
-		if (bond_ethdev_8023ad_flow_verify(bonded_eth_dev,
-				slave_eth_dev->data->port_id) != 0) {
+		errval = bond_ethdev_8023ad_flow_verify(bonded_eth_dev,
+				slave_eth_dev->data->port_id);
+		if (errval != 0) {
 			RTE_BOND_LOG(ERR,
-				"rte_eth_tx_queue_setup: port=%d queue_id %d, err (%d)",
-				slave_eth_dev->data->port_id, q_id, errval);
-			return -1;
+				"bond_ethdev_8023ad_flow_verify: port=%d, err (%d)",
+				slave_eth_dev->data->port_id, errval);
+			return errval;
 		}
 
 		if (internals->mode4.dedicated_queues.flow[slave_eth_dev->data->port_id] != NULL)
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:15.437848489 +0200
+++ 0062-net-bonding-fix-error-message-on-flow-verify.patch	2021-08-10 15:11:13.058638389 +0200
@@ -1 +1 @@
-From cb8dc97f9d7e48f6ac0f79587133ec6213ed1d18 Mon Sep 17 00:00:00 2001
+From 0d201efa284156695782ab65e293ebb8cc39eebf Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit cb8dc97f9d7e48f6ac0f79587133ec6213ed1d18 ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -21 +22 @@
-index b01ef003e6..4c43bf9166 100644
+index 56e18bad9e..2ad36f42cf 100644
@@ -24 +25 @@
-@@ -1805,12 +1805,13 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev,
+@@ -1791,12 +1791,13 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev,

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

* [dpdk-stable] patch 'net/bonding: check flow setting' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (60 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/bonding: fix error message on flow verify' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/softnic: fix connection memory leak' " christian.ehrhardt
                   ` (38 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Martin Havlik; +Cc: Min Hu, Andrew Rybchenko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/e8b31f7fd71c09bf27998ca21e5e727640035458

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From e8b31f7fd71c09bf27998ca21e5e727640035458 Mon Sep 17 00:00:00 2001
From: Martin Havlik <xhavli56@stud.fit.vutbr.cz>
Date: Tue, 22 Jun 2021 11:25:29 +0200
Subject: [PATCH] net/bonding: check flow setting

[ upstream commit d844400966d0071680d618c21a896ec8c73a50e6 ]

Return value from bond_ethdev_8023ad_flow_set() is now checked
and appropriate message is logged on error.

Fixes: 112891cd27e5 ("net/bonding: add dedicated HW queues for LACP control")

Signed-off-by: Martin Havlik <xhavli56@stud.fit.vutbr.cz>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 2ad36f42cf..7e4ed477a0 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -1805,8 +1805,14 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev,
 					internals->mode4.dedicated_queues.flow[slave_eth_dev->data->port_id],
 					&flow_error);
 
-		bond_ethdev_8023ad_flow_set(bonded_eth_dev,
+		errval = bond_ethdev_8023ad_flow_set(bonded_eth_dev,
 				slave_eth_dev->data->port_id);
+		if (errval != 0) {
+			RTE_BOND_LOG(ERR,
+				"bond_ethdev_8023ad_flow_set: port=%d, err (%d)",
+				slave_eth_dev->data->port_id, errval);
+			return errval;
+		}
 	}
 
 	/* Start device */
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:15.475781590 +0200
+++ 0063-net-bonding-check-flow-setting.patch	2021-08-10 15:11:13.062638416 +0200
@@ -1 +1 @@
-From d844400966d0071680d618c21a896ec8c73a50e6 Mon Sep 17 00:00:00 2001
+From e8b31f7fd71c09bf27998ca21e5e727640035458 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit d844400966d0071680d618c21a896ec8c73a50e6 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index 4c43bf9166..a6755661c4 100644
+index 2ad36f42cf..7e4ed477a0 100644
@@ -23 +24 @@
-@@ -1819,8 +1819,14 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev,
+@@ -1805,8 +1805,14 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev,

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

* [dpdk-stable] patch 'net/softnic: fix connection memory leak' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (61 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/bonding: check flow setting' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/mlx5: remove redundant operations in NEON Rx' " christian.ehrhardt
                   ` (37 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Dapeng Yu; +Cc: Andrew Rybchenko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/c9bf6d0d074891cd6b5d5932a1b43254c143f6c8

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From c9bf6d0d074891cd6b5d5932a1b43254c143f6c8 Mon Sep 17 00:00:00 2001
From: Dapeng Yu <dapengx.yu@intel.com>
Date: Fri, 9 Jul 2021 14:00:56 +0800
Subject: [PATCH] net/softnic: fix connection memory leak

[ upstream commit ae2b3ba6430d9f86cc3583b893f442aaa8934655 ]

In function softnic_conn_init(), a block of memory is allocated as
connection buffer, but it is never freed in softnic_conn_free(),
which cause memory leak.

Fixes: 7709a63bf178 ("net/softnic: add connection agent")

Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 drivers/net/softnic/conn.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/softnic/conn.c b/drivers/net/softnic/conn.c
index 8b66580887..5b031358d5 100644
--- a/drivers/net/softnic/conn.c
+++ b/drivers/net/softnic/conn.c
@@ -144,6 +144,7 @@ softnic_conn_free(struct softnic_conn *conn)
 
 	free(conn->msg_out);
 	free(conn->msg_in);
+	free(conn->buf);
 	free(conn->prompt);
 	free(conn->welcome);
 	free(conn);
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:15.511211519 +0200
+++ 0064-net-softnic-fix-connection-memory-leak.patch	2021-08-10 15:11:13.062638416 +0200
@@ -1 +1 @@
-From ae2b3ba6430d9f86cc3583b893f442aaa8934655 Mon Sep 17 00:00:00 2001
+From c9bf6d0d074891cd6b5d5932a1b43254c143f6c8 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit ae2b3ba6430d9f86cc3583b893f442aaa8934655 ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org

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

* [dpdk-stable] patch 'net/mlx5: remove redundant operations in NEON Rx' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (62 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/softnic: fix connection memory leak' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/mlx5: fix typo in vectorized Rx comments' " christian.ehrhardt
                   ` (36 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Ruifeng Wang; +Cc: Viacheslav Ovsiienko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/7118e13be63b977f6042a7d13517f61a7a147910

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 7118e13be63b977f6042a7d13517f61a7a147910 Mon Sep 17 00:00:00 2001
From: Ruifeng Wang <ruifeng.wang@arm.com>
Date: Wed, 7 Jul 2021 17:03:06 +0800
Subject: [PATCH] net/mlx5: remove redundant operations in NEON Rx

[ upstream commit ff6fcd415f4b2be7572abffa5284978c176d3de4 ]

Mask of entries after the compressed CQE is covered by invalid mask of
non-compressed valid CQEs. Hence remove redundant calculation on mask.
The change showed slight performance uplift on N1SDP.

Fixes: 570acdb1da8a ("net/mlx5: add vectorized Rx/Tx burst for ARM")

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
index 01b834bb7c..d72675281f 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
+++ b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
@@ -671,16 +671,15 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
 		comp_idx = __builtin_clzl(vget_lane_u64(vreinterpret_u64_u16(
 					  comp_mask), 0)) /
 					  (sizeof(uint16_t) * 8);
-		/* D.6 mask out entries after the compressed CQE. */
-		mask = vcreate_u16(comp_idx < MLX5_VPMD_DESCS_PER_LOOP ?
-				   -1UL >> (comp_idx * sizeof(uint16_t) * 8) :
-				   0);
-		invalid_mask = vorr_u16(invalid_mask, mask);
+		invalid_mask = vorr_u16(invalid_mask, comp_mask);
 		/* D.7 count non-compressed valid CQEs. */
 		n = __builtin_clzl(vget_lane_u64(vreinterpret_u64_u16(
 				   invalid_mask), 0)) / (sizeof(uint16_t) * 8);
 		nocmp_n += n;
-		/* D.2 get the final invalid mask. */
+		/*
+		 * D.2 mask out entries after the compressed CQE.
+		 *     get the final invalid mask.
+		 */
 		mask = vcreate_u16(n < MLX5_VPMD_DESCS_PER_LOOP ?
 				   -1UL >> (n * sizeof(uint16_t) * 8) : 0);
 		invalid_mask = vorr_u16(invalid_mask, mask);
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:15.546177327 +0200
+++ 0065-net-mlx5-remove-redundant-operations-in-NEON-Rx.patch	2021-08-10 15:11:13.062638416 +0200
@@ -1 +1 @@
-From ff6fcd415f4b2be7572abffa5284978c176d3de4 Mon Sep 17 00:00:00 2001
+From 7118e13be63b977f6042a7d13517f61a7a147910 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit ff6fcd415f4b2be7572abffa5284978c176d3de4 ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index 5c569ee199..4d1710b837 100644
+index 01b834bb7c..d72675281f 100644
@@ -23 +24 @@
-@@ -767,16 +767,15 @@ rxq_cq_process_v(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cq,
+@@ -671,16 +671,15 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,

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

* [dpdk-stable] patch 'net/mlx5: fix typo in vectorized Rx comments' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (63 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/mlx5: remove redundant operations in NEON Rx' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/mvpp2: fix port speed overflow' " christian.ehrhardt
                   ` (35 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Sarosh Arif; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/c9440cf1b76dd36df14f8ddb5e1170bd7df56166

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From c9440cf1b76dd36df14f8ddb5e1170bd7df56166 Mon Sep 17 00:00:00 2001
From: Sarosh Arif <sarosh.arif@emumba.com>
Date: Tue, 8 Jun 2021 16:08:50 +0500
Subject: [PATCH] net/mlx5: fix typo in vectorized Rx comments

[ upstream commit 6e695b0cda4728ec37bd0aa2310d4b967f4ca86d ]

Change "returing" to "returning".

Fixes: 2e542da70937 ("net/mlx5: add Altivec Rx")
Fixes: 570acdb1da8a ("net/mlx5: add vectorized Rx/Tx burst for ARM")
Fixes: 3c2ddbd413e3 ("net/mlx5: separate shareable vector functions")

Signed-off-by: Sarosh Arif <sarosh.arif@emumba.com>
---
 drivers/net/mlx5/mlx5_rxtx_vec_altivec.h | 2 +-
 drivers/net/mlx5/mlx5_rxtx_vec_neon.h    | 2 +-
 drivers/net/mlx5/mlx5_rxtx_vec_sse.h     | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h b/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h
index 7160d202dd..acbc329674 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h
+++ b/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h
@@ -674,7 +674,7 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
 
 	/*
 	 * A. load first Qword (8bytes) in one loop.
-	 * B. copy 4 mbuf pointers from elts ring to returing pkts.
+	 * B. copy 4 mbuf pointers from elts ring to returning pkts.
 	 * C. load remaining CQE data and extract necessary fields.
 	 *    Final 16bytes cqes[] extracted from original 64bytes CQE has the
 	 *    following structure:
diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
index d72675281f..51ad62dd7f 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
+++ b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
@@ -497,7 +497,7 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
 	 * there's no instruction to count trailing zeros. __builtin_clzl() is
 	 * used instead.
 	 *
-	 * A. copy 4 mbuf pointers from elts ring to returing pkts.
+	 * A. copy 4 mbuf pointers from elts ring to returning pkts.
 	 * B. load 64B CQE and extract necessary fields
 	 *    Final 16bytes cqes[] extracted from original 64bytes CQE has the
 	 *    following structure:
diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h b/drivers/net/mlx5/mlx5_rxtx_vec_sse.h
index a9d9e8e7d9..2a983c12a1 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h
+++ b/drivers/net/mlx5/mlx5_rxtx_vec_sse.h
@@ -481,7 +481,7 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
 	assert(rxq->decompressed == 0);
 	/*
 	 * A. load first Qword (8bytes) in one loop.
-	 * B. copy 4 mbuf pointers from elts ring to returing pkts.
+	 * B. copy 4 mbuf pointers from elts ring to returning pkts.
 	 * C. load remained CQE data and extract necessary fields.
 	 *    Final 16bytes cqes[] extracted from original 64bytes CQE has the
 	 *    following structure:
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:15.580119957 +0200
+++ 0066-net-mlx5-fix-typo-in-vectorized-Rx-comments.patch	2021-08-10 15:11:13.066638446 +0200
@@ -1 +1 @@
-From 6e695b0cda4728ec37bd0aa2310d4b967f4ca86d Mon Sep 17 00:00:00 2001
+From c9440cf1b76dd36df14f8ddb5e1170bd7df56166 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 6e695b0cda4728ec37bd0aa2310d4b967f4ca86d ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -21 +22 @@
-index 648c59e2c2..101f49b051 100644
+index 7160d202dd..acbc329674 100644
@@ -24 +25 @@
-@@ -840,7 +840,7 @@ rxq_cq_process_v(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cq,
+@@ -674,7 +674,7 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
@@ -34 +35 @@
-index 4d1710b837..77979c939c 100644
+index d72675281f..51ad62dd7f 100644
@@ -37 +38 @@
-@@ -593,7 +593,7 @@ rxq_cq_process_v(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cq,
+@@ -497,7 +497,7 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
@@ -47 +48 @@
-index 661fa7273c..7fee4355cf 100644
+index a9d9e8e7d9..2a983c12a1 100644
@@ -50,2 +51,2 @@
-@@ -565,7 +565,7 @@ rxq_cq_process_v(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cq,
- 	const __m128i flow_mark_adj = _mm_set_epi32(rxq->mark * (-1), 0, 0, 0);
+@@ -481,7 +481,7 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
+ 	assert(rxq->decompressed == 0);

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

* [dpdk-stable] patch 'net/mvpp2: fix port speed overflow' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (64 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/mlx5: fix typo in vectorized Rx comments' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/mvpp2: fix configured state dependency' " christian.ehrhardt
                   ` (34 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Dana Vardi; +Cc: Liron Himi, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/de826be26ae7135eb30e9f588342b3f911a64e6c

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From de826be26ae7135eb30e9f588342b3f911a64e6c Mon Sep 17 00:00:00 2001
From: Dana Vardi <danat@marvell.com>
Date: Sun, 11 Jul 2021 16:11:43 +0300
Subject: [PATCH] net/mvpp2: fix port speed overflow

[ upstream commit 8fa07a68a6f842aa81b8949976e8088e2b6318a3 ]

ethtool_cmd_speed return uint32 and after the arithmetic
operation in mrvl_get_max_rate func the result is out of range.

Fixes: 429c394417 ("net/mvpp2: support traffic manager")

Signed-off-by: Dana Vardi <danat@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
---
 drivers/net/mvpp2/mrvl_tm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mvpp2/mrvl_tm.c b/drivers/net/mvpp2/mrvl_tm.c
index 3de8997030..7fcd37229c 100644
--- a/drivers/net/mvpp2/mrvl_tm.c
+++ b/drivers/net/mvpp2/mrvl_tm.c
@@ -57,7 +57,7 @@ mrvl_get_max_rate(struct rte_eth_dev *dev, uint64_t *rate)
 
 	close(fd);
 
-	*rate = ethtool_cmd_speed(&edata) * 1000 * 1000 / 8;
+	*rate = (uint64_t)ethtool_cmd_speed(&edata) * 1000 * 1000 / 8;
 
 	return 0;
 }
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:15.615269865 +0200
+++ 0067-net-mvpp2-fix-port-speed-overflow.patch	2021-08-10 15:11:13.066638446 +0200
@@ -1 +1 @@
-From 8fa07a68a6f842aa81b8949976e8088e2b6318a3 Mon Sep 17 00:00:00 2001
+From de826be26ae7135eb30e9f588342b3f911a64e6c Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 8fa07a68a6f842aa81b8949976e8088e2b6318a3 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
-index e98f576cfa..7e3c46f956 100644
+index 3de8997030..7fcd37229c 100644

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

* [dpdk-stable] patch 'net/mvpp2: fix configured state dependency' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (65 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/mvpp2: fix port speed overflow' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/bnxt: fix nested lock during bonding' " christian.ehrhardt
                   ` (33 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Dana Vardi; +Cc: Liron Himi, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/27637e4d84284cb55aa7834b5cfa42fdc29e0253

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 27637e4d84284cb55aa7834b5cfa42fdc29e0253 Mon Sep 17 00:00:00 2001
From: Dana Vardi <danat@marvell.com>
Date: Sun, 11 Jul 2021 16:12:49 +0300
Subject: [PATCH] net/mvpp2: fix configured state dependency

[ upstream commit e622c1a88e3507dc6d2c9dd6ec555905d1b5baf1 ]

Need to set configure flag to allow create and commit mrvl tm
hierarchy tree. tm configuration depends on parameters that are
being set in port configure stage, e.g. nb_tx_queues.
This also aligned with the tm api description.

Fixes: 429c394417 ("net/mvpp2: support traffic manager")

Signed-off-by: Dana Vardi <danat@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
---
 drivers/net/mvpp2/mrvl_ethdev.c | 12 ++++--
 drivers/net/mvpp2/mrvl_ethdev.h |  2 +
 drivers/net/mvpp2/mrvl_tm.c     | 65 +++++++++++++++++++++++++++++++++
 3 files changed, 76 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c
index 33386c44b8..7571e16343 100644
--- a/drivers/net/mvpp2/mrvl_ethdev.c
+++ b/drivers/net/mvpp2/mrvl_ethdev.c
@@ -400,12 +400,18 @@ mrvl_dev_configure(struct rte_eth_dev *dev)
 	    dev->data->dev_conf.rxmode.mq_mode == ETH_MQ_RX_RSS) {
 		MRVL_LOG(WARNING, "Disabling hash for 1 rx queue");
 		priv->ppio_params.inqs_params.hash_type = PP2_PPIO_HASH_T_NONE;
-
+		priv->configured = 1;
 		return 0;
 	}
 
-	return mrvl_configure_rss(priv,
-				  &dev->data->dev_conf.rx_adv_conf.rss_conf);
+	ret = mrvl_configure_rss(priv,
+			&dev->data->dev_conf.rx_adv_conf.rss_conf);
+	if (ret < 0)
+		return ret;
+
+	priv->configured = 1;
+
+	return 0;
 }
 
 /**
diff --git a/drivers/net/mvpp2/mrvl_ethdev.h b/drivers/net/mvpp2/mrvl_ethdev.h
index eee5182ce8..8566873199 100644
--- a/drivers/net/mvpp2/mrvl_ethdev.h
+++ b/drivers/net/mvpp2/mrvl_ethdev.h
@@ -208,6 +208,8 @@ struct mrvl_priv {
 	LIST_HEAD(shaper_profiles, mrvl_tm_shaper_profile) shaper_profiles;
 	LIST_HEAD(nodes, mrvl_tm_node) nodes;
 	uint64_t rate_max;
+
+	uint8_t configured; /** indicates if device has been configured */
 };
 
 /** Flow operations forward declaration. */
diff --git a/drivers/net/mvpp2/mrvl_tm.c b/drivers/net/mvpp2/mrvl_tm.c
index 7fcd37229c..3e3b0c1f9b 100644
--- a/drivers/net/mvpp2/mrvl_tm.c
+++ b/drivers/net/mvpp2/mrvl_tm.c
@@ -146,6 +146,11 @@ mrvl_node_type_get(struct rte_eth_dev *dev, uint32_t node_id, int *is_leaf,
 	struct mrvl_priv *priv = dev->data->dev_private;
 	struct mrvl_tm_node *node;
 
+	if (!priv->configured)
+		return -rte_tm_error_set(error, ENODEV,
+					 RTE_TM_ERROR_TYPE_UNSPECIFIED,
+					 NULL, "Port didn't configured\n");
+
 	if (!is_leaf)
 		return -rte_tm_error_set(error, EINVAL,
 					 RTE_TM_ERROR_TYPE_UNSPECIFIED,
@@ -177,6 +182,11 @@ mrvl_capabilities_get(struct rte_eth_dev *dev,
 {
 	struct mrvl_priv *priv = dev->data->dev_private;
 
+	if (!priv->configured)
+		return -rte_tm_error_set(error, ENODEV,
+					 RTE_TM_ERROR_TYPE_UNSPECIFIED,
+					 NULL, "Port didn't configured\n");
+
 	if (!cap)
 		return -rte_tm_error_set(error, EINVAL,
 					 RTE_TM_ERROR_TYPE_UNSPECIFIED,
@@ -224,6 +234,11 @@ mrvl_level_capabilities_get(struct rte_eth_dev *dev,
 {
 	struct mrvl_priv *priv = dev->data->dev_private;
 
+	if (!priv->configured)
+		return -rte_tm_error_set(error, ENODEV,
+					 RTE_TM_ERROR_TYPE_UNSPECIFIED,
+					 NULL, "Port didn't configured\n");
+
 	if (!cap)
 		return -rte_tm_error_set(error, EINVAL,
 					 RTE_TM_ERROR_TYPE_UNSPECIFIED,
@@ -284,6 +299,11 @@ mrvl_node_capabilities_get(struct rte_eth_dev *dev, uint32_t node_id,
 	struct mrvl_priv *priv = dev->data->dev_private;
 	struct mrvl_tm_node *node;
 
+	if (!priv->configured)
+		return -rte_tm_error_set(error, ENODEV,
+					 RTE_TM_ERROR_TYPE_UNSPECIFIED,
+					 NULL, "Port didn't configured\n");
+
 	if (!cap)
 		return -rte_tm_error_set(error, EINVAL,
 					 RTE_TM_ERROR_TYPE_UNSPECIFIED,
@@ -352,6 +372,11 @@ mrvl_shaper_profile_add(struct rte_eth_dev *dev, uint32_t shaper_profile_id,
 	struct mrvl_priv *priv = dev->data->dev_private;
 	struct mrvl_tm_shaper_profile *profile;
 
+	if (!priv->configured)
+		return -rte_tm_error_set(error, ENODEV,
+					 RTE_TM_ERROR_TYPE_UNSPECIFIED,
+					 NULL, "Port didn't configured\n");
+
 	if (!params)
 		return -rte_tm_error_set(error, EINVAL,
 					 RTE_TM_ERROR_TYPE_UNSPECIFIED,
@@ -420,6 +445,11 @@ mrvl_shaper_profile_delete(struct rte_eth_dev *dev, uint32_t shaper_profile_id,
 	struct mrvl_priv *priv = dev->data->dev_private;
 	struct mrvl_tm_shaper_profile *profile;
 
+	if (!priv->configured)
+		return -rte_tm_error_set(error, ENODEV,
+					 RTE_TM_ERROR_TYPE_UNSPECIFIED,
+					 NULL, "Port didn't configured\n");
+
 	profile = mrvl_shaper_profile_from_id(priv, shaper_profile_id);
 	if (!profile)
 		return -rte_tm_error_set(error, ENODEV,
@@ -566,6 +596,11 @@ mrvl_node_add(struct rte_eth_dev *dev, uint32_t node_id,
 	struct mrvl_tm_node *node, *parent = NULL;
 	int ret;
 
+	if (!priv->configured)
+		return -rte_tm_error_set(error, ENODEV,
+					 RTE_TM_ERROR_TYPE_UNSPECIFIED,
+					 NULL, "Port didn't configured\n");
+
 	if (priv->ppio)
 		return -rte_tm_error_set(error, EPERM,
 					 RTE_TM_ERROR_TYPE_UNSPECIFIED,
@@ -651,6 +686,11 @@ mrvl_node_delete(struct rte_eth_dev *dev, uint32_t node_id,
 	struct mrvl_priv *priv = dev->data->dev_private;
 	struct mrvl_tm_node *node;
 
+	if (!priv->configured)
+		return -rte_tm_error_set(error, ENODEV,
+					 RTE_TM_ERROR_TYPE_UNSPECIFIED,
+					 NULL, "Port didn't configured\n");
+
 	if (priv->ppio) {
 		return -rte_tm_error_set(error, EPERM,
 					 RTE_TM_ERROR_TYPE_UNSPECIFIED,
@@ -715,6 +755,11 @@ mrvl_node_suspend(struct rte_eth_dev *dev, uint32_t node_id,
 	struct mrvl_tm_node *node, *tmp;
 	int ret;
 
+	if (!priv->configured)
+		return -rte_tm_error_set(error, ENODEV,
+					 RTE_TM_ERROR_TYPE_UNSPECIFIED,
+					 NULL, "Port didn't configured\n");
+
 	node = mrvl_node_from_id(priv, node_id);
 	if (!node)
 		return -rte_tm_error_set(error, ENODEV,
@@ -756,6 +801,11 @@ mrvl_node_resume(struct rte_eth_dev *dev, uint32_t node_id,
 	struct mrvl_tm_node *node;
 	int ret;
 
+	if (!priv->configured)
+		return -rte_tm_error_set(error, ENODEV,
+					 RTE_TM_ERROR_TYPE_UNSPECIFIED,
+					 NULL, "Port didn't configured\n");
+
 	node = mrvl_node_from_id(priv, node_id);
 	if (!node)
 		return -rte_tm_error_set(error, ENODEV,
@@ -792,6 +842,11 @@ mrvl_hierarchy_commit(struct rte_eth_dev *dev, int clear_on_fail,
 	struct mrvl_tm_node *node;
 	int ret;
 
+	if (!priv->configured)
+		return -rte_tm_error_set(error, ENODEV,
+					 RTE_TM_ERROR_TYPE_UNSPECIFIED,
+					 NULL, "Port didn't configured\n");
+
 	if (priv->ppio) {
 		ret = -rte_tm_error_set(error, EPERM,
 					RTE_TM_ERROR_TYPE_UNSPECIFIED,
@@ -898,6 +953,11 @@ mrvl_node_stats_read(struct rte_eth_dev *dev, uint32_t node_id,
 	struct mrvl_tm_node *node;
 	int ret;
 
+	if (!priv->configured)
+		return -rte_tm_error_set(error, ENODEV,
+					 RTE_TM_ERROR_TYPE_UNSPECIFIED,
+					 NULL, "Port didn't configured\n");
+
 	if (!priv->ppio) {
 		return -rte_tm_error_set(error, EPERM,
 					 RTE_TM_ERROR_TYPE_UNSPECIFIED,
@@ -967,6 +1027,11 @@ mrvl_node_stats_update(struct rte_eth_dev *dev, uint32_t node_id,
 	struct mrvl_priv *priv = dev->data->dev_private;
 	struct mrvl_tm_node *node;
 
+	if (!priv->configured)
+		return -rte_tm_error_set(error, ENODEV,
+					 RTE_TM_ERROR_TYPE_UNSPECIFIED,
+					 NULL, "Port didn't configured\n");
+
 	node = mrvl_node_from_id(priv, node_id);
 	if (!node)
 		return -rte_tm_error_set(error, ENODEV,
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:15.648382609 +0200
+++ 0068-net-mvpp2-fix-configured-state-dependency.patch	2021-08-10 15:11:13.066638446 +0200
@@ -1 +1 @@
-From e622c1a88e3507dc6d2c9dd6ec555905d1b5baf1 Mon Sep 17 00:00:00 2001
+From 27637e4d84284cb55aa7834b5cfa42fdc29e0253 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit e622c1a88e3507dc6d2c9dd6ec555905d1b5baf1 ]
+
@@ -12 +13,0 @@
-Cc: stable@dpdk.org
@@ -17 +18 @@
- drivers/net/mvpp2/mrvl_ethdev.c | 10 ++++-
+ drivers/net/mvpp2/mrvl_ethdev.c | 12 ++++--
@@ -20 +21 @@
- 3 files changed, 75 insertions(+), 2 deletions(-)
+ 3 files changed, 76 insertions(+), 3 deletions(-)
@@ -23 +24 @@
-index 63d348e279..1802695a0e 100644
+index 33386c44b8..7571e16343 100644
@@ -26 +27 @@
-@@ -533,12 +533,18 @@ mrvl_dev_configure(struct rte_eth_dev *dev)
+@@ -400,12 +400,18 @@ mrvl_dev_configure(struct rte_eth_dev *dev)
@@ -35,0 +37 @@
+-				  &dev->data->dev_conf.rx_adv_conf.rss_conf);
@@ -37 +39 @@
- 			&dev->data->dev_conf.rx_adv_conf.rss_conf);
++			&dev->data->dev_conf.rx_adv_conf.rss_conf);
@@ -48 +50 @@
-index fda239a53c..426cf33548 100644
+index eee5182ce8..8566873199 100644
@@ -51,4 +53,4 @@
-@@ -186,6 +186,8 @@ struct mrvl_priv {
- 
- 	uint8_t forward_bad_frames;
- 	uint32_t fill_bpool_buffs;
+@@ -208,6 +208,8 @@ struct mrvl_priv {
+ 	LIST_HEAD(shaper_profiles, mrvl_tm_shaper_profile) shaper_profiles;
+ 	LIST_HEAD(nodes, mrvl_tm_node) nodes;
+ 	uint64_t rate_max;
@@ -61 +63 @@
-index 7e3c46f956..9fac80b867 100644
+index 7fcd37229c..3e3b0c1f9b 100644
@@ -88 +90 @@
-@@ -228,6 +238,11 @@ mrvl_level_capabilities_get(struct rte_eth_dev *dev,
+@@ -224,6 +234,11 @@ mrvl_level_capabilities_get(struct rte_eth_dev *dev,
@@ -100 +102 @@
-@@ -294,6 +309,11 @@ mrvl_node_capabilities_get(struct rte_eth_dev *dev, uint32_t node_id,
+@@ -284,6 +299,11 @@ mrvl_node_capabilities_get(struct rte_eth_dev *dev, uint32_t node_id,
@@ -112 +114 @@
-@@ -366,6 +386,11 @@ mrvl_shaper_profile_add(struct rte_eth_dev *dev, uint32_t shaper_profile_id,
+@@ -352,6 +372,11 @@ mrvl_shaper_profile_add(struct rte_eth_dev *dev, uint32_t shaper_profile_id,
@@ -124 +126 @@
-@@ -434,6 +459,11 @@ mrvl_shaper_profile_delete(struct rte_eth_dev *dev, uint32_t shaper_profile_id,
+@@ -420,6 +445,11 @@ mrvl_shaper_profile_delete(struct rte_eth_dev *dev, uint32_t shaper_profile_id,
@@ -136 +138 @@
-@@ -580,6 +610,11 @@ mrvl_node_add(struct rte_eth_dev *dev, uint32_t node_id,
+@@ -566,6 +596,11 @@ mrvl_node_add(struct rte_eth_dev *dev, uint32_t node_id,
@@ -148 +150 @@
-@@ -665,6 +700,11 @@ mrvl_node_delete(struct rte_eth_dev *dev, uint32_t node_id,
+@@ -651,6 +686,11 @@ mrvl_node_delete(struct rte_eth_dev *dev, uint32_t node_id,
@@ -160 +162 @@
-@@ -729,6 +769,11 @@ mrvl_node_suspend(struct rte_eth_dev *dev, uint32_t node_id,
+@@ -715,6 +755,11 @@ mrvl_node_suspend(struct rte_eth_dev *dev, uint32_t node_id,
@@ -172 +174 @@
-@@ -770,6 +815,11 @@ mrvl_node_resume(struct rte_eth_dev *dev, uint32_t node_id,
+@@ -756,6 +801,11 @@ mrvl_node_resume(struct rte_eth_dev *dev, uint32_t node_id,
@@ -184 +186 @@
-@@ -806,6 +856,11 @@ mrvl_hierarchy_commit(struct rte_eth_dev *dev, int clear_on_fail,
+@@ -792,6 +842,11 @@ mrvl_hierarchy_commit(struct rte_eth_dev *dev, int clear_on_fail,
@@ -196 +198 @@
-@@ -912,6 +967,11 @@ mrvl_node_stats_read(struct rte_eth_dev *dev, uint32_t node_id,
+@@ -898,6 +953,11 @@ mrvl_node_stats_read(struct rte_eth_dev *dev, uint32_t node_id,
@@ -208 +210 @@
-@@ -981,6 +1041,11 @@ mrvl_node_stats_update(struct rte_eth_dev *dev, uint32_t node_id,
+@@ -967,6 +1027,11 @@ mrvl_node_stats_update(struct rte_eth_dev *dev, uint32_t node_id,

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

* [dpdk-stable] patch 'net/bnxt: fix nested lock during bonding' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (66 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/mvpp2: fix configured state dependency' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/bnxt: clear cached statistics' " christian.ehrhardt
                   ` (32 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Weifeng Li; +Cc: Ajit Khaparde, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/c6ff8fe4e7dbd2e26073187cbf09f00e6e339f85

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From c6ff8fe4e7dbd2e26073187cbf09f00e6e339f85 Mon Sep 17 00:00:00 2001
From: Weifeng Li <liweifeng96@126.com>
Date: Sat, 3 Jul 2021 06:20:42 -0400
Subject: [PATCH] net/bnxt: fix nested lock during bonding

[ upstream commit 8117f5f61a7399fb160cc48d05daf6e0aac734f8 ]

Bnxt PMD registers LSC callback (bond_ethdev_lsc_event_callback) when
working at bond mode. This callback will dead lock when LSC
interrupt triggered.

lsc interrupt ->
bnxt_handle_async_event ->
bnxt_link_update_op ->
bond_ethdev_lsc_event_callback (lsc_lock) ->
bnxt_link_update_op ->
bond_ethdev_lsc_event_callback (lsc_lock dead lock)

Fixes: c2faa1d1969e ("net/bnxt: add support for LSC interrupt event")

Signed-off-by: Weifeng Li <liweifeng96@126.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_cpr.c    | 2 ++
 drivers/net/bnxt/bnxt_ethdev.c | 5 -----
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c
index 26c7dae88f..f02cbbb23e 100644
--- a/drivers/net/bnxt/bnxt_cpr.c
+++ b/drivers/net/bnxt/bnxt_cpr.c
@@ -64,6 +64,8 @@ void bnxt_handle_async_event(struct bnxt *bp,
 	case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE:
 		/* FALLTHROUGH */
 		bnxt_link_update_op(bp->eth_dev, 0);
+		_rte_eth_dev_callback_process(bp->eth_dev,
+			RTE_ETH_EVENT_INTR_LSC, NULL);
 		break;
 	case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD:
 		PMD_DRV_LOG(INFO, "Async event: PF driver unloaded\n");
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index b3e95f72a0..057976026c 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -1238,11 +1238,6 @@ out:
 	if (new.link_status != eth_dev->data->dev_link.link_status ||
 	new.link_speed != eth_dev->data->dev_link.link_speed) {
 		rte_eth_linkstatus_set(eth_dev, &new);
-
-		_rte_eth_dev_callback_process(eth_dev,
-					      RTE_ETH_EVENT_INTR_LSC,
-					      NULL);
-
 		bnxt_print_link_info(eth_dev);
 	}
 
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:15.684551770 +0200
+++ 0069-net-bnxt-fix-nested-lock-during-bonding.patch	2021-08-10 15:11:13.070638474 +0200
@@ -1 +1 @@
-From 8117f5f61a7399fb160cc48d05daf6e0aac734f8 Mon Sep 17 00:00:00 2001
+From c6ff8fe4e7dbd2e26073187cbf09f00e6e339f85 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 8117f5f61a7399fb160cc48d05daf6e0aac734f8 ]
+
@@ -18 +19,0 @@
-Cc: stable@dpdk.org
@@ -28 +29 @@
-index 2c7fd78c3d..f4c9c72664 100644
+index 26c7dae88f..f02cbbb23e 100644
@@ -31 +32 @@
-@@ -111,6 +111,8 @@ void bnxt_handle_async_event(struct bnxt *bp,
+@@ -64,6 +64,8 @@ void bnxt_handle_async_event(struct bnxt *bp,
@@ -35 +36 @@
-+		rte_eth_dev_callback_process(bp->eth_dev,
++		_rte_eth_dev_callback_process(bp->eth_dev,
@@ -41 +42 @@
-index ee69296926..19d52fa82b 100644
+index b3e95f72a0..057976026c 100644
@@ -44 +45 @@
-@@ -1843,11 +1843,6 @@ out:
+@@ -1238,11 +1238,6 @@ out:
@@ -46 +47 @@
- 	    new.link_speed != eth_dev->data->dev_link.link_speed) {
+ 	new.link_speed != eth_dev->data->dev_link.link_speed) {
@@ -49,3 +50,3 @@
--		rte_eth_dev_callback_process(eth_dev,
--					     RTE_ETH_EVENT_INTR_LSC,
--					     NULL);
+-		_rte_eth_dev_callback_process(eth_dev,
+-					      RTE_ETH_EVENT_INTR_LSC,
+-					      NULL);

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

* [dpdk-stable] patch 'net/bnxt: clear cached statistics' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (67 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/bnxt: fix nested lock during bonding' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-11  8:54   ` Christian Ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/ice/base: revert change of first profile mask' " christian.ehrhardt
                   ` (31 subsequent siblings)
  100 siblings, 1 reply; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Kalesh AP; +Cc: Ajit Khaparde, Lance Richardson, Somnath Kotur, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/a0776bdb0995d658f4c9793b70b56fe7f4118e5f

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From a0776bdb0995d658f4c9793b70b56fe7f4118e5f Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Date: Tue, 13 Jul 2021 19:04:13 +0530
Subject: [PATCH] net/bnxt: clear cached statistics

[ upstream commit 84fd852caac19795d0a05af8dabce8f011fe61a4 ]

As part of the workaround put in the commit "219842b9990c",
driver caches the last read stats values from the hardware.
But this is not cleared during the clear stats operation. This
results in showing up stale stats values while reading the stats
after the clear operation.

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>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
 drivers/net/bnxt/bnxt_stats.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/net/bnxt/bnxt_stats.c b/drivers/net/bnxt/bnxt_stats.c
index 692b0967eb..a30e2b465d 100644
--- a/drivers/net/bnxt/bnxt_stats.c
+++ b/drivers/net/bnxt/bnxt_stats.c
@@ -424,6 +424,16 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
 	return rc;
 }
 
+static void bnxt_clear_prev_stat(struct bnxt *bp)
+{
+	/*
+	 * Clear the cached values of stats returned by HW in the previous
+	 * get operation.
+	 */
+	memset(bp->prev_rx_ring_stats, 0, sizeof(struct bnxt_ring_stats) * bp->rx_cp_nr_rings);
+	memset(bp->prev_tx_ring_stats, 0, sizeof(struct bnxt_ring_stats) * bp->tx_cp_nr_rings);
+}
+
 int bnxt_stats_reset_op(struct rte_eth_dev *eth_dev)
 {
 	struct bnxt *bp = eth_dev->data->dev_private;
@@ -446,6 +456,8 @@ int bnxt_stats_reset_op(struct rte_eth_dev *eth_dev)
 		rte_atomic64_clear(&rxq->rx_mbuf_alloc_fail);
 	}
 
+	bnxt_clear_prev_stat(bp);
+
 	return ret;
 }
 
@@ -611,5 +623,7 @@ int bnxt_dev_xstats_reset_op(struct rte_eth_dev *eth_dev)
 		PMD_DRV_LOG(ERR, "Failed to reset xstats: %s\n",
 			    strerror(-ret));
 
+	bnxt_clear_prev_stat(bp);
+
 	return ret;
 }
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:15.728060604 +0200
+++ 0070-net-bnxt-clear-cached-statistics.patch	2021-08-10 15:11:13.074638504 +0200
@@ -1 +1 @@
-From 84fd852caac19795d0a05af8dabce8f011fe61a4 Mon Sep 17 00:00:00 2001
+From a0776bdb0995d658f4c9793b70b56fe7f4118e5f Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 84fd852caac19795d0a05af8dabce8f011fe61a4 ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -24 +25 @@
-index c7b23f46a1..991eafc644 100644
+index 692b0967eb..a30e2b465d 100644
@@ -27 +28 @@
-@@ -603,6 +603,16 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
+@@ -424,6 +424,16 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
@@ -44 +45 @@
-@@ -625,6 +635,8 @@ int bnxt_stats_reset_op(struct rte_eth_dev *eth_dev)
+@@ -446,6 +456,8 @@ int bnxt_stats_reset_op(struct rte_eth_dev *eth_dev)
@@ -53 +54 @@
-@@ -933,6 +945,8 @@ int bnxt_dev_xstats_reset_op(struct rte_eth_dev *eth_dev)
+@@ -611,5 +623,7 @@ int bnxt_dev_xstats_reset_op(struct rte_eth_dev *eth_dev)
@@ -61 +61,0 @@
- 

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

* [dpdk-stable] patch 'net/ice/base: revert change of first profile mask' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (68 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/bnxt: clear cached statistics' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'distributor: fix 128-bit write alignment' " christian.ehrhardt
                   ` (30 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Wenjun Wu; +Cc: Qi Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/ff5c98462cd6787df67a0261d6b5a48ef6591711

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From ff5c98462cd6787df67a0261d6b5a48ef6591711 Mon Sep 17 00:00:00 2001
From: Wenjun Wu <wenjun1.wu@intel.com>
Date: Tue, 13 Jul 2021 09:51:04 +0800
Subject: [PATCH] net/ice/base: revert change of first profile mask

[ upstream commit 0a37b22875d67f37a561012e30456ad51bd79061 ]

Segmentation fault mentioned in below commit is related to
other root cause under investigation.
This reverts patch below since it may have potential
risk and side effect if the first profile mask is set to 0.

Fixes: 148fdf2d3537 ("net/ice/base: fix first profile mask")

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ice/base/ice_flex_pipe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ice/base/ice_flex_pipe.c b/drivers/net/ice/base/ice_flex_pipe.c
index eb0d784745..cc95a2e0d0 100644
--- a/drivers/net/ice/base/ice_flex_pipe.c
+++ b/drivers/net/ice/base/ice_flex_pipe.c
@@ -2953,7 +2953,7 @@ static void ice_init_prof_masks(struct ice_hw *hw, enum ice_block blk)
 	per_pf = ICE_PROF_MASK_COUNT / hw->dev_caps.num_funcs;
 
 	hw->blk[blk].masks.count = per_pf;
-	hw->blk[blk].masks.first = 0;
+	hw->blk[blk].masks.first = hw->pf_id * per_pf;
 
 	ice_memset(hw->blk[blk].masks.masks, 0,
 		   sizeof(hw->blk[blk].masks.masks), ICE_NONDMA_MEM);
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:15.762784212 +0200
+++ 0071-net-ice-base-revert-change-of-first-profile-mask.patch	2021-08-10 15:11:13.078638532 +0200
@@ -1 +1 @@
-From 0a37b22875d67f37a561012e30456ad51bd79061 Mon Sep 17 00:00:00 2001
+From ff5c98462cd6787df67a0261d6b5a48ef6591711 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 0a37b22875d67f37a561012e30456ad51bd79061 ]
+
@@ -12 +13,0 @@
-Cc: stable@dpdk.org
@@ -21 +22 @@
-index 829d88bba6..b3cea731f3 100644
+index eb0d784745..cc95a2e0d0 100644
@@ -24 +25 @@
-@@ -3432,7 +3432,7 @@ static void ice_init_prof_masks(struct ice_hw *hw, enum ice_block blk)
+@@ -2953,7 +2953,7 @@ static void ice_init_prof_masks(struct ice_hw *hw, enum ice_block blk)

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

* [dpdk-stable] patch 'distributor: fix 128-bit write alignment' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (69 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/ice/base: revert change of first profile mask' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'test/power: fix CPU frequency check for intel_pstate' " christian.ehrhardt
                   ` (29 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: David Hunt; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/4e4f0af3f678990014815f5326f5078234a3b24a

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 4e4f0af3f678990014815f5326f5078234a3b24a Mon Sep 17 00:00:00 2001
From: David Hunt <david.hunt@intel.com>
Date: Fri, 16 Jul 2021 14:32:37 +0100
Subject: [PATCH] distributor: fix 128-bit write alignment

[ upstream commit de8606bf73323dfa8395f2dc0a93dc6194ff21b7 ]

When the distributor sample app is built as a 32-bit app,
the data buffer passed to find_match_vec can be unaligned,
causing a segmentation fault due to writing a 128-bit value
using _mm_store_si128().  128-bit align the data being
passed in so this does not happen.

Fixes: 775003ad2f96 ("distributor: add new burst-capable library")

Signed-off-by: David Hunt <david.hunt@intel.com>
---
 lib/librte_distributor/rte_distributor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_distributor/rte_distributor.c b/lib/librte_distributor/rte_distributor.c
index ef34facba6..50a2d0ee11 100644
--- a/lib/librte_distributor/rte_distributor.c
+++ b/lib/librte_distributor/rte_distributor.c
@@ -477,7 +477,7 @@ rte_distributor_process(struct rte_distributor *d,
 		return 0;
 
 	while (next_idx < num_mbufs) {
-		uint16_t matches[RTE_DIST_BURST_SIZE];
+		uint16_t matches[RTE_DIST_BURST_SIZE] __rte_aligned(128);
 		unsigned int pkts;
 
 		if ((num_mbufs - next_idx) < RTE_DIST_BURST_SIZE)
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:15.804671149 +0200
+++ 0072-distributor-fix-128-bit-write-alignment.patch	2021-08-10 15:11:13.078638532 +0200
@@ -1 +1 @@
-From de8606bf73323dfa8395f2dc0a93dc6194ff21b7 Mon Sep 17 00:00:00 2001
+From 4e4f0af3f678990014815f5326f5078234a3b24a Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit de8606bf73323dfa8395f2dc0a93dc6194ff21b7 ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -17 +18 @@
- lib/distributor/rte_distributor.c | 2 +-
+ lib/librte_distributor/rte_distributor.c | 2 +-
@@ -20,5 +21,5 @@
-diff --git a/lib/distributor/rte_distributor.c b/lib/distributor/rte_distributor.c
-index 07e385a259..c210cf86bd 100644
---- a/lib/distributor/rte_distributor.c
-+++ b/lib/distributor/rte_distributor.c
-@@ -478,7 +478,7 @@ rte_distributor_process(struct rte_distributor *d,
+diff --git a/lib/librte_distributor/rte_distributor.c b/lib/librte_distributor/rte_distributor.c
+index ef34facba6..50a2d0ee11 100644
+--- a/lib/librte_distributor/rte_distributor.c
++++ b/lib/librte_distributor/rte_distributor.c
+@@ -477,7 +477,7 @@ rte_distributor_process(struct rte_distributor *d,

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

* [dpdk-stable] patch 'test/power: fix CPU frequency check for intel_pstate' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (70 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'distributor: fix 128-bit write alignment' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-11  9:51   ` Christian Ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'test/crypto: fix mempool size for session-less' " christian.ehrhardt
                   ` (28 subsequent siblings)
  100 siblings, 1 reply; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Richael Zhuang; +Cc: David Hunt, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/ed9be54294b454945f73d70ba5989bd5cd1e7bcb

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From ed9be54294b454945f73d70ba5989bd5cd1e7bcb Mon Sep 17 00:00:00 2001
From: Richael Zhuang <richael.zhuang@arm.com>
Date: Wed, 14 Jul 2021 18:44:05 +0800
Subject: [PATCH] test/power: fix CPU frequency check for intel_pstate

[ upstream commit cf1e803508009917f41dd5bb347e4140043afe03 ]

For acpi_cpufreq and cppc_cpufreq, both cpuinfo_cur_freq and
scaling_cur_freq exist. For pstate, only scaling_cur_freq exists.
And value in scaling_cur_freq and cpuinfo_cur_freq may not be the
same. For acpi_cpufreq and cppc_cpufreq, we should check
cpuinfo_cur_freq but not scaling_cur_freq. So here change the
check sequence to make sure it works for all cpufreq drivers.
Besides, add rounding for pstate driver.

Fixes: ff6dfb8e492f ("test/power: fix CPU frequency check")

Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Acked-by: David Hunt <david.hunt@intel.com>
---
 app/test/test_power_cpufreq.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/app/test/test_power_cpufreq.c b/app/test/test_power_cpufreq.c
index e5bf3b3367..c0e0431c5f 100644
--- a/app/test/test_power_cpufreq.c
+++ b/app/test/test_power_cpufreq.c
@@ -62,13 +62,13 @@ check_cur_freq(unsigned int lcore_id, uint32_t idx, bool turbo)
 	int i;
 
 	if (snprintf(fullpath, sizeof(fullpath),
-		TEST_POWER_SYSFILE_SCALING_FREQ, lcore_id) < 0) {
+		TEST_POWER_SYSFILE_CPUINFO_FREQ, lcore_id) < 0) {
 		return 0;
 	}
 	f = fopen(fullpath, "r");
 	if (f == NULL) {
 		if (snprintf(fullpath, sizeof(fullpath),
-			TEST_POWER_SYSFILE_CPUINFO_FREQ, lcore_id) < 0) {
+			TEST_POWER_SYSFILE_SCALING_FREQ, lcore_id) < 0) {
 			return 0;
 		}
 		f = fopen(fullpath, "r");
@@ -85,7 +85,7 @@ check_cur_freq(unsigned int lcore_id, uint32_t idx, bool turbo)
 		freq_conv = cur_freq;
 
 		env = rte_power_get_env();
-		if (env == PM_ENV_CPPC_CPUFREQ) {
+		if (env == PM_ENV_CPPC_CPUFREQ || env == PM_ENV_PSTATE_CPUFREQ) {
 			/* convert the frequency to nearest 100000 value
 			 * Ex: if cur_freq=1396789 then freq_conv=1400000
 			 * Ex: if cur_freq=800030 then freq_conv=800000
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:15.838864480 +0200
+++ 0073-test-power-fix-CPU-frequency-check-for-intel_pstate.patch	2021-08-10 15:11:13.078638532 +0200
@@ -1 +1 @@
-From cf1e803508009917f41dd5bb347e4140043afe03 Mon Sep 17 00:00:00 2001
+From ed9be54294b454945f73d70ba5989bd5cd1e7bcb Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit cf1e803508009917f41dd5bb347e4140043afe03 ]
+
@@ -15 +16,0 @@
-Cc: stable@dpdk.org
@@ -24 +25 @@
-index b8fc53925c..1a9549527e 100644
+index e5bf3b3367..c0e0431c5f 100644

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

* [dpdk-stable] patch 'test/crypto: fix mempool size for session-less' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (71 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'test/power: fix CPU frequency check for intel_pstate' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/mlx5: fix overflow in mempool argument' " christian.ehrhardt
                   ` (27 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Abhinandan Gujjar; +Cc: Ciara Power, Akhil Goyal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/76f8afec4acd5c34a769b20acd3f8f2f3b2b5eb8

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 76f8afec4acd5c34a769b20acd3f8f2f3b2b5eb8 Mon Sep 17 00:00:00 2001
From: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
Date: Sun, 18 Jul 2021 17:48:51 +0530
Subject: [PATCH] test/crypto: fix mempool size for session-less

[ upstream commit b812567ef6daa2a99a05a38bd79252c97e46078b ]

Currently, private_data_offset for the sessionless is computed
wrongly which includes extra bytes added by
sizeof(struct rte_crypto_sym_xform) * 2. This causes buffer
overflow which leads to test application crash while freeing the
ops mempool. This patch provides fix for the same and also takes
care of increasing the length of ops to accommodate space for
rte_event_crypto_metadata while creating the crypto ops mempool.

Fixes: 3c2c535ecfc0 ("test: add event crypto adapter auto-test")

Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
Reported-by: Ciara Power <ciara.power@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
---
 app/test/test_event_crypto_adapter.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c
index 1c0a0fa5e3..b30e0f8f3e 100644
--- a/app/test/test_event_crypto_adapter.c
+++ b/app/test/test_event_crypto_adapter.c
@@ -224,8 +224,7 @@ test_op_forward_mode(uint8_t session_less)
 		op->sess_type = RTE_CRYPTO_OP_SESSIONLESS;
 		first_xform = &cipher_xform;
 		sym_op->xform = first_xform;
-		uint32_t len = IV_OFFSET + MAXIMUM_IV_LENGTH +
-				(sizeof(struct rte_crypto_sym_xform) * 2);
+		uint32_t len = IV_OFFSET + MAXIMUM_IV_LENGTH;
 		op->private_data_offset = len;
 		/* Fill in private data information */
 		rte_memcpy(&m_data.response_info, &response_info,
@@ -419,8 +418,7 @@ test_op_new_mode(uint8_t session_less)
 		op->sess_type = RTE_CRYPTO_OP_SESSIONLESS;
 		first_xform = &cipher_xform;
 		sym_op->xform = first_xform;
-		uint32_t len = IV_OFFSET + MAXIMUM_IV_LENGTH +
-				(sizeof(struct rte_crypto_sym_xform) * 2);
+		uint32_t len = IV_OFFSET + MAXIMUM_IV_LENGTH;
 		op->private_data_offset = len;
 		/* Fill in private data information */
 		rte_memcpy(&m_data.response_info, &response_info,
@@ -516,7 +514,8 @@ configure_cryptodev(void)
 			NUM_MBUFS, MBUF_CACHE_SIZE,
 			DEFAULT_NUM_XFORMS *
 			sizeof(struct rte_crypto_sym_xform) +
-			MAXIMUM_IV_LENGTH,
+			MAXIMUM_IV_LENGTH +
+			sizeof(union rte_event_crypto_metadata),
 			rte_socket_id());
 	if (params.op_mpool == NULL) {
 		RTE_LOG(ERR, USER1, "Can't create CRYPTO_OP_POOL\n");
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:15.875900565 +0200
+++ 0074-test-crypto-fix-mempool-size-for-session-less.patch	2021-08-10 15:11:13.078638532 +0200
@@ -1 +1 @@
-From b812567ef6daa2a99a05a38bd79252c97e46078b Mon Sep 17 00:00:00 2001
+From 76f8afec4acd5c34a769b20acd3f8f2f3b2b5eb8 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b812567ef6daa2a99a05a38bd79252c97e46078b ]
+
@@ -15 +16,0 @@
-Cc: stable@dpdk.org
@@ -25 +26 @@
-index f689bc1f22..3ad20921e2 100644
+index 1c0a0fa5e3..b30e0f8f3e 100644
@@ -28 +29 @@
-@@ -228,8 +228,7 @@ test_op_forward_mode(uint8_t session_less)
+@@ -224,8 +224,7 @@ test_op_forward_mode(uint8_t session_less)
@@ -38 +39 @@
-@@ -423,8 +422,7 @@ test_op_new_mode(uint8_t session_less)
+@@ -419,8 +418,7 @@ test_op_new_mode(uint8_t session_less)
@@ -48 +49 @@
-@@ -520,7 +518,8 @@ configure_cryptodev(void)
+@@ -516,7 +514,8 @@ configure_cryptodev(void)

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

* [dpdk-stable] patch 'net/mlx5: fix overflow in mempool argument' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (72 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'test/crypto: fix mempool size for session-less' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/mlx5: fix Rx/Tx queue checks' " christian.ehrhardt
                   ` (26 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Michael Baum; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/373eada95f9c09b3f06bf62fd3ab9543c26f3373

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 373eada95f9c09b3f06bf62fd3ab9543c26f3373 Mon Sep 17 00:00:00 2001
From: Michael Baum <michaelba@nvidia.com>
Date: Thu, 1 Jul 2021 09:39:16 +0300
Subject: [PATCH] net/mlx5: fix overflow in mempool argument

[ upstream commit 2fec07edd4bca7ead134a5a1b4672a682d6c6ad4 ]

The mlx5_mprq_alloc_mp function makes shifting to the numeric constant
1, for sending it as a parameter to rte_mempool_create function.

The rte_mempool_create function expects to get void pointer (uintptr_t,
might be 64-bit) and instead gets a 32-bit variable, because the
numeric constant size is a 32-bit.
In case the shift is greater than 32 the variable might lose its value
even though the function might get 64-bit argument.

Change the size of the numeric constant 1 to uintptr_t.

Fixes: 3a22f3877c9d ("net/mlx5: replace external mbuf shared memory")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@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 e3f41d121d..c0605637a7 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -1683,7 +1683,7 @@ mlx5_mprq_alloc_mp(struct rte_eth_dev *dev)
 	snprintf(name, sizeof(name), "port-%u-mprq", dev->data->port_id);
 	mp = rte_mempool_create(name, obj_num, obj_size, MLX5_MPRQ_MP_CACHE_SZ,
 				0, NULL, NULL, mlx5_mprq_buf_init,
-				(void *)(uintptr_t)(1 << strd_num_n),
+				(void *)((uintptr_t)1 << strd_num_n),
 				dev->device->numa_node, 0);
 	if (mp == NULL) {
 		DRV_LOG(ERR,
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:15.911775885 +0200
+++ 0075-net-mlx5-fix-overflow-in-mempool-argument.patch	2021-08-10 15:11:13.082638562 +0200
@@ -1 +1 @@
-From 2fec07edd4bca7ead134a5a1b4672a682d6c6ad4 Mon Sep 17 00:00:00 2001
+From 373eada95f9c09b3f06bf62fd3ab9543c26f3373 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 2fec07edd4bca7ead134a5a1b4672a682d6c6ad4 ]
+
@@ -18 +19,0 @@
-Cc: stable@dpdk.org
@@ -27 +28 @@
-index 23685d7654..dacffc9251 100644
+index e3f41d121d..c0605637a7 100644
@@ -30 +31 @@
-@@ -1240,7 +1240,7 @@ mlx5_mprq_alloc_mp(struct rte_eth_dev *dev)
+@@ -1683,7 +1683,7 @@ mlx5_mprq_alloc_mp(struct rte_eth_dev *dev)

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

* [dpdk-stable] patch 'net/mlx5: fix Rx/Tx queue checks' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (73 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/mlx5: fix overflow in mempool argument' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/mlx5: reject inner ethernet matching in GTP' " christian.ehrhardt
                   ` (25 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Dmitry Kozlyuk; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/a1b444b122c2784e383cd9df6880087a1e038095

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From a1b444b122c2784e383cd9df6880087a1e038095 Mon Sep 17 00:00:00 2001
From: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Date: Tue, 20 Jul 2021 10:53:35 +0300
Subject: [PATCH] net/mlx5: fix Rx/Tx queue checks

[ upstream commit 94e257ec8ca82a98e38ffb9e7c117a8aac554489 ]

When device configuration was interrupted by a signal,
mlx5_rxq/txq_release() could access yet unitinialized array
and crash the application. Add checks whether queue array
is initialized.

Fixes: a1366b1a2be3 ("net/mlx5: add reference counter on DPDK Rx queues")
Fixes: 6e78005a9b30 ("net/mlx5: add reference counter on DPDK Tx queues")

Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_rxq.c | 2 +-
 drivers/net/mlx5/mlx5_txq.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index c0605637a7..aaa26a40d4 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -2074,7 +2074,7 @@ mlx5_rxq_release(struct rte_eth_dev *dev, uint16_t idx)
 	struct mlx5_priv *priv = dev->data->dev_private;
 	struct mlx5_rxq_ctrl *rxq_ctrl;
 
-	if (!(*priv->rxqs)[idx])
+	if (priv->rxqs == NULL || (*priv->rxqs)[idx] == NULL)
 		return 0;
 	rxq_ctrl = container_of((*priv->rxqs)[idx], struct mlx5_rxq_ctrl, rxq);
 	assert(rxq_ctrl->priv);
diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
index 9c929a57ea..a63b362048 100644
--- a/drivers/net/mlx5/mlx5_txq.c
+++ b/drivers/net/mlx5/mlx5_txq.c
@@ -1410,7 +1410,7 @@ mlx5_txq_release(struct rte_eth_dev *dev, uint16_t idx)
 	struct mlx5_priv *priv = dev->data->dev_private;
 	struct mlx5_txq_ctrl *txq;
 
-	if (!(*priv->txqs)[idx])
+	if (priv->txqs == NULL || (*priv->txqs)[idx] == NULL)
 		return 0;
 	txq = container_of((*priv->txqs)[idx], struct mlx5_txq_ctrl, txq);
 	if (txq->obj && !mlx5_txq_obj_release(txq->obj))
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:15.948402460 +0200
+++ 0076-net-mlx5-fix-Rx-Tx-queue-checks.patch	2021-08-10 15:11:13.082638562 +0200
@@ -1 +1 @@
-From 94e257ec8ca82a98e38ffb9e7c117a8aac554489 Mon Sep 17 00:00:00 2001
+From a1b444b122c2784e383cd9df6880087a1e038095 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 94e257ec8ca82a98e38ffb9e7c117a8aac554489 ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -23 +24 @@
-index dacffc9251..4a8b67e731 100644
+index c0605637a7..aaa26a40d4 100644
@@ -26 +27 @@
-@@ -1712,7 +1712,7 @@ mlx5_rxq_release(struct rte_eth_dev *dev, uint16_t idx)
+@@ -2074,7 +2074,7 @@ mlx5_rxq_release(struct rte_eth_dev *dev, uint16_t idx)
@@ -34 +35 @@
- 	if (__atomic_sub_fetch(&rxq_ctrl->refcnt, 1, __ATOMIC_RELAXED) > 1)
+ 	assert(rxq_ctrl->priv);
@@ -36 +37 @@
-index f68c0c61a9..eb4d34ca55 100644
+index 9c929a57ea..a63b362048 100644
@@ -39 +40 @@
-@@ -1246,7 +1246,7 @@ mlx5_txq_release(struct rte_eth_dev *dev, uint16_t idx)
+@@ -1410,7 +1410,7 @@ mlx5_txq_release(struct rte_eth_dev *dev, uint16_t idx)
@@ -41 +42 @@
- 	struct mlx5_txq_ctrl *txq_ctrl;
+ 	struct mlx5_txq_ctrl *txq;
@@ -46,2 +47,2 @@
- 	txq_ctrl = container_of((*priv->txqs)[idx], struct mlx5_txq_ctrl, txq);
- 	if (__atomic_sub_fetch(&txq_ctrl->refcnt, 1, __ATOMIC_RELAXED) > 1)
+ 	txq = container_of((*priv->txqs)[idx], struct mlx5_txq_ctrl, txq);
+ 	if (txq->obj && !mlx5_txq_obj_release(txq->obj))

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

* [dpdk-stable] patch 'net/mlx5: reject inner ethernet matching in GTP' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (74 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/mlx5: fix Rx/Tx queue checks' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-11  9:17   ` Christian Ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/bnxt: fix null dereference in interrupt handler' " christian.ehrhardt
                   ` (24 subsequent siblings)
  100 siblings, 1 reply; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Lior Margalit; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/72c1cc5d90154b1f8a8fc0b94f097c41cdb27b24

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 72c1cc5d90154b1f8a8fc0b94f097c41cdb27b24 Mon Sep 17 00:00:00 2001
From: Lior Margalit <lmargalit@nvidia.com>
Date: Tue, 20 Jul 2021 18:17:18 +0300
Subject: [PATCH] net/mlx5: reject inner ethernet matching in GTP

[ upstream commit 4e5ba38d56e3a037271547c90fbfc25c81938a4f ]

The user is able to create a flow rule pattern with ETH after GTP
although it is not supported by the flex-parser configuration.

Failed the rule validation in such case with proper error message.

Fixes: 23c1d42c7138 ("net/mlx5: split flow validation to dedicated function")

Signed-off-by: Lior Margalit <lmargalit@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 65064ffb07..cb08e5ec35 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -1441,6 +1441,10 @@ mlx5_flow_validate_item_eth(const struct rte_flow_item *item,
 		return rte_flow_error_set(error, EINVAL,
 					  RTE_FLOW_ERROR_TYPE_ITEM, item,
 					  "L2 layer should not follow VLAN");
+	if (item_flags & MLX5_FLOW_LAYER_GTP)
+		return rte_flow_error_set(error, EINVAL,
+					  RTE_FLOW_ERROR_TYPE_ITEM, item,
+					  "L2 layer should not follow GTP");
 	if (!mask)
 		mask = &rte_flow_item_eth_mask;
 	ret = mlx5_flow_item_acceptable(item, (const uint8_t *)mask,
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:15.983836535 +0200
+++ 0077-net-mlx5-reject-inner-ethernet-matching-in-GTP.patch	2021-08-10 15:11:13.090638619 +0200
@@ -1 +1 @@
-From 4e5ba38d56e3a037271547c90fbfc25c81938a4f Mon Sep 17 00:00:00 2001
+From 72c1cc5d90154b1f8a8fc0b94f097c41cdb27b24 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 4e5ba38d56e3a037271547c90fbfc25c81938a4f ]
+
@@ -12 +13,0 @@
-Cc: stable@dpdk.org
@@ -21 +22 @@
-index 2059f29b23..a3fdce685e 100644
+index 65064ffb07..cb08e5ec35 100644
@@ -24 +25 @@
-@@ -1999,6 +1999,10 @@ mlx5_flow_validate_item_eth(const struct rte_flow_item *item,
+@@ -1441,6 +1441,10 @@ mlx5_flow_validate_item_eth(const struct rte_flow_item *item,

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

* [dpdk-stable] patch 'net/bnxt: fix null dereference in interrupt handler' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (75 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/mlx5: reject inner ethernet matching in GTP' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-11  8:50   ` Christian Ehrhardt
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/softnic: fix memory leak in arguments parsing' " christian.ehrhardt
                   ` (23 subsequent siblings)
  100 siblings, 1 reply; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Kalesh AP; +Cc: Ajit Khaparde, Lance Richardson, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/8945c5a358b46e2351289050d4c1df982e76c95c

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 8945c5a358b46e2351289050d4c1df982e76c95c Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Date: Tue, 20 Jul 2021 21:51:58 +0530
Subject: [PATCH] net/bnxt: fix null dereference in interrupt handler

[ upstream commit 3f44ec48c733f7d7607877164c9aa0305de9cecd ]

Coverity reports that pointer "cpr->cp_ring_struct" may be
dereferenced with null value. This patch fixes this.

Coverity issue: 372063
Fixes: 5ed30db87fa8 ("net/bnxt: fix missing barriers in completion handling")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
---
 drivers/net/bnxt/bnxt_irq.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c
index 93779f4e0c..1f33429116 100644
--- a/drivers/net/bnxt/bnxt_irq.c
+++ b/drivers/net/bnxt/bnxt_irq.c
@@ -45,6 +45,7 @@ void bnxt_int_handler(void *param)
 			return;
 		}
 
+		cp_ring_size = cpr->cp_ring_struct->ring_size;
 		cons = RING_CMP(cpr->cp_ring_struct, raw_cons);
 		cmp = &cpr->cp_desc_ring[cons];
 
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:16.029545681 +0200
+++ 0078-net-bnxt-fix-null-dereference-in-interrupt-handler.patch	2021-08-10 15:11:13.090638619 +0200
@@ -1 +1 @@
-From 3f44ec48c733f7d7607877164c9aa0305de9cecd Mon Sep 17 00:00:00 2001
+From 8945c5a358b46e2351289050d4c1df982e76c95c Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 3f44ec48c733f7d7607877164c9aa0305de9cecd ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -17,2 +18,2 @@
- drivers/net/bnxt/bnxt_irq.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ drivers/net/bnxt/bnxt_irq.c | 1 +
+ 1 file changed, 1 insertion(+)
@@ -21 +22 @@
-index ebdac8385d..122a1f9908 100644
+index 93779f4e0c..1f33429116 100644
@@ -24,9 +25 @@
-@@ -33,7 +33,6 @@ void bnxt_int_handler(void *param)
- 		return;
- 
- 	raw_cons = cpr->cp_raw_cons;
--	cp_ring_size = cpr->cp_ring_struct->ring_size;
- 	pthread_mutex_lock(&bp->def_cp_lock);
- 	while (1) {
- 		if (!cpr || !cpr->cp_ring_struct || !cpr->cp_db.doorbell) {
-@@ -46,6 +45,7 @@ void bnxt_int_handler(void *param)
+@@ -45,6 +45,7 @@ void bnxt_int_handler(void *param)

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

* [dpdk-stable] patch 'net/softnic: fix memory leak in arguments parsing' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (76 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/bnxt: fix null dereference in interrupt handler' " christian.ehrhardt
@ 2021-08-10 15:39 ` christian.ehrhardt
  2021-08-11 10:19   ` Christian Ehrhardt
  2021-08-10 15:40 ` [dpdk-stable] patch 'net/hns3: fix filter parsing comment' " christian.ehrhardt
                   ` (22 subsequent siblings)
  100 siblings, 1 reply; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:39 UTC (permalink / raw)
  To: Dapeng Yu; +Cc: Jasvinder Singh, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/d313979fd603c8c588822a675b328fd000e17734

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From d313979fd603c8c588822a675b328fd000e17734 Mon Sep 17 00:00:00 2001
From: Dapeng Yu <dapengx.yu@intel.com>
Date: Thu, 15 Jul 2021 13:38:14 +0800
Subject: [PATCH] net/softnic: fix memory leak in arguments parsing

[ upstream commit d8f852f5f3692bbf15743d1aca25e6abcbe652ad ]

In function pmd_parse_args(), firmware path is duplicated from device
arguments as character string, but is never freed, which cause memory
leak.

This patch changes the type of firmware member of struct pmd_params to
character array, to make memory resource release unnecessary, and
changes the type of name member to character array, to keep the
consistency of character string handling in struct pmd_params.

Fixes: 7e68bc20f8c8 ("net/softnic: restructure")

Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
---
 drivers/net/softnic/rte_eth_softnic.c         | 30 ++++++++++++++++---
 .../net/softnic/rte_eth_softnic_internals.h   |  5 ++--
 2 files changed, 29 insertions(+), 6 deletions(-)

diff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c
index 11723778fd..f4858255ce 100644
--- a/drivers/net/softnic/rte_eth_softnic.c
+++ b/drivers/net/softnic/rte_eth_softnic.c
@@ -440,6 +440,7 @@ pmd_parse_args(struct pmd_params *p, const char *params)
 {
 	struct rte_kvargs *kvlist;
 	int ret = 0;
+	char *firmware = NULL;
 
 	kvlist = rte_kvargs_parse(params, pmd_valid_args);
 	if (kvlist == NULL)
@@ -447,7 +448,14 @@ pmd_parse_args(struct pmd_params *p, const char *params)
 
 	/* Set default values */
 	memset(p, 0, sizeof(*p));
-	p->firmware = SOFTNIC_FIRMWARE;
+	if (rte_strscpy(p->firmware, SOFTNIC_FIRMWARE,
+			sizeof(p->firmware)) < 0) {
+		PMD_LOG(WARNING,
+			"\"%s\": firmware path should be shorter than %zu",
+			SOFTNIC_FIRMWARE, sizeof(p->firmware));
+		ret = -EINVAL;
+		goto out_free;
+	}
 	p->cpu_id = SOFTNIC_CPU_ID;
 	p->sc = SOFTNIC_SC;
 	p->tm.n_queues = SOFTNIC_TM_N_QUEUES;
@@ -468,11 +476,20 @@ pmd_parse_args(struct pmd_params *p, const char *params)
 	/* Firmware script (optional) */
 	if (rte_kvargs_count(kvlist, PMD_PARAM_FIRMWARE) == 1) {
 		ret = rte_kvargs_process(kvlist, PMD_PARAM_FIRMWARE,
-			&get_string, &p->firmware);
+			&get_string, &firmware);
 		if (ret < 0)
 			goto out_free;
 	}
-
+	if (rte_strscpy(p->firmware, firmware,
+			sizeof(p->firmware)) < 0) {
+		PMD_LOG(WARNING,
+			"\"%s\": firmware path should be shorter than %zu",
+			firmware, sizeof(p->firmware));
+		free(firmware);
+		ret = -EINVAL;
+		goto out_free;
+	}
+	free(firmware);
 	/* Connection listening port (optional) */
 	if (rte_kvargs_count(kvlist, PMD_PARAM_CONN_PORT) == 1) {
 		ret = rte_kvargs_process(kvlist, PMD_PARAM_CONN_PORT,
@@ -621,7 +638,12 @@ pmd_probe(struct rte_vdev_device *vdev)
 	if (status)
 		return status;
 
-	p.name = name;
+	if (rte_strscpy(p.name, name, sizeof(p.name)) < 0) {
+		PMD_LOG(WARNING,
+			"\"%s\": device name should be shorter than %zu",
+			name, sizeof(p.name));
+		return -EINVAL;
+	}
 
 	/* Allocate and initialize soft ethdev private data */
 	dev_private = pmd_init(&p);
diff --git a/drivers/net/softnic/rte_eth_softnic_internals.h b/drivers/net/softnic/rte_eth_softnic_internals.h
index 6eec43b22b..f8549b2174 100644
--- a/drivers/net/softnic/rte_eth_softnic_internals.h
+++ b/drivers/net/softnic/rte_eth_softnic_internals.h
@@ -28,14 +28,15 @@
 #include "conn.h"
 
 #define NAME_SIZE                                            64
+#define SOFTNIC_PATH_MAX                                     4096
 
 /**
  * PMD Parameters
  */
 
 struct pmd_params {
-	const char *name;
-	const char *firmware;
+	char name[NAME_SIZE];
+	char firmware[SOFTNIC_PATH_MAX];
 	uint16_t conn_port;
 	uint32_t cpu_id;
 	int sc; /**< Service cores. */
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:16.063474888 +0200
+++ 0079-net-softnic-fix-memory-leak-in-arguments-parsing.patch	2021-08-10 15:11:13.090638619 +0200
@@ -1 +1 @@
-From d8f852f5f3692bbf15743d1aca25e6abcbe652ad Mon Sep 17 00:00:00 2001
+From d313979fd603c8c588822a675b328fd000e17734 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit d8f852f5f3692bbf15743d1aca25e6abcbe652ad ]
+
@@ -16 +17,0 @@
-Cc: stable@dpdk.org
@@ -26 +27 @@
-index f64023256d..0aa7147b13 100644
+index 11723778fd..f4858255ce 100644
@@ -91 +92 @@
-index 1b3186ef0b..07285ca315 100644
+index 6eec43b22b..f8549b2174 100644

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

* [dpdk-stable] patch 'net/hns3: fix filter parsing comment' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (77 preceding siblings ...)
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/softnic: fix memory leak in arguments parsing' " christian.ehrhardt
@ 2021-08-10 15:40 ` christian.ehrhardt
  2021-08-10 15:40 ` [dpdk-stable] patch 'net/hns3: fix Tx prepare after stop' " christian.ehrhardt
                   ` (21 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:40 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: Min Hu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/c5f7acac593f4b3358d3d2c449870f11d65114a5

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From c5f7acac593f4b3358d3d2c449870f11d65114a5 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Sat, 17 Jul 2021 10:02:51 +0800
Subject: [PATCH] net/hns3: fix filter parsing comment

[ upstream commit 529017f9e70b2b41a4febf283946183586c3ebb2 ]

This patch fixed incorrect comment of hns3_parse_fdir_filter().

Fixes: fcba820d9b9e ("net/hns3: support flow director")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 drivers/net/hns3/hns3_flow.c | 59 ++++++++++++++----------------------
 1 file changed, 23 insertions(+), 36 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 2153b84ab7..ad6f18ec68 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1075,42 +1075,29 @@ is_tunnel_packet(enum rte_flow_item_type type)
 }
 
 /*
- * Parse the rule to see if it is a IP or MAC VLAN flow director rule.
- * And get the flow director filter info BTW.
- * UDP/TCP/SCTP PATTERN:
- * The first not void item can be ETH or IPV4 or IPV6
- * The second not void item must be IPV4 or IPV6 if the first one is ETH.
- * The next not void item could be UDP or TCP or SCTP (optional)
- * The next not void item could be RAW (for flexbyte, optional)
- * The next not void item must be END.
- * A Fuzzy Match pattern can appear at any place before END.
- * Fuzzy Match is optional for IPV4 but is required for IPV6
- * MAC VLAN PATTERN:
- * The first not void item must be ETH.
- * The second not void item must be MAC VLAN.
- * The next not void item must be END.
- * ACTION:
- * The first not void action should be QUEUE or DROP.
- * The second not void optional action should be MARK,
- * mark_id is a uint32_t number.
- * The next not void action should be END.
- * UDP/TCP/SCTP pattern example:
- * ITEM		Spec			Mask
- * ETH		NULL			NULL
- * IPV4		src_addr 192.168.1.20	0xFFFFFFFF
- *		dst_addr 192.167.3.50	0xFFFFFFFF
- * UDP/TCP/SCTP	src_port	80	0xFFFF
- *		dst_port	80	0xFFFF
- * END
- * MAC VLAN pattern example:
- * ITEM		Spec			Mask
- * ETH		dst_addr
-		{0xAC, 0x7B, 0xA1,	{0xFF, 0xFF, 0xFF,
-		0x2C, 0x6D, 0x36}	0xFF, 0xFF, 0xFF}
- * MAC VLAN	tci	0x2016		0xEFFF
- * END
- * Other members in mask and spec should set to 0x00.
- * Item->last should be NULL.
+ * Parse the flow director rule.
+ * The supported PATTERN:
+ *   case: non-tunnel packet:
+ *     ETH : src-mac, dst-mac, ethertype
+ *     VLAN: tag1, tag2
+ *     IPv4: src-ip, dst-ip, tos, proto
+ *     IPv6: src-ip(last 32 bit addr), dst-ip(last 32 bit addr), proto
+ *     UDP : src-port, dst-port
+ *     TCP : src-port, dst-port
+ *     SCTP: src-port, dst-port, tag
+ *   case: tunnel packet:
+ *     OUTER-ETH: ethertype
+ *     OUTER-L3 : proto
+ *     OUTER-L4 : src-port, dst-port
+ *     TUNNEL   : vni, flow-id(only valid when NVGRE)
+ *     INNER-ETH/VLAN/IPv4/IPv6/UDP/TCP/SCTP: same as non-tunnel packet
+ * The supported ACTION:
+ *    QUEUE
+ *    DROP
+ *    COUNT
+ *    MARK: the id range [0, 4094]
+ *    FLAG
+ *    RSS: only valid if firmware support FD_QUEUE_REGION.
  */
 static int
 hns3_parse_fdir_filter(struct rte_eth_dev *dev,
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:16.101362922 +0200
+++ 0080-net-hns3-fix-filter-parsing-comment.patch	2021-08-10 15:11:13.090638619 +0200
@@ -1 +1 @@
-From 529017f9e70b2b41a4febf283946183586c3ebb2 Mon Sep 17 00:00:00 2001
+From c5f7acac593f4b3358d3d2c449870f11d65114a5 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 529017f9e70b2b41a4febf283946183586c3ebb2 ]
+
@@ -9 +10,0 @@
-Cc: stable@dpdk.org
@@ -18 +19 @@
-index 82810e00e8..755a6f2c7c 100644
+index 2153b84ab7..ad6f18ec68 100644
@@ -21 +22 @@
-@@ -1134,42 +1134,29 @@ is_tunnel_packet(enum rte_flow_item_type type)
+@@ -1075,42 +1075,29 @@ is_tunnel_packet(enum rte_flow_item_type type)

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

* [dpdk-stable] patch 'net/hns3: fix Tx prepare after stop' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (78 preceding siblings ...)
  2021-08-10 15:40 ` [dpdk-stable] patch 'net/hns3: fix filter parsing comment' " christian.ehrhardt
@ 2021-08-10 15:40 ` christian.ehrhardt
  2021-08-10 15:40 ` [dpdk-stable] patch 'net/hinic: increase protection of the VLAN' " christian.ehrhardt
                   ` (20 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:40 UTC (permalink / raw)
  To: Huisong Li; +Cc: Min Hu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/6bac8ed1b29535c07b3413e22409f0a147543cbb

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 6bac8ed1b29535c07b3413e22409f0a147543cbb Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Sat, 17 Jul 2021 10:02:56 +0800
Subject: [PATCH] net/hns3: fix Tx prepare after stop

[ upstream commit 1cc574c41a8e4a901b822aad9c85a07e98a7b661 ]

In some special scenarios, such as TSO scenarios, the user layer may need
to call the tx_pkt_prepare(), and then call tx_pkt_burst() to send packets.
If the return value of tx_pkt_parepare() isn't equal to the numbers of
packets requested to send, warning message may be printed at the user
layer. Currently, tx_pkt_prepare() is assigned to dummy function when
dev_stop() is called in hns3 PMD. At this moment, if user layer continues
to send packets, the warning message will always be printed. So this patch
modifies the address to NULL.

Fixes: 2790c6464725 ("net/hns3: support device reset")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 drivers/net/hns3/hns3_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index 7f24edf960..bc1806c0e7 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -2432,6 +2432,6 @@ void hns3_set_rxtx_function(struct rte_eth_dev *eth_dev)
 	} else {
 		eth_dev->rx_pkt_burst = hns3_dummy_rxtx_burst;
 		eth_dev->tx_pkt_burst = hns3_dummy_rxtx_burst;
-		eth_dev->tx_pkt_prepare = hns3_dummy_rxtx_burst;
+		eth_dev->tx_pkt_prepare = NULL;
 	}
 }
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:16.139490189 +0200
+++ 0081-net-hns3-fix-Tx-prepare-after-stop.patch	2021-08-10 15:11:13.094638647 +0200
@@ -1 +1 @@
-From 1cc574c41a8e4a901b822aad9c85a07e98a7b661 Mon Sep 17 00:00:00 2001
+From 6bac8ed1b29535c07b3413e22409f0a147543cbb Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 1cc574c41a8e4a901b822aad9c85a07e98a7b661 ]
+
@@ -16 +17,0 @@
-Cc: stable@dpdk.org
@@ -25 +26 @@
-index a86e105fbc..d3fbe082e6 100644
+index 7f24edf960..bc1806c0e7 100644
@@ -28 +29 @@
-@@ -4386,7 +4386,7 @@ void hns3_set_rxtx_function(struct rte_eth_dev *eth_dev)
+@@ -2432,6 +2432,6 @@ void hns3_set_rxtx_function(struct rte_eth_dev *eth_dev)
@@ -36 +36,0 @@
- 

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

* [dpdk-stable] patch 'net/hinic: increase protection of the VLAN' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (79 preceding siblings ...)
  2021-08-10 15:40 ` [dpdk-stable] patch 'net/hns3: fix Tx prepare after stop' " christian.ehrhardt
@ 2021-08-10 15:40 ` christian.ehrhardt
  2021-08-10 15:40 ` [dpdk-stable] patch 'net/hinic/base: fix LRO' " christian.ehrhardt
                   ` (19 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:40 UTC (permalink / raw)
  To: Guoyang Zhou; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/b846727f7cd5aabdf76f9421bd1c19dfbb1fcbe8

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From b846727f7cd5aabdf76f9421bd1c19dfbb1fcbe8 Mon Sep 17 00:00:00 2001
From: Guoyang Zhou <zhouguoyang@huawei.com>
Date: Fri, 16 Jul 2021 17:54:28 +0800
Subject: [PATCH] net/hinic: increase protection of the VLAN

[ upstream commit 2cfd68ec407609becd75661787043e7cae35f15c ]

If the VLAN id 0 is deleted for hinic, all packets without
VLAN will be discarded when the VLAN filter is turned on.

Fixes: 50ce3e7aec8f ("ethdev: fix VLAN offloads set if no relative capabilities")

Signed-off-by: Guoyang Zhou <zhouguoyang@huawei.com>
---
 drivers/net/hinic/hinic_pmd_ethdev.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c
index 791075e87b..a7c3d7bf75 100644
--- a/drivers/net/hinic/hinic_pmd_ethdev.c
+++ b/drivers/net/hinic/hinic_pmd_ethdev.c
@@ -1597,6 +1597,9 @@ static int hinic_vlan_filter_set(struct rte_eth_dev *dev,
 	if (vlan_id > RTE_ETHER_MAX_VLAN_ID)
 		return -EINVAL;
 
+	if (vlan_id == 0)
+		return 0;
+
 	func_id = hinic_global_func_id(nic_dev->hwdev);
 
 	if (enable) {
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:16.179822762 +0200
+++ 0082-net-hinic-increase-protection-of-the-VLAN.patch	2021-08-10 15:11:13.094638647 +0200
@@ -1 +1 @@
-From 2cfd68ec407609becd75661787043e7cae35f15c Mon Sep 17 00:00:00 2001
+From b846727f7cd5aabdf76f9421bd1c19dfbb1fcbe8 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 2cfd68ec407609becd75661787043e7cae35f15c ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -18 +19 @@
-index 946465779f..75849f28be 100644
+index 791075e87b..a7c3d7bf75 100644
@@ -21 +22 @@
-@@ -1617,6 +1617,9 @@ static int hinic_vlan_filter_set(struct rte_eth_dev *dev,
+@@ -1597,6 +1597,9 @@ static int hinic_vlan_filter_set(struct rte_eth_dev *dev,

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

* [dpdk-stable] patch 'net/hinic/base: fix LRO' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (80 preceding siblings ...)
  2021-08-10 15:40 ` [dpdk-stable] patch 'net/hinic: increase protection of the VLAN' " christian.ehrhardt
@ 2021-08-10 15:40 ` christian.ehrhardt
  2021-08-10 15:40 ` [dpdk-stable] patch 'bus/dpaa: fix freeing in FMAN interface destructor' " christian.ehrhardt
                   ` (18 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:40 UTC (permalink / raw)
  To: Guoyang Zhou; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/989c4886e7ce3e926ec16b11c0e04979ef48ceca

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 989c4886e7ce3e926ec16b11c0e04979ef48ceca Mon Sep 17 00:00:00 2001
From: Guoyang Zhou <zhouguoyang@huawei.com>
Date: Fri, 16 Jul 2021 17:54:29 +0800
Subject: [PATCH] net/hinic/base: fix LRO

[ upstream commit 68fa836d0ff83229e1404f1274c90e1bff2475c8 ]

The Rx queue must config as ceq disables, and must set MSI-X
state disabled. Otherwise when LRO is enables, there will be
problems with packet aggregation because of firmware.

Fixes: 9d02f40d6503 ("net/hinic: fix LRO")

Signed-off-by: Guoyang Zhou <zhouguoyang@huawei.com>
---
 drivers/net/hinic/base/hinic_pmd_nicio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/hinic/base/hinic_pmd_nicio.c b/drivers/net/hinic/base/hinic_pmd_nicio.c
index 9d9f2a7a56..928a35da78 100644
--- a/drivers/net/hinic/base/hinic_pmd_nicio.c
+++ b/drivers/net/hinic/base/hinic_pmd_nicio.c
@@ -230,8 +230,8 @@ static void hinic_rq_prepare_ctxt(struct hinic_rq *rq,
 	wq_block_pfn_hi = upper_32_bits(wq_block_pfn);
 	wq_block_pfn_lo = lower_32_bits(wq_block_pfn);
 
-	/* must config as ceq enable but do not generate ceq */
-	rq_ctxt->ceq_attr = RQ_CTXT_CEQ_ATTR_SET(1, EN) |
+	/* config as ceq disable, but must set msix state disable */
+	rq_ctxt->ceq_attr = RQ_CTXT_CEQ_ATTR_SET(0, EN) |
 			    RQ_CTXT_CEQ_ATTR_SET(1, OWNER);
 
 	rq_ctxt->pi_intr_attr = RQ_CTXT_PI_SET(pi_start, IDX) |
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:16.218738939 +0200
+++ 0083-net-hinic-base-fix-LRO.patch	2021-08-10 15:11:13.094638647 +0200
@@ -1 +1 @@
-From 68fa836d0ff83229e1404f1274c90e1bff2475c8 Mon Sep 17 00:00:00 2001
+From 989c4886e7ce3e926ec16b11c0e04979ef48ceca Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 68fa836d0ff83229e1404f1274c90e1bff2475c8 ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
-index 162308b02f..ad5db9f1de 100644
+index 9d9f2a7a56..928a35da78 100644

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

* [dpdk-stable] patch 'bus/dpaa: fix freeing in FMAN interface destructor' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (81 preceding siblings ...)
  2021-08-10 15:40 ` [dpdk-stable] patch 'net/hinic/base: fix LRO' " christian.ehrhardt
@ 2021-08-10 15:40 ` christian.ehrhardt
  2021-08-10 15:40 ` [dpdk-stable] patch 'net/sfc: fix MAC stats lock in xstats query by ID' " christian.ehrhardt
                   ` (17 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:40 UTC (permalink / raw)
  To: Hemant Agrawal; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/782d2bfc5bd385527a0e558dc132b0899306ca8e

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 782d2bfc5bd385527a0e558dc132b0899306ca8e Mon Sep 17 00:00:00 2001
From: Hemant Agrawal <hemant.agrawal@nxp.com>
Date: Mon, 19 Jul 2021 19:29:11 +0530
Subject: [PATCH] bus/dpaa: fix freeing in FMAN interface destructor

[ upstream commit 5ddcf3de6bc08fa7c14fd1ead86012aa575cf665 ]

if was allocated with rte_malloc, free shall be equivalent.

Fixes: 4762b3d419c3 ("bus/dpaa: delay fman device list to bus probe")

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/bus/dpaa/base/fman/fman.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bus/dpaa/base/fman/fman.c b/drivers/bus/dpaa/base/fman/fman.c
index 6d77a7e393..4affce433d 100644
--- a/drivers/bus/dpaa/base/fman/fman.c
+++ b/drivers/bus/dpaa/base/fman/fman.c
@@ -50,7 +50,7 @@ if_destructor(struct __fman_if *__if)
 		free(bp);
 	}
 cleanup:
-	free(__if);
+	rte_free(__if);
 }
 
 static int
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:16.255257650 +0200
+++ 0084-bus-dpaa-fix-freeing-in-FMAN-interface-destructor.patch	2021-08-10 15:11:13.098638677 +0200
@@ -1 +1 @@
-From 5ddcf3de6bc08fa7c14fd1ead86012aa575cf665 Mon Sep 17 00:00:00 2001
+From 782d2bfc5bd385527a0e558dc132b0899306ca8e Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 5ddcf3de6bc08fa7c14fd1ead86012aa575cf665 ]
+
@@ -9 +10,0 @@
-Cc: stable@dpdk.org
@@ -17 +18 @@
-index 692071b4b0..a14004d7fc 100644
+index 6d77a7e393..4affce433d 100644

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

* [dpdk-stable] patch 'net/sfc: fix MAC stats lock in xstats query by ID' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (82 preceding siblings ...)
  2021-08-10 15:40 ` [dpdk-stable] patch 'bus/dpaa: fix freeing in FMAN interface destructor' " christian.ehrhardt
@ 2021-08-10 15:40 ` christian.ehrhardt
  2021-08-10 15:40 ` [dpdk-stable] patch 'net/sfc: fix reading adapter state without locking' " christian.ehrhardt
                   ` (16 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:40 UTC (permalink / raw)
  To: Ivan Ilchenko; +Cc: Andrew Rybchenko, Andy Moreton, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/e675fd546c07cbeb919e4f10c028add7c58706c4

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From e675fd546c07cbeb919e4f10c028add7c58706c4 Mon Sep 17 00:00:00 2001
From: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Date: Fri, 23 Jul 2021 16:15:05 +0300
Subject: [PATCH] net/sfc: fix MAC stats lock in xstats query by ID

[ upstream commit 9076e855f171e6588d43c0c20956da154b8c4371 ]

Add MAC stats lock in xstats_get_by_id() callback before reading
number of supported MAC stats.

Fixes: 73280c1e4ff ("net/sfc: support xstats retrieval by ID")

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
---
 drivers/net/sfc/sfc_ethdev.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index 07eebb06d5..703139f2c9 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -772,12 +772,14 @@ sfc_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
 	int ret;
 	int rc;
 
-	if (unlikely(values == NULL) ||
-	    unlikely((ids == NULL) && (n < port->mac_stats_nb_supported)))
-		return port->mac_stats_nb_supported;
-
 	rte_spinlock_lock(&port->mac_stats_lock);
 
+	if (unlikely(values == NULL) ||
+	    unlikely(ids == NULL && n < port->mac_stats_nb_supported)) {
+		ret = port->mac_stats_nb_supported;
+		goto unlock;
+	}
+
 	rc = sfc_port_update_mac_stats(sa);
 	if (rc != 0) {
 		SFC_ASSERT(rc > 0);
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:16.291956804 +0200
+++ 0085-net-sfc-fix-MAC-stats-lock-in-xstats-query-by-ID.patch	2021-08-10 15:11:13.098638677 +0200
@@ -1 +1 @@
-From 9076e855f171e6588d43c0c20956da154b8c4371 Mon Sep 17 00:00:00 2001
+From e675fd546c07cbeb919e4f10c028add7c58706c4 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 9076e855f171e6588d43c0c20956da154b8c4371 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index 88896db1f8..d4ac61ff76 100644
+index 07eebb06d5..703139f2c9 100644
@@ -23 +24 @@
-@@ -789,12 +789,14 @@ sfc_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
+@@ -772,12 +772,14 @@ sfc_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,

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

* [dpdk-stable] patch 'net/sfc: fix reading adapter state without locking' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (83 preceding siblings ...)
  2021-08-10 15:40 ` [dpdk-stable] patch 'net/sfc: fix MAC stats lock in xstats query by ID' " christian.ehrhardt
@ 2021-08-10 15:40 ` christian.ehrhardt
  2021-08-10 15:40 ` [dpdk-stable] patch 'net/sfc: fix xstats query by ID according to ethdev' " christian.ehrhardt
                   ` (15 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:40 UTC (permalink / raw)
  To: Ivan Ilchenko; +Cc: Andrew Rybchenko, Andy Moreton, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/388d4a9184c7ab3739f45ae1e14d99a48d4826bf

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 388d4a9184c7ab3739f45ae1e14d99a48d4826bf Mon Sep 17 00:00:00 2001
From: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Date: Fri, 23 Jul 2021 16:15:06 +0300
Subject: [PATCH] net/sfc: fix reading adapter state without locking

[ upstream commit 17b0d7b36777341486efc0959d5ed69cf5af5f26 ]

Update MAC stats function reads adapter state with MAC stats locking
but without adapter locking. Add adapter locking before calling this
function and remove MAC stats locking since there's no point to have
it together with adapter locking. The second place MAC stats locking
is used is MAC stats reset function. It's called with adapter being
already locked so there's no point to use MAC stats locking anymore.

Fixes: 1caab2f1e68 ("net/sfc: add basic statistics")

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
---
 drivers/net/sfc/sfc.h        |  1 -
 drivers/net/sfc/sfc_ethdev.c | 28 ++++++++++++++++++++--------
 drivers/net/sfc/sfc_port.c   |  9 +++------
 3 files changed, 23 insertions(+), 15 deletions(-)

diff --git a/drivers/net/sfc/sfc.h b/drivers/net/sfc/sfc.h
index bce6beefaa..57a901b948 100644
--- a/drivers/net/sfc/sfc.h
+++ b/drivers/net/sfc/sfc.h
@@ -141,7 +141,6 @@ struct sfc_port {
 	unsigned int			nb_mcast_addrs;
 	uint8_t				*mcast_addrs;
 
-	rte_spinlock_t			mac_stats_lock;
 	uint64_t			*mac_stats_buf;
 	unsigned int			mac_stats_nb_supported;
 	efsys_mem_t			mac_stats_dma_mem;
diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index 703139f2c9..93c7ee6322 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -596,7 +596,7 @@ sfc_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 	uint64_t *mac_stats;
 	int ret;
 
-	rte_spinlock_lock(&port->mac_stats_lock);
+	sfc_adapter_lock(sa);
 
 	ret = sfc_port_update_mac_stats(sa);
 	if (ret != 0)
@@ -669,7 +669,7 @@ sfc_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 	}
 
 unlock:
-	rte_spinlock_unlock(&port->mac_stats_lock);
+	sfc_adapter_unlock(sa);
 	SFC_ASSERT(ret >= 0);
 	return -ret;
 }
@@ -681,12 +681,15 @@ sfc_stats_reset(struct rte_eth_dev *dev)
 	struct sfc_port *port = &sa->port;
 	int rc;
 
+	sfc_adapter_lock(sa);
+
 	if (sa->state != SFC_ADAPTER_STARTED) {
 		/*
 		 * The operation cannot be done if port is not started; it
 		 * will be scheduled to be done during the next port start
 		 */
 		port->mac_stats_reset_pending = B_TRUE;
+		sfc_adapter_unlock(sa);
 		return 0;
 	}
 
@@ -694,6 +697,8 @@ sfc_stats_reset(struct rte_eth_dev *dev)
 	if (rc != 0)
 		sfc_err(sa, "failed to reset statistics (rc = %d)", rc);
 
+	sfc_adapter_unlock(sa);
+
 	SFC_ASSERT(rc >= 0);
 	return -rc;
 }
@@ -709,7 +714,7 @@ sfc_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
 	unsigned int i;
 	int nstats = 0;
 
-	rte_spinlock_lock(&port->mac_stats_lock);
+	sfc_adapter_lock(sa);
 
 	rc = sfc_port_update_mac_stats(sa);
 	if (rc != 0) {
@@ -731,7 +736,7 @@ sfc_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
 	}
 
 unlock:
-	rte_spinlock_unlock(&port->mac_stats_lock);
+	sfc_adapter_unlock(sa);
 
 	return nstats;
 }
@@ -772,7 +777,7 @@ sfc_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
 	int ret;
 	int rc;
 
-	rte_spinlock_lock(&port->mac_stats_lock);
+	sfc_adapter_lock(sa);
 
 	if (unlikely(values == NULL) ||
 	    unlikely(ids == NULL && n < port->mac_stats_nb_supported)) {
@@ -802,7 +807,7 @@ sfc_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
 	ret = nb_written;
 
 unlock:
-	rte_spinlock_unlock(&port->mac_stats_lock);
+	sfc_adapter_unlock(sa);
 
 	return ret;
 }
@@ -818,9 +823,14 @@ sfc_xstats_get_names_by_id(struct rte_eth_dev *dev,
 	unsigned int nb_written = 0;
 	unsigned int i;
 
+	sfc_adapter_lock(sa);
+
 	if (unlikely(xstats_names == NULL) ||
-	    unlikely((ids == NULL) && (size < port->mac_stats_nb_supported)))
-		return port->mac_stats_nb_supported;
+	    unlikely((ids == NULL) && (size < port->mac_stats_nb_supported))) {
+		nb_supported = port->mac_stats_nb_supported;
+		sfc_adapter_unlock(sa);
+		return nb_supported;
+	}
 
 	for (i = 0; (i < EFX_MAC_NSTATS) && (nb_written < size); ++i) {
 		if (!EFX_MAC_STAT_SUPPORTED(port->mac_stats_mask, i))
@@ -836,6 +846,8 @@ sfc_xstats_get_names_by_id(struct rte_eth_dev *dev,
 		++nb_supported;
 	}
 
+	sfc_adapter_unlock(sa);
+
 	return nb_written;
 }
 
diff --git a/drivers/net/sfc/sfc_port.c b/drivers/net/sfc/sfc_port.c
index 23313e125f..967fd3a266 100644
--- a/drivers/net/sfc/sfc_port.c
+++ b/drivers/net/sfc/sfc_port.c
@@ -42,7 +42,7 @@ sfc_port_update_mac_stats(struct sfc_adapter *sa)
 	unsigned int nb_attempts = 0;
 	int rc;
 
-	SFC_ASSERT(rte_spinlock_is_locked(&port->mac_stats_lock));
+	SFC_ASSERT(sfc_adapter_is_locked(sa));
 
 	if (sa->state != SFC_ADAPTER_STARTED)
 		return EINVAL;
@@ -102,14 +102,13 @@ sfc_port_reset_sw_stats(struct sfc_adapter *sa)
 int
 sfc_port_reset_mac_stats(struct sfc_adapter *sa)
 {
-	struct sfc_port *port = &sa->port;
 	int rc;
 
-	rte_spinlock_lock(&port->mac_stats_lock);
+	SFC_ASSERT(sfc_adapter_is_locked(sa));
+
 	rc = efx_mac_stats_clear(sa->nic);
 	if (rc == 0)
 		sfc_port_reset_sw_stats(sa);
-	rte_spinlock_unlock(&port->mac_stats_lock);
 
 	return rc;
 }
@@ -415,8 +414,6 @@ sfc_port_attach(struct sfc_adapter *sa)
 		goto fail_mcast_addr_list_buf_alloc;
 	}
 
-	rte_spinlock_init(&port->mac_stats_lock);
-
 	rc = ENOMEM;
 	port->mac_stats_buf = rte_calloc_socket("mac_stats_buf", EFX_MAC_NSTATS,
 						sizeof(uint64_t), 0,
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:16.327853300 +0200
+++ 0086-net-sfc-fix-reading-adapter-state-without-locking.patch	2021-08-10 15:11:13.102638705 +0200
@@ -1 +1 @@
-From 17b0d7b36777341486efc0959d5ed69cf5af5f26 Mon Sep 17 00:00:00 2001
+From 388d4a9184c7ab3739f45ae1e14d99a48d4826bf Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 17b0d7b36777341486efc0959d5ed69cf5af5f26 ]
+
@@ -14 +15,0 @@
-Cc: stable@dpdk.org
@@ -26 +27 @@
-index 546739bd4a..c7b0e5a30d 100644
+index bce6beefaa..57a901b948 100644
@@ -29 +30 @@
-@@ -130,7 +130,6 @@ struct sfc_port {
+@@ -141,7 +141,6 @@ struct sfc_port {
@@ -38 +39 @@
-index d4ac61ff76..d5417e5e65 100644
+index 703139f2c9..93c7ee6322 100644
@@ -41 +42 @@
-@@ -613,7 +613,7 @@ sfc_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
+@@ -596,7 +596,7 @@ sfc_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
@@ -50 +51 @@
-@@ -686,7 +686,7 @@ sfc_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
+@@ -669,7 +669,7 @@ sfc_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
@@ -59 +60 @@
-@@ -698,12 +698,15 @@ sfc_stats_reset(struct rte_eth_dev *dev)
+@@ -681,12 +681,15 @@ sfc_stats_reset(struct rte_eth_dev *dev)
@@ -75 +76 @@
-@@ -711,6 +714,8 @@ sfc_stats_reset(struct rte_eth_dev *dev)
+@@ -694,6 +697,8 @@ sfc_stats_reset(struct rte_eth_dev *dev)
@@ -84 +85 @@
-@@ -726,7 +731,7 @@ sfc_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
+@@ -709,7 +714,7 @@ sfc_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
@@ -93 +94 @@
-@@ -748,7 +753,7 @@ sfc_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
+@@ -731,7 +736,7 @@ sfc_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
@@ -102 +103 @@
-@@ -789,7 +794,7 @@ sfc_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
+@@ -772,7 +777,7 @@ sfc_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
@@ -111 +112 @@
-@@ -819,7 +824,7 @@ sfc_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
+@@ -802,7 +807,7 @@ sfc_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
@@ -120 +121 @@
-@@ -835,9 +840,14 @@ sfc_xstats_get_names_by_id(struct rte_eth_dev *dev,
+@@ -818,9 +823,14 @@ sfc_xstats_get_names_by_id(struct rte_eth_dev *dev,
@@ -137 +138 @@
-@@ -853,6 +863,8 @@ sfc_xstats_get_names_by_id(struct rte_eth_dev *dev,
+@@ -836,6 +846,8 @@ sfc_xstats_get_names_by_id(struct rte_eth_dev *dev,
@@ -147 +148 @@
-index ac117f9c48..cdc0f94f19 100644
+index 23313e125f..967fd3a266 100644
@@ -150 +151 @@
-@@ -43,7 +43,7 @@ sfc_port_update_mac_stats(struct sfc_adapter *sa)
+@@ -42,7 +42,7 @@ sfc_port_update_mac_stats(struct sfc_adapter *sa)
@@ -159 +160 @@
-@@ -103,14 +103,13 @@ sfc_port_reset_sw_stats(struct sfc_adapter *sa)
+@@ -102,14 +102,13 @@ sfc_port_reset_sw_stats(struct sfc_adapter *sa)
@@ -176 +177 @@
-@@ -416,8 +415,6 @@ sfc_port_attach(struct sfc_adapter *sa)
+@@ -415,8 +414,6 @@ sfc_port_attach(struct sfc_adapter *sa)

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

* [dpdk-stable] patch 'net/sfc: fix xstats query by ID according to ethdev' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (84 preceding siblings ...)
  2021-08-10 15:40 ` [dpdk-stable] patch 'net/sfc: fix reading adapter state without locking' " christian.ehrhardt
@ 2021-08-10 15:40 ` christian.ehrhardt
  2021-08-10 15:40 ` [dpdk-stable] patch 'net/sfc: fix xstats query by unsorted list of IDs' " christian.ehrhardt
                   ` (14 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:40 UTC (permalink / raw)
  To: Ivan Ilchenko; +Cc: Andrew Rybchenko, Andy Moreton, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/a31460e290504bbb8ec62ef76281044eac9a715b

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From a31460e290504bbb8ec62ef76281044eac9a715b Mon Sep 17 00:00:00 2001
From: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Date: Fri, 23 Jul 2021 16:15:09 +0300
Subject: [PATCH] net/sfc: fix xstats query by ID according to ethdev

[ upstream commit 8232cc2d35ab9d07a729971b6c7596189775bc8f ]

Fix xstats by ID callbacks according to ethdev usage.
Handle combinations of input arguments that are required by ethdev
and sanity check and reject other combinations on callback entry.

Fixes: 73280c1e4ff ("net/sfc: support xstats retrieval by ID")

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
---
 drivers/net/sfc/sfc_ethdev.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index 93c7ee6322..7317c30a71 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -777,13 +777,10 @@ sfc_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
 	int ret;
 	int rc;
 
-	sfc_adapter_lock(sa);
+	if (unlikely(ids == NULL || values == NULL))
+		return -EINVAL;
 
-	if (unlikely(values == NULL) ||
-	    unlikely(ids == NULL && n < port->mac_stats_nb_supported)) {
-		ret = port->mac_stats_nb_supported;
-		goto unlock;
-	}
+	sfc_adapter_lock(sa);
 
 	rc = sfc_port_update_mac_stats(sa);
 	if (rc != 0) {
@@ -798,7 +795,7 @@ sfc_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
 		if (!EFX_MAC_STAT_SUPPORTED(port->mac_stats_mask, i))
 			continue;
 
-		if ((ids == NULL) || (ids[nb_written] == nb_supported))
+		if (ids[nb_written] == nb_supported)
 			values[nb_written++] = mac_stats[i];
 
 		++nb_supported;
@@ -823,10 +820,13 @@ sfc_xstats_get_names_by_id(struct rte_eth_dev *dev,
 	unsigned int nb_written = 0;
 	unsigned int i;
 
+	if (unlikely(xstats_names == NULL && ids != NULL) ||
+	    unlikely(xstats_names != NULL && ids == NULL))
+		return -EINVAL;
+
 	sfc_adapter_lock(sa);
 
-	if (unlikely(xstats_names == NULL) ||
-	    unlikely((ids == NULL) && (size < port->mac_stats_nb_supported))) {
+	if (unlikely(xstats_names == NULL && ids == NULL)) {
 		nb_supported = port->mac_stats_nb_supported;
 		sfc_adapter_unlock(sa);
 		return nb_supported;
@@ -836,7 +836,7 @@ sfc_xstats_get_names_by_id(struct rte_eth_dev *dev,
 		if (!EFX_MAC_STAT_SUPPORTED(port->mac_stats_mask, i))
 			continue;
 
-		if ((ids == NULL) || (ids[nb_written] == nb_supported)) {
+		if (ids[nb_written] == nb_supported) {
 			char *name = xstats_names[nb_written++].name;
 
 			strlcpy(name, efx_mac_stat_name(sa->nic, i),
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:16.368105036 +0200
+++ 0087-net-sfc-fix-xstats-query-by-ID-according-to-ethdev.patch	2021-08-10 15:11:13.102638705 +0200
@@ -1 +1 @@
-From 8232cc2d35ab9d07a729971b6c7596189775bc8f Mon Sep 17 00:00:00 2001
+From a31460e290504bbb8ec62ef76281044eac9a715b Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 8232cc2d35ab9d07a729971b6c7596189775bc8f ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -21 +22 @@
-index d5417e5e65..fca3f524a1 100644
+index 93c7ee6322..7317c30a71 100644
@@ -24 +25 @@
-@@ -794,13 +794,10 @@ sfc_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
+@@ -777,13 +777,10 @@ sfc_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
@@ -41 +42 @@
-@@ -815,7 +812,7 @@ sfc_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
+@@ -798,7 +795,7 @@ sfc_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
@@ -50 +51 @@
-@@ -840,10 +837,13 @@ sfc_xstats_get_names_by_id(struct rte_eth_dev *dev,
+@@ -823,10 +820,13 @@ sfc_xstats_get_names_by_id(struct rte_eth_dev *dev,
@@ -66 +67 @@
-@@ -853,7 +853,7 @@ sfc_xstats_get_names_by_id(struct rte_eth_dev *dev,
+@@ -836,7 +836,7 @@ sfc_xstats_get_names_by_id(struct rte_eth_dev *dev,

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

* [dpdk-stable] patch 'net/sfc: fix xstats query by unsorted list of IDs' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (85 preceding siblings ...)
  2021-08-10 15:40 ` [dpdk-stable] patch 'net/sfc: fix xstats query by ID according to ethdev' " christian.ehrhardt
@ 2021-08-10 15:40 ` christian.ehrhardt
  2021-08-10 15:40 ` [dpdk-stable] patch 'net/sfc: fix MAC stats update for stopped device' " christian.ehrhardt
                   ` (13 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:40 UTC (permalink / raw)
  To: Ivan Ilchenko; +Cc: Andrew Rybchenko, Andy Moreton, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/6fe317e2505898550ddb64ef84a80c9f6b1abb54

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 6fe317e2505898550ddb64ef84a80c9f6b1abb54 Mon Sep 17 00:00:00 2001
From: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Date: Fri, 23 Jul 2021 16:15:10 +0300
Subject: [PATCH] net/sfc: fix xstats query by unsorted list of IDs

[ upstream commit 7d466e5fd8d13def57538d80a2f759c2c436dba0 ]

Device may support only some MAC stats. Add mapping from ids to subset
of supported MAC stats for each port.

Fixes: 73280c1e4ff ("net/sfc: support xstats retrieval by ID")

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
---
 drivers/net/sfc/sfc.h        |  2 ++
 drivers/net/sfc/sfc_ethdev.c | 44 ++++++++++++++++++------------------
 drivers/net/sfc/sfc_port.c   | 29 ++++++++++++++++++------
 3 files changed, 46 insertions(+), 29 deletions(-)

diff --git a/drivers/net/sfc/sfc.h b/drivers/net/sfc/sfc.h
index 57a901b948..e12b4f56f2 100644
--- a/drivers/net/sfc/sfc.h
+++ b/drivers/net/sfc/sfc.h
@@ -152,6 +152,8 @@ struct sfc_port {
 
 	uint32_t		mac_stats_mask[EFX_MAC_STATS_MASK_NPAGES];
 
+	unsigned int			mac_stats_by_id[EFX_MAC_NSTATS];
+
 	uint64_t			ipackets;
 };
 
diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index 7317c30a71..c008a93af0 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -771,8 +771,6 @@ sfc_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
 	struct sfc_adapter *sa = sfc_adapter_by_eth_dev(dev);
 	struct sfc_port *port = &sa->port;
 	uint64_t *mac_stats;
-	unsigned int nb_supported = 0;
-	unsigned int nb_written = 0;
 	unsigned int i;
 	int ret;
 	int rc;
@@ -791,17 +789,19 @@ sfc_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
 
 	mac_stats = port->mac_stats_buf;
 
-	for (i = 0; (i < EFX_MAC_NSTATS) && (nb_written < n); ++i) {
-		if (!EFX_MAC_STAT_SUPPORTED(port->mac_stats_mask, i))
-			continue;
-
-		if (ids[nb_written] == nb_supported)
-			values[nb_written++] = mac_stats[i];
+	SFC_ASSERT(port->mac_stats_nb_supported <=
+		   RTE_DIM(port->mac_stats_by_id));
 
-		++nb_supported;
+	for (i = 0; i < n; i++) {
+		if (ids[i] < port->mac_stats_nb_supported) {
+			values[i] = mac_stats[port->mac_stats_by_id[ids[i]]];
+		} else {
+			ret = i;
+			goto unlock;
+		}
 	}
 
-	ret = nb_written;
+	ret = n;
 
 unlock:
 	sfc_adapter_unlock(sa);
@@ -816,8 +816,7 @@ sfc_xstats_get_names_by_id(struct rte_eth_dev *dev,
 {
 	struct sfc_adapter *sa = sfc_adapter_by_eth_dev(dev);
 	struct sfc_port *port = &sa->port;
-	unsigned int nb_supported = 0;
-	unsigned int nb_written = 0;
+	unsigned int nb_supported;
 	unsigned int i;
 
 	if (unlikely(xstats_names == NULL && ids != NULL) ||
@@ -832,23 +831,24 @@ sfc_xstats_get_names_by_id(struct rte_eth_dev *dev,
 		return nb_supported;
 	}
 
-	for (i = 0; (i < EFX_MAC_NSTATS) && (nb_written < size); ++i) {
-		if (!EFX_MAC_STAT_SUPPORTED(port->mac_stats_mask, i))
-			continue;
-
-		if (ids[nb_written] == nb_supported) {
-			char *name = xstats_names[nb_written++].name;
+	SFC_ASSERT(port->mac_stats_nb_supported <=
+		   RTE_DIM(port->mac_stats_by_id));
 
-			strlcpy(name, efx_mac_stat_name(sa->nic, i),
+	for (i = 0; i < size; i++) {
+		if (ids[i] < port->mac_stats_nb_supported) {
+			strlcpy(xstats_names[i].name,
+				efx_mac_stat_name(sa->nic,
+						 port->mac_stats_by_id[ids[i]]),
 				sizeof(xstats_names[0].name));
+		} else {
+			sfc_adapter_unlock(sa);
+			return i;
 		}
-
-		++nb_supported;
 	}
 
 	sfc_adapter_unlock(sa);
 
-	return nb_written;
+	return size;
 }
 
 static int
diff --git a/drivers/net/sfc/sfc_port.c b/drivers/net/sfc/sfc_port.c
index 967fd3a266..ee59766208 100644
--- a/drivers/net/sfc/sfc_port.c
+++ b/drivers/net/sfc/sfc_port.c
@@ -156,6 +156,27 @@ sfc_port_phy_caps_to_max_link_speed(uint32_t phy_caps)
 
 #endif
 
+static void
+sfc_port_fill_mac_stats_info(struct sfc_adapter *sa)
+{
+	unsigned int mac_stats_nb_supported = 0;
+	struct sfc_port *port = &sa->port;
+	unsigned int stat_idx;
+
+	efx_mac_stats_get_mask(sa->nic, port->mac_stats_mask,
+			       sizeof(port->mac_stats_mask));
+
+	for (stat_idx = 0; stat_idx < EFX_MAC_NSTATS; ++stat_idx) {
+		if (!EFX_MAC_STAT_SUPPORTED(port->mac_stats_mask, stat_idx))
+			continue;
+
+		port->mac_stats_by_id[mac_stats_nb_supported] = stat_idx;
+		mac_stats_nb_supported++;
+	}
+
+	port->mac_stats_nb_supported = mac_stats_nb_supported;
+}
+
 int
 sfc_port_start(struct sfc_adapter *sa)
 {
@@ -164,7 +185,6 @@ sfc_port_start(struct sfc_adapter *sa)
 	uint32_t phy_adv_cap;
 	const uint32_t phy_pause_caps =
 		((1u << EFX_PHY_CAP_PAUSE) | (1u << EFX_PHY_CAP_ASYM));
-	unsigned int i;
 
 	sfc_log_init(sa, "entry");
 
@@ -258,12 +278,7 @@ sfc_port_start(struct sfc_adapter *sa)
 		port->mac_stats_reset_pending = B_FALSE;
 	}
 
-	efx_mac_stats_get_mask(sa->nic, port->mac_stats_mask,
-			       sizeof(port->mac_stats_mask));
-
-	for (i = 0, port->mac_stats_nb_supported = 0; i < EFX_MAC_NSTATS; ++i)
-		if (EFX_MAC_STAT_SUPPORTED(port->mac_stats_mask, i))
-			port->mac_stats_nb_supported++;
+	sfc_port_fill_mac_stats_info(sa);
 
 	port->mac_stats_update_generation = 0;
 
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:16.408690382 +0200
+++ 0088-net-sfc-fix-xstats-query-by-unsorted-list-of-IDs.patch	2021-08-10 15:11:13.106638735 +0200
@@ -1 +1 @@
-From 7d466e5fd8d13def57538d80a2f759c2c436dba0 Mon Sep 17 00:00:00 2001
+From 6fe317e2505898550ddb64ef84a80c9f6b1abb54 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 7d466e5fd8d13def57538d80a2f759c2c436dba0 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
-index c7b0e5a30d..972d32606d 100644
+index 57a901b948..e12b4f56f2 100644
@@ -25 +26 @@
-@@ -141,6 +141,8 @@ struct sfc_port {
+@@ -152,6 +152,8 @@ struct sfc_port {
@@ -35 +36 @@
-index fca3f524a1..ae9304f90f 100644
+index 7317c30a71..c008a93af0 100644
@@ -38 +39 @@
-@@ -788,8 +788,6 @@ sfc_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
+@@ -771,8 +771,6 @@ sfc_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
@@ -47 +48 @@
-@@ -808,17 +806,19 @@ sfc_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
+@@ -791,17 +789,19 @@ sfc_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
@@ -75 +76 @@
-@@ -833,8 +833,7 @@ sfc_xstats_get_names_by_id(struct rte_eth_dev *dev,
+@@ -816,8 +816,7 @@ sfc_xstats_get_names_by_id(struct rte_eth_dev *dev,
@@ -85 +86 @@
-@@ -849,23 +848,24 @@ sfc_xstats_get_names_by_id(struct rte_eth_dev *dev,
+@@ -832,23 +831,24 @@ sfc_xstats_get_names_by_id(struct rte_eth_dev *dev,
@@ -121 +122 @@
-index cdc0f94f19..bb9e01d96b 100644
+index 967fd3a266..ee59766208 100644
@@ -124 +125 @@
-@@ -157,6 +157,27 @@ sfc_port_phy_caps_to_max_link_speed(uint32_t phy_caps)
+@@ -156,6 +156,27 @@ sfc_port_phy_caps_to_max_link_speed(uint32_t phy_caps)
@@ -152 +153 @@
-@@ -165,7 +186,6 @@ sfc_port_start(struct sfc_adapter *sa)
+@@ -164,7 +185,6 @@ sfc_port_start(struct sfc_adapter *sa)
@@ -160 +161 @@
-@@ -259,12 +279,7 @@ sfc_port_start(struct sfc_adapter *sa)
+@@ -258,12 +278,7 @@ sfc_port_start(struct sfc_adapter *sa)

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

* [dpdk-stable] patch 'net/sfc: fix MAC stats update for stopped device' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (86 preceding siblings ...)
  2021-08-10 15:40 ` [dpdk-stable] patch 'net/sfc: fix xstats query by unsorted list of IDs' " christian.ehrhardt
@ 2021-08-10 15:40 ` christian.ehrhardt
  2021-08-10 15:40 ` [dpdk-stable] patch 'app/testpmd: fix help string for port reset' " christian.ehrhardt
                   ` (12 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:40 UTC (permalink / raw)
  To: Ivan Ilchenko; +Cc: Andrew Rybchenko, Andy Moreton, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/dcfe651cffd573cac59103b948e498edb8ae9ecc

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From dcfe651cffd573cac59103b948e498edb8ae9ecc Mon Sep 17 00:00:00 2001
From: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Date: Fri, 23 Jul 2021 16:15:11 +0300
Subject: [PATCH] net/sfc: fix MAC stats update for stopped device

[ upstream commit 1827b073ed47fbc8efedebecd61686a137e4433b ]

Return the latest stats snapshot in stopped state
instead of returning an error.

Fixes: 1caab2f1e68 ("net/sfc: add basic statistics")

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
---
 drivers/net/sfc/sfc.h        |  2 +-
 drivers/net/sfc/sfc_ethdev.c |  6 +++---
 drivers/net/sfc/sfc_port.c   | 11 +++++++----
 3 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/drivers/net/sfc/sfc.h b/drivers/net/sfc/sfc.h
index e12b4f56f2..4c0320c6a8 100644
--- a/drivers/net/sfc/sfc.h
+++ b/drivers/net/sfc/sfc.h
@@ -405,7 +405,7 @@ int sfc_port_start(struct sfc_adapter *sa);
 void sfc_port_stop(struct sfc_adapter *sa);
 void sfc_port_link_mode_to_info(efx_link_mode_t link_mode,
 				struct rte_eth_link *link_info);
-int sfc_port_update_mac_stats(struct sfc_adapter *sa);
+int sfc_port_update_mac_stats(struct sfc_adapter *sa, boolean_t manual_update);
 int sfc_port_reset_mac_stats(struct sfc_adapter *sa);
 int sfc_set_rx_mode(struct sfc_adapter *sa);
 
diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index c008a93af0..5b2a72ebf3 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -598,7 +598,7 @@ sfc_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 
 	sfc_adapter_lock(sa);
 
-	ret = sfc_port_update_mac_stats(sa);
+	ret = sfc_port_update_mac_stats(sa, B_FALSE);
 	if (ret != 0)
 		goto unlock;
 
@@ -716,7 +716,7 @@ sfc_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
 
 	sfc_adapter_lock(sa);
 
-	rc = sfc_port_update_mac_stats(sa);
+	rc = sfc_port_update_mac_stats(sa, B_FALSE);
 	if (rc != 0) {
 		SFC_ASSERT(rc > 0);
 		nstats = -rc;
@@ -780,7 +780,7 @@ sfc_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
 
 	sfc_adapter_lock(sa);
 
-	rc = sfc_port_update_mac_stats(sa);
+	rc = sfc_port_update_mac_stats(sa, B_FALSE);
 	if (rc != 0) {
 		SFC_ASSERT(rc > 0);
 		ret = -rc;
diff --git a/drivers/net/sfc/sfc_port.c b/drivers/net/sfc/sfc_port.c
index ee59766208..7fd1f777ac 100644
--- a/drivers/net/sfc/sfc_port.c
+++ b/drivers/net/sfc/sfc_port.c
@@ -25,7 +25,8 @@
 /**
  * Update MAC statistics in the buffer.
  *
- * @param	sa	Adapter
+ * @param	sa		Adapter
+ * @param	force_upload	Flag to upload MAC stats in any case
  *
  * @return Status code
  * @retval	0	Success
@@ -33,7 +34,7 @@
  * @retval	ENOMEM	Memory allocation failure
  */
 int
-sfc_port_update_mac_stats(struct sfc_adapter *sa)
+sfc_port_update_mac_stats(struct sfc_adapter *sa, boolean_t force_upload)
 {
 	struct sfc_port *port = &sa->port;
 	efsys_mem_t *esmp = &port->mac_stats_dma_mem;
@@ -45,14 +46,14 @@ sfc_port_update_mac_stats(struct sfc_adapter *sa)
 	SFC_ASSERT(sfc_adapter_is_locked(sa));
 
 	if (sa->state != SFC_ADAPTER_STARTED)
-		return EINVAL;
+		return 0;
 
 	/*
 	 * If periodic statistics DMA'ing is off or if not supported,
 	 * make a manual request and keep an eye on timer if need be
 	 */
 	if (!port->mac_stats_periodic_dma_supported ||
-	    (port->mac_stats_update_period_ms == 0)) {
+	    (port->mac_stats_update_period_ms == 0) || force_upload) {
 		if (port->mac_stats_update_period_ms != 0) {
 			uint64_t timestamp = sfc_get_system_msecs();
 
@@ -366,6 +367,8 @@ sfc_port_stop(struct sfc_adapter *sa)
 	(void)efx_mac_stats_periodic(sa->nic, &sa->port.mac_stats_dma_mem,
 				     0, B_FALSE);
 
+	sfc_port_update_mac_stats(sa, B_TRUE);
+
 	efx_port_fini(sa->nic);
 	efx_filter_fini(sa->nic);
 
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:16.447793519 +0200
+++ 0089-net-sfc-fix-MAC-stats-update-for-stopped-device.patch	2021-08-10 15:11:13.106638735 +0200
@@ -1 +1 @@
-From 1827b073ed47fbc8efedebecd61686a137e4433b Mon Sep 17 00:00:00 2001
+From dcfe651cffd573cac59103b948e498edb8ae9ecc Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 1827b073ed47fbc8efedebecd61686a137e4433b ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
-index 972d32606d..1594f934ba 100644
+index e12b4f56f2..4c0320c6a8 100644
@@ -25 +26 @@
-@@ -422,7 +422,7 @@ int sfc_port_start(struct sfc_adapter *sa);
+@@ -405,7 +405,7 @@ int sfc_port_start(struct sfc_adapter *sa);
@@ -33 +34 @@
- int sfc_set_rx_mode_unchecked(struct sfc_adapter *sa);
+ 
@@ -35 +36 @@
-index ae9304f90f..bbc22723f6 100644
+index c008a93af0..5b2a72ebf3 100644
@@ -38 +39 @@
-@@ -615,7 +615,7 @@ sfc_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
+@@ -598,7 +598,7 @@ sfc_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
@@ -47 +48 @@
-@@ -733,7 +733,7 @@ sfc_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
+@@ -716,7 +716,7 @@ sfc_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
@@ -56 +57 @@
-@@ -797,7 +797,7 @@ sfc_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
+@@ -780,7 +780,7 @@ sfc_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
@@ -66 +67 @@
-index bb9e01d96b..8c432c15f5 100644
+index ee59766208..7fd1f777ac 100644
@@ -69 +70 @@
-@@ -26,7 +26,8 @@
+@@ -25,7 +25,8 @@
@@ -79 +80 @@
-@@ -34,7 +35,7 @@
+@@ -33,7 +34,7 @@
@@ -88 +89 @@
-@@ -46,14 +47,14 @@ sfc_port_update_mac_stats(struct sfc_adapter *sa)
+@@ -45,14 +46,14 @@ sfc_port_update_mac_stats(struct sfc_adapter *sa)
@@ -105 +106 @@
-@@ -367,6 +368,8 @@ sfc_port_stop(struct sfc_adapter *sa)
+@@ -366,6 +367,8 @@ sfc_port_stop(struct sfc_adapter *sa)

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

* [dpdk-stable] patch 'app/testpmd: fix help string for port reset' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (87 preceding siblings ...)
  2021-08-10 15:40 ` [dpdk-stable] patch 'net/sfc: fix MAC stats update for stopped device' " christian.ehrhardt
@ 2021-08-10 15:40 ` christian.ehrhardt
  2021-08-10 15:40 ` [dpdk-stable] patch 'app/testpmd: fix MAC address after " christian.ehrhardt
                   ` (11 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:40 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Andrew Rybchenko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/7ec9ebd3eca1a480104204dfe8f56eb84ace85a4

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 7ec9ebd3eca1a480104204dfe8f56eb84ace85a4 Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit@intel.com>
Date: Fri, 23 Jul 2021 13:24:19 +0100
Subject: [PATCH] app/testpmd: fix help string for port reset

[ upstream commit a2db845cccf4aaab428fbff613a94e8e86418d41 ]

Command help string is missing 'reset' keyword,
although description has it. Adding it.

Fixes: 97f1e196799f ("app/testpmd: add port reset command")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 app/test-pmd/cmdline.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 3eedb82486..e6c053ad57 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -1324,7 +1324,7 @@ cmdline_parse_token_string_t cmd_operate_port_all_all =
 cmdline_parse_inst_t cmd_operate_port = {
 	.f = cmd_operate_port_parsed,
 	.data = NULL,
-	.help_str = "port start|stop|close all: Start/Stop/Close/Reset all ports",
+	.help_str = "port start|stop|close|reset all: Start/Stop/Close/Reset all ports",
 	.tokens = {
 		(void *)&cmd_operate_port_all_cmd,
 		(void *)&cmd_operate_port_all_port,
@@ -1371,7 +1371,7 @@ cmdline_parse_token_num_t cmd_operate_specific_port_id =
 cmdline_parse_inst_t cmd_operate_specific_port = {
 	.f = cmd_operate_specific_port_parsed,
 	.data = NULL,
-	.help_str = "port start|stop|close <port_id>: Start/Stop/Close/Reset port_id",
+	.help_str = "port start|stop|close|reset <port_id>: Start/Stop/Close/Reset port_id",
 	.tokens = {
 		(void *)&cmd_operate_specific_port_cmd,
 		(void *)&cmd_operate_specific_port_port,
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:16.480591990 +0200
+++ 0090-app-testpmd-fix-help-string-for-port-reset.patch	2021-08-10 15:11:13.122638850 +0200
@@ -1 +1 @@
-From a2db845cccf4aaab428fbff613a94e8e86418d41 Mon Sep 17 00:00:00 2001
+From 7ec9ebd3eca1a480104204dfe8f56eb84ace85a4 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a2db845cccf4aaab428fbff613a94e8e86418d41 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
-index 8468018cf3..905a6143eb 100644
+index 3eedb82486..e6c053ad57 100644
@@ -22 +23 @@
-@@ -1237,7 +1237,7 @@ cmdline_parse_token_string_t cmd_operate_port_all_all =
+@@ -1324,7 +1324,7 @@ cmdline_parse_token_string_t cmd_operate_port_all_all =
@@ -31 +32 @@
-@@ -1284,7 +1284,7 @@ cmdline_parse_token_num_t cmd_operate_specific_port_id =
+@@ -1371,7 +1371,7 @@ cmdline_parse_token_num_t cmd_operate_specific_port_id =

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

* [dpdk-stable] patch 'app/testpmd: fix MAC address after port reset' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (88 preceding siblings ...)
  2021-08-10 15:40 ` [dpdk-stable] patch 'app/testpmd: fix help string for port reset' " christian.ehrhardt
@ 2021-08-10 15:40 ` christian.ehrhardt
  2021-08-10 15:40 ` [dpdk-stable] patch 'net/virtio: report maximum MTU in device info' " christian.ehrhardt
                   ` (10 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:40 UTC (permalink / raw)
  To: Yuying Zhang; +Cc: Aman Deep Singh, Xiaoyun Li, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/f9aae4b6ebdcad12c010c32b4f9036b2a4486704

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From f9aae4b6ebdcad12c010c32b4f9036b2a4486704 Mon Sep 17 00:00:00 2001
From: Yuying Zhang <yuying.zhang@intel.com>
Date: Wed, 14 Jul 2021 02:20:27 +0000
Subject: [PATCH] app/testpmd: fix MAC address after port reset

[ upstream commit 5ffc4a2acadad427f2f9ddf8e072632764ad2d47 ]

MAC address of each port in global variable ports hasn't been updated
after resetting. It was the initial one after resetting VF MAC address.
This patch gets correct port MAC address when starting port.

Fixes: a5279d25616d ("app/testpmd: check status of getting MAC address")

Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
Acked-by: Aman Deep Singh <aman.deep.singh@intel.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
---
 app/test-pmd/testpmd.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 9485953aba..0861436c02 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2317,7 +2317,6 @@ start_port(portid_t pid)
 	portid_t pi;
 	queueid_t qi;
 	struct rte_port *port;
-	struct rte_ether_addr mac_addr;
 	struct rte_eth_hairpin_cap cap;
 
 	if (port_id_is_invalid(pid, ENABLED_WARN))
@@ -2481,11 +2480,14 @@ start_port(portid_t pid)
 			RTE_PORT_HANDLING, RTE_PORT_STARTED) == 0)
 			printf("Port %d can not be set into started\n", pi);
 
-		if (eth_macaddr_get_print_err(pi, &mac_addr) == 0)
+		if (eth_macaddr_get_print_err(pi, &port->eth_addr) == 0)
 			printf("Port %d: %02X:%02X:%02X:%02X:%02X:%02X\n", pi,
-				mac_addr.addr_bytes[0], mac_addr.addr_bytes[1],
-				mac_addr.addr_bytes[2], mac_addr.addr_bytes[3],
-				mac_addr.addr_bytes[4], mac_addr.addr_bytes[5]);
+				port->eth_addr.addr_bytes[0],
+				port->eth_addr.addr_bytes[1],
+				port->eth_addr.addr_bytes[2],
+				port->eth_addr.addr_bytes[3],
+				port->eth_addr.addr_bytes[4],
+				port->eth_addr.addr_bytes[5]);
 
 		/* at least one port started, need checking link status */
 		need_check_link_status = 1;
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:16.528418773 +0200
+++ 0091-app-testpmd-fix-MAC-address-after-port-reset.patch	2021-08-10 15:11:13.122638850 +0200
@@ -1 +1 @@
-From 5ffc4a2acadad427f2f9ddf8e072632764ad2d47 Mon Sep 17 00:00:00 2001
+From f9aae4b6ebdcad12c010c32b4f9036b2a4486704 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 5ffc4a2acadad427f2f9ddf8e072632764ad2d47 ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -21 +22 @@
-index a48f70962f..37aba40272 100644
+index 9485953aba..0861436c02 100644
@@ -24,2 +25,2 @@
-@@ -2441,7 +2441,6 @@ start_port(portid_t pid)
- 	int peer_pi;
+@@ -2317,7 +2317,6 @@ start_port(portid_t pid)
+ 	portid_t pi;
@@ -32 +33 @@
-@@ -2612,11 +2611,14 @@ start_port(portid_t pid)
+@@ -2481,11 +2480,14 @@ start_port(portid_t pid)

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

* [dpdk-stable] patch 'net/virtio: report maximum MTU in device info' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (89 preceding siblings ...)
  2021-08-10 15:40 ` [dpdk-stable] patch 'app/testpmd: fix MAC address after " christian.ehrhardt
@ 2021-08-10 15:40 ` christian.ehrhardt
  2021-08-10 15:40 ` [dpdk-stable] patch 'vhost: fix crash on reconnect' " christian.ehrhardt
                   ` (9 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:40 UTC (permalink / raw)
  To: Ivan Ilchenko; +Cc: Andrew Rybchenko, Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/68c79e6da11918ec4dbd9725907a455d1f20da4b

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 68c79e6da11918ec4dbd9725907a455d1f20da4b Mon Sep 17 00:00:00 2001
From: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Date: Wed, 21 Jul 2021 12:22:25 +0300
Subject: [PATCH] net/virtio: report maximum MTU in device info

[ upstream commit 11d7bc9ff074dc5e37dd9ab51bb365669d08c3d6 ]

Fix the driver to report maximum MTU obtained from config if
VIRTIO_NET_F_MTU is supported or calculated based on maximum
Rx packet length.

Fixes: ad97ceece12c ("ethdev: add min/max MTU to device info")

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/net/virtio/virtio_ethdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index dfc6849e8a..0eca488c40 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -2447,6 +2447,7 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 	dev_info->min_rx_bufsize = VIRTIO_MIN_RX_BUFSIZE;
 	dev_info->max_rx_pktlen = VIRTIO_MAX_RX_PKTLEN;
 	dev_info->max_mac_addrs = VIRTIO_MAX_MAC_ADDRS;
+	dev_info->max_mtu = hw->max_mtu;
 
 	host_features = VTPCI_OPS(hw)->get_features(hw);
 	dev_info->rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP;
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:16.566781517 +0200
+++ 0092-net-virtio-report-maximum-MTU-in-device-info.patch	2021-08-10 15:11:13.126638878 +0200
@@ -1 +1 @@
-From 11d7bc9ff074dc5e37dd9ab51bb365669d08c3d6 Mon Sep 17 00:00:00 2001
+From 68c79e6da11918ec4dbd9725907a455d1f20da4b Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 11d7bc9ff074dc5e37dd9ab51bb365669d08c3d6 ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -21 +22 @@
-index 72d3dda71f..a4adeec5ab 100644
+index dfc6849e8a..0eca488c40 100644
@@ -24 +25 @@
-@@ -2504,6 +2504,7 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
+@@ -2447,6 +2447,7 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
@@ -30 +31 @@
- 	host_features = VIRTIO_OPS(hw)->get_features(hw);
+ 	host_features = VTPCI_OPS(hw)->get_features(hw);

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

* [dpdk-stable] patch 'vhost: fix crash on reconnect' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (90 preceding siblings ...)
  2021-08-10 15:40 ` [dpdk-stable] patch 'net/virtio: report maximum MTU in device info' " christian.ehrhardt
@ 2021-08-10 15:40 ` christian.ehrhardt
  2021-08-10 15:40 ` [dpdk-stable] patch 'net/virtio: fix interrupt handle leak' " christian.ehrhardt
                   ` (8 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:40 UTC (permalink / raw)
  To: Maxime Coquelin; +Cc: Yinan Wang, Chenbo Xia, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/96dcc5fe48b32721b1d5e883dace6977a4052f94

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 96dcc5fe48b32721b1d5e883dace6977a4052f94 Mon Sep 17 00:00:00 2001
From: Maxime Coquelin <maxime.coquelin@redhat.com>
Date: Mon, 26 Jul 2021 09:58:14 +0200
Subject: [PATCH] vhost: fix crash on reconnect

[ upstream commit 3c929a0bb3e7addc5103227bff126b8b9dd952ef ]

When the vhost-user frontend like Virtio-user tries to
reconnect to the restarted Vhost backend, the Vhost backend
segfaults when multiqueue is enabled.

This is caused by VHOST_USER_GET_VRING_BASE being called for
a virtqueue that has not been created before, causing a NULL
pointer dereferencing.

This patch adds the VHOST_USER_GET_VRING_BASE requests to
the list of requests that trigger queue pair allocations.

Fixes: 160cbc815b41 ("vhost: remove a hack on queue allocation")

Reported-by: Yinan Wang <yinan.wang@intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Yinan Wang <yinan.wang@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
---
 lib/librte_vhost/vhost_user.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index c016114e75..b1c0bef7b6 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -2606,6 +2606,7 @@ vhost_user_check_and_alloc_queue_pair(struct virtio_net *dev,
 		break;
 	case VHOST_USER_SET_VRING_NUM:
 	case VHOST_USER_SET_VRING_BASE:
+	case VHOST_USER_GET_VRING_BASE:
 	case VHOST_USER_SET_VRING_ENABLE:
 		vring_idx = msg->payload.state.index;
 		break;
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:16.599562799 +0200
+++ 0093-vhost-fix-crash-on-reconnect.patch	2021-08-10 15:11:13.126638878 +0200
@@ -1 +1 @@
-From 3c929a0bb3e7addc5103227bff126b8b9dd952ef Mon Sep 17 00:00:00 2001
+From 96dcc5fe48b32721b1d5e883dace6977a4052f94 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 3c929a0bb3e7addc5103227bff126b8b9dd952ef ]
+
@@ -18 +19,0 @@
-Cc: stable@dpdk.org
@@ -25 +26 @@
- lib/vhost/vhost_user.c | 1 +
+ lib/librte_vhost/vhost_user.c | 1 +
@@ -28,5 +29,5 @@
-diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c
-index 433f412fa8..29a4c9af60 100644
---- a/lib/vhost/vhost_user.c
-+++ b/lib/vhost/vhost_user.c
-@@ -2796,6 +2796,7 @@ vhost_user_check_and_alloc_queue_pair(struct virtio_net *dev,
+diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
+index c016114e75..b1c0bef7b6 100644
+--- a/lib/librte_vhost/vhost_user.c
++++ b/lib/librte_vhost/vhost_user.c
+@@ -2606,6 +2606,7 @@ vhost_user_check_and_alloc_queue_pair(struct virtio_net *dev,

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

* [dpdk-stable] patch 'net/virtio: fix interrupt handle leak' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (91 preceding siblings ...)
  2021-08-10 15:40 ` [dpdk-stable] patch 'vhost: fix crash on reconnect' " christian.ehrhardt
@ 2021-08-10 15:40 ` christian.ehrhardt
  2021-08-11  6:52   ` Christian Ehrhardt
  2021-08-10 15:40 ` [dpdk-stable] patch 'net/iavf: fix Tx threshold check' " christian.ehrhardt
                   ` (7 subsequent siblings)
  100 siblings, 1 reply; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:40 UTC (permalink / raw)
  To: Gaoxiang Liu; +Cc: Chenbo Xia, Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/a3b51a8b34b382717a2bab9681135b034ae872e0

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From a3b51a8b34b382717a2bab9681135b034ae872e0 Mon Sep 17 00:00:00 2001
From: Gaoxiang Liu <liugaoxiang@huawei.com>
Date: Mon, 26 Jul 2021 22:42:05 +0800
Subject: [PATCH] net/virtio: fix interrupt handle leak

[ upstream commit 7b9195154926b808e3ae23750eaff3e81cd5f529 ]

Free memory of interrupt handle in virtio_user_dev_uninit() to
avoid memory leak.
when virtio user dev closes, memory of interrupt handle is not freed
that is allocated in virtio_user_fill_intr_handle().

Fixes: 3d4fb6fd2505 ("net/virtio-user: support Rx interrupt")

Signed-off-by: Gaoxiang Liu <liugaoxiang@huawei.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/net/virtio/virtio_user/virtio_user_dev.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
index ad5d2f3bf8..1277dbe038 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -528,6 +528,12 @@ void
 virtio_user_dev_uninit(struct virtio_user_dev *dev)
 {
 	uint32_t i;
+	struct rte_eth_dev *eth_dev = &rte_eth_devices[dev->hw.port_id];
+
+	if (eth_dev->intr_handle) {
+		free(eth_dev->intr_handle);
+		eth_dev->intr_handle = NULL;
+	}
 
 	virtio_user_stop_device(dev);
 
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:16.635100829 +0200
+++ 0094-net-virtio-fix-interrupt-handle-leak.patch	2021-08-10 15:11:13.126638878 +0200
@@ -1 +1 @@
-From 7b9195154926b808e3ae23750eaff3e81cd5f529 Mon Sep 17 00:00:00 2001
+From a3b51a8b34b382717a2bab9681135b034ae872e0 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 7b9195154926b808e3ae23750eaff3e81cd5f529 ]
+
@@ -12 +13,0 @@
-Cc: stable@dpdk.org
@@ -18,2 +19,2 @@
- drivers/net/virtio/virtio_user/virtio_user_dev.c | 7 +++++++
- 1 file changed, 7 insertions(+)
+ drivers/net/virtio/virtio_user/virtio_user_dev.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
@@ -22 +23 @@
-index 1cd1e95f45..16c58710d7 100644
+index ad5d2f3bf8..1277dbe038 100644
@@ -25,2 +26 @@
-@@ -654,6 +654,13 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
- void
+@@ -528,6 +528,12 @@ void
@@ -28,0 +29 @@
+ 	uint32_t i;
@@ -35 +36 @@
-+
+ 
@@ -38 +38,0 @@
- 	rte_mem_event_callback_unregister(VIRTIO_USER_MEM_EVENT_CLB_NAME, dev);

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

* [dpdk-stable] patch 'net/iavf: fix Tx threshold check' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (92 preceding siblings ...)
  2021-08-10 15:40 ` [dpdk-stable] patch 'net/virtio: fix interrupt handle leak' " christian.ehrhardt
@ 2021-08-10 15:40 ` christian.ehrhardt
  2021-08-10 15:40 ` [dpdk-stable] patch 'net/softnic: fix null dereference in arguments parsing' " christian.ehrhardt
                   ` (6 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:40 UTC (permalink / raw)
  To: Xiaoyun Li; +Cc: Beilei Xing, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/a4cb6c2543060ea443733548c24cb7462a174be0

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From a4cb6c2543060ea443733548c24cb7462a174be0 Mon Sep 17 00:00:00 2001
From: Xiaoyun Li <xiaoyun.li@intel.com>
Date: Thu, 22 Jul 2021 15:56:20 +0800
Subject: [PATCH] net/iavf: fix Tx threshold check

[ upstream commit ed21e06e44ad7fe5dfa4b8ed713e29833a474fa9 ]

Function check_tx_thresh is called with wrong parameter. If the
check fails, tx_queue_setup should return error not keep going.
This patch fixes above issues.

Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
---
 drivers/net/iavf/iavf_rxtx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index 93f3928af6..17468e4ca0 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -449,7 +449,8 @@ iavf_dev_tx_queue_setup(struct rte_eth_dev *dev,
 		tx_conf->tx_rs_thresh : DEFAULT_TX_RS_THRESH);
 	tx_free_thresh = (uint16_t)((tx_conf->tx_free_thresh) ?
 		tx_conf->tx_free_thresh : DEFAULT_TX_FREE_THRESH);
-	check_tx_thresh(nb_desc, tx_rs_thresh, tx_rs_thresh);
+	if (check_tx_thresh(nb_desc, tx_rs_thresh, tx_free_thresh) != 0)
+		return -EINVAL;
 
 	/* Free memory if needed. */
 	if (dev->data->tx_queues[queue_idx]) {
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:16.670207355 +0200
+++ 0095-net-iavf-fix-Tx-threshold-check.patch	2021-08-10 15:11:13.130638908 +0200
@@ -1 +1 @@
-From ed21e06e44ad7fe5dfa4b8ed713e29833a474fa9 Mon Sep 17 00:00:00 2001
+From a4cb6c2543060ea443733548c24cb7462a174be0 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit ed21e06e44ad7fe5dfa4b8ed713e29833a474fa9 ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index d61b32fcee..e33fe4576b 100644
+index 93f3928af6..17468e4ca0 100644
@@ -23 +24 @@
-@@ -708,7 +708,8 @@ iavf_dev_tx_queue_setup(struct rte_eth_dev *dev,
+@@ -449,7 +449,8 @@ iavf_dev_tx_queue_setup(struct rte_eth_dev *dev,

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

* [dpdk-stable] patch 'net/softnic: fix null dereference in arguments parsing' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (93 preceding siblings ...)
  2021-08-10 15:40 ` [dpdk-stable] patch 'net/iavf: fix Tx threshold check' " christian.ehrhardt
@ 2021-08-10 15:40 ` christian.ehrhardt
  2021-08-11 10:21   ` Christian Ehrhardt
  2021-08-10 15:40 ` [dpdk-stable] patch 'net/softnic: fix memory leak as profile is freed' " christian.ehrhardt
                   ` (5 subsequent siblings)
  100 siblings, 1 reply; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:40 UTC (permalink / raw)
  To: Dapeng Yu; +Cc: Jasvinder Singh, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/0eaed422260125d4d542168630bffe74b2462d5e

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 0eaed422260125d4d542168630bffe74b2462d5e Mon Sep 17 00:00:00 2001
From: Dapeng Yu <dapengx.yu@intel.com>
Date: Tue, 27 Jul 2021 16:14:59 +0800
Subject: [PATCH] net/softnic: fix null dereference in arguments parsing

[ upstream commit 51799b4f971982bc0757cf8a11940eb538b1af57 ]

When there is no "firmware" in arguments, the "firmware" pointer is
null, and will be dereferenced by rte_strscpy().

This patch moves the code block which copies character string from
"firmware" to "p->firmware" into the "if" statements where "firmware"
argument exists and it is duplicated successfully.

Coverity issue: 372136
Fixes: d8f852f5f369 ("net/softnic: fix memory leak in arguments parsing")

Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
---
 drivers/net/softnic/rte_eth_softnic.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c
index f4858255ce..5a6947615a 100644
--- a/drivers/net/softnic/rte_eth_softnic.c
+++ b/drivers/net/softnic/rte_eth_softnic.c
@@ -479,17 +479,19 @@ pmd_parse_args(struct pmd_params *p, const char *params)
 			&get_string, &firmware);
 		if (ret < 0)
 			goto out_free;
-	}
-	if (rte_strscpy(p->firmware, firmware,
-			sizeof(p->firmware)) < 0) {
-		PMD_LOG(WARNING,
-			"\"%s\": firmware path should be shorter than %zu",
-			firmware, sizeof(p->firmware));
+
+		if (rte_strscpy(p->firmware, firmware,
+				sizeof(p->firmware)) < 0) {
+			PMD_LOG(WARNING,
+				"\"%s\": "
+				"firmware path should be shorter than %zu",
+				firmware, sizeof(p->firmware));
+			free(firmware);
+			ret = -EINVAL;
+			goto out_free;
+		}
 		free(firmware);
-		ret = -EINVAL;
-		goto out_free;
 	}
-	free(firmware);
 	/* Connection listening port (optional) */
 	if (rte_kvargs_count(kvlist, PMD_PARAM_CONN_PORT) == 1) {
 		ret = rte_kvargs_process(kvlist, PMD_PARAM_CONN_PORT,
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:16.702153440 +0200
+++ 0096-net-softnic-fix-null-dereference-in-arguments-parsin.patch	2021-08-10 15:11:13.130638908 +0200
@@ -1 +1 @@
-From 51799b4f971982bc0757cf8a11940eb538b1af57 Mon Sep 17 00:00:00 2001
+From 0eaed422260125d4d542168630bffe74b2462d5e Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 51799b4f971982bc0757cf8a11940eb538b1af57 ]
+
@@ -15 +16,0 @@
-Cc: stable@dpdk.org
@@ -24 +25 @@
-index 0aa7147b13..b3b55b9035 100644
+index f4858255ce..5a6947615a 100644

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

* [dpdk-stable] patch 'net/softnic: fix memory leak as profile is freed' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (94 preceding siblings ...)
  2021-08-10 15:40 ` [dpdk-stable] patch 'net/softnic: fix null dereference in arguments parsing' " christian.ehrhardt
@ 2021-08-10 15:40 ` christian.ehrhardt
  2021-08-10 15:40 ` [dpdk-stable] patch 'app/testpmd: fix Tx checksum calculation for tunnel' " christian.ehrhardt
                   ` (4 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:40 UTC (permalink / raw)
  To: Dapeng Yu; +Cc: Jasvinder Singh, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/7f2d70b40028de98e2734a6acdad8eca0e745e94

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 7f2d70b40028de98e2734a6acdad8eca0e745e94 Mon Sep 17 00:00:00 2001
From: Dapeng Yu <dapengx.yu@intel.com>
Date: Wed, 28 Jul 2021 14:05:39 +0800
Subject: [PATCH] net/softnic: fix memory leak as profile is freed

[ upstream commit b3bc560bd6bdf3c9851d25bc0a66cb24aa1fd48c ]

In function softnic_table_action_profile_free(), the memory referenced
by pointer "ap" in the instance of "struct softnic_table_action_profile"
is not freed.

This patch fixes it.

Fixes: a737dd4e5863 ("net/softnic: add table action profile")

Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
---
 drivers/net/softnic/rte_eth_softnic_action.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/softnic/rte_eth_softnic_action.c b/drivers/net/softnic/rte_eth_softnic_action.c
index 92c744dc9a..33be9552a6 100644
--- a/drivers/net/softnic/rte_eth_softnic_action.c
+++ b/drivers/net/softnic/rte_eth_softnic_action.c
@@ -183,6 +183,7 @@ softnic_table_action_profile_free(struct pmd_internals *p)
 			break;
 
 		TAILQ_REMOVE(&p->table_action_profile_list, profile, node);
+		rte_table_action_profile_free(profile->ap);
 		free(profile);
 	}
 }
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:16.735793046 +0200
+++ 0097-net-softnic-fix-memory-leak-as-profile-is-freed.patch	2021-08-10 15:11:13.130638908 +0200
@@ -1 +1 @@
-From b3bc560bd6bdf3c9851d25bc0a66cb24aa1fd48c Mon Sep 17 00:00:00 2001
+From 7f2d70b40028de98e2734a6acdad8eca0e745e94 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b3bc560bd6bdf3c9851d25bc0a66cb24aa1fd48c ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org

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

* [dpdk-stable] patch 'app/testpmd: fix Tx checksum calculation for tunnel' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (95 preceding siblings ...)
  2021-08-10 15:40 ` [dpdk-stable] patch 'net/softnic: fix memory leak as profile is freed' " christian.ehrhardt
@ 2021-08-10 15:40 ` christian.ehrhardt
  2021-08-10 15:40 ` [dpdk-stable] patch 'cryptodev: fix freeing after device release' " christian.ehrhardt
                   ` (3 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:40 UTC (permalink / raw)
  To: Gregory Etelson
  Cc: Ori Kam, Ajit Khaparde, Xiaoyun Li, Olivier Matz, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/78626ad00f9e487b8f49fd578dec8f3f6a7e501a

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 78626ad00f9e487b8f49fd578dec8f3f6a7e501a Mon Sep 17 00:00:00 2001
From: Gregory Etelson <getelson@nvidia.com>
Date: Thu, 29 Jul 2021 20:01:41 +0300
Subject: [PATCH] app/testpmd: fix Tx checksum calculation for tunnel

[ upstream commit b2a9e4a855d0e5b4e3fdba5b126bcf00aa8f0ada ]

csumonly engine calculates Tx checksum of a tunnelled packet
for outer headers only or separately for outer and inner headers.
The calculation method is determined by checksum configuration options.
If Tx checksum calculation is separated,
the inner headers are processed before outer headers.

Inner headers processing sets checksum values to 0 unconditionally.
If Tx configuration offloads inner checksums only, outer checksum
calculation in software will read 0 instead of real values
and produce wrong result.

The patch zeroes inner checksums only before software calculation.

Fixes: 6b520d54ebfe ("app/testpmd: use Tx preparation in checksum engine")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---
 app/test-pmd/csumonly.c | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 7b92ab1195..7c5d54342b 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -451,17 +451,18 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
 
 	if (info->ethertype == _htons(RTE_ETHER_TYPE_IPV4)) {
 		ipv4_hdr = l3_hdr;
-		ipv4_hdr->hdr_checksum = 0;
 
 		ol_flags |= PKT_TX_IPV4;
 		if (info->l4_proto == IPPROTO_TCP && tso_segsz) {
 			ol_flags |= PKT_TX_IP_CKSUM;
 		} else {
-			if (tx_offloads & DEV_TX_OFFLOAD_IPV4_CKSUM)
+			if (tx_offloads & DEV_TX_OFFLOAD_IPV4_CKSUM) {
 				ol_flags |= PKT_TX_IP_CKSUM;
-			else
+			} else if (ipv4_hdr->hdr_checksum != 0) {
+				ipv4_hdr->hdr_checksum = 0;
 				ipv4_hdr->hdr_checksum =
 					rte_ipv4_cksum(ipv4_hdr);
+			}
 		}
 	} else if (info->ethertype == _htons(RTE_ETHER_TYPE_IPV6))
 		ol_flags |= PKT_TX_IPV6;
@@ -472,10 +473,10 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
 		udp_hdr = (struct rte_udp_hdr *)((char *)l3_hdr + info->l3_len);
 		/* do not recalculate udp cksum if it was 0 */
 		if (udp_hdr->dgram_cksum != 0) {
-			udp_hdr->dgram_cksum = 0;
-			if (tx_offloads & DEV_TX_OFFLOAD_UDP_CKSUM)
+			if (tx_offloads & DEV_TX_OFFLOAD_UDP_CKSUM) {
 				ol_flags |= PKT_TX_UDP_CKSUM;
-			else {
+			} else {
+				udp_hdr->dgram_cksum = 0;
 				udp_hdr->dgram_cksum =
 					get_udptcp_checksum(l3_hdr, udp_hdr,
 						info->ethertype);
@@ -485,12 +486,12 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
 			ol_flags |= PKT_TX_UDP_SEG;
 	} else if (info->l4_proto == IPPROTO_TCP) {
 		tcp_hdr = (struct rte_tcp_hdr *)((char *)l3_hdr + info->l3_len);
-		tcp_hdr->cksum = 0;
 		if (tso_segsz)
 			ol_flags |= PKT_TX_TCP_SEG;
-		else if (tx_offloads & DEV_TX_OFFLOAD_TCP_CKSUM)
+		else if (tx_offloads & DEV_TX_OFFLOAD_TCP_CKSUM) {
 			ol_flags |= PKT_TX_TCP_CKSUM;
-		else {
+		} else if (tcp_hdr->cksum != 0) {
+			tcp_hdr->cksum = 0;
 			tcp_hdr->cksum =
 				get_udptcp_checksum(l3_hdr, tcp_hdr,
 					info->ethertype);
@@ -500,13 +501,13 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
 	} else if (info->l4_proto == IPPROTO_SCTP) {
 		sctp_hdr = (struct rte_sctp_hdr *)
 			((char *)l3_hdr + info->l3_len);
-		sctp_hdr->cksum = 0;
 		/* sctp payload must be a multiple of 4 to be
 		 * offloaded */
 		if ((tx_offloads & DEV_TX_OFFLOAD_SCTP_CKSUM) &&
 			((ipv4_hdr->total_length & 0x3) == 0)) {
 			ol_flags |= PKT_TX_SCTP_CKSUM;
-		} else {
+		} else if (sctp_hdr->cksum != 0) {
+			sctp_hdr->cksum = 0;
 			/* XXX implement CRC32c, example available in
 			 * RFC3309 */
 		}
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:16.767684449 +0200
+++ 0098-app-testpmd-fix-Tx-checksum-calculation-for-tunnel.patch	2021-08-10 15:11:13.130638908 +0200
@@ -1 +1 @@
-From b2a9e4a855d0e5b4e3fdba5b126bcf00aa8f0ada Mon Sep 17 00:00:00 2001
+From 78626ad00f9e487b8f49fd578dec8f3f6a7e501a Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b2a9e4a855d0e5b4e3fdba5b126bcf00aa8f0ada ]
+
@@ -20 +21,0 @@
-Cc: stable@dpdk.org
@@ -32 +33 @@
-index 0161f72175..bd5ad64a57 100644
+index 7b92ab1195..7c5d54342b 100644
@@ -35 +36 @@
-@@ -480,17 +480,18 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
+@@ -451,17 +451,18 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
@@ -57 +58 @@
-@@ -501,10 +502,10 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
+@@ -472,10 +473,10 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
@@ -71 +72 @@
-@@ -514,12 +515,12 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
+@@ -485,12 +486,12 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
@@ -87 +88 @@
-@@ -529,13 +530,13 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
+@@ -500,13 +501,13 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,

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

* [dpdk-stable] patch 'cryptodev: fix freeing after device release' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (96 preceding siblings ...)
  2021-08-10 15:40 ` [dpdk-stable] patch 'app/testpmd: fix Tx checksum calculation for tunnel' " christian.ehrhardt
@ 2021-08-10 15:40 ` christian.ehrhardt
  2021-08-10 15:40 ` [dpdk-stable] patch 'crypto/octeontx: " christian.ehrhardt
                   ` (2 subsequent siblings)
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:40 UTC (permalink / raw)
  To: Ciara Power; +Cc: Zhihong Peng, Akhil Goyal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/8d586e78ec35caa18df292a704d04a3d68be84e6

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 8d586e78ec35caa18df292a704d04a3d68be84e6 Mon Sep 17 00:00:00 2001
From: Ciara Power <ciara.power@intel.com>
Date: Wed, 21 Jul 2021 12:51:22 +0000
Subject: [PATCH] cryptodev: fix freeing after device release

[ upstream commit eeaeca82b8cbd6599bafd4029aad5ce4dedff7a2 ]

The PMD destroy function was calling the release function, which frees
cryptodev->data, and then tries to free cryptodev->data->dev_private,
which causes the heap use after free issue.

A temporary pointer is set before the free of cryptodev->data,
which can then be used afterwards to free dev_private.
The free cannot be moved to before the release function is called,
as dev_private is used in the PMD close function while being released.

Fixes: 9e6edea41805 ("cryptodev: add APIs to assist PMD initialisation")

Reported-by: Zhihong Peng <zhihongx.peng@intel.com>
Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
---
 lib/librte_cryptodev/rte_cryptodev_pmd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/librte_cryptodev/rte_cryptodev_pmd.c b/lib/librte_cryptodev/rte_cryptodev_pmd.c
index 0912004127..e342daabc4 100644
--- a/lib/librte_cryptodev/rte_cryptodev_pmd.c
+++ b/lib/librte_cryptodev/rte_cryptodev_pmd.c
@@ -140,6 +140,7 @@ int
 rte_cryptodev_pmd_destroy(struct rte_cryptodev *cryptodev)
 {
 	int retval;
+	void *dev_priv = cryptodev->data->dev_private;
 
 	CDEV_LOG_INFO("Closing crypto device %s", cryptodev->device->name);
 
@@ -149,7 +150,7 @@ rte_cryptodev_pmd_destroy(struct rte_cryptodev *cryptodev)
 		return retval;
 
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY)
-		rte_free(cryptodev->data->dev_private);
+		rte_free(dev_priv);
 
 
 	cryptodev->device = NULL;
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:16.801842195 +0200
+++ 0099-cryptodev-fix-freeing-after-device-release.patch	2021-08-10 15:11:13.130638908 +0200
@@ -1 +1 @@
-From eeaeca82b8cbd6599bafd4029aad5ce4dedff7a2 Mon Sep 17 00:00:00 2001
+From 8d586e78ec35caa18df292a704d04a3d68be84e6 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit eeaeca82b8cbd6599bafd4029aad5ce4dedff7a2 ]
+
@@ -16 +17,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
- lib/cryptodev/rte_cryptodev_pmd.c | 3 ++-
+ lib/librte_cryptodev/rte_cryptodev_pmd.c | 3 ++-
@@ -25 +26 @@
-diff --git a/lib/cryptodev/rte_cryptodev_pmd.c b/lib/cryptodev/rte_cryptodev_pmd.c
+diff --git a/lib/librte_cryptodev/rte_cryptodev_pmd.c b/lib/librte_cryptodev/rte_cryptodev_pmd.c
@@ -27,2 +28,2 @@
---- a/lib/cryptodev/rte_cryptodev_pmd.c
-+++ b/lib/cryptodev/rte_cryptodev_pmd.c
+--- a/lib/librte_cryptodev/rte_cryptodev_pmd.c
++++ b/lib/librte_cryptodev/rte_cryptodev_pmd.c

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

* [dpdk-stable] patch 'crypto/octeontx: fix freeing after device release' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (97 preceding siblings ...)
  2021-08-10 15:40 ` [dpdk-stable] patch 'cryptodev: fix freeing after device release' " christian.ehrhardt
@ 2021-08-10 15:40 ` christian.ehrhardt
  2021-08-10 15:40 ` [dpdk-stable] patch 'doc: announce common prefix for ethdev' " christian.ehrhardt
  2021-08-10 15:40 ` [dpdk-stable] patch 'app/testpmd: fix IPv4 checksum' " christian.ehrhardt
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:40 UTC (permalink / raw)
  To: Akhil Goyal; +Cc: Zhihong Peng, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/8bf13272693339b0f50f5c1b3ff69c3090f5b5a2

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 8bf13272693339b0f50f5c1b3ff69c3090f5b5a2 Mon Sep 17 00:00:00 2001
From: Akhil Goyal <gakhil@marvell.com>
Date: Fri, 30 Jul 2021 23:28:27 +0530
Subject: [PATCH] crypto/octeontx: fix freeing after device release

[ upstream commit 12b650efd49d8b932a7717be1cafd13d9040ea3e ]

When the PMD is removed, rte_cryptodev_pmd_release_device
is called which frees cryptodev->data, and then tries to free
cryptodev->data->dev_private, which causes the heap use
after free issue.

A temporary pointer is set before the free of cryptodev->data,
which can then be used afterwards to free dev_private.

Fixes: bfe2ae495ee2 ("crypto/octeontx: add PMD skeleton")

Reported-by: Zhihong Peng <zhihongx.peng@intel.com>
Signed-off-by: Akhil Goyal <gakhil@marvell.com>
---
 drivers/crypto/octeontx/otx_cryptodev.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/octeontx/otx_cryptodev.c b/drivers/crypto/octeontx/otx_cryptodev.c
index ddece13118..adc6c5c042 100644
--- a/drivers/crypto/octeontx/otx_cryptodev.c
+++ b/drivers/crypto/octeontx/otx_cryptodev.c
@@ -72,6 +72,7 @@ otx_cpt_pci_remove(struct rte_pci_device *pci_dev)
 {
 	struct rte_cryptodev *cryptodev;
 	char name[RTE_CRYPTODEV_NAME_MAX_LEN];
+	void *dev_priv;
 
 	if (pci_dev == NULL)
 		return -EINVAL;
@@ -85,11 +86,13 @@ otx_cpt_pci_remove(struct rte_pci_device *pci_dev)
 	if (pci_dev->driver == NULL)
 		return -ENODEV;
 
+	dev_priv = cryptodev->data->dev_private;
+
 	/* free crypto device */
 	rte_cryptodev_pmd_release_device(cryptodev);
 
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY)
-		rte_free(cryptodev->data->dev_private);
+		rte_free(dev_priv);
 
 	cryptodev->device->driver = NULL;
 	cryptodev->device = NULL;
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:16.836756215 +0200
+++ 0100-crypto-octeontx-fix-freeing-after-device-release.patch	2021-08-10 15:11:13.130638908 +0200
@@ -1 +1 @@
-From 12b650efd49d8b932a7717be1cafd13d9040ea3e Mon Sep 17 00:00:00 2001
+From 8bf13272693339b0f50f5c1b3ff69c3090f5b5a2 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 12b650efd49d8b932a7717be1cafd13d9040ea3e ]
+
@@ -15 +16,0 @@
-Cc: stable@dpdk.org
@@ -24 +25 @@
-index 7207909abb..3822c0d779 100644
+index ddece13118..adc6c5c042 100644
@@ -27 +28 @@
-@@ -75,6 +75,7 @@ otx_cpt_pci_remove(struct rte_pci_device *pci_dev)
+@@ -72,6 +72,7 @@ otx_cpt_pci_remove(struct rte_pci_device *pci_dev)
@@ -35 +36 @@
-@@ -88,11 +89,13 @@ otx_cpt_pci_remove(struct rte_pci_device *pci_dev)
+@@ -85,11 +86,13 @@ otx_cpt_pci_remove(struct rte_pci_device *pci_dev)

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

* [dpdk-stable] patch 'doc: announce common prefix for ethdev' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (98 preceding siblings ...)
  2021-08-10 15:40 ` [dpdk-stable] patch 'crypto/octeontx: " christian.ehrhardt
@ 2021-08-10 15:40 ` christian.ehrhardt
  2021-08-10 15:40 ` [dpdk-stable] patch 'app/testpmd: fix IPv4 checksum' " christian.ehrhardt
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:40 UTC (permalink / raw)
  To: Ferruh Yigit
  Cc: Andrew Rybchenko, Jerin Jacob, Ajit Khaparde, Raslan Darawsheh,
	Tyler Retzlaff, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/f8af3d85d70c3150a4b6334ff5793de7f2e7015e

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From f8af3d85d70c3150a4b6334ff5793de7f2e7015e Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit@intel.com>
Date: Wed, 30 Jun 2021 10:21:16 +0100
Subject: [PATCH] doc: announce common prefix for ethdev

[ upstream commit fb5b717acf432ca3f9f82292a1af9fe6242ee376 ]

Announce adding 'RTE_ETH_' prefix to all public ethdev macros/enums on
v21.11.
Backward compatibility macros will be added on v21.11 and they will be
removed on v22.11.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Raslan Darawsheh <rasland@nvidia.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 doc/guides/rel_notes/deprecation.rst | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 58109590cc..7ac836098a 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -59,6 +59,12 @@ Deprecation Notices
   - ``rte_eth_dev_stop``
   - ``rte_eth_dev_close``
 
+* ethdev: Will add ``RTE_ETH_`` prefix to all ethdev macros/enums in v21.11.
+  Macros will be added for backward compatibility.
+  Backward compatibility macros will be removed on v22.11.
+  A few old backward compatibility macros from 2013 that does not have
+  proper prefix will be removed on v21.11.
+
 * ethdev: New offload flags ``DEV_RX_OFFLOAD_FLOW_MARK`` will be added in 19.11.
   This will allow application to enable or disable PMDs from updating
   ``rte_mbuf::hash::fdir``.
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:16.868025557 +0200
+++ 0101-doc-announce-common-prefix-for-ethdev.patch	2021-08-10 15:11:13.130638908 +0200
@@ -1 +1 @@
-From fb5b717acf432ca3f9f82292a1af9fe6242ee376 Mon Sep 17 00:00:00 2001
+From f8af3d85d70c3150a4b6334ff5793de7f2e7015e Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit fb5b717acf432ca3f9f82292a1af9fe6242ee376 ]
+
@@ -22 +24 @@
-index 4bc4d34e5c..d9c0e65921 100644
+index 58109590cc..7ac836098a 100644
@@ -25,3 +27,3 @@
-@@ -51,6 +51,12 @@ Deprecation Notices
-   us extending existing enum/define.
-   One solution can be using a fixed size array instead of ``.*MAX.*`` value.
+@@ -59,6 +59,12 @@ Deprecation Notices
+   - ``rte_eth_dev_stop``
+   - ``rte_eth_dev_close``
@@ -35,3 +37,3 @@
- * ethdev: The flow director API, including ``rte_eth_conf.fdir_conf`` field,
-   and the related structures (``rte_fdir_*`` and ``rte_eth_fdir_*``),
-   will be removed in DPDK 20.11.
+ * ethdev: New offload flags ``DEV_RX_OFFLOAD_FLOW_MARK`` will be added in 19.11.
+   This will allow application to enable or disable PMDs from updating
+   ``rte_mbuf::hash::fdir``.

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

* [dpdk-stable] patch 'app/testpmd: fix IPv4 checksum' has been queued to stable release 19.11.10
  2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
                   ` (99 preceding siblings ...)
  2021-08-10 15:40 ` [dpdk-stable] patch 'doc: announce common prefix for ethdev' " christian.ehrhardt
@ 2021-08-10 15:40 ` christian.ehrhardt
  100 siblings, 0 replies; 114+ messages in thread
From: christian.ehrhardt @ 2021-08-10 15:40 UTC (permalink / raw)
  To: Gregory Etelson; +Cc: Ajit Khaparde, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/d3dcfe0a54322e732b9b8191c8bb9672da9333ee

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From d3dcfe0a54322e732b9b8191c8bb9672da9333ee Mon Sep 17 00:00:00 2001
From: Gregory Etelson <getelson@nvidia.com>
Date: Mon, 2 Aug 2021 21:13:16 +0300
Subject: [PATCH] app/testpmd: fix IPv4 checksum

[ upstream commit de73c8ac50681a0b9221407a100a2c578f7e6ad3 ]

UDP protocol reserves 0 checksum value for special purposes.
Other protocols, like IPv4, TCP and SCTP must calculate checksum value
in software or offload checksum calculation to hardware.

If IPv4 TX checksum offload was off and header checksum was set to 0,
testpmd csum engine did not calculate checksum value for IPv4, TCP and
SCTP.

The patch always calculates IPv4, TCP and SCTP TX checksums if it is
not offloaded.

Bugzilla ID: 768
Fixes: b2a9e4a855d0 ("app/testpmd: fix Tx checksum calculation for tunnel")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 app/test-pmd/csumonly.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 7c5d54342b..29044c4170 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -458,7 +458,7 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
 		} else {
 			if (tx_offloads & DEV_TX_OFFLOAD_IPV4_CKSUM) {
 				ol_flags |= PKT_TX_IP_CKSUM;
-			} else if (ipv4_hdr->hdr_checksum != 0) {
+			} else {
 				ipv4_hdr->hdr_checksum = 0;
 				ipv4_hdr->hdr_checksum =
 					rte_ipv4_cksum(ipv4_hdr);
@@ -490,7 +490,7 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
 			ol_flags |= PKT_TX_TCP_SEG;
 		else if (tx_offloads & DEV_TX_OFFLOAD_TCP_CKSUM) {
 			ol_flags |= PKT_TX_TCP_CKSUM;
-		} else if (tcp_hdr->cksum != 0) {
+		} else {
 			tcp_hdr->cksum = 0;
 			tcp_hdr->cksum =
 				get_udptcp_checksum(l3_hdr, tcp_hdr,
@@ -506,7 +506,7 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
 		if ((tx_offloads & DEV_TX_OFFLOAD_SCTP_CKSUM) &&
 			((ipv4_hdr->total_length & 0x3) == 0)) {
 			ol_flags |= PKT_TX_SCTP_CKSUM;
-		} else if (sctp_hdr->cksum != 0) {
+		} else {
 			sctp_hdr->cksum = 0;
 			/* XXX implement CRC32c, example available in
 			 * RFC3309 */
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:16.900159865 +0200
+++ 0102-app-testpmd-fix-IPv4-checksum.patch	2021-08-10 15:11:13.134638936 +0200
@@ -1 +1 @@
-From de73c8ac50681a0b9221407a100a2c578f7e6ad3 Mon Sep 17 00:00:00 2001
+From d3dcfe0a54322e732b9b8191c8bb9672da9333ee Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit de73c8ac50681a0b9221407a100a2c578f7e6ad3 ]
+
@@ -19 +20,0 @@
-Cc: stable@dpdk.org
@@ -28 +29 @@
-index bd5ad64a57..607c889359 100644
+index 7c5d54342b..29044c4170 100644
@@ -31 +32 @@
-@@ -487,7 +487,7 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
+@@ -458,7 +458,7 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
@@ -40 +41 @@
-@@ -519,7 +519,7 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
+@@ -490,7 +490,7 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
@@ -49 +50 @@
-@@ -535,7 +535,7 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
+@@ -506,7 +506,7 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,

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

* Re: [dpdk-stable] patch 'net/virtio: fix interrupt handle leak' has been queued to stable release 19.11.10
  2021-08-10 15:40 ` [dpdk-stable] patch 'net/virtio: fix interrupt handle leak' " christian.ehrhardt
@ 2021-08-11  6:52   ` Christian Ehrhardt
  0 siblings, 0 replies; 114+ messages in thread
From: Christian Ehrhardt @ 2021-08-11  6:52 UTC (permalink / raw)
  To: Gaoxiang Liu; +Cc: Chenbo Xia, Maxime Coquelin, dpdk stable

On Tue, Aug 10, 2021 at 5:45 PM <christian.ehrhardt@canonical.com> wrote:
>
> Hi,
>
> FYI, your patch has been queued to stable release 19.11.10

Hi,
while applying cleanly your patch caused build time failures like:

../drivers/net/virtio/virtio_user/virtio_user_dev.c: In function
‘virtio_user_dev_uninit’:
../drivers/net/virtio/virtio_user/virtio_user_dev.c:531:52: error:
‘struct virtio_user_dev’ has no member named ‘hw’
  531 |  struct rte_eth_dev *eth_dev = &rte_eth_devices[dev->hw.port_id];
      |

Therefore the patch will be de-qeueud from the stable branch that shall become
19.11.10.
Please consider having a look and providing a backport.

A backport should contain a reference to the DPDK main branch commit
in it's commit message in the following fashion:
    [ upstream commit <commit's dpdk main branch SHA-1 checksum> ]

For example:
    https://git.dpdk.org/dpdk-stable/commit/?h=18.11&id=d90e6ae6f936ecdc2fd3811ff9f26aec7f3c06eb

When sending the backported patch, please indicate the target branch in the
subject line, as we have multiple branches, for example:
    [PATCH $stable_branch] foo/bar: fix baz

With git format-patch, this can be achieved by appending the parameter:
    --subject-prefix='PATCH 19.11'

Send the backported patch to "stable@dpdk.org" but not "dev@dpdk.org".

FYI, branch $stable_branch is located at tree:
   https://git.dpdk.org/dpdk-stable

Thanks in advance,
Chrtistian


> Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
> It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue
>
> This queued commit can be viewed at:
> https://github.com/cpaelzer/dpdk-stable-queue/commit/a3b51a8b34b382717a2bab9681135b034ae872e0
>
> Thanks.
>
> Christian Ehrhardt <christian.ehrhardt@canonical.com>
>
> ---
> From a3b51a8b34b382717a2bab9681135b034ae872e0 Mon Sep 17 00:00:00 2001
> From: Gaoxiang Liu <liugaoxiang@huawei.com>
> Date: Mon, 26 Jul 2021 22:42:05 +0800
> Subject: [PATCH] net/virtio: fix interrupt handle leak
>
> [ upstream commit 7b9195154926b808e3ae23750eaff3e81cd5f529 ]
>
> Free memory of interrupt handle in virtio_user_dev_uninit() to
> avoid memory leak.
> when virtio user dev closes, memory of interrupt handle is not freed
> that is allocated in virtio_user_fill_intr_handle().
>
> Fixes: 3d4fb6fd2505 ("net/virtio-user: support Rx interrupt")
>
> Signed-off-by: Gaoxiang Liu <liugaoxiang@huawei.com>
> Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
>  drivers/net/virtio/virtio_user/virtio_user_dev.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
> index ad5d2f3bf8..1277dbe038 100644
> --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
> +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
> @@ -528,6 +528,12 @@ void
>  virtio_user_dev_uninit(struct virtio_user_dev *dev)
>  {
>         uint32_t i;
> +       struct rte_eth_dev *eth_dev = &rte_eth_devices[dev->hw.port_id];
> +
> +       if (eth_dev->intr_handle) {
> +               free(eth_dev->intr_handle);
> +               eth_dev->intr_handle = NULL;
> +       }
>
>         virtio_user_stop_device(dev);
>
> --
> 2.32.0
>
> ---
>   Diff of the applied patch vs upstream commit (please double-check if non-empty:
> ---
> --- -   2021-08-10 15:11:16.635100829 +0200
> +++ 0094-net-virtio-fix-interrupt-handle-leak.patch     2021-08-10 15:11:13.126638878 +0200
> @@ -1 +1 @@
> -From 7b9195154926b808e3ae23750eaff3e81cd5f529 Mon Sep 17 00:00:00 2001
> +From a3b51a8b34b382717a2bab9681135b034ae872e0 Mon Sep 17 00:00:00 2001
> @@ -5,0 +6,2 @@
> +[ upstream commit 7b9195154926b808e3ae23750eaff3e81cd5f529 ]
> +
> @@ -12 +13,0 @@
> -Cc: stable@dpdk.org
> @@ -18,2 +19,2 @@
> - drivers/net/virtio/virtio_user/virtio_user_dev.c | 7 +++++++
> - 1 file changed, 7 insertions(+)
> + drivers/net/virtio/virtio_user/virtio_user_dev.c | 6 ++++++
> + 1 file changed, 6 insertions(+)
> @@ -22 +23 @@
> -index 1cd1e95f45..16c58710d7 100644
> +index ad5d2f3bf8..1277dbe038 100644
> @@ -25,2 +26 @@
> -@@ -654,6 +654,13 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
> - void
> +@@ -528,6 +528,12 @@ void
> @@ -28,0 +29 @@
> +       uint32_t i;
> @@ -35 +36 @@
> -+
> +
> @@ -38 +38,0 @@
> -       rte_mem_event_callback_unregister(VIRTIO_USER_MEM_EVENT_CLB_NAME, dev);



-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd

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

* Re: [dpdk-stable] patch 'net/bnxt: fix null dereference in interrupt handler' has been queued to stable release 19.11.10
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/bnxt: fix null dereference in interrupt handler' " christian.ehrhardt
@ 2021-08-11  8:50   ` Christian Ehrhardt
  0 siblings, 0 replies; 114+ messages in thread
From: Christian Ehrhardt @ 2021-08-11  8:50 UTC (permalink / raw)
  To: Kalesh AP; +Cc: Ajit Khaparde, Lance Richardson, dpdk stable

On Tue, Aug 10, 2021 at 5:44 PM <christian.ehrhardt@canonical.com> wrote:
>
> Hi,
>
> FYI, your patch has been queued to stable release 19.11.10

Hi,
while applying cleanly your patch caused build time failures like:

../drivers/net/bnxt/bnxt_irq.c: In function ‘bnxt_int_handler’:
../drivers/net/bnxt/bnxt_irq.c:48:3: error: ‘cp_ring_size’ undeclared
(first use in this function)
   48 |   cp_ring_size = cpr->cp_ring_struct->ring_size;
      |   ^~~~~~~~~~~~

Therefore the patch will be de-qeueud from the stable branch that shall become
19.11.10.
Please consider having a look and providing a backport.

A backport should contain a reference to the DPDK main branch commit
in it's commit message in the following fashion:
    [ upstream commit <commit's dpdk main branch SHA-1 checksum> ]

For example:
    https://git.dpdk.org/dpdk-stable/commit/?h=18.11&id=d90e6ae6f936ecdc2fd3811ff9f26aec7f3c06eb

When sending the backported patch, please indicate the target branch in the
subject line, as we have multiple branches, for example:
    [PATCH 19.11] foo/bar: fix baz

With git format-patch, this can be achieved by appending the parameter:
    --subject-prefix='PATCH 19.11'

Send the backported patch to "stable@dpdk.org" but not "dev@dpdk.org".

FYI, branch 19.11 is located at tree:
   https://git.dpdk.org/dpdk-stable

Thanks in advance,
Chrtistian

> Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
> It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue
>
> This queued commit can be viewed at:
> https://github.com/cpaelzer/dpdk-stable-queue/commit/8945c5a358b46e2351289050d4c1df982e76c95c
>
> Thanks.
>
> Christian Ehrhardt <christian.ehrhardt@canonical.com>
>
> ---
> From 8945c5a358b46e2351289050d4c1df982e76c95c Mon Sep 17 00:00:00 2001
> From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> Date: Tue, 20 Jul 2021 21:51:58 +0530
> Subject: [PATCH] net/bnxt: fix null dereference in interrupt handler
>
> [ upstream commit 3f44ec48c733f7d7607877164c9aa0305de9cecd ]
>
> Coverity reports that pointer "cpr->cp_ring_struct" may be
> dereferenced with null value. This patch fixes this.
>
> Coverity issue: 372063
> Fixes: 5ed30db87fa8 ("net/bnxt: fix missing barriers in completion handling")
>
> Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
> ---
>  drivers/net/bnxt/bnxt_irq.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c
> index 93779f4e0c..1f33429116 100644
> --- a/drivers/net/bnxt/bnxt_irq.c
> +++ b/drivers/net/bnxt/bnxt_irq.c
> @@ -45,6 +45,7 @@ void bnxt_int_handler(void *param)
>                         return;
>                 }
>
> +               cp_ring_size = cpr->cp_ring_struct->ring_size;
>                 cons = RING_CMP(cpr->cp_ring_struct, raw_cons);
>                 cmp = &cpr->cp_desc_ring[cons];
>
> --
> 2.32.0
>
> ---
>   Diff of the applied patch vs upstream commit (please double-check if non-empty:
> ---
> --- -   2021-08-10 15:11:16.029545681 +0200
> +++ 0078-net-bnxt-fix-null-dereference-in-interrupt-handler.patch       2021-08-10 15:11:13.090638619 +0200
> @@ -1 +1 @@
> -From 3f44ec48c733f7d7607877164c9aa0305de9cecd Mon Sep 17 00:00:00 2001
> +From 8945c5a358b46e2351289050d4c1df982e76c95c Mon Sep 17 00:00:00 2001
> @@ -5,0 +6,2 @@
> +[ upstream commit 3f44ec48c733f7d7607877164c9aa0305de9cecd ]
> +
> @@ -11 +12,0 @@
> -Cc: stable@dpdk.org
> @@ -17,2 +18,2 @@
> - drivers/net/bnxt/bnxt_irq.c | 2 +-
> - 1 file changed, 1 insertion(+), 1 deletion(-)
> + drivers/net/bnxt/bnxt_irq.c | 1 +
> + 1 file changed, 1 insertion(+)
> @@ -21 +22 @@
> -index ebdac8385d..122a1f9908 100644
> +index 93779f4e0c..1f33429116 100644
> @@ -24,9 +25 @@
> -@@ -33,7 +33,6 @@ void bnxt_int_handler(void *param)
> -               return;
> -
> -       raw_cons = cpr->cp_raw_cons;
> --      cp_ring_size = cpr->cp_ring_struct->ring_size;
> -       pthread_mutex_lock(&bp->def_cp_lock);
> -       while (1) {
> -               if (!cpr || !cpr->cp_ring_struct || !cpr->cp_db.doorbell) {
> -@@ -46,6 +45,7 @@ void bnxt_int_handler(void *param)
> +@@ -45,6 +45,7 @@ void bnxt_int_handler(void *param)



-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd

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

* Re: [dpdk-stable] patch 'net/bnxt: clear cached statistics' has been queued to stable release 19.11.10
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/bnxt: clear cached statistics' " christian.ehrhardt
@ 2021-08-11  8:54   ` Christian Ehrhardt
  0 siblings, 0 replies; 114+ messages in thread
From: Christian Ehrhardt @ 2021-08-11  8:54 UTC (permalink / raw)
  To: Kalesh AP; +Cc: Ajit Khaparde, Lance Richardson, Somnath Kotur, dpdk stable

On Tue, Aug 10, 2021 at 5:43 PM <christian.ehrhardt@canonical.com> wrote:
>
> Hi,
>
> FYI, your patch has been queued to stable release 19.11.10

Hi,
while applying cleanly your patch caused build time failures like:

../drivers/net/bnxt/bnxt_stats.c: In function ‘bnxt_clear_prev_stat’:
../drivers/net/bnxt/bnxt_stats.c:433:11: error: ‘struct bnxt’ has no
member named ‘prev_rx_ring_stats’
  433 |  memset(bp->prev_rx_ring_stats, 0, sizeof(struct
bnxt_ring_stats) * bp->rx_cp_nr_rings);
      |           ^~
../drivers/net/bnxt/bnxt_stats.c:433:43: error: invalid application of
‘sizeof’ to incomplete type ‘struct bnxt_ring_stats’
  433 |  memset(bp->prev_rx_ring_stats, 0, sizeof(struct
bnxt_ring_stats) * bp->rx_cp_nr_rings);
      |                                           ^~~~~~
../drivers/net/bnxt/bnxt_stats.c:434:11: error: ‘struct bnxt’ has no
member named ‘prev_tx_ring_stats’
  434 |  memset(bp->prev_tx_ring_stats, 0, sizeof(struct
bnxt_ring_stats) * bp->tx_cp_nr_rings);
      |           ^~
../drivers/net/bnxt/bnxt_stats.c:434:43: error: invalid application of
‘sizeof’ to incomplete type ‘struct bnxt_ring_stats’
  434 |  memset(bp->prev_tx_ring_stats, 0, sizeof(struct
bnxt_ring_stats) * bp->tx_cp_nr_rings);
      |

Therefore the patch will be de-qeueud from the stable branch that shall become
19.11.10.
Please consider having a look and providing a backport.

A backport should contain a reference to the DPDK main branch commit
in it's commit message in the following fashion:
    [ upstream commit <commit's dpdk main branch SHA-1 checksum> ]

For example:
    https://git.dpdk.org/dpdk-stable/commit/?h=18.11&id=d90e6ae6f936ecdc2fd3811ff9f26aec7f3c06eb

When sending the backported patch, please indicate the target branch in the
subject line, as we have multiple branches, for example:
    [PATCH 19.11] foo/bar: fix baz

With git format-patch, this can be achieved by appending the parameter:
    --subject-prefix='PATCH 19.11'

Send the backported patch to "stable@dpdk.org" but not "dev@dpdk.org".

FYI, branch 19.11 is located at tree:
   https://git.dpdk.org/dpdk-stable

Thanks in advance,
Chrtistian

> Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
> It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue
>
> This queued commit can be viewed at:
> https://github.com/cpaelzer/dpdk-stable-queue/commit/a0776bdb0995d658f4c9793b70b56fe7f4118e5f
>
> Thanks.
>
> Christian Ehrhardt <christian.ehrhardt@canonical.com>
>
> ---
> From a0776bdb0995d658f4c9793b70b56fe7f4118e5f Mon Sep 17 00:00:00 2001
> From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> Date: Tue, 13 Jul 2021 19:04:13 +0530
> Subject: [PATCH] net/bnxt: clear cached statistics
>
> [ upstream commit 84fd852caac19795d0a05af8dabce8f011fe61a4 ]
>
> As part of the workaround put in the commit "219842b9990c",
> driver caches the last read stats values from the hardware.
> But this is not cleared during the clear stats operation. This
> results in showing up stale stats values while reading the stats
> after the clear operation.
>
> 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>
> Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
> Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
> ---
>  drivers/net/bnxt/bnxt_stats.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> diff --git a/drivers/net/bnxt/bnxt_stats.c b/drivers/net/bnxt/bnxt_stats.c
> index 692b0967eb..a30e2b465d 100644
> --- a/drivers/net/bnxt/bnxt_stats.c
> +++ b/drivers/net/bnxt/bnxt_stats.c
> @@ -424,6 +424,16 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
>         return rc;
>  }
>
> +static void bnxt_clear_prev_stat(struct bnxt *bp)
> +{
> +       /*
> +        * Clear the cached values of stats returned by HW in the previous
> +        * get operation.
> +        */
> +       memset(bp->prev_rx_ring_stats, 0, sizeof(struct bnxt_ring_stats) * bp->rx_cp_nr_rings);
> +       memset(bp->prev_tx_ring_stats, 0, sizeof(struct bnxt_ring_stats) * bp->tx_cp_nr_rings);
> +}
> +
>  int bnxt_stats_reset_op(struct rte_eth_dev *eth_dev)
>  {
>         struct bnxt *bp = eth_dev->data->dev_private;
> @@ -446,6 +456,8 @@ int bnxt_stats_reset_op(struct rte_eth_dev *eth_dev)
>                 rte_atomic64_clear(&rxq->rx_mbuf_alloc_fail);
>         }
>
> +       bnxt_clear_prev_stat(bp);
> +
>         return ret;
>  }
>
> @@ -611,5 +623,7 @@ int bnxt_dev_xstats_reset_op(struct rte_eth_dev *eth_dev)
>                 PMD_DRV_LOG(ERR, "Failed to reset xstats: %s\n",
>                             strerror(-ret));
>
> +       bnxt_clear_prev_stat(bp);
> +
>         return ret;
>  }
> --
> 2.32.0
>
> ---
>   Diff of the applied patch vs upstream commit (please double-check if non-empty:
> ---
> --- -   2021-08-10 15:11:15.728060604 +0200
> +++ 0070-net-bnxt-clear-cached-statistics.patch 2021-08-10 15:11:13.074638504 +0200
> @@ -1 +1 @@
> -From 84fd852caac19795d0a05af8dabce8f011fe61a4 Mon Sep 17 00:00:00 2001
> +From a0776bdb0995d658f4c9793b70b56fe7f4118e5f Mon Sep 17 00:00:00 2001
> @@ -5,0 +6,2 @@
> +[ upstream commit 84fd852caac19795d0a05af8dabce8f011fe61a4 ]
> +
> @@ -13 +14,0 @@
> -Cc: stable@dpdk.org
> @@ -24 +25 @@
> -index c7b23f46a1..991eafc644 100644
> +index 692b0967eb..a30e2b465d 100644
> @@ -27 +28 @@
> -@@ -603,6 +603,16 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
> +@@ -424,6 +424,16 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
> @@ -44 +45 @@
> -@@ -625,6 +635,8 @@ int bnxt_stats_reset_op(struct rte_eth_dev *eth_dev)
> +@@ -446,6 +456,8 @@ int bnxt_stats_reset_op(struct rte_eth_dev *eth_dev)
> @@ -53 +54 @@
> -@@ -933,6 +945,8 @@ int bnxt_dev_xstats_reset_op(struct rte_eth_dev *eth_dev)
> +@@ -611,5 +623,7 @@ int bnxt_dev_xstats_reset_op(struct rte_eth_dev *eth_dev)
> @@ -61 +61,0 @@
> -



-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd

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

* Re: [dpdk-stable] patch 'net/hns3: fix delay for waiting to stop Rx/Tx' has been queued to stable release 19.11.10
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/hns3: fix delay for waiting to stop Rx/Tx' " christian.ehrhardt
@ 2021-08-11  9:02   ` Christian Ehrhardt
  0 siblings, 0 replies; 114+ messages in thread
From: Christian Ehrhardt @ 2021-08-11  9:02 UTC (permalink / raw)
  To: Huisong Li; +Cc: Min Hu, dpdk stable

On Tue, Aug 10, 2021 at 5:42 PM <christian.ehrhardt@canonical.com> wrote:
>
> Hi,
>
> FYI, your patch has been queued to stable release 19.11.10
>
> Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
> It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue
>
> This queued commit can be viewed at:
> https://github.com/cpaelzer/dpdk-stable-queue/commit/249c35152a9bcd6d4c4b52776602750552dcf294
>
> Thanks.
>
> Christian Ehrhardt <christian.ehrhardt@canonical.com>
>
> ---
> From 249c35152a9bcd6d4c4b52776602750552dcf294 Mon Sep 17 00:00:00 2001
> From: Huisong Li <lihuisong@huawei.com>
> Date: Sun, 13 Jun 2021 10:31:52 +0800
> Subject: [PATCH] net/hns3: fix delay for waiting to stop Rx/Tx
>
> [ upstream commit 4d8cce267840556cec8483c61f8cfbf25873496d ]
>
> When the primary process executes dev_stop or is being reset, the packet
> sending and receiving functions is changed. In this moment, the primary
> process requests secondary processes to change their Rx/Tx functions, and
> delays a period of time in case of crashes when queues are still in use.
> The delay time depends on the number of queues actually used, instead of
> the maximum number of queues supported by the device.
>
> Fixes: 23d4b61fee5d ("net/hns3: support multiple process")
>
> Signed-off-by: Huisong Li <lihuisong@huawei.com>
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> ---
>  drivers/net/hns3/hns3_ethdev.c    | 1184 ++++++++++++++++++++++++++++-
>  drivers/net/hns3/hns3_ethdev_vf.c |    4 +-
>  2 files changed, 1184 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
> index ac82e0b5ef..e1bc55682c 100644
> --- a/drivers/net/hns3/hns3_ethdev.c
> +++ b/drivers/net/hns3/hns3_ethdev.c
> @@ -4742,7 +4742,7 @@ hns3_dev_stop(struct rte_eth_dev *dev)
>         /* Disable datapath on secondary process. */
>         hns3_mp_req_stop_rxtx(dev);
>         /* Prevent crashes when queues are still in use. */
> -       rte_delay_ms(hw->tqps_num);
> +       rte_delay_ms(hw->cfg_max_queues);
>
>         rte_spinlock_lock(&hw->lock);
>         if (rte_atomic16_read(&hw->reset.resetting) == 0) {
> @@ -5130,10 +5130,1190 @@ hns3_get_reset_level(struct hns3_adapter *hns, uint64_t *levels)
>                 reset_level = HNS3_IMP_RESET;
>         else if (hns3_atomic_test_bit(HNS3_GLOBAL_RESET, levels))
>                 reset_level = HNS3_GLOBAL_RESET;
> +<<<<<<< HEAD

I beg your pardon, this was my mistake to be missing this remaining
three-way-merge snippet when backporting.
I have fixed it now - the patch is still applied, looks correct to me
now and can be seen at
  https://github.com/cpaelzer/dpdk-stable-queue/commit/779b8527cef5227ff7972522b5ac5c3cae3e8169

>         else if (hns3_atomic_test_bit(HNS3_FUNC_RESET, levels))
>                 reset_level = HNS3_FUNC_RESET;
>         else if (hns3_atomic_test_bit(HNS3_FLR_RESET, levels))
>                 reset_level = HNS3_FLR_RESET;
> +||||||| constructed merge base
> +       else if (hns3_atomic_test_bit(HNS3_FUNC_RESET, levels))
> +               reset_level = HNS3_FUNC_RESET;
> +       else if (hns3_atomic_test_bit(HNS3_FLR_RESET, levels))
> +               reset_level = HNS3_FLR_RESET;
> +
> +       if (hw->reset.level != HNS3_NONE_RESET && reset_level < hw->reset.level)
> +               return HNS3_NONE_RESET;
> +
> +       return reset_level;
> +}
> +
> +static void
> +hns3_record_imp_error(struct hns3_adapter *hns)
> +{
> +       struct hns3_hw *hw = &hns->hw;
> +       uint32_t reg_val;
> +
> +       reg_val = hns3_read_dev(hw, HNS3_VECTOR0_OTER_EN_REG);
> +       if (hns3_get_bit(reg_val, HNS3_VECTOR0_IMP_RD_POISON_B)) {
> +               hns3_warn(hw, "Detected IMP RD poison!");
> +               hns3_set_bit(reg_val, HNS3_VECTOR0_IMP_RD_POISON_B, 0);
> +               hns3_write_dev(hw, HNS3_VECTOR0_OTER_EN_REG, reg_val);
> +       }
> +
> +       if (hns3_get_bit(reg_val, HNS3_VECTOR0_IMP_CMDQ_ERR_B)) {
> +               hns3_warn(hw, "Detected IMP CMDQ error!");
> +               hns3_set_bit(reg_val, HNS3_VECTOR0_IMP_CMDQ_ERR_B, 0);
> +               hns3_write_dev(hw, HNS3_VECTOR0_OTER_EN_REG, reg_val);
> +       }
> +}
> +
> +static int
> +hns3_prepare_reset(struct hns3_adapter *hns)
> +{
> +       struct hns3_hw *hw = &hns->hw;
> +       uint32_t reg_val;
> +       int ret;
> +
> +       switch (hw->reset.level) {
> +       case HNS3_FUNC_RESET:
> +               ret = hns3_func_reset_cmd(hw, HNS3_PF_FUNC_ID);
> +               if (ret)
> +                       return ret;
> +
> +               /*
> +                * After performaning pf reset, it is not necessary to do the
> +                * mailbox handling or send any command to firmware, because
> +                * any mailbox handling or command to firmware is only valid
> +                * after hns3_cmd_init is called.
> +                */
> +               __atomic_store_n(&hw->reset.disable_cmd, 1, __ATOMIC_RELAXED);
> +               hw->reset.stats.request_cnt++;
> +               break;
> +       case HNS3_IMP_RESET:
> +               hns3_record_imp_error(hns);
> +               reg_val = hns3_read_dev(hw, HNS3_VECTOR0_OTER_EN_REG);
> +               hns3_write_dev(hw, HNS3_VECTOR0_OTER_EN_REG, reg_val |
> +                              BIT(HNS3_VECTOR0_IMP_RESET_INT_B));
> +               break;
> +       default:
> +               break;
> +       }
> +       return 0;
> +}
> +
> +static int
> +hns3_set_rst_done(struct hns3_hw *hw)
> +{
> +       struct hns3_pf_rst_done_cmd *req;
> +       struct hns3_cmd_desc desc;
> +
> +       req = (struct hns3_pf_rst_done_cmd *)desc.data;
> +       hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_PF_RST_DONE, false);
> +       req->pf_rst_done |= HNS3_PF_RESET_DONE_BIT;
> +       return hns3_cmd_send(hw, &desc, 1);
> +}
> +
> +static int
> +hns3_stop_service(struct hns3_adapter *hns)
> +{
> +       struct hns3_hw *hw = &hns->hw;
> +       struct rte_eth_dev *eth_dev;
> +
> +       eth_dev = &rte_eth_devices[hw->data->port_id];
> +       hw->mac.link_status = ETH_LINK_DOWN;
> +       if (hw->adapter_state == HNS3_NIC_STARTED) {
> +               rte_eal_alarm_cancel(hns3_service_handler, eth_dev);
> +               hns3_update_linkstatus_and_event(hw, false);
> +       }
> +
> +       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);
> +
> +       rte_spinlock_lock(&hw->lock);
> +       if (hns->hw.adapter_state == HNS3_NIC_STARTED ||
> +           hw->adapter_state == HNS3_NIC_STOPPING) {
> +               hns3_enable_all_queues(hw, false);
> +               hns3_do_stop(hns);
> +               hw->reset.mbuf_deferred_free = true;
> +       } else
> +               hw->reset.mbuf_deferred_free = false;
> +
> +       /*
> +        * It is cumbersome for hardware to pick-and-choose entries for deletion
> +        * from table space. Hence, for function reset software intervention is
> +        * required to delete the entries
> +        */
> +       if (__atomic_load_n(&hw->reset.disable_cmd, __ATOMIC_RELAXED) == 0)
> +               hns3_configure_all_mc_mac_addr(hns, true);
> +       rte_spinlock_unlock(&hw->lock);
> +
> +       return 0;
> +}
> +
> +static int
> +hns3_start_service(struct hns3_adapter *hns)
> +{
> +       struct hns3_hw *hw = &hns->hw;
> +       struct rte_eth_dev *eth_dev;
> +
> +       if (hw->reset.level == HNS3_IMP_RESET ||
> +           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);
> +       if (hw->adapter_state == HNS3_NIC_STARTED) {
> +               /*
> +                * This API parent function already hold the hns3_hw.lock, the
> +                * hns3_service_handler may report lse, in bonding application
> +                * it will call driver's ops which may acquire the hns3_hw.lock
> +                * again, thus lead to deadlock.
> +                * We defer calls hns3_service_handler to avoid the deadlock.
> +                */
> +               rte_eal_alarm_set(HNS3_SERVICE_QUICK_INTERVAL,
> +                                 hns3_service_handler, eth_dev);
> +
> +               /* Enable interrupt of all rx queues before enabling queues */
> +               hns3_dev_all_rx_queue_intr_enable(hw, true);
> +               /*
> +                * Enable state of each rxq and txq will be recovered after
> +                * reset, so we need to restore them before enable all tqps;
> +                */
> +               hns3_restore_tqp_enable_state(hw);
> +               /*
> +                * When finished the initialization, enable queues to receive
> +                * and transmit packets.
> +                */
> +               hns3_enable_all_queues(hw, true);
> +       }
> +
> +       return 0;
> +}
> +
> +static int
> +hns3_restore_conf(struct hns3_adapter *hns)
> +{
> +       struct hns3_hw *hw = &hns->hw;
> +       int ret;
> +
> +       ret = hns3_configure_all_mac_addr(hns, false);
> +       if (ret)
> +               return ret;
> +
> +       ret = hns3_configure_all_mc_mac_addr(hns, false);
> +       if (ret)
> +               goto err_mc_mac;
> +
> +       ret = hns3_dev_promisc_restore(hns);
> +       if (ret)
> +               goto err_promisc;
> +
> +       ret = hns3_restore_vlan_table(hns);
> +       if (ret)
> +               goto err_promisc;
> +
> +       ret = hns3_restore_vlan_conf(hns);
> +       if (ret)
> +               goto err_promisc;
> +
> +       ret = hns3_restore_all_fdir_filter(hns);
> +       if (ret)
> +               goto err_promisc;
> +
> +       ret = hns3_restore_ptp(hns);
> +       if (ret)
> +               goto err_promisc;
> +
> +       ret = hns3_restore_rx_interrupt(hw);
> +       if (ret)
> +               goto err_promisc;
> +
> +       ret = hns3_restore_gro_conf(hw);
> +       if (ret)
> +               goto err_promisc;
> +
> +       ret = hns3_restore_fec(hw);
> +       if (ret)
> +               goto err_promisc;
> +
> +       if (hns->hw.adapter_state == HNS3_NIC_STARTED) {
> +               ret = hns3_do_start(hns, false);
> +               if (ret)
> +                       goto err_promisc;
> +               hns3_info(hw, "hns3 dev restart successful!");
> +       } else if (hw->adapter_state == HNS3_NIC_STOPPING)
> +               hw->adapter_state = HNS3_NIC_CONFIGURED;
> +       return 0;
> +
> +err_promisc:
> +       hns3_configure_all_mc_mac_addr(hns, true);
> +err_mc_mac:
> +       hns3_configure_all_mac_addr(hns, true);
> +       return ret;
> +}
> +
> +static void
> +hns3_reset_service(void *param)
> +{
> +       struct hns3_adapter *hns = (struct hns3_adapter *)param;
> +       struct hns3_hw *hw = &hns->hw;
> +       enum hns3_reset_level reset_level;
> +       struct timeval tv_delta;
> +       struct timeval tv_start;
> +       struct timeval tv;
> +       uint64_t msec;
> +       int ret;
> +
> +       /*
> +        * The interrupt is not triggered within the delay time.
> +        * The interrupt may have been lost. It is necessary to handle
> +        * the interrupt to recover from the error.
> +        */
> +       if (__atomic_load_n(&hw->reset.schedule, __ATOMIC_RELAXED) ==
> +                           SCHEDULE_DEFERRED) {
> +               __atomic_store_n(&hw->reset.schedule, SCHEDULE_REQUESTED,
> +                                 __ATOMIC_RELAXED);
> +               hns3_err(hw, "Handling interrupts in delayed tasks");
> +               hns3_interrupt_handler(&rte_eth_devices[hw->data->port_id]);
> +               reset_level = hns3_get_reset_level(hns, &hw->reset.pending);
> +               if (reset_level == HNS3_NONE_RESET) {
> +                       hns3_err(hw, "No reset level is set, try IMP reset");
> +                       hns3_atomic_set_bit(HNS3_IMP_RESET, &hw->reset.pending);
> +               }
> +       }
> +       __atomic_store_n(&hw->reset.schedule, SCHEDULE_NONE, __ATOMIC_RELAXED);
> +
> +       /*
> +        * Check if there is any ongoing reset in the hardware. This status can
> +        * be checked from reset_pending. If there is then, we need to wait for
> +        * hardware to complete reset.
> +        *    a. If we are able to figure out in reasonable time that hardware
> +        *       has fully resetted then, we can proceed with driver, client
> +        *       reset.
> +        *    b. else, we can come back later to check this status so re-sched
> +        *       now.
> +        */
> +       reset_level = hns3_get_reset_level(hns, &hw->reset.pending);
> +       if (reset_level != HNS3_NONE_RESET) {
> +               hns3_clock_gettime(&tv_start);
> +               ret = hns3_reset_process(hns, reset_level);
> +               hns3_clock_gettime(&tv);
> +               timersub(&tv, &tv_start, &tv_delta);
> +               msec = hns3_clock_calctime_ms(&tv_delta);
> +               if (msec > HNS3_RESET_PROCESS_MS)
> +                       hns3_err(hw, "%d handle long time delta %" PRIu64
> +                                    " ms time=%ld.%.6ld",
> +                                hw->reset.level, msec,
> +                                tv.tv_sec, tv.tv_usec);
> +               if (ret == -EAGAIN)
> +                       return;
> +       }
> +
> +       /* Check if we got any *new* reset requests to be honored */
> +       reset_level = hns3_get_reset_level(hns, &hw->reset.request);
> +       if (reset_level != HNS3_NONE_RESET)
> +               hns3_msix_process(hns, reset_level);
> +}
> +
> +static unsigned int
> +hns3_get_speed_capa_num(uint16_t device_id)
> +{
> +       unsigned int num;
> +
> +       switch (device_id) {
> +       case HNS3_DEV_ID_25GE:
> +       case HNS3_DEV_ID_25GE_RDMA:
> +               num = 2;
> +               break;
> +       case HNS3_DEV_ID_100G_RDMA_MACSEC:
> +       case HNS3_DEV_ID_200G_RDMA:
> +               num = 1;
> +               break;
> +       default:
> +               num = 0;
> +               break;
> +       }
> +
> +       return num;
> +}
> +
> +static int
> +hns3_get_speed_fec_capa(struct rte_eth_fec_capa *speed_fec_capa,
> +                       uint16_t device_id)
> +{
> +       switch (device_id) {
> +       case HNS3_DEV_ID_25GE:
> +       /* fallthrough */
> +       case HNS3_DEV_ID_25GE_RDMA:
> +               speed_fec_capa[0].speed = speed_fec_capa_tbl[1].speed;
> +               speed_fec_capa[0].capa = speed_fec_capa_tbl[1].capa;
> +
> +               /* In HNS3 device, the 25G NIC is compatible with 10G rate */
> +               speed_fec_capa[1].speed = speed_fec_capa_tbl[0].speed;
> +               speed_fec_capa[1].capa = speed_fec_capa_tbl[0].capa;
> +               break;
> +       case HNS3_DEV_ID_100G_RDMA_MACSEC:
> +               speed_fec_capa[0].speed = speed_fec_capa_tbl[4].speed;
> +               speed_fec_capa[0].capa = speed_fec_capa_tbl[4].capa;
> +               break;
> +       case HNS3_DEV_ID_200G_RDMA:
> +               speed_fec_capa[0].speed = speed_fec_capa_tbl[5].speed;
> +               speed_fec_capa[0].capa = speed_fec_capa_tbl[5].capa;
> +               break;
> +       default:
> +               return -ENOTSUP;
> +       }
> +
> +       return 0;
> +}
> +
> +static int
> +hns3_fec_get_capability(struct rte_eth_dev *dev,
> +                       struct rte_eth_fec_capa *speed_fec_capa,
> +                       unsigned int num)
> +{
> +       struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> +       struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
> +       uint16_t device_id = pci_dev->id.device_id;
> +       unsigned int capa_num;
> +       int ret;
> +
> +       capa_num = hns3_get_speed_capa_num(device_id);
> +       if (capa_num == 0) {
> +               hns3_err(hw, "device(0x%x) is not supported by hns3 PMD",
> +                        device_id);
> +               return -ENOTSUP;
> +       }
> +
> +       if (speed_fec_capa == NULL || num < capa_num)
> +               return capa_num;
> +
> +       ret = hns3_get_speed_fec_capa(speed_fec_capa, device_id);
> +       if (ret)
> +               return -ENOTSUP;
> +
> +       return capa_num;
> +}
> +
> +static int
> +get_current_fec_auto_state(struct hns3_hw *hw, uint8_t *state)
> +{
> +       struct hns3_config_fec_cmd *req;
> +       struct hns3_cmd_desc desc;
> +       int ret;
> +
> +       /*
> +        * CMD(HNS3_OPC_CONFIG_FEC_MODE) read is not supported
> +        * in device of link speed
> +        * below 10 Gbps.
> +        */
> +       if (hw->mac.link_speed < ETH_SPEED_NUM_10G) {
> +               *state = 0;
> +               return 0;
> +       }
> +
> +       hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_CONFIG_FEC_MODE, true);
> +       req = (struct hns3_config_fec_cmd *)desc.data;
> +       ret = hns3_cmd_send(hw, &desc, 1);
> +       if (ret) {
> +               hns3_err(hw, "get current fec auto state failed, ret = %d",
> +                        ret);
> +               return ret;
> +       }
> +
> +       *state = req->fec_mode & (1U << HNS3_MAC_CFG_FEC_AUTO_EN_B);
> +       return 0;
> +}
> +
> +static int
> +hns3_fec_get_internal(struct hns3_hw *hw, uint32_t *fec_capa)
> +{
> +       struct hns3_sfp_info_cmd *resp;
> +       uint32_t tmp_fec_capa;
> +       uint8_t auto_state;
> +       struct hns3_cmd_desc desc;
> +       int ret;
> +
> +       /*
> +        * If link is down and AUTO is enabled, AUTO is returned, otherwise,
> +        * configured FEC mode is returned.
> +        * If link is up, current FEC mode is returned.
> +        */
> +       if (hw->mac.link_status == ETH_LINK_DOWN) {
> +               ret = get_current_fec_auto_state(hw, &auto_state);
> +               if (ret)
> +                       return ret;
> +
> +               if (auto_state == 0x1) {
> +                       *fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(AUTO);
> +                       return 0;
> +               }
> +       }
> +
> +       hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_GET_SFP_INFO, true);
> +       resp = (struct hns3_sfp_info_cmd *)desc.data;
> +       resp->query_type = HNS3_ACTIVE_QUERY;
> +
> +       ret = hns3_cmd_send(hw, &desc, 1);
> +       if (ret == -EOPNOTSUPP) {
> +               hns3_err(hw, "IMP do not support get FEC, ret = %d", ret);
> +               return ret;
> +       } else if (ret) {
> +               hns3_err(hw, "get FEC failed, ret = %d", ret);
> +               return ret;
> +       }
> +
> +       /*
> +        * FEC mode order defined in hns3 hardware is inconsistend with
> +        * that defined in the ethdev library. So the sequence needs
> +        * to be converted.
> +        */
> +       switch (resp->active_fec) {
> +       case HNS3_HW_FEC_MODE_NOFEC:
> +               tmp_fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(NOFEC);
> +               break;
> +       case HNS3_HW_FEC_MODE_BASER:
> +               tmp_fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(BASER);
> +               break;
> +       case HNS3_HW_FEC_MODE_RS:
> +               tmp_fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(RS);
> +               break;
> +       default:
> +               tmp_fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(NOFEC);
> +               break;
> +       }
> +
> +       *fec_capa = tmp_fec_capa;
> +       return 0;
> +}
> +
> +static int
> +hns3_fec_get(struct rte_eth_dev *dev, uint32_t *fec_capa)
> +{
> +       struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> +
> +       return hns3_fec_get_internal(hw, fec_capa);
> +}
> +
> +static int
> +hns3_set_fec_hw(struct hns3_hw *hw, uint32_t mode)
> +{
> +       struct hns3_config_fec_cmd *req;
> +       struct hns3_cmd_desc desc;
> +       int ret;
> +
> +       hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_CONFIG_FEC_MODE, false);
> +
> +       req = (struct hns3_config_fec_cmd *)desc.data;
> +       switch (mode) {
> +       case RTE_ETH_FEC_MODE_CAPA_MASK(NOFEC):
> +               hns3_set_field(req->fec_mode, HNS3_MAC_CFG_FEC_MODE_M,
> +                               HNS3_MAC_CFG_FEC_MODE_S, HNS3_MAC_FEC_OFF);
> +               break;
> +       case RTE_ETH_FEC_MODE_CAPA_MASK(BASER):
> +               hns3_set_field(req->fec_mode, HNS3_MAC_CFG_FEC_MODE_M,
> +                               HNS3_MAC_CFG_FEC_MODE_S, HNS3_MAC_FEC_BASER);
> +               break;
> +       case RTE_ETH_FEC_MODE_CAPA_MASK(RS):
> +               hns3_set_field(req->fec_mode, HNS3_MAC_CFG_FEC_MODE_M,
> +                               HNS3_MAC_CFG_FEC_MODE_S, HNS3_MAC_FEC_RS);
> +               break;
> +       case RTE_ETH_FEC_MODE_CAPA_MASK(AUTO):
> +               hns3_set_bit(req->fec_mode, HNS3_MAC_CFG_FEC_AUTO_EN_B, 1);
> +               break;
> +       default:
> +               return 0;
> +       }
> +       ret = hns3_cmd_send(hw, &desc, 1);
> +       if (ret)
> +               hns3_err(hw, "set fec mode failed, ret = %d", ret);
> +
> +       return ret;
> +}
> +
> +static uint32_t
> +get_current_speed_fec_cap(struct hns3_hw *hw, struct rte_eth_fec_capa *fec_capa)
> +{
> +       struct hns3_mac *mac = &hw->mac;
> +       uint32_t cur_capa;
> +
> +       switch (mac->link_speed) {
> +       case ETH_SPEED_NUM_10G:
> +               cur_capa = fec_capa[1].capa;
> +               break;
> +       case ETH_SPEED_NUM_25G:
> +       case ETH_SPEED_NUM_100G:
> +       case ETH_SPEED_NUM_200G:
> +               cur_capa = fec_capa[0].capa;
> +               break;
> +       default:
> +               cur_capa = 0;
> +               break;
> +       }
> +
> +       return cur_capa;
> +}
> +
> +static bool
> +is_fec_mode_one_bit_set(uint32_t mode)
> +{
> +       int cnt = 0;
> +       uint8_t i;
> +
> +       for (i = 0; i < sizeof(mode); i++)
> +               if (mode >> i & 0x1)
> +                       cnt++;
> +
> +       return cnt == 1 ? true : false;
> +}
> +
> +static int
> +hns3_fec_set(struct rte_eth_dev *dev, uint32_t mode)
> +{
> +#define FEC_CAPA_NUM 2
> +       struct hns3_adapter *hns = dev->data->dev_private;
> +       struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(hns);
> +       struct hns3_pf *pf = &hns->pf;
> +
> +       struct rte_eth_fec_capa fec_capa[FEC_CAPA_NUM];
> +       uint32_t cur_capa;
> +       uint32_t num = FEC_CAPA_NUM;
> +       int ret;
> +
> +       ret = hns3_fec_get_capability(dev, fec_capa, num);
> +       if (ret < 0)
> +               return ret;
> +
> +       /* HNS3 PMD driver only support one bit set mode, e.g. 0x1, 0x4 */
> +       if (!is_fec_mode_one_bit_set(mode)) {
> +               hns3_err(hw, "FEC mode(0x%x) not supported in HNS3 PMD, "
> +                            "FEC mode should be only one bit set", mode);
> +               return -EINVAL;
> +       }
> +
> +       /*
> +        * Check whether the configured mode is within the FEC capability.
> +        * If not, the configured mode will not be supported.
> +        */
> +       cur_capa = get_current_speed_fec_cap(hw, fec_capa);
> +       if (!(cur_capa & mode)) {
> +               hns3_err(hw, "unsupported FEC mode = 0x%x", mode);
> +               return -EINVAL;
> +       }
> +
> +       rte_spinlock_lock(&hw->lock);
> +       ret = hns3_set_fec_hw(hw, mode);
> +       if (ret) {
> +               rte_spinlock_unlock(&hw->lock);
> +               return ret;
> +       }
> +
> +       pf->fec_mode = mode;
> +       rte_spinlock_unlock(&hw->lock);
> +
> +       return 0;
> +}
> +
> +static int
> +hns3_restore_fec(struct hns3_hw *hw)
> +{
> +       struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
> +       struct hns3_pf *pf = &hns->pf;
> +       uint32_t mode = pf->fec_mode;
> +       int ret;
> +=======
> +       else if (hns3_atomic_test_bit(HNS3_FUNC_RESET, levels))
> +               reset_level = HNS3_FUNC_RESET;
> +       else if (hns3_atomic_test_bit(HNS3_FLR_RESET, levels))
> +               reset_level = HNS3_FLR_RESET;
> +
> +       if (hw->reset.level != HNS3_NONE_RESET && reset_level < hw->reset.level)
> +               return HNS3_NONE_RESET;
> +
> +       return reset_level;
> +}
> +
> +static void
> +hns3_record_imp_error(struct hns3_adapter *hns)
> +{
> +       struct hns3_hw *hw = &hns->hw;
> +       uint32_t reg_val;
> +
> +       reg_val = hns3_read_dev(hw, HNS3_VECTOR0_OTER_EN_REG);
> +       if (hns3_get_bit(reg_val, HNS3_VECTOR0_IMP_RD_POISON_B)) {
> +               hns3_warn(hw, "Detected IMP RD poison!");
> +               hns3_set_bit(reg_val, HNS3_VECTOR0_IMP_RD_POISON_B, 0);
> +               hns3_write_dev(hw, HNS3_VECTOR0_OTER_EN_REG, reg_val);
> +       }
> +
> +       if (hns3_get_bit(reg_val, HNS3_VECTOR0_IMP_CMDQ_ERR_B)) {
> +               hns3_warn(hw, "Detected IMP CMDQ error!");
> +               hns3_set_bit(reg_val, HNS3_VECTOR0_IMP_CMDQ_ERR_B, 0);
> +               hns3_write_dev(hw, HNS3_VECTOR0_OTER_EN_REG, reg_val);
> +       }
> +}
> +
> +static int
> +hns3_prepare_reset(struct hns3_adapter *hns)
> +{
> +       struct hns3_hw *hw = &hns->hw;
> +       uint32_t reg_val;
> +       int ret;
> +
> +       switch (hw->reset.level) {
> +       case HNS3_FUNC_RESET:
> +               ret = hns3_func_reset_cmd(hw, HNS3_PF_FUNC_ID);
> +               if (ret)
> +                       return ret;
> +
> +               /*
> +                * After performaning pf reset, it is not necessary to do the
> +                * mailbox handling or send any command to firmware, because
> +                * any mailbox handling or command to firmware is only valid
> +                * after hns3_cmd_init is called.
> +                */
> +               __atomic_store_n(&hw->reset.disable_cmd, 1, __ATOMIC_RELAXED);
> +               hw->reset.stats.request_cnt++;
> +               break;
> +       case HNS3_IMP_RESET:
> +               hns3_record_imp_error(hns);
> +               reg_val = hns3_read_dev(hw, HNS3_VECTOR0_OTER_EN_REG);
> +               hns3_write_dev(hw, HNS3_VECTOR0_OTER_EN_REG, reg_val |
> +                              BIT(HNS3_VECTOR0_IMP_RESET_INT_B));
> +               break;
> +       default:
> +               break;
> +       }
> +       return 0;
> +}
> +
> +static int
> +hns3_set_rst_done(struct hns3_hw *hw)
> +{
> +       struct hns3_pf_rst_done_cmd *req;
> +       struct hns3_cmd_desc desc;
> +
> +       req = (struct hns3_pf_rst_done_cmd *)desc.data;
> +       hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_PF_RST_DONE, false);
> +       req->pf_rst_done |= HNS3_PF_RESET_DONE_BIT;
> +       return hns3_cmd_send(hw, &desc, 1);
> +}
> +
> +static int
> +hns3_stop_service(struct hns3_adapter *hns)
> +{
> +       struct hns3_hw *hw = &hns->hw;
> +       struct rte_eth_dev *eth_dev;
> +
> +       eth_dev = &rte_eth_devices[hw->data->port_id];
> +       hw->mac.link_status = ETH_LINK_DOWN;
> +       if (hw->adapter_state == HNS3_NIC_STARTED) {
> +               rte_eal_alarm_cancel(hns3_service_handler, eth_dev);
> +               hns3_update_linkstatus_and_event(hw, false);
> +       }
> +
> +       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);
> +
> +       rte_spinlock_lock(&hw->lock);
> +       if (hns->hw.adapter_state == HNS3_NIC_STARTED ||
> +           hw->adapter_state == HNS3_NIC_STOPPING) {
> +               hns3_enable_all_queues(hw, false);
> +               hns3_do_stop(hns);
> +               hw->reset.mbuf_deferred_free = true;
> +       } else
> +               hw->reset.mbuf_deferred_free = false;
> +
> +       /*
> +        * It is cumbersome for hardware to pick-and-choose entries for deletion
> +        * from table space. Hence, for function reset software intervention is
> +        * required to delete the entries
> +        */
> +       if (__atomic_load_n(&hw->reset.disable_cmd, __ATOMIC_RELAXED) == 0)
> +               hns3_configure_all_mc_mac_addr(hns, true);
> +       rte_spinlock_unlock(&hw->lock);
> +
> +       return 0;
> +}
> +
> +static int
> +hns3_start_service(struct hns3_adapter *hns)
> +{
> +       struct hns3_hw *hw = &hns->hw;
> +       struct rte_eth_dev *eth_dev;
> +
> +       if (hw->reset.level == HNS3_IMP_RESET ||
> +           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);
> +       if (hw->adapter_state == HNS3_NIC_STARTED) {
> +               /*
> +                * This API parent function already hold the hns3_hw.lock, the
> +                * hns3_service_handler may report lse, in bonding application
> +                * it will call driver's ops which may acquire the hns3_hw.lock
> +                * again, thus lead to deadlock.
> +                * We defer calls hns3_service_handler to avoid the deadlock.
> +                */
> +               rte_eal_alarm_set(HNS3_SERVICE_QUICK_INTERVAL,
> +                                 hns3_service_handler, eth_dev);
> +
> +               /* Enable interrupt of all rx queues before enabling queues */
> +               hns3_dev_all_rx_queue_intr_enable(hw, true);
> +               /*
> +                * Enable state of each rxq and txq will be recovered after
> +                * reset, so we need to restore them before enable all tqps;
> +                */
> +               hns3_restore_tqp_enable_state(hw);
> +               /*
> +                * When finished the initialization, enable queues to receive
> +                * and transmit packets.
> +                */
> +               hns3_enable_all_queues(hw, true);
> +       }
> +
> +       return 0;
> +}
> +
> +static int
> +hns3_restore_conf(struct hns3_adapter *hns)
> +{
> +       struct hns3_hw *hw = &hns->hw;
> +       int ret;
> +
> +       ret = hns3_configure_all_mac_addr(hns, false);
> +       if (ret)
> +               return ret;
> +
> +       ret = hns3_configure_all_mc_mac_addr(hns, false);
> +       if (ret)
> +               goto err_mc_mac;
> +
> +       ret = hns3_dev_promisc_restore(hns);
> +       if (ret)
> +               goto err_promisc;
> +
> +       ret = hns3_restore_vlan_table(hns);
> +       if (ret)
> +               goto err_promisc;
> +
> +       ret = hns3_restore_vlan_conf(hns);
> +       if (ret)
> +               goto err_promisc;
> +
> +       ret = hns3_restore_all_fdir_filter(hns);
> +       if (ret)
> +               goto err_promisc;
> +
> +       ret = hns3_restore_ptp(hns);
> +       if (ret)
> +               goto err_promisc;
> +
> +       ret = hns3_restore_rx_interrupt(hw);
> +       if (ret)
> +               goto err_promisc;
> +
> +       ret = hns3_restore_gro_conf(hw);
> +       if (ret)
> +               goto err_promisc;
> +
> +       ret = hns3_restore_fec(hw);
> +       if (ret)
> +               goto err_promisc;
> +
> +       if (hns->hw.adapter_state == HNS3_NIC_STARTED) {
> +               ret = hns3_do_start(hns, false);
> +               if (ret)
> +                       goto err_promisc;
> +               hns3_info(hw, "hns3 dev restart successful!");
> +       } else if (hw->adapter_state == HNS3_NIC_STOPPING)
> +               hw->adapter_state = HNS3_NIC_CONFIGURED;
> +       return 0;
> +
> +err_promisc:
> +       hns3_configure_all_mc_mac_addr(hns, true);
> +err_mc_mac:
> +       hns3_configure_all_mac_addr(hns, true);
> +       return ret;
> +}
> +
> +static void
> +hns3_reset_service(void *param)
> +{
> +       struct hns3_adapter *hns = (struct hns3_adapter *)param;
> +       struct hns3_hw *hw = &hns->hw;
> +       enum hns3_reset_level reset_level;
> +       struct timeval tv_delta;
> +       struct timeval tv_start;
> +       struct timeval tv;
> +       uint64_t msec;
> +       int ret;
> +
> +       /*
> +        * The interrupt is not triggered within the delay time.
> +        * The interrupt may have been lost. It is necessary to handle
> +        * the interrupt to recover from the error.
> +        */
> +       if (__atomic_load_n(&hw->reset.schedule, __ATOMIC_RELAXED) ==
> +                           SCHEDULE_DEFERRED) {
> +               __atomic_store_n(&hw->reset.schedule, SCHEDULE_REQUESTED,
> +                                 __ATOMIC_RELAXED);
> +               hns3_err(hw, "Handling interrupts in delayed tasks");
> +               hns3_interrupt_handler(&rte_eth_devices[hw->data->port_id]);
> +               reset_level = hns3_get_reset_level(hns, &hw->reset.pending);
> +               if (reset_level == HNS3_NONE_RESET) {
> +                       hns3_err(hw, "No reset level is set, try IMP reset");
> +                       hns3_atomic_set_bit(HNS3_IMP_RESET, &hw->reset.pending);
> +               }
> +       }
> +       __atomic_store_n(&hw->reset.schedule, SCHEDULE_NONE, __ATOMIC_RELAXED);
> +
> +       /*
> +        * Check if there is any ongoing reset in the hardware. This status can
> +        * be checked from reset_pending. If there is then, we need to wait for
> +        * hardware to complete reset.
> +        *    a. If we are able to figure out in reasonable time that hardware
> +        *       has fully resetted then, we can proceed with driver, client
> +        *       reset.
> +        *    b. else, we can come back later to check this status so re-sched
> +        *       now.
> +        */
> +       reset_level = hns3_get_reset_level(hns, &hw->reset.pending);
> +       if (reset_level != HNS3_NONE_RESET) {
> +               hns3_clock_gettime(&tv_start);
> +               ret = hns3_reset_process(hns, reset_level);
> +               hns3_clock_gettime(&tv);
> +               timersub(&tv, &tv_start, &tv_delta);
> +               msec = hns3_clock_calctime_ms(&tv_delta);
> +               if (msec > HNS3_RESET_PROCESS_MS)
> +                       hns3_err(hw, "%d handle long time delta %" PRIu64
> +                                    " ms time=%ld.%.6ld",
> +                                hw->reset.level, msec,
> +                                tv.tv_sec, tv.tv_usec);
> +               if (ret == -EAGAIN)
> +                       return;
> +       }
> +
> +       /* Check if we got any *new* reset requests to be honored */
> +       reset_level = hns3_get_reset_level(hns, &hw->reset.request);
> +       if (reset_level != HNS3_NONE_RESET)
> +               hns3_msix_process(hns, reset_level);
> +}
> +
> +static unsigned int
> +hns3_get_speed_capa_num(uint16_t device_id)
> +{
> +       unsigned int num;
> +
> +       switch (device_id) {
> +       case HNS3_DEV_ID_25GE:
> +       case HNS3_DEV_ID_25GE_RDMA:
> +               num = 2;
> +               break;
> +       case HNS3_DEV_ID_100G_RDMA_MACSEC:
> +       case HNS3_DEV_ID_200G_RDMA:
> +               num = 1;
> +               break;
> +       default:
> +               num = 0;
> +               break;
> +       }
> +
> +       return num;
> +}
> +
> +static int
> +hns3_get_speed_fec_capa(struct rte_eth_fec_capa *speed_fec_capa,
> +                       uint16_t device_id)
> +{
> +       switch (device_id) {
> +       case HNS3_DEV_ID_25GE:
> +       /* fallthrough */
> +       case HNS3_DEV_ID_25GE_RDMA:
> +               speed_fec_capa[0].speed = speed_fec_capa_tbl[1].speed;
> +               speed_fec_capa[0].capa = speed_fec_capa_tbl[1].capa;
> +
> +               /* In HNS3 device, the 25G NIC is compatible with 10G rate */
> +               speed_fec_capa[1].speed = speed_fec_capa_tbl[0].speed;
> +               speed_fec_capa[1].capa = speed_fec_capa_tbl[0].capa;
> +               break;
> +       case HNS3_DEV_ID_100G_RDMA_MACSEC:
> +               speed_fec_capa[0].speed = speed_fec_capa_tbl[4].speed;
> +               speed_fec_capa[0].capa = speed_fec_capa_tbl[4].capa;
> +               break;
> +       case HNS3_DEV_ID_200G_RDMA:
> +               speed_fec_capa[0].speed = speed_fec_capa_tbl[5].speed;
> +               speed_fec_capa[0].capa = speed_fec_capa_tbl[5].capa;
> +               break;
> +       default:
> +               return -ENOTSUP;
> +       }
> +
> +       return 0;
> +}
> +
> +static int
> +hns3_fec_get_capability(struct rte_eth_dev *dev,
> +                       struct rte_eth_fec_capa *speed_fec_capa,
> +                       unsigned int num)
> +{
> +       struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> +       struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
> +       uint16_t device_id = pci_dev->id.device_id;
> +       unsigned int capa_num;
> +       int ret;
> +
> +       capa_num = hns3_get_speed_capa_num(device_id);
> +       if (capa_num == 0) {
> +               hns3_err(hw, "device(0x%x) is not supported by hns3 PMD",
> +                        device_id);
> +               return -ENOTSUP;
> +       }
> +
> +       if (speed_fec_capa == NULL || num < capa_num)
> +               return capa_num;
> +
> +       ret = hns3_get_speed_fec_capa(speed_fec_capa, device_id);
> +       if (ret)
> +               return -ENOTSUP;
> +
> +       return capa_num;
> +}
> +
> +static int
> +get_current_fec_auto_state(struct hns3_hw *hw, uint8_t *state)
> +{
> +       struct hns3_config_fec_cmd *req;
> +       struct hns3_cmd_desc desc;
> +       int ret;
> +
> +       /*
> +        * CMD(HNS3_OPC_CONFIG_FEC_MODE) read is not supported
> +        * in device of link speed
> +        * below 10 Gbps.
> +        */
> +       if (hw->mac.link_speed < ETH_SPEED_NUM_10G) {
> +               *state = 0;
> +               return 0;
> +       }
> +
> +       hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_CONFIG_FEC_MODE, true);
> +       req = (struct hns3_config_fec_cmd *)desc.data;
> +       ret = hns3_cmd_send(hw, &desc, 1);
> +       if (ret) {
> +               hns3_err(hw, "get current fec auto state failed, ret = %d",
> +                        ret);
> +               return ret;
> +       }
> +
> +       *state = req->fec_mode & (1U << HNS3_MAC_CFG_FEC_AUTO_EN_B);
> +       return 0;
> +}
> +
> +static int
> +hns3_fec_get_internal(struct hns3_hw *hw, uint32_t *fec_capa)
> +{
> +       struct hns3_sfp_info_cmd *resp;
> +       uint32_t tmp_fec_capa;
> +       uint8_t auto_state;
> +       struct hns3_cmd_desc desc;
> +       int ret;
> +
> +       /*
> +        * If link is down and AUTO is enabled, AUTO is returned, otherwise,
> +        * configured FEC mode is returned.
> +        * If link is up, current FEC mode is returned.
> +        */
> +       if (hw->mac.link_status == ETH_LINK_DOWN) {
> +               ret = get_current_fec_auto_state(hw, &auto_state);
> +               if (ret)
> +                       return ret;
> +
> +               if (auto_state == 0x1) {
> +                       *fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(AUTO);
> +                       return 0;
> +               }
> +       }
> +
> +       hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_GET_SFP_INFO, true);
> +       resp = (struct hns3_sfp_info_cmd *)desc.data;
> +       resp->query_type = HNS3_ACTIVE_QUERY;
> +
> +       ret = hns3_cmd_send(hw, &desc, 1);
> +       if (ret == -EOPNOTSUPP) {
> +               hns3_err(hw, "IMP do not support get FEC, ret = %d", ret);
> +               return ret;
> +       } else if (ret) {
> +               hns3_err(hw, "get FEC failed, ret = %d", ret);
> +               return ret;
> +       }
> +
> +       /*
> +        * FEC mode order defined in hns3 hardware is inconsistend with
> +        * that defined in the ethdev library. So the sequence needs
> +        * to be converted.
> +        */
> +       switch (resp->active_fec) {
> +       case HNS3_HW_FEC_MODE_NOFEC:
> +               tmp_fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(NOFEC);
> +               break;
> +       case HNS3_HW_FEC_MODE_BASER:
> +               tmp_fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(BASER);
> +               break;
> +       case HNS3_HW_FEC_MODE_RS:
> +               tmp_fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(RS);
> +               break;
> +       default:
> +               tmp_fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(NOFEC);
> +               break;
> +       }
> +
> +       *fec_capa = tmp_fec_capa;
> +       return 0;
> +}
> +
> +static int
> +hns3_fec_get(struct rte_eth_dev *dev, uint32_t *fec_capa)
> +{
> +       struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> +
> +       return hns3_fec_get_internal(hw, fec_capa);
> +}
> +
> +static int
> +hns3_set_fec_hw(struct hns3_hw *hw, uint32_t mode)
> +{
> +       struct hns3_config_fec_cmd *req;
> +       struct hns3_cmd_desc desc;
> +       int ret;
> +
> +       hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_CONFIG_FEC_MODE, false);
> +
> +       req = (struct hns3_config_fec_cmd *)desc.data;
> +       switch (mode) {
> +       case RTE_ETH_FEC_MODE_CAPA_MASK(NOFEC):
> +               hns3_set_field(req->fec_mode, HNS3_MAC_CFG_FEC_MODE_M,
> +                               HNS3_MAC_CFG_FEC_MODE_S, HNS3_MAC_FEC_OFF);
> +               break;
> +       case RTE_ETH_FEC_MODE_CAPA_MASK(BASER):
> +               hns3_set_field(req->fec_mode, HNS3_MAC_CFG_FEC_MODE_M,
> +                               HNS3_MAC_CFG_FEC_MODE_S, HNS3_MAC_FEC_BASER);
> +               break;
> +       case RTE_ETH_FEC_MODE_CAPA_MASK(RS):
> +               hns3_set_field(req->fec_mode, HNS3_MAC_CFG_FEC_MODE_M,
> +                               HNS3_MAC_CFG_FEC_MODE_S, HNS3_MAC_FEC_RS);
> +               break;
> +       case RTE_ETH_FEC_MODE_CAPA_MASK(AUTO):
> +               hns3_set_bit(req->fec_mode, HNS3_MAC_CFG_FEC_AUTO_EN_B, 1);
> +               break;
> +       default:
> +               return 0;
> +       }
> +       ret = hns3_cmd_send(hw, &desc, 1);
> +       if (ret)
> +               hns3_err(hw, "set fec mode failed, ret = %d", ret);
> +
> +       return ret;
> +}
> +
> +static uint32_t
> +get_current_speed_fec_cap(struct hns3_hw *hw, struct rte_eth_fec_capa *fec_capa)
> +{
> +       struct hns3_mac *mac = &hw->mac;
> +       uint32_t cur_capa;
> +
> +       switch (mac->link_speed) {
> +       case ETH_SPEED_NUM_10G:
> +               cur_capa = fec_capa[1].capa;
> +               break;
> +       case ETH_SPEED_NUM_25G:
> +       case ETH_SPEED_NUM_100G:
> +       case ETH_SPEED_NUM_200G:
> +               cur_capa = fec_capa[0].capa;
> +               break;
> +       default:
> +               cur_capa = 0;
> +               break;
> +       }
> +
> +       return cur_capa;
> +}
> +
> +static bool
> +is_fec_mode_one_bit_set(uint32_t mode)
> +{
> +       int cnt = 0;
> +       uint8_t i;
> +
> +       for (i = 0; i < sizeof(mode); i++)
> +               if (mode >> i & 0x1)
> +                       cnt++;
> +
> +       return cnt == 1 ? true : false;
> +}
> +
> +static int
> +hns3_fec_set(struct rte_eth_dev *dev, uint32_t mode)
> +{
> +#define FEC_CAPA_NUM 2
> +       struct hns3_adapter *hns = dev->data->dev_private;
> +       struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(hns);
> +       struct hns3_pf *pf = &hns->pf;
> +
> +       struct rte_eth_fec_capa fec_capa[FEC_CAPA_NUM];
> +       uint32_t cur_capa;
> +       uint32_t num = FEC_CAPA_NUM;
> +       int ret;
> +
> +       ret = hns3_fec_get_capability(dev, fec_capa, num);
> +       if (ret < 0)
> +               return ret;
> +
> +       /* HNS3 PMD driver only support one bit set mode, e.g. 0x1, 0x4 */
> +       if (!is_fec_mode_one_bit_set(mode)) {
> +               hns3_err(hw, "FEC mode(0x%x) not supported in HNS3 PMD, "
> +                            "FEC mode should be only one bit set", mode);
> +               return -EINVAL;
> +       }
> +
> +       /*
> +        * Check whether the configured mode is within the FEC capability.
> +        * If not, the configured mode will not be supported.
> +        */
> +       cur_capa = get_current_speed_fec_cap(hw, fec_capa);
> +       if (!(cur_capa & mode)) {
> +               hns3_err(hw, "unsupported FEC mode = 0x%x", mode);
> +               return -EINVAL;
> +       }
> +
> +       rte_spinlock_lock(&hw->lock);
> +       ret = hns3_set_fec_hw(hw, mode);
> +       if (ret) {
> +               rte_spinlock_unlock(&hw->lock);
> +               return ret;
> +       }
> +
> +       pf->fec_mode = mode;
> +       rte_spinlock_unlock(&hw->lock);
> +
> +       return 0;
> +}
> +
> +static int
> +hns3_restore_fec(struct hns3_hw *hw)
> +{
> +       struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
> +       struct hns3_pf *pf = &hns->pf;
> +       uint32_t mode = pf->fec_mode;
> +       int ret;
> +>>>>>>> net/hns3: fix delay for waiting to stop Rx/Tx
>
>         if (hw->reset.level != HNS3_NONE_RESET && reset_level < hw->reset.level)
>                 return HNS3_NONE_RESET;
> @@ -5201,7 +6381,7 @@ hns3_stop_service(struct hns3_adapter *hns)
>         rte_wmb();
>         /* Disable datapath on secondary process. */
>         hns3_mp_req_stop_rxtx(eth_dev);
> -       rte_delay_ms(hw->tqps_num);
> +       rte_delay_ms(hw->cfg_max_queues);
>
>         rte_spinlock_lock(&hw->lock);
>         if (hns->hw.adapter_state == HNS3_NIC_STARTED ||
> diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
> index a7b6188eea..eb3edf3464 100644
> --- a/drivers/net/hns3/hns3_ethdev_vf.c
> +++ b/drivers/net/hns3/hns3_ethdev_vf.c
> @@ -1631,7 +1631,7 @@ hns3vf_dev_stop(struct rte_eth_dev *dev)
>         /* Disable datapath on secondary process. */
>         hns3_mp_req_stop_rxtx(dev);
>         /* Prevent crashes when queues are still in use. */
> -       rte_delay_ms(hw->tqps_num);
> +       rte_delay_ms(hw->cfg_max_queues);
>
>         rte_spinlock_lock(&hw->lock);
>         if (rte_atomic16_read(&hw->reset.resetting) == 0) {
> @@ -2005,7 +2005,7 @@ hns3vf_stop_service(struct hns3_adapter *hns)
>         rte_wmb();
>         /* Disable datapath on secondary process. */
>         hns3_mp_req_stop_rxtx(eth_dev);
> -       rte_delay_ms(hw->tqps_num);
> +       rte_delay_ms(hw->cfg_max_queues);
>
>         rte_spinlock_lock(&hw->lock);
>         if (hw->adapter_state == HNS3_NIC_STARTED ||
> --
> 2.32.0
>
> ---
>   Diff of the applied patch vs upstream commit (please double-check if non-empty:
> ---
> --- -   2021-08-10 15:11:14.264171339 +0200
> +++ 0031-net-hns3-fix-delay-for-waiting-to-stop-Rx-Tx.patch     2021-08-10 15:11:12.962637696 +0200
> @@ -1 +1 @@
> -From 4d8cce267840556cec8483c61f8cfbf25873496d Mon Sep 17 00:00:00 2001
> +From 249c35152a9bcd6d4c4b52776602750552dcf294 Mon Sep 17 00:00:00 2001
> @@ -5,0 +6,2 @@
> +[ upstream commit 4d8cce267840556cec8483c61f8cfbf25873496d ]
> +
> @@ -14 +15,0 @@
> -Cc: stable@dpdk.org
> @@ -19,3 +20,3 @@
> - drivers/net/hns3/hns3_ethdev.c    | 4 ++--
> - drivers/net/hns3/hns3_ethdev_vf.c | 4 ++--
> - 2 files changed, 4 insertions(+), 4 deletions(-)
> + drivers/net/hns3/hns3_ethdev.c    | 1184 ++++++++++++++++++++++++++++-
> + drivers/net/hns3/hns3_ethdev_vf.c |    4 +-
> + 2 files changed, 1184 insertions(+), 4 deletions(-)
> @@ -24 +25 @@
> -index 20491305e7..dff265828e 100644
> +index ac82e0b5ef..e1bc55682c 100644
> @@ -27 +28 @@
> -@@ -5895,7 +5895,7 @@ hns3_dev_stop(struct rte_eth_dev *dev)
> +@@ -4742,7 +4742,7 @@ hns3_dev_stop(struct rte_eth_dev *dev)
> @@ -35,2 +36,1193 @@
> -       if (__atomic_load_n(&hw->reset.resetting, __ATOMIC_RELAXED) == 0) {
> -@@ -6511,7 +6511,7 @@ hns3_stop_service(struct hns3_adapter *hns)
> +       if (rte_atomic16_read(&hw->reset.resetting) == 0) {
> +@@ -5130,10 +5130,1190 @@ hns3_get_reset_level(struct hns3_adapter *hns, uint64_t *levels)
> +               reset_level = HNS3_IMP_RESET;
> +       else if (hns3_atomic_test_bit(HNS3_GLOBAL_RESET, levels))
> +               reset_level = HNS3_GLOBAL_RESET;
> ++<<<<<<< HEAD
> +       else if (hns3_atomic_test_bit(HNS3_FUNC_RESET, levels))
> +               reset_level = HNS3_FUNC_RESET;
> +       else if (hns3_atomic_test_bit(HNS3_FLR_RESET, levels))
> +               reset_level = HNS3_FLR_RESET;
> ++||||||| constructed merge base
> ++      else if (hns3_atomic_test_bit(HNS3_FUNC_RESET, levels))
> ++              reset_level = HNS3_FUNC_RESET;
> ++      else if (hns3_atomic_test_bit(HNS3_FLR_RESET, levels))
> ++              reset_level = HNS3_FLR_RESET;
> ++
> ++      if (hw->reset.level != HNS3_NONE_RESET && reset_level < hw->reset.level)
> ++              return HNS3_NONE_RESET;
> ++
> ++      return reset_level;
> ++}
> ++
> ++static void
> ++hns3_record_imp_error(struct hns3_adapter *hns)
> ++{
> ++      struct hns3_hw *hw = &hns->hw;
> ++      uint32_t reg_val;
> ++
> ++      reg_val = hns3_read_dev(hw, HNS3_VECTOR0_OTER_EN_REG);
> ++      if (hns3_get_bit(reg_val, HNS3_VECTOR0_IMP_RD_POISON_B)) {
> ++              hns3_warn(hw, "Detected IMP RD poison!");
> ++              hns3_set_bit(reg_val, HNS3_VECTOR0_IMP_RD_POISON_B, 0);
> ++              hns3_write_dev(hw, HNS3_VECTOR0_OTER_EN_REG, reg_val);
> ++      }
> ++
> ++      if (hns3_get_bit(reg_val, HNS3_VECTOR0_IMP_CMDQ_ERR_B)) {
> ++              hns3_warn(hw, "Detected IMP CMDQ error!");
> ++              hns3_set_bit(reg_val, HNS3_VECTOR0_IMP_CMDQ_ERR_B, 0);
> ++              hns3_write_dev(hw, HNS3_VECTOR0_OTER_EN_REG, reg_val);
> ++      }
> ++}
> ++
> ++static int
> ++hns3_prepare_reset(struct hns3_adapter *hns)
> ++{
> ++      struct hns3_hw *hw = &hns->hw;
> ++      uint32_t reg_val;
> ++      int ret;
> ++
> ++      switch (hw->reset.level) {
> ++      case HNS3_FUNC_RESET:
> ++              ret = hns3_func_reset_cmd(hw, HNS3_PF_FUNC_ID);
> ++              if (ret)
> ++                      return ret;
> ++
> ++              /*
> ++               * After performaning pf reset, it is not necessary to do the
> ++               * mailbox handling or send any command to firmware, because
> ++               * any mailbox handling or command to firmware is only valid
> ++               * after hns3_cmd_init is called.
> ++               */
> ++              __atomic_store_n(&hw->reset.disable_cmd, 1, __ATOMIC_RELAXED);
> ++              hw->reset.stats.request_cnt++;
> ++              break;
> ++      case HNS3_IMP_RESET:
> ++              hns3_record_imp_error(hns);
> ++              reg_val = hns3_read_dev(hw, HNS3_VECTOR0_OTER_EN_REG);
> ++              hns3_write_dev(hw, HNS3_VECTOR0_OTER_EN_REG, reg_val |
> ++                             BIT(HNS3_VECTOR0_IMP_RESET_INT_B));
> ++              break;
> ++      default:
> ++              break;
> ++      }
> ++      return 0;
> ++}
> ++
> ++static int
> ++hns3_set_rst_done(struct hns3_hw *hw)
> ++{
> ++      struct hns3_pf_rst_done_cmd *req;
> ++      struct hns3_cmd_desc desc;
> ++
> ++      req = (struct hns3_pf_rst_done_cmd *)desc.data;
> ++      hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_PF_RST_DONE, false);
> ++      req->pf_rst_done |= HNS3_PF_RESET_DONE_BIT;
> ++      return hns3_cmd_send(hw, &desc, 1);
> ++}
> ++
> ++static int
> ++hns3_stop_service(struct hns3_adapter *hns)
> ++{
> ++      struct hns3_hw *hw = &hns->hw;
> ++      struct rte_eth_dev *eth_dev;
> ++
> ++      eth_dev = &rte_eth_devices[hw->data->port_id];
> ++      hw->mac.link_status = ETH_LINK_DOWN;
> ++      if (hw->adapter_state == HNS3_NIC_STARTED) {
> ++              rte_eal_alarm_cancel(hns3_service_handler, eth_dev);
> ++              hns3_update_linkstatus_and_event(hw, false);
> ++      }
> ++
> ++      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);
> ++
> ++      rte_spinlock_lock(&hw->lock);
> ++      if (hns->hw.adapter_state == HNS3_NIC_STARTED ||
> ++          hw->adapter_state == HNS3_NIC_STOPPING) {
> ++              hns3_enable_all_queues(hw, false);
> ++              hns3_do_stop(hns);
> ++              hw->reset.mbuf_deferred_free = true;
> ++      } else
> ++              hw->reset.mbuf_deferred_free = false;
> ++
> ++      /*
> ++       * It is cumbersome for hardware to pick-and-choose entries for deletion
> ++       * from table space. Hence, for function reset software intervention is
> ++       * required to delete the entries
> ++       */
> ++      if (__atomic_load_n(&hw->reset.disable_cmd, __ATOMIC_RELAXED) == 0)
> ++              hns3_configure_all_mc_mac_addr(hns, true);
> ++      rte_spinlock_unlock(&hw->lock);
> ++
> ++      return 0;
> ++}
> ++
> ++static int
> ++hns3_start_service(struct hns3_adapter *hns)
> ++{
> ++      struct hns3_hw *hw = &hns->hw;
> ++      struct rte_eth_dev *eth_dev;
> ++
> ++      if (hw->reset.level == HNS3_IMP_RESET ||
> ++          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);
> ++      if (hw->adapter_state == HNS3_NIC_STARTED) {
> ++              /*
> ++               * This API parent function already hold the hns3_hw.lock, the
> ++               * hns3_service_handler may report lse, in bonding application
> ++               * it will call driver's ops which may acquire the hns3_hw.lock
> ++               * again, thus lead to deadlock.
> ++               * We defer calls hns3_service_handler to avoid the deadlock.
> ++               */
> ++              rte_eal_alarm_set(HNS3_SERVICE_QUICK_INTERVAL,
> ++                                hns3_service_handler, eth_dev);
> ++
> ++              /* Enable interrupt of all rx queues before enabling queues */
> ++              hns3_dev_all_rx_queue_intr_enable(hw, true);
> ++              /*
> ++               * Enable state of each rxq and txq will be recovered after
> ++               * reset, so we need to restore them before enable all tqps;
> ++               */
> ++              hns3_restore_tqp_enable_state(hw);
> ++              /*
> ++               * When finished the initialization, enable queues to receive
> ++               * and transmit packets.
> ++               */
> ++              hns3_enable_all_queues(hw, true);
> ++      }
> ++
> ++      return 0;
> ++}
> ++
> ++static int
> ++hns3_restore_conf(struct hns3_adapter *hns)
> ++{
> ++      struct hns3_hw *hw = &hns->hw;
> ++      int ret;
> ++
> ++      ret = hns3_configure_all_mac_addr(hns, false);
> ++      if (ret)
> ++              return ret;
> ++
> ++      ret = hns3_configure_all_mc_mac_addr(hns, false);
> ++      if (ret)
> ++              goto err_mc_mac;
> ++
> ++      ret = hns3_dev_promisc_restore(hns);
> ++      if (ret)
> ++              goto err_promisc;
> ++
> ++      ret = hns3_restore_vlan_table(hns);
> ++      if (ret)
> ++              goto err_promisc;
> ++
> ++      ret = hns3_restore_vlan_conf(hns);
> ++      if (ret)
> ++              goto err_promisc;
> ++
> ++      ret = hns3_restore_all_fdir_filter(hns);
> ++      if (ret)
> ++              goto err_promisc;
> ++
> ++      ret = hns3_restore_ptp(hns);
> ++      if (ret)
> ++              goto err_promisc;
> ++
> ++      ret = hns3_restore_rx_interrupt(hw);
> ++      if (ret)
> ++              goto err_promisc;
> ++
> ++      ret = hns3_restore_gro_conf(hw);
> ++      if (ret)
> ++              goto err_promisc;
> ++
> ++      ret = hns3_restore_fec(hw);
> ++      if (ret)
> ++              goto err_promisc;
> ++
> ++      if (hns->hw.adapter_state == HNS3_NIC_STARTED) {
> ++              ret = hns3_do_start(hns, false);
> ++              if (ret)
> ++                      goto err_promisc;
> ++              hns3_info(hw, "hns3 dev restart successful!");
> ++      } else if (hw->adapter_state == HNS3_NIC_STOPPING)
> ++              hw->adapter_state = HNS3_NIC_CONFIGURED;
> ++      return 0;
> ++
> ++err_promisc:
> ++      hns3_configure_all_mc_mac_addr(hns, true);
> ++err_mc_mac:
> ++      hns3_configure_all_mac_addr(hns, true);
> ++      return ret;
> ++}
> ++
> ++static void
> ++hns3_reset_service(void *param)
> ++{
> ++      struct hns3_adapter *hns = (struct hns3_adapter *)param;
> ++      struct hns3_hw *hw = &hns->hw;
> ++      enum hns3_reset_level reset_level;
> ++      struct timeval tv_delta;
> ++      struct timeval tv_start;
> ++      struct timeval tv;
> ++      uint64_t msec;
> ++      int ret;
> ++
> ++      /*
> ++       * The interrupt is not triggered within the delay time.
> ++       * The interrupt may have been lost. It is necessary to handle
> ++       * the interrupt to recover from the error.
> ++       */
> ++      if (__atomic_load_n(&hw->reset.schedule, __ATOMIC_RELAXED) ==
> ++                          SCHEDULE_DEFERRED) {
> ++              __atomic_store_n(&hw->reset.schedule, SCHEDULE_REQUESTED,
> ++                                __ATOMIC_RELAXED);
> ++              hns3_err(hw, "Handling interrupts in delayed tasks");
> ++              hns3_interrupt_handler(&rte_eth_devices[hw->data->port_id]);
> ++              reset_level = hns3_get_reset_level(hns, &hw->reset.pending);
> ++              if (reset_level == HNS3_NONE_RESET) {
> ++                      hns3_err(hw, "No reset level is set, try IMP reset");
> ++                      hns3_atomic_set_bit(HNS3_IMP_RESET, &hw->reset.pending);
> ++              }
> ++      }
> ++      __atomic_store_n(&hw->reset.schedule, SCHEDULE_NONE, __ATOMIC_RELAXED);
> ++
> ++      /*
> ++       * Check if there is any ongoing reset in the hardware. This status can
> ++       * be checked from reset_pending. If there is then, we need to wait for
> ++       * hardware to complete reset.
> ++       *    a. If we are able to figure out in reasonable time that hardware
> ++       *       has fully resetted then, we can proceed with driver, client
> ++       *       reset.
> ++       *    b. else, we can come back later to check this status so re-sched
> ++       *       now.
> ++       */
> ++      reset_level = hns3_get_reset_level(hns, &hw->reset.pending);
> ++      if (reset_level != HNS3_NONE_RESET) {
> ++              hns3_clock_gettime(&tv_start);
> ++              ret = hns3_reset_process(hns, reset_level);
> ++              hns3_clock_gettime(&tv);
> ++              timersub(&tv, &tv_start, &tv_delta);
> ++              msec = hns3_clock_calctime_ms(&tv_delta);
> ++              if (msec > HNS3_RESET_PROCESS_MS)
> ++                      hns3_err(hw, "%d handle long time delta %" PRIu64
> ++                                   " ms time=%ld.%.6ld",
> ++                               hw->reset.level, msec,
> ++                               tv.tv_sec, tv.tv_usec);
> ++              if (ret == -EAGAIN)
> ++                      return;
> ++      }
> ++
> ++      /* Check if we got any *new* reset requests to be honored */
> ++      reset_level = hns3_get_reset_level(hns, &hw->reset.request);
> ++      if (reset_level != HNS3_NONE_RESET)
> ++              hns3_msix_process(hns, reset_level);
> ++}
> ++
> ++static unsigned int
> ++hns3_get_speed_capa_num(uint16_t device_id)
> ++{
> ++      unsigned int num;
> ++
> ++      switch (device_id) {
> ++      case HNS3_DEV_ID_25GE:
> ++      case HNS3_DEV_ID_25GE_RDMA:
> ++              num = 2;
> ++              break;
> ++      case HNS3_DEV_ID_100G_RDMA_MACSEC:
> ++      case HNS3_DEV_ID_200G_RDMA:
> ++              num = 1;
> ++              break;
> ++      default:
> ++              num = 0;
> ++              break;
> ++      }
> ++
> ++      return num;
> ++}
> ++
> ++static int
> ++hns3_get_speed_fec_capa(struct rte_eth_fec_capa *speed_fec_capa,
> ++                      uint16_t device_id)
> ++{
> ++      switch (device_id) {
> ++      case HNS3_DEV_ID_25GE:
> ++      /* fallthrough */
> ++      case HNS3_DEV_ID_25GE_RDMA:
> ++              speed_fec_capa[0].speed = speed_fec_capa_tbl[1].speed;
> ++              speed_fec_capa[0].capa = speed_fec_capa_tbl[1].capa;
> ++
> ++              /* In HNS3 device, the 25G NIC is compatible with 10G rate */
> ++              speed_fec_capa[1].speed = speed_fec_capa_tbl[0].speed;
> ++              speed_fec_capa[1].capa = speed_fec_capa_tbl[0].capa;
> ++              break;
> ++      case HNS3_DEV_ID_100G_RDMA_MACSEC:
> ++              speed_fec_capa[0].speed = speed_fec_capa_tbl[4].speed;
> ++              speed_fec_capa[0].capa = speed_fec_capa_tbl[4].capa;
> ++              break;
> ++      case HNS3_DEV_ID_200G_RDMA:
> ++              speed_fec_capa[0].speed = speed_fec_capa_tbl[5].speed;
> ++              speed_fec_capa[0].capa = speed_fec_capa_tbl[5].capa;
> ++              break;
> ++      default:
> ++              return -ENOTSUP;
> ++      }
> ++
> ++      return 0;
> ++}
> ++
> ++static int
> ++hns3_fec_get_capability(struct rte_eth_dev *dev,
> ++                      struct rte_eth_fec_capa *speed_fec_capa,
> ++                      unsigned int num)
> ++{
> ++      struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> ++      struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
> ++      uint16_t device_id = pci_dev->id.device_id;
> ++      unsigned int capa_num;
> ++      int ret;
> ++
> ++      capa_num = hns3_get_speed_capa_num(device_id);
> ++      if (capa_num == 0) {
> ++              hns3_err(hw, "device(0x%x) is not supported by hns3 PMD",
> ++                       device_id);
> ++              return -ENOTSUP;
> ++      }
> ++
> ++      if (speed_fec_capa == NULL || num < capa_num)
> ++              return capa_num;
> ++
> ++      ret = hns3_get_speed_fec_capa(speed_fec_capa, device_id);
> ++      if (ret)
> ++              return -ENOTSUP;
> ++
> ++      return capa_num;
> ++}
> ++
> ++static int
> ++get_current_fec_auto_state(struct hns3_hw *hw, uint8_t *state)
> ++{
> ++      struct hns3_config_fec_cmd *req;
> ++      struct hns3_cmd_desc desc;
> ++      int ret;
> ++
> ++      /*
> ++       * CMD(HNS3_OPC_CONFIG_FEC_MODE) read is not supported
> ++       * in device of link speed
> ++       * below 10 Gbps.
> ++       */
> ++      if (hw->mac.link_speed < ETH_SPEED_NUM_10G) {
> ++              *state = 0;
> ++              return 0;
> ++      }
> ++
> ++      hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_CONFIG_FEC_MODE, true);
> ++      req = (struct hns3_config_fec_cmd *)desc.data;
> ++      ret = hns3_cmd_send(hw, &desc, 1);
> ++      if (ret) {
> ++              hns3_err(hw, "get current fec auto state failed, ret = %d",
> ++                       ret);
> ++              return ret;
> ++      }
> ++
> ++      *state = req->fec_mode & (1U << HNS3_MAC_CFG_FEC_AUTO_EN_B);
> ++      return 0;
> ++}
> ++
> ++static int
> ++hns3_fec_get_internal(struct hns3_hw *hw, uint32_t *fec_capa)
> ++{
> ++      struct hns3_sfp_info_cmd *resp;
> ++      uint32_t tmp_fec_capa;
> ++      uint8_t auto_state;
> ++      struct hns3_cmd_desc desc;
> ++      int ret;
> ++
> ++      /*
> ++       * If link is down and AUTO is enabled, AUTO is returned, otherwise,
> ++       * configured FEC mode is returned.
> ++       * If link is up, current FEC mode is returned.
> ++       */
> ++      if (hw->mac.link_status == ETH_LINK_DOWN) {
> ++              ret = get_current_fec_auto_state(hw, &auto_state);
> ++              if (ret)
> ++                      return ret;
> ++
> ++              if (auto_state == 0x1) {
> ++                      *fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(AUTO);
> ++                      return 0;
> ++              }
> ++      }
> ++
> ++      hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_GET_SFP_INFO, true);
> ++      resp = (struct hns3_sfp_info_cmd *)desc.data;
> ++      resp->query_type = HNS3_ACTIVE_QUERY;
> ++
> ++      ret = hns3_cmd_send(hw, &desc, 1);
> ++      if (ret == -EOPNOTSUPP) {
> ++              hns3_err(hw, "IMP do not support get FEC, ret = %d", ret);
> ++              return ret;
> ++      } else if (ret) {
> ++              hns3_err(hw, "get FEC failed, ret = %d", ret);
> ++              return ret;
> ++      }
> ++
> ++      /*
> ++       * FEC mode order defined in hns3 hardware is inconsistend with
> ++       * that defined in the ethdev library. So the sequence needs
> ++       * to be converted.
> ++       */
> ++      switch (resp->active_fec) {
> ++      case HNS3_HW_FEC_MODE_NOFEC:
> ++              tmp_fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(NOFEC);
> ++              break;
> ++      case HNS3_HW_FEC_MODE_BASER:
> ++              tmp_fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(BASER);
> ++              break;
> ++      case HNS3_HW_FEC_MODE_RS:
> ++              tmp_fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(RS);
> ++              break;
> ++      default:
> ++              tmp_fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(NOFEC);
> ++              break;
> ++      }
> ++
> ++      *fec_capa = tmp_fec_capa;
> ++      return 0;
> ++}
> ++
> ++static int
> ++hns3_fec_get(struct rte_eth_dev *dev, uint32_t *fec_capa)
> ++{
> ++      struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> ++
> ++      return hns3_fec_get_internal(hw, fec_capa);
> ++}
> ++
> ++static int
> ++hns3_set_fec_hw(struct hns3_hw *hw, uint32_t mode)
> ++{
> ++      struct hns3_config_fec_cmd *req;
> ++      struct hns3_cmd_desc desc;
> ++      int ret;
> ++
> ++      hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_CONFIG_FEC_MODE, false);
> ++
> ++      req = (struct hns3_config_fec_cmd *)desc.data;
> ++      switch (mode) {
> ++      case RTE_ETH_FEC_MODE_CAPA_MASK(NOFEC):
> ++              hns3_set_field(req->fec_mode, HNS3_MAC_CFG_FEC_MODE_M,
> ++                              HNS3_MAC_CFG_FEC_MODE_S, HNS3_MAC_FEC_OFF);
> ++              break;
> ++      case RTE_ETH_FEC_MODE_CAPA_MASK(BASER):
> ++              hns3_set_field(req->fec_mode, HNS3_MAC_CFG_FEC_MODE_M,
> ++                              HNS3_MAC_CFG_FEC_MODE_S, HNS3_MAC_FEC_BASER);
> ++              break;
> ++      case RTE_ETH_FEC_MODE_CAPA_MASK(RS):
> ++              hns3_set_field(req->fec_mode, HNS3_MAC_CFG_FEC_MODE_M,
> ++                              HNS3_MAC_CFG_FEC_MODE_S, HNS3_MAC_FEC_RS);
> ++              break;
> ++      case RTE_ETH_FEC_MODE_CAPA_MASK(AUTO):
> ++              hns3_set_bit(req->fec_mode, HNS3_MAC_CFG_FEC_AUTO_EN_B, 1);
> ++              break;
> ++      default:
> ++              return 0;
> ++      }
> ++      ret = hns3_cmd_send(hw, &desc, 1);
> ++      if (ret)
> ++              hns3_err(hw, "set fec mode failed, ret = %d", ret);
> ++
> ++      return ret;
> ++}
> ++
> ++static uint32_t
> ++get_current_speed_fec_cap(struct hns3_hw *hw, struct rte_eth_fec_capa *fec_capa)
> ++{
> ++      struct hns3_mac *mac = &hw->mac;
> ++      uint32_t cur_capa;
> ++
> ++      switch (mac->link_speed) {
> ++      case ETH_SPEED_NUM_10G:
> ++              cur_capa = fec_capa[1].capa;
> ++              break;
> ++      case ETH_SPEED_NUM_25G:
> ++      case ETH_SPEED_NUM_100G:
> ++      case ETH_SPEED_NUM_200G:
> ++              cur_capa = fec_capa[0].capa;
> ++              break;
> ++      default:
> ++              cur_capa = 0;
> ++              break;
> ++      }
> ++
> ++      return cur_capa;
> ++}
> ++
> ++static bool
> ++is_fec_mode_one_bit_set(uint32_t mode)
> ++{
> ++      int cnt = 0;
> ++      uint8_t i;
> ++
> ++      for (i = 0; i < sizeof(mode); i++)
> ++              if (mode >> i & 0x1)
> ++                      cnt++;
> ++
> ++      return cnt == 1 ? true : false;
> ++}
> ++
> ++static int
> ++hns3_fec_set(struct rte_eth_dev *dev, uint32_t mode)
> ++{
> ++#define FEC_CAPA_NUM 2
> ++      struct hns3_adapter *hns = dev->data->dev_private;
> ++      struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(hns);
> ++      struct hns3_pf *pf = &hns->pf;
> ++
> ++      struct rte_eth_fec_capa fec_capa[FEC_CAPA_NUM];
> ++      uint32_t cur_capa;
> ++      uint32_t num = FEC_CAPA_NUM;
> ++      int ret;
> ++
> ++      ret = hns3_fec_get_capability(dev, fec_capa, num);
> ++      if (ret < 0)
> ++              return ret;
> ++
> ++      /* HNS3 PMD driver only support one bit set mode, e.g. 0x1, 0x4 */
> ++      if (!is_fec_mode_one_bit_set(mode)) {
> ++              hns3_err(hw, "FEC mode(0x%x) not supported in HNS3 PMD, "
> ++                           "FEC mode should be only one bit set", mode);
> ++              return -EINVAL;
> ++      }
> ++
> ++      /*
> ++       * Check whether the configured mode is within the FEC capability.
> ++       * If not, the configured mode will not be supported.
> ++       */
> ++      cur_capa = get_current_speed_fec_cap(hw, fec_capa);
> ++      if (!(cur_capa & mode)) {
> ++              hns3_err(hw, "unsupported FEC mode = 0x%x", mode);
> ++              return -EINVAL;
> ++      }
> ++
> ++      rte_spinlock_lock(&hw->lock);
> ++      ret = hns3_set_fec_hw(hw, mode);
> ++      if (ret) {
> ++              rte_spinlock_unlock(&hw->lock);
> ++              return ret;
> ++      }
> ++
> ++      pf->fec_mode = mode;
> ++      rte_spinlock_unlock(&hw->lock);
> ++
> ++      return 0;
> ++}
> ++
> ++static int
> ++hns3_restore_fec(struct hns3_hw *hw)
> ++{
> ++      struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
> ++      struct hns3_pf *pf = &hns->pf;
> ++      uint32_t mode = pf->fec_mode;
> ++      int ret;
> ++=======
> ++      else if (hns3_atomic_test_bit(HNS3_FUNC_RESET, levels))
> ++              reset_level = HNS3_FUNC_RESET;
> ++      else if (hns3_atomic_test_bit(HNS3_FLR_RESET, levels))
> ++              reset_level = HNS3_FLR_RESET;
> ++
> ++      if (hw->reset.level != HNS3_NONE_RESET && reset_level < hw->reset.level)
> ++              return HNS3_NONE_RESET;
> ++
> ++      return reset_level;
> ++}
> ++
> ++static void
> ++hns3_record_imp_error(struct hns3_adapter *hns)
> ++{
> ++      struct hns3_hw *hw = &hns->hw;
> ++      uint32_t reg_val;
> ++
> ++      reg_val = hns3_read_dev(hw, HNS3_VECTOR0_OTER_EN_REG);
> ++      if (hns3_get_bit(reg_val, HNS3_VECTOR0_IMP_RD_POISON_B)) {
> ++              hns3_warn(hw, "Detected IMP RD poison!");
> ++              hns3_set_bit(reg_val, HNS3_VECTOR0_IMP_RD_POISON_B, 0);
> ++              hns3_write_dev(hw, HNS3_VECTOR0_OTER_EN_REG, reg_val);
> ++      }
> ++
> ++      if (hns3_get_bit(reg_val, HNS3_VECTOR0_IMP_CMDQ_ERR_B)) {
> ++              hns3_warn(hw, "Detected IMP CMDQ error!");
> ++              hns3_set_bit(reg_val, HNS3_VECTOR0_IMP_CMDQ_ERR_B, 0);
> ++              hns3_write_dev(hw, HNS3_VECTOR0_OTER_EN_REG, reg_val);
> ++      }
> ++}
> ++
> ++static int
> ++hns3_prepare_reset(struct hns3_adapter *hns)
> ++{
> ++      struct hns3_hw *hw = &hns->hw;
> ++      uint32_t reg_val;
> ++      int ret;
> ++
> ++      switch (hw->reset.level) {
> ++      case HNS3_FUNC_RESET:
> ++              ret = hns3_func_reset_cmd(hw, HNS3_PF_FUNC_ID);
> ++              if (ret)
> ++                      return ret;
> ++
> ++              /*
> ++               * After performaning pf reset, it is not necessary to do the
> ++               * mailbox handling or send any command to firmware, because
> ++               * any mailbox handling or command to firmware is only valid
> ++               * after hns3_cmd_init is called.
> ++               */
> ++              __atomic_store_n(&hw->reset.disable_cmd, 1, __ATOMIC_RELAXED);
> ++              hw->reset.stats.request_cnt++;
> ++              break;
> ++      case HNS3_IMP_RESET:
> ++              hns3_record_imp_error(hns);
> ++              reg_val = hns3_read_dev(hw, HNS3_VECTOR0_OTER_EN_REG);
> ++              hns3_write_dev(hw, HNS3_VECTOR0_OTER_EN_REG, reg_val |
> ++                             BIT(HNS3_VECTOR0_IMP_RESET_INT_B));
> ++              break;
> ++      default:
> ++              break;
> ++      }
> ++      return 0;
> ++}
> ++
> ++static int
> ++hns3_set_rst_done(struct hns3_hw *hw)
> ++{
> ++      struct hns3_pf_rst_done_cmd *req;
> ++      struct hns3_cmd_desc desc;
> ++
> ++      req = (struct hns3_pf_rst_done_cmd *)desc.data;
> ++      hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_PF_RST_DONE, false);
> ++      req->pf_rst_done |= HNS3_PF_RESET_DONE_BIT;
> ++      return hns3_cmd_send(hw, &desc, 1);
> ++}
> ++
> ++static int
> ++hns3_stop_service(struct hns3_adapter *hns)
> ++{
> ++      struct hns3_hw *hw = &hns->hw;
> ++      struct rte_eth_dev *eth_dev;
> ++
> ++      eth_dev = &rte_eth_devices[hw->data->port_id];
> ++      hw->mac.link_status = ETH_LINK_DOWN;
> ++      if (hw->adapter_state == HNS3_NIC_STARTED) {
> ++              rte_eal_alarm_cancel(hns3_service_handler, eth_dev);
> ++              hns3_update_linkstatus_and_event(hw, false);
> ++      }
> ++
> ++      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);
> ++
> ++      rte_spinlock_lock(&hw->lock);
> ++      if (hns->hw.adapter_state == HNS3_NIC_STARTED ||
> ++          hw->adapter_state == HNS3_NIC_STOPPING) {
> ++              hns3_enable_all_queues(hw, false);
> ++              hns3_do_stop(hns);
> ++              hw->reset.mbuf_deferred_free = true;
> ++      } else
> ++              hw->reset.mbuf_deferred_free = false;
> ++
> ++      /*
> ++       * It is cumbersome for hardware to pick-and-choose entries for deletion
> ++       * from table space. Hence, for function reset software intervention is
> ++       * required to delete the entries
> ++       */
> ++      if (__atomic_load_n(&hw->reset.disable_cmd, __ATOMIC_RELAXED) == 0)
> ++              hns3_configure_all_mc_mac_addr(hns, true);
> ++      rte_spinlock_unlock(&hw->lock);
> ++
> ++      return 0;
> ++}
> ++
> ++static int
> ++hns3_start_service(struct hns3_adapter *hns)
> ++{
> ++      struct hns3_hw *hw = &hns->hw;
> ++      struct rte_eth_dev *eth_dev;
> ++
> ++      if (hw->reset.level == HNS3_IMP_RESET ||
> ++          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);
> ++      if (hw->adapter_state == HNS3_NIC_STARTED) {
> ++              /*
> ++               * This API parent function already hold the hns3_hw.lock, the
> ++               * hns3_service_handler may report lse, in bonding application
> ++               * it will call driver's ops which may acquire the hns3_hw.lock
> ++               * again, thus lead to deadlock.
> ++               * We defer calls hns3_service_handler to avoid the deadlock.
> ++               */
> ++              rte_eal_alarm_set(HNS3_SERVICE_QUICK_INTERVAL,
> ++                                hns3_service_handler, eth_dev);
> ++
> ++              /* Enable interrupt of all rx queues before enabling queues */
> ++              hns3_dev_all_rx_queue_intr_enable(hw, true);
> ++              /*
> ++               * Enable state of each rxq and txq will be recovered after
> ++               * reset, so we need to restore them before enable all tqps;
> ++               */
> ++              hns3_restore_tqp_enable_state(hw);
> ++              /*
> ++               * When finished the initialization, enable queues to receive
> ++               * and transmit packets.
> ++               */
> ++              hns3_enable_all_queues(hw, true);
> ++      }
> ++
> ++      return 0;
> ++}
> ++
> ++static int
> ++hns3_restore_conf(struct hns3_adapter *hns)
> ++{
> ++      struct hns3_hw *hw = &hns->hw;
> ++      int ret;
> ++
> ++      ret = hns3_configure_all_mac_addr(hns, false);
> ++      if (ret)
> ++              return ret;
> ++
> ++      ret = hns3_configure_all_mc_mac_addr(hns, false);
> ++      if (ret)
> ++              goto err_mc_mac;
> ++
> ++      ret = hns3_dev_promisc_restore(hns);
> ++      if (ret)
> ++              goto err_promisc;
> ++
> ++      ret = hns3_restore_vlan_table(hns);
> ++      if (ret)
> ++              goto err_promisc;
> ++
> ++      ret = hns3_restore_vlan_conf(hns);
> ++      if (ret)
> ++              goto err_promisc;
> ++
> ++      ret = hns3_restore_all_fdir_filter(hns);
> ++      if (ret)
> ++              goto err_promisc;
> ++
> ++      ret = hns3_restore_ptp(hns);
> ++      if (ret)
> ++              goto err_promisc;
> ++
> ++      ret = hns3_restore_rx_interrupt(hw);
> ++      if (ret)
> ++              goto err_promisc;
> ++
> ++      ret = hns3_restore_gro_conf(hw);
> ++      if (ret)
> ++              goto err_promisc;
> ++
> ++      ret = hns3_restore_fec(hw);
> ++      if (ret)
> ++              goto err_promisc;
> ++
> ++      if (hns->hw.adapter_state == HNS3_NIC_STARTED) {
> ++              ret = hns3_do_start(hns, false);
> ++              if (ret)
> ++                      goto err_promisc;
> ++              hns3_info(hw, "hns3 dev restart successful!");
> ++      } else if (hw->adapter_state == HNS3_NIC_STOPPING)
> ++              hw->adapter_state = HNS3_NIC_CONFIGURED;
> ++      return 0;
> ++
> ++err_promisc:
> ++      hns3_configure_all_mc_mac_addr(hns, true);
> ++err_mc_mac:
> ++      hns3_configure_all_mac_addr(hns, true);
> ++      return ret;
> ++}
> ++
> ++static void
> ++hns3_reset_service(void *param)
> ++{
> ++      struct hns3_adapter *hns = (struct hns3_adapter *)param;
> ++      struct hns3_hw *hw = &hns->hw;
> ++      enum hns3_reset_level reset_level;
> ++      struct timeval tv_delta;
> ++      struct timeval tv_start;
> ++      struct timeval tv;
> ++      uint64_t msec;
> ++      int ret;
> ++
> ++      /*
> ++       * The interrupt is not triggered within the delay time.
> ++       * The interrupt may have been lost. It is necessary to handle
> ++       * the interrupt to recover from the error.
> ++       */
> ++      if (__atomic_load_n(&hw->reset.schedule, __ATOMIC_RELAXED) ==
> ++                          SCHEDULE_DEFERRED) {
> ++              __atomic_store_n(&hw->reset.schedule, SCHEDULE_REQUESTED,
> ++                                __ATOMIC_RELAXED);
> ++              hns3_err(hw, "Handling interrupts in delayed tasks");
> ++              hns3_interrupt_handler(&rte_eth_devices[hw->data->port_id]);
> ++              reset_level = hns3_get_reset_level(hns, &hw->reset.pending);
> ++              if (reset_level == HNS3_NONE_RESET) {
> ++                      hns3_err(hw, "No reset level is set, try IMP reset");
> ++                      hns3_atomic_set_bit(HNS3_IMP_RESET, &hw->reset.pending);
> ++              }
> ++      }
> ++      __atomic_store_n(&hw->reset.schedule, SCHEDULE_NONE, __ATOMIC_RELAXED);
> ++
> ++      /*
> ++       * Check if there is any ongoing reset in the hardware. This status can
> ++       * be checked from reset_pending. If there is then, we need to wait for
> ++       * hardware to complete reset.
> ++       *    a. If we are able to figure out in reasonable time that hardware
> ++       *       has fully resetted then, we can proceed with driver, client
> ++       *       reset.
> ++       *    b. else, we can come back later to check this status so re-sched
> ++       *       now.
> ++       */
> ++      reset_level = hns3_get_reset_level(hns, &hw->reset.pending);
> ++      if (reset_level != HNS3_NONE_RESET) {
> ++              hns3_clock_gettime(&tv_start);
> ++              ret = hns3_reset_process(hns, reset_level);
> ++              hns3_clock_gettime(&tv);
> ++              timersub(&tv, &tv_start, &tv_delta);
> ++              msec = hns3_clock_calctime_ms(&tv_delta);
> ++              if (msec > HNS3_RESET_PROCESS_MS)
> ++                      hns3_err(hw, "%d handle long time delta %" PRIu64
> ++                                   " ms time=%ld.%.6ld",
> ++                               hw->reset.level, msec,
> ++                               tv.tv_sec, tv.tv_usec);
> ++              if (ret == -EAGAIN)
> ++                      return;
> ++      }
> ++
> ++      /* Check if we got any *new* reset requests to be honored */
> ++      reset_level = hns3_get_reset_level(hns, &hw->reset.request);
> ++      if (reset_level != HNS3_NONE_RESET)
> ++              hns3_msix_process(hns, reset_level);
> ++}
> ++
> ++static unsigned int
> ++hns3_get_speed_capa_num(uint16_t device_id)
> ++{
> ++      unsigned int num;
> ++
> ++      switch (device_id) {
> ++      case HNS3_DEV_ID_25GE:
> ++      case HNS3_DEV_ID_25GE_RDMA:
> ++              num = 2;
> ++              break;
> ++      case HNS3_DEV_ID_100G_RDMA_MACSEC:
> ++      case HNS3_DEV_ID_200G_RDMA:
> ++              num = 1;
> ++              break;
> ++      default:
> ++              num = 0;
> ++              break;
> ++      }
> ++
> ++      return num;
> ++}
> ++
> ++static int
> ++hns3_get_speed_fec_capa(struct rte_eth_fec_capa *speed_fec_capa,
> ++                      uint16_t device_id)
> ++{
> ++      switch (device_id) {
> ++      case HNS3_DEV_ID_25GE:
> ++      /* fallthrough */
> ++      case HNS3_DEV_ID_25GE_RDMA:
> ++              speed_fec_capa[0].speed = speed_fec_capa_tbl[1].speed;
> ++              speed_fec_capa[0].capa = speed_fec_capa_tbl[1].capa;
> ++
> ++              /* In HNS3 device, the 25G NIC is compatible with 10G rate */
> ++              speed_fec_capa[1].speed = speed_fec_capa_tbl[0].speed;
> ++              speed_fec_capa[1].capa = speed_fec_capa_tbl[0].capa;
> ++              break;
> ++      case HNS3_DEV_ID_100G_RDMA_MACSEC:
> ++              speed_fec_capa[0].speed = speed_fec_capa_tbl[4].speed;
> ++              speed_fec_capa[0].capa = speed_fec_capa_tbl[4].capa;
> ++              break;
> ++      case HNS3_DEV_ID_200G_RDMA:
> ++              speed_fec_capa[0].speed = speed_fec_capa_tbl[5].speed;
> ++              speed_fec_capa[0].capa = speed_fec_capa_tbl[5].capa;
> ++              break;
> ++      default:
> ++              return -ENOTSUP;
> ++      }
> ++
> ++      return 0;
> ++}
> ++
> ++static int
> ++hns3_fec_get_capability(struct rte_eth_dev *dev,
> ++                      struct rte_eth_fec_capa *speed_fec_capa,
> ++                      unsigned int num)
> ++{
> ++      struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> ++      struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
> ++      uint16_t device_id = pci_dev->id.device_id;
> ++      unsigned int capa_num;
> ++      int ret;
> ++
> ++      capa_num = hns3_get_speed_capa_num(device_id);
> ++      if (capa_num == 0) {
> ++              hns3_err(hw, "device(0x%x) is not supported by hns3 PMD",
> ++                       device_id);
> ++              return -ENOTSUP;
> ++      }
> ++
> ++      if (speed_fec_capa == NULL || num < capa_num)
> ++              return capa_num;
> ++
> ++      ret = hns3_get_speed_fec_capa(speed_fec_capa, device_id);
> ++      if (ret)
> ++              return -ENOTSUP;
> ++
> ++      return capa_num;
> ++}
> ++
> ++static int
> ++get_current_fec_auto_state(struct hns3_hw *hw, uint8_t *state)
> ++{
> ++      struct hns3_config_fec_cmd *req;
> ++      struct hns3_cmd_desc desc;
> ++      int ret;
> ++
> ++      /*
> ++       * CMD(HNS3_OPC_CONFIG_FEC_MODE) read is not supported
> ++       * in device of link speed
> ++       * below 10 Gbps.
> ++       */
> ++      if (hw->mac.link_speed < ETH_SPEED_NUM_10G) {
> ++              *state = 0;
> ++              return 0;
> ++      }
> ++
> ++      hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_CONFIG_FEC_MODE, true);
> ++      req = (struct hns3_config_fec_cmd *)desc.data;
> ++      ret = hns3_cmd_send(hw, &desc, 1);
> ++      if (ret) {
> ++              hns3_err(hw, "get current fec auto state failed, ret = %d",
> ++                       ret);
> ++              return ret;
> ++      }
> ++
> ++      *state = req->fec_mode & (1U << HNS3_MAC_CFG_FEC_AUTO_EN_B);
> ++      return 0;
> ++}
> ++
> ++static int
> ++hns3_fec_get_internal(struct hns3_hw *hw, uint32_t *fec_capa)
> ++{
> ++      struct hns3_sfp_info_cmd *resp;
> ++      uint32_t tmp_fec_capa;
> ++      uint8_t auto_state;
> ++      struct hns3_cmd_desc desc;
> ++      int ret;
> ++
> ++      /*
> ++       * If link is down and AUTO is enabled, AUTO is returned, otherwise,
> ++       * configured FEC mode is returned.
> ++       * If link is up, current FEC mode is returned.
> ++       */
> ++      if (hw->mac.link_status == ETH_LINK_DOWN) {
> ++              ret = get_current_fec_auto_state(hw, &auto_state);
> ++              if (ret)
> ++                      return ret;
> ++
> ++              if (auto_state == 0x1) {
> ++                      *fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(AUTO);
> ++                      return 0;
> ++              }
> ++      }
> ++
> ++      hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_GET_SFP_INFO, true);
> ++      resp = (struct hns3_sfp_info_cmd *)desc.data;
> ++      resp->query_type = HNS3_ACTIVE_QUERY;
> ++
> ++      ret = hns3_cmd_send(hw, &desc, 1);
> ++      if (ret == -EOPNOTSUPP) {
> ++              hns3_err(hw, "IMP do not support get FEC, ret = %d", ret);
> ++              return ret;
> ++      } else if (ret) {
> ++              hns3_err(hw, "get FEC failed, ret = %d", ret);
> ++              return ret;
> ++      }
> ++
> ++      /*
> ++       * FEC mode order defined in hns3 hardware is inconsistend with
> ++       * that defined in the ethdev library. So the sequence needs
> ++       * to be converted.
> ++       */
> ++      switch (resp->active_fec) {
> ++      case HNS3_HW_FEC_MODE_NOFEC:
> ++              tmp_fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(NOFEC);
> ++              break;
> ++      case HNS3_HW_FEC_MODE_BASER:
> ++              tmp_fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(BASER);
> ++              break;
> ++      case HNS3_HW_FEC_MODE_RS:
> ++              tmp_fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(RS);
> ++              break;
> ++      default:
> ++              tmp_fec_capa = RTE_ETH_FEC_MODE_CAPA_MASK(NOFEC);
> ++              break;
> ++      }
> ++
> ++      *fec_capa = tmp_fec_capa;
> ++      return 0;
> ++}
> ++
> ++static int
> ++hns3_fec_get(struct rte_eth_dev *dev, uint32_t *fec_capa)
> ++{
> ++      struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> ++
> ++      return hns3_fec_get_internal(hw, fec_capa);
> ++}
> ++
> ++static int
> ++hns3_set_fec_hw(struct hns3_hw *hw, uint32_t mode)
> ++{
> ++      struct hns3_config_fec_cmd *req;
> ++      struct hns3_cmd_desc desc;
> ++      int ret;
> ++
> ++      hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_CONFIG_FEC_MODE, false);
> ++
> ++      req = (struct hns3_config_fec_cmd *)desc.data;
> ++      switch (mode) {
> ++      case RTE_ETH_FEC_MODE_CAPA_MASK(NOFEC):
> ++              hns3_set_field(req->fec_mode, HNS3_MAC_CFG_FEC_MODE_M,
> ++                              HNS3_MAC_CFG_FEC_MODE_S, HNS3_MAC_FEC_OFF);
> ++              break;
> ++      case RTE_ETH_FEC_MODE_CAPA_MASK(BASER):
> ++              hns3_set_field(req->fec_mode, HNS3_MAC_CFG_FEC_MODE_M,
> ++                              HNS3_MAC_CFG_FEC_MODE_S, HNS3_MAC_FEC_BASER);
> ++              break;
> ++      case RTE_ETH_FEC_MODE_CAPA_MASK(RS):
> ++              hns3_set_field(req->fec_mode, HNS3_MAC_CFG_FEC_MODE_M,
> ++                              HNS3_MAC_CFG_FEC_MODE_S, HNS3_MAC_FEC_RS);
> ++              break;
> ++      case RTE_ETH_FEC_MODE_CAPA_MASK(AUTO):
> ++              hns3_set_bit(req->fec_mode, HNS3_MAC_CFG_FEC_AUTO_EN_B, 1);
> ++              break;
> ++      default:
> ++              return 0;
> ++      }
> ++      ret = hns3_cmd_send(hw, &desc, 1);
> ++      if (ret)
> ++              hns3_err(hw, "set fec mode failed, ret = %d", ret);
> ++
> ++      return ret;
> ++}
> ++
> ++static uint32_t
> ++get_current_speed_fec_cap(struct hns3_hw *hw, struct rte_eth_fec_capa *fec_capa)
> ++{
> ++      struct hns3_mac *mac = &hw->mac;
> ++      uint32_t cur_capa;
> ++
> ++      switch (mac->link_speed) {
> ++      case ETH_SPEED_NUM_10G:
> ++              cur_capa = fec_capa[1].capa;
> ++              break;
> ++      case ETH_SPEED_NUM_25G:
> ++      case ETH_SPEED_NUM_100G:
> ++      case ETH_SPEED_NUM_200G:
> ++              cur_capa = fec_capa[0].capa;
> ++              break;
> ++      default:
> ++              cur_capa = 0;
> ++              break;
> ++      }
> ++
> ++      return cur_capa;
> ++}
> ++
> ++static bool
> ++is_fec_mode_one_bit_set(uint32_t mode)
> ++{
> ++      int cnt = 0;
> ++      uint8_t i;
> ++
> ++      for (i = 0; i < sizeof(mode); i++)
> ++              if (mode >> i & 0x1)
> ++                      cnt++;
> ++
> ++      return cnt == 1 ? true : false;
> ++}
> ++
> ++static int
> ++hns3_fec_set(struct rte_eth_dev *dev, uint32_t mode)
> ++{
> ++#define FEC_CAPA_NUM 2
> ++      struct hns3_adapter *hns = dev->data->dev_private;
> ++      struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(hns);
> ++      struct hns3_pf *pf = &hns->pf;
> ++
> ++      struct rte_eth_fec_capa fec_capa[FEC_CAPA_NUM];
> ++      uint32_t cur_capa;
> ++      uint32_t num = FEC_CAPA_NUM;
> ++      int ret;
> ++
> ++      ret = hns3_fec_get_capability(dev, fec_capa, num);
> ++      if (ret < 0)
> ++              return ret;
> ++
> ++      /* HNS3 PMD driver only support one bit set mode, e.g. 0x1, 0x4 */
> ++      if (!is_fec_mode_one_bit_set(mode)) {
> ++              hns3_err(hw, "FEC mode(0x%x) not supported in HNS3 PMD, "
> ++                           "FEC mode should be only one bit set", mode);
> ++              return -EINVAL;
> ++      }
> ++
> ++      /*
> ++       * Check whether the configured mode is within the FEC capability.
> ++       * If not, the configured mode will not be supported.
> ++       */
> ++      cur_capa = get_current_speed_fec_cap(hw, fec_capa);
> ++      if (!(cur_capa & mode)) {
> ++              hns3_err(hw, "unsupported FEC mode = 0x%x", mode);
> ++              return -EINVAL;
> ++      }
> ++
> ++      rte_spinlock_lock(&hw->lock);
> ++      ret = hns3_set_fec_hw(hw, mode);
> ++      if (ret) {
> ++              rte_spinlock_unlock(&hw->lock);
> ++              return ret;
> ++      }
> ++
> ++      pf->fec_mode = mode;
> ++      rte_spinlock_unlock(&hw->lock);
> ++
> ++      return 0;
> ++}
> ++
> ++static int
> ++hns3_restore_fec(struct hns3_hw *hw)
> ++{
> ++      struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
> ++      struct hns3_pf *pf = &hns->pf;
> ++      uint32_t mode = pf->fec_mode;
> ++      int ret;
> ++>>>>>>> net/hns3: fix delay for waiting to stop Rx/Tx
> +
> +       if (hw->reset.level != HNS3_NONE_RESET && reset_level < hw->reset.level)
> +               return HNS3_NONE_RESET;
> +@@ -5201,7 +6381,7 @@ hns3_stop_service(struct hns3_adapter *hns)
> @@ -46 +1238 @@
> -index 41dd8ee129..7a5c162964 100644
> +index a7b6188eea..eb3edf3464 100644
> @@ -49 +1241 @@
> -@@ -2107,7 +2107,7 @@ hns3vf_dev_stop(struct rte_eth_dev *dev)
> +@@ -1631,7 +1631,7 @@ hns3vf_dev_stop(struct rte_eth_dev *dev)
> @@ -57,2 +1249,2 @@
> -       if (__atomic_load_n(&hw->reset.resetting, __ATOMIC_RELAXED) == 0) {
> -@@ -2558,7 +2558,7 @@ hns3vf_stop_service(struct hns3_adapter *hns)
> +       if (rte_atomic16_read(&hw->reset.resetting) == 0) {
> +@@ -2005,7 +2005,7 @@ hns3vf_stop_service(struct hns3_adapter *hns)



-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd

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

* Re: [dpdk-stable] patch 'net/mlx5: reject inner ethernet matching in GTP' has been queued to stable release 19.11.10
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/mlx5: reject inner ethernet matching in GTP' " christian.ehrhardt
@ 2021-08-11  9:17   ` Christian Ehrhardt
  2021-08-11 10:25     ` Lior Margalit
  0 siblings, 1 reply; 114+ messages in thread
From: Christian Ehrhardt @ 2021-08-11  9:17 UTC (permalink / raw)
  To: Lior Margalit; +Cc: Matan Azrad, dpdk stable

On Tue, Aug 10, 2021 at 5:44 PM <christian.ehrhardt@canonical.com> wrote:
>
> Hi,
>
> FYI, your patch has been queued to stable release 19.11.10

Hi,
while applying cleanly your patch caused build time failures like:

../drivers/net/mlx5/mlx5_flow.c: In function ‘mlx5_flow_validate_item_eth’:
../drivers/net/mlx5/mlx5_flow.c:1444:19: error: ‘MLX5_FLOW_LAYER_GTP’
undeclared (first use in this function); did you mean
‘MLX5_FLOW_LAYER_GRE’?
 1444 |  if (item_flags & MLX5_FLOW_LAYER_GTP)
      |                   ^~~~~~~~~~~~~~~~~~~
      |                   MLX5_FLOW_LAYER_GRE

Therefore the patch will be de-qeueud from the stable branch that shall become
19.11.10.
Please consider having a look and providing a backport.

A backport should contain a reference to the DPDK main branch commit
in it's commit message in the following fashion:
    [ upstream commit <commit's dpdk main branch SHA-1 checksum> ]

For example:
    https://git.dpdk.org/dpdk-stable/commit/?h=18.11&id=d90e6ae6f936ecdc2fd3811ff9f26aec7f3c06eb

When sending the backported patch, please indicate the target branch in the
subject line, as we have multiple branches, for example:
    [PATCH 19.11] foo/bar: fix baz

With git format-patch, this can be achieved by appending the parameter:
    --subject-prefix='PATCH 19.11'

Send the backported patch to "stable@dpdk.org" but not "dev@dpdk.org".

FYI, branch 19.11 is located at tree:
   https://git.dpdk.org/dpdk-stable

Thanks in advance,
Chrtistian

> Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
> It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue
>
> This queued commit can be viewed at:
> https://github.com/cpaelzer/dpdk-stable-queue/commit/72c1cc5d90154b1f8a8fc0b94f097c41cdb27b24
>
> Thanks.
>
> Christian Ehrhardt <christian.ehrhardt@canonical.com>
>
> ---
> From 72c1cc5d90154b1f8a8fc0b94f097c41cdb27b24 Mon Sep 17 00:00:00 2001
> From: Lior Margalit <lmargalit@nvidia.com>
> Date: Tue, 20 Jul 2021 18:17:18 +0300
> Subject: [PATCH] net/mlx5: reject inner ethernet matching in GTP
>
> [ upstream commit 4e5ba38d56e3a037271547c90fbfc25c81938a4f ]
>
> The user is able to create a flow rule pattern with ETH after GTP
> although it is not supported by the flex-parser configuration.
>
> Failed the rule validation in such case with proper error message.
>
> Fixes: 23c1d42c7138 ("net/mlx5: split flow validation to dedicated function")
>
> Signed-off-by: Lior Margalit <lmargalit@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>
> ---
>  drivers/net/mlx5/mlx5_flow.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
> index 65064ffb07..cb08e5ec35 100644
> --- a/drivers/net/mlx5/mlx5_flow.c
> +++ b/drivers/net/mlx5/mlx5_flow.c
> @@ -1441,6 +1441,10 @@ mlx5_flow_validate_item_eth(const struct rte_flow_item *item,
>                 return rte_flow_error_set(error, EINVAL,
>                                           RTE_FLOW_ERROR_TYPE_ITEM, item,
>                                           "L2 layer should not follow VLAN");
> +       if (item_flags & MLX5_FLOW_LAYER_GTP)
> +               return rte_flow_error_set(error, EINVAL,
> +                                         RTE_FLOW_ERROR_TYPE_ITEM, item,
> +                                         "L2 layer should not follow GTP");
>         if (!mask)
>                 mask = &rte_flow_item_eth_mask;
>         ret = mlx5_flow_item_acceptable(item, (const uint8_t *)mask,
> --
> 2.32.0
>
> ---
>   Diff of the applied patch vs upstream commit (please double-check if non-empty:
> ---
> --- -   2021-08-10 15:11:15.983836535 +0200
> +++ 0077-net-mlx5-reject-inner-ethernet-matching-in-GTP.patch   2021-08-10 15:11:13.090638619 +0200
> @@ -1 +1 @@
> -From 4e5ba38d56e3a037271547c90fbfc25c81938a4f Mon Sep 17 00:00:00 2001
> +From 72c1cc5d90154b1f8a8fc0b94f097c41cdb27b24 Mon Sep 17 00:00:00 2001
> @@ -5,0 +6,2 @@
> +[ upstream commit 4e5ba38d56e3a037271547c90fbfc25c81938a4f ]
> +
> @@ -12 +13,0 @@
> -Cc: stable@dpdk.org
> @@ -21 +22 @@
> -index 2059f29b23..a3fdce685e 100644
> +index 65064ffb07..cb08e5ec35 100644
> @@ -24 +25 @@
> -@@ -1999,6 +1999,10 @@ mlx5_flow_validate_item_eth(const struct rte_flow_item *item,
> +@@ -1441,6 +1441,10 @@ mlx5_flow_validate_item_eth(const struct rte_flow_item *item,



-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd

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

* Re: [dpdk-stable] patch 'common/mlx5: fix Netlink receive message buffer size' has been queued to stable release 19.11.10
  2021-08-10 15:39 ` [dpdk-stable] patch 'common/mlx5: fix Netlink receive message buffer size' " christian.ehrhardt
@ 2021-08-11  9:26   ` Christian Ehrhardt
  0 siblings, 0 replies; 114+ messages in thread
From: Christian Ehrhardt @ 2021-08-11  9:26 UTC (permalink / raw)
  To: Viacheslav Ovsiienko; +Cc: dpdk stable

On Tue, Aug 10, 2021 at 5:43 PM <christian.ehrhardt@canonical.com> wrote:
>
> Hi,
>
> FYI, your patch has been queued to stable release 19.11.10

Hi,
while applying cleanly your patch caused build time failures like:

/usr/bin/ld: drivers/libtmp_rte_pmd_mlx5.a.p/net_mlx5_mlx5_nl.c.o: in
function `mlx5_nl_recv.constprop.0':
mlx5_nl.c:(.text+0x504): undefined reference to `mlx5_free'
/usr/bin/ld: mlx5_nl.c:(.text+0x517): undefined reference to `mlx5_malloc'
/usr/bin/ld: drivers/libtmp_rte_pmd_mlx5.a.p/net_mlx5_mlx5_nl.c.o: in
function `mlx5_nl_mac_addr_sync':
mlx5_nl.c:(.text+0xfbb): undefined reference to `mlx5_free'
/usr/bin/ld: mlx5_nl.c:(.text+0xfcd): undefined reference to `mlx5_malloc'
/usr/bin/ld: drivers/libtmp_rte_pmd_mlx5.a.p/net_mlx5_mlx5_nl.c.o: in
function `mlx5_nl_ifindex':
mlx5_nl.c:(.text+0x1872): undefined reference to `mlx5_free'
/usr/bin/ld: mlx5_nl.c:(.text+0x1884): undefined reference to `mlx5_malloc'
/usr/bin/ld: mlx5_nl.c:(.text+0x1bd2): undefined reference to `mlx5_free'
/usr/bin/ld: mlx5_nl.c:(.text+0x1be4): undefined reference to `mlx5_malloc'
/usr/bin/ld: drivers/libtmp_rte_pmd_mlx5.a.p/net_mlx5_mlx5_nl.c.o: in
function `mlx5_nl_portnum':
mlx5_nl.c:(.text+0x1f6a): undefined reference to `mlx5_free'
/usr/bin/ld: mlx5_nl.c:(.text+0x1f7c): undefined reference to `mlx5_malloc'
/usr/bin/ld: drivers/libtmp_rte_pmd_mlx5.a.p/net_mlx5_mlx5_nl.c.o: in
function `mlx5_nl_switch_info':
mlx5_nl.c:(.text+0x2364): undefined reference to `mlx5_free'
/usr/bin/ld: mlx5_nl.c:(.text+0x2377): undefined reference to `mlx5_malloc'
collect2: error: ld returned 1 exit status

Therefore the patch will be de-qeueud from the stable branch that shall become
19.11.10.
Please consider having a look and providing a backport.

A backport should contain a reference to the DPDK main branch commit
in it's commit message in the following fashion:
    [ upstream commit <commit's dpdk main branch SHA-1 checksum> ]

For example:
    https://git.dpdk.org/dpdk-stable/commit/?h=18.11&id=d90e6ae6f936ecdc2fd3811ff9f26aec7f3c06eb

When sending the backported patch, please indicate the target branch in the
subject line, as we have multiple branches, for example:
    [PATCH 19.11] foo/bar: fix baz

With git format-patch, this can be achieved by appending the parameter:
    --subject-prefix='PATCH 19.11'

Send the backported patch to "stable@dpdk.org" but not "dev@dpdk.org".

FYI, branch 19.11 is located at tree:
   https://git.dpdk.org/dpdk-stable

Thanks in advance,
Chrtistian

> Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
> It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue
>
> This queued commit can be viewed at:
> https://github.com/cpaelzer/dpdk-stable-queue/commit/6af6af1640a7cd555e22dea6f12f497b82bb0761
>
> Thanks.
>
> Christian Ehrhardt <christian.ehrhardt@canonical.com>
>
> ---
> From 6af6af1640a7cd555e22dea6f12f497b82bb0761 Mon Sep 17 00:00:00 2001
> From: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> Date: Thu, 1 Jul 2021 10:31:33 +0300
> Subject: [PATCH] common/mlx5: fix Netlink receive message buffer size
>
> [ upstream commit 32d1e4dbadba4bc3523d8b354458a4b979e5c2e6 ]
>
> If there are many VFs the Netlink message length sent by kernel
> in reply to RTM_GETLINK request can be large. We should query
> the size of message being received in advance and allocate
> the large enough buffer to handle these large messages.
>
> Fixes: ccdcba53a3f4 ("net/mlx5: use Netlink to add/remove MAC addresses")
>
> Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> ---
>  drivers/net/mlx5/mlx5_nl.c | 69 ++++++++++++++++++++++++++++++--------
>  1 file changed, 55 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/net/mlx5/mlx5_nl.c b/drivers/net/mlx5/mlx5_nl.c
> index 668affb0b1..8d5478d9f5 100644
> --- a/drivers/net/mlx5/mlx5_nl.c
> +++ b/drivers/net/mlx5/mlx5_nl.c
> @@ -128,8 +128,8 @@ int
>  mlx5_nl_init(int protocol)
>  {
>         int fd;
> -       int sndbuf_size = MLX5_SEND_BUF_SIZE;
> -       int rcvbuf_size = MLX5_RECV_BUF_SIZE;
> +       int buf_size;
> +       socklen_t opt_size;
>         struct sockaddr_nl local = {
>                 .nl_family = AF_NETLINK,
>         };
> @@ -140,16 +140,36 @@ mlx5_nl_init(int protocol)
>                 rte_errno = errno;
>                 return -rte_errno;
>         }
> -       ret = setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &sndbuf_size, sizeof(int));
> +       opt_size = sizeof(buf_size);
> +       ret = getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &buf_size, &opt_size);
>         if (ret == -1) {
>                 rte_errno = errno;
>                 goto error;
>         }
> -       ret = setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &rcvbuf_size, sizeof(int));
> +       DRV_LOG(DEBUG, "Netlink socket send buffer: %d", buf_size);
> +       if (buf_size < MLX5_SEND_BUF_SIZE) {
> +               ret = setsockopt(fd, SOL_SOCKET, SO_SNDBUF,
> +                                &buf_size, sizeof(buf_size));
> +               if (ret == -1) {
> +                       rte_errno = errno;
> +                       goto error;
> +               }
> +       }
> +       opt_size = sizeof(buf_size);
> +       ret = getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &buf_size, &opt_size);
>         if (ret == -1) {
>                 rte_errno = errno;
>                 goto error;
>         }
> +       DRV_LOG(DEBUG, "Netlink socket recv buffer: %d", buf_size);
> +       if (buf_size < MLX5_RECV_BUF_SIZE) {
> +               ret = setsockopt(fd, SOL_SOCKET, SO_RCVBUF,
> +                                &buf_size, sizeof(buf_size));
> +               if (ret == -1) {
> +                       rte_errno = errno;
> +                       goto error;
> +               }
> +       }
>         ret = bind(fd, (struct sockaddr *)&local, sizeof(local));
>         if (ret == -1) {
>                 rte_errno = errno;
> @@ -271,11 +291,7 @@ mlx5_nl_recv(int nlsk_fd, uint32_t sn, int (*cb)(struct nlmsghdr *, void *arg),
>              void *arg)
>  {
>         struct sockaddr_nl sa;
> -       void *buf = malloc(MLX5_RECV_BUF_SIZE);
> -       struct iovec iov = {
> -               .iov_base = buf,
> -               .iov_len = MLX5_RECV_BUF_SIZE,
> -       };
> +       struct iovec iov;
>         struct msghdr msg = {
>                 .msg_name = &sa,
>                 .msg_namelen = sizeof(sa),
> @@ -283,18 +299,43 @@ mlx5_nl_recv(int nlsk_fd, uint32_t sn, int (*cb)(struct nlmsghdr *, void *arg),
>                 /* One message at a time */
>                 .msg_iovlen = 1,
>         };
> +       void *buf = NULL;
>         int multipart = 0;
>         int ret = 0;
>
> -       if (!buf) {
> -               rte_errno = ENOMEM;
> -               return -rte_errno;
> -       }
>         do {
>                 struct nlmsghdr *nh;
> -               int recv_bytes = 0;
> +               int recv_bytes;
>
>                 do {
> +                       /* Query length of incoming message. */
> +                       iov.iov_base = NULL;
> +                       iov.iov_len = 0;
> +                       recv_bytes = recvmsg(nlsk_fd, &msg,
> +                                            MSG_PEEK | MSG_TRUNC);
> +                       if (recv_bytes < 0) {
> +                               rte_errno = errno;
> +                               ret = -rte_errno;
> +                               goto exit;
> +                       }
> +                       if (recv_bytes == 0) {
> +                               rte_errno = ENODATA;
> +                               ret = -rte_errno;
> +                               goto exit;
> +                       }
> +                       /* Allocate buffer to fetch the message. */
> +                       if (recv_bytes < MLX5_RECV_BUF_SIZE)
> +                               recv_bytes = MLX5_RECV_BUF_SIZE;
> +                       mlx5_free(buf);
> +                       buf = mlx5_malloc(0, recv_bytes, 0, SOCKET_ID_ANY);
> +                       if (!buf) {
> +                               rte_errno = ENOMEM;
> +                               ret = -rte_errno;
> +                               goto exit;
> +                       }
> +                       /* Fetch the message. */
> +                       iov.iov_base = buf;
> +                       iov.iov_len = recv_bytes;
>                         recv_bytes = recvmsg(nlsk_fd, &msg, 0);
>                         if (recv_bytes == -1) {
>                                 rte_errno = errno;
> --
> 2.32.0
>
> ---
>   Diff of the applied patch vs upstream commit (please double-check if non-empty:
> ---
> --- -   2021-08-10 15:11:15.121954386 +0200
> +++ 0054-common-mlx5-fix-Netlink-receive-message-buffer-size.patch      2021-08-10 15:11:13.038638243 +0200
> @@ -1 +1 @@
> -From 32d1e4dbadba4bc3523d8b354458a4b979e5c2e6 Mon Sep 17 00:00:00 2001
> +From 6af6af1640a7cd555e22dea6f12f497b82bb0761 Mon Sep 17 00:00:00 2001
> @@ -5,0 +6,2 @@
> +[ upstream commit 32d1e4dbadba4bc3523d8b354458a4b979e5c2e6 ]
> +
> @@ -12 +13,0 @@
> -Cc: stable@dpdk.org
> @@ -16 +17 @@
> - drivers/common/mlx5/linux/mlx5_nl.c | 69 +++++++++++++++++++++++------
> + drivers/net/mlx5/mlx5_nl.c | 69 ++++++++++++++++++++++++++++++--------
> @@ -19,5 +20,5 @@
> -diff --git a/drivers/common/mlx5/linux/mlx5_nl.c b/drivers/common/mlx5/linux/mlx5_nl.c
> -index 3f1912d078..dc8dafd0a8 100644
> ---- a/drivers/common/mlx5/linux/mlx5_nl.c
> -+++ b/drivers/common/mlx5/linux/mlx5_nl.c
> -@@ -189,8 +189,8 @@ int
> +diff --git a/drivers/net/mlx5/mlx5_nl.c b/drivers/net/mlx5/mlx5_nl.c
> +index 668affb0b1..8d5478d9f5 100644
> +--- a/drivers/net/mlx5/mlx5_nl.c
> ++++ b/drivers/net/mlx5/mlx5_nl.c
> +@@ -128,8 +128,8 @@ int
> @@ -34 +35 @@
> -@@ -201,16 +201,36 @@ mlx5_nl_init(int protocol)
> +@@ -140,16 +140,36 @@ mlx5_nl_init(int protocol)
> @@ -73 +74 @@
> -@@ -332,11 +352,7 @@ mlx5_nl_recv(int nlsk_fd, uint32_t sn, int (*cb)(struct nlmsghdr *, void *arg),
> +@@ -271,11 +291,7 @@ mlx5_nl_recv(int nlsk_fd, uint32_t sn, int (*cb)(struct nlmsghdr *, void *arg),
> @@ -77 +78 @@
> --      void *buf = mlx5_malloc(0, MLX5_RECV_BUF_SIZE, 0, SOCKET_ID_ANY);
> +-      void *buf = malloc(MLX5_RECV_BUF_SIZE);
> @@ -86 +87 @@
> -@@ -344,18 +360,43 @@ mlx5_nl_recv(int nlsk_fd, uint32_t sn, int (*cb)(struct nlmsghdr *, void *arg),
> +@@ -283,18 +299,43 @@ mlx5_nl_recv(int nlsk_fd, uint32_t sn, int (*cb)(struct nlmsghdr *, void *arg),



-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd

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

* Re: [dpdk-stable] patch 'test/power: fix CPU frequency check for intel_pstate' has been queued to stable release 19.11.10
  2021-08-10 15:39 ` [dpdk-stable] patch 'test/power: fix CPU frequency check for intel_pstate' " christian.ehrhardt
@ 2021-08-11  9:51   ` Christian Ehrhardt
  0 siblings, 0 replies; 114+ messages in thread
From: Christian Ehrhardt @ 2021-08-11  9:51 UTC (permalink / raw)
  To: Richael Zhuang; +Cc: David Hunt, dpdk stable

On Tue, Aug 10, 2021 at 5:44 PM <christian.ehrhardt@canonical.com> wrote:
>
> Hi,
>
> FYI, your patch has been queued to stable release 19.11.10

Hi,
while applying cleanly your patch caused build time failures like:

../app/test/test_power_cpufreq.c: In function ‘check_cur_freq’:
../app/test/test_power_cpufreq.c:88:14: error: ‘PM_ENV_CPPC_CPUFREQ’
undeclared (first use in this function); did you mean
‘PM_ENV_ACPI_CPUFREQ’?
   88 |   if (env == PM_ENV_CPPC_CPUFREQ || env == PM_ENV_PSTATE_CPUFREQ) {
      |              ^~~~~~~~~~~~~~~~~~~
      |              PM_ENV_ACPI_CPUFREQ

Therefore the patch will be de-qeueud from the stable branch that shall become
19.11.10.
Please consider having a look and providing a backport.

A backport should contain a reference to the DPDK main branch commit
in it's commit message in the following fashion:
    [ upstream commit <commit's dpdk main branch SHA-1 checksum> ]

For example:
    https://git.dpdk.org/dpdk-stable/commit/?h=18.11&id=d90e6ae6f936ecdc2fd3811ff9f26aec7f3c06eb

When sending the backported patch, please indicate the target branch in the
subject line, as we have multiple branches, for example:
    [PATCH 19.11] foo/bar: fix baz

With git format-patch, this can be achieved by appending the parameter:
    --subject-prefix='PATCH 19.11'

Send the backported patch to "stable@dpdk.org" but not "dev@dpdk.org".

FYI, branch 19.11 is located at tree:
   https://git.dpdk.org/dpdk-stable

Thanks in advance,
Chrtistian

> Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
> It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue
>
> This queued commit can be viewed at:
> https://github.com/cpaelzer/dpdk-stable-queue/commit/ed9be54294b454945f73d70ba5989bd5cd1e7bcb
>
> Thanks.
>
> Christian Ehrhardt <christian.ehrhardt@canonical.com>
>
> ---
> From ed9be54294b454945f73d70ba5989bd5cd1e7bcb Mon Sep 17 00:00:00 2001
> From: Richael Zhuang <richael.zhuang@arm.com>
> Date: Wed, 14 Jul 2021 18:44:05 +0800
> Subject: [PATCH] test/power: fix CPU frequency check for intel_pstate
>
> [ upstream commit cf1e803508009917f41dd5bb347e4140043afe03 ]
>
> For acpi_cpufreq and cppc_cpufreq, both cpuinfo_cur_freq and
> scaling_cur_freq exist. For pstate, only scaling_cur_freq exists.
> And value in scaling_cur_freq and cpuinfo_cur_freq may not be the
> same. For acpi_cpufreq and cppc_cpufreq, we should check
> cpuinfo_cur_freq but not scaling_cur_freq. So here change the
> check sequence to make sure it works for all cpufreq drivers.
> Besides, add rounding for pstate driver.
>
> Fixes: ff6dfb8e492f ("test/power: fix CPU frequency check")
>
> Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
> Acked-by: David Hunt <david.hunt@intel.com>
> ---
>  app/test/test_power_cpufreq.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/app/test/test_power_cpufreq.c b/app/test/test_power_cpufreq.c
> index e5bf3b3367..c0e0431c5f 100644
> --- a/app/test/test_power_cpufreq.c
> +++ b/app/test/test_power_cpufreq.c
> @@ -62,13 +62,13 @@ check_cur_freq(unsigned int lcore_id, uint32_t idx, bool turbo)
>         int i;
>
>         if (snprintf(fullpath, sizeof(fullpath),
> -               TEST_POWER_SYSFILE_SCALING_FREQ, lcore_id) < 0) {
> +               TEST_POWER_SYSFILE_CPUINFO_FREQ, lcore_id) < 0) {
>                 return 0;
>         }
>         f = fopen(fullpath, "r");
>         if (f == NULL) {
>                 if (snprintf(fullpath, sizeof(fullpath),
> -                       TEST_POWER_SYSFILE_CPUINFO_FREQ, lcore_id) < 0) {
> +                       TEST_POWER_SYSFILE_SCALING_FREQ, lcore_id) < 0) {
>                         return 0;
>                 }
>                 f = fopen(fullpath, "r");
> @@ -85,7 +85,7 @@ check_cur_freq(unsigned int lcore_id, uint32_t idx, bool turbo)
>                 freq_conv = cur_freq;
>
>                 env = rte_power_get_env();
> -               if (env == PM_ENV_CPPC_CPUFREQ) {
> +               if (env == PM_ENV_CPPC_CPUFREQ || env == PM_ENV_PSTATE_CPUFREQ) {
>                         /* convert the frequency to nearest 100000 value
>                          * Ex: if cur_freq=1396789 then freq_conv=1400000
>                          * Ex: if cur_freq=800030 then freq_conv=800000
> --
> 2.32.0
>
> ---
>   Diff of the applied patch vs upstream commit (please double-check if non-empty:
> ---
> --- -   2021-08-10 15:11:15.838864480 +0200
> +++ 0073-test-power-fix-CPU-frequency-check-for-intel_pstate.patch      2021-08-10 15:11:13.078638532 +0200
> @@ -1 +1 @@
> -From cf1e803508009917f41dd5bb347e4140043afe03 Mon Sep 17 00:00:00 2001
> +From ed9be54294b454945f73d70ba5989bd5cd1e7bcb Mon Sep 17 00:00:00 2001
> @@ -5,0 +6,2 @@
> +[ upstream commit cf1e803508009917f41dd5bb347e4140043afe03 ]
> +
> @@ -15 +16,0 @@
> -Cc: stable@dpdk.org
> @@ -24 +25 @@
> -index b8fc53925c..1a9549527e 100644
> +index e5bf3b3367..c0e0431c5f 100644



-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd

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

* Re: [dpdk-stable] patch 'test/power: fix CPU frequency when turbo enabled' has been queued to stable release 19.11.10
  2021-08-10 15:39 ` [dpdk-stable] patch 'test/power: fix CPU frequency when turbo enabled' " christian.ehrhardt
@ 2021-08-11  9:59   ` Christian Ehrhardt
  0 siblings, 0 replies; 114+ messages in thread
From: Christian Ehrhardt @ 2021-08-11  9:59 UTC (permalink / raw)
  To: Richael Zhuang; +Cc: David Hunt, dpdk stable

On Tue, Aug 10, 2021 at 5:43 PM <christian.ehrhardt@canonical.com> wrote:
>
> Hi,
>
> FYI, your patch has been queued to stable release 19.11.10

Hi,
I've rejected your other patch based on this already a few minutes ago
earlier, but this one is the actual one adding PM_ENV_CPPC_CPUFREQ in
a place it isn't available yet.

While applying cleanly your patch caused build time failures like:

../app/test/test_power_cpufreq.c: In function ‘check_cur_freq’:
../app/test/test_power_cpufreq.c:88:14: error: ‘PM_ENV_CPPC_CPUFREQ’
undeclared (first use in this function); did you mean
‘PM_ENV_ACPI_CPUFREQ’?
   88 |   if (env == PM_ENV_CPPC_CPUFREQ) {
      |              ^~~~~~~~~~~~~~~~~~~
      |              PM_ENV_ACPI_CPUFREQ

Therefore the patch will be de-qeueud from the stable branch that shall become
19.11.10.
Please consider having a look and providing a backport.

A backport should contain a reference to the DPDK main branch commit
in it's commit message in the following fashion:
    [ upstream commit <commit's dpdk main branch SHA-1 checksum> ]

For example:
    https://git.dpdk.org/dpdk-stable/commit/?h=18.11&id=d90e6ae6f936ecdc2fd3811ff9f26aec7f3c06eb

When sending the backported patch, please indicate the target branch in the
subject line, as we have multiple branches, for example:
    [PATCH 19.11] foo/bar: fix baz

With git format-patch, this can be achieved by appending the parameter:
    --subject-prefix='PATCH 19.11'

Send the backported patch to "stable@dpdk.org" but not "dev@dpdk.org".

FYI, branch 19.11 is located at tree:
   https://git.dpdk.org/dpdk-stable

Thanks in advance,
Chrtistian

> Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
> It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue
>
> This queued commit can be viewed at:
> https://github.com/cpaelzer/dpdk-stable-queue/commit/4da3e8a9f04a9c2f820b8270b25b09cca79ed739
>
> Thanks.
>
> Christian Ehrhardt <christian.ehrhardt@canonical.com>
>
> ---
> From 4da3e8a9f04a9c2f820b8270b25b09cca79ed739 Mon Sep 17 00:00:00 2001
> From: Richael Zhuang <richael.zhuang@arm.com>
> Date: Fri, 9 Jul 2021 18:55:48 +0800
> Subject: [PATCH] test/power: fix CPU frequency when turbo enabled
>
> [ upstream commit 29343b9030e38e8c3519ba01cb66724d45b13dc8 ]
>
> On arm platform, the value in "/sys/.../cpuinfo_cur_freq" may not
> be exactly the same as what was set when using CPPC cpufreq driver.
> For other cpufreq driver, no need to round it currently, or else
> this check will fail with turbo enabled. For example, with acpi_cpufreq,
> cpuinfo_cur_freq can be 2401000 which is equal to freqs[0].It should
> not be rounded to 2400000.
>
> Fixes: 606a234c6d360 ("test/power: round CPU frequency to check")
>
> Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
> Acked-by: David Hunt <david.hunt@intel.com>
> ---
>  app/test/test_power_cpufreq.c | 23 ++++++++++++++---------
>  1 file changed, 14 insertions(+), 9 deletions(-)
>
> diff --git a/app/test/test_power_cpufreq.c b/app/test/test_power_cpufreq.c
> index d0c7e60ca5..e5bf3b3367 100644
> --- a/app/test/test_power_cpufreq.c
> +++ b/app/test/test_power_cpufreq.c
> @@ -55,7 +55,9 @@ check_cur_freq(unsigned int lcore_id, uint32_t idx, bool turbo)
>         FILE *f;
>         char fullpath[PATH_MAX];
>         char buf[BUFSIZ];
> +       enum power_management_env env;
>         uint32_t cur_freq;
> +       uint32_t freq_conv;
>         int ret = -1;
>         int i;
>
> @@ -80,15 +82,18 @@ check_cur_freq(unsigned int lcore_id, uint32_t idx, bool turbo)
>                         goto fail_all;
>
>                 cur_freq = strtoul(buf, NULL, TEST_POWER_CONVERT_TO_DECIMAL);
> -
> -               /* convert the frequency to nearest 100000 value
> -                * Ex: if cur_freq=1396789 then freq_conv=1400000
> -                * Ex: if cur_freq=800030 then freq_conv=800000
> -                */
> -               unsigned int freq_conv = 0;
> -               freq_conv = (cur_freq + TEST_FREQ_ROUNDING_DELTA)
> -                                       / TEST_ROUND_FREQ_TO_N_100000;
> -               freq_conv = freq_conv * TEST_ROUND_FREQ_TO_N_100000;
> +               freq_conv = cur_freq;
> +
> +               env = rte_power_get_env();
> +               if (env == PM_ENV_CPPC_CPUFREQ) {
> +                       /* convert the frequency to nearest 100000 value
> +                        * Ex: if cur_freq=1396789 then freq_conv=1400000
> +                        * Ex: if cur_freq=800030 then freq_conv=800000
> +                        */
> +                       freq_conv = (cur_freq + TEST_FREQ_ROUNDING_DELTA)
> +                                               / TEST_ROUND_FREQ_TO_N_100000;
> +                       freq_conv = freq_conv * TEST_ROUND_FREQ_TO_N_100000;
> +               }
>
>                 if (turbo)
>                         ret = (freqs[idx] <= freq_conv ? 0 : -1);
> --
> 2.32.0
>
> ---
>   Diff of the applied patch vs upstream commit (please double-check if non-empty:
> ---
> --- -   2021-08-10 15:11:15.364486251 +0200
> +++ 0060-test-power-fix-CPU-frequency-when-turbo-enabled.patch  2021-08-10 15:11:13.054638359 +0200
> @@ -1 +1 @@
> -From 29343b9030e38e8c3519ba01cb66724d45b13dc8 Mon Sep 17 00:00:00 2001
> +From 4da3e8a9f04a9c2f820b8270b25b09cca79ed739 Mon Sep 17 00:00:00 2001
> @@ -5,0 +6,2 @@
> +[ upstream commit 29343b9030e38e8c3519ba01cb66724d45b13dc8 ]
> +
> @@ -14 +15,0 @@
> -Cc: stable@dpdk.org
> @@ -23 +24 @@
> -index 8516df4ca6..b8fc53925c 100644
> +index d0c7e60ca5..e5bf3b3367 100644



-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd

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

* Re: [dpdk-stable] patch 'net/softnic: fix memory leak in arguments parsing' has been queued to stable release 19.11.10
  2021-08-10 15:39 ` [dpdk-stable] patch 'net/softnic: fix memory leak in arguments parsing' " christian.ehrhardt
@ 2021-08-11 10:19   ` Christian Ehrhardt
  0 siblings, 0 replies; 114+ messages in thread
From: Christian Ehrhardt @ 2021-08-11 10:19 UTC (permalink / raw)
  To: Dapeng Yu; +Cc: Jasvinder Singh, dpdk stable

On Tue, Aug 10, 2021 at 5:44 PM <christian.ehrhardt@canonical.com> wrote:
>
> Hi,
>
> FYI, your patch has been queued to stable release 19.11.10
>

Hi,
while applying cleanly your patch caused build time failures like:

[  262s]   if (rte_strscpy(p->firmware, SOFTNIC_FIRMWARE,
[  262s]   ^
[  262s] /home/abuild/rpmbuild/BUILD/dpdk-1628675870.0ca0a4945/drivers/net/softnic/rte_eth_softnic.c:451:2:
error: nested extern declaration of 'rte_strscpy'
[-Werror=nested-externs]
[  262s] /home/abuild/rpmbuild/BUILD/dpdk-1628675870.0ca0a4945/drivers/net/softnic/rte_eth_softnic.c:
At top level:
[  262s] cc1: error: unrecognized command line option
"-Wno-address-of-packed-member" [-Werror]

Therefore the patch will be de-qeueud from the stable branch that shall become
19.11.10.
Please consider having a look and providing a backport.

A backport should contain a reference to the DPDK main branch commit
in it's commit message in the following fashion:
    [ upstream commit <commit's dpdk main branch SHA-1 checksum> ]

For example:
    https://git.dpdk.org/dpdk-stable/commit/?h=18.11&id=d90e6ae6f936ecdc2fd3811ff9f26aec7f3c06eb

When sending the backported patch, please indicate the target branch in the
subject line, as we have multiple branches, for example:
    [PATCH 19.11] foo/bar: fix baz

With git format-patch, this can be achieved by appending the parameter:
    --subject-prefix='PATCH 19.11'

Send the backported patch to "stable@dpdk.org" but not "dev@dpdk.org".

FYI, branch 19.11 is located at tree:
   https://git.dpdk.org/dpdk-stable

Thanks in advance,
Chrtistian


> Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
> It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue
>
> This queued commit can be viewed at:
> https://github.com/cpaelzer/dpdk-stable-queue/commit/d313979fd603c8c588822a675b328fd000e17734
>
> Thanks.
>
> Christian Ehrhardt <christian.ehrhardt@canonical.com>
>
> ---
> From d313979fd603c8c588822a675b328fd000e17734 Mon Sep 17 00:00:00 2001
> From: Dapeng Yu <dapengx.yu@intel.com>
> Date: Thu, 15 Jul 2021 13:38:14 +0800
> Subject: [PATCH] net/softnic: fix memory leak in arguments parsing
>
> [ upstream commit d8f852f5f3692bbf15743d1aca25e6abcbe652ad ]
>
> In function pmd_parse_args(), firmware path is duplicated from device
> arguments as character string, but is never freed, which cause memory
> leak.
>
> This patch changes the type of firmware member of struct pmd_params to
> character array, to make memory resource release unnecessary, and
> changes the type of name member to character array, to keep the
> consistency of character string handling in struct pmd_params.
>
> Fixes: 7e68bc20f8c8 ("net/softnic: restructure")
>
> Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
> Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
> ---
>  drivers/net/softnic/rte_eth_softnic.c         | 30 ++++++++++++++++---
>  .../net/softnic/rte_eth_softnic_internals.h   |  5 ++--
>  2 files changed, 29 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c
> index 11723778fd..f4858255ce 100644
> --- a/drivers/net/softnic/rte_eth_softnic.c
> +++ b/drivers/net/softnic/rte_eth_softnic.c
> @@ -440,6 +440,7 @@ pmd_parse_args(struct pmd_params *p, const char *params)
>  {
>         struct rte_kvargs *kvlist;
>         int ret = 0;
> +       char *firmware = NULL;
>
>         kvlist = rte_kvargs_parse(params, pmd_valid_args);
>         if (kvlist == NULL)
> @@ -447,7 +448,14 @@ pmd_parse_args(struct pmd_params *p, const char *params)
>
>         /* Set default values */
>         memset(p, 0, sizeof(*p));
> -       p->firmware = SOFTNIC_FIRMWARE;
> +       if (rte_strscpy(p->firmware, SOFTNIC_FIRMWARE,
> +                       sizeof(p->firmware)) < 0) {
> +               PMD_LOG(WARNING,
> +                       "\"%s\": firmware path should be shorter than %zu",
> +                       SOFTNIC_FIRMWARE, sizeof(p->firmware));
> +               ret = -EINVAL;
> +               goto out_free;
> +       }
>         p->cpu_id = SOFTNIC_CPU_ID;
>         p->sc = SOFTNIC_SC;
>         p->tm.n_queues = SOFTNIC_TM_N_QUEUES;
> @@ -468,11 +476,20 @@ pmd_parse_args(struct pmd_params *p, const char *params)
>         /* Firmware script (optional) */
>         if (rte_kvargs_count(kvlist, PMD_PARAM_FIRMWARE) == 1) {
>                 ret = rte_kvargs_process(kvlist, PMD_PARAM_FIRMWARE,
> -                       &get_string, &p->firmware);
> +                       &get_string, &firmware);
>                 if (ret < 0)
>                         goto out_free;
>         }
> -
> +       if (rte_strscpy(p->firmware, firmware,
> +                       sizeof(p->firmware)) < 0) {
> +               PMD_LOG(WARNING,
> +                       "\"%s\": firmware path should be shorter than %zu",
> +                       firmware, sizeof(p->firmware));
> +               free(firmware);
> +               ret = -EINVAL;
> +               goto out_free;
> +       }
> +       free(firmware);
>         /* Connection listening port (optional) */
>         if (rte_kvargs_count(kvlist, PMD_PARAM_CONN_PORT) == 1) {
>                 ret = rte_kvargs_process(kvlist, PMD_PARAM_CONN_PORT,
> @@ -621,7 +638,12 @@ pmd_probe(struct rte_vdev_device *vdev)
>         if (status)
>                 return status;
>
> -       p.name = name;
> +       if (rte_strscpy(p.name, name, sizeof(p.name)) < 0) {
> +               PMD_LOG(WARNING,
> +                       "\"%s\": device name should be shorter than %zu",
> +                       name, sizeof(p.name));
> +               return -EINVAL;
> +       }
>
>         /* Allocate and initialize soft ethdev private data */
>         dev_private = pmd_init(&p);
> diff --git a/drivers/net/softnic/rte_eth_softnic_internals.h b/drivers/net/softnic/rte_eth_softnic_internals.h
> index 6eec43b22b..f8549b2174 100644
> --- a/drivers/net/softnic/rte_eth_softnic_internals.h
> +++ b/drivers/net/softnic/rte_eth_softnic_internals.h
> @@ -28,14 +28,15 @@
>  #include "conn.h"
>
>  #define NAME_SIZE                                            64
> +#define SOFTNIC_PATH_MAX                                     4096
>
>  /**
>   * PMD Parameters
>   */
>
>  struct pmd_params {
> -       const char *name;
> -       const char *firmware;
> +       char name[NAME_SIZE];
> +       char firmware[SOFTNIC_PATH_MAX];
>         uint16_t conn_port;
>         uint32_t cpu_id;
>         int sc; /**< Service cores. */
> --
> 2.32.0
>
> ---
>   Diff of the applied patch vs upstream commit (please double-check if non-empty:
> ---
> --- -   2021-08-10 15:11:16.063474888 +0200
> +++ 0079-net-softnic-fix-memory-leak-in-arguments-parsing.patch 2021-08-10 15:11:13.090638619 +0200
> @@ -1 +1 @@
> -From d8f852f5f3692bbf15743d1aca25e6abcbe652ad Mon Sep 17 00:00:00 2001
> +From d313979fd603c8c588822a675b328fd000e17734 Mon Sep 17 00:00:00 2001
> @@ -5,0 +6,2 @@
> +[ upstream commit d8f852f5f3692bbf15743d1aca25e6abcbe652ad ]
> +
> @@ -16 +17,0 @@
> -Cc: stable@dpdk.org
> @@ -26 +27 @@
> -index f64023256d..0aa7147b13 100644
> +index 11723778fd..f4858255ce 100644
> @@ -91 +92 @@
> -index 1b3186ef0b..07285ca315 100644
> +index 6eec43b22b..f8549b2174 100644



-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd

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

* Re: [dpdk-stable] patch 'net/softnic: fix null dereference in arguments parsing' has been queued to stable release 19.11.10
  2021-08-10 15:40 ` [dpdk-stable] patch 'net/softnic: fix null dereference in arguments parsing' " christian.ehrhardt
@ 2021-08-11 10:21   ` Christian Ehrhardt
  0 siblings, 0 replies; 114+ messages in thread
From: Christian Ehrhardt @ 2021-08-11 10:21 UTC (permalink / raw)
  To: Dapeng Yu; +Cc: Jasvinder Singh, dpdk stable

On Tue, Aug 10, 2021 at 5:45 PM <christian.ehrhardt@canonical.com> wrote:
>
> Hi,
>
> FYI, your patch has been queued to stable release 19.11.10

Hi,
I had to reject your other fix "net/softnic: fix memory leak in
arguments parsing" which invalidates
this patch as well. If you look at backports I'd ask you to have a
look at backporting the couple.
For now this patch has also been de-queued.

> Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
> It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue
>
> This queued commit can be viewed at:
> https://github.com/cpaelzer/dpdk-stable-queue/commit/0eaed422260125d4d542168630bffe74b2462d5e
>
> Thanks.
>
> Christian Ehrhardt <christian.ehrhardt@canonical.com>
>
> ---
> From 0eaed422260125d4d542168630bffe74b2462d5e Mon Sep 17 00:00:00 2001
> From: Dapeng Yu <dapengx.yu@intel.com>
> Date: Tue, 27 Jul 2021 16:14:59 +0800
> Subject: [PATCH] net/softnic: fix null dereference in arguments parsing
>
> [ upstream commit 51799b4f971982bc0757cf8a11940eb538b1af57 ]
>
> When there is no "firmware" in arguments, the "firmware" pointer is
> null, and will be dereferenced by rte_strscpy().
>
> This patch moves the code block which copies character string from
> "firmware" to "p->firmware" into the "if" statements where "firmware"
> argument exists and it is duplicated successfully.
>
> Coverity issue: 372136
> Fixes: d8f852f5f369 ("net/softnic: fix memory leak in arguments parsing")
>
> Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
> Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
> ---
>  drivers/net/softnic/rte_eth_softnic.c | 20 +++++++++++---------
>  1 file changed, 11 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c
> index f4858255ce..5a6947615a 100644
> --- a/drivers/net/softnic/rte_eth_softnic.c
> +++ b/drivers/net/softnic/rte_eth_softnic.c
> @@ -479,17 +479,19 @@ pmd_parse_args(struct pmd_params *p, const char *params)
>                         &get_string, &firmware);
>                 if (ret < 0)
>                         goto out_free;
> -       }
> -       if (rte_strscpy(p->firmware, firmware,
> -                       sizeof(p->firmware)) < 0) {
> -               PMD_LOG(WARNING,
> -                       "\"%s\": firmware path should be shorter than %zu",
> -                       firmware, sizeof(p->firmware));
> +
> +               if (rte_strscpy(p->firmware, firmware,
> +                               sizeof(p->firmware)) < 0) {
> +                       PMD_LOG(WARNING,
> +                               "\"%s\": "
> +                               "firmware path should be shorter than %zu",
> +                               firmware, sizeof(p->firmware));
> +                       free(firmware);
> +                       ret = -EINVAL;
> +                       goto out_free;
> +               }
>                 free(firmware);
> -               ret = -EINVAL;
> -               goto out_free;
>         }
> -       free(firmware);
>         /* Connection listening port (optional) */
>         if (rte_kvargs_count(kvlist, PMD_PARAM_CONN_PORT) == 1) {
>                 ret = rte_kvargs_process(kvlist, PMD_PARAM_CONN_PORT,
> --
> 2.32.0
>
> ---
>   Diff of the applied patch vs upstream commit (please double-check if non-empty:
> ---
> --- -   2021-08-10 15:11:16.702153440 +0200
> +++ 0096-net-softnic-fix-null-dereference-in-arguments-parsin.patch     2021-08-10 15:11:13.130638908 +0200
> @@ -1 +1 @@
> -From 51799b4f971982bc0757cf8a11940eb538b1af57 Mon Sep 17 00:00:00 2001
> +From 0eaed422260125d4d542168630bffe74b2462d5e Mon Sep 17 00:00:00 2001
> @@ -5,0 +6,2 @@
> +[ upstream commit 51799b4f971982bc0757cf8a11940eb538b1af57 ]
> +
> @@ -15 +16,0 @@
> -Cc: stable@dpdk.org
> @@ -24 +25 @@
> -index 0aa7147b13..b3b55b9035 100644
> +index f4858255ce..5a6947615a 100644



-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd

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

* Re: [dpdk-stable] patch 'net/mlx5: reject inner ethernet matching in GTP' has been queued to stable release 19.11.10
  2021-08-11  9:17   ` Christian Ehrhardt
@ 2021-08-11 10:25     ` Lior Margalit
  2021-08-11 11:23       ` Christian Ehrhardt
  0 siblings, 1 reply; 114+ messages in thread
From: Lior Margalit @ 2021-08-11 10:25 UTC (permalink / raw)
  To: Christian Ehrhardt; +Cc: Matan Azrad, dpdk stable

Hi Chrtistian,

This patch is not relevant for 19.11

Thank you,
Lior

-----Original Message-----
From: Christian Ehrhardt <christian.ehrhardt@canonical.com> 
Sent: Wednesday, August 11, 2021 12:18 PM
To: Lior Margalit <lmargalit@nvidia.com>
Cc: Matan Azrad <matan@nvidia.com>; dpdk stable <stable@dpdk.org>
Subject: Re: patch 'net/mlx5: reject inner ethernet matching in GTP' has been queued to stable release 19.11.10

External email: Use caution opening links or attachments


On Tue, Aug 10, 2021 at 5:44 PM <christian.ehrhardt@canonical.com> wrote:
>
> Hi,
>
> FYI, your patch has been queued to stable release 19.11.10

Hi,
while applying cleanly your patch caused build time failures like:

../drivers/net/mlx5/mlx5_flow.c: In function ‘mlx5_flow_validate_item_eth’:
../drivers/net/mlx5/mlx5_flow.c:1444:19: error: ‘MLX5_FLOW_LAYER_GTP’
undeclared (first use in this function); did you mean ‘MLX5_FLOW_LAYER_GRE’?
 1444 |  if (item_flags & MLX5_FLOW_LAYER_GTP)
      |                   ^~~~~~~~~~~~~~~~~~~
      |                   MLX5_FLOW_LAYER_GRE

Therefore the patch will be de-qeueud from the stable branch that shall become 19.11.10.
Please consider having a look and providing a backport.

A backport should contain a reference to the DPDK main branch commit in it's commit message in the following fashion:
    [ upstream commit <commit's dpdk main branch SHA-1 checksum> ]

For example:
    https://git.dpdk.org/dpdk-stable/commit/?h=18.11&id=d90e6ae6f936ecdc2fd3811ff9f26aec7f3c06eb

When sending the backported patch, please indicate the target branch in the subject line, as we have multiple branches, for example:
    [PATCH 19.11] foo/bar: fix baz

With git format-patch, this can be achieved by appending the parameter:
    --subject-prefix='PATCH 19.11'

Send the backported patch to "stable@dpdk.org" but not "dev@dpdk.org".

FYI, branch 19.11 is located at tree:
   https://git.dpdk.org/dpdk-stable

Thanks in advance,
Chrtistian

> Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
> It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue
>
> This queued commit can be viewed at:
> https://github.com/cpaelzer/dpdk-stable-queue/commit/72c1cc5d90154b1f8
> a8fc0b94f097c41cdb27b24
>
> Thanks.
>
> Christian Ehrhardt <christian.ehrhardt@canonical.com>
>
> ---
> From 72c1cc5d90154b1f8a8fc0b94f097c41cdb27b24 Mon Sep 17 00:00:00 2001
> From: Lior Margalit <lmargalit@nvidia.com>
> Date: Tue, 20 Jul 2021 18:17:18 +0300
> Subject: [PATCH] net/mlx5: reject inner ethernet matching in GTP
>
> [ upstream commit 4e5ba38d56e3a037271547c90fbfc25c81938a4f ]
>
> The user is able to create a flow rule pattern with ETH after GTP 
> although it is not supported by the flex-parser configuration.
>
> Failed the rule validation in such case with proper error message.
>
> Fixes: 23c1d42c7138 ("net/mlx5: split flow validation to dedicated 
> function")
>
> Signed-off-by: Lior Margalit <lmargalit@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>
> ---
>  drivers/net/mlx5/mlx5_flow.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/net/mlx5/mlx5_flow.c 
> b/drivers/net/mlx5/mlx5_flow.c index 65064ffb07..cb08e5ec35 100644
> --- a/drivers/net/mlx5/mlx5_flow.c
> +++ b/drivers/net/mlx5/mlx5_flow.c
> @@ -1441,6 +1441,10 @@ mlx5_flow_validate_item_eth(const struct rte_flow_item *item,
>                 return rte_flow_error_set(error, EINVAL,
>                                           RTE_FLOW_ERROR_TYPE_ITEM, item,
>                                           "L2 layer should not follow 
> VLAN");
> +       if (item_flags & MLX5_FLOW_LAYER_GTP)
> +               return rte_flow_error_set(error, EINVAL,
> +                                         RTE_FLOW_ERROR_TYPE_ITEM, item,
> +                                         "L2 layer should not follow 
> + GTP");
>         if (!mask)
>                 mask = &rte_flow_item_eth_mask;
>         ret = mlx5_flow_item_acceptable(item, (const uint8_t *)mask,
> --
> 2.32.0
>
> ---
>   Diff of the applied patch vs upstream commit (please double-check if non-empty:
> ---
> --- -   2021-08-10 15:11:15.983836535 +0200
> +++ 0077-net-mlx5-reject-inner-ethernet-matching-in-GTP.patch   2021-08-10 15:11:13.090638619 +0200
> @@ -1 +1 @@
> -From 4e5ba38d56e3a037271547c90fbfc25c81938a4f Mon Sep 17 00:00:00 
> 2001
> +From 72c1cc5d90154b1f8a8fc0b94f097c41cdb27b24 Mon Sep 17 00:00:00 
> +2001
> @@ -5,0 +6,2 @@
> +[ upstream commit 4e5ba38d56e3a037271547c90fbfc25c81938a4f ]
> +
> @@ -12 +13,0 @@
> -Cc: stable@dpdk.org
> @@ -21 +22 @@
> -index 2059f29b23..a3fdce685e 100644
> +index 65064ffb07..cb08e5ec35 100644
> @@ -24 +25 @@
> -@@ -1999,6 +1999,10 @@ mlx5_flow_validate_item_eth(const struct 
> rte_flow_item *item,
> +@@ -1441,6 +1441,10 @@ mlx5_flow_validate_item_eth(const struct 
> +rte_flow_item *item,



--
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd

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

* Re: [dpdk-stable] patch 'net/mlx5: reject inner ethernet matching in GTP' has been queued to stable release 19.11.10
  2021-08-11 10:25     ` Lior Margalit
@ 2021-08-11 11:23       ` Christian Ehrhardt
  0 siblings, 0 replies; 114+ messages in thread
From: Christian Ehrhardt @ 2021-08-11 11:23 UTC (permalink / raw)
  To: Lior Margalit; +Cc: Matan Azrad, dpdk stable

On Wed, Aug 11, 2021 at 12:25 PM Lior Margalit <lmargalit@nvidia.com> wrote:
>
> Hi Chrtistian,
>
> This patch is not relevant for 19.11

Thanks for letting me know!

> Thank you,
> Lior
>
> -----Original Message-----
> From: Christian Ehrhardt <christian.ehrhardt@canonical.com>
> Sent: Wednesday, August 11, 2021 12:18 PM
> To: Lior Margalit <lmargalit@nvidia.com>
> Cc: Matan Azrad <matan@nvidia.com>; dpdk stable <stable@dpdk.org>
> Subject: Re: patch 'net/mlx5: reject inner ethernet matching in GTP' has been queued to stable release 19.11.10
>
> External email: Use caution opening links or attachments
>
>
> On Tue, Aug 10, 2021 at 5:44 PM <christian.ehrhardt@canonical.com> wrote:
> >
> > Hi,
> >
> > FYI, your patch has been queued to stable release 19.11.10
>
> Hi,
> while applying cleanly your patch caused build time failures like:
>
> ../drivers/net/mlx5/mlx5_flow.c: In function ‘mlx5_flow_validate_item_eth’:
> ../drivers/net/mlx5/mlx5_flow.c:1444:19: error: ‘MLX5_FLOW_LAYER_GTP’
> undeclared (first use in this function); did you mean ‘MLX5_FLOW_LAYER_GRE’?
>  1444 |  if (item_flags & MLX5_FLOW_LAYER_GTP)
>       |                   ^~~~~~~~~~~~~~~~~~~
>       |                   MLX5_FLOW_LAYER_GRE
>
> Therefore the patch will be de-qeueud from the stable branch that shall become 19.11.10.
> Please consider having a look and providing a backport.
>
> A backport should contain a reference to the DPDK main branch commit in it's commit message in the following fashion:
>     [ upstream commit <commit's dpdk main branch SHA-1 checksum> ]
>
> For example:
>     https://git.dpdk.org/dpdk-stable/commit/?h=18.11&id=d90e6ae6f936ecdc2fd3811ff9f26aec7f3c06eb
>
> When sending the backported patch, please indicate the target branch in the subject line, as we have multiple branches, for example:
>     [PATCH 19.11] foo/bar: fix baz
>
> With git format-patch, this can be achieved by appending the parameter:
>     --subject-prefix='PATCH 19.11'
>
> Send the backported patch to "stable@dpdk.org" but not "dev@dpdk.org".
>
> FYI, branch 19.11 is located at tree:
>    https://git.dpdk.org/dpdk-stable
>
> Thanks in advance,
> Chrtistian
>
> > Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
> > It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue
> >
> > This queued commit can be viewed at:
> > https://github.com/cpaelzer/dpdk-stable-queue/commit/72c1cc5d90154b1f8
> > a8fc0b94f097c41cdb27b24
> >
> > Thanks.
> >
> > Christian Ehrhardt <christian.ehrhardt@canonical.com>
> >
> > ---
> > From 72c1cc5d90154b1f8a8fc0b94f097c41cdb27b24 Mon Sep 17 00:00:00 2001
> > From: Lior Margalit <lmargalit@nvidia.com>
> > Date: Tue, 20 Jul 2021 18:17:18 +0300
> > Subject: [PATCH] net/mlx5: reject inner ethernet matching in GTP
> >
> > [ upstream commit 4e5ba38d56e3a037271547c90fbfc25c81938a4f ]
> >
> > The user is able to create a flow rule pattern with ETH after GTP
> > although it is not supported by the flex-parser configuration.
> >
> > Failed the rule validation in such case with proper error message.
> >
> > Fixes: 23c1d42c7138 ("net/mlx5: split flow validation to dedicated
> > function")
> >
> > Signed-off-by: Lior Margalit <lmargalit@nvidia.com>
> > Acked-by: Matan Azrad <matan@nvidia.com>
> > ---
> >  drivers/net/mlx5/mlx5_flow.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/net/mlx5/mlx5_flow.c
> > b/drivers/net/mlx5/mlx5_flow.c index 65064ffb07..cb08e5ec35 100644
> > --- a/drivers/net/mlx5/mlx5_flow.c
> > +++ b/drivers/net/mlx5/mlx5_flow.c
> > @@ -1441,6 +1441,10 @@ mlx5_flow_validate_item_eth(const struct rte_flow_item *item,
> >                 return rte_flow_error_set(error, EINVAL,
> >                                           RTE_FLOW_ERROR_TYPE_ITEM, item,
> >                                           "L2 layer should not follow
> > VLAN");
> > +       if (item_flags & MLX5_FLOW_LAYER_GTP)
> > +               return rte_flow_error_set(error, EINVAL,
> > +                                         RTE_FLOW_ERROR_TYPE_ITEM, item,
> > +                                         "L2 layer should not follow
> > + GTP");
> >         if (!mask)
> >                 mask = &rte_flow_item_eth_mask;
> >         ret = mlx5_flow_item_acceptable(item, (const uint8_t *)mask,
> > --
> > 2.32.0
> >
> > ---
> >   Diff of the applied patch vs upstream commit (please double-check if non-empty:
> > ---
> > --- -   2021-08-10 15:11:15.983836535 +0200
> > +++ 0077-net-mlx5-reject-inner-ethernet-matching-in-GTP.patch   2021-08-10 15:11:13.090638619 +0200
> > @@ -1 +1 @@
> > -From 4e5ba38d56e3a037271547c90fbfc25c81938a4f Mon Sep 17 00:00:00
> > 2001
> > +From 72c1cc5d90154b1f8a8fc0b94f097c41cdb27b24 Mon Sep 17 00:00:00
> > +2001
> > @@ -5,0 +6,2 @@
> > +[ upstream commit 4e5ba38d56e3a037271547c90fbfc25c81938a4f ]
> > +
> > @@ -12 +13,0 @@
> > -Cc: stable@dpdk.org
> > @@ -21 +22 @@
> > -index 2059f29b23..a3fdce685e 100644
> > +index 65064ffb07..cb08e5ec35 100644
> > @@ -24 +25 @@
> > -@@ -1999,6 +1999,10 @@ mlx5_flow_validate_item_eth(const struct
> > rte_flow_item *item,
> > +@@ -1441,6 +1441,10 @@ mlx5_flow_validate_item_eth(const struct
> > +rte_flow_item *item,
>
>
>
> --
> Christian Ehrhardt
> Staff Engineer, Ubuntu Server
> Canonical Ltd



-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd

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

end of thread, other threads:[~2021-08-11 11:24 UTC | newest]

Thread overview: 114+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-10 15:38 [dpdk-stable] patch 'bitmap: fix buffer overrun in bitmap init' has been queued to stable release 19.11.10 christian.ehrhardt
2021-08-10 15:38 ` [dpdk-stable] patch 'net/bnxt: check access to possible null pointer' " christian.ehrhardt
2021-08-10 15:38 ` [dpdk-stable] patch 'net/bnxt: fix error messages in VNIC prepare' " christian.ehrhardt
2021-08-10 15:38 ` [dpdk-stable] patch 'net/bnxt: set flow error when free filter not available' " christian.ehrhardt
2021-08-10 15:38 ` [dpdk-stable] patch 'net/bnxt: remove unnecessary code' " christian.ehrhardt
2021-08-10 15:38 ` [dpdk-stable] patch 'net/bnxt: fix error handling in VNIC prepare' " christian.ehrhardt
2021-08-10 15:38 ` [dpdk-stable] patch 'net/bnxt: set flow error after tunnel redirection free' " christian.ehrhardt
2021-08-10 15:38 ` [dpdk-stable] patch 'net/bnxt: use common function to free VNIC resource' " christian.ehrhardt
2021-08-10 15:38 ` [dpdk-stable] patch 'net/bnxt: fix check for PTP support in FW' " christian.ehrhardt
2021-08-10 15:38 ` [dpdk-stable] patch 'net/bnxt: improve probing log message' " christian.ehrhardt
2021-08-10 15:38 ` [dpdk-stable] patch 'net/iavf: fix RSS key access out of bound' " christian.ehrhardt
2021-08-10 15:38 ` [dpdk-stable] patch 'doc: fix default burst size in testpmd' " christian.ehrhardt
2021-08-10 15:38 ` [dpdk-stable] patch 'devtools: fix file listing in maintainers check' " christian.ehrhardt
2021-08-10 15:38 ` [dpdk-stable] patch 'vhost/crypto: check request pointer before dereference' " christian.ehrhardt
2021-08-10 15:38 ` [dpdk-stable] patch 'kni: fix mbuf allocation for kernel side use' " christian.ehrhardt
2021-08-10 15:38 ` [dpdk-stable] patch 'kni: fix crash on userspace VA for segmented packets' " christian.ehrhardt
2021-08-10 15:38 ` [dpdk-stable] patch 'flow_classify: fix leaking rules on delete' " christian.ehrhardt
2021-08-10 15:38 ` [dpdk-stable] patch 'rib: fix max depth IPv6 lookup' " christian.ehrhardt
2021-08-10 15:38 ` [dpdk-stable] patch 'tests/eal: fix memory leak' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'common/mlx5: fix Netlink port name padding in probing' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'app/test: fix IPv6 header initialization' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'test/mbuf: fix virtual address conversion' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'net/octeontx2: fix flow creation limit on CN98xx' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'net/octeontx2: use runtime LSO format indices' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'net/ice/base: fix first profile mask' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'vhost: fix missing memory table NUMA realloc' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'vhost: fix missing guest pages " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'mempool/octeontx2: fix shift calculation' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'drivers/net: fix memzone allocations for DMA memory' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'net/hns3: increase VF reset retry maximum' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'net/hns3: fix delay for waiting to stop Rx/Tx' " christian.ehrhardt
2021-08-11  9:02   ` Christian Ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'net/hns3: fix VLAN strip log' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'net/pfe: remove unnecessary null check' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'ethdev: fix doc of flow action' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'app/testpmd: change port link speed without stopping all' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'crypto/qat: fix Arm build with special memcpy' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'app/crypto-perf: fix out-of-place mempool allocation' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'test/crypto: fix mbuf reset after null check' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'test/crypto: fix typo in AES case' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'test/crypto: fix typo in ESN " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'crypto/mvsam: fix AES-GCM session parameters' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'crypto/mvsam: fix capabilities' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'crypto/mvsam: fix session data reset' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'crypto/mvsam: fix options parsing' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'ipc: stop mp control thread on cleanup' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'power: fix namespace for internal struct' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'net/bnxt: cleanup code' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'net/bnxt: fix typo in log message' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'net/bnxt: fix Tx descriptor status implementation' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'net/bnxt: fix scalar Tx completion handling' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'net/bnxt: fix Rx interrupt setting' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'doc: add limitation for ConnectX-4 with L2 in mlx5 guide' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'net/mlx5: fix match MPLS over GRE with key' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'common/mlx5: fix Netlink receive message buffer size' " christian.ehrhardt
2021-08-11  9:26   ` Christian Ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'net/mlx5: remove unsupported flow item MPLS over IP' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'net/ice: fix memzone leak when firmware is missing' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'net/i40e: fix descriptor scan on Arm' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'net/ixgbe: fix flow entry access after freeing' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'net/octeontx/base: fix debug build with clang' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'test/power: fix CPU frequency when turbo enabled' " christian.ehrhardt
2021-08-11  9:59   ` Christian Ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'net/virtio: fix aarch32 build' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'net/bonding: fix error message on flow verify' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'net/bonding: check flow setting' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'net/softnic: fix connection memory leak' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'net/mlx5: remove redundant operations in NEON Rx' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'net/mlx5: fix typo in vectorized Rx comments' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'net/mvpp2: fix port speed overflow' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'net/mvpp2: fix configured state dependency' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'net/bnxt: fix nested lock during bonding' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'net/bnxt: clear cached statistics' " christian.ehrhardt
2021-08-11  8:54   ` Christian Ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'net/ice/base: revert change of first profile mask' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'distributor: fix 128-bit write alignment' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'test/power: fix CPU frequency check for intel_pstate' " christian.ehrhardt
2021-08-11  9:51   ` Christian Ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'test/crypto: fix mempool size for session-less' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'net/mlx5: fix overflow in mempool argument' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'net/mlx5: fix Rx/Tx queue checks' " christian.ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'net/mlx5: reject inner ethernet matching in GTP' " christian.ehrhardt
2021-08-11  9:17   ` Christian Ehrhardt
2021-08-11 10:25     ` Lior Margalit
2021-08-11 11:23       ` Christian Ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'net/bnxt: fix null dereference in interrupt handler' " christian.ehrhardt
2021-08-11  8:50   ` Christian Ehrhardt
2021-08-10 15:39 ` [dpdk-stable] patch 'net/softnic: fix memory leak in arguments parsing' " christian.ehrhardt
2021-08-11 10:19   ` Christian Ehrhardt
2021-08-10 15:40 ` [dpdk-stable] patch 'net/hns3: fix filter parsing comment' " christian.ehrhardt
2021-08-10 15:40 ` [dpdk-stable] patch 'net/hns3: fix Tx prepare after stop' " christian.ehrhardt
2021-08-10 15:40 ` [dpdk-stable] patch 'net/hinic: increase protection of the VLAN' " christian.ehrhardt
2021-08-10 15:40 ` [dpdk-stable] patch 'net/hinic/base: fix LRO' " christian.ehrhardt
2021-08-10 15:40 ` [dpdk-stable] patch 'bus/dpaa: fix freeing in FMAN interface destructor' " christian.ehrhardt
2021-08-10 15:40 ` [dpdk-stable] patch 'net/sfc: fix MAC stats lock in xstats query by ID' " christian.ehrhardt
2021-08-10 15:40 ` [dpdk-stable] patch 'net/sfc: fix reading adapter state without locking' " christian.ehrhardt
2021-08-10 15:40 ` [dpdk-stable] patch 'net/sfc: fix xstats query by ID according to ethdev' " christian.ehrhardt
2021-08-10 15:40 ` [dpdk-stable] patch 'net/sfc: fix xstats query by unsorted list of IDs' " christian.ehrhardt
2021-08-10 15:40 ` [dpdk-stable] patch 'net/sfc: fix MAC stats update for stopped device' " christian.ehrhardt
2021-08-10 15:40 ` [dpdk-stable] patch 'app/testpmd: fix help string for port reset' " christian.ehrhardt
2021-08-10 15:40 ` [dpdk-stable] patch 'app/testpmd: fix MAC address after " christian.ehrhardt
2021-08-10 15:40 ` [dpdk-stable] patch 'net/virtio: report maximum MTU in device info' " christian.ehrhardt
2021-08-10 15:40 ` [dpdk-stable] patch 'vhost: fix crash on reconnect' " christian.ehrhardt
2021-08-10 15:40 ` [dpdk-stable] patch 'net/virtio: fix interrupt handle leak' " christian.ehrhardt
2021-08-11  6:52   ` Christian Ehrhardt
2021-08-10 15:40 ` [dpdk-stable] patch 'net/iavf: fix Tx threshold check' " christian.ehrhardt
2021-08-10 15:40 ` [dpdk-stable] patch 'net/softnic: fix null dereference in arguments parsing' " christian.ehrhardt
2021-08-11 10:21   ` Christian Ehrhardt
2021-08-10 15:40 ` [dpdk-stable] patch 'net/softnic: fix memory leak as profile is freed' " christian.ehrhardt
2021-08-10 15:40 ` [dpdk-stable] patch 'app/testpmd: fix Tx checksum calculation for tunnel' " christian.ehrhardt
2021-08-10 15:40 ` [dpdk-stable] patch 'cryptodev: fix freeing after device release' " christian.ehrhardt
2021-08-10 15:40 ` [dpdk-stable] patch 'crypto/octeontx: " christian.ehrhardt
2021-08-10 15:40 ` [dpdk-stable] patch 'doc: announce common prefix for ethdev' " christian.ehrhardt
2021-08-10 15:40 ` [dpdk-stable] patch 'app/testpmd: fix IPv4 checksum' " christian.ehrhardt

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).