patches for DPDK stable branches
 help / color / mirror / Atom feed
* patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12
@ 2022-02-25 17:14 christian.ehrhardt
  2022-02-25 17:14 ` patch 'net/hns3: fix secondary process reference count' " christian.ehrhardt
                   ` (55 more replies)
  0 siblings, 56 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:14 UTC (permalink / raw)
  To: Huisong Li; +Cc: Min Hu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 2f88c3970219ec1c172c183fdad7e06ee82ba220 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Sat, 25 Dec 2021 18:53:41 +0800
Subject: [PATCH] net/hns3: fix residual MAC after setting default MAC

[ upstream commit 19e67d8ebced5cb12829f75c70e6c497b5925e82 ]

This problem occurs in the following scenarios:
1) reset is encountered when the adapter is running.
2) set a new default MAC address.

After the above two steps, the old default MAC address should be not
take effect. But the current behavior is contrary to that. This is due
to the change of the "default_addr_setted" in hw->mac from 'true' to
'false' after the reset. As a result, the old MAC address is not removed
when the new default MAC address is set. This variable controls whether
to delete the old default MAC address when setting the default MAC
address. It is only used when the mac_addr_set API is called for the
first time. In fact, when a unicast MAC address is deleted, if the
address isn't in the MAC address table, the driver doesn't return
failure. So this patch remove the redundant and troublesome variables to
resolve this problem.

Fixes: 7d7f9f80bbfb ("net/hns3: support MAC address related operations")

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

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index 157dd34d4f..a2676f84b0 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -1545,7 +1545,7 @@ hns3_remove_mc_addr_common(struct hns3_hw *hw, struct rte_ether_addr *mac_addr)
 
 static int
 hns3_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr,
-		  uint32_t idx, __attribute__ ((unused)) uint32_t pool)
+		  __rte_unused uint32_t idx, __rte_unused uint32_t pool)
 {
 	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	char mac_str[RTE_ETHER_ADDR_FMT_SIZE];
@@ -1576,8 +1576,6 @@ hns3_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr,
 		return ret;
 	}
 
-	if (idx == 0)
-		hw->mac.default_addr_setted = true;
 	rte_spinlock_unlock(&hw->lock);
 
 	return ret;
@@ -1642,35 +1640,18 @@ hns3_set_default_mac_addr(struct rte_eth_dev *dev,
 	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct rte_ether_addr *oaddr;
 	char mac_str[RTE_ETHER_ADDR_FMT_SIZE];
-	bool default_addr_setted;
-	bool rm_succes = false;
 	int ret, ret_val;
 
-	/* check if mac addr is valid */
-	if (!rte_is_valid_assigned_ether_addr(mac_addr)) {
-		rte_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
-				      mac_addr);
-		hns3_err(hw, "Failed to set mac addr, addr(%s) invalid",
-			 mac_str);
-		return -EINVAL;
-	}
-
-	oaddr = (struct rte_ether_addr *)hw->mac.mac_addr;
-	default_addr_setted = hw->mac.default_addr_setted;
-	if (default_addr_setted && !!rte_is_same_ether_addr(mac_addr, oaddr))
-		return 0;
-
 	rte_spinlock_lock(&hw->lock);
-	if (default_addr_setted) {
-		ret = hns3_remove_uc_addr_common(hw, oaddr);
-		if (ret) {
-			rte_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
-					      oaddr);
-			hns3_warn(hw, "Remove old uc mac address(%s) fail: %d",
-				  mac_str, ret);
-			rm_succes = false;
-		} else
-			rm_succes = true;
+	oaddr = (struct rte_ether_addr *)hw->mac.mac_addr;
+	ret = hns3_remove_uc_addr_common(hw, oaddr);
+	if (ret) {
+		rte_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
+					oaddr);
+		hns3_warn(hw, "Remove old uc mac address(%s) fail: %d",
+				mac_str, ret);
+		rte_spinlock_unlock(&hw->lock);
+		return ret;
 	}
 
 	ret = hns3_add_uc_addr_common(hw, mac_addr);
@@ -1689,7 +1670,6 @@ hns3_set_default_mac_addr(struct rte_eth_dev *dev,
 
 	rte_ether_addr_copy(mac_addr,
 			    (struct rte_ether_addr *)hw->mac.mac_addr);
-	hw->mac.default_addr_setted = true;
 	rte_spinlock_unlock(&hw->lock);
 
 	return 0;
@@ -1705,16 +1685,12 @@ err_pause_addr_cfg:
 	}
 
 err_add_uc_addr:
-	if (rm_succes) {
-		ret_val = hns3_add_uc_addr_common(hw, oaddr);
-		if (ret_val) {
-			rte_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
-					      oaddr);
-			hns3_warn(hw,
-				  "Failed to restore old uc mac addr(%s): %d",
-				  mac_str, ret_val);
-			hw->mac.default_addr_setted = false;
-		}
+	ret_val = hns3_add_uc_addr_common(hw, oaddr);
+	if (ret_val) {
+		rte_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
+					oaddr);
+		hns3_warn(hw, "Failed to restore old uc mac addr(%s): %d",
+				mac_str, ret_val);
 	}
 	rte_spinlock_unlock(&hw->lock);
 
@@ -2880,7 +2856,6 @@ hns3_get_board_configuration(struct hns3_hw *hw)
 	hw->rss_dis_flag = false;
 	memcpy(hw->mac.mac_addr, cfg.mac_addr, RTE_ETHER_ADDR_LEN);
 	hw->mac.phy_addr = cfg.phy_addr;
-	hw->mac.default_addr_setted = false;
 	hw->num_tx_desc = cfg.tqp_desc_num;
 	hw->num_rx_desc = cfg.tqp_desc_num;
 	hw->dcb_info.num_pg = 1;
@@ -4699,7 +4674,6 @@ hns3_do_stop(struct hns3_adapter *hns)
 		reset_queue = true;
 	} else
 		reset_queue = false;
-	hw->mac.default_addr_setted = false;
 	return hns3_stop_queues(hns, reset_queue);
 }
 
diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h
index 6c3ac6f8a9..be0fac4fd2 100644
--- a/drivers/net/hns3/hns3_ethdev.h
+++ b/drivers/net/hns3/hns3_ethdev.h
@@ -144,7 +144,6 @@ enum hns3_media_type {
 
 struct hns3_mac {
 	uint8_t mac_addr[RTE_ETHER_ADDR_LEN];
-	bool default_addr_setted; /* whether default addr(mac_addr) is set */
 	uint8_t media_type;
 	uint8_t phy_addr;
 	uint8_t link_duplex  : 1; /* ETH_LINK_[HALF/FULL]_DUPLEX */
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:44.339090435 +0100
+++ 0001-net-hns3-fix-residual-MAC-after-setting-default-MAC.patch	2022-02-25 16:58:44.168990350 +0100
@@ -1 +1 @@
-From 19e67d8ebced5cb12829f75c70e6c497b5925e82 Mon Sep 17 00:00:00 2001
+From 2f88c3970219ec1c172c183fdad7e06ee82ba220 Mon Sep 17 00:00:00 2001
@@ -3 +3 @@
-Date: Wed, 22 Sep 2021 11:41:51 +0800
+Date: Sat, 25 Dec 2021 18:53:41 +0800
@@ -5,0 +6,2 @@
+[ upstream commit 19e67d8ebced5cb12829f75c70e6c497b5925e82 ]
+
@@ -8 +10 @@
-2) set a new default MAC address
+2) set a new default MAC address.
@@ -23 +24,0 @@
-Cc: stable@dpdk.org
@@ -28 +29 @@
- drivers/net/hns3/hns3_ethdev.c | 38 ++++++++++------------------------
+ drivers/net/hns3/hns3_ethdev.c | 58 ++++++++++------------------------
@@ -30 +31 @@
- 2 files changed, 11 insertions(+), 28 deletions(-)
+ 2 files changed, 16 insertions(+), 43 deletions(-)
@@ -33 +34 @@
-index 7d37004972..5c8ac5754f 100644
+index 157dd34d4f..a2676f84b0 100644
@@ -36 +37 @@
-@@ -1651,7 +1651,7 @@ hns3_remove_mc_addr_common(struct hns3_hw *hw, struct rte_ether_addr *mac_addr)
+@@ -1545,7 +1545,7 @@ hns3_remove_mc_addr_common(struct hns3_hw *hw, struct rte_ether_addr *mac_addr)
@@ -40 +41 @@
--		  uint32_t idx, __rte_unused uint32_t pool)
+-		  uint32_t idx, __attribute__ ((unused)) uint32_t pool)
@@ -45 +46 @@
-@@ -1682,8 +1682,6 @@ hns3_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr,
+@@ -1576,8 +1576,6 @@ hns3_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr,
@@ -54 +55 @@
-@@ -1748,30 +1746,19 @@ hns3_set_default_mac_addr(struct rte_eth_dev *dev,
+@@ -1642,35 +1640,18 @@ hns3_set_default_mac_addr(struct rte_eth_dev *dev,
@@ -58,0 +60 @@
+-	bool rm_succes = false;
@@ -61,4 +63,9 @@
--	/*
--	 * It has been guaranteed that input parameter named mac_addr is valid
--	 * address in the rte layer of DPDK framework.
--	 */
+-	/* check if mac addr is valid */
+-	if (!rte_is_valid_assigned_ether_addr(mac_addr)) {
+-		rte_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
+-				      mac_addr);
+-		hns3_err(hw, "Failed to set mac addr, addr(%s) invalid",
+-			 mac_str);
+-		return -EINVAL;
+-	}
+-
@@ -74 +81 @@
--			hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
+-			rte_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
@@ -77,0 +85,3 @@
+-			rm_succes = false;
+-		} else
+-			rm_succes = true;
@@ -81,2 +91,2 @@
-+		hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
-+				      oaddr);
++		rte_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
++					oaddr);
@@ -84,5 +94 @@
-+			  mac_str, ret);
- 
--			rte_spinlock_unlock(&hw->lock);
--			return ret;
--		}
++				mac_str, ret);
@@ -94 +100 @@
-@@ -1790,7 +1777,6 @@ hns3_set_default_mac_addr(struct rte_eth_dev *dev,
+@@ -1689,7 +1670,6 @@ hns3_set_default_mac_addr(struct rte_eth_dev *dev,
@@ -102,5 +108,20 @@
-@@ -1811,7 +1797,6 @@ err_add_uc_addr:
- 		hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE, oaddr);
- 		hns3_warn(hw, "Failed to restore old uc mac addr(%s): %d",
- 				  mac_str, ret_val);
--		hw->mac.default_addr_setted = false;
+@@ -1705,16 +1685,12 @@ err_pause_addr_cfg:
+ 	}
+ 
+ err_add_uc_addr:
+-	if (rm_succes) {
+-		ret_val = hns3_add_uc_addr_common(hw, oaddr);
+-		if (ret_val) {
+-			rte_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
+-					      oaddr);
+-			hns3_warn(hw,
+-				  "Failed to restore old uc mac addr(%s): %d",
+-				  mac_str, ret_val);
+-			hw->mac.default_addr_setted = false;
+-		}
++	ret_val = hns3_add_uc_addr_common(hw, oaddr);
++	if (ret_val) {
++		rte_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
++					oaddr);
++		hns3_warn(hw, "Failed to restore old uc mac addr(%s): %d",
++				mac_str, ret_val);
@@ -110 +131 @@
-@@ -3473,7 +3458,6 @@ hns3_get_board_configuration(struct hns3_hw *hw)
+@@ -2880,7 +2856,6 @@ hns3_get_board_configuration(struct hns3_hw *hw)
@@ -118,4 +139,4 @@
-@@ -5931,7 +5915,7 @@ hns3_do_stop(struct hns3_adapter *hns)
- 			return ret;
- 		}
- 	}
+@@ -4699,7 +4674,6 @@ hns3_do_stop(struct hns3_adapter *hns)
+ 		reset_queue = true;
+ 	} else
+ 		reset_queue = false;
@@ -123,2 +144 @@
-+
- 	return 0;
+ 	return hns3_stop_queues(hns, reset_queue);
@@ -128 +148 @@
-index 0e4e4269a1..243a4046ae 100644
+index 6c3ac6f8a9..be0fac4fd2 100644
@@ -131 +151 @@
-@@ -188,7 +188,6 @@ enum hns3_media_type {
+@@ -144,7 +144,6 @@ enum hns3_media_type {

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

* patch 'net/hns3: fix secondary process reference count' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
@ 2022-02-25 17:14 ` christian.ehrhardt
  2022-02-25 17:14 ` patch 'net/hns3: fix multi-process action register and unregister' " christian.ehrhardt
                   ` (54 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:14 UTC (permalink / raw)
  To: Huisong Li; +Cc: Min Hu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 98389f055c357c035fdcbb8f409a99bbfd824328 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Sat, 25 Dec 2021 18:53:42 +0800
Subject: [PATCH] net/hns3: fix secondary process reference count

[ upstream commit 323263717774df318d8a6e64ac8bfe546e03b8f6 ]

The "secondary_cnt" will be increased when a secondary process
initialized. But the value of this variable is not decreased when the
secondary process exits, which causes the primary process senses that
the secondary process still exists. As a result, the primary process
fails to send messages to the secondary process after the secondary
process exits.

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    | 5 +++--
 drivers/net/hns3/hns3_ethdev_vf.c | 6 ++++--
 drivers/net/hns3/hns3_mp.c        | 3 ++-
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index a2676f84b0..d245c5db8b 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -4749,6 +4749,7 @@ hns3_dev_close(struct rte_eth_dev *eth_dev)
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
 		rte_free(eth_dev->process_private);
 		eth_dev->process_private = NULL;
+		__atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED);
 		return;
 	}
 
@@ -5437,8 +5438,7 @@ hns3_dev_init(struct rte_eth_dev *eth_dev)
 				     "process, ret = %d", ret);
 			goto err_mp_init_secondary;
 		}
-
-		hw->secondary_cnt++;
+		__atomic_fetch_add(&hw->secondary_cnt, 1, __ATOMIC_RELAXED);
 		return 0;
 	}
 
@@ -5551,6 +5551,7 @@ hns3_dev_uninit(struct rte_eth_dev *eth_dev)
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
 		rte_free(eth_dev->process_private);
 		eth_dev->process_private = NULL;
+		__atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED);
 		return 0;
 	}
 
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
index 790e76a0db..972a6f00e4 100644
--- a/drivers/net/hns3/hns3_ethdev_vf.c
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
@@ -1653,6 +1653,8 @@ hns3vf_dev_close(struct rte_eth_dev *eth_dev)
 
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
 		rte_free(eth_dev->process_private);
+		eth_dev->process_private = NULL;
+		__atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED);
 		return;
     }
 
@@ -2291,8 +2293,7 @@ hns3vf_dev_init(struct rte_eth_dev *eth_dev)
 					  "process, ret = %d", ret);
 			goto err_mp_init_secondary;
 		}
-
-		hw->secondary_cnt++;
+		__atomic_fetch_add(&hw->secondary_cnt, 1, __ATOMIC_RELAXED);
 		return 0;
 	}
 
@@ -2386,6 +2387,7 @@ hns3vf_dev_uninit(struct rte_eth_dev *eth_dev)
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
 		rte_free(eth_dev->process_private);
 		eth_dev->process_private = NULL;
+		__atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED);
 		return 0;
 	}
 
diff --git a/drivers/net/hns3/hns3_mp.c b/drivers/net/hns3/hns3_mp.c
index a03f2cf13c..9b5ff475a9 100644
--- a/drivers/net/hns3/hns3_mp.c
+++ b/drivers/net/hns3/hns3_mp.c
@@ -132,7 +132,8 @@ mp_req_on_rxtx(struct rte_eth_dev *dev, enum hns3_mp_req_type type)
 	int ret;
 	int i;
 
-	if (rte_eal_process_type() == RTE_PROC_SECONDARY || !hw->secondary_cnt)
+	if (rte_eal_process_type() == RTE_PROC_SECONDARY ||
+		__atomic_load_n(&hw->secondary_cnt, __ATOMIC_RELAXED) == 0)
 		return;
 	if (type != HNS3_MP_REQ_START_RXTX && type != HNS3_MP_REQ_STOP_RXTX) {
 		hns3_err(hw, "port %u unknown request (req_type %d)",
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:44.379511481 +0100
+++ 0002-net-hns3-fix-secondary-process-reference-count.patch	2022-02-25 16:58:44.176990357 +0100
@@ -1 +1 @@
-From 323263717774df318d8a6e64ac8bfe546e03b8f6 Mon Sep 17 00:00:00 2001
+From 98389f055c357c035fdcbb8f409a99bbfd824328 Mon Sep 17 00:00:00 2001
@@ -3 +3 @@
-Date: Tue, 2 Nov 2021 09:38:26 +0800
+Date: Sat, 25 Dec 2021 18:53:42 +0800
@@ -5,0 +6,2 @@
+[ upstream commit 323263717774df318d8a6e64ac8bfe546e03b8f6 ]
+
@@ -14 +15,0 @@
-Cc: stable@dpdk.org
@@ -19,4 +20,4 @@
- drivers/net/hns3/hns3_ethdev.c    | 10 +++++++---
- drivers/net/hns3/hns3_ethdev_vf.c | 10 +++++++---
- drivers/net/hns3/hns3_mp.c        |  4 +++-
- 3 files changed, 17 insertions(+), 7 deletions(-)
+ drivers/net/hns3/hns3_ethdev.c    | 5 +++--
+ drivers/net/hns3/hns3_ethdev_vf.c | 6 ++++--
+ drivers/net/hns3/hns3_mp.c        | 3 ++-
+ 3 files changed, 9 insertions(+), 5 deletions(-)
@@ -25 +26 @@
-index 03447c8d4a..dafaf31f65 100644
+index a2676f84b0..d245c5db8b 100644
@@ -28,6 +29,4 @@
-@@ -5850,8 +5850,10 @@ hns3_dev_close(struct rte_eth_dev *eth_dev)
- 	struct hns3_hw *hw = &hns->hw;
- 	int ret = 0;
- 
--	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
-+	if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
+@@ -4749,6 +4749,7 @@ hns3_dev_close(struct rte_eth_dev *eth_dev)
+ 	if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
+ 		rte_free(eth_dev->process_private);
+ 		eth_dev->process_private = NULL;
@@ -35,2 +34,2 @@
- 		return 0;
-+	}
+ 		return;
+ 	}
@@ -38,3 +37 @@
- 	if (hw->adapter_state == HNS3_NIC_STARTED)
- 		ret = hns3_dev_stop(eth_dev);
-@@ -7377,7 +7379,7 @@ hns3_dev_init(struct rte_eth_dev *eth_dev)
+@@ -5437,8 +5438,7 @@ hns3_dev_init(struct rte_eth_dev *eth_dev)
@@ -43,0 +41 @@
+-
@@ -46 +43,0 @@
- 		hns3_tx_push_init(eth_dev);
@@ -49,3 +45,0 @@
-@@ -7480,8 +7482,10 @@ hns3_dev_uninit(struct rte_eth_dev *eth_dev)
- 
- 	PMD_INIT_FUNC_TRACE();
@@ -53,2 +47,4 @@
--	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
-+	if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
+@@ -5551,6 +5551,7 @@ hns3_dev_uninit(struct rte_eth_dev *eth_dev)
+ 	if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
+ 		rte_free(eth_dev->process_private);
+ 		eth_dev->process_private = NULL;
@@ -57 +53 @@
-+	}
+ 	}
@@ -59,2 +54,0 @@
- 	if (hw->adapter_state < HNS3_NIC_CLOSING)
- 		hns3_dev_close(eth_dev);
@@ -62 +56 @@
-index 4a0d73fc29..41d61a8160 100644
+index 790e76a0db..972a6f00e4 100644
@@ -65,3 +59 @@
-@@ -1893,8 +1893,10 @@ hns3vf_dev_close(struct rte_eth_dev *eth_dev)
- 	struct hns3_hw *hw = &hns->hw;
- 	int ret = 0;
+@@ -1653,6 +1653,8 @@ hns3vf_dev_close(struct rte_eth_dev *eth_dev)
@@ -69,2 +61,3 @@
--	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
-+	if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
+ 	if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
+ 		rte_free(eth_dev->process_private);
++		eth_dev->process_private = NULL;
@@ -72,2 +65,2 @@
- 		return 0;
-+	}
+ 		return;
+     }
@@ -75,3 +68 @@
- 	if (hw->adapter_state == HNS3_NIC_STARTED)
- 		ret = hns3vf_dev_stop(eth_dev);
-@@ -2685,7 +2687,7 @@ hns3vf_dev_init(struct rte_eth_dev *eth_dev)
+@@ -2291,8 +2293,7 @@ hns3vf_dev_init(struct rte_eth_dev *eth_dev)
@@ -80,0 +72 @@
+-
@@ -83 +74,0 @@
- 		hns3_tx_push_init(eth_dev);
@@ -86 +76,0 @@
-@@ -2787,8 +2789,10 @@ hns3vf_dev_uninit(struct rte_eth_dev *eth_dev)
@@ -88,4 +78,4 @@
- 	PMD_INIT_FUNC_TRACE();
- 
--	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
-+	if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
+@@ -2386,6 +2387,7 @@ hns3vf_dev_uninit(struct rte_eth_dev *eth_dev)
+ 	if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
+ 		rte_free(eth_dev->process_private);
+ 		eth_dev->process_private = NULL;
@@ -94 +84 @@
-+	}
+ 	}
@@ -96,2 +85,0 @@
- 	if (hw->adapter_state < HNS3_NIC_CLOSING)
- 		hns3vf_dev_close(eth_dev);
@@ -99 +87 @@
-index cd514ac29c..c28598a53a 100644
+index a03f2cf13c..9b5ff475a9 100644
@@ -102 +90 @@
-@@ -150,8 +150,10 @@ mp_req_on_rxtx(struct rte_eth_dev *dev, enum hns3_mp_req_type type)
+@@ -132,7 +132,8 @@ mp_req_on_rxtx(struct rte_eth_dev *dev, enum hns3_mp_req_type type)
@@ -110,2 +98 @@
-+
- 	if (!mp_req_type_is_valid(type)) {
+ 	if (type != HNS3_MP_REQ_START_RXTX && type != HNS3_MP_REQ_STOP_RXTX) {
@@ -113 +99,0 @@
- 			 dev->data->port_id, type);

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

* patch 'net/hns3: fix multi-process action register and unregister' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
  2022-02-25 17:14 ` patch 'net/hns3: fix secondary process reference count' " christian.ehrhardt
@ 2022-02-25 17:14 ` christian.ehrhardt
  2022-02-25 17:14 ` patch 'net/hns3: unregister MP action on close for secondary' " christian.ehrhardt
                   ` (53 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:14 UTC (permalink / raw)
  To: Huisong Li; +Cc: Min Hu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 21f145ed527e007d18cc825f59ad773f43545bfb Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Sat, 25 Dec 2021 18:53:43 +0800
Subject: [PATCH] net/hns3: fix multi-process action register and unregister

[ upstream commit 841f8693536f9410fd51d385e1090d35cfe59914 ]

The multi-process has the following problems:
1) After a port in primary process is closed, the mp action of the
   process is unregistered. Which will cause that other device in the
   primary process cannot respond to requests from secondary processes.
2) Because variable "hns3_inited" is set to true without returning an
   initial value, the mp action cannot be registered again after it is
   unregistered.
3) The mp action of primary and secondary process need to be registered
   only once regardless of port numbers in the process. That's what
   variable "hns3_inited" does. But the variable is difficult to
   understand.

This patch adds a hns3_process_local_data structure to resolve above
problems.

Fixes: 9570b1fdbdad ("net/hns3: check multi-process action register result")
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    |  2 ++
 drivers/net/hns3/hns3_ethdev_vf.c |  2 ++
 drivers/net/hns3/hns3_mp.c        | 37 ++++++++++++++++++-------------
 drivers/net/hns3/hns3_mp.h        |  7 ++++++
 4 files changed, 33 insertions(+), 15 deletions(-)

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index d245c5db8b..122a2bc66c 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -5439,6 +5439,7 @@ hns3_dev_init(struct rte_eth_dev *eth_dev)
 			goto err_mp_init_secondary;
 		}
 		__atomic_fetch_add(&hw->secondary_cnt, 1, __ATOMIC_RELAXED);
+		process_data.eth_dev_cnt++;
 		return 0;
 	}
 
@@ -5449,6 +5450,7 @@ hns3_dev_init(struct rte_eth_dev *eth_dev)
 			     ret);
 		goto err_mp_init_primary;
 	}
+	process_data.eth_dev_cnt++;
 
 	hw->adapter_state = HNS3_NIC_UNINITIALIZED;
 
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
index 972a6f00e4..562f6f7662 100644
--- a/drivers/net/hns3/hns3_ethdev_vf.c
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
@@ -2294,6 +2294,7 @@ hns3vf_dev_init(struct rte_eth_dev *eth_dev)
 			goto err_mp_init_secondary;
 		}
 		__atomic_fetch_add(&hw->secondary_cnt, 1, __ATOMIC_RELAXED);
+		process_data.eth_dev_cnt++;
 		return 0;
 	}
 
@@ -2304,6 +2305,7 @@ hns3vf_dev_init(struct rte_eth_dev *eth_dev)
 			     ret);
 		goto err_mp_init_primary;
 	}
+	process_data.eth_dev_cnt++;
 
 	hw->adapter_state = HNS3_NIC_UNINITIALIZED;
 	hns->is_vf = true;
diff --git a/drivers/net/hns3/hns3_mp.c b/drivers/net/hns3/hns3_mp.c
index 9b5ff475a9..c7e49a798a 100644
--- a/drivers/net/hns3/hns3_mp.c
+++ b/drivers/net/hns3/hns3_mp.c
@@ -14,7 +14,8 @@
 #include "hns3_rxtx.h"
 #include "hns3_mp.h"
 
-static bool hns3_inited;
+/* local data for primary or secondary process. */
+struct hns3_process_local_data process_data;
 
 /*
  * Initialize IPC message.
@@ -199,14 +200,15 @@ int hns3_mp_init_primary(void)
 {
 	int ret;
 
-	if (!hns3_inited) {
-		/* primary is allowed to not support IPC */
-		ret = rte_mp_action_register(HNS3_MP_NAME, mp_primary_handle);
-		if (ret && rte_errno != ENOTSUP)
-			return ret;
+	if (process_data.init_done)
+		return 0;
 
-		hns3_inited = true;
-	}
+	/* primary is allowed to not support IPC */
+	ret = rte_mp_action_register(HNS3_MP_NAME, mp_primary_handle);
+	if (ret && rte_errno != ENOTSUP)
+		return ret;
+
+	process_data.init_done = true;
 
 	return 0;
 }
@@ -216,8 +218,12 @@ int hns3_mp_init_primary(void)
  */
 void hns3_mp_uninit_primary(void)
 {
-	if (hns3_inited)
+	process_data.eth_dev_cnt--;
+
+	if (process_data.eth_dev_cnt == 0) {
 		rte_mp_action_unregister(HNS3_MP_NAME);
+		process_data.init_done = false;
+	}
 }
 
 /*
@@ -227,13 +233,14 @@ int hns3_mp_init_secondary(void)
 {
 	int ret;
 
-	if (!hns3_inited) {
-		ret = rte_mp_action_register(HNS3_MP_NAME, mp_secondary_handle);
-		if (ret)
-			return ret;
+	if (process_data.init_done)
+		return 0;
 
-		hns3_inited = true;
-	}
+	ret = rte_mp_action_register(HNS3_MP_NAME, mp_secondary_handle);
+	if (ret)
+		return ret;
+
+	process_data.init_done = true;
 
 	return 0;
 }
diff --git a/drivers/net/hns3/hns3_mp.h b/drivers/net/hns3/hns3_mp.h
index 60ef2315db..8ef432e763 100644
--- a/drivers/net/hns3/hns3_mp.h
+++ b/drivers/net/hns3/hns3_mp.h
@@ -5,6 +5,13 @@
 #ifndef _HNS3_MP_H_
 #define _HNS3_MP_H_
 
+/* Local data for primary or secondary process. */
+struct hns3_process_local_data {
+	bool init_done; /* Process action register completed flag. */
+	int eth_dev_cnt; /* Ethdev count under the current process. */
+};
+extern struct hns3_process_local_data process_data;
+
 void hns3_mp_req_start_rxtx(struct rte_eth_dev *dev);
 void hns3_mp_req_stop_rxtx(struct rte_eth_dev *dev);
 int hns3_mp_init_primary(void);
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:44.423699640 +0100
+++ 0003-net-hns3-fix-multi-process-action-register-and-unreg.patch	2022-02-25 16:58:44.184990363 +0100
@@ -1 +1 @@
-From 841f8693536f9410fd51d385e1090d35cfe59914 Mon Sep 17 00:00:00 2001
+From 21f145ed527e007d18cc825f59ad773f43545bfb Mon Sep 17 00:00:00 2001
@@ -3 +3 @@
-Date: Tue, 2 Nov 2021 09:38:27 +0800
+Date: Sat, 25 Dec 2021 18:53:43 +0800
@@ -5,0 +6,2 @@
+[ upstream commit 841f8693536f9410fd51d385e1090d35cfe59914 ]
+
@@ -34 +36 @@
-index dafaf31f65..874854da61 100644
+index d245c5db8b..122a2bc66c 100644
@@ -37 +39 @@
-@@ -7380,6 +7380,7 @@ hns3_dev_init(struct rte_eth_dev *eth_dev)
+@@ -5439,6 +5439,7 @@ hns3_dev_init(struct rte_eth_dev *eth_dev)
@@ -42 +43,0 @@
- 		hns3_tx_push_init(eth_dev);
@@ -45 +46,2 @@
-@@ -7391,6 +7392,7 @@ hns3_dev_init(struct rte_eth_dev *eth_dev)
+ 
+@@ -5449,6 +5450,7 @@ hns3_dev_init(struct rte_eth_dev *eth_dev)
@@ -52 +54 @@
- 	hns->is_vf = false;
+ 
@@ -54 +56 @@
-index 41d61a8160..91acd1f5dd 100644
+index 972a6f00e4..562f6f7662 100644
@@ -57 +59 @@
-@@ -2688,6 +2688,7 @@ hns3vf_dev_init(struct rte_eth_dev *eth_dev)
+@@ -2294,6 +2294,7 @@ hns3vf_dev_init(struct rte_eth_dev *eth_dev)
@@ -62 +63,0 @@
- 		hns3_tx_push_init(eth_dev);
@@ -65 +66,2 @@
-@@ -2699,6 +2700,7 @@ hns3vf_dev_init(struct rte_eth_dev *eth_dev)
+ 
+@@ -2304,6 +2305,7 @@ hns3vf_dev_init(struct rte_eth_dev *eth_dev)
@@ -74 +76 @@
-index c28598a53a..1a79d249b8 100644
+index 9b5ff475a9..c7e49a798a 100644
@@ -77 +79 @@
-@@ -12,7 +12,8 @@
+@@ -14,7 +14,8 @@
@@ -87 +89 @@
-@@ -230,14 +231,15 @@ int hns3_mp_init_primary(void)
+@@ -199,14 +200,15 @@ int hns3_mp_init_primary(void)
@@ -110 +112 @@
-@@ -247,8 +249,12 @@ int hns3_mp_init_primary(void)
+@@ -216,8 +218,12 @@ int hns3_mp_init_primary(void)
@@ -124 +126 @@
-@@ -258,13 +264,14 @@ int hns3_mp_init_secondary(void)
+@@ -227,13 +233,14 @@ int hns3_mp_init_secondary(void)
@@ -146 +148 @@
-index e0e4aeaf6c..b49532f985 100644
+index 60ef2315db..8ef432e763 100644
@@ -162 +164 @@
- void hns3_mp_req_start_tx(struct rte_eth_dev *dev);
+ int hns3_mp_init_primary(void);

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

* patch 'net/hns3: unregister MP action on close for secondary' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
  2022-02-25 17:14 ` patch 'net/hns3: fix secondary process reference count' " christian.ehrhardt
  2022-02-25 17:14 ` patch 'net/hns3: fix multi-process action register and unregister' " christian.ehrhardt
@ 2022-02-25 17:14 ` christian.ehrhardt
  2022-02-25 17:14 ` patch 'net/ice: build failure with make and GCC > 11' " christian.ehrhardt
                   ` (52 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:14 UTC (permalink / raw)
  To: Huisong Li; +Cc: Min Hu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 48d18f507a1ee6d64d7f46c37292cd5404a0aee7 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Sat, 25 Dec 2021 18:53:44 +0800
Subject: [PATCH] net/hns3: unregister MP action on close for secondary

[ upstream commit 443242212baeb67d298c54cc927553c92aa29bec ]

This patch fixes lack of unregistering MP action for secondary process
when PMD is closed.

Fixes: 9570b1fdbdad ("net/hns3: check multi-process action register result")
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    | 6 ++++--
 drivers/net/hns3/hns3_ethdev_vf.c | 6 ++++--
 drivers/net/hns3/hns3_mp.c        | 5 +----
 drivers/net/hns3/hns3_mp.h        | 2 +-
 4 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index 122a2bc66c..df76dfce7f 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -4750,6 +4750,7 @@ hns3_dev_close(struct rte_eth_dev *eth_dev)
 		rte_free(eth_dev->process_private);
 		eth_dev->process_private = NULL;
 		__atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED);
+		hns3_mp_uninit();
 		return;
 	}
 
@@ -4768,7 +4769,7 @@ hns3_dev_close(struct rte_eth_dev *eth_dev)
 	rte_free(hw->reset.wait_data);
 	rte_free(eth_dev->process_private);
 	eth_dev->process_private = NULL;
-	hns3_mp_uninit_primary();
+	hns3_mp_uninit();
 	hns3_warn(hw, "Close port %d finished", hw->data->port_id);
 }
 
@@ -5529,7 +5530,7 @@ err_init_pf:
 	rte_free(hw->reset.wait_data);
 
 err_init_reset:
-	hns3_mp_uninit_primary();
+	hns3_mp_uninit();
 
 err_mp_init_primary:
 err_mp_init_secondary:
@@ -5554,6 +5555,7 @@ hns3_dev_uninit(struct rte_eth_dev *eth_dev)
 		rte_free(eth_dev->process_private);
 		eth_dev->process_private = NULL;
 		__atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED);
+		hns3_mp_uninit();
 		return 0;
 	}
 
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
index 562f6f7662..dbd46cd278 100644
--- a/drivers/net/hns3/hns3_ethdev_vf.c
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
@@ -1655,6 +1655,7 @@ hns3vf_dev_close(struct rte_eth_dev *eth_dev)
 		rte_free(eth_dev->process_private);
 		eth_dev->process_private = NULL;
 		__atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED);
+		hns3_mp_uninit();
 		return;
     }
 
@@ -1672,7 +1673,7 @@ hns3vf_dev_close(struct rte_eth_dev *eth_dev)
 	rte_free(hw->reset.wait_data);
 	rte_free(eth_dev->process_private);
 	eth_dev->process_private = NULL;
-	hns3_mp_uninit_primary();
+	hns3_mp_uninit();
 	hns3_warn(hw, "Close port %d finished", hw->data->port_id);
 }
 
@@ -2364,7 +2365,7 @@ err_init_vf:
 	rte_free(hw->reset.wait_data);
 
 err_init_reset:
-	hns3_mp_uninit_primary();
+	hns3_mp_uninit();
 
 err_mp_init_primary:
 err_mp_init_secondary:
@@ -2390,6 +2391,7 @@ hns3vf_dev_uninit(struct rte_eth_dev *eth_dev)
 		rte_free(eth_dev->process_private);
 		eth_dev->process_private = NULL;
 		__atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED);
+		hns3_mp_uninit();
 		return 0;
 	}
 
diff --git a/drivers/net/hns3/hns3_mp.c b/drivers/net/hns3/hns3_mp.c
index c7e49a798a..b017387efd 100644
--- a/drivers/net/hns3/hns3_mp.c
+++ b/drivers/net/hns3/hns3_mp.c
@@ -213,10 +213,7 @@ int hns3_mp_init_primary(void)
 	return 0;
 }
 
-/*
- * Un-initialize by primary process.
- */
-void hns3_mp_uninit_primary(void)
+void hns3_mp_uninit(void)
 {
 	process_data.eth_dev_cnt--;
 
diff --git a/drivers/net/hns3/hns3_mp.h b/drivers/net/hns3/hns3_mp.h
index 8ef432e763..ef334648ff 100644
--- a/drivers/net/hns3/hns3_mp.h
+++ b/drivers/net/hns3/hns3_mp.h
@@ -15,7 +15,7 @@ extern struct hns3_process_local_data process_data;
 void hns3_mp_req_start_rxtx(struct rte_eth_dev *dev);
 void hns3_mp_req_stop_rxtx(struct rte_eth_dev *dev);
 int hns3_mp_init_primary(void);
-void hns3_mp_uninit_primary(void);
+void hns3_mp_uninit(void);
 int hns3_mp_init_secondary(void);
 
 #endif /* _HNS3_MP_H_ */
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:44.465601605 +0100
+++ 0004-net-hns3-unregister-MP-action-on-close-for-secondary.patch	2022-02-25 16:58:44.192990370 +0100
@@ -1 +1 @@
-From 443242212baeb67d298c54cc927553c92aa29bec Mon Sep 17 00:00:00 2001
+From 48d18f507a1ee6d64d7f46c37292cd5404a0aee7 Mon Sep 17 00:00:00 2001
@@ -3 +3 @@
-Date: Tue, 2 Nov 2021 09:38:28 +0800
+Date: Sat, 25 Dec 2021 18:53:44 +0800
@@ -5,0 +6,2 @@
+[ upstream commit 443242212baeb67d298c54cc927553c92aa29bec ]
+
@@ -22 +24 @@
-index 874854da61..88abbb84ea 100644
+index 122a2bc66c..df76dfce7f 100644
@@ -25,3 +27,3 @@
-@@ -5852,6 +5852,7 @@ hns3_dev_close(struct rte_eth_dev *eth_dev)
- 
- 	if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
+@@ -4750,6 +4750,7 @@ hns3_dev_close(struct rte_eth_dev *eth_dev)
+ 		rte_free(eth_dev->process_private);
+ 		eth_dev->process_private = NULL;
@@ -30 +32 @@
- 		return 0;
+ 		return;
@@ -33,3 +35 @@
-@@ -5868,7 +5869,7 @@ hns3_dev_close(struct rte_eth_dev *eth_dev)
- 	hns3_uninit_pf(eth_dev);
- 	hns3_free_all_queues(eth_dev);
+@@ -4768,7 +4769,7 @@ hns3_dev_close(struct rte_eth_dev *eth_dev)
@@ -36,0 +37,2 @@
+ 	rte_free(eth_dev->process_private);
+ 	eth_dev->process_private = NULL;
@@ -39 +41,2 @@
- 	hns3_warn(hw, "Close port %u finished", hw->data->port_id);
+ 	hns3_warn(hw, "Close port %d finished", hw->data->port_id);
+ }
@@ -41,2 +44 @@
- 	return ret;
-@@ -7463,7 +7464,7 @@ err_init_pf:
+@@ -5529,7 +5530,7 @@ err_init_pf:
@@ -51,3 +53,3 @@
-@@ -7486,6 +7487,7 @@ hns3_dev_uninit(struct rte_eth_dev *eth_dev)
- 
- 	if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
+@@ -5554,6 +5555,7 @@ hns3_dev_uninit(struct rte_eth_dev *eth_dev)
+ 		rte_free(eth_dev->process_private);
+ 		eth_dev->process_private = NULL;
@@ -60 +62 @@
-index 91acd1f5dd..f7f615bf72 100644
+index 562f6f7662..dbd46cd278 100644
@@ -63,3 +65,3 @@
-@@ -1895,6 +1895,7 @@ hns3vf_dev_close(struct rte_eth_dev *eth_dev)
- 
- 	if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
+@@ -1655,6 +1655,7 @@ hns3vf_dev_close(struct rte_eth_dev *eth_dev)
+ 		rte_free(eth_dev->process_private);
+ 		eth_dev->process_private = NULL;
@@ -68,2 +70,2 @@
- 		return 0;
- 	}
+ 		return;
+     }
@@ -71,3 +73 @@
-@@ -1910,7 +1911,7 @@ hns3vf_dev_close(struct rte_eth_dev *eth_dev)
- 	hns3vf_uninit_vf(eth_dev);
- 	hns3_free_all_queues(eth_dev);
+@@ -1672,7 +1673,7 @@ hns3vf_dev_close(struct rte_eth_dev *eth_dev)
@@ -74,0 +75,2 @@
+ 	rte_free(eth_dev->process_private);
+ 	eth_dev->process_private = NULL;
@@ -77 +79,2 @@
- 	hns3_warn(hw, "Close port %u finished", hw->data->port_id);
+ 	hns3_warn(hw, "Close port %d finished", hw->data->port_id);
+ }
@@ -79,2 +82 @@
- 	return ret;
-@@ -2769,7 +2770,7 @@ err_init_vf:
+@@ -2364,7 +2365,7 @@ err_init_vf:
@@ -89,3 +91,3 @@
-@@ -2793,6 +2794,7 @@ hns3vf_dev_uninit(struct rte_eth_dev *eth_dev)
- 
- 	if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
+@@ -2390,6 +2391,7 @@ hns3vf_dev_uninit(struct rte_eth_dev *eth_dev)
+ 		rte_free(eth_dev->process_private);
+ 		eth_dev->process_private = NULL;
@@ -98 +100 @@
-index 1a79d249b8..6d33bf49cd 100644
+index c7e49a798a..b017387efd 100644
@@ -101 +103 @@
-@@ -244,10 +244,7 @@ int hns3_mp_init_primary(void)
+@@ -213,10 +213,7 @@ int hns3_mp_init_primary(void)
@@ -114 +116 @@
-index b49532f985..5738ab74a5 100644
+index 8ef432e763..ef334648ff 100644
@@ -117,3 +119,3 @@
-@@ -18,7 +18,7 @@ void hns3_mp_req_start_tx(struct rte_eth_dev *dev);
- void hns3_mp_req_stop_tx(struct rte_eth_dev *dev);
- 
+@@ -15,7 +15,7 @@ extern struct hns3_process_local_data process_data;
+ void hns3_mp_req_start_rxtx(struct rte_eth_dev *dev);
+ void hns3_mp_req_stop_rxtx(struct rte_eth_dev *dev);

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

* patch 'net/ice: build failure with make and GCC > 11' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (2 preceding siblings ...)
  2022-02-25 17:14 ` patch 'net/hns3: unregister MP action on close for secondary' " christian.ehrhardt
@ 2022-02-25 17:14 ` christian.ehrhardt
  2022-02-25 17:14 ` patch 'config/ppc: fix build with GCC >= 10' " christian.ehrhardt
                   ` (51 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:14 UTC (permalink / raw)
  To: Steve Yang; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 4b0a43dcaf3e4cd5f1caf023231db1fd9fd894f2 Mon Sep 17 00:00:00 2001
From: Steve Yang <stevex.yang@intel.com>
Date: Wed, 12 Jan 2022 06:45:05 +0000
Subject: [PATCH] net/ice: build failure with make and GCC > 11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Since GCC version is greater than 11.1.1, the '-finline-functions'
option perhaps causes '-Werror=maybe-uninitialized' issue.

Check the gcc version, and enable '-Wno-maybe-uninitialized',
otherwise it will have "error: ‘r_bitmap’ may be used uninitialized".

Bugzilla ID: 744

Signed-off-by: Steve Yang <stevex.yang@intel.com>
---
 drivers/net/ice/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ice/Makefile b/drivers/net/ice/Makefile
index 9cfd059781..9935d614c8 100644
--- a/drivers/net/ice/Makefile
+++ b/drivers/net/ice/Makefile
@@ -37,6 +37,10 @@ ifeq ($(shell test $(GCC_VERSION) -ge 44 && echo 1), 1)
 CFLAGS_BASE_DRIVER += -Wno-unused-but-set-variable
 endif
 
+ifeq ($(shell test $(GCC_VERSION) -ge 110 && echo 1), 1)
+CFLAGS_BASE_DRIVER += -Wno-maybe-uninitialized
+endif
+
 endif
 OBJS_BASE_DRIVER=$(patsubst %.c,%.o,$(notdir $(wildcard $(SRCDIR)/base/*.c)))
 $(foreach obj, $(OBJS_BASE_DRIVER), $(eval CFLAGS_$(obj)+=$(CFLAGS_BASE_DRIVER)))
-- 
2.35.0


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

* patch 'config/ppc: fix build with GCC >= 10' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (3 preceding siblings ...)
  2022-02-25 17:14 ` patch 'net/ice: build failure with make and GCC > 11' " christian.ehrhardt
@ 2022-02-25 17:14 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'maintainers: update for stable branches' " christian.ehrhardt
                   ` (50 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:14 UTC (permalink / raw)
  To: David Marchand
  Cc: Ferruh Yigit, Bruce Richardson, Christian Ehrhardt, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From a489d32bfe9fcd6839476d135efea82ed3026491 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Wed, 15 Sep 2021 07:08:12 +0200
Subject: [PATCH] config/ppc: fix build with GCC >= 10

[ upstream commit dfb1ad1e7a070926c9bd9fdf38e6b944a21f1d49 ]

Like for python, multiline statements in meson must either use a
backslash character (explicit continuation) or be enclosed in ()
(implicit continuation).

python PEP8 recommends the latter [1], and it looks like meson had
an issue with backslash before 0.50 [2].

1: https://www.python.org/dev/peps/pep-0008/#multiline-if-statements
2: https://github.com/mesonbuild/meson/commit/90c9b868b20b

Fixes: 394407f50c90 ("config/ppc: ignore GCC 11 psabi warnings")

Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
---
 config/ppc_64/meson.build | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/config/ppc_64/meson.build b/config/ppc_64/meson.build
index 303b249570..aed37a6b59 100644
--- a/config/ppc_64/meson.build
+++ b/config/ppc_64/meson.build
@@ -20,8 +20,8 @@ endif
 
 # Suppress the gcc warning "note: the layout of aggregates containing
 # vectors with 4-byte alignment has changed in GCC 5".
-if cc.get_id() == 'gcc' and cc.version().version_compare('>=10.0') and
-        cc.version().version_compare('<12.0') and cc.has_argument('-Wno-psabi')
+if (cc.get_id() == 'gcc' and cc.version().version_compare('>=10.0') and
+        cc.version().version_compare('<12.0') and cc.has_argument('-Wno-psabi'))
     add_project_arguments('-Wno-psabi', language: 'c')
 endif
 
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:44.538790357 +0100
+++ 0006-config-ppc-fix-build-with-GCC-10.patch	2022-02-25 16:58:44.192990370 +0100
@@ -1 +1 @@
-From dfb1ad1e7a070926c9bd9fdf38e6b944a21f1d49 Mon Sep 17 00:00:00 2001
+From a489d32bfe9fcd6839476d135efea82ed3026491 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit dfb1ad1e7a070926c9bd9fdf38e6b944a21f1d49 ]
+
@@ -21,0 +24 @@
+Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
@@ -23 +26 @@
- config/ppc/meson.build | 4 ++--
+ config/ppc_64/meson.build | 4 ++--
@@ -26,4 +29,4 @@
-diff --git a/config/ppc/meson.build b/config/ppc/meson.build
-index 0b1948fc7c..aa1327a595 100644
---- a/config/ppc/meson.build
-+++ b/config/ppc/meson.build
+diff --git a/config/ppc_64/meson.build b/config/ppc_64/meson.build
+index 303b249570..aed37a6b59 100644
+--- a/config/ppc_64/meson.build
++++ b/config/ppc_64/meson.build

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

* patch 'maintainers: update for stable branches' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (4 preceding siblings ...)
  2022-02-25 17:14 ` patch 'config/ppc: fix build with GCC >= 10' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'bus/ifpga: remove useless check while browsing devices' " christian.ehrhardt
                   ` (49 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Kevin Traynor; +Cc: Luca Boccassi, Christian Ehrhardt, Xueming Li, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 904776ab83c22b08ef77f7c8fec7a389c51ddbc9 Mon Sep 17 00:00:00 2001
From: Kevin Traynor <ktraynor@redhat.com>
Date: Mon, 13 Dec 2021 16:48:57 +0000
Subject: [PATCH] maintainers: update for stable branches

[ upstream commit 4318cd2a4df1b05d252cdb05fb1e0a9dce378018 ]

Christian and Xueming are both already maintaining LTS releases.

Update the MAINTAINERS file to reflect this.

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
---
 MAINTAINERS | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 75431e333b..b207fbce03 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -73,6 +73,8 @@ T: git://dpdk.org/next/dpdk-next-pipeline
 Stable Branches
 M: Luca Boccassi <bluca@debian.org>
 M: Kevin Traynor <ktraynor@redhat.com>
+M: Christian Ehrhardt <christian.ehrhardt@canonical.com>
+M: Xueming Li <xuemingl@nvidia.com>
 T: git://dpdk.org/dpdk-stable
 
 Security Issues
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:44.575777759 +0100
+++ 0007-maintainers-update-for-stable-branches.patch	2022-02-25 16:58:44.196990375 +0100
@@ -1 +1 @@
-From 4318cd2a4df1b05d252cdb05fb1e0a9dce378018 Mon Sep 17 00:00:00 2001
+From 904776ab83c22b08ef77f7c8fec7a389c51ddbc9 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 4318cd2a4df1b05d252cdb05fb1e0a9dce378018 ]
+
@@ -10,2 +11,0 @@
-Cc: stable@dpdk.org
-
@@ -18 +18 @@
-index 852595fe91..4dab6e3cec 100644
+index 75431e333b..b207fbce03 100644
@@ -21 +21 @@
-@@ -64,6 +64,8 @@ T: git://dpdk.org/next/dpdk-next-eventdev
+@@ -73,6 +73,8 @@ T: git://dpdk.org/next/dpdk-next-pipeline

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

* patch 'bus/ifpga: remove useless check while browsing devices' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (5 preceding siblings ...)
  2022-02-25 17:15 ` patch 'maintainers: update for stable branches' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'eal/linux: log hugepage create errors with filename' " christian.ehrhardt
                   ` (48 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Maxime Gouin; +Cc: Olivier Matz, Kevin Traynor, Rosen Xu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 47065be22622b9634d2bb0be00bd21097eb42e37 Mon Sep 17 00:00:00 2001
From: Maxime Gouin <maxime.gouin@6wind.com>
Date: Wed, 5 Jan 2022 11:26:52 +0100
Subject: [PATCH] bus/ifpga: remove useless check while browsing devices

[ upstream commit 62c21c38a26e654bba09be147ea2d61c2e699a13 ]

reported by code analysis tool C++test (version 10.4):

  /build/dpdk-20.11/drivers/bus/ifpga/ifpga_bus.c
  67    Condition "afu_dev" is always evaluated to true
  81    Condition "afu_dev" is always evaluated to true

The "for" loop already checks that afu_dev is not NULL.

Fixes: 05fa3d4a6539 ("bus/ifpga: add Intel FPGA bus library")

Signed-off-by: Maxime Gouin <maxime.gouin@6wind.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
---
 drivers/bus/ifpga/ifpga_bus.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/bus/ifpga/ifpga_bus.c b/drivers/bus/ifpga/ifpga_bus.c
index addbc3e86b..1d9e63dab0 100644
--- a/drivers/bus/ifpga/ifpga_bus.c
+++ b/drivers/bus/ifpga/ifpga_bus.c
@@ -66,8 +66,7 @@ ifpga_find_afu_dev(const struct rte_rawdev *rdev,
 	struct rte_afu_device *afu_dev = NULL;
 
 	TAILQ_FOREACH(afu_dev, &ifpga_afu_dev_list, next) {
-		if (afu_dev &&
-			afu_dev->rawdev == rdev &&
+		if (afu_dev->rawdev == rdev &&
 			!ifpga_afu_id_cmp(&afu_dev->id, afu_id))
 			return afu_dev;
 	}
@@ -80,8 +79,7 @@ rte_ifpga_find_afu_by_name(const char *name)
 	struct rte_afu_device *afu_dev = NULL;
 
 	TAILQ_FOREACH(afu_dev, &ifpga_afu_dev_list, next) {
-		if (afu_dev &&
-			!strcmp(afu_dev->device.name, name))
+		if (!strcmp(afu_dev->device.name, name))
 			return afu_dev;
 	}
 	return NULL;
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:44.611397719 +0100
+++ 0008-bus-ifpga-remove-useless-check-while-browsing-device.patch	2022-02-25 16:58:44.196990375 +0100
@@ -1 +1 @@
-From 62c21c38a26e654bba09be147ea2d61c2e699a13 Mon Sep 17 00:00:00 2001
+From 47065be22622b9634d2bb0be00bd21097eb42e37 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 62c21c38a26e654bba09be147ea2d61c2e699a13 ]
+
@@ -15 +16,0 @@
-Cc: stable@dpdk.org
@@ -26 +27 @@
-index cbc6809284..c5c8bbd572 100644
+index addbc3e86b..1d9e63dab0 100644
@@ -29 +30 @@
-@@ -64,8 +64,7 @@ ifpga_find_afu_dev(const struct rte_rawdev *rdev,
+@@ -66,8 +66,7 @@ ifpga_find_afu_dev(const struct rte_rawdev *rdev,
@@ -39 +40 @@
-@@ -78,8 +77,7 @@ rte_ifpga_find_afu_by_name(const char *name)
+@@ -80,8 +79,7 @@ rte_ifpga_find_afu_by_name(const char *name)

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

* patch 'eal/linux: log hugepage create errors with filename' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (6 preceding siblings ...)
  2022-02-25 17:15 ` patch 'bus/ifpga: remove useless check while browsing devices' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'devtools: fix comment detection in forbidden token check' " christian.ehrhardt
                   ` (47 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 1e884c7a6834429cf7a177a9d31f2dfd44d582b7 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Thu, 23 Dec 2021 11:21:58 -0800
Subject: [PATCH] eal/linux: log hugepage create errors with filename

[ upstream commit 8a5a91401dc23ddab1ddea3667a17a615a25077f ]

While debugging running DPDK service in a container, it is
useful to see which file creation failed.  Don't hide this
failure with DEBUG.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/librte_eal/linux/eal/eal_memalloc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/librte_eal/linux/eal/eal_memalloc.c b/lib/librte_eal/linux/eal/eal_memalloc.c
index 9f2d3e113c..7499ba0b15 100644
--- a/lib/librte_eal/linux/eal/eal_memalloc.c
+++ b/lib/librte_eal/linux/eal/eal_memalloc.c
@@ -304,8 +304,8 @@ get_seg_fd(char *path, int buflen, struct hugepage_info *hi,
 		if (fd < 0) {
 			fd = open(path, O_CREAT | O_RDWR, 0600);
 			if (fd < 0) {
-				RTE_LOG(ERR, EAL, "%s(): open failed: %s\n",
-					__func__, strerror(errno));
+				RTE_LOG(ERR, EAL, "%s(): open '%s' failed: %s\n",
+					__func__, path, strerror(errno));
 				return -1;
 			}
 			/* take out a read lock and keep it indefinitely */
@@ -342,8 +342,8 @@ get_seg_fd(char *path, int buflen, struct hugepage_info *hi,
 
 			fd = open(path, O_CREAT | O_RDWR, 0600);
 			if (fd < 0) {
-				RTE_LOG(DEBUG, EAL, "%s(): open failed: %s\n",
-					__func__, strerror(errno));
+				RTE_LOG(ERR, EAL, "%s(): open '%s' failed: %s\n",
+					__func__, path, strerror(errno));
 				return -1;
 			}
 			/* take out a read lock */
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:44.646388076 +0100
+++ 0009-eal-linux-log-hugepage-create-errors-with-filename.patch	2022-02-25 16:58:44.196990375 +0100
@@ -1 +1 @@
-From 8a5a91401dc23ddab1ddea3667a17a615a25077f Mon Sep 17 00:00:00 2001
+From 1e884c7a6834429cf7a177a9d31f2dfd44d582b7 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 8a5a91401dc23ddab1ddea3667a17a615a25077f ]
+
@@ -10,2 +11,0 @@
-Cc: stable@dpdk.org
-
@@ -15 +15 @@
- lib/eal/linux/eal_memalloc.c | 8 ++++----
+ lib/librte_eal/linux/eal/eal_memalloc.c | 8 ++++----
@@ -18,5 +18,5 @@
-diff --git a/lib/eal/linux/eal_memalloc.c b/lib/eal/linux/eal_memalloc.c
-index 337f2bc739..16b58d861b 100644
---- a/lib/eal/linux/eal_memalloc.c
-+++ b/lib/eal/linux/eal_memalloc.c
-@@ -308,8 +308,8 @@ get_seg_fd(char *path, int buflen, struct hugepage_info *hi,
+diff --git a/lib/librte_eal/linux/eal/eal_memalloc.c b/lib/librte_eal/linux/eal/eal_memalloc.c
+index 9f2d3e113c..7499ba0b15 100644
+--- a/lib/librte_eal/linux/eal/eal_memalloc.c
++++ b/lib/librte_eal/linux/eal/eal_memalloc.c
+@@ -304,8 +304,8 @@ get_seg_fd(char *path, int buflen, struct hugepage_info *hi,
@@ -33 +33 @@
-@@ -346,8 +346,8 @@ get_seg_fd(char *path, int buflen, struct hugepage_info *hi,
+@@ -342,8 +342,8 @@ get_seg_fd(char *path, int buflen, struct hugepage_info *hi,

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

* patch 'devtools: fix comment detection in forbidden token check' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (7 preceding siblings ...)
  2022-02-25 17:15 ` patch 'eal/linux: log hugepage create errors with filename' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'net/ixgbe: add vector Rx parameter " christian.ehrhardt
                   ` (46 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: David Marchand; +Cc: Thomas Monjalon, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 692ac5fb54947906ab4380c5e462e9552e8e1b14 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Thu, 27 Jan 2022 11:55:11 +0100
Subject: [PATCH] devtools: fix comment detection in forbidden token check

[ upstream commit fdcc8970bce23d476e7fabd18a82fb298725c511 ]

After a comment section was detected, passing to a new hunk was not seen
as ending the section and all subsequent hunks were ignored.

Fixes: 7413e7f2aeb3 ("devtools: alert on new calls to exit from libs")

Reported-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 devtools/check-forbidden-tokens.awk | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/devtools/check-forbidden-tokens.awk b/devtools/check-forbidden-tokens.awk
index 61ba707c9b..026844141c 100755
--- a/devtools/check-forbidden-tokens.awk
+++ b/devtools/check-forbidden-tokens.awk
@@ -20,6 +20,9 @@ BEGIN {
 # state machine assumes the comments structure is enforced by
 # checkpatches.pl
 (in_file) {
+	if ($0 ~ "^@@") {
+		in_comment = 0
+	}
 	# comment start
 	if (index($0,comment_start) > 0) {
 		in_comment = 1
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:44.681028708 +0100
+++ 0010-devtools-fix-comment-detection-in-forbidden-token-ch.patch	2022-02-25 16:58:44.196990375 +0100
@@ -1 +1 @@
-From fdcc8970bce23d476e7fabd18a82fb298725c511 Mon Sep 17 00:00:00 2001
+From 692ac5fb54947906ab4380c5e462e9552e8e1b14 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit fdcc8970bce23d476e7fabd18a82fb298725c511 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/ixgbe: add vector Rx parameter check' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (8 preceding siblings ...)
  2022-02-25 17:15 ` patch 'devtools: fix comment detection in forbidden token check' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'net/bnxt: fix xstats query' " christian.ehrhardt
                   ` (45 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Bin Zheng; +Cc: Leyi Rong, Haiyue Wang, Liang Ma, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 21d32d597349c70abf8e390cb51eb8921ef3cca5 Mon Sep 17 00:00:00 2001
From: Bin Zheng <zhengbin.89740@bytedance.com>
Date: Fri, 10 Dec 2021 16:22:09 +0800
Subject: [PATCH] net/ixgbe: add vector Rx parameter check

[ upstream commit c59f93d9a1e09e21e27f5bde7d8632a4d0503582 ]

Under the circumstance that `rx_tail` wrap back to zero
and the advance speed of `rx_tail` is greater than `rxrearm_start`,
`rx_tail` will catch up with `rxrearm_start` and surpass it.
This may cause some mbufs be reused by application.

So we need to make some restrictions to ensure that
 `rx_tail` will not exceed `rxrearm_start`.

e.g.

RDH: 972 RDT: 991 rxrearm_nb: 991 rxrearm_start: 992 rx_tail: 959
RDH: 1004 RDT: 1023 rxrearm_nb: 991 rxrearm_start: 0 rx_tail: 991
RDH: 12 RDT: 31 rxrearm_nb: 991 rxrearm_start: 32 rx_tail: 1023
RDH: 31 RDT: 63 rxrearm_nb: 960 rxrearm_start: 64 rx_tail: 0
RDH: 95 RDT: 95 rxrearm_nb: 1016 rxrearm_start: 96 rx_tail: 88
RDH: 95 RDT: 127 rxrearm_nb: 991 rxrearm_start: 128 rx_tail: 95
...
RDH: 908 RDT: 927 rxrearm_nb: 991 rxrearm_start: 928 rx_tail: 895
RDH: 940 RDT: 959 rxrearm_nb: 991 rxrearm_start: 960 rx_tail: 927
RDH: 980 RDT: 991 rxrearm_nb: 991 rxrearm_start: 992 rx_tail: 959
RDH: 991 RDT: 991 rxrearm_nb: 1026 rxrearm_start: 992 rx_tail: 994

when `rx_tail` catches up with `rxrearm_start`,
2(994 - 992) mbufs be reused by application !

Bugzilla ID: 882
Fixes: 5a3cca342417 ("net/ixgbe: fix vector Rx")

Signed-off-by: Bin Zheng <zhengbin.89740@bytedance.com>
Acked-by: Leyi Rong <leyi.rong@intel.com>
Reviewed-by: Haiyue Wang <haiyue.wang@intel.com>
Reviewed-by: Liang Ma <liangma@liangbit.com>
---
 drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
index 414845f2d7..ac7bcb59c3 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
@@ -364,6 +364,17 @@ _recv_raw_pkts_vec(struct ixgbe_rx_queue *rxq, struct rte_mbuf **rx_pkts,
 	uint8_t vlan_flags;
 	uint16_t udp_p_flag = 0; /* Rx Descriptor UDP header present */
 
+	/*
+	 * Under the circumstance that `rx_tail` wrap back to zero
+	 * and the advance speed of `rx_tail` is greater than `rxrearm_start`,
+	 * `rx_tail` will catch up with `rxrearm_start` and surpass it.
+	 * This may cause some mbufs be reused by application.
+	 *
+	 * So we need to make some restrictions to ensure that
+	 * `rx_tail` will not exceed `rxrearm_start`.
+	 */
+	nb_pkts = RTE_MIN(nb_pkts, RTE_IXGBE_RXQ_REARM_THRESH);
+
 	/* nb_pkts has to be floor-aligned to RTE_IXGBE_DESCS_PER_LOOP */
 	nb_pkts = RTE_ALIGN_FLOOR(nb_pkts, RTE_IXGBE_DESCS_PER_LOOP);
 
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:44.714689296 +0100
+++ 0011-net-ixgbe-add-vector-Rx-parameter-check.patch	2022-02-25 16:58:44.200990377 +0100
@@ -1 +1 @@
-From c59f93d9a1e09e21e27f5bde7d8632a4d0503582 Mon Sep 17 00:00:00 2001
+From 21d32d597349c70abf8e390cb51eb8921ef3cca5 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit c59f93d9a1e09e21e27f5bde7d8632a4d0503582 ]
+
@@ -33 +34,0 @@
-Cc: stable@dpdk.org
@@ -44 +45 @@
-index c56f76b368..bb34b27168 100644
+index 414845f2d7..ac7bcb59c3 100644

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

* patch 'net/bnxt: fix xstats query' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (9 preceding siblings ...)
  2022-02-25 17:15 ` patch 'net/ixgbe: add vector Rx parameter " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'net/bonding: fix mode type mismatch' " christian.ehrhardt
                   ` (44 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Kalesh AP; +Cc: Ajit Khaparde, Somnath Kotur, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 5b1137059210dfe45dee2c9dc48ec3eaac727719 Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Date: Tue, 4 Jan 2022 14:08:23 +0530
Subject: [PATCH] net/bnxt: fix xstats query

[ upstream commit c05c22f9b8032c2974de7042ba8c38fb42ed7c82 ]

Fix incorrect memset in bnxt_dev_xstats_get_op.
In bnxt_dev_xstats_get_op(), the PMD is not zeroing the whole
buffer supplied by the application. This can end up passing
junk statistics values to the application when the FW does not
support extended stats on a function.
Fixed to call memset() with correct size.

Fixes: f55e12f33416 ("net/bnxt: support extended port counters")

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

diff --git a/drivers/net/bnxt/bnxt_stats.c b/drivers/net/bnxt/bnxt_stats.c
index b9538bbf35..ca66ce1213 100644
--- a/drivers/net/bnxt/bnxt_stats.c
+++ b/drivers/net/bnxt/bnxt_stats.c
@@ -546,7 +546,7 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev,
 					(bp->fw_tx_port_stats_ext_size /
 					 stat_size));
 
-	memset(xstats, 0, sizeof(*xstats));
+	memset(xstats, 0, sizeof(*xstats) * n);
 
 	count = 0;
 	for (i = 0; i < RTE_DIM(bnxt_rx_stats_strings); i++) {
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:44.752529027 +0100
+++ 0012-net-bnxt-fix-xstats-query.patch	2022-02-25 16:58:44.200990377 +0100
@@ -1 +1 @@
-From c05c22f9b8032c2974de7042ba8c38fb42ed7c82 Mon Sep 17 00:00:00 2001
+From 5b1137059210dfe45dee2c9dc48ec3eaac727719 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit c05c22f9b8032c2974de7042ba8c38fb42ed7c82 ]
+
@@ -14 +15,0 @@
-Cc: stable@dpdk.org
@@ -24 +25 @@
-index 197fd7c02b..208aa5616d 100644
+index b9538bbf35..ca66ce1213 100644
@@ -27 +28 @@
-@@ -741,7 +741,7 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev,
+@@ -546,7 +546,7 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev,

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

* patch 'net/bonding: fix mode type mismatch' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (10 preceding siblings ...)
  2022-02-25 17:15 ` patch 'net/bnxt: fix xstats query' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'app/testpmd: fix dereference before null check' " christian.ehrhardt
                   ` (43 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Yunjian Wang; +Cc: Min Hu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From f4a9c37bef544e9ebbf286a0b6c4a5005b7f3666 Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian@huawei.com>
Date: Fri, 10 Dec 2021 19:41:01 +0800
Subject: [PATCH] net/bonding: fix mode type mismatch

[ upstream commit cc5097b1e46ddee8df8d2210a67ec675f3807ba2 ]

There were some type-mismatch issues in bonding and fix them:
- Use %u to fix argument type mismatch in RTE_BOND_LOG.
- The internals->mode is of type uint8_t. But the function
  parameter 'mode' is of type int. So change the mode type
  from int to uint8_t.

Fixes: 2efb58cbab6e ("bond: new link bonding library")
Fixes: a45b288ef21a ("bond: support link status polling")
Fixes: 68451eb6698c ("net/bonding: call through EAL on create/free")

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
---
 drivers/net/bonding/eth_bond_private.h | 2 +-
 drivers/net/bonding/rte_eth_bond_api.c | 2 +-
 drivers/net/bonding/rte_eth_bond_pmd.c | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/bonding/eth_bond_private.h b/drivers/net/bonding/eth_bond_private.h
index 72f99e1140..98933be3b0 100644
--- a/drivers/net/bonding/eth_bond_private.h
+++ b/drivers/net/bonding/eth_bond_private.h
@@ -240,7 +240,7 @@ slave_remove_mac_addresses(struct rte_eth_dev *bonded_eth_dev,
 		uint16_t slave_port_id);
 
 int
-bond_ethdev_mode_set(struct rte_eth_dev *eth_dev, int mode);
+bond_ethdev_mode_set(struct rte_eth_dev *eth_dev, uint8_t mode);
 
 int
 slave_configure(struct rte_eth_dev *bonded_eth_dev,
diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c
index 73dfab4983..7ae865c2cf 100644
--- a/drivers/net/bonding/rte_eth_bond_api.c
+++ b/drivers/net/bonding/rte_eth_bond_api.c
@@ -663,7 +663,7 @@ __eth_bond_slave_remove_lock_free(uint16_t bonded_port_id,
 		}
 
 	if (slave_idx < 0) {
-		RTE_BOND_LOG(ERR, "Couldn't find slave in port list, slave count %d",
+		RTE_BOND_LOG(ERR, "Couldn't find slave in port list, slave count %u",
 				internals->slave_count);
 		return -1;
 	}
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index df1e9136b5..a9d81fe936 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -1558,7 +1558,7 @@ mac_address_slaves_update(struct rte_eth_dev *bonded_eth_dev)
 }
 
 int
-bond_ethdev_mode_set(struct rte_eth_dev *eth_dev, int mode)
+bond_ethdev_mode_set(struct rte_eth_dev *eth_dev, uint8_t mode)
 {
 	struct bond_dev_private *internals;
 
@@ -3262,7 +3262,7 @@ bond_alloc(struct rte_vdev_device *dev, uint8_t mode)
 	/* Set mode 4 default configuration */
 	bond_mode_8023ad_setup(eth_dev, NULL);
 	if (bond_ethdev_mode_set(eth_dev, mode)) {
-		RTE_BOND_LOG(ERR, "Failed to set bonded device %d mode to %d",
+		RTE_BOND_LOG(ERR, "Failed to set bonded device %u mode to %u",
 				 eth_dev->data->port_id, mode);
 		goto err;
 	}
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:44.790216558 +0100
+++ 0013-net-bonding-fix-mode-type-mismatch.patch	2022-02-25 16:58:44.204990382 +0100
@@ -1 +1 @@
-From cc5097b1e46ddee8df8d2210a67ec675f3807ba2 Mon Sep 17 00:00:00 2001
+From f4a9c37bef544e9ebbf286a0b6c4a5005b7f3666 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit cc5097b1e46ddee8df8d2210a67ec675f3807ba2 ]
+
@@ -15 +16,0 @@
-Cc: stable@dpdk.org
@@ -26 +27 @@
-index 9626b26d67..156335c425 100644
+index 72f99e1140..98933be3b0 100644
@@ -39 +40 @@
-index 2d5cac6c51..8840d9e17b 100644
+index 73dfab4983..7ae865c2cf 100644
@@ -42 +43 @@
-@@ -668,7 +668,7 @@ __eth_bond_slave_remove_lock_free(uint16_t bonded_port_id,
+@@ -663,7 +663,7 @@ __eth_bond_slave_remove_lock_free(uint16_t bonded_port_id,
@@ -52 +53 @@
-index 0f11a2f5a8..9607141b39 100644
+index df1e9136b5..a9d81fe936 100644
@@ -55 +56 @@
-@@ -1554,7 +1554,7 @@ mac_address_slaves_update(struct rte_eth_dev *bonded_eth_dev)
+@@ -1558,7 +1558,7 @@ mac_address_slaves_update(struct rte_eth_dev *bonded_eth_dev)
@@ -64 +65 @@
-@@ -3300,7 +3300,7 @@ bond_alloc(struct rte_vdev_device *dev, uint8_t mode)
+@@ -3262,7 +3262,7 @@ bond_alloc(struct rte_vdev_device *dev, uint8_t mode)

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

* patch 'app/testpmd: fix dereference before null check' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (11 preceding siblings ...)
  2022-02-25 17:15 ` patch 'net/bonding: fix mode type mismatch' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'net/cxgbe: fix dangling pointer by mailbox access rework' " christian.ehrhardt
                   ` (42 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Sean Morrissey; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From a6dd7ffb5d97d3b9cf77da062e1610d2a6d105e8 Mon Sep 17 00:00:00 2001
From: Sean Morrissey <sean.morrissey@intel.com>
Date: Tue, 18 Jan 2022 10:53:09 +0000
Subject: [PATCH] app/testpmd: fix dereference before null check

[ upstream commit f924a8d3bb838bffbaf2c2d47bada952e45b475f ]

Assign 'left' variable only after null check on 'size'
as function returns if 'size' is null.

Coverity issue: 374381
Fixes: 169a9fed1f4c ("app/testpmd: fix hex string parser support for flow API")

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 app/test-pmd/cmdline_flow.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index df9183376c..9f43f6c43f 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -5293,8 +5293,8 @@ error:
 static int
 parse_hex_string(const char *src, uint8_t *dst, uint32_t *size)
 {
-	uint32_t left = *size;
 	const uint8_t *head = dst;
+	uint32_t left;
 
 	/* Check input parameters */
 	if ((src == NULL) ||
@@ -5303,6 +5303,8 @@ parse_hex_string(const char *src, uint8_t *dst, uint32_t *size)
 		(*size == 0))
 		return -1;
 
+	left = *size;
+
 	/* Convert chars to bytes */
 	while (left) {
 		char tmp[3], *end = tmp;
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:44.828191171 +0100
+++ 0014-app-testpmd-fix-dereference-before-null-check.patch	2022-02-25 16:58:44.208990384 +0100
@@ -1 +1 @@
-From f924a8d3bb838bffbaf2c2d47bada952e45b475f Mon Sep 17 00:00:00 2001
+From a6dd7ffb5d97d3b9cf77da062e1610d2a6d105e8 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit f924a8d3bb838bffbaf2c2d47bada952e45b475f ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index 5c2bba48ad..bbaf18d76e 100644
+index df9183376c..9f43f6c43f 100644
@@ -23 +24 @@
-@@ -7702,8 +7702,8 @@ error:
+@@ -5293,8 +5293,8 @@ error:
@@ -33 +34 @@
-@@ -7712,6 +7712,8 @@ parse_hex_string(const char *src, uint8_t *dst, uint32_t *size)
+@@ -5303,6 +5303,8 @@ parse_hex_string(const char *src, uint8_t *dst, uint32_t *size)

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

* patch 'net/cxgbe: fix dangling pointer by mailbox access rework' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (12 preceding siblings ...)
  2022-02-25 17:15 ` patch 'app/testpmd: fix dereference before null check' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'net/mlx5: fix maximum packet headers size for TSO' " christian.ehrhardt
                   ` (41 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Rahul Lakkireddy; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 161c85a44e48b9572f07e0dc7f9ed5af96a398c4 Mon Sep 17 00:00:00 2001
From: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Date: Thu, 20 Jan 2022 03:26:40 +0530
Subject: [PATCH] net/cxgbe: fix dangling pointer by mailbox access rework
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit 19cafed99ac573662045424e559cee444c175b63 ]

Rework mailbox access serialization to dynamically allocate and
free mbox entry. Also remove unnecessary temp memory and macros.

Observed with: gcc-12.0 (GCC) 12.0.1 20220118 (experimental)

In file included from ../lib/eal/linux/include/rte_os.h:14,
                 from ../lib/eal/include/rte_common.h:28,
                 from ../lib/eal/include/rte_log.h:25,
                 from ../lib/ethdev/rte_ethdev.h:164,
                 from ../lib/ethdev/ethdev_driver.h:18,
                 from ../drivers/net/cxgbe/base/t4vf_hw.c:6:
In function ‘t4_os_atomic_add_tail’,
    inlined from ‘t4vf_wr_mbox_core’ at
	../drivers/net/cxgbe/base/t4vf_hw.c:115:2:
../drivers/net/cxgbe/base/adapter.h:742:9:
      warning: storing the address of local variable ‘entry’ in
      ‘((struct mbox_list *)adapter)[96].tqh_last’ [-Wdangling-pointer=]
  742 |         TAILQ_INSERT_TAIL(head, entry, next);
      |         ^~~~~~~~~~~~~~~~~
../drivers/net/cxgbe/base/t4vf_hw.c: In function ‘t4vf_wr_mbox_core’:
../drivers/net/cxgbe/base/t4vf_hw.c:86:27: note: ‘entry’ declared here
   86 |         struct mbox_entry entry;
      |                           ^~~~~
../drivers/net/cxgbe/base/t4vf_hw.c:86:27: note: ‘adapter’ declared here

Fixes: 3bd122eef2cc ("cxgbe/base: add hardware API for Chelsio T5 series adapters")

Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
---
 drivers/net/cxgbe/base/adapter.h |  2 -
 drivers/net/cxgbe/base/t4_hw.c   | 83 ++++++++++++--------------------
 drivers/net/cxgbe/base/t4vf_hw.c | 28 +++++++----
 3 files changed, 49 insertions(+), 64 deletions(-)

diff --git a/drivers/net/cxgbe/base/adapter.h b/drivers/net/cxgbe/base/adapter.h
index eabd70a213..33aecd8dd4 100644
--- a/drivers/net/cxgbe/base/adapter.h
+++ b/drivers/net/cxgbe/base/adapter.h
@@ -286,8 +286,6 @@ struct sge {
 	u32 fl_starve_thres;        /* Free List starvation threshold */
 };
 
-#define T4_OS_NEEDS_MBOX_LOCKING 1
-
 /*
  * OS Lock/List primitives for those interfaces in the Common Code which
  * need this.
diff --git a/drivers/net/cxgbe/base/t4_hw.c b/drivers/net/cxgbe/base/t4_hw.c
index 71ad1cb0f2..baca2bc9e0 100644
--- a/drivers/net/cxgbe/base/t4_hw.c
+++ b/drivers/net/cxgbe/base/t4_hw.c
@@ -264,17 +264,6 @@ static void fw_asrt(struct adapter *adap, u32 mbox_addr)
 
 #define X_CIM_PF_NOACCESS 0xeeeeeeee
 
-/*
- * If the Host OS Driver needs locking arround accesses to the mailbox, this
- * can be turned on via the T4_OS_NEEDS_MBOX_LOCKING CPP define ...
- */
-/* makes single-statement usage a bit cleaner ... */
-#ifdef T4_OS_NEEDS_MBOX_LOCKING
-#define T4_OS_MBOX_LOCKING(x) x
-#else
-#define T4_OS_MBOX_LOCKING(x) do {} while (0)
-#endif
-
 /**
  * t4_wr_mbox_meat_timeout - send a command to FW through the given mailbox
  * @adap: the adapter
@@ -315,28 +304,17 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox,
 		1, 1, 3, 5, 10, 10, 20, 50, 100
 	};
 
-	u32 v;
-	u64 res;
-	int i, ms;
-	unsigned int delay_idx;
-	__be64 *temp = (__be64 *)malloc(size * sizeof(char));
-	__be64 *p = temp;
 	u32 data_reg = PF_REG(mbox, A_CIM_PF_MAILBOX_DATA);
 	u32 ctl_reg = PF_REG(mbox, A_CIM_PF_MAILBOX_CTRL);
-	u32 ctl;
-	struct mbox_entry entry;
-	u32 pcie_fw = 0;
-
-	if (!temp)
-		return -ENOMEM;
+	struct mbox_entry *entry;
+	u32 v, ctl, pcie_fw = 0;
+	unsigned int delay_idx;
+	const __be64 *p;
+	int i, ms, ret;
+	u64 res;
 
-	if ((size & 15) || size > MBOX_LEN) {
-		free(temp);
+	if ((size & 15) != 0 || size > MBOX_LEN)
 		return -EINVAL;
-	}
-
-	memset(p, 0, size);
-	memcpy(p, (const __be64 *)cmd, size);
 
 	/*
 	 * If we have a negative timeout, that implies that we can't sleep.
@@ -346,14 +324,17 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox,
 		timeout = -timeout;
 	}
 
-#ifdef T4_OS_NEEDS_MBOX_LOCKING
+	entry = t4_os_alloc(sizeof(*entry));
+	if (entry == NULL)
+		return -ENOMEM;
+
 	/*
 	 * Queue ourselves onto the mailbox access list.  When our entry is at
 	 * the front of the list, we have rights to access the mailbox.  So we
 	 * wait [for a while] till we're at the front [or bail out with an
 	 * EBUSY] ...
 	 */
-	t4_os_atomic_add_tail(&entry, &adap->mbox_list, &adap->mbox_lock);
+	t4_os_atomic_add_tail(entry, &adap->mbox_list, &adap->mbox_lock);
 
 	delay_idx = 0;
 	ms = delay[0];
@@ -368,18 +349,18 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox,
 		 */
 		pcie_fw = t4_read_reg(adap, A_PCIE_FW);
 		if (i > 4 * timeout || (pcie_fw & F_PCIE_FW_ERR)) {
-			t4_os_atomic_list_del(&entry, &adap->mbox_list,
+			t4_os_atomic_list_del(entry, &adap->mbox_list,
 					      &adap->mbox_lock);
 			t4_report_fw_error(adap);
-			free(temp);
-			return (pcie_fw & F_PCIE_FW_ERR) ? -ENXIO : -EBUSY;
+			ret = ((pcie_fw & F_PCIE_FW_ERR) != 0) ? -ENXIO : -EBUSY;
+			goto out_free;
 		}
 
 		/*
 		 * If we're at the head, break out and start the mailbox
 		 * protocol.
 		 */
-		if (t4_os_list_first_entry(&adap->mbox_list) == &entry)
+		if (t4_os_list_first_entry(&adap->mbox_list) == entry)
 			break;
 
 		/*
@@ -394,7 +375,6 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox,
 			rte_delay_ms(ms);
 		}
 	}
-#endif /* T4_OS_NEEDS_MBOX_LOCKING */
 
 	/*
 	 * Attempt to gain access to the mailbox.
@@ -411,12 +391,11 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox,
 	 * mailbox atomic access list and report the error to our caller.
 	 */
 	if (v != X_MBOWNER_PL) {
-		T4_OS_MBOX_LOCKING(t4_os_atomic_list_del(&entry,
-							 &adap->mbox_list,
-							 &adap->mbox_lock));
+		t4_os_atomic_list_del(entry, &adap->mbox_list,
+				      &adap->mbox_lock);
 		t4_report_fw_error(adap);
-		free(temp);
-		return (v == X_MBOWNER_FW ? -EBUSY : -ETIMEDOUT);
+		ret = (v == X_MBOWNER_FW) ? -EBUSY : -ETIMEDOUT;
+		goto out_free;
 	}
 
 	/*
@@ -442,7 +421,7 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox,
 	/*
 	 * Copy in the new mailbox command and send it on its way ...
 	 */
-	for (i = 0; i < size; i += 8, p++)
+	for (i = 0, p = cmd; i < size; i += 8, p++)
 		t4_write_reg64(adap, data_reg + i, be64_to_cpu(*p));
 
 	CXGBE_DEBUG_MBOX(adap, "%s: mbox %u: %016llx %016llx %016llx %016llx "
@@ -513,11 +492,10 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox,
 				get_mbox_rpl(adap, rpl, size / 8, data_reg);
 			}
 			t4_write_reg(adap, ctl_reg, V_MBOWNER(X_MBOWNER_NONE));
-			T4_OS_MBOX_LOCKING(
-				t4_os_atomic_list_del(&entry, &adap->mbox_list,
-						      &adap->mbox_lock));
-			free(temp);
-			return -G_FW_CMD_RETVAL((int)res);
+			t4_os_atomic_list_del(entry, &adap->mbox_list,
+					      &adap->mbox_lock);
+			ret = -G_FW_CMD_RETVAL((int)res);
+			goto out_free;
 		}
 	}
 
@@ -528,12 +506,13 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox,
 	 */
 	dev_err(adap, "command %#x in mailbox %d timed out\n",
 		*(const u8 *)cmd, mbox);
-	T4_OS_MBOX_LOCKING(t4_os_atomic_list_del(&entry,
-						 &adap->mbox_list,
-						 &adap->mbox_lock));
+	t4_os_atomic_list_del(entry, &adap->mbox_list, &adap->mbox_lock);
 	t4_report_fw_error(adap);
-	free(temp);
-	return (pcie_fw & F_PCIE_FW_ERR) ? -ENXIO : -ETIMEDOUT;
+	ret = ((pcie_fw & F_PCIE_FW_ERR) != 0) ? -ENXIO : -ETIMEDOUT;
+
+out_free:
+	t4_os_free(entry);
+	return ret;
 }
 
 int t4_wr_mbox_meat(struct adapter *adap, int mbox, const void *cmd, int size,
diff --git a/drivers/net/cxgbe/base/t4vf_hw.c b/drivers/net/cxgbe/base/t4vf_hw.c
index 649bacfb25..7e323d9b66 100644
--- a/drivers/net/cxgbe/base/t4vf_hw.c
+++ b/drivers/net/cxgbe/base/t4vf_hw.c
@@ -83,7 +83,7 @@ int t4vf_wr_mbox_core(struct adapter *adapter,
 
 	u32 mbox_ctl = T4VF_CIM_BASE_ADDR + A_CIM_VF_EXT_MAILBOX_CTRL;
 	__be64 cmd_rpl[MBOX_LEN / 8];
-	struct mbox_entry entry;
+	struct mbox_entry *entry;
 	unsigned int delay_idx;
 	u32 v, mbox_data;
 	const __be64 *p;
@@ -106,13 +106,17 @@ int t4vf_wr_mbox_core(struct adapter *adapter,
 			size > NUM_CIM_VF_MAILBOX_DATA_INSTANCES * 4)
 		return -EINVAL;
 
+	entry = t4_os_alloc(sizeof(*entry));
+	if (entry == NULL)
+		return -ENOMEM;
+
 	/*
 	 * Queue ourselves onto the mailbox access list.  When our entry is at
 	 * the front of the list, we have rights to access the mailbox.  So we
 	 * wait [for a while] till we're at the front [or bail out with an
 	 * EBUSY] ...
 	 */
-	t4_os_atomic_add_tail(&entry, &adapter->mbox_list, &adapter->mbox_lock);
+	t4_os_atomic_add_tail(entry, &adapter->mbox_list, &adapter->mbox_lock);
 
 	delay_idx = 0;
 	ms = delay[0];
@@ -125,17 +129,17 @@ int t4vf_wr_mbox_core(struct adapter *adapter,
 		 * contend on access to the mailbox ...
 		 */
 		if (i > (2 * FW_CMD_MAX_TIMEOUT)) {
-			t4_os_atomic_list_del(&entry, &adapter->mbox_list,
+			t4_os_atomic_list_del(entry, &adapter->mbox_list,
 					      &adapter->mbox_lock);
 			ret = -EBUSY;
-			return ret;
+			goto out_free;
 		}
 
 		/*
 		 * If we're at the head, break out and start the mailbox
 		 * protocol.
 		 */
-		if (t4_os_list_first_entry(&adapter->mbox_list) == &entry)
+		if (t4_os_list_first_entry(&adapter->mbox_list) == entry)
 			break;
 
 		/*
@@ -160,10 +164,10 @@ int t4vf_wr_mbox_core(struct adapter *adapter,
 		v = G_MBOWNER(t4_read_reg(adapter, mbox_ctl));
 
 	if (v != X_MBOWNER_PL) {
-		t4_os_atomic_list_del(&entry, &adapter->mbox_list,
+		t4_os_atomic_list_del(entry, &adapter->mbox_list,
 				      &adapter->mbox_lock);
 		ret = (v == X_MBOWNER_FW) ? -EBUSY : -ETIMEDOUT;
-		return ret;
+		goto out_free;
 	}
 
 	/*
@@ -224,7 +228,7 @@ int t4vf_wr_mbox_core(struct adapter *adapter,
 			get_mbox_rpl(adapter, cmd_rpl, size / 8, mbox_data);
 			t4_write_reg(adapter, mbox_ctl,
 				     V_MBOWNER(X_MBOWNER_NONE));
-			t4_os_atomic_list_del(&entry, &adapter->mbox_list,
+			t4_os_atomic_list_del(entry, &adapter->mbox_list,
 					      &adapter->mbox_lock);
 
 			/* return value in high-order host-endian word */
@@ -236,7 +240,8 @@ int t4vf_wr_mbox_core(struct adapter *adapter,
 					 & F_FW_CMD_REQUEST) == 0);
 				memcpy(rpl, cmd_rpl, size);
 			}
-			return -((int)G_FW_CMD_RETVAL(v));
+			ret = -((int)G_FW_CMD_RETVAL(v));
+			goto out_free;
 		}
 	}
 
@@ -246,8 +251,11 @@ int t4vf_wr_mbox_core(struct adapter *adapter,
 	dev_err(adapter, "command %#x timed out\n",
 		*(const u8 *)cmd);
 	dev_err(adapter, "    Control = %#x\n", t4_read_reg(adapter, mbox_ctl));
-	t4_os_atomic_list_del(&entry, &adapter->mbox_list, &adapter->mbox_lock);
+	t4_os_atomic_list_del(entry, &adapter->mbox_list, &adapter->mbox_lock);
 	ret = -ETIMEDOUT;
+
+out_free:
+	t4_os_free(entry);
 	return ret;
 }
 
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:44.870710825 +0100
+++ 0015-net-cxgbe-fix-dangling-pointer-by-mailbox-access-rew.patch	2022-02-25 16:58:44.216990391 +0100
@@ -1 +1 @@
-From 19cafed99ac573662045424e559cee444c175b63 Mon Sep 17 00:00:00 2001
+From 161c85a44e48b9572f07e0dc7f9ed5af96a398c4 Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit 19cafed99ac573662045424e559cee444c175b63 ]
+
@@ -35 +36,0 @@
-Cc: stable@dpdk.org
@@ -46 +47 @@
-index 1c7c8afe16..97963422bf 100644
+index eabd70a213..33aecd8dd4 100644
@@ -49 +50 @@
-@@ -291,8 +291,6 @@ struct sge {
+@@ -286,8 +286,6 @@ struct sge {
@@ -59 +60 @@
-index cdcd7e5510..645833765a 100644
+index 71ad1cb0f2..baca2bc9e0 100644
@@ -62 +63 @@
-@@ -263,17 +263,6 @@ static void fw_asrt(struct adapter *adap, u32 mbox_addr)
+@@ -264,17 +264,6 @@ static void fw_asrt(struct adapter *adap, u32 mbox_addr)
@@ -80 +81 @@
-@@ -314,28 +303,17 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox,
+@@ -315,28 +304,17 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox,
@@ -116 +117 @@
-@@ -345,14 +323,17 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox,
+@@ -346,14 +324,17 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox,
@@ -136 +137 @@
-@@ -367,18 +348,18 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox,
+@@ -368,18 +349,18 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox,
@@ -159 +160 @@
-@@ -393,7 +374,6 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox,
+@@ -394,7 +375,6 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox,
@@ -167 +168 @@
-@@ -410,12 +390,11 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox,
+@@ -411,12 +391,11 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox,
@@ -184 +185 @@
-@@ -441,7 +420,7 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox,
+@@ -442,7 +421,7 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox,
@@ -193 +194 @@
-@@ -512,11 +491,10 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox,
+@@ -513,11 +492,10 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox,
@@ -209 +210 @@
-@@ -527,12 +505,13 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox,
+@@ -528,12 +506,13 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox,
@@ -229 +230 @@
-index 561d759dbc..7dbd4deb79 100644
+index 649bacfb25..7e323d9b66 100644

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

* patch 'net/mlx5: fix maximum packet headers size for TSO' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (13 preceding siblings ...)
  2022-02-25 17:15 ` patch 'net/cxgbe: fix dangling pointer by mailbox access rework' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'net/nfp: remove useless range checks' " christian.ehrhardt
                   ` (40 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Alexander Kozyrev; +Cc: Viacheslav Ovsiienko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 6edb22f2d81bb8318dd25b9fcd2aaeeecc92863c Mon Sep 17 00:00:00 2001
From: Alexander Kozyrev <akozyrev@nvidia.com>
Date: Thu, 13 Jan 2022 16:32:29 +0200
Subject: [PATCH] net/mlx5: fix maximum packet headers size for TSO

[ upstream commit 9701034faab0f84ba42e1f5343afda5464b11ca3 ]

The maximum packet headers size for TSO is calculated as a sum of
Ethernet, VLAN, IPv6 and TCP headers (plus inner headers).
The rationale  behind choosing IPv6 and TCP is their headers
are bigger than IPv4 and UDP respectively, giving us the maximum
possible headers size. But it is not true for L3 headers.
IPv4 header size (20 bytes) is smaller than IPv6 header size
(40 bytes) only in the default case. There are up to 10
optional header fields called Options in case IHL > 5.
This means that the maximum size of the IPv4 header is 60 bytes.

Choosing the wrong maximum packets headers size causes inability
to transmit multi-segment TSO packets with IPv4 Options present.
PMD check that it is possible to inline all the packet headers
and the packet headers size exceeds the expected maximum size.
The maximum packet headers size was set to 192 bytes before,
but its value has been reduced during Tx path refactor activity.
Restore the proper maximum packet headers size for TSO.

Fixes: 50724e1bba76 ("net/mlx5: update Tx definitions")

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/mlx5_defs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_defs.h b/drivers/net/mlx5/mlx5_defs.h
index 2836099b75..b1c72714bf 100644
--- a/drivers/net/mlx5/mlx5_defs.h
+++ b/drivers/net/mlx5/mlx5_defs.h
@@ -70,7 +70,7 @@
 #define MLX5_MAX_XSTATS 32
 
 /* Maximum Packet headers size (L2+L3+L4) for TSO. */
-#define MLX5_MAX_TSO_HEADER (128u + 34u)
+#define MLX5_MAX_TSO_HEADER 192U
 
 /* Inline data size required by NICs. */
 #define MLX5_INLINE_HSIZE_NONE 0
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:44.918270261 +0100
+++ 0016-net-mlx5-fix-maximum-packet-headers-size-for-TSO.patch	2022-02-25 16:58:44.216990391 +0100
@@ -1 +1 @@
-From 9701034faab0f84ba42e1f5343afda5464b11ca3 Mon Sep 17 00:00:00 2001
+From 6edb22f2d81bb8318dd25b9fcd2aaeeecc92863c Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 9701034faab0f84ba42e1f5343afda5464b11ca3 ]
+
@@ -25 +26,0 @@
-Cc: stable@dpdk.org
@@ -34 +35 @@
-index 36b384fa08..2d48fde010 100644
+index 2836099b75..b1c72714bf 100644
@@ -37 +38 @@
-@@ -50,7 +50,7 @@
+@@ -70,7 +70,7 @@

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

* patch 'net/nfp: remove useless range checks' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (14 preceding siblings ...)
  2022-02-25 17:15 ` patch 'net/mlx5: fix maximum packet headers size for TSO' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'net/sfc: validate queue span when parsing flow action RSS' " christian.ehrhardt
                   ` (39 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Maxime Gouin; +Cc: Olivier Matz, Kevin Traynor, Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 6f93f1756f48fe7801516a8f2346aa905b6d73df Mon Sep 17 00:00:00 2001
From: Maxime Gouin <maxime.gouin@6wind.com>
Date: Wed, 5 Jan 2022 11:32:03 +0100
Subject: [PATCH] net/nfp: remove useless range checks

[ upstream commit a52c79642ab4296763189dd8efadbb679d32c9a0 ]

Reported by code analysis tool C++test (version 10.4):

> /build/dpdk-20.11/drivers/net/nfp/nfpcore/nfp_target.h
> 375   Condition "island < 1" is always evaluated to false
> 415   Condition "island < 1" is always evaluated to false
> 547   Condition "target < 0" is always evaluated to false

All of these conditions have the same error. They call
NFP_CPP_ID_ISLAND_of or NFP_CPP_ID_TARGET_of which return a uint8_t and
put the result in "island" or "target" which are integers. These
variables can only contain values between 0 and 255.

Fixes: c7e9729da6b5 ("net/nfp: support CPP")

Signed-off-by: Maxime Gouin <maxime.gouin@6wind.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 drivers/net/nfp/nfpcore/nfp_target.h | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/net/nfp/nfpcore/nfp_target.h b/drivers/net/nfp/nfpcore/nfp_target.h
index 2884a0034f..e8dcc9ad1e 100644
--- a/drivers/net/nfp/nfpcore/nfp_target.h
+++ b/drivers/net/nfp/nfpcore/nfp_target.h
@@ -37,7 +37,7 @@ pushpull_width(int pp)
 static inline int
 target_rw(uint32_t cpp_id, int pp, int start, int len)
 {
-	int island = NFP_CPP_ID_ISLAND_of(cpp_id);
+	uint8_t island = NFP_CPP_ID_ISLAND_of(cpp_id);
 
 	if (island && (island < start || island > (start + len)))
 		return NFP_ERRNO(EINVAL);
@@ -117,7 +117,7 @@ nfp6000_nbi_ppc(uint32_t cpp_id)
 static inline int
 nfp6000_nbi(uint32_t cpp_id, uint64_t address)
 {
-	int island = NFP_CPP_ID_ISLAND_of(cpp_id);
+	uint8_t island = NFP_CPP_ID_ISLAND_of(cpp_id);
 	uint64_t rel_addr = address & 0x3fFFFF;
 
 	if (island && (island < 8 || island > 9))
@@ -281,7 +281,7 @@ static inline int
 nfp6000_mu(uint32_t cpp_id, uint64_t address)
 {
 	int pp;
-	int island = NFP_CPP_ID_ISLAND_of(cpp_id);
+	uint8_t island = NFP_CPP_ID_ISLAND_of(cpp_id);
 
 	if (island == 0) {
 		if (address < 0x2000000000ULL)
@@ -316,7 +316,7 @@ nfp6000_mu(uint32_t cpp_id, uint64_t address)
 static inline int
 nfp6000_ila(uint32_t cpp_id)
 {
-	int island = NFP_CPP_ID_ISLAND_of(cpp_id);
+	uint8_t island = NFP_CPP_ID_ISLAND_of(cpp_id);
 
 	if (island && (island < 48 || island > 51))
 		return NFP_ERRNO(EINVAL);
@@ -336,7 +336,7 @@ nfp6000_ila(uint32_t cpp_id)
 static inline int
 nfp6000_pci(uint32_t cpp_id)
 {
-	int island = NFP_CPP_ID_ISLAND_of(cpp_id);
+	uint8_t island = NFP_CPP_ID_ISLAND_of(cpp_id);
 
 	if (island && (island < 4 || island > 7))
 		return NFP_ERRNO(EINVAL);
@@ -354,7 +354,7 @@ nfp6000_pci(uint32_t cpp_id)
 static inline int
 nfp6000_crypto(uint32_t cpp_id)
 {
-	int island = NFP_CPP_ID_ISLAND_of(cpp_id);
+	uint8_t island = NFP_CPP_ID_ISLAND_of(cpp_id);
 
 	if (island && (island < 12 || island > 15))
 		return NFP_ERRNO(EINVAL);
@@ -370,9 +370,9 @@ nfp6000_crypto(uint32_t cpp_id)
 static inline int
 nfp6000_cap_xpb(uint32_t cpp_id)
 {
-	int island = NFP_CPP_ID_ISLAND_of(cpp_id);
+	uint8_t island = NFP_CPP_ID_ISLAND_of(cpp_id);
 
-	if (island && (island < 1 || island > 63))
+	if (island > 63)
 		return NFP_ERRNO(EINVAL);
 
 	switch (cpp_id & NFP_CPP_ID(0, ~0, ~0)) {
@@ -410,9 +410,9 @@ nfp6000_cap_xpb(uint32_t cpp_id)
 static inline int
 nfp6000_cls(uint32_t cpp_id)
 {
-	int island = NFP_CPP_ID_ISLAND_of(cpp_id);
+	uint8_t island = NFP_CPP_ID_ISLAND_of(cpp_id);
 
-	if (island && (island < 1 || island > 63))
+	if (island > 63)
 		return NFP_ERRNO(EINVAL);
 
 	switch (cpp_id & NFP_CPP_ID(0, ~0, ~0)) {
@@ -540,11 +540,11 @@ nfp_target_cpp(uint32_t cpp_island_id, uint64_t cpp_island_address,
 	       const uint32_t *imb_table)
 {
 	int err;
-	int island = NFP_CPP_ID_ISLAND_of(cpp_island_id);
-	int target = NFP_CPP_ID_TARGET_of(cpp_island_id);
+	uint8_t island = NFP_CPP_ID_ISLAND_of(cpp_island_id);
+	uint8_t target = NFP_CPP_ID_TARGET_of(cpp_island_id);
 	uint32_t imb;
 
-	if (target < 0 || target >= 16)
+	if (target >= 16)
 		return NFP_ERRNO(EINVAL);
 
 	if (island == 0) {
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:44.957441928 +0100
+++ 0017-net-nfp-remove-useless-range-checks.patch	2022-02-25 16:58:44.216990391 +0100
@@ -1 +1 @@
-From a52c79642ab4296763189dd8efadbb679d32c9a0 Mon Sep 17 00:00:00 2001
+From 6f93f1756f48fe7801516a8f2346aa905b6d73df Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a52c79642ab4296763189dd8efadbb679d32c9a0 ]
+
@@ -19 +20,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/sfc: validate queue span when parsing flow action RSS' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (15 preceding siblings ...)
  2022-02-25 17:15 ` patch 'net/nfp: remove useless range checks' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'raw/ifpga/base: fix SPI transaction' " christian.ehrhardt
                   ` (38 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Ivan Malov; +Cc: Andrew Rybchenko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 177049c3d18f97f68d8c58eaabf4594be59468c9 Mon Sep 17 00:00:00 2001
From: Ivan Malov <ivan.malov@oktetlabs.ru>
Date: Tue, 11 Jan 2022 00:48:45 +0300
Subject: [PATCH] net/sfc: validate queue span when parsing flow action RSS

[ upstream commit 667151aec1ddf8669819ac39d3e86f40f815c213 ]

The current code silently shrinks the value if it exceeds
the supported maximum. Do not do that. Validate the value.

Fixes: d77d07391d4d ("net/sfc: support flow API RSS action")

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 drivers/net/sfc/sfc_flow.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c
index 91aa2a687a..c8ff0ff2a6 100644
--- a/drivers/net/sfc/sfc_flow.c
+++ b/drivers/net/sfc/sfc_flow.c
@@ -1294,6 +1294,9 @@ sfc_flow_parse_rss(struct sfc_adapter *sa,
 			rxq_hw_index_max = rxq->hw_index;
 	}
 
+	if (rxq_hw_index_max - rxq_hw_index_min + 1 > EFX_MAXRSS)
+		return -EINVAL;
+
 	switch (action_rss->func) {
 	case RTE_ETH_HASH_FUNCTION_DEFAULT:
 	case RTE_ETH_HASH_FUNCTION_TOEPLITZ:
@@ -1423,9 +1426,8 @@ sfc_flow_filter_insert(struct sfc_adapter *sa,
 		uint8_t *rss_key;
 
 		if (flow->rss) {
-			rss_spread = MIN(flow_rss->rxq_hw_index_max -
-					flow_rss->rxq_hw_index_min + 1,
-					EFX_MAXRSS);
+			rss_spread = flow_rss->rxq_hw_index_max -
+				     flow_rss->rxq_hw_index_min + 1;
 			rss_hash_types = flow_rss->rss_hash_types;
 			rss_key = flow_rss->rss_key;
 		} else {
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:44.994639770 +0100
+++ 0018-net-sfc-validate-queue-span-when-parsing-flow-action.patch	2022-02-25 16:58:44.220990396 +0100
@@ -1 +1 @@
-From 667151aec1ddf8669819ac39d3e86f40f815c213 Mon Sep 17 00:00:00 2001
+From 177049c3d18f97f68d8c58eaabf4594be59468c9 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 667151aec1ddf8669819ac39d3e86f40f815c213 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
-index fc74c8035e..509fde4a86 100644
+index 91aa2a687a..c8ff0ff2a6 100644
@@ -22 +23 @@
-@@ -1477,6 +1477,9 @@ sfc_flow_parse_rss(struct sfc_adapter *sa,
+@@ -1294,6 +1294,9 @@ sfc_flow_parse_rss(struct sfc_adapter *sa,
@@ -32 +33 @@
-@@ -1612,9 +1615,8 @@ sfc_flow_filter_insert(struct sfc_adapter *sa,
+@@ -1423,9 +1426,8 @@ sfc_flow_filter_insert(struct sfc_adapter *sa,
@@ -35 +36 @@
- 		if (spec_filter->rss) {
+ 		if (flow->rss) {

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

* patch 'raw/ifpga/base: fix SPI transaction' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (16 preceding siblings ...)
  2022-02-25 17:15 ` patch 'net/sfc: validate queue span when parsing flow action RSS' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'net/ice: fix link up when starting device' " christian.ehrhardt
                   ` (37 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Tianfei Zhang; +Cc: Rosen Xu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 30c9deb946a2adcd873b1e69fb604f7fe7926e0a Mon Sep 17 00:00:00 2001
From: Tianfei Zhang <tianfei.zhang@intel.com>
Date: Tue, 18 Jan 2022 20:44:59 -0500
Subject: [PATCH] raw/ifpga/base: fix SPI transaction

[ upstream commit eacdd03c79f5d8adfa7d0dad1e75657dbaf4f788 ]

When EOP is detected, 2 more bytes should be received
(may be a SPI_PACKET_ESC before last valid byte) then
rx should be finished.

Fixes: 96ebfcf8125c ("raw/ifpga/base: add SPI and MAX10 device driver")

Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
---
 drivers/raw/ifpga/base/opae_spi.c             |  12 +
 drivers/raw/ifpga/base/opae_spi.h             |   4 +
 drivers/raw/ifpga/base/opae_spi_transaction.c | 215 ++++++++++--------
 3 files changed, 140 insertions(+), 91 deletions(-)

diff --git a/drivers/raw/ifpga/base/opae_spi.c b/drivers/raw/ifpga/base/opae_spi.c
index bfdc83e6cd..d2c955e6b3 100644
--- a/drivers/raw/ifpga/base/opae_spi.c
+++ b/drivers/raw/ifpga/base/opae_spi.c
@@ -239,6 +239,18 @@ int spi_command(struct altera_spi_device *dev, unsigned int chip_select,
 	return 0;
 }
 
+int spi_write(struct altera_spi_device *dev, unsigned int chip_select,
+		unsigned int wlen, void *wdata)
+{
+	return spi_command(dev, chip_select, wlen, wdata, 0, NULL);
+}
+
+int spi_read(struct altera_spi_device *dev, unsigned int chip_select,
+		unsigned int rlen, void *rdata)
+{
+	return spi_command(dev, chip_select, 0, NULL, rlen, rdata);
+}
+
 struct altera_spi_device *altera_spi_alloc(void *base, int type)
 {
 	struct altera_spi_device *spi_dev =
diff --git a/drivers/raw/ifpga/base/opae_spi.h b/drivers/raw/ifpga/base/opae_spi.h
index 73a2276739..e0f87a9088 100644
--- a/drivers/raw/ifpga/base/opae_spi.h
+++ b/drivers/raw/ifpga/base/opae_spi.h
@@ -112,6 +112,10 @@ struct spi_tran_header {
 	u32 addr;
 };
 
+int spi_read(struct altera_spi_device *dev, unsigned int chip_select,
+		unsigned int rlen, void *rdata);
+int spi_write(struct altera_spi_device *dev, unsigned int chip_select,
+		unsigned int wlen, void *wdata);
 int spi_command(struct altera_spi_device *dev, unsigned int chip_select,
 		unsigned int wlen, void *wdata, unsigned int rlen, void *rdata);
 void spi_cs_deactivate(struct altera_spi_device *dev);
diff --git a/drivers/raw/ifpga/base/opae_spi_transaction.c b/drivers/raw/ifpga/base/opae_spi_transaction.c
index d13d2fbc83..99131a1f76 100644
--- a/drivers/raw/ifpga/base/opae_spi_transaction.c
+++ b/drivers/raw/ifpga/base/opae_spi_transaction.c
@@ -40,7 +40,7 @@ static void print_buffer(const char *string, void *buffer, int len)
 	printf("%s print buffer, len=%d\n", string, len);
 
 	for (i = 0; i < len; i++)
-		printf("%x ", *(p+i));
+		printf("%02x ", *(p+i));
 	printf("\n");
 }
 #else
@@ -72,43 +72,6 @@ static void reorder_phy_data(u8 bits_per_word,
 	}
 }
 
-enum {
-	SPI_FOUND_SOP,
-	SPI_FOUND_EOP,
-	SPI_NOT_FOUND,
-};
-
-static int resp_find_sop_eop(unsigned char *resp, unsigned int len,
-		int flags)
-{
-	int ret = SPI_NOT_FOUND;
-
-	unsigned char *b = resp;
-
-	/* find SOP */
-	if (flags != SPI_FOUND_SOP) {
-		while (b < resp + len && *b != SPI_PACKET_SOP)
-			b++;
-
-		if (*b != SPI_PACKET_SOP)
-			goto done;
-
-		ret = SPI_FOUND_SOP;
-	}
-
-	/* find EOP */
-	while (b < resp + len && *b != SPI_PACKET_EOP)
-		b++;
-
-	if (*b != SPI_PACKET_EOP)
-		goto done;
-
-	ret = SPI_FOUND_EOP;
-
-done:
-	return ret;
-}
-
 static void phy_tx_pad(unsigned char *phy_buf, unsigned int phy_buf_len,
 		unsigned int *aligned_len)
 {
@@ -137,6 +100,104 @@ static void phy_tx_pad(unsigned char *phy_buf, unsigned int phy_buf_len,
 		*p++ = SPI_BYTE_IDLE;
 }
 
+#define RX_ALL_IDLE_DATA (SPI_BYTE_IDLE << 24 | SPI_BYTE_IDLE << 16 |	\
+			 SPI_BYTE_IDLE << 8 | SPI_BYTE_IDLE)
+
+static bool all_idle_data(u8 *rxbuf)
+{
+	return *(u32 *)rxbuf == RX_ALL_IDLE_DATA;
+}
+
+static unsigned char *find_eop(u8 *rxbuf, u32 BPW)
+{
+	return memchr(rxbuf, SPI_PACKET_EOP, BPW);
+}
+
+static int do_spi_txrx(struct spi_transaction_dev *dev,
+		unsigned char *tx_buffer,
+		unsigned int tx_len, unsigned char *rx_buffer,
+		unsigned int rx_len,
+		unsigned int *actual_rx)
+{
+	unsigned int rx_cnt = 0;
+	int ret = 0;
+	unsigned int BPW = 4;
+	bool eop_found = false;
+	unsigned char *eop;
+	unsigned char *ptr;
+	unsigned char *rxbuf = rx_buffer;
+	int add_byte = 0;
+	unsigned long ticks;
+	unsigned long timeout;
+
+	/* send command */
+	ret = spi_write(dev->dev, dev->chipselect, tx_len, tx_buffer);
+	if (ret)
+		return -EBUSY;
+
+	timeout = rte_get_timer_cycles() +
+				msecs_to_timer_cycles(2000);
+
+	/* read out data */
+	while (rx_cnt < rx_len) {
+		ret = spi_read(dev->dev, dev->chipselect, BPW, rxbuf);
+		if (ret)
+			return -EBUSY;
+
+		/* skip all of invalid data */
+		if (!eop_found && all_idle_data(rxbuf)) {
+			ticks = rte_get_timer_cycles();
+			if (!time_after(ticks, timeout)) {
+				continue;
+			} else {
+				dev_err(dev, "read spi data timeout\n");
+				return -ETIMEDOUT;
+			}
+		}
+
+		rx_cnt += BPW;
+		if (!eop_found) {
+			/* EOP is found, we read 2 more bytes and exit. */
+			eop = find_eop(rxbuf, BPW);
+			if (eop) {
+				if ((BPW + rxbuf - eop) > 2) {
+					/*
+					 * check if the last 2 bytes are already
+					 * received in current word.
+					 */
+					break;
+				} else if ((BPW + rxbuf - eop) == 2) {
+					/*
+					 * skip if last byte is not SPI_BYTE_ESC
+					 * or SPI_PACKET_ESC. this is the valid
+					 * end of a response too.
+					 */
+					ptr = eop + 1;
+
+					if (*ptr != SPI_BYTE_ESC &&
+							*ptr != SPI_PACKET_ESC)
+						break;
+
+					add_byte = 1;
+				} else {
+					add_byte = 2;
+				}
+
+				rx_len = min(rx_len,
+						IFPGA_ALIGN(rx_cnt +
+							add_byte, BPW));
+				eop_found = true;
+			}
+		}
+		rxbuf += BPW;
+	}
+
+	*actual_rx = rx_cnt;
+	print_buffer("found valid data:", rx_buffer, rx_cnt);
+
+	return ret;
+}
+
 static int byte_to_core_convert(struct spi_transaction_dev *dev,
 		unsigned int send_len, unsigned char *send_data,
 		unsigned int resp_len, unsigned char *resp_data,
@@ -148,15 +209,9 @@ static int byte_to_core_convert(struct spi_transaction_dev *dev,
 	unsigned char *resp_packet = dev->buffer->bytes_resp;
 	unsigned char *p;
 	unsigned char current_byte;
-	unsigned char *tx_buffer;
 	unsigned int tx_len = 0;
-	unsigned char *rx_buffer;
-	unsigned int rx_len = 0;
-	int retry = 0;
-	int spi_flags;
-	unsigned long timeout = msecs_to_timer_cycles(1000);
-	unsigned long ticks;
 	unsigned int resp_max_len = 2 * resp_len;
+	unsigned int actual_rx;
 
 	print_buffer("before bytes:", send_data, send_len);
 
@@ -190,48 +245,15 @@ static int byte_to_core_convert(struct spi_transaction_dev *dev,
 
 	print_buffer("after order to spi:", send_packet, tx_len);
 
-	/* call spi */
-	tx_buffer = send_packet;
-	rx_buffer = resp_packet;
-	rx_len = resp_max_len;
-	spi_flags = SPI_NOT_FOUND;
-
-read_again:
-	ret = spi_command(dev->dev, dev->chipselect, tx_len, tx_buffer,
-			rx_len, rx_buffer);
+	ret = do_spi_txrx(dev, send_packet, tx_len, resp_packet,
+			resp_max_len, &actual_rx);
 	if (ret)
-		return -EBUSY;
-
-	print_buffer("read from spi:", rx_buffer, rx_len);
-
-	/* look for SOP firstly*/
-	ret = resp_find_sop_eop(rx_buffer, rx_len - 1, spi_flags);
-	if (ret != SPI_FOUND_EOP) {
-		tx_buffer = NULL;
-		tx_len = 0;
-		ticks = rte_get_timer_cycles();
-		if (time_after(ticks, timeout) &&
-				retry++ > SPI_MAX_RETRY) {
-			dev_err(NULL, "Have retry %d, found invalid packet data\n",
-				retry);
-			return -EBUSY;
-		}
-
-		if (ret == SPI_FOUND_SOP) {
-			rx_buffer += rx_len;
-			resp_max_len += rx_len;
-		}
-
-		spi_flags = ret;
-		goto read_again;
-	}
-
-	print_buffer("found valid data:", resp_packet, resp_max_len);
+		return ret;
 
 	/* analyze response packet */
 	i = 0;
 	p = resp_data;
-	while (i < resp_max_len) {
+	while (i < actual_rx) {
 		current_byte = resp_packet[i];
 		switch (current_byte) {
 		case SPI_BYTE_IDLE:
@@ -337,9 +359,13 @@ static int packet_to_byte_conver(struct spi_transaction_dev *dev,
 		current_byte = resp_packet[i];
 
 		switch (current_byte) {
-		case SPI_PACKET_ESC:
-		case SPI_PACKET_CHANNEL:
 		case SPI_PACKET_SOP:
+			dev_err(dev, "error on get SOP after SOP\n");
+			return -EINVAL;
+		case SPI_PACKET_CHANNEL:
+			i += 2;
+			break;
+		case SPI_PACKET_ESC:
 			i++;
 			current_byte = resp_packet[i];
 			*p++ = xor_20(current_byte);
@@ -348,23 +374,30 @@ static int packet_to_byte_conver(struct spi_transaction_dev *dev,
 		case SPI_PACKET_EOP:
 			i++;
 			current_byte = resp_packet[i];
-			if (current_byte == SPI_PACKET_ESC ||
-					current_byte == SPI_PACKET_CHANNEL ||
-					current_byte == SPI_PACKET_SOP) {
+			switch (current_byte) {
+			case SPI_PACKET_ESC:
 				i++;
 				current_byte = resp_packet[i];
 				*p++ = xor_20(current_byte);
-			} else
+				break;
+			case SPI_PACKET_CHANNEL:
+			case SPI_PACKET_SOP:
+			case SPI_PACKET_EOP:
+				dev_err(dev, "error get SOP/EOP after EOP\n");
+				return -EINVAL;
+			default:
 				*p++ = current_byte;
-			i = valid_resp_len;
-			break;
+				break;
+			}
+			goto done;
+
 		default:
 			*p++ = current_byte;
 			i++;
 		}
-
 	}
 
+done:
 	*valid = p - resp_buf;
 
 	print_buffer("after packet:", resp_buf, *valid);
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:45.032924906 +0100
+++ 0019-raw-ifpga-base-fix-SPI-transaction.patch	2022-02-25 16:58:44.220990396 +0100
@@ -1 +1 @@
-From eacdd03c79f5d8adfa7d0dad1e75657dbaf4f788 Mon Sep 17 00:00:00 2001
+From 30c9deb946a2adcd873b1e69fb604f7fe7926e0a Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit eacdd03c79f5d8adfa7d0dad1e75657dbaf4f788 ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
-index 9efeecb791..ca3d41fb92 100644
+index bfdc83e6cd..d2c955e6b3 100644
@@ -45 +46 @@
-index af11656e4d..bcff67dd66 100644
+index 73a2276739..e0f87a9088 100644
@@ -48 +49 @@
-@@ -117,6 +117,10 @@ struct spi_tran_header {
+@@ -112,6 +112,10 @@ struct spi_tran_header {
@@ -60 +61 @@
-index 006cdb4c1a..cd50d40629 100644
+index d13d2fbc83..99131a1f76 100644

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

* patch 'net/ice: fix link up when starting device' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (17 preceding siblings ...)
  2022-02-25 17:15 ` patch 'raw/ifpga/base: fix SPI transaction' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'net/bnxt: handle ring cleanup in case of error' " christian.ehrhardt
                   ` (36 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Yunjian Wang; +Cc: Qi Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 5381edac9f1dd70c784a91bd0cf2ea24a26e3b31 Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian@huawei.com>
Date: Tue, 25 Jan 2022 09:39:07 +0800
Subject: [PATCH] net/ice: fix link up when starting device

[ upstream commit 6c76b76dc64183eb2f24a52b90d4ff9feb4872f4 ]

Currently, there is a possibility that the link status is not correct
after set link up, the device ID is 159b. It would be fixed by calling
ice_link_update() while the parameter 'wait_to_complete' is true. It's
reasonable to wait for complete right after set link up as it is not
in an link status change interrupt handling scenario.

Fixes: cf911d90e366 ("net/ice: support link update")

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ice/ice_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 5071eda1c0..f665a89f9c 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2911,7 +2911,7 @@ ice_dev_start(struct rte_eth_dev *dev)
 	ice_dev_set_link_up(dev);
 
 	/* Call get_link_info aq commond to enable/disable LSE */
-	ice_link_update(dev, 0);
+	ice_link_update(dev, 1);
 
 	pf->adapter_stopped = false;
 
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:45.066726406 +0100
+++ 0020-net-ice-fix-link-up-when-starting-device.patch	2022-02-25 16:58:44.224990398 +0100
@@ -1 +1 @@
-From 6c76b76dc64183eb2f24a52b90d4ff9feb4872f4 Mon Sep 17 00:00:00 2001
+From 5381edac9f1dd70c784a91bd0cf2ea24a26e3b31 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 6c76b76dc64183eb2f24a52b90d4ff9feb4872f4 ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
-index 6d85e421cf..d01acb8797 100644
+index 5071eda1c0..f665a89f9c 100644
@@ -25 +26 @@
-@@ -3610,7 +3610,7 @@ ice_dev_start(struct rte_eth_dev *dev)
+@@ -2911,7 +2911,7 @@ ice_dev_start(struct rte_eth_dev *dev)
@@ -28 +29 @@
- 	/* Call get_link_info aq command to enable/disable LSE */
+ 	/* Call get_link_info aq commond to enable/disable LSE */

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

* patch 'net/bnxt: handle ring cleanup in case of error' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (18 preceding siblings ...)
  2022-02-25 17:15 ` patch 'net/ice: fix link up when starting device' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'raw/ifpga/base: fix port feature ID' " christian.ehrhardt
                   ` (35 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Kalesh AP; +Cc: Ajit Khaparde, Somnath Kotur, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 4eb2c96733074b6f9c5841f96aa32bd7730e3ad9 Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Date: Thu, 20 Jan 2022 14:42:26 +0530
Subject: [PATCH] net/bnxt: handle ring cleanup in case of error

[ upstream commit 75915b2b3c577ee5bb938c3f1ab6b51958c431a3 ]

In bnxt_alloc_mem(), after bnxt_alloc_async_ring_struct(),
any of the functions failure causes an error:

bnxt_hwrm_ring_free(): hwrm_ring_free nq failed. rc:1

Fix this by initializing ring->fw_ring_id to INVALID_HW_RING_ID
in bnxt_alloc_async_ring_struct().

Fixes: bd0a14c99f65 ("net/bnxt: use dedicated CPR for async events")

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

diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index d601f249da..b56313a6a9 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -841,6 +841,7 @@ int bnxt_alloc_async_ring_struct(struct bnxt *bp)
 	ring->ring_mask = ring->ring_size - 1;
 	ring->vmem_size = 0;
 	ring->vmem = NULL;
+	ring->fw_ring_id = INVALID_HW_RING_ID;
 
 	bp->async_cp_ring = cpr;
 	cpr->cp_ring_struct = ring;
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:45.104331957 +0100
+++ 0021-net-bnxt-handle-ring-cleanup-in-case-of-error.patch	2022-02-25 16:58:44.224990398 +0100
@@ -1 +1 @@
-From 75915b2b3c577ee5bb938c3f1ab6b51958c431a3 Mon Sep 17 00:00:00 2001
+From 4eb2c96733074b6f9c5841f96aa32bd7730e3ad9 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 75915b2b3c577ee5bb938c3f1ab6b51958c431a3 ]
+
@@ -15 +16,0 @@
-Cc: stable@dpdk.org
@@ -25 +26 @@
-index dc437f314e..5c6c27fed7 100644
+index d601f249da..b56313a6a9 100644
@@ -28 +29 @@
-@@ -851,6 +851,7 @@ int bnxt_alloc_async_ring_struct(struct bnxt *bp)
+@@ -841,6 +841,7 @@ int bnxt_alloc_async_ring_struct(struct bnxt *bp)

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

* patch 'raw/ifpga/base: fix port feature ID' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (19 preceding siblings ...)
  2022-02-25 17:15 ` patch 'net/bnxt: handle ring cleanup in case of error' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'net/memif: remove unnecessary Rx interrupt stub' " christian.ehrhardt
                   ` (34 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Wei Huang; +Cc: Tianfei Zhang, Rosen Xu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 2d59bc708b985c22d9188ed3d5558a2b2ec2ca89 Mon Sep 17 00:00:00 2001
From: Wei Huang <wei.huang@intel.com>
Date: Mon, 24 Jan 2022 21:30:47 -0500
Subject: [PATCH] raw/ifpga/base: fix port feature ID

[ upstream commit e55d8d4c12f30eaccf0912420881e027d7f295f3 ]

Fix ID value of port features to match the definition from hardware.

Fixes: 473c88f9b391 ("drivers/raw: remove rawdev from directory names")

Signed-off-by: Wei Huang <wei.huang@intel.com>
Acked-by: Tianfei Zhang <tianfei.zhang@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
---
 drivers/raw/ifpga/base/ifpga_defines.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/raw/ifpga/base/ifpga_defines.h b/drivers/raw/ifpga/base/ifpga_defines.h
index 9f0147d1ed..7853d2976a 100644
--- a/drivers/raw/ifpga/base/ifpga_defines.h
+++ b/drivers/raw/ifpga/base/ifpga_defines.h
@@ -93,9 +93,9 @@ enum fpga_id_type {
 
 #define PORT_FEATURE_ID_HEADER FEATURE_ID_FIU_HEADER
 #define PORT_FEATURE_ID_ERROR 0x10
-#define PORT_FEATURE_ID_UMSG 0x12
-#define PORT_FEATURE_ID_UINT 0x13
-#define PORT_FEATURE_ID_STP 0x14
+#define PORT_FEATURE_ID_UMSG 0x11
+#define PORT_FEATURE_ID_UINT 0x12
+#define PORT_FEATURE_ID_STP 0x13
 #define PORT_FEATURE_ID_UAFU FEATURE_ID_AFU
 
 /*
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:45.137204303 +0100
+++ 0022-raw-ifpga-base-fix-port-feature-ID.patch	2022-02-25 16:58:44.228990403 +0100
@@ -1 +1 @@
-From e55d8d4c12f30eaccf0912420881e027d7f295f3 Mon Sep 17 00:00:00 2001
+From 2d59bc708b985c22d9188ed3d5558a2b2ec2ca89 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit e55d8d4c12f30eaccf0912420881e027d7f295f3 ]
+
@@ -9 +10,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
-index dca1518a83..8f6203392b 100644
+index 9f0147d1ed..7853d2976a 100644

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

* patch 'net/memif: remove unnecessary Rx interrupt stub' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (20 preceding siblings ...)
  2022-02-25 17:15 ` patch 'raw/ifpga/base: fix port feature ID' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'net/bonding: fix RSS with early configure' " christian.ehrhardt
                   ` (33 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Morten Brørup, Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From c39fd98e6fab1bb19bce9dedfaa177fd020b0c19 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Fri, 14 Jan 2022 12:46:44 -0800
Subject: [PATCH] net/memif: remove unnecessary Rx interrupt stub
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit d6dccbd76692c64cff79a821bc73069dc5b043e4 ]

The code in memif driver to stub out rx_irq_enable is unnecessary
and causes different error returns than other drivers.
The core ethdev code will return -ENOTSUP if the driver has
a null rx_queue_intr_enable callback.

Fixes: 09c7e63a71f9 ("net/memif: introduce memory interface PMD")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 drivers/net/memif/rte_eth_memif.c | 19 -------------------
 1 file changed, 19 deletions(-)

diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c
index 13758c6d9e..fddf84a8fd 100644
--- a/drivers/net/memif/rte_eth_memif.c
+++ b/drivers/net/memif/rte_eth_memif.c
@@ -1412,23 +1412,6 @@ memif_stats_reset(struct rte_eth_dev *dev)
 	return 0;
 }
 
-static int
-memif_rx_queue_intr_enable(struct rte_eth_dev *dev __rte_unused,
-			   uint16_t qid __rte_unused)
-{
-	MIF_LOG(WARNING, "Interrupt mode not supported.");
-
-	return -1;
-}
-
-static int
-memif_rx_queue_intr_disable(struct rte_eth_dev *dev, uint16_t qid __rte_unused)
-{
-	struct pmd_internals *pmd __rte_unused = dev->data->dev_private;
-
-	return 0;
-}
-
 static const struct eth_dev_ops ops = {
 	.dev_start = memif_dev_start,
 	.dev_close = memif_dev_close,
@@ -1438,8 +1421,6 @@ static const struct eth_dev_ops ops = {
 	.rx_queue_setup = memif_rx_queue_setup,
 	.rx_queue_release = memif_queue_release,
 	.tx_queue_release = memif_queue_release,
-	.rx_queue_intr_enable = memif_rx_queue_intr_enable,
-	.rx_queue_intr_disable = memif_rx_queue_intr_disable,
 	.link_update = memif_link_update,
 	.stats_get = memif_stats_get,
 	.stats_reset = memif_stats_reset,
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:45.172458366 +0100
+++ 0023-net-memif-remove-unnecessary-Rx-interrupt-stub.patch	2022-02-25 16:58:44.228990403 +0100
@@ -1 +1 @@
-From d6dccbd76692c64cff79a821bc73069dc5b043e4 Mon Sep 17 00:00:00 2001
+From c39fd98e6fab1bb19bce9dedfaa177fd020b0c19 Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit d6dccbd76692c64cff79a821bc73069dc5b043e4 ]
+
@@ -15 +16,0 @@
-Cc: stable@dpdk.org
@@ -25 +26 @@
-index 59cb5a82a2..d3459c5007 100644
+index 13758c6d9e..fddf84a8fd 100644
@@ -28 +29 @@
-@@ -1500,23 +1500,6 @@ memif_stats_reset(struct rte_eth_dev *dev)
+@@ -1412,23 +1412,6 @@ memif_stats_reset(struct rte_eth_dev *dev)
@@ -51,2 +52,2 @@
- 	.dev_stop = memif_dev_stop,
-@@ -1527,8 +1510,6 @@ static const struct eth_dev_ops ops = {
+ 	.dev_close = memif_dev_close,
+@@ -1438,8 +1421,6 @@ static const struct eth_dev_ops ops = {
@@ -54,2 +55,2 @@
- 	.rx_queue_release = memif_rx_queue_release,
- 	.tx_queue_release = memif_tx_queue_release,
+ 	.rx_queue_release = memif_queue_release,
+ 	.tx_queue_release = memif_queue_release,

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

* patch 'net/bonding: fix RSS with early configure' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (21 preceding siblings ...)
  2022-02-25 17:15 ` patch 'net/memif: remove unnecessary Rx interrupt stub' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'net/hns3: fix using enum as boolean' " christian.ehrhardt
                   ` (32 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Yu Wenjun; +Cc: Min Hu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 21e65fa8ece81729c5e48e070c8aca9bc5d7d670 Mon Sep 17 00:00:00 2001
From: Yu Wenjun <yuwenjun@cmss.chinamobile.com>
Date: Tue, 18 Jan 2022 17:18:52 +0800
Subject: [PATCH] net/bonding: fix RSS with early configure

[ upstream commit 4986aea2b879fb242ae04880eb0ed958f40d199a ]

RSS don't work when bond_ethdev_configure called before
rte_eth_bond_slave_add.

This is because internals->rss_key_len is 0 in bond_ethdev_configure().
If internals->rss_key_len is 0, internals->rss_key can not be set
properly.

e.g.:
doesn't work (examples/bond/main.c):
rte_eth_bond_create()
rte_eth_dev_configure()
rte_eth_bond_slave_add()
rte_eth_dev_start()

works (testpmd):
rte_eth_bond_create()
rte_eth_bond_slave_add()
rte_eth_dev_configure()
rte_eth_dev_start()

Fixing by using 'default_rss_key' when 'internals->rss_key_len' is 0.

Fixes: 6b1a001ec546 ("net/bonding: fix RSS key length")

Signed-off-by: Yu Wenjun <yuwenjun@cmss.chinamobile.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index a9d81fe936..4ec90c0422 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -3491,6 +3491,11 @@ bond_ethdev_configure(struct rte_eth_dev *dev)
 	if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS) {
 		struct rte_eth_rss_conf *rss_conf =
 			&dev->data->dev_conf.rx_adv_conf.rss_conf;
+
+		if (internals->rss_key_len == 0) {
+			internals->rss_key_len = sizeof(default_rss_key);
+		}
+
 		if (rss_conf->rss_key != NULL) {
 			if (internals->rss_key_len > rss_conf->rss_key_len) {
 				RTE_BOND_LOG(ERR, "Invalid rss key length(%u)",
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:45.210292893 +0100
+++ 0024-net-bonding-fix-RSS-with-early-configure.patch	2022-02-25 16:58:44.232990405 +0100
@@ -1 +1 @@
-From 4986aea2b879fb242ae04880eb0ed958f40d199a Mon Sep 17 00:00:00 2001
+From 21e65fa8ece81729c5e48e070c8aca9bc5d7d670 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 4986aea2b879fb242ae04880eb0ed958f40d199a ]
+
@@ -29 +30,0 @@
-Cc: stable@dpdk.org
@@ -38 +39 @@
-index 9607141b39..c72fc64806 100644
+index a9d81fe936..4ec90c0422 100644
@@ -41,2 +42,2 @@
-@@ -3511,6 +3511,11 @@ bond_ethdev_configure(struct rte_eth_dev *dev)
- 	if (dev->data->dev_conf.rxmode.mq_mode & RTE_ETH_MQ_RX_RSS) {
+@@ -3491,6 +3491,11 @@ bond_ethdev_configure(struct rte_eth_dev *dev)
+ 	if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS) {

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

* patch 'net/hns3: fix using enum as boolean' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (22 preceding siblings ...)
  2022-02-25 17:15 ` patch 'net/bonding: fix RSS with early configure' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'net/virtio: fix Tx queue 0 overriden by queue 128' " christian.ehrhardt
                   ` (31 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Huisong Li; +Cc: Min Hu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From ed0cc8521391bb800c2faad1812f48f45a362cb2 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Sat, 22 Jan 2022 09:51:29 +0800
Subject: [PATCH] net/hns3: fix using enum as boolean

[ upstream commit 67d0b17947d6936147f4cbfff6ff938884f14776 ]

The enum type variables cannot be used as bool variables. This patch
fixes for "with->func" in hns3_action_rss_same().

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

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
---
 drivers/net/hns3/hns3_flow.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index ad6f18ec68..ce6f37880a 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1202,7 +1202,8 @@ hns3_action_rss_same(const struct rte_flow_action_rss *comp,
 	if (comp->func == RTE_ETH_HASH_FUNCTION_MAX)
 		func_is_same = false;
 	else
-		func_is_same = (with->func ? (comp->func == with->func) : true);
+		func_is_same = (with->func != RTE_ETH_HASH_FUNCTION_DEFAULT) ?
+				(comp->func == with->func) : true;
 
 	return (func_is_same &&
 		comp->types == (with->types & HNS3_ETH_RSS_SUPPORT) &&
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:45.243862596 +0100
+++ 0025-net-hns3-fix-using-enum-as-boolean.patch	2022-02-25 16:58:44.232990405 +0100
@@ -1 +1 @@
-From 67d0b17947d6936147f4cbfff6ff938884f14776 Mon Sep 17 00:00:00 2001
+From ed0cc8521391bb800c2faad1812f48f45a362cb2 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 67d0b17947d6936147f4cbfff6ff938884f14776 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
-index 5f2b279546..00084872ad 100644
+index ad6f18ec68..ce6f37880a 100644
@@ -22 +23 @@
-@@ -1251,7 +1251,8 @@ hns3_action_rss_same(const struct rte_flow_action_rss *comp,
+@@ -1202,7 +1202,8 @@ hns3_action_rss_same(const struct rte_flow_action_rss *comp,
@@ -26 +27 @@
--		func_is_same = with->func ? (comp->func == with->func) : true;
+-		func_is_same = (with->func ? (comp->func == with->func) : true);

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

* patch 'net/virtio: fix Tx queue 0 overriden by queue 128' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (23 preceding siblings ...)
  2022-02-25 17:15 ` patch 'net/hns3: fix using enum as boolean' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'vdpa/ifc: fix log info mismatch' " christian.ehrhardt
                   ` (30 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Xueming Li; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 58f8e7b7a880ccca9b8a478ad966fe4af1008df3 Mon Sep 17 00:00:00 2001
From: Xueming Li <xuemingl@nvidia.com>
Date: Thu, 2 Dec 2021 21:50:45 +0800
Subject: [PATCH] net/virtio: fix Tx queue 0 overriden by queue 128

[ upstream commit 8a886e573af9d25be33e333e9f5cfb48ddd3646c ]

Both Rx queue and Tx queue are VirtQ in virtio, VQ index is 256 for Tx
queue 128. Uint8 type of TxQ VQ index overflows and overrides Tx queue 0
data.

This patch fixes VQ index type with uint16 type.

Fixes: c1f86306a026 ("virtio: add new driver")

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/net/virtio/virtio_rxtx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index b6a89d59e7..6706366e9f 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -1092,7 +1092,7 @@ virtio_dev_tx_queue_setup(struct rte_eth_dev *dev,
 			unsigned int socket_id __rte_unused,
 			const struct rte_eth_txconf *tx_conf)
 {
-	uint8_t vtpci_queue_idx = 2 * queue_idx + VTNET_SQ_TQ_QUEUE_IDX;
+	uint16_t vtpci_queue_idx = 2 * queue_idx + VTNET_SQ_TQ_QUEUE_IDX;
 	struct virtio_hw *hw = dev->data->dev_private;
 	struct virtqueue *vq = hw->vqs[vtpci_queue_idx];
 	struct virtnet_tx *txvq;
@@ -1136,7 +1136,7 @@ int
 virtio_dev_tx_queue_setup_finish(struct rte_eth_dev *dev,
 				uint16_t queue_idx)
 {
-	uint8_t vtpci_queue_idx = 2 * queue_idx + VTNET_SQ_TQ_QUEUE_IDX;
+	uint16_t vtpci_queue_idx = 2 * queue_idx + VTNET_SQ_TQ_QUEUE_IDX;
 	struct virtio_hw *hw = dev->data->dev_private;
 	struct virtqueue *vq = hw->vqs[vtpci_queue_idx];
 
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:45.282982318 +0100
+++ 0026-net-virtio-fix-Tx-queue-0-overriden-by-queue-128.patch	2022-02-25 16:58:44.236990409 +0100
@@ -1 +1 @@
-From 8a886e573af9d25be33e333e9f5cfb48ddd3646c Mon Sep 17 00:00:00 2001
+From 58f8e7b7a880ccca9b8a478ad966fe4af1008df3 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 8a886e573af9d25be33e333e9f5cfb48ddd3646c ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
-index b39dd92d1b..4795893ec7 100644
+index b6a89d59e7..6706366e9f 100644
@@ -25 +26 @@
-@@ -814,7 +814,7 @@ virtio_dev_tx_queue_setup(struct rte_eth_dev *dev,
+@@ -1092,7 +1092,7 @@ virtio_dev_tx_queue_setup(struct rte_eth_dev *dev,
@@ -29,2 +30,2 @@
--	uint8_t vq_idx = 2 * queue_idx + VTNET_SQ_TQ_QUEUE_IDX;
-+	uint16_t vq_idx = 2 * queue_idx + VTNET_SQ_TQ_QUEUE_IDX;
+-	uint8_t vtpci_queue_idx = 2 * queue_idx + VTNET_SQ_TQ_QUEUE_IDX;
++	uint16_t vtpci_queue_idx = 2 * queue_idx + VTNET_SQ_TQ_QUEUE_IDX;
@@ -32 +33 @@
- 	struct virtqueue *vq = hw->vqs[vq_idx];
+ 	struct virtqueue *vq = hw->vqs[vtpci_queue_idx];
@@ -34 +35 @@
-@@ -858,7 +858,7 @@ int
+@@ -1136,7 +1136,7 @@ int
@@ -38,2 +39,2 @@
--	uint8_t vq_idx = 2 * queue_idx + VTNET_SQ_TQ_QUEUE_IDX;
-+	uint16_t vq_idx = 2 * queue_idx + VTNET_SQ_TQ_QUEUE_IDX;
+-	uint8_t vtpci_queue_idx = 2 * queue_idx + VTNET_SQ_TQ_QUEUE_IDX;
++	uint16_t vtpci_queue_idx = 2 * queue_idx + VTNET_SQ_TQ_QUEUE_IDX;
@@ -41 +42 @@
- 	struct virtqueue *vq = hw->vqs[vq_idx];
+ 	struct virtqueue *vq = hw->vqs[vtpci_queue_idx];

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

* patch 'vdpa/ifc: fix log info mismatch' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (24 preceding siblings ...)
  2022-02-25 17:15 ` patch 'net/virtio: fix Tx queue 0 overriden by queue 128' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'net/virtio-user: check FD flags getting failure' " christian.ehrhardt
                   ` (29 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Andy Pei; +Cc: Chenbo Xia, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 3c97e0b5fc0488b73ed23f33b35b1605d624a6e9 Mon Sep 17 00:00:00 2001
From: Andy Pei <andy.pei@intel.com>
Date: Mon, 13 Dec 2021 15:00:40 +0800
Subject: [PATCH] vdpa/ifc: fix log info mismatch

[ upstream commit 527ec438eb31d4d821624f74d7dfd3b0bcc1c28e ]

Fix log info mismatch.

Fixes: a3f8150eac6d ("net/ifcvf: add ifcvf vDPA driver")

Signed-off-by: Andy Pei <andy.pei@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
---
 drivers/net/ifc/base/ifcvf.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ifc/base/ifcvf.c b/drivers/net/ifc/base/ifcvf.c
index 721cb1da8a..d10c1fd6a4 100644
--- a/drivers/net/ifc/base/ifcvf.c
+++ b/drivers/net/ifc/base/ifcvf.c
@@ -94,12 +94,14 @@ next:
 		return -1;
 	}
 
-	DEBUGOUT("capability mapping:\ncommon cfg: %p\n"
-			"notify base: %p\nisr cfg: %p\ndevice cfg: %p\n"
-			"multiplier: %u\n",
-			hw->common_cfg, hw->dev_cfg,
-			hw->isr, hw->notify_base,
-			hw->notify_off_multiplier);
+	DEBUGOUT("capability mapping:\n"
+		 "common cfg: %p\n"
+		 "notify base: %p\n"
+		 "isr cfg: %p\n"
+		 "device cfg: %p\n"
+		 "multiplier: %u\n",
+		 hw->common_cfg, hw->notify_base, hw->isr, hw->dev_cfg,
+		 hw->notify_off_multiplier);
 
 	return 0;
 }
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:45.322284117 +0100
+++ 0027-vdpa-ifc-fix-log-info-mismatch.patch	2022-02-25 16:58:44.236990409 +0100
@@ -1 +1 @@
-From 527ec438eb31d4d821624f74d7dfd3b0bcc1c28e Mon Sep 17 00:00:00 2001
+From 3c97e0b5fc0488b73ed23f33b35b1605d624a6e9 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 527ec438eb31d4d821624f74d7dfd3b0bcc1c28e ]
+
@@ -9 +10,0 @@
-Cc: stable@dpdk.org
@@ -14 +15 @@
- drivers/vdpa/ifc/base/ifcvf.c | 14 ++++++++------
+ drivers/net/ifc/base/ifcvf.c | 14 ++++++++------
@@ -17 +18 @@
-diff --git a/drivers/vdpa/ifc/base/ifcvf.c b/drivers/vdpa/ifc/base/ifcvf.c
+diff --git a/drivers/net/ifc/base/ifcvf.c b/drivers/net/ifc/base/ifcvf.c
@@ -19,2 +20,2 @@
---- a/drivers/vdpa/ifc/base/ifcvf.c
-+++ b/drivers/vdpa/ifc/base/ifcvf.c
+--- a/drivers/net/ifc/base/ifcvf.c
++++ b/drivers/net/ifc/base/ifcvf.c

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

* patch 'net/virtio-user: check FD flags getting failure' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (25 preceding siblings ...)
  2022-02-25 17:15 ` patch 'vdpa/ifc: fix log info mismatch' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'net/mlx5: reject jump to root table' " christian.ehrhardt
                   ` (28 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Yunjian Wang; +Cc: Chenbo Xia, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 9a6321719c1bb602e651b171b77c8f04491313db Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian@huawei.com>
Date: Sat, 8 Jan 2022 15:52:31 +0800
Subject: [PATCH] net/virtio-user: check FD flags getting failure

[ upstream commit 6abf10a21b293cb427ef21c59f490592717cb211 ]

The function fcntl() could return errors,
the return value need to be checked.

Fixes: 6a84c37e3975 ("net/virtio-user: add vhost-user adapter layer")

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
---
 drivers/net/virtio/virtio_user/vhost_user.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/virtio/virtio_user/vhost_user.c b/drivers/net/virtio/virtio_user/vhost_user.c
index d8e083ba8b..b4e8ec4b4b 100644
--- a/drivers/net/virtio/virtio_user/vhost_user.c
+++ b/drivers/net/virtio/virtio_user/vhost_user.c
@@ -422,8 +422,10 @@ vhost_user_setup(struct virtio_user_dev *dev)
 	}
 
 	flag = fcntl(fd, F_GETFD);
-	if (fcntl(fd, F_SETFD, flag | FD_CLOEXEC) < 0)
-		PMD_DRV_LOG(WARNING, "fcntl failed, %s", strerror(errno));
+	if (flag == -1)
+		PMD_DRV_LOG(WARNING, "fcntl get fd failed, %s", strerror(errno));
+	else if (fcntl(fd, F_SETFD, flag | FD_CLOEXEC) < 0)
+		PMD_DRV_LOG(WARNING, "fcntl set fd failed, %s", strerror(errno));
 
 	memset(&un, 0, sizeof(un));
 	un.sun_family = AF_UNIX;
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:45.354405248 +0100
+++ 0028-net-virtio-user-check-FD-flags-getting-failure.patch	2022-02-25 16:58:44.236990409 +0100
@@ -1 +1 @@
-From 6abf10a21b293cb427ef21c59f490592717cb211 Mon Sep 17 00:00:00 2001
+From 9a6321719c1bb602e651b171b77c8f04491313db Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 6abf10a21b293cb427ef21c59f490592717cb211 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
-index cc830a660f..0a39393c45 100644
+index d8e083ba8b..b4e8ec4b4b 100644
@@ -22 +23 @@
-@@ -840,8 +840,10 @@ vhost_user_setup(struct virtio_user_dev *dev)
+@@ -422,8 +422,10 @@ vhost_user_setup(struct virtio_user_dev *dev)

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

* patch 'net/mlx5: reject jump to root table' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (26 preceding siblings ...)
  2022-02-25 17:15 ` patch 'net/virtio-user: check FD flags getting failure' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'build: fix warning about using -Wextra flag' " christian.ehrhardt
                   ` (27 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Xiaoyu Min; +Cc: Viacheslav Ovsiienko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 7e275590e51019b5b34b86c54b0d126523da93ae Mon Sep 17 00:00:00 2001
From: Xiaoyu Min <jackmin@nvidia.com>
Date: Tue, 18 Jan 2022 19:38:50 +0800
Subject: [PATCH] net/mlx5: reject jump to root table

[ upstream commit 87b26522f7ff65375fb1d773a7f93c70bf857b96 ]

Currently root table as destination is not supported.
The jump action which finally be translated to underlying root table in
rdma-core should be rejected.

Fixes: f78f747f41d0 ("net/mlx5: allow jump to group lower than current")

Signed-off-by: Xiaoyu Min <jackmin@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index e16a98be3b..6f0876f233 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -3487,7 +3487,7 @@ flow_dv_validate_action_jump(const struct rte_flow_action *action,
 			     const struct rte_flow_attr *attributes,
 			     bool external, struct rte_flow_error *error)
 {
-	uint32_t target_group, table;
+	uint32_t target_group, table = 0;
 	int ret = 0;
 
 	if (action_flags & (MLX5_FLOW_FATE_ACTIONS |
@@ -3515,6 +3515,10 @@ flow_dv_validate_action_jump(const struct rte_flow_action *action,
 					  RTE_FLOW_ERROR_TYPE_ACTION, NULL,
 					  "target group must be other than"
 					  " the current flow group");
+	if (table == 0)
+		return rte_flow_error_set(error, EINVAL,
+					  RTE_FLOW_ERROR_TYPE_ACTION_CONF,
+					  NULL, "root table shouldn't be destination");
 	return 0;
 }
 
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:45.391847134 +0100
+++ 0029-net-mlx5-reject-jump-to-root-table.patch	2022-02-25 16:58:44.244990416 +0100
@@ -1 +1 @@
-From 87b26522f7ff65375fb1d773a7f93c70bf857b96 Mon Sep 17 00:00:00 2001
+From 7e275590e51019b5b34b86c54b0d126523da93ae Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 87b26522f7ff65375fb1d773a7f93c70bf857b96 ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index 18992b1e26..af90a7fd0a 100644
+index e16a98be3b..6f0876f233 100644
@@ -23 +24 @@
-@@ -4968,7 +4968,7 @@ flow_dv_validate_action_jump(struct rte_eth_dev *dev,
+@@ -3487,7 +3487,7 @@ flow_dv_validate_action_jump(const struct rte_flow_action *action,
@@ -30,3 +31,3 @@
- 	struct flow_grp_info grp_info = {
- 		.external = !!external,
-@@ -4999,6 +4999,10 @@ flow_dv_validate_action_jump(struct rte_eth_dev *dev,
+ 
+ 	if (action_flags & (MLX5_FLOW_FATE_ACTIONS |
+@@ -3515,6 +3515,10 @@ flow_dv_validate_action_jump(const struct rte_flow_action *action,

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

* patch 'build: fix warning about using -Wextra flag' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (27 preceding siblings ...)
  2022-02-25 17:15 ` patch 'net/mlx5: reject jump to root table' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'kni: fix ioctl signature' " christian.ehrhardt
                   ` (26 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Luca Boccassi, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 921ec4a84bd94d9fde03ce34a7cc3cbbcc94d085 Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Fri, 21 Jan 2022 16:12:30 +0000
Subject: [PATCH] build: fix warning about using -Wextra flag

[ upstream commit d832326ae9b1b67c2976da293a459b51297fcfa0 ]

Each build, meson would issue a warning reporting that the
"warning_level" setting should be used in place of adding -Wextra
directly to our build commands. Testing with meson 0.61 shows that the
only difference for gcc and clang builds between warning levels 1 and
2 is the addition of -Wextra, so we can remove the warning by deleting
our explicit set of Wextra and changing the build defaults to
warning_level 2.

Fixes: 524a0d5d66b9 ("build: enable extra warnings with meson")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
---
 config/meson.build | 5 ++---
 meson.build        | 6 +++++-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/config/meson.build b/config/meson.build
index 25dec320ba..e87d1ba533 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -187,10 +187,9 @@ endif
 add_project_arguments('-include', 'rte_config.h', language: 'c')
 
 # enable extra warnings and disable any unwanted warnings
+# -Wall is added by default at warning level 1, and -Wextra
+# at warning level 2 (DPDK default)
 warning_flags = [
-	# -Wall is added by meson by default, so add -Wextra only
-	'-Wextra',
-
 	# additional warnings in alphabetical order
 	'-Wcast-qual',
 	'-Wdeprecated',
diff --git a/meson.build b/meson.build
index 428b84d22f..00ebbef115 100644
--- a/meson.build
+++ b/meson.build
@@ -7,7 +7,11 @@ project('DPDK', 'C',
 	version: run_command(find_program('cat', 'more'),
 		files('VERSION')).stdout().strip(),
 	license: 'BSD',
-	default_options: ['buildtype=release', 'default_library=static'],
+	default_options: [
+        'buildtype=release',
+        'default_library=static',
+        'warning_level=2',
+    ],
 	meson_version: '>= 0.47.1'
 )
 
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:45.436560656 +0100
+++ 0030-build-fix-warning-about-using-Wextra-flag.patch	2022-02-25 16:58:44.244990416 +0100
@@ -1 +1 @@
-From d832326ae9b1b67c2976da293a459b51297fcfa0 Mon Sep 17 00:00:00 2001
+From 921ec4a84bd94d9fde03ce34a7cc3cbbcc94d085 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit d832326ae9b1b67c2976da293a459b51297fcfa0 ]
+
@@ -24 +26 @@
-index ee12318d4f..7134e80e8d 100644
+index 25dec320ba..e87d1ba533 100644
@@ -27 +29 @@
-@@ -247,10 +247,9 @@ endif
+@@ -187,10 +187,9 @@ endif
@@ -34,2 +36,2 @@
--        # -Wall is added by meson by default, so add -Wextra only
--        '-Wextra',
+-	# -Wall is added by meson by default, so add -Wextra only
+-	'-Wextra',
@@ -37,3 +39,3 @@
-         # additional warnings in alphabetical order
-         '-Wcast-qual',
-         '-Wdeprecated',
+ 	# additional warnings in alphabetical order
+ 	'-Wcast-qual',
+ 	'-Wdeprecated',
@@ -41 +43 @@
-index 1223b79d74..3d97e96f38 100644
+index 428b84d22f..00ebbef115 100644
@@ -45,10 +47,10 @@
-         version: run_command(find_program('cat', 'more'),
-             files('VERSION'), check: true).stdout().strip(),
-         license: 'BSD',
--        default_options: ['buildtype=release', 'default_library=static'],
-+        default_options: [
-+            'buildtype=release',
-+            'default_library=static',
-+            'warning_level=2',
-+        ],
-         meson_version: '>= 0.49.2'
+ 	version: run_command(find_program('cat', 'more'),
+ 		files('VERSION')).stdout().strip(),
+ 	license: 'BSD',
+-	default_options: ['buildtype=release', 'default_library=static'],
++	default_options: [
++        'buildtype=release',
++        'default_library=static',
++        'warning_level=2',
++    ],
+ 	meson_version: '>= 0.47.1'

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

* patch 'kni: fix ioctl signature' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (28 preceding siblings ...)
  2022-02-25 17:15 ` patch 'build: fix warning about using -Wextra flag' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'doc: fix KNI PMD name typo' " christian.ehrhardt
                   ` (25 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Markus Theil; +Cc: Michael Pfeiffer, Stephen Hemminger, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 7eb7d8589b1caa3b9e92a6460d43668ced1ead72 Mon Sep 17 00:00:00 2001
From: Markus Theil <markus.theil@secunet.com>
Date: Fri, 3 Dec 2021 08:19:07 +0100
Subject: [PATCH] kni: fix ioctl signature

[ upstream commit f1b2991c3c0f480fe8e9f6c5c640a1d913b76bed ]

Fix kni's ioctl signature to correctly match the kernel's
structs. This shaves off the (void*) casts and uses struct file*
instead of struct inode*. With the correct signature, control flow
integrity checkers are no longer confused at this point.

Signed-off-by: Markus Theil <markus.theil@secunet.com>
Tested-by: Michael Pfeiffer <michael.pfeiffer@tu-ilmenau.de>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
 kernel/linux/kni/kni_misc.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/kernel/linux/kni/kni_misc.c b/kernel/linux/kni/kni_misc.c
index f4944e1ddf..9b3d20ec69 100644
--- a/kernel/linux/kni/kni_misc.c
+++ b/kernel/linux/kni/kni_misc.c
@@ -478,10 +478,10 @@ kni_ioctl_release(struct net *net, uint32_t ioctl_num,
 	return ret;
 }
 
-static int
-kni_ioctl(struct inode *inode, uint32_t ioctl_num, unsigned long ioctl_param)
+static long
+kni_ioctl(struct file *file, unsigned int ioctl_num, unsigned long ioctl_param)
 {
-	int ret = -EINVAL;
+	long ret = -EINVAL;
 	struct net *net = current->nsproxy->net_ns;
 
 	pr_debug("IOCTL num=0x%0x param=0x%0lx\n", ioctl_num, ioctl_param);
@@ -507,8 +507,8 @@ kni_ioctl(struct inode *inode, uint32_t ioctl_num, unsigned long ioctl_param)
 	return ret;
 }
 
-static int
-kni_compat_ioctl(struct inode *inode, uint32_t ioctl_num,
+static long
+kni_compat_ioctl(struct file *file, unsigned int ioctl_num,
 		unsigned long ioctl_param)
 {
 	/* 32 bits app on 64 bits OS to be supported later */
@@ -521,8 +521,8 @@ static const struct file_operations kni_fops = {
 	.owner = THIS_MODULE,
 	.open = kni_open,
 	.release = kni_release,
-	.unlocked_ioctl = (void *)kni_ioctl,
-	.compat_ioctl = (void *)kni_compat_ioctl,
+	.unlocked_ioctl = kni_ioctl,
+	.compat_ioctl = kni_compat_ioctl,
 };
 
 static struct miscdevice kni_misc = {
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:45.469448904 +0100
+++ 0031-kni-fix-ioctl-signature.patch	2022-02-25 16:58:44.244990416 +0100
@@ -1 +1 @@
-From f1b2991c3c0f480fe8e9f6c5c640a1d913b76bed Mon Sep 17 00:00:00 2001
+From 7eb7d8589b1caa3b9e92a6460d43668ced1ead72 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit f1b2991c3c0f480fe8e9f6c5c640a1d913b76bed ]
+
@@ -19 +21 @@
-index e8a8203c90..ec70190042 100644
+index f4944e1ddf..9b3d20ec69 100644
@@ -22 +24 @@
-@@ -480,10 +480,10 @@ kni_ioctl_release(struct net *net, uint32_t ioctl_num,
+@@ -478,10 +478,10 @@ kni_ioctl_release(struct net *net, uint32_t ioctl_num,
@@ -36 +38 @@
-@@ -509,8 +509,8 @@ kni_ioctl(struct inode *inode, uint32_t ioctl_num, unsigned long ioctl_param)
+@@ -507,8 +507,8 @@ kni_ioctl(struct inode *inode, uint32_t ioctl_num, unsigned long ioctl_param)
@@ -47 +49 @@
-@@ -523,8 +523,8 @@ static const struct file_operations kni_fops = {
+@@ -521,8 +521,8 @@ static const struct file_operations kni_fops = {

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

* patch 'doc: fix KNI PMD name typo' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (29 preceding siblings ...)
  2022-02-25 17:15 ` patch 'kni: fix ioctl signature' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'ring: fix error code when creating ring' " christian.ehrhardt
                   ` (24 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Haiyue Wang; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 685c1a1e68b895bd52dade31f77bb170b4459836 Mon Sep 17 00:00:00 2001
From: Haiyue Wang <haiyue.wang@intel.com>
Date: Wed, 19 Jan 2022 20:26:14 +0800
Subject: [PATCH] doc: fix KNI PMD name typo

[ upstream commit 08c724b3276725549e4426f15be206d1b688795b ]

The KNI PMD name should be "net_kni".

Fixes: 75e2bc54c018 ("net/kni: add KNI PMD")

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 doc/guides/nics/kni.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/guides/nics/kni.rst b/doc/guides/nics/kni.rst
index 90d3040cf5..f403de1fc0 100644
--- a/doc/guides/nics/kni.rst
+++ b/doc/guides/nics/kni.rst
@@ -33,7 +33,7 @@ Usage
 
 EAL ``--vdev`` argument can be used to create KNI device instance, like::
 
-        testpmd --vdev=net_kni0 --vdev=net_kn1 -- -i
+        testpmd --vdev=net_kni0 --vdev=net_kni1 -- -i
 
 Above command will create ``kni0`` and ``kni1`` Linux network interfaces,
 those interfaces can be controlled by standard Linux tools.
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:45.503248463 +0100
+++ 0032-doc-fix-KNI-PMD-name-typo.patch	2022-02-25 16:58:44.244990416 +0100
@@ -1 +1 @@
-From 08c724b3276725549e4426f15be206d1b688795b Mon Sep 17 00:00:00 2001
+From 685c1a1e68b895bd52dade31f77bb170b4459836 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 08c724b3276725549e4426f15be206d1b688795b ]
+
@@ -9 +10,0 @@
-Cc: stable@dpdk.org
@@ -18 +19 @@
-index 37c5411a32..2a23bb3f3b 100644
+index 90d3040cf5..f403de1fc0 100644
@@ -25,2 +26,2 @@
--        dpdk-testpmd --vdev=net_kni0 --vdev=net_kn1 -- -i
-+        dpdk-testpmd --vdev=net_kni0 --vdev=net_kni1 -- -i
+-        testpmd --vdev=net_kni0 --vdev=net_kn1 -- -i
++        testpmd --vdev=net_kni0 --vdev=net_kni1 -- -i

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

* patch 'ring: fix error code when creating ring' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (30 preceding siblings ...)
  2022-02-25 17:15 ` patch 'doc: fix KNI PMD name typo' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'test/mem: fix error check' " christian.ehrhardt
                   ` (23 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Yunjian Wang; +Cc: Nan Zhou, Konstantin Ananyev, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From b737263daeb4bf22b44b73ef4375a4931c6b142f Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian@huawei.com>
Date: Mon, 10 Jan 2022 17:23:03 +0800
Subject: [PATCH] ring: fix error code when creating ring

[ upstream commit 074717be3ef9e7a8868b5af078b0ca7b61bcc44b ]

The error value returned by rte_ring_create_elem() should be positive
integers. However, if the rte_ring_get_memsize_elem() function fails,
a negative number is returned and is directly used as the return value.
As a result, this will cause the external call to check the return
value to fail(like called by rte_mempool_create()).

Fixes: a182620042aa ("ring: get size in memory")

Reported-by: Nan Zhou <zhounan14@huawei.com>
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
 lib/librte_ring/rte_ring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_ring/rte_ring.c b/lib/librte_ring/rte_ring.c
index d9b308036c..6e740e8f9e 100644
--- a/lib/librte_ring/rte_ring.c
+++ b/lib/librte_ring/rte_ring.c
@@ -137,7 +137,7 @@ rte_ring_create(const char *name, unsigned count, int socket_id,
 
 	ring_size = rte_ring_get_memsize(count);
 	if (ring_size < 0) {
-		rte_errno = ring_size;
+		rte_errno = -ring_size;
 		return NULL;
 	}
 
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:45.535788823 +0100
+++ 0033-ring-fix-error-code-when-creating-ring.patch	2022-02-25 16:58:44.248990421 +0100
@@ -1 +1 @@
-From 074717be3ef9e7a8868b5af078b0ca7b61bcc44b Mon Sep 17 00:00:00 2001
+From b737263daeb4bf22b44b73ef4375a4931c6b142f Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 074717be3ef9e7a8868b5af078b0ca7b61bcc44b ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
- lib/ring/rte_ring.c | 2 +-
+ lib/librte_ring/rte_ring.c | 2 +-
@@ -22,5 +23,5 @@
-diff --git a/lib/ring/rte_ring.c b/lib/ring/rte_ring.c
-index f17bd966be..185f9be798 100644
---- a/lib/ring/rte_ring.c
-+++ b/lib/ring/rte_ring.c
-@@ -267,7 +267,7 @@ rte_ring_create_elem(const char *name, unsigned int esize, unsigned int count,
+diff --git a/lib/librte_ring/rte_ring.c b/lib/librte_ring/rte_ring.c
+index d9b308036c..6e740e8f9e 100644
+--- a/lib/librte_ring/rte_ring.c
++++ b/lib/librte_ring/rte_ring.c
+@@ -137,7 +137,7 @@ rte_ring_create(const char *name, unsigned count, int socket_id,
@@ -28 +29 @@
- 	ring_size = rte_ring_get_memsize_elem(esize, count);
+ 	ring_size = rte_ring_get_memsize(count);

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

* patch 'test/mem: fix error check' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (31 preceding siblings ...)
  2022-02-25 17:15 ` patch 'ring: fix error code when creating ring' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'bus/dpaa: fix C++ include guard' " christian.ehrhardt
                   ` (22 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Jie Zhou; +Cc: Dmitry Kozlyuk, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 04e3a108e7f7043f15727173ffc72d157991866f Mon Sep 17 00:00:00 2001
From: Jie Zhou <jizh@linux.microsoft.com>
Date: Tue, 25 Jan 2022 21:10:36 -0800
Subject: [PATCH] test/mem: fix error check

[ upstream commit 068cdfae1fc19a491fc68723997ca89a92501736 ]

Fix incorrect errno variable used in memory autotest.
Use rte_errno instead.

Fixes: 086d426406bd ("test/mem: fix memory autotests on FreeBSD")

Signed-off-by: Jie Zhou <jizh@linux.microsoft.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
---
 app/test/test_memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test/test_memory.c b/app/test/test_memory.c
index dbf6871e71..140ac3f3cf 100644
--- a/app/test/test_memory.c
+++ b/app/test/test_memory.c
@@ -63,7 +63,7 @@ check_seg_fds(const struct rte_memseg_list *msl, const struct rte_memseg *ms,
 	/* we're able to get memseg fd - try getting its offset */
 	ret = rte_memseg_get_fd_offset_thread_unsafe(ms, &offset);
 	if (ret < 0) {
-		if (errno == ENOTSUP)
+		if (rte_errno == ENOTSUP)
 			return 1;
 		return -1;
 	}
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:45.569619611 +0100
+++ 0034-test-mem-fix-error-check.patch	2022-02-25 16:58:44.248990421 +0100
@@ -1 +1 @@
-From 068cdfae1fc19a491fc68723997ca89a92501736 Mon Sep 17 00:00:00 2001
+From 04e3a108e7f7043f15727173ffc72d157991866f Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 068cdfae1fc19a491fc68723997ca89a92501736 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org

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

* patch 'bus/dpaa: fix C++ include guard' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (32 preceding siblings ...)
  2022-02-25 17:15 ` patch 'test/mem: fix error check' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'net/cxgbe: remove useless " christian.ehrhardt
                   ` (21 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Weiguo Li; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From f01ea4e120ec3139dd389f4e2896be7914c0d1ae Mon Sep 17 00:00:00 2001
From: Weiguo Li <liwg06@foxmail.com>
Date: Mon, 7 Feb 2022 20:36:56 +0800
Subject: [PATCH] bus/dpaa: fix C++ include guard

[ upstream commit 1785d9eb62eea2b32c08ea30bfdd318e45b8120c ]

Supplement the missing half of braces for the extern "C" block,
or remove the incomplete guard in internal header.

Fixes: 6d6b4f49a155 ("bus/dpaa: add FMAN hardware operations")
Fixes: 919eeaccb2ba ("bus/dpaa: introduce NXP DPAA bus driver skeleton")

Signed-off-by: Weiguo Li <liwg06@foxmail.com>
---
 drivers/bus/dpaa/include/fsl_fman.h | 4 ----
 drivers/bus/dpaa/rte_dpaa_bus.h     | 4 ++++
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/bus/dpaa/include/fsl_fman.h b/drivers/bus/dpaa/include/fsl_fman.h
index 1d1ce86719..6b426a7b93 100644
--- a/drivers/bus/dpaa/include/fsl_fman.h
+++ b/drivers/bus/dpaa/include/fsl_fman.h
@@ -7,10 +7,6 @@
 #ifndef __FSL_FMAN_H
 #define __FSL_FMAN_H
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /* Status field in FD is updated on Rx side by FMAN with following information.
  * Refer to field description in FM BG.
  */
diff --git a/drivers/bus/dpaa/rte_dpaa_bus.h b/drivers/bus/dpaa/rte_dpaa_bus.h
index 373aca9785..f85bf86cc3 100644
--- a/drivers/bus/dpaa/rte_dpaa_bus.h
+++ b/drivers/bus/dpaa/rte_dpaa_bus.h
@@ -16,6 +16,10 @@
 #include <fsl_bman.h>
 #include <netcfg.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define DPAA_MEMPOOL_OPS_NAME	"dpaa"
 
 #define DEV_TO_DPAA_DEVICE(ptr)	\
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:45.601739873 +0100
+++ 0035-bus-dpaa-fix-C-include-guard.patch	2022-02-25 16:58:44.248990421 +0100
@@ -1 +1 @@
-From 1785d9eb62eea2b32c08ea30bfdd318e45b8120c Mon Sep 17 00:00:00 2001
+From f01ea4e120ec3139dd389f4e2896be7914c0d1ae Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 1785d9eb62eea2b32c08ea30bfdd318e45b8120c ]
+
@@ -19 +21 @@
-index acb344584f..20690f8329 100644
+index 1d1ce86719..6b426a7b93 100644
@@ -22,3 +24,3 @@
-@@ -9,10 +9,6 @@
- 
- #include <rte_compat.h>
+@@ -7,10 +7,6 @@
+ #ifndef __FSL_FMAN_H
+ #define __FSL_FMAN_H
@@ -34 +36 @@
-index 31a5ea3fca..54bb1436fd 100644
+index 373aca9785..f85bf86cc3 100644
@@ -37 +39 @@
-@@ -17,6 +17,10 @@
+@@ -16,6 +16,10 @@
@@ -45,3 +47,3 @@
- /* This sequence number field is used to store event entry index for
-  * driver specific usage. For parallel mode queues, invalid
-  * index will be set and for atomic mode queues, valid value
+ #define DPAA_MEMPOOL_OPS_NAME	"dpaa"
+ 
+ #define DEV_TO_DPAA_DEVICE(ptr)	\

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

* patch 'net/cxgbe: remove useless C++ include guard' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (33 preceding siblings ...)
  2022-02-25 17:15 ` patch 'bus/dpaa: fix C++ include guard' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'net/dpaa2: " christian.ehrhardt
                   ` (20 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Weiguo Li; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 08349a7b9bef5393c66c6658f843ec8b5d235ec1 Mon Sep 17 00:00:00 2001
From: Weiguo Li <liwg06@foxmail.com>
Date: Mon, 7 Feb 2022 20:36:58 +0800
Subject: [PATCH] net/cxgbe: remove useless C++ include guard

[ upstream commit 073ab38ff7ea71f71cb9b9b8b729e4584eaffef3 ]

Remove the incomplete cplusplus guard in internal header.

Fixes: 3bd122eef2cc ("cxgbe/base: add hardware API for Chelsio T5 series adapters")

Signed-off-by: Weiguo Li <liwg06@foxmail.com>
---
 drivers/net/cxgbe/base/common.h | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/net/cxgbe/base/common.h b/drivers/net/cxgbe/base/common.h
index 7e12624be1..fe944d61eb 100644
--- a/drivers/net/cxgbe/base/common.h
+++ b/drivers/net/cxgbe/base/common.h
@@ -12,10 +12,6 @@
 #include "t4_chip_type.h"
 #include "t4fw_interface.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 #define CXGBE_PAGE_SIZE RTE_PGSIZE_4K
 
 #define T4_MEMORY_WRITE 0
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:45.634251718 +0100
+++ 0036-net-cxgbe-remove-useless-C-include-guard.patch	2022-02-25 16:58:44.248990421 +0100
@@ -1 +1 @@
-From 073ab38ff7ea71f71cb9b9b8b729e4584eaffef3 Mon Sep 17 00:00:00 2001
+From 08349a7b9bef5393c66c6658f843ec8b5d235ec1 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 073ab38ff7ea71f71cb9b9b8b729e4584eaffef3 ]
+
@@ -16 +18 @@
-index 58d7d7a8f2..af987b0d5d 100644
+index 7e12624be1..fe944d61eb 100644

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

* patch 'net/dpaa2: remove useless C++ include guard' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (34 preceding siblings ...)
  2022-02-25 17:15 ` patch 'net/cxgbe: remove useless " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'net/hns3: fix max packet size rollback in PF' " christian.ehrhardt
                   ` (19 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Weiguo Li; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 613423a3ad882ff51d4c976e62a7552f3adfbfaa Mon Sep 17 00:00:00 2001
From: Weiguo Li <liwg06@foxmail.com>
Date: Mon, 7 Feb 2022 20:36:59 +0800
Subject: [PATCH] net/dpaa2: remove useless C++ include guard

[ upstream commit 9df62f8574c2ea139432e3fff010d756f0980c45 ]

Remove the incomplete cplusplus guard in internal headers.

Fixes: 72ec7a678e70 ("net/dpaa2: add soft parser driver")

Signed-off-by: Weiguo Li <liwg06@foxmail.com>
---
 drivers/net/dpaa2/dpaa2_sparser.h | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/net/dpaa2/dpaa2_sparser.h b/drivers/net/dpaa2/dpaa2_sparser.h
index 365b8062a9..ed0897928b 100644
--- a/drivers/net/dpaa2/dpaa2_sparser.h
+++ b/drivers/net/dpaa2/dpaa2_sparser.h
@@ -13,10 +13,6 @@
 #ifndef _DPAA2_SPARSER_H
 #define _DPAA2_SPARSER_H
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 #define WRIOP_SS_INITIALIZER(priv)				\
 do {								\
 	/* Base offset of parse profile memory in WRIOP */	\
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:45.666285955 +0100
+++ 0037-net-dpaa2-remove-useless-C-include-guard.patch	2022-02-25 16:58:44.248990421 +0100
@@ -1 +1 @@
-From 9df62f8574c2ea139432e3fff010d756f0980c45 Mon Sep 17 00:00:00 2001
+From 613423a3ad882ff51d4c976e62a7552f3adfbfaa Mon Sep 17 00:00:00 2001
@@ -4,0 +5,2 @@
+
+[ upstream commit 9df62f8574c2ea139432e3fff010d756f0980c45 ]

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

* patch 'net/hns3: fix max packet size rollback in PF' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (35 preceding siblings ...)
  2022-02-25 17:15 ` patch 'net/dpaa2: " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'net/hns3: fix RSS key with null' " christian.ehrhardt
                   ` (18 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Huisong Li; +Cc: Min Hu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From f18c3d166a6fd2b1fdba5d6b6393220fedc48542 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Fri, 28 Jan 2022 10:07:03 +0800
Subject: [PATCH] net/hns3: fix max packet size rollback in PF

[ upstream commit e8f1f783d1cd61faf12658df64726bca88b7ff63 ]

HNS3 PF driver use the hns->pf.mps to restore the MTU when a reset
occurs.
If user fails to configure the MTU, the MPS of PF may not be restored to
the original value.

Fixes: 25fb790f7868 ("net/hns3: fix HW buffer size on MTU update")
Fixes: 1f5ca0b460cd ("net/hns3: support some device operations")
Fixes: d51867db65c1 ("net/hns3: add initialization")

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

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index df76dfce7f..177a526df0 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -2406,7 +2406,6 @@ static int
 hns3_config_mtu(struct hns3_hw *hw, uint16_t mps)
 {
 	struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
-	uint16_t original_mps = hns->pf.mps;
 	int err;
 	int ret;
 
@@ -2416,22 +2415,20 @@ hns3_config_mtu(struct hns3_hw *hw, uint16_t mps)
 		return ret;
 	}
 
-	hns->pf.mps = mps;
 	ret = hns3_buffer_alloc(hw);
 	if (ret) {
 		hns3_err(hw, "failed to allocate buffer, ret = %d", ret);
 		goto rollback;
 	}
 
+	hns->pf.mps = mps;
+
 	return 0;
 
 rollback:
-	err = hns3_set_mac_mtu(hw, original_mps);
-	if (err) {
+	err = hns3_set_mac_mtu(hw, hns->pf.mps);
+	if (err)
 		hns3_err(hw, "fail to rollback MTU, err = %d", err);
-		return ret;
-	}
-	hns->pf.mps = original_mps;
 
 	return ret;
 }
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:45.700844070 +0100
+++ 0038-net-hns3-fix-max-packet-size-rollback-in-PF.patch	2022-02-25 16:58:44.252990423 +0100
@@ -1 +1 @@
-From e8f1f783d1cd61faf12658df64726bca88b7ff63 Mon Sep 17 00:00:00 2001
+From f18c3d166a6fd2b1fdba5d6b6393220fedc48542 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit e8f1f783d1cd61faf12658df64726bca88b7ff63 ]
+
@@ -14 +15,0 @@
-Cc: stable@dpdk.org
@@ -23 +24 @@
-index a5114662d2..73bf209717 100644
+index df76dfce7f..177a526df0 100644
@@ -26 +27 @@
-@@ -2075,7 +2075,6 @@ static int
+@@ -2406,7 +2406,6 @@ static int
@@ -34 +35 @@
-@@ -2085,22 +2084,20 @@ hns3_config_mtu(struct hns3_hw *hw, uint16_t mps)
+@@ -2416,22 +2415,20 @@ hns3_config_mtu(struct hns3_hw *hw, uint16_t mps)

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

* patch 'net/hns3: fix RSS key with null' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (36 preceding siblings ...)
  2022-02-25 17:15 ` patch 'net/hns3: fix max packet size rollback in PF' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'net/ixgbe: check filter init failure' " christian.ehrhardt
                   ` (17 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Lijun Ou; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 04768eab277ce59288344e14a963793d4a9ea451 Mon Sep 17 00:00:00 2001
From: Lijun Ou <oulijun@huawei.com>
Date: Fri, 28 Jan 2022 10:07:04 +0800
Subject: [PATCH] net/hns3: fix RSS key with null

[ upstream commit e995c91dcc426e83d4d0d6681b8d3dc0d313c655 ]

Since the patch '1848b117' has initialized the variable 'key' in
'struct rte_flow_action_rss' with 'NULL', the PMD will use the
default RSS key when create the first RSS rule with NULL RSS key.
Then, if create a repeated RSS rule with the above, it will not
identify duplicate rules and return an error message.

To solve the preceding problem, determine whether the current RSS keys
are the same based on whether the length of key_len of rss is 0.

Fixes: 1848b117cca1 ("app/testpmd: fix RSS key for flow API RSS rule")

Signed-off-by: Lijun Ou <oulijun@huawei.com>
---
 drivers/net/hns3/hns3_flow.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index ce6f37880a..a3bc037062 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1189,6 +1189,7 @@ static bool
 hns3_action_rss_same(const struct rte_flow_action_rss *comp,
 		     const struct rte_flow_action_rss *with)
 {
+	bool rss_key_is_same;
 	bool func_is_same;
 
 	/*
@@ -1205,11 +1206,16 @@ hns3_action_rss_same(const struct rte_flow_action_rss *comp,
 		func_is_same = (with->func != RTE_ETH_HASH_FUNCTION_DEFAULT) ?
 				(comp->func == with->func) : true;
 
-	return (func_is_same &&
+	if (with->key_len == 0 || with->key == NULL)
+		rss_key_is_same = 1;
+	else
+		rss_key_is_same = comp->key_len == with->key_len &&
+		!memcmp(comp->key, with->key, with->key_len);
+
+	return (func_is_same && rss_key_is_same &&
 		comp->types == (with->types & HNS3_ETH_RSS_SUPPORT) &&
-		comp->level == with->level && comp->key_len == with->key_len &&
+		comp->level == with->level &&
 		comp->queue_num == with->queue_num &&
-		!memcmp(comp->key, with->key, with->key_len) &&
 		!memcmp(comp->queue, with->queue,
 			sizeof(*with->queue) * with->queue_num));
 }
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:45.738230299 +0100
+++ 0039-net-hns3-fix-RSS-key-with-null.patch	2022-02-25 16:58:44.256990428 +0100
@@ -1 +1 @@
-From e995c91dcc426e83d4d0d6681b8d3dc0d313c655 Mon Sep 17 00:00:00 2001
+From 04768eab277ce59288344e14a963793d4a9ea451 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit e995c91dcc426e83d4d0d6681b8d3dc0d313c655 ]
+
@@ -16 +17,0 @@
-Cc: stable@dpdk.org
@@ -24 +25 @@
-index 56ef6f57b2..aba07aaa6f 100644
+index ce6f37880a..a3bc037062 100644
@@ -27 +28 @@
-@@ -1286,6 +1286,7 @@ static bool
+@@ -1189,6 +1189,7 @@ static bool
@@ -35 +36 @@
-@@ -1302,11 +1303,16 @@ hns3_action_rss_same(const struct rte_flow_action_rss *comp,
+@@ -1205,11 +1206,16 @@ hns3_action_rss_same(const struct rte_flow_action_rss *comp,

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

* patch 'net/ixgbe: check filter init failure' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (37 preceding siblings ...)
  2022-02-25 17:15 ` patch 'net/hns3: fix RSS key with null' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'net/bonding: fix promiscuous and allmulticast state' " christian.ehrhardt
                   ` (16 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Yunjian Wang; +Cc: Haiyue Wang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 9ec546fff4c726b3a62b1383481b77ba701b1f74 Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian@huawei.com>
Date: Fri, 24 Dec 2021 19:26:38 +0800
Subject: [PATCH] net/ixgbe: check filter init failure

[ upstream commit 8c1e5c658c24553d5f813adc8afed8910e6f5194 ]

The function ixgbe_fdir_filter_init() and ixgbe_l2_tn_filter_init()
could return errors, the return value need to be checked and returned.

Fixes: 080e3c0ee989 ("net/ixgbe: store flow director filter")
Fixes: d0c0c416ef1f ("net/ixgbe: store L2 tunnel filter")

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 32 +++++++++++++++++++++++---------
 1 file changed, 23 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index a9607e7914..bd2a684941 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1277,13 +1277,8 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
 
 	/* initialize PF if max_vfs not zero */
 	ret = ixgbe_pf_host_init(eth_dev);
-	if (ret) {
-		rte_free(eth_dev->data->mac_addrs);
-		eth_dev->data->mac_addrs = NULL;
-		rte_free(eth_dev->data->hash_mac_addrs);
-		eth_dev->data->hash_mac_addrs = NULL;
-		return ret;
-	}
+	if (ret)
+		goto err_pf_host_init;
 
 	ctrl_ext = IXGBE_READ_REG(hw, IXGBE_CTRL_EXT);
 	/* let hardware know driver is loaded */
@@ -1322,10 +1317,14 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
 	TAILQ_INIT(&filter_info->fivetuple_list);
 
 	/* initialize flow director filter list & hash */
-	ixgbe_fdir_filter_init(eth_dev);
+	ret = ixgbe_fdir_filter_init(eth_dev);
+	if (ret)
+		goto err_fdir_filter_init;
 
 	/* initialize l2 tunnel filter list & hash */
-	ixgbe_l2_tn_filter_init(eth_dev);
+	ret = ixgbe_l2_tn_filter_init(eth_dev);
+	if (ret)
+		goto err_l2_tn_filter_init;
 
 	/* initialize flow filter lists */
 	ixgbe_filterlist_init();
@@ -1337,6 +1336,21 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
 	ixgbe_tm_conf_init(eth_dev);
 
 	return 0;
+
+err_l2_tn_filter_init:
+	ixgbe_fdir_filter_uninit(eth_dev);
+err_fdir_filter_init:
+	ixgbe_disable_intr(hw);
+	rte_intr_disable(intr_handle);
+	rte_intr_callback_unregister(intr_handle,
+		ixgbe_dev_interrupt_handler, eth_dev);
+	ixgbe_pf_host_uninit(eth_dev);
+err_pf_host_init:
+	rte_free(eth_dev->data->mac_addrs);
+	eth_dev->data->mac_addrs = NULL;
+	rte_free(eth_dev->data->hash_mac_addrs);
+	eth_dev->data->hash_mac_addrs = NULL;
+	return ret;
 }
 
 static int
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:45.772592958 +0100
+++ 0040-net-ixgbe-check-filter-init-failure.patch	2022-02-25 16:58:44.264990435 +0100
@@ -1 +1 @@
-From 8c1e5c658c24553d5f813adc8afed8910e6f5194 Mon Sep 17 00:00:00 2001
+From 9ec546fff4c726b3a62b1383481b77ba701b1f74 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 8c1e5c658c24553d5f813adc8afed8910e6f5194 ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index c8f0460440..2f4ebb4e59 100644
+index a9607e7914..bd2a684941 100644
@@ -23 +24 @@
-@@ -1223,13 +1223,8 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
+@@ -1277,13 +1277,8 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
@@ -39 +40 @@
-@@ -1268,10 +1263,14 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
+@@ -1322,10 +1317,14 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
@@ -56 +57 @@
-@@ -1283,6 +1282,21 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
+@@ -1337,6 +1336,21 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)

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

* patch 'net/bonding: fix promiscuous and allmulticast state' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (38 preceding siblings ...)
  2022-02-25 17:15 ` patch 'net/ixgbe: check filter init failure' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'net/bonding: fix reference count on mbufs' " christian.ehrhardt
                   ` (15 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Min Hu (Connor); +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 98417a7b4f1d90977032660b7c4c509161ce8485 Mon Sep 17 00:00:00 2001
From: "Min Hu (Connor)" <humin29@huawei.com>
Date: Fri, 28 Jan 2022 10:25:32 +0800
Subject: [PATCH] net/bonding: fix promiscuous and allmulticast state

[ upstream commit ac5341f5f9bab7b87b1a71761c40d204a7e6ab86 ]

Currently, promiscuous or allmulticast state of bonding port will not be
passed to the new primary slave when active/standby switch-over. It
causes bugs in some scenario.

For example, promiscuous state of bonding port is off now, primary slave
(called A) is off but secondary slave(called B) is on.
Then active/standby switch-over, promiscuous state of the bonding port
is off, but the new primary slave turns to be B and its promiscuous
state is still on.
It is not consistent with bonding port. And this patch will fix it.

Fixes: 2efb58cbab6e ("bond: new link bonding library")
Fixes: 68218b87c184 ("net/bonding: prefer allmulti to promiscuous for LACP")

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 70 ++++++++++++++++++++++++++
 1 file changed, 70 insertions(+)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 4ec90c0422..95e8cbaa57 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -2651,6 +2651,39 @@ bond_ethdev_promiscuous_disable(struct rte_eth_dev *dev)
 	return ret;
 }
 
+static int
+bond_ethdev_promiscuous_update(struct rte_eth_dev *dev)
+{
+	struct bond_dev_private *internals = dev->data->dev_private;
+	uint16_t port_id = internals->current_primary_port;
+
+	switch (internals->mode) {
+	case BONDING_MODE_ROUND_ROBIN:
+	case BONDING_MODE_BALANCE:
+	case BONDING_MODE_BROADCAST:
+	case BONDING_MODE_8023AD:
+		/* As promiscuous mode is propagated to all slaves for these
+		 * mode, no need to update for bonding device.
+		 */
+		break;
+	case BONDING_MODE_ACTIVE_BACKUP:
+	case BONDING_MODE_TLB:
+	case BONDING_MODE_ALB:
+	default:
+		/* As promiscuous mode is propagated only to primary slave
+		 * for these mode. When active/standby switchover, promiscuous
+		 * mode should be set to new primary slave according to bonding
+		 * device.
+		 */
+		if (rte_eth_promiscuous_get(internals->port_id) == 1)
+			rte_eth_promiscuous_enable(port_id);
+		else
+			rte_eth_promiscuous_disable(port_id);
+	}
+
+	return 0;
+}
+
 static int
 bond_ethdev_allmulticast_enable(struct rte_eth_dev *eth_dev)
 {
@@ -2764,6 +2797,39 @@ bond_ethdev_allmulticast_disable(struct rte_eth_dev *eth_dev)
 	return ret;
 }
 
+static int
+bond_ethdev_allmulticast_update(struct rte_eth_dev *dev)
+{
+	struct bond_dev_private *internals = dev->data->dev_private;
+	uint16_t port_id = internals->current_primary_port;
+
+	switch (internals->mode) {
+	case BONDING_MODE_ROUND_ROBIN:
+	case BONDING_MODE_BALANCE:
+	case BONDING_MODE_BROADCAST:
+	case BONDING_MODE_8023AD:
+		/* As allmulticast mode is propagated to all slaves for these
+		 * mode, no need to update for bonding device.
+		 */
+		break;
+	case BONDING_MODE_ACTIVE_BACKUP:
+	case BONDING_MODE_TLB:
+	case BONDING_MODE_ALB:
+	default:
+		/* As allmulticast mode is propagated only to primary slave
+		 * for these mode. When active/standby switchover, allmulticast
+		 * mode should be set to new primary slave according to bonding
+		 * device.
+		 */
+		if (rte_eth_allmulticast_get(internals->port_id) == 1)
+			rte_eth_allmulticast_enable(port_id);
+		else
+			rte_eth_allmulticast_disable(port_id);
+	}
+
+	return 0;
+}
+
 static void
 bond_ethdev_delayed_lsc_propagation(void *arg)
 {
@@ -2853,6 +2919,8 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type,
 			lsc_flag = 1;
 
 			mac_address_slaves_update(bonded_eth_dev);
+			bond_ethdev_promiscuous_update(bonded_eth_dev);
+			bond_ethdev_allmulticast_update(bonded_eth_dev);
 		}
 
 		activate_slave(bonded_eth_dev, port_id);
@@ -2882,6 +2950,8 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type,
 			else
 				internals->current_primary_port = internals->primary_port;
 			mac_address_slaves_update(bonded_eth_dev);
+			bond_ethdev_promiscuous_update(bonded_eth_dev);
+			bond_ethdev_allmulticast_update(bonded_eth_dev);
 		}
 	}
 
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:45.816928992 +0100
+++ 0041-net-bonding-fix-promiscuous-and-allmulticast-state.patch	2022-02-25 16:58:44.268990437 +0100
@@ -1 +1 @@
-From ac5341f5f9bab7b87b1a71761c40d204a7e6ab86 Mon Sep 17 00:00:00 2001
+From 98417a7b4f1d90977032660b7c4c509161ce8485 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit ac5341f5f9bab7b87b1a71761c40d204a7e6ab86 ]
+
@@ -19 +20,0 @@
-Cc: stable@dpdk.org
@@ -27 +28 @@
-index e5abe90e07..d2fcfad676 100644
+index 4ec90c0422..95e8cbaa57 100644
@@ -30 +31 @@
-@@ -2691,6 +2691,39 @@ bond_ethdev_promiscuous_disable(struct rte_eth_dev *dev)
+@@ -2651,6 +2651,39 @@ bond_ethdev_promiscuous_disable(struct rte_eth_dev *dev)
@@ -70 +71 @@
-@@ -2804,6 +2837,39 @@ bond_ethdev_allmulticast_disable(struct rte_eth_dev *eth_dev)
+@@ -2764,6 +2797,39 @@ bond_ethdev_allmulticast_disable(struct rte_eth_dev *eth_dev)
@@ -110 +111 @@
-@@ -2893,6 +2959,8 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type,
+@@ -2853,6 +2919,8 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type,
@@ -119 +120 @@
-@@ -2922,6 +2990,8 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type,
+@@ -2882,6 +2950,8 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type,

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

* patch 'net/bonding: fix reference count on mbufs' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (39 preceding siblings ...)
  2022-02-25 17:15 ` patch 'net/bonding: fix promiscuous and allmulticast state' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'app/testpmd: fix bonding mode set' " christian.ehrhardt
                   ` (14 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Min Hu (Connor); +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 2e48567d11a67b37f231c94c37d28ea22e9c4c18 Mon Sep 17 00:00:00 2001
From: "Min Hu (Connor)" <humin29@huawei.com>
Date: Fri, 28 Jan 2022 10:25:33 +0800
Subject: [PATCH] net/bonding: fix reference count on mbufs

[ upstream commit 814e79f3afad8c45c6922617f26292af3221ae2b ]

In bonding Tx broadcast mode, Packets should be sent by every slave,
but only one mbuf exits. The solution is to increment reference count
on mbufs, but it ignores multi segments.

This patch fixed it by adding reference for every segment in multi
segments Tx scenario.

Fixes: 2efb58cbab6e ("bond: new link bonding library")

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 95e8cbaa57..5b1507e817 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -1322,7 +1322,7 @@ bond_ethdev_tx_burst_broadcast(void *queue, struct rte_mbuf **bufs,
 
 	/* Increment reference count on mbufs */
 	for (i = 0; i < nb_pkts; i++)
-		rte_mbuf_refcnt_update(bufs[i], num_of_slaves - 1);
+		rte_pktmbuf_refcnt_update(bufs[i], num_of_slaves - 1);
 
 	/* Transmit burst on each active slave */
 	for (i = 0; i < num_of_slaves; i++) {
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:45.854933062 +0100
+++ 0042-net-bonding-fix-reference-count-on-mbufs.patch	2022-02-25 16:58:44.268990437 +0100
@@ -1 +1 @@
-From 814e79f3afad8c45c6922617f26292af3221ae2b Mon Sep 17 00:00:00 2001
+From 2e48567d11a67b37f231c94c37d28ea22e9c4c18 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 814e79f3afad8c45c6922617f26292af3221ae2b ]
+
@@ -14 +15,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
-index d2fcfad676..bfa931098e 100644
+index 95e8cbaa57..5b1507e817 100644
@@ -25 +26 @@
-@@ -1318,7 +1318,7 @@ bond_ethdev_tx_burst_broadcast(void *queue, struct rte_mbuf **bufs,
+@@ -1322,7 +1322,7 @@ bond_ethdev_tx_burst_broadcast(void *queue, struct rte_mbuf **bufs,

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

* patch 'app/testpmd: fix bonding mode set' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (40 preceding siblings ...)
  2022-02-25 17:15 ` patch 'net/bonding: fix reference count on mbufs' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'stack: fix stubs header export' " christian.ehrhardt
                   ` (13 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Min Hu (Connor); +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 81decddb44d9da3a9d3571e26008b80408b62375 Mon Sep 17 00:00:00 2001
From: "Min Hu (Connor)" <humin29@huawei.com>
Date: Fri, 28 Jan 2022 10:35:19 +0800
Subject: [PATCH] app/testpmd: fix bonding mode set

[ upstream commit 39ddd5d1895e72ba2bc974eddbc12a3135639ed1 ]

when start testpmd, and type command like this, it will lead to
Segmentation fault, like:

testpmd> create bonded device 4 0
testpmd> add bonding slave 0 2
testpmd> add bonding slave 1 2
testpmd> port start 2
testpmd> set bonding mode 0 2
testpmd> quit
Stopping port 0...
Stopping ports...
...
Bye...
Segmentation fault

The reason to the bug is that rte timer do not be cancelled when quit.
That is, in 'bond_ethdev_start', resources are allocated according to
different bonding mode. In 'bond_ethdev_stop', resources are free by
the corresponding mode.

For example, 'bond_ethdev_start' start bond_mode_8023ad_ext_periodic_cb
timer for bonding mode 4. and 'bond_ethdev_stop' cancel the timer only
when the current bonding mode is 4. If the bonding mode is changed,
and directly quit the process, the timer will still on, and freed memory
will be accessed, then segmentation fault.

'bonding mode' changed means resources changed, reallocate resources for
different mode should be done, that is, device should be restarted.

Fixes: 2950a769315e ("bond: testpmd support")

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 app/test-pmd/cmdline.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 1e44a998fc..a3b991ea1b 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -5672,6 +5672,19 @@ static void cmd_set_bonding_mode_parsed(void *parsed_result,
 {
 	struct cmd_set_bonding_mode_result *res = parsed_result;
 	portid_t port_id = res->port_id;
+	struct rte_port *port = &ports[port_id];
+
+	/*
+	 * Bonding mode changed means resources of device changed, like whether
+	 * started rte timer or not. Device should be restarted when resources
+	 * of device changed.
+	 */
+	if (port->port_status != RTE_PORT_STOPPED) {
+		fprintf(stderr,
+			"\t Error: Can't set bonding mode when port %d is not stopped\n",
+			port_id);
+		return;
+	}
 
 	/* Set the bonding mode for the relevant port. */
 	if (0 != rte_eth_bond_mode_set(port_id, res->value))
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:45.890479958 +0100
+++ 0043-app-testpmd-fix-bonding-mode-set.patch	2022-02-25 16:58:44.288990455 +0100
@@ -1 +1 @@
-From 39ddd5d1895e72ba2bc974eddbc12a3135639ed1 Mon Sep 17 00:00:00 2001
+From 81decddb44d9da3a9d3571e26008b80408b62375 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 39ddd5d1895e72ba2bc974eddbc12a3135639ed1 ]
+
@@ -36 +37,0 @@
-Cc: stable@dpdk.org
@@ -45 +46 @@
-index e626b1c7d9..16ad4be005 100644
+index 1e44a998fc..a3b991ea1b 100644
@@ -48 +49 @@
-@@ -5915,6 +5915,19 @@ static void cmd_set_bonding_mode_parsed(void *parsed_result,
+@@ -5672,6 +5672,19 @@ static void cmd_set_bonding_mode_parsed(void *parsed_result,

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

* patch 'stack: fix stubs header export' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (41 preceding siblings ...)
  2022-02-25 17:15 ` patch 'app/testpmd: fix bonding mode set' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'ipsec: fix C++ include' " christian.ehrhardt
                   ` (12 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: David Marchand; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 6578183ebd2725ce4df8c0af502a4d5785694336 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Thu, 10 Feb 2022 09:55:43 +0100
Subject: [PATCH] stack: fix stubs header export

[ upstream commit 8adf5f528bf3321feeae2231007ebae162032739 ]

The stubs header is included as part of rte_stack.h for architectures
other than x86_64 and aarch64 (i.e. x86 32 bits and ppc).

Note: chkincs won't catch this issue since it checks headers from within
the source directory.

Fixes: 7911ba0473e0 ("stack: enable lock-free implementation for aarch64")

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/librte_stack/meson.build | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/librte_stack/meson.build b/lib/librte_stack/meson.build
index f420a5c223..ef29dd6959 100644
--- a/lib/librte_stack/meson.build
+++ b/lib/librte_stack/meson.build
@@ -8,4 +8,6 @@ headers = files('rte_stack.h',
 		'rte_stack_std.h',
 		'rte_stack_lf.h',
 		'rte_stack_lf_generic.h',
-		'rte_stack_lf_c11.h')
+		'rte_stack_lf_c11.h',
+		'rte_stack_lf_stubs.h',
+)
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:45.940779961 +0100
+++ 0044-stack-fix-stubs-header-export.patch	2022-02-25 16:58:44.288990455 +0100
@@ -1 +1 @@
-From 8adf5f528bf3321feeae2231007ebae162032739 Mon Sep 17 00:00:00 2001
+From 6578183ebd2725ce4df8c0af502a4d5785694336 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 8adf5f528bf3321feeae2231007ebae162032739 ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -17,2 +18,2 @@
- lib/stack/meson.build | 1 +
- 1 file changed, 1 insertion(+)
+ lib/librte_stack/meson.build | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
@@ -20,10 +21,12 @@
-diff --git a/lib/stack/meson.build b/lib/stack/meson.build
-index 2f53f49677..18177a742f 100644
---- a/lib/stack/meson.build
-+++ b/lib/stack/meson.build
-@@ -9,4 +9,5 @@ indirect_headers += files(
-         'rte_stack_lf.h',
-         'rte_stack_lf_generic.h',
-         'rte_stack_lf_c11.h',
-+        'rte_stack_lf_stubs.h',
- )
+diff --git a/lib/librte_stack/meson.build b/lib/librte_stack/meson.build
+index f420a5c223..ef29dd6959 100644
+--- a/lib/librte_stack/meson.build
++++ b/lib/librte_stack/meson.build
+@@ -8,4 +8,6 @@ headers = files('rte_stack.h',
+ 		'rte_stack_std.h',
+ 		'rte_stack_lf.h',
+ 		'rte_stack_lf_generic.h',
+-		'rte_stack_lf_c11.h')
++		'rte_stack_lf_c11.h',
++		'rte_stack_lf_stubs.h',
++)

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

* patch 'ipsec: fix C++ include' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (42 preceding siblings ...)
  2022-02-25 17:15 ` patch 'stack: fix stubs header export' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'table: " christian.ehrhardt
                   ` (11 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Konstantin Ananyev, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From adda8aa04b5e98694121ca763d6a98fd75c44488 Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Thu, 10 Feb 2022 15:42:36 +0000
Subject: [PATCH] ipsec: fix C++ include

[ upstream commit e82470e22528ad7c0277aa94ecbc6b97f3bdb4c2 ]

C++ does not have automatic casting to/from void pointers, so need
explicit cast if header is to be included in C++ code

Fixes: f901d9c82688 ("ipsec: add helpers to group completed crypto-ops")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
 lib/librte_ipsec/rte_ipsec_group.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_ipsec/rte_ipsec_group.h b/lib/librte_ipsec/rte_ipsec_group.h
index 47b33ca5ec..27a2f6f26d 100644
--- a/lib/librte_ipsec/rte_ipsec_group.h
+++ b/lib/librte_ipsec/rte_ipsec_group.h
@@ -51,10 +51,10 @@ rte_ipsec_ses_from_crypto(const struct rte_crypto_op *cop)
 
 	if (cop->sess_type == RTE_CRYPTO_OP_SECURITY_SESSION) {
 		ss = cop->sym[0].sec_session;
-		return (void *)(uintptr_t)ss->opaque_data;
+		return (struct rte_ipsec_session *)(uintptr_t)ss->opaque_data;
 	} else if (cop->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
 		cs = cop->sym[0].session;
-		return (void *)(uintptr_t)cs->opaque_data;
+		return (struct rte_ipsec_session *)(uintptr_t)cs->opaque_data;
 	}
 	return NULL;
 }
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:45.977174059 +0100
+++ 0045-ipsec-fix-C-include.patch	2022-02-25 16:58:44.288990455 +0100
@@ -1 +1 @@
-From e82470e22528ad7c0277aa94ecbc6b97f3bdb4c2 Mon Sep 17 00:00:00 2001
+From adda8aa04b5e98694121ca763d6a98fd75c44488 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit e82470e22528ad7c0277aa94ecbc6b97f3bdb4c2 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -15 +16 @@
- lib/ipsec/rte_ipsec_group.h | 4 ++--
+ lib/librte_ipsec/rte_ipsec_group.h | 4 ++--
@@ -18,5 +19,5 @@
-diff --git a/lib/ipsec/rte_ipsec_group.h b/lib/ipsec/rte_ipsec_group.h
-index 60ab297710..62c2bd7217 100644
---- a/lib/ipsec/rte_ipsec_group.h
-+++ b/lib/ipsec/rte_ipsec_group.h
-@@ -49,10 +49,10 @@ rte_ipsec_ses_from_crypto(const struct rte_crypto_op *cop)
+diff --git a/lib/librte_ipsec/rte_ipsec_group.h b/lib/librte_ipsec/rte_ipsec_group.h
+index 47b33ca5ec..27a2f6f26d 100644
+--- a/lib/librte_ipsec/rte_ipsec_group.h
++++ b/lib/librte_ipsec/rte_ipsec_group.h
+@@ -51,10 +51,10 @@ rte_ipsec_ses_from_crypto(const struct rte_crypto_op *cop)

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

* patch 'table: fix C++ include' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (43 preceding siblings ...)
  2022-02-25 17:15 ` patch 'ipsec: fix C++ include' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'vhost: " christian.ehrhardt
                   ` (10 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From b85a9bff6a1839071d619a78b5a830eb6fde9aac Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Thu, 10 Feb 2022 15:42:37 +0000
Subject: [PATCH] table: fix C++ include

[ upstream commit 097ea8e274440919433cd932ec7a1b2f3956180b ]

Since C++ doesn't support automatic casting from void * to other types,
we need to explicitly add the casts to any header files in DPDK.

Fixes: ea7be0a0386e ("lib/librte_table: add hash function headers")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/librte_table/rte_table_hash_func.h | 32 +++++++++++++-------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/lib/librte_table/rte_table_hash_func.h b/lib/librte_table/rte_table_hash_func.h
index 350c795649..d4f126ab5f 100644
--- a/lib/librte_table/rte_table_hash_func.h
+++ b/lib/librte_table/rte_table_hash_func.h
@@ -58,8 +58,8 @@ static inline uint64_t
 rte_table_hash_crc_key8(void *key, void *mask, __rte_unused uint32_t key_size,
 	uint64_t seed)
 {
-	uint64_t *k = key;
-	uint64_t *m = mask;
+	uint64_t *k = (uint64_t *)key;
+	uint64_t *m = (uint64_t *)mask;
 	uint64_t crc0;
 
 	crc0 = rte_crc32_u64(seed, k[0] & m[0]);
@@ -72,8 +72,8 @@ static inline uint64_t
 rte_table_hash_crc_key16(void *key, void *mask, __rte_unused uint32_t key_size,
 	uint64_t seed)
 {
-	uint64_t *k = key;
-	uint64_t *m = mask;
+	uint64_t *k = (uint64_t *)key;
+	uint64_t *m = (uint64_t *)mask;
 	uint64_t k0, crc0, crc1;
 
 	k0 = k[0] & m[0];
@@ -91,8 +91,8 @@ static inline uint64_t
 rte_table_hash_crc_key24(void *key, void *mask, __rte_unused uint32_t key_size,
 	uint64_t seed)
 {
-	uint64_t *k = key;
-	uint64_t *m = mask;
+	uint64_t *k = (uint64_t *)key;
+	uint64_t *m = (uint64_t *)mask;
 	uint64_t k0, k2, crc0, crc1;
 
 	k0 = k[0] & m[0];
@@ -113,8 +113,8 @@ static inline uint64_t
 rte_table_hash_crc_key32(void *key, void *mask, __rte_unused uint32_t key_size,
 	uint64_t seed)
 {
-	uint64_t *k = key;
-	uint64_t *m = mask;
+	uint64_t *k = (uint64_t *)key;
+	uint64_t *m = (uint64_t *)mask;
 	uint64_t k0, k2, crc0, crc1, crc2, crc3;
 
 	k0 = k[0] & m[0];
@@ -139,8 +139,8 @@ static inline uint64_t
 rte_table_hash_crc_key40(void *key, void *mask, __rte_unused uint32_t key_size,
 	uint64_t seed)
 {
-	uint64_t *k = key;
-	uint64_t *m = mask;
+	uint64_t *k = (uint64_t *)key;
+	uint64_t *m = (uint64_t *)mask;
 	uint64_t k0, k2, crc0, crc1, crc2, crc3;
 
 	k0 = k[0] & m[0];
@@ -165,8 +165,8 @@ static inline uint64_t
 rte_table_hash_crc_key48(void *key, void *mask, __rte_unused uint32_t key_size,
 	uint64_t seed)
 {
-	uint64_t *k = key;
-	uint64_t *m = mask;
+	uint64_t *k = (uint64_t *)key;
+	uint64_t *m = (uint64_t *)mask;
 	uint64_t k0, k2, k5, crc0, crc1, crc2, crc3;
 
 	k0 = k[0] & m[0];
@@ -192,8 +192,8 @@ static inline uint64_t
 rte_table_hash_crc_key56(void *key, void *mask, __rte_unused uint32_t key_size,
 	uint64_t seed)
 {
-	uint64_t *k = key;
-	uint64_t *m = mask;
+	uint64_t *k = (uint64_t *)key;
+	uint64_t *m = (uint64_t *)mask;
 	uint64_t k0, k2, k5, crc0, crc1, crc2, crc3, crc4, crc5;
 
 	k0 = k[0] & m[0];
@@ -222,8 +222,8 @@ static inline uint64_t
 rte_table_hash_crc_key64(void *key, void *mask, __rte_unused uint32_t key_size,
 	uint64_t seed)
 {
-	uint64_t *k = key;
-	uint64_t *m = mask;
+	uint64_t *k = (uint64_t *)key;
+	uint64_t *m = (uint64_t *)mask;
 	uint64_t k0, k2, k5, crc0, crc1, crc2, crc3, crc4, crc5;
 
 	k0 = k[0] & m[0];
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:46.015532124 +0100
+++ 0046-table-fix-C-include.patch	2022-02-25 16:58:44.288990455 +0100
@@ -1 +1 @@
-From 097ea8e274440919433cd932ec7a1b2f3956180b Mon Sep 17 00:00:00 2001
+From b85a9bff6a1839071d619a78b5a830eb6fde9aac Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 097ea8e274440919433cd932ec7a1b2f3956180b ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -14 +15 @@
- lib/table/rte_table_hash_func.h | 32 ++++++++++++++++----------------
+ lib/librte_table/rte_table_hash_func.h | 32 +++++++++++++-------------
@@ -17,4 +18,4 @@
-diff --git a/lib/table/rte_table_hash_func.h b/lib/table/rte_table_hash_func.h
-index c4c35cc06a..a962ec2f68 100644
---- a/lib/table/rte_table_hash_func.h
-+++ b/lib/table/rte_table_hash_func.h
+diff --git a/lib/librte_table/rte_table_hash_func.h b/lib/librte_table/rte_table_hash_func.h
+index 350c795649..d4f126ab5f 100644
+--- a/lib/librte_table/rte_table_hash_func.h
++++ b/lib/librte_table/rte_table_hash_func.h

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

* patch 'vhost: fix C++ include' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (44 preceding siblings ...)
  2022-02-25 17:15 ` patch 'table: " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'test/mbuf: fix mbuf data content check' " christian.ehrhardt
                   ` (9 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From f0bd885fcbed713f79c4b494d50c7763e502ca33 Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Thu, 10 Feb 2022 15:42:38 +0000
Subject: [PATCH] vhost: fix C++ include

[ upstream commit 1d1126ad436e8c7c015fb3f67ad3af05c3b397d5 ]

The virtio kernel header includes are already noted as being
incompatible with C++. We can ensure that the header is safe for
inclusion in C++ code by not including those headers during C++ builds.
While not ideal, this does ensure that all DPDK headers can be included
in C++ code without errors.

Fixes: f8904d563691 ("vhost: fix header for strict compilation flags")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/librte_vhost/rte_vhost.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/librte_vhost/rte_vhost.h b/lib/librte_vhost/rte_vhost.h
index f85ed4dc50..08bb6a8fe9 100644
--- a/lib/librte_vhost/rte_vhost.h
+++ b/lib/librte_vhost/rte_vhost.h
@@ -20,10 +20,12 @@
 extern "C" {
 #endif
 
+#ifndef __cplusplus
 /* These are not C++-aware. */
 #include <linux/vhost.h>
 #include <linux/virtio_ring.h>
 #include <linux/virtio_net.h>
+#endif
 
 #define RTE_VHOST_USER_CLIENT		(1ULL << 0)
 #define RTE_VHOST_USER_NO_RECONNECT	(1ULL << 1)
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:46.050547461 +0100
+++ 0047-vhost-fix-C-include.patch	2022-02-25 16:58:44.288990455 +0100
@@ -1 +1 @@
-From 1d1126ad436e8c7c015fb3f67ad3af05c3b397d5 Mon Sep 17 00:00:00 2001
+From f0bd885fcbed713f79c4b494d50c7763e502ca33 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 1d1126ad436e8c7c015fb3f67ad3af05c3b397d5 ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -17 +18 @@
- lib/vhost/rte_vhost.h | 2 ++
+ lib/librte_vhost/rte_vhost.h | 2 ++
@@ -20,5 +21,5 @@
-diff --git a/lib/vhost/rte_vhost.h b/lib/vhost/rte_vhost.h
-index b454c05868..2acb31df2d 100644
---- a/lib/vhost/rte_vhost.h
-+++ b/lib/vhost/rte_vhost.h
-@@ -21,10 +21,12 @@
+diff --git a/lib/librte_vhost/rte_vhost.h b/lib/librte_vhost/rte_vhost.h
+index f85ed4dc50..08bb6a8fe9 100644
+--- a/lib/librte_vhost/rte_vhost.h
++++ b/lib/librte_vhost/rte_vhost.h
+@@ -20,10 +20,12 @@

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

* patch 'test/mbuf: fix mbuf data content check' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (45 preceding siblings ...)
  2022-02-25 17:15 ` patch 'vhost: " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'ipc: end multiprocess thread during cleanup' " christian.ehrhardt
                   ` (8 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: David Marchand; +Cc: Olivier Matz, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 0a8fdfb70e5c3bc49ce52b02cf94bbd367b304bd Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Thu, 3 Feb 2022 10:39:12 +0100
Subject: [PATCH] test/mbuf: fix mbuf data content check

[ upstream commit 985571b6b41ec49552b3d91c20060236c7c0fecb ]

When allocating a mbuf, its data content is most of the time zero'd but
nothing ensures this. This is especially wrong when building with
RTE_MALLOC_DEBUG, where data is poisoned to 0x6b on free.

This test reserves MBUF_TEST_DATA_LEN2 bytes in the mbuf data segment,
and sets this data to 0xcc.
Calling strlen(), the test may try to read more than MBUF_TEST_DATA_LEN2
which has been noticed when memory had been poisoned.

The mbuf data content is checked right after, so we can simply remove
strlen().

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

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---
 app/test/test_mbuf.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
index 0208c31196..f231d37ffd 100644
--- a/app/test/test_mbuf.c
+++ b/app/test/test_mbuf.c
@@ -2011,8 +2011,6 @@ test_pktmbuf_read_from_offset(struct rte_mempool *pktmbuf_pool)
 			NULL);
 	if (data_copy == NULL)
 		GOTO_FAIL("%s: Error in reading packet data!\n", __func__);
-	if (strlen(data_copy) != MBUF_TEST_DATA_LEN2 - 5)
-		GOTO_FAIL("%s: Incorrect data length!\n", __func__);
 	for (off = 0; off < MBUF_TEST_DATA_LEN2 - 5; off++) {
 		if (data_copy[off] != (char)0xcc)
 			GOTO_FAIL("Data corrupted at offset %u", off);
@@ -2034,8 +2032,6 @@ test_pktmbuf_read_from_offset(struct rte_mempool *pktmbuf_pool)
 	data_copy = rte_pktmbuf_read(m, hdr_len, 0, NULL);
 	if (data_copy == NULL)
 		GOTO_FAIL("%s: Error in reading packet data!\n", __func__);
-	if (strlen(data_copy) != MBUF_TEST_DATA_LEN2)
-		GOTO_FAIL("%s: Corrupted data content!\n", __func__);
 	for (off = 0; off < MBUF_TEST_DATA_LEN2; off++) {
 		if (data_copy[off] != (char)0xcc)
 			GOTO_FAIL("Data corrupted at offset %u", off);
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:46.088848652 +0100
+++ 0048-test-mbuf-fix-mbuf-data-content-check.patch	2022-02-25 16:58:44.292990460 +0100
@@ -1 +1 @@
-From 985571b6b41ec49552b3d91c20060236c7c0fecb Mon Sep 17 00:00:00 2001
+From 0a8fdfb70e5c3bc49ce52b02cf94bbd367b304bd Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 985571b6b41ec49552b3d91c20060236c7c0fecb ]
+
@@ -19 +20,0 @@
-Cc: stable@dpdk.org
@@ -28 +29 @@
-index f762befb69..d37aefd2e9 100644
+index 0208c31196..f231d37ffd 100644
@@ -31 +32 @@
-@@ -2042,8 +2042,6 @@ test_pktmbuf_read_from_offset(struct rte_mempool *pktmbuf_pool)
+@@ -2011,8 +2011,6 @@ test_pktmbuf_read_from_offset(struct rte_mempool *pktmbuf_pool)
@@ -40 +41 @@
-@@ -2065,8 +2063,6 @@ test_pktmbuf_read_from_offset(struct rte_mempool *pktmbuf_pool)
+@@ -2034,8 +2032,6 @@ test_pktmbuf_read_from_offset(struct rte_mempool *pktmbuf_pool)

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

* patch 'ipc: end multiprocess thread during cleanup' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (46 preceding siblings ...)
  2022-02-25 17:15 ` patch 'test/mbuf: fix mbuf data content check' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'vfio: cleanup the multiprocess sync handle' " christian.ehrhardt
                   ` (7 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Anatoly Burakov, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From e24d07f803c29ad22afdf4dfc5cfb2cdfc080e48 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Sat, 13 Nov 2021 09:22:54 -0800
Subject: [PATCH] ipc: end multiprocess thread during cleanup

[ upstream commit 6e858b4d9244cf53505589673755ab18ac2a4a83 ]

When rte_eal_cleanup is called, all control threads should exit.
For the mp thread, this best handled by closing the mp_socket
and letting the thread see that.

This also fixes potential problems where the mp_socket gets
another hard error, and the thread runs away repeating itself
by reading the same error.

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

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/librte_eal/common/eal_common_proc.c | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/lib/librte_eal/common/eal_common_proc.c b/lib/librte_eal/common/eal_common_proc.c
index ac2ddb01a5..d88a1ebafb 100644
--- a/lib/librte_eal/common/eal_common_proc.c
+++ b/lib/librte_eal/common/eal_common_proc.c
@@ -277,8 +277,17 @@ read_msg(struct mp_msg_internal *m, struct sockaddr_un *s)
 	msgh.msg_control = control;
 	msgh.msg_controllen = sizeof(control);
 
+retry:
 	msglen = recvmsg(mp_fd, &msgh, 0);
+
+	/* zero length message means socket was closed */
+	if (msglen == 0)
+		return 0;
+
 	if (msglen < 0) {
+		if (errno == EINTR)
+			goto retry;
+
 		RTE_LOG(ERR, EAL, "recvmsg failed, %s\n", strerror(errno));
 		return -1;
 	}
@@ -306,7 +315,7 @@ read_msg(struct mp_msg_internal *m, struct sockaddr_un *s)
 		RTE_LOG(ERR, EAL, "invalid received data length\n");
 		return -1;
 	}
-	return 0;
+	return msglen;
 }
 
 static void
@@ -378,8 +387,13 @@ mp_handle(void *arg __rte_unused)
 	struct sockaddr_un sa;
 
 	while (mp_fd >= 0) {
-		if (read_msg(&msg, &sa) == 0)
-			process_msg(&msg, &sa);
+		int ret;
+
+		ret = read_msg(&msg, &sa);
+		if (ret <= 0)
+			break;
+
+		process_msg(&msg, &sa);
 	}
 
 	return NULL;
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:46.124739834 +0100
+++ 0049-ipc-end-multiprocess-thread-during-cleanup.patch	2022-02-25 16:58:44.292990460 +0100
@@ -1 +1 @@
-From 6e858b4d9244cf53505589673755ab18ac2a4a83 Mon Sep 17 00:00:00 2001
+From e24d07f803c29ad22afdf4dfc5cfb2cdfc080e48 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 6e858b4d9244cf53505589673755ab18ac2a4a83 ]
+
@@ -15 +16,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
- lib/eal/common/eal_common_proc.c | 20 +++++++++++++++++---
+ lib/librte_eal/common/eal_common_proc.c | 20 +++++++++++++++++---
@@ -23,5 +24,5 @@
-diff --git a/lib/eal/common/eal_common_proc.c b/lib/eal/common/eal_common_proc.c
-index ebd0f6673b..b33d58ea0a 100644
---- a/lib/eal/common/eal_common_proc.c
-+++ b/lib/eal/common/eal_common_proc.c
-@@ -282,8 +282,17 @@ read_msg(struct mp_msg_internal *m, struct sockaddr_un *s)
+diff --git a/lib/librte_eal/common/eal_common_proc.c b/lib/librte_eal/common/eal_common_proc.c
+index ac2ddb01a5..d88a1ebafb 100644
+--- a/lib/librte_eal/common/eal_common_proc.c
++++ b/lib/librte_eal/common/eal_common_proc.c
+@@ -277,8 +277,17 @@ read_msg(struct mp_msg_internal *m, struct sockaddr_un *s)
@@ -45 +46 @@
-@@ -311,7 +320,7 @@ read_msg(struct mp_msg_internal *m, struct sockaddr_un *s)
+@@ -306,7 +315,7 @@ read_msg(struct mp_msg_internal *m, struct sockaddr_un *s)
@@ -54 +55 @@
-@@ -385,8 +394,13 @@ mp_handle(void *arg __rte_unused)
+@@ -378,8 +387,13 @@ mp_handle(void *arg __rte_unused)

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

* patch 'vfio: cleanup the multiprocess sync handle' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (47 preceding siblings ...)
  2022-02-25 17:15 ` patch 'ipc: end multiprocess thread during cleanup' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'net/memif: remove pointer deference before null check' " christian.ehrhardt
                   ` (6 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Anatoly Burakov, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From dcae27834511c94d971db981a07029849e03c271 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Sat, 13 Nov 2021 09:22:55 -0800
Subject: [PATCH] vfio: cleanup the multiprocess sync handle

[ upstream commit 6412941ae8d183ead5720f06cd2616f7c523f6a8 ]

When rte_eal_cleanup is called the rte_mp_action for VFIO
should be freed.

Fixes: edf73dd33072 ("ipc: handle unsupported IPC in action register")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/librte_eal/linux/eal/eal.c              | 4 ++++
 lib/librte_eal/linux/eal/eal_vfio.h         | 1 +
 lib/librte_eal/linux/eal/eal_vfio_mp_sync.c | 8 ++++++++
 3 files changed, 13 insertions(+)

diff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/eal.c
index a2898705b6..5fa8c82c63 100644
--- a/lib/librte_eal/linux/eal/eal.c
+++ b/lib/librte_eal/linux/eal/eal.c
@@ -1323,7 +1323,11 @@ rte_eal_cleanup(void)
 	 */
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY)
 		rte_memseg_walk(mark_freeable, NULL);
+
 	rte_service_finalize();
+#ifdef VFIO_PRESENT
+	vfio_mp_sync_cleanup();
+#endif
 	rte_mp_channel_cleanup();
 	eal_cleanup_config(&internal_config);
 	return 0;
diff --git a/lib/librte_eal/linux/eal/eal_vfio.h b/lib/librte_eal/linux/eal/eal_vfio.h
index 6ebaca6a0c..921ee59538 100644
--- a/lib/librte_eal/linux/eal/eal_vfio.h
+++ b/lib/librte_eal/linux/eal/eal_vfio.h
@@ -133,6 +133,7 @@ int
 vfio_has_supported_extensions(int vfio_container_fd);
 
 int vfio_mp_sync_setup(void);
+void vfio_mp_sync_cleanup(void);
 
 #define EAL_VFIO_MP "eal_vfio_mp_sync"
 
diff --git a/lib/librte_eal/linux/eal/eal_vfio_mp_sync.c b/lib/librte_eal/linux/eal/eal_vfio_mp_sync.c
index 6254696ae5..76877f5b54 100644
--- a/lib/librte_eal/linux/eal/eal_vfio_mp_sync.c
+++ b/lib/librte_eal/linux/eal/eal_vfio_mp_sync.c
@@ -120,4 +120,12 @@ vfio_mp_sync_setup(void)
 	return 0;
 }
 
+void
+vfio_mp_sync_cleanup(void)
+{
+	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+		return;
+
+	rte_mp_action_unregister(EAL_VFIO_MP);
+}
 #endif
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:46.166767364 +0100
+++ 0050-vfio-cleanup-the-multiprocess-sync-handle.patch	2022-02-25 16:58:44.292990460 +0100
@@ -1 +1 @@
-From 6412941ae8d183ead5720f06cd2616f7c523f6a8 Mon Sep 17 00:00:00 2001
+From dcae27834511c94d971db981a07029849e03c271 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 6412941ae8d183ead5720f06cd2616f7c523f6a8 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -15,3 +16,3 @@
- lib/eal/linux/eal.c              | 4 ++++
- lib/eal/linux/eal_vfio.h         | 1 +
- lib/eal/linux/eal_vfio_mp_sync.c | 8 ++++++++
+ lib/librte_eal/linux/eal/eal.c              | 4 ++++
+ lib/librte_eal/linux/eal/eal_vfio.h         | 1 +
+ lib/librte_eal/linux/eal/eal_vfio_mp_sync.c | 8 ++++++++
@@ -20,7 +21,7 @@
-diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
-index fad062a2dd..d77cd871be 100644
---- a/lib/eal/linux/eal.c
-+++ b/lib/eal/linux/eal.c
-@@ -1276,7 +1276,11 @@ rte_eal_cleanup(void)
- 	if (rte_eal_process_type() == RTE_PROC_PRIMARY &&
- 			internal_conf->hugepage_file.unlink_existing)
+diff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/eal.c
+index a2898705b6..5fa8c82c63 100644
+--- a/lib/librte_eal/linux/eal/eal.c
++++ b/lib/librte_eal/linux/eal/eal.c
+@@ -1323,7 +1323,11 @@ rte_eal_cleanup(void)
+ 	 */
+ 	if (rte_eal_process_type() == RTE_PROC_PRIMARY)
@@ -34,6 +35,6 @@
- 	/* after this point, any DPDK pointers will become dangling */
- 	rte_eal_memory_detach();
-diff --git a/lib/eal/linux/eal_vfio.h b/lib/eal/linux/eal_vfio.h
-index c5d5f70548..bba5c7afa5 100644
---- a/lib/eal/linux/eal_vfio.h
-+++ b/lib/eal/linux/eal_vfio.h
+ 	eal_cleanup_config(&internal_config);
+ 	return 0;
+diff --git a/lib/librte_eal/linux/eal/eal_vfio.h b/lib/librte_eal/linux/eal/eal_vfio.h
+index 6ebaca6a0c..921ee59538 100644
+--- a/lib/librte_eal/linux/eal/eal_vfio.h
++++ b/lib/librte_eal/linux/eal/eal_vfio.h
@@ -48,4 +49,4 @@
-diff --git a/lib/eal/linux/eal_vfio_mp_sync.c b/lib/eal/linux/eal_vfio_mp_sync.c
-index a2accfab3a..d12bbaee64 100644
---- a/lib/eal/linux/eal_vfio_mp_sync.c
-+++ b/lib/eal/linux/eal_vfio_mp_sync.c
+diff --git a/lib/librte_eal/linux/eal/eal_vfio_mp_sync.c b/lib/librte_eal/linux/eal/eal_vfio_mp_sync.c
+index 6254696ae5..76877f5b54 100644
+--- a/lib/librte_eal/linux/eal/eal_vfio_mp_sync.c
++++ b/lib/librte_eal/linux/eal/eal_vfio_mp_sync.c

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

* patch 'net/memif: remove pointer deference before null check' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (48 preceding siblings ...)
  2022-02-25 17:15 ` patch 'vfio: cleanup the multiprocess sync handle' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'net/sfc: do not push fast free offload to default TxQ config' " christian.ehrhardt
                   ` (5 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Weiguo Li; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From a30a7dba8884a9bedcf00023aa61d29d004ad632 Mon Sep 17 00:00:00 2001
From: Weiguo Li <liwg06@foxmail.com>
Date: Wed, 9 Feb 2022 15:39:34 +0800
Subject: [PATCH] net/memif: remove pointer deference before null check

[ upstream commit b6c0f464affcf0ec6fcf0a26e517692dc08244f4 ]

There are duplicates of assignment here, the one before null check
may cause a null pointer deference, so remove the previous one.

Fixes: 09c7e63a71f9 ("net/memif: introduce memory interface PMD")

Signed-off-by: Weiguo Li <liwg06@foxmail.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 drivers/net/memif/memif_socket.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/memif/memif_socket.c b/drivers/net/memif/memif_socket.c
index c1967c67bf..ff6317574d 100644
--- a/drivers/net/memif/memif_socket.c
+++ b/drivers/net/memif/memif_socket.c
@@ -396,11 +396,10 @@ memif_msg_enq_init(struct rte_eth_dev *dev)
 {
 	struct pmd_internals *pmd = dev->data->dev_private;
 	struct memif_msg_queue_elt *e = memif_msg_enq(pmd->cc);
-	memif_msg_init_t *i = &e->msg.init;
+	memif_msg_init_t *i;
 
 	if (e == NULL)
 		return -1;
-
 	i = &e->msg.init;
 	e->msg.type = MEMIF_MSG_TYPE_INIT;
 	i->version = MEMIF_VERSION;
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:46.205072340 +0100
+++ 0051-net-memif-remove-pointer-deference-before-null-check.patch	2022-02-25 16:58:44.296990462 +0100
@@ -1 +1 @@
-From b6c0f464affcf0ec6fcf0a26e517692dc08244f4 Mon Sep 17 00:00:00 2001
+From a30a7dba8884a9bedcf00023aa61d29d004ad632 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b6c0f464affcf0ec6fcf0a26e517692dc08244f4 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
-index 42f48a68a1..7886644412 100644
+index c1967c67bf..ff6317574d 100644
@@ -22 +23 @@
-@@ -402,11 +402,10 @@ memif_msg_enq_init(struct rte_eth_dev *dev)
+@@ -396,11 +396,10 @@ memif_msg_enq_init(struct rte_eth_dev *dev)

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

* patch 'net/sfc: do not push fast free offload to default TxQ config' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (49 preceding siblings ...)
  2022-02-25 17:15 ` patch 'net/memif: remove pointer deference before null check' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'net/sfc: demand Tx fast free offload on EF10 simple datapath' " christian.ehrhardt
                   ` (4 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Ivan Malov; +Cc: Andrew Rybchenko, Andy Moreton, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 5b759d85bded9547924982fdba76b73928d9a5e3 Mon Sep 17 00:00:00 2001
From: Ivan Malov <ivan.malov@oktetlabs.ru>
Date: Wed, 9 Feb 2022 02:26:47 +0300
Subject: [PATCH] net/sfc: do not push fast free offload to default TxQ config

[ upstream commit f67615ea626e23e61b71d27f894fe9a4ef716df3 ]

Doing so is wrong since fast free is an adapter-wide offload.

Technically, the offending commit (see "Fixes" tag) does not
induce failures, however, such started to occur after commit
a4996bd89c42 ("ethdev: new Rx/Tx offloads API") had shown up,
because of the strict offload validation in the generic code.

Fixes: c78d280e88ef ("net/sfc: convert to new Tx offload API")

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
---
 drivers/net/sfc/sfc_ethdev.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index 5b2a72ebf3..8206fa78e5 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -93,7 +93,6 @@ sfc_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 	struct sfc_adapter_shared *sas = sfc_adapter_shared_by_eth_dev(dev);
 	struct sfc_adapter *sa = sfc_adapter_by_eth_dev(dev);
 	struct sfc_rss *rss = &sas->rss;
-	uint64_t txq_offloads_def = 0;
 
 	sfc_log_init(sa, "entry");
 
@@ -143,11 +142,6 @@ sfc_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 	dev_info->tx_offload_capa = sfc_tx_get_dev_offload_caps(sa) |
 				    dev_info->tx_queue_offload_capa;
 
-	if (dev_info->tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
-		txq_offloads_def |= DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-
-	dev_info->default_txconf.offloads |= txq_offloads_def;
-
 	if (rss->context_type != EFX_RX_SCALE_UNAVAILABLE) {
 		uint64_t rte_hf = 0;
 		unsigned int i;
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:46.245580559 +0100
+++ 0052-net-sfc-do-not-push-fast-free-offload-to-default-TxQ.patch	2022-02-25 16:58:44.296990462 +0100
@@ -1 +1 @@
-From f67615ea626e23e61b71d27f894fe9a4ef716df3 Mon Sep 17 00:00:00 2001
+From 5b759d85bded9547924982fdba76b73928d9a5e3 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit f67615ea626e23e61b71d27f894fe9a4ef716df3 ]
+
@@ -14 +15,0 @@
-Cc: stable@dpdk.org
@@ -24 +25 @@
-index abf7b8d287..b04a05bd9f 100644
+index 5b2a72ebf3..8206fa78e5 100644
@@ -27 +28,2 @@
-@@ -94,7 +94,6 @@ sfc_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
+@@ -93,7 +93,6 @@ sfc_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
+ 	struct sfc_adapter_shared *sas = sfc_adapter_shared_by_eth_dev(dev);
@@ -30 +31,0 @@
- 	struct sfc_mae *mae = &sa->mae;
@@ -35 +36 @@
-@@ -146,11 +145,6 @@ sfc_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
+@@ -143,11 +142,6 @@ sfc_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
@@ -39,2 +40,2 @@
--	if (dev_info->tx_offload_capa & RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE)
--		txq_offloads_def |= RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE;
+-	if (dev_info->tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+-		txq_offloads_def |= DEV_TX_OFFLOAD_MBUF_FAST_FREE;

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

* patch 'net/sfc: demand Tx fast free offload on EF10 simple datapath' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (50 preceding siblings ...)
  2022-02-25 17:15 ` patch 'net/sfc: do not push fast free offload to default TxQ config' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'net/iavf: count continuous DD bits for Arm' " christian.ehrhardt
                   ` (3 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Ivan Malov; +Cc: Andrew Rybchenko, Andy Moreton, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From f7faec39ae7937d3ce6b7025b0670810d7afe435 Mon Sep 17 00:00:00 2001
From: Ivan Malov <ivan.malov@oktetlabs.ru>
Date: Wed, 9 Feb 2022 02:26:48 +0300
Subject: [PATCH] net/sfc: demand Tx fast free offload on EF10 simple datapath

[ upstream commit 24a491bb882a3269b9b4e2754e1d5b43d83b9821 ]

Enforce this offload as it is immutable on the said datapath.

Fixes: c78d280e88ef ("net/sfc: convert to new Tx offload API")

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
---
 drivers/net/sfc/sfc_tx.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/sfc/sfc_tx.c b/drivers/net/sfc/sfc_tx.c
index 7d0e18a6bd..9738ed9660 100644
--- a/drivers/net/sfc/sfc_tx.c
+++ b/drivers/net/sfc/sfc_tx.c
@@ -258,6 +258,7 @@ sfc_tx_qinit_info(struct sfc_adapter *sa, unsigned int sw_index)
 static int
 sfc_tx_check_mode(struct sfc_adapter *sa, const struct rte_eth_txmode *txmode)
 {
+	uint64_t dev_tx_offload_cap = sfc_tx_get_dev_offload_caps(sa);
 	int rc = 0;
 
 	switch (txmode->mq_mode) {
@@ -269,6 +270,13 @@ sfc_tx_check_mode(struct sfc_adapter *sa, const struct rte_eth_txmode *txmode)
 		rc = EINVAL;
 	}
 
+	if ((dev_tx_offload_cap & DEV_TX_OFFLOAD_MBUF_FAST_FREE) != 0 &&
+	    (txmode->offloads & DEV_TX_OFFLOAD_MBUF_FAST_FREE) == 0) {
+		sfc_err(sa, "There is no FAST_FREE flag in the attempted Tx mode configuration");
+		sfc_err(sa, "FAST_FREE is always active as per the current Tx datapath variant");
+		rc = EINVAL;
+	}
+
 	/*
 	 * These features are claimed to be i40e-specific,
 	 * but it does make sense to double-check their absence
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:46.282460454 +0100
+++ 0053-net-sfc-demand-Tx-fast-free-offload-on-EF10-simple-d.patch	2022-02-25 16:58:44.296990462 +0100
@@ -1 +1 @@
-From 24a491bb882a3269b9b4e2754e1d5b43d83b9821 Mon Sep 17 00:00:00 2001
+From f7faec39ae7937d3ce6b7025b0670810d7afe435 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 24a491bb882a3269b9b4e2754e1d5b43d83b9821 ]
+
@@ -9 +10,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
-index cd927cf2f7..f376f24f7b 100644
+index 7d0e18a6bd..9738ed9660 100644
@@ -22 +23 @@
-@@ -308,6 +308,7 @@ sfc_tx_qinit_info(struct sfc_adapter *sa, sfc_sw_index_t sw_index)
+@@ -258,6 +258,7 @@ sfc_tx_qinit_info(struct sfc_adapter *sa, unsigned int sw_index)
@@ -30 +31 @@
-@@ -319,6 +320,13 @@ sfc_tx_check_mode(struct sfc_adapter *sa, const struct rte_eth_txmode *txmode)
+@@ -269,6 +270,13 @@ sfc_tx_check_mode(struct sfc_adapter *sa, const struct rte_eth_txmode *txmode)
@@ -34,2 +35,2 @@
-+	if ((dev_tx_offload_cap & RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE) != 0 &&
-+	    (txmode->offloads & RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE) == 0) {
++	if ((dev_tx_offload_cap & DEV_TX_OFFLOAD_MBUF_FAST_FREE) != 0 &&
++	    (txmode->offloads & DEV_TX_OFFLOAD_MBUF_FAST_FREE) == 0) {

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

* patch 'net/iavf: count continuous DD bits for Arm' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (51 preceding siblings ...)
  2022-02-25 17:15 ` patch 'net/sfc: demand Tx fast free offload on EF10 simple datapath' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'net/mlx5: fix committed bucket size' " christian.ehrhardt
                   ` (2 subsequent siblings)
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Kathleen Capella; +Cc: Honnappa Nagarahalli, Qi Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 55f2ea35c7cafdb178e59862d66eaf73b3282706 Mon Sep 17 00:00:00 2001
From: Kathleen Capella <kathleen.capella@arm.com>
Date: Sat, 5 Feb 2022 00:26:29 +0000
Subject: [PATCH] net/iavf: count continuous DD bits for Arm

[ upstream commit 3d88d5e401f6d04882415866012a98bced0c3cb8 ]

On Arm platforms, reading of descriptors may be re-ordered causing the
status of DD bits to be discontinuous. Add logic to only process
continuous descriptors by checking DD bits.

Fixes: 1060591eada5 ("net/avf: enable bulk allocate Rx")

Signed-off-by: Kathleen Capella <kathleen.capella@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/iavf/iavf_rxtx.c | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index bc67712d9c..d406f0d992 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -1101,7 +1101,7 @@ iavf_rx_scan_hw_ring(struct iavf_rx_queue *rxq)
 	uint16_t pkt_len;
 	uint64_t qword1;
 	uint32_t rx_status;
-	int32_t s[IAVF_LOOK_AHEAD], nb_dd;
+	int32_t s[IAVF_LOOK_AHEAD], var, nb_dd;
 	int32_t i, j, nb_rx = 0;
 	uint64_t pkt_flags;
 	static const uint32_t ptype_tbl[UINT8_MAX + 1] __rte_cache_aligned = {
@@ -1150,9 +1150,27 @@ iavf_rx_scan_hw_ring(struct iavf_rx_queue *rxq)
 
 		rte_smp_rmb();
 
-		/* Compute how many status bits were set */
-		for (j = 0, nb_dd = 0; j < IAVF_LOOK_AHEAD; j++)
-			nb_dd += s[j] & (1 << IAVF_RX_DESC_STATUS_DD_SHIFT);
+		/* Compute how many contiguous DD bits were set */
+		for (j = 0, nb_dd = 0; j < IAVF_LOOK_AHEAD; j++) {
+			var = s[j] & (1 << IAVF_RX_DESC_STATUS_DD_SHIFT);
+#ifdef RTE_ARCH_ARM
+			/* For Arm platforms, count only contiguous descriptors
+			 * whose DD bit is set to 1. On Arm platforms, reads of
+			 * descriptors can be reordered. Since the CPU may
+			 * be reading the descriptors as the NIC updates them
+			 * in memory, it is possbile that the DD bit for a
+			 * descriptor earlier in the queue is read as not set
+			 * while the DD bit for a descriptor later in the queue
+			 * is read as set.
+			 */
+			if (var)
+				nb_dd += 1;
+			else
+				break;
+#else
+			nb_dd += var;
+#endif
+		}
 
 		nb_rx += nb_dd;
 
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:46.315135552 +0100
+++ 0054-net-iavf-count-continuous-DD-bits-for-Arm.patch	2022-02-25 16:58:44.300990467 +0100
@@ -1 +1 @@
-From 3d88d5e401f6d04882415866012a98bced0c3cb8 Mon Sep 17 00:00:00 2001
+From 55f2ea35c7cafdb178e59862d66eaf73b3282706 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 3d88d5e401f6d04882415866012a98bced0c3cb8 ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -21 +22 @@
-index 7158938643..f07d886821 100644
+index bc67712d9c..d406f0d992 100644
@@ -24 +25 @@
-@@ -1897,7 +1897,7 @@ iavf_rx_scan_hw_ring(struct iavf_rx_queue *rxq)
+@@ -1101,7 +1101,7 @@ iavf_rx_scan_hw_ring(struct iavf_rx_queue *rxq)
@@ -32,2 +33,2 @@
- 	const uint32_t *ptype_tbl = rxq->vsi->adapter->ptype_tbl;
-@@ -1928,9 +1928,27 @@ iavf_rx_scan_hw_ring(struct iavf_rx_queue *rxq)
+ 	static const uint32_t ptype_tbl[UINT8_MAX + 1] __rte_cache_aligned = {
+@@ -1150,9 +1150,27 @@ iavf_rx_scan_hw_ring(struct iavf_rx_queue *rxq)

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

* patch 'net/mlx5: fix committed bucket size' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (52 preceding siblings ...)
  2022-02-25 17:15 ` patch 'net/iavf: count continuous DD bits for Arm' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'compress/octeontx: fix null pointer dereference' " christian.ehrhardt
  2022-02-25 17:15 ` patch 'raw/ntb: clear all valid doorbell bits on init' " christian.ehrhardt
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Alexander Kozyrev; +Cc: Viacheslav Ovsiienko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 8b3ab4586f0be206a8483d705f05e01bc9c3125b Mon Sep 17 00:00:00 2001
From: Alexander Kozyrev <akozyrev@nvidia.com>
Date: Mon, 7 Feb 2022 15:28:40 +0200
Subject: [PATCH] net/mlx5: fix committed bucket size

[ upstream commit 21fdeab422e0edabc6b738f7a0c56dec7e9c374e ]

Committed Bucket Size calculation tries to fit into 8-bit wide
mantissa field by setting 256 as a maximum value for it.
To compensate for this increase in the mantissa value the exponent
value has to be reduced by 8. But it gives a negative exponent
value for CBS less than 128. And negative exponent value is not
supported by the NIC. Adjust CSB calculation only for values
bigger than 128 to allow both small and big bucket sizes.

Fixes: 3bd26b23cefc ("net/mlx5: support meter profile operations")

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_meter.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_meter.c b/drivers/net/mlx5/mlx5_flow_meter.c
index 62e3a35902..e51a85b477 100644
--- a/drivers/net/mlx5/mlx5_flow_meter.c
+++ b/drivers/net/mlx5/mlx5_flow_meter.c
@@ -213,8 +213,10 @@ mlx5_flow_meter_xbs_man_exp_calc(uint64_t xbs, uint8_t *man, uint8_t *exp)
 	}
 	/* xbs = xbs_mantissa * 2^xbs_exponent */
 	_man = frexp(xbs, &_exp);
-	_man = _man * pow(2, MLX5_MAN_WIDTH);
-	_exp = _exp - MLX5_MAN_WIDTH;
+	if (_exp >= MLX5_MAN_WIDTH) {
+		_man = _man * pow(2, MLX5_MAN_WIDTH);
+		_exp = _exp - MLX5_MAN_WIDTH;
+	}
 	*man = (uint8_t)ceil(_man);
 	*exp = _exp;
 }
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:46.351199502 +0100
+++ 0055-net-mlx5-fix-committed-bucket-size.patch	2022-02-25 16:58:44.300990467 +0100
@@ -1 +1 @@
-From 21fdeab422e0edabc6b738f7a0c56dec7e9c374e Mon Sep 17 00:00:00 2001
+From 8b3ab4586f0be206a8483d705f05e01bc9c3125b Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 21fdeab422e0edabc6b738f7a0c56dec7e9c374e ]
+
@@ -15 +16,0 @@
-Cc: stable@dpdk.org
@@ -24 +25 @@
-index 0dc7fbfb32..d0f8bcd100 100644
+index 62e3a35902..e51a85b477 100644
@@ -27 +28 @@
-@@ -295,8 +295,10 @@ mlx5_flow_meter_xbs_man_exp_calc(uint64_t xbs, uint8_t *man, uint8_t *exp)
+@@ -213,8 +213,10 @@ mlx5_flow_meter_xbs_man_exp_calc(uint64_t xbs, uint8_t *man, uint8_t *exp)

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

* patch 'compress/octeontx: fix null pointer dereference' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (53 preceding siblings ...)
  2022-02-25 17:15 ` patch 'net/mlx5: fix committed bucket size' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  2022-02-25 17:15 ` patch 'raw/ntb: clear all valid doorbell bits on init' " christian.ehrhardt
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Weiguo Li; +Cc: Akhil Goyal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From dc34c5a920c882161bd3bc92153859fb444e5290 Mon Sep 17 00:00:00 2001
From: Weiguo Li <liwg06@foxmail.com>
Date: Tue, 25 Jan 2022 22:33:15 +0800
Subject: [PATCH] compress/octeontx: fix null pointer dereference

[ upstream commit b072930fb10a0471d69db5de341ea87a0d1561cc ]

Check for memory allocation failure is added to avoid null
pointer dereference.

Fixes: c378f084d6e3 ("compress/octeontx: add device setup ops")

Signed-off-by: Weiguo Li <liwg06@foxmail.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
---
 drivers/compress/octeontx/otx_zip_pmd.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/compress/octeontx/otx_zip_pmd.c b/drivers/compress/octeontx/otx_zip_pmd.c
index bff8ef035e..3876b5e74a 100644
--- a/drivers/compress/octeontx/otx_zip_pmd.c
+++ b/drivers/compress/octeontx/otx_zip_pmd.c
@@ -394,6 +394,8 @@ zip_pmd_qp_setup(struct rte_compressdev *dev, uint16_t qp_id,
 	}
 
 	name =  rte_malloc(NULL, RTE_COMPRESSDEV_NAME_MAX_LEN, 0);
+	if (name == NULL)
+		return (-ENOMEM);
 	snprintf(name, RTE_COMPRESSDEV_NAME_MAX_LEN,
 		 "zip_pmd_%u_qp_%u",
 		 dev->data->dev_id, qp_id);
@@ -401,8 +403,10 @@ zip_pmd_qp_setup(struct rte_compressdev *dev, uint16_t qp_id,
 	/* Allocate the queue pair data structure. */
 	qp = rte_zmalloc_socket(name, sizeof(*qp),
 				RTE_CACHE_LINE_SIZE, socket_id);
-	if (qp == NULL)
+	if (qp == NULL) {
+		rte_free(name);
 		return (-ENOMEM);
+	}
 
 	qp->name = name;
 
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:46.384224868 +0100
+++ 0056-compress-octeontx-fix-null-pointer-dereference.patch	2022-02-25 16:58:44.300990467 +0100
@@ -1 +1 @@
-From b072930fb10a0471d69db5de341ea87a0d1561cc Mon Sep 17 00:00:00 2001
+From dc34c5a920c882161bd3bc92153859fb444e5290 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b072930fb10a0471d69db5de341ea87a0d1561cc ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
-index 26cdce60a8..f9b8f7a1ec 100644
+index bff8ef035e..3876b5e74a 100644
@@ -22 +23 @@
-@@ -391,6 +391,8 @@ zip_pmd_qp_setup(struct rte_compressdev *dev, uint16_t qp_id,
+@@ -394,6 +394,8 @@ zip_pmd_qp_setup(struct rte_compressdev *dev, uint16_t qp_id,
@@ -31 +32 @@
-@@ -398,8 +400,10 @@ zip_pmd_qp_setup(struct rte_compressdev *dev, uint16_t qp_id,
+@@ -401,8 +403,10 @@ zip_pmd_qp_setup(struct rte_compressdev *dev, uint16_t qp_id,

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

* patch 'raw/ntb: clear all valid doorbell bits on init' has been queued to stable release 19.11.12
  2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
                   ` (54 preceding siblings ...)
  2022-02-25 17:15 ` patch 'compress/octeontx: fix null pointer dereference' " christian.ehrhardt
@ 2022-02-25 17:15 ` christian.ehrhardt
  55 siblings, 0 replies; 57+ messages in thread
From: christian.ehrhardt @ 2022-02-25 17:15 UTC (permalink / raw)
  To: Junfeng Guo; +Cc: Jingjing Wu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.12

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

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

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From 37e6856e3f6e89521bdb8dd6adafeb520496ecd0 Mon Sep 17 00:00:00 2001
From: Junfeng Guo <junfeng.guo@intel.com>
Date: Thu, 10 Feb 2022 15:06:34 +0800
Subject: [PATCH] raw/ntb: clear all valid doorbell bits on init

[ upstream commit 3bc814fc555d8c7d1c7c63e1e831e9c34679837f ]

Before registering the doorbell interrupt handler callback function,
all the valid doorbell bits within the NTB private data struct should
be cleared to avoid the confusion of the handshake timing sequence
diagram when setting up the NTB connection in back-to-back mode.

Fixes: 62012a76811e ("raw/ntb: add handshake process")

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
---
 drivers/raw/ntb/ntb.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/raw/ntb/ntb.c b/drivers/raw/ntb/ntb.c
index 0f0f5c785c..c25608ee8a 100644
--- a/drivers/raw/ntb/ntb.c
+++ b/drivers/raw/ntb/ntb.c
@@ -1371,6 +1371,10 @@ ntb_init_hw(struct rte_rawdev *dev, struct rte_pci_device *pci_dev)
 
 	/* Init doorbell. */
 	hw->db_valid_mask = RTE_LEN2MASK(hw->db_cnt, uint64_t);
+	/* Clear all valid doorbell bits before registering intr handler */
+	if (hw->ntb_ops->db_clear == NULL)
+		return -ENOTSUP;
+	(*hw->ntb_ops->db_clear)(dev, hw->db_valid_mask);
 
 	intr_handle = &pci_dev->intr_handle;
 	/* Register callback func to eal lib */
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:46.415183941 +0100
+++ 0057-raw-ntb-clear-all-valid-doorbell-bits-on-init.patch	2022-02-25 16:58:44.304990469 +0100
@@ -1 +1 @@
-From 3bc814fc555d8c7d1c7c63e1e831e9c34679837f Mon Sep 17 00:00:00 2001
+From 37e6856e3f6e89521bdb8dd6adafeb520496ecd0 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 3bc814fc555d8c7d1c7c63e1e831e9c34679837f ]
+
@@ -12 +13,0 @@
-Cc: stable@dpdk.org
@@ -21 +22 @@
-index 46ac02e5ab..f5e773c53b 100644
+index 0f0f5c785c..c25608ee8a 100644
@@ -24 +25 @@
-@@ -1398,6 +1398,10 @@ ntb_init_hw(struct rte_rawdev *dev, struct rte_pci_device *pci_dev)
+@@ -1371,6 +1371,10 @@ ntb_init_hw(struct rte_rawdev *dev, struct rte_pci_device *pci_dev)
@@ -33 +34 @@
- 	intr_handle = pci_dev->intr_handle;
+ 	intr_handle = &pci_dev->intr_handle;

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

end of thread, other threads:[~2022-02-25 17:18 UTC | newest]

Thread overview: 57+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-25 17:14 patch 'net/hns3: fix residual MAC after setting default MAC' has been queued to stable release 19.11.12 christian.ehrhardt
2022-02-25 17:14 ` patch 'net/hns3: fix secondary process reference count' " christian.ehrhardt
2022-02-25 17:14 ` patch 'net/hns3: fix multi-process action register and unregister' " christian.ehrhardt
2022-02-25 17:14 ` patch 'net/hns3: unregister MP action on close for secondary' " christian.ehrhardt
2022-02-25 17:14 ` patch 'net/ice: build failure with make and GCC > 11' " christian.ehrhardt
2022-02-25 17:14 ` patch 'config/ppc: fix build with GCC >= 10' " christian.ehrhardt
2022-02-25 17:15 ` patch 'maintainers: update for stable branches' " christian.ehrhardt
2022-02-25 17:15 ` patch 'bus/ifpga: remove useless check while browsing devices' " christian.ehrhardt
2022-02-25 17:15 ` patch 'eal/linux: log hugepage create errors with filename' " christian.ehrhardt
2022-02-25 17:15 ` patch 'devtools: fix comment detection in forbidden token check' " christian.ehrhardt
2022-02-25 17:15 ` patch 'net/ixgbe: add vector Rx parameter " christian.ehrhardt
2022-02-25 17:15 ` patch 'net/bnxt: fix xstats query' " christian.ehrhardt
2022-02-25 17:15 ` patch 'net/bonding: fix mode type mismatch' " christian.ehrhardt
2022-02-25 17:15 ` patch 'app/testpmd: fix dereference before null check' " christian.ehrhardt
2022-02-25 17:15 ` patch 'net/cxgbe: fix dangling pointer by mailbox access rework' " christian.ehrhardt
2022-02-25 17:15 ` patch 'net/mlx5: fix maximum packet headers size for TSO' " christian.ehrhardt
2022-02-25 17:15 ` patch 'net/nfp: remove useless range checks' " christian.ehrhardt
2022-02-25 17:15 ` patch 'net/sfc: validate queue span when parsing flow action RSS' " christian.ehrhardt
2022-02-25 17:15 ` patch 'raw/ifpga/base: fix SPI transaction' " christian.ehrhardt
2022-02-25 17:15 ` patch 'net/ice: fix link up when starting device' " christian.ehrhardt
2022-02-25 17:15 ` patch 'net/bnxt: handle ring cleanup in case of error' " christian.ehrhardt
2022-02-25 17:15 ` patch 'raw/ifpga/base: fix port feature ID' " christian.ehrhardt
2022-02-25 17:15 ` patch 'net/memif: remove unnecessary Rx interrupt stub' " christian.ehrhardt
2022-02-25 17:15 ` patch 'net/bonding: fix RSS with early configure' " christian.ehrhardt
2022-02-25 17:15 ` patch 'net/hns3: fix using enum as boolean' " christian.ehrhardt
2022-02-25 17:15 ` patch 'net/virtio: fix Tx queue 0 overriden by queue 128' " christian.ehrhardt
2022-02-25 17:15 ` patch 'vdpa/ifc: fix log info mismatch' " christian.ehrhardt
2022-02-25 17:15 ` patch 'net/virtio-user: check FD flags getting failure' " christian.ehrhardt
2022-02-25 17:15 ` patch 'net/mlx5: reject jump to root table' " christian.ehrhardt
2022-02-25 17:15 ` patch 'build: fix warning about using -Wextra flag' " christian.ehrhardt
2022-02-25 17:15 ` patch 'kni: fix ioctl signature' " christian.ehrhardt
2022-02-25 17:15 ` patch 'doc: fix KNI PMD name typo' " christian.ehrhardt
2022-02-25 17:15 ` patch 'ring: fix error code when creating ring' " christian.ehrhardt
2022-02-25 17:15 ` patch 'test/mem: fix error check' " christian.ehrhardt
2022-02-25 17:15 ` patch 'bus/dpaa: fix C++ include guard' " christian.ehrhardt
2022-02-25 17:15 ` patch 'net/cxgbe: remove useless " christian.ehrhardt
2022-02-25 17:15 ` patch 'net/dpaa2: " christian.ehrhardt
2022-02-25 17:15 ` patch 'net/hns3: fix max packet size rollback in PF' " christian.ehrhardt
2022-02-25 17:15 ` patch 'net/hns3: fix RSS key with null' " christian.ehrhardt
2022-02-25 17:15 ` patch 'net/ixgbe: check filter init failure' " christian.ehrhardt
2022-02-25 17:15 ` patch 'net/bonding: fix promiscuous and allmulticast state' " christian.ehrhardt
2022-02-25 17:15 ` patch 'net/bonding: fix reference count on mbufs' " christian.ehrhardt
2022-02-25 17:15 ` patch 'app/testpmd: fix bonding mode set' " christian.ehrhardt
2022-02-25 17:15 ` patch 'stack: fix stubs header export' " christian.ehrhardt
2022-02-25 17:15 ` patch 'ipsec: fix C++ include' " christian.ehrhardt
2022-02-25 17:15 ` patch 'table: " christian.ehrhardt
2022-02-25 17:15 ` patch 'vhost: " christian.ehrhardt
2022-02-25 17:15 ` patch 'test/mbuf: fix mbuf data content check' " christian.ehrhardt
2022-02-25 17:15 ` patch 'ipc: end multiprocess thread during cleanup' " christian.ehrhardt
2022-02-25 17:15 ` patch 'vfio: cleanup the multiprocess sync handle' " christian.ehrhardt
2022-02-25 17:15 ` patch 'net/memif: remove pointer deference before null check' " christian.ehrhardt
2022-02-25 17:15 ` patch 'net/sfc: do not push fast free offload to default TxQ config' " christian.ehrhardt
2022-02-25 17:15 ` patch 'net/sfc: demand Tx fast free offload on EF10 simple datapath' " christian.ehrhardt
2022-02-25 17:15 ` patch 'net/iavf: count continuous DD bits for Arm' " christian.ehrhardt
2022-02-25 17:15 ` patch 'net/mlx5: fix committed bucket size' " christian.ehrhardt
2022-02-25 17:15 ` patch 'compress/octeontx: fix null pointer dereference' " christian.ehrhardt
2022-02-25 17:15 ` patch 'raw/ntb: clear all valid doorbell bits on init' " 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).