patches for DPDK stable branches
 help / color / Atom feed
* [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4
@ 2020-07-24 11:57 luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/ice: fix switch action number check' " luca.boccassi
                   ` (191 more replies)
  0 siblings, 192 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Kevin Traynor; +Cc: Luca Boccassi, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 2819f713763a3796cfc05962770e3c813e459ecf Mon Sep 17 00:00:00 2001
From: Kevin Traynor <ktraynor@redhat.com>
Date: Wed, 1 Jul 2020 14:53:05 +0100
Subject: [PATCH] vhost: remove zero-copy and client mode restriction

Commits [1] were backported as fixes from the latest DPDK release
to the stable branches. They are detecting if vhost-user client and
zero-copy are being used together. As this can be problematic in
some cases, this combination was being rejected by those patches.

It might be ok to deprecate this combination in latest DPDK,
but for stable releases we should not remove the functionality
as it may be in use with earlier releases from the same stable branch.

In fact, we know that this functionality is used at least in OVS in
multiple releases/active branches.

This patch removes the restriction of zero-copy and client mode
and adds a warning for the user.

[1]
commit a6ae060e3995
("vhost: prevent zero-copy with incompatible client mode")

commit 1c2eaf9a9852
("vhost: fix zero-copy server mode")

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Luca Boccassi <bluca@debian.org>
---
 lib/librte_vhost/socket.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c
index 2461549fe..dc3ee1e99 100644
--- a/lib/librte_vhost/socket.c
+++ b/lib/librte_vhost/socket.c
@@ -926,12 +926,10 @@ rte_vhost_driver_register(const char *path, uint64_t flags)
 			ret = -1;
 			goto out_mutex;
 		}
-		if ((flags & RTE_VHOST_USER_CLIENT) != 0) {
-			RTE_LOG(ERR, VHOST_CONFIG,
-			"error: zero copy is incompatible with vhost client mode\n");
-			ret = -1;
-			goto out_mutex;
-		}
+		if ((flags & RTE_VHOST_USER_CLIENT) != 0)
+			RTE_LOG(WARNING, VHOST_CONFIG,
+			"zero copy may be incompatible with vhost client mode\n");
+
 		vsocket->supported_features &= ~(1ULL << VIRTIO_F_IN_ORDER);
 		vsocket->features &= ~(1ULL << VIRTIO_F_IN_ORDER);
 
-- 
2.20.1


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

* [dpdk-stable] patch 'net/ice: fix switch action number check' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/hns3: clear promiscuous on PF uninit' " luca.boccassi
                   ` (190 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Wei Zhao; +Cc: Qimai Xiao, Qi Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 47be9745de536a89775543f98112b600f9653d95 Mon Sep 17 00:00:00 2001
From: Wei Zhao <wei.zhao1@intel.com>
Date: Thu, 21 May 2020 15:34:11 +0800
Subject: [PATCH] net/ice: fix switch action number check

[ upstream commit 59d3870c7facace93db794a37e136d4a9f6ef0a3 ]

The action number for switch filter should be 1, any
other such as 0 or more than 1 is invalid.

Fixes: 3428c6b6ec1f ("net/ice: add action number check for switch")

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Tested-by: Qimai Xiao <qimaix.xiao@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ice/ice_switch_filter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c
index 6c2473163..b00ac2abe 100644
--- a/drivers/net/ice/ice_switch_filter.c
+++ b/drivers/net/ice/ice_switch_filter.c
@@ -1028,7 +1028,7 @@ ice_switch_check_action(const struct rte_flow_action *actions,
 		}
 	}
 
-	if (actions_num > 1) {
+	if (actions_num != 1) {
 		rte_flow_error_set(error,
 				   EINVAL, RTE_FLOW_ERROR_TYPE_ACTION,
 				   actions,
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:48.667982112 +0100
+++ 0002-net-ice-fix-switch-action-number-check.patch	2020-07-24 12:53:48.131003553 +0100
@@ -1,13 +1,14 @@
-From 59d3870c7facace93db794a37e136d4a9f6ef0a3 Mon Sep 17 00:00:00 2001
+From 47be9745de536a89775543f98112b600f9653d95 Mon Sep 17 00:00:00 2001
 From: Wei Zhao <wei.zhao1@intel.com>
 Date: Thu, 21 May 2020 15:34:11 +0800
 Subject: [PATCH] net/ice: fix switch action number check
 
+[ upstream commit 59d3870c7facace93db794a37e136d4a9f6ef0a3 ]
+
 The action number for switch filter should be 1, any
 other such as 0 or more than 1 is invalid.
 
 Fixes: 3428c6b6ec1f ("net/ice: add action number check for switch")
-Cc: stable@dpdk.org
 
 Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
 Tested-by: Qimai Xiao <qimaix.xiao@intel.com>
@@ -17,10 +18,10 @@
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c
-index dd3f4847a..20e8187d3 100644
+index 6c2473163..b00ac2abe 100644
 --- a/drivers/net/ice/ice_switch_filter.c
 +++ b/drivers/net/ice/ice_switch_filter.c
-@@ -1388,7 +1388,7 @@ ice_switch_check_action(const struct rte_flow_action *actions,
+@@ -1028,7 +1028,7 @@ ice_switch_check_action(const struct rte_flow_action *actions,
  		}
  	}
  

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

* [dpdk-stable] patch 'net/hns3: clear promiscuous on PF uninit' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/ice: fix switch action number check' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/hns3: fix Tx less than 60 bytes' " luca.boccassi
                   ` (189 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Chengchang Tang; +Cc: Wei Hu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 3bf5b201399a507b0468326864be8b1e4870c88f Mon Sep 17 00:00:00 2001
From: Chengchang Tang <tangchengchang@huawei.com>
Date: Fri, 22 May 2020 17:21:15 +0800
Subject: [PATCH] net/hns3: clear promiscuous on PF uninit

[ upstream commit 3f28ec4a88abc319d63c652141d716720d93dc47 ]

Currently, promiscuous mode configuration are not cleared during
uninstallation based on hns3 PF device. The residual entries may cause
unnecessary bandwidth usage.

So, we need clear the PF's promisc mode status during the uninit.

Fixes: a45fd0aa0ea1 ("net/hns3: fix Rx queue search with broadcast packet")
Fixes: d51867db65c1 ("net/hns3: add initialization")

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
---
 drivers/net/hns3/hns3_ethdev.c | 53 +++++++++++++++++++++++++++-------
 1 file changed, 43 insertions(+), 10 deletions(-)

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index 3271b61fc..dbe747f9d 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -3733,7 +3733,7 @@ hns3_set_promisc_mode(struct hns3_hw *hw, bool en_uc_pmc, bool en_mc_pmc)
 }
 
 static int
-hns3_clear_all_vfs_promisc_mode(struct hns3_hw *hw)
+hns3_promisc_init(struct hns3_hw *hw)
 {
 	struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
 	struct hns3_pf *pf = &hns->pf;
@@ -3741,17 +3741,55 @@ hns3_clear_all_vfs_promisc_mode(struct hns3_hw *hw)
 	uint16_t func_id;
 	int ret;
 
+	ret = hns3_set_promisc_mode(hw, false, false);
+	if (ret) {
+		PMD_INIT_LOG(ERR, "failed to set promisc mode, ret = %d", ret);
+		return ret;
+	}
+
+	/*
+	 * In current version VFs are not supported when PF is driven by DPDK
+	 * driver. After PF has been taken over by DPDK, the original VF will
+	 * be invalid. So, there is a possibility of entry residues. It should
+	 * clear VFs's promisc mode to avoid unnecessary bandwidth usage
+	 * during init.
+	 */
 	/* func_id 0 is denoted PF, the VFs start from 1 */
 	for (func_id = 1; func_id < pf->func_num; func_id++) {
 		hns3_promisc_param_init(&param, false, false, false, func_id);
 		ret = hns3_cmd_set_promisc_mode(hw, &param);
-		if (ret)
+		if (ret) {
+			PMD_INIT_LOG(ERR, "failed to clear vf:%d promisc mode,"
+					" ret = %d", func_id, ret);
 			return ret;
+		}
 	}
 
 	return 0;
 }
 
+static void
+hns3_promisc_uninit(struct hns3_hw *hw)
+{
+	struct hns3_promisc_param param;
+	uint16_t func_id;
+	int ret;
+
+	func_id = 0;
+
+	/*
+	 * In current version VFs are not supported when PF is driven by
+	 * DPDK driver, and VFs' promisc mode status has been cleared during
+	 * init and their status will not change. So just clear PF's promisc
+	 * mode status during uninit.
+	 */
+	hns3_promisc_param_init(&param, false, false, false, func_id);
+	ret = hns3_cmd_set_promisc_mode(hw, &param);
+	if (ret)
+		PMD_INIT_LOG(ERR, "failed to clear promisc status during"
+				" uninit, ret = %d", ret);
+}
+
 static int
 hns3_dev_promiscuous_enable(struct rte_eth_dev *dev)
 {
@@ -4092,15 +4130,9 @@ hns3_init_hardware(struct hns3_adapter *hns)
 		goto err_mac_init;
 	}
 
-	ret = hns3_set_promisc_mode(hw, false, false);
+	ret = hns3_promisc_init(hw);
 	if (ret) {
-		PMD_INIT_LOG(ERR, "Failed to set promisc mode: %d", ret);
-		goto err_mac_init;
-	}
-
-	ret = hns3_clear_all_vfs_promisc_mode(hw);
-	if (ret) {
-		PMD_INIT_LOG(ERR, "Failed to clear all vfs promisc mode: %d",
+		PMD_INIT_LOG(ERR, "Failed to init promisc: %d",
 			     ret);
 		goto err_mac_init;
 	}
@@ -4259,6 +4291,7 @@ hns3_uninit_pf(struct rte_eth_dev *eth_dev)
 
 	hns3_enable_hw_error_intr(hns, false);
 	hns3_rss_uninit(hns);
+	hns3_promisc_uninit(hw);
 	hns3_fdir_filter_uninit(hns);
 	hns3_uninit_umv_space(hw);
 	hns3_pf_disable_irq0(hw);
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:48.705432454 +0100
+++ 0003-net-hns3-clear-promiscuous-on-PF-uninit.patch	2020-07-24 12:53:48.143003777 +0100
@@ -1,8 +1,10 @@
-From 3f28ec4a88abc319d63c652141d716720d93dc47 Mon Sep 17 00:00:00 2001
+From 3bf5b201399a507b0468326864be8b1e4870c88f Mon Sep 17 00:00:00 2001
 From: Chengchang Tang <tangchengchang@huawei.com>
 Date: Fri, 22 May 2020 17:21:15 +0800
 Subject: [PATCH] net/hns3: clear promiscuous on PF uninit
 
+[ upstream commit 3f28ec4a88abc319d63c652141d716720d93dc47 ]
+
 Currently, promiscuous mode configuration are not cleared during
 uninstallation based on hns3 PF device. The residual entries may cause
 unnecessary bandwidth usage.
@@ -11,7 +13,6 @@
 
 Fixes: a45fd0aa0ea1 ("net/hns3: fix Rx queue search with broadcast packet")
 Fixes: d51867db65c1 ("net/hns3: add initialization")
-Cc: stable@dpdk.org
 
 Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
 Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
@@ -20,10 +21,10 @@
  1 file changed, 43 insertions(+), 10 deletions(-)
 
 diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
-index 06c488659..1c06b8ff1 100644
+index 3271b61fc..dbe747f9d 100644
 --- a/drivers/net/hns3/hns3_ethdev.c
 +++ b/drivers/net/hns3/hns3_ethdev.c
-@@ -3826,7 +3826,7 @@ hns3_set_promisc_mode(struct hns3_hw *hw, bool en_uc_pmc, bool en_mc_pmc)
+@@ -3733,7 +3733,7 @@ hns3_set_promisc_mode(struct hns3_hw *hw, bool en_uc_pmc, bool en_mc_pmc)
  }
  
  static int
@@ -32,7 +33,7 @@
  {
  	struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
  	struct hns3_pf *pf = &hns->pf;
-@@ -3834,16 +3834,54 @@ hns3_clear_all_vfs_promisc_mode(struct hns3_hw *hw)
+@@ -3741,17 +3741,55 @@ hns3_clear_all_vfs_promisc_mode(struct hns3_hw *hw)
  	uint16_t func_id;
  	int ret;
  
@@ -49,7 +50,8 @@
 +	 * clear VFs's promisc mode to avoid unnecessary bandwidth usage
 +	 * during init.
 +	 */
- 	for (func_id = HNS3_1ST_VF_FUNC_ID; func_id < pf->func_num; func_id++) {
+ 	/* func_id 0 is denoted PF, the VFs start from 1 */
+ 	for (func_id = 1; func_id < pf->func_num; func_id++) {
  		hns3_promisc_param_init(&param, false, false, false, func_id);
  		ret = hns3_cmd_set_promisc_mode(hw, &param);
 -		if (ret)
@@ -70,7 +72,7 @@
 +	uint16_t func_id;
 +	int ret;
 +
-+	func_id = HNS3_PF_FUNC_ID;
++	func_id = 0;
 +
 +	/*
 +	 * In current version VFs are not supported when PF is driven by
@@ -88,7 +90,7 @@
  static int
  hns3_dev_promiscuous_enable(struct rte_eth_dev *dev)
  {
-@@ -4186,15 +4224,9 @@ hns3_init_hardware(struct hns3_adapter *hns)
+@@ -4092,15 +4130,9 @@ hns3_init_hardware(struct hns3_adapter *hns)
  		goto err_mac_init;
  	}
  
@@ -106,7 +108,7 @@
  			     ret);
  		goto err_mac_init;
  	}
-@@ -4353,6 +4385,7 @@ hns3_uninit_pf(struct rte_eth_dev *eth_dev)
+@@ -4259,6 +4291,7 @@ hns3_uninit_pf(struct rte_eth_dev *eth_dev)
  
  	hns3_enable_hw_error_intr(hns, false);
  	hns3_rss_uninit(hns);

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

* [dpdk-stable] patch 'net/hns3: fix Tx less than 60 bytes' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/ice: fix switch action number check' " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/hns3: clear promiscuous on PF uninit' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/hns3: add RSS hash offload to Rx configuration' " luca.boccassi
                   ` (188 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Wei Hu (Xavier); +Cc: Hao Chen, Chengchang Tang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 6dbb90a12522d0d840821570b1ba9ed062a25bae Mon Sep 17 00:00:00 2001
From: "Wei Hu (Xavier)" <xavier.huwei@huawei.com>
Date: Fri, 22 May 2020 17:21:16 +0800
Subject: [PATCH] net/hns3: fix Tx less than 60 bytes

[ upstream commit 16c374402fb88e9b9cb004e794156991da7a79a4 ]

Currently, when running testpmd application based on hns3 network engine
with csum fwd mode by "set fwd csum" command in the prompt line, sending
42 consecutive bytes of ARP packets to network port with packets
generator. But in fact hardware can't send the ARP packets and the
related logs as below:
"Preparing packet burst to failed: Invalid argument"

The hardware doesn't support transmit packets less than 60 bytes, and in
the '.tx_pkt_burst' ops implementation function named hns3_xmit_pkts
appending operation has been added for less than 60 bytes packets. So
the interception needs to be removed in the '.tx_pkt_prepare' ops
implementation function named hns3_prep_pkts.

Fixes: de620754a109 ("net/hns3: fix sending packets less than 60 bytes")
Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations")

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
---
 drivers/net/hns3/hns3_rxtx.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index 34dc389d9..dcaeab267 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -2104,12 +2104,6 @@ hns3_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 	for (i = 0; i < nb_pkts; i++) {
 		m = tx_pkts[i];
 
-		/* check the size of packet */
-		if (m->pkt_len < HNS3_MIN_FRAME_LEN) {
-			rte_errno = EINVAL;
-			return i;
-		}
-
 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:48.750857417 +0100
+++ 0004-net-hns3-fix-Tx-less-than-60-bytes.patch	2020-07-24 12:53:48.143003777 +0100
@@ -1,8 +1,10 @@
-From 16c374402fb88e9b9cb004e794156991da7a79a4 Mon Sep 17 00:00:00 2001
+From 6dbb90a12522d0d840821570b1ba9ed062a25bae Mon Sep 17 00:00:00 2001
 From: "Wei Hu (Xavier)" <xavier.huwei@huawei.com>
 Date: Fri, 22 May 2020 17:21:16 +0800
 Subject: [PATCH] net/hns3: fix Tx less than 60 bytes
 
+[ upstream commit 16c374402fb88e9b9cb004e794156991da7a79a4 ]
+
 Currently, when running testpmd application based on hns3 network engine
 with csum fwd mode by "set fwd csum" command in the prompt line, sending
 42 consecutive bytes of ARP packets to network port with packets
@@ -18,7 +20,6 @@
 
 Fixes: de620754a109 ("net/hns3: fix sending packets less than 60 bytes")
 Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations")
-Cc: stable@dpdk.org
 
 Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
 Signed-off-by: Hao Chen <chenhao164@huawei.com>
@@ -28,22 +29,22 @@
  1 file changed, 6 deletions(-)
 
 diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
-index 8b3ced116..25ba3b820 100644
+index 34dc389d9..dcaeab267 100644
 --- a/drivers/net/hns3/hns3_rxtx.c
 +++ b/drivers/net/hns3/hns3_rxtx.c
-@@ -2313,12 +2313,6 @@ hns3_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
+@@ -2104,12 +2104,6 @@ hns3_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
  	for (i = 0; i < nb_pkts; i++) {
  		m = tx_pkts[i];
  
 -		/* check the size of packet */
--		if (m->pkt_len < RTE_ETHER_MIN_LEN) {
+-		if (m->pkt_len < HNS3_MIN_FRAME_LEN) {
 -			rte_errno = EINVAL;
 -			return i;
 -		}
 -
- 		if (hns3_pkt_is_tso(m) &&
- 		    (hns3_pkt_need_linearized(m, m->nb_segs) ||
- 		     hns3_check_tso_pkt_valid(m))) {
+ #ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ 		ret = rte_validate_tx_offload(m);
+ 		if (ret != 0) {
 -- 
 2.20.1
 

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

* [dpdk-stable] patch 'net/hns3: add RSS hash offload to Rx configuration' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (2 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/hns3: fix Tx less than 60 bytes' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/hns3: fix key length when configuring RSS' " luca.boccassi
                   ` (187 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Lijun Ou; +Cc: Wei Hu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 36e0995b4d49f026bcb0eeb29c1e1d11b2b72179 Mon Sep 17 00:00:00 2001
From: Lijun Ou <oulijun@huawei.com>
Date: Fri, 22 May 2020 17:21:17 +0800
Subject: [PATCH] net/hns3: add RSS hash offload to Rx configuration

[ upstream commit fdae939696a09b4010df004be06c491d9294e319 ]

Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
enable/disable PMDs write to `rte_mbuf::hash::rss`. The hns3 PMD driver
already can notify the validity of `rte_mbuf::hash:rss` to the
application by enabling `PKT_RX_RSS_HASH` flag in `rte_mbuf::ol_flags`.

Fixes: 19a3ca4c99cf ("net/hns3: add start/stop and configure operations")
Fixes: c37ca66f2b27 ("net/hns3: support RSS")

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
---
 drivers/net/hns3/hns3_ethdev.c    | 1 +
 drivers/net/hns3/hns3_ethdev_vf.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index dbe747f9d..85d432d36 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -2228,6 +2228,7 @@ hns3_dev_configure(struct rte_eth_dev *dev)
 
 	/* When RSS is not configured, redirect the packet queue 0 */
 	if ((uint32_t)mq_mode & ETH_MQ_RX_RSS_FLAG) {
+		conf->rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
 		rss_conf = conf->rx_adv_conf.rss_conf;
 		if (rss_conf.rss_key == NULL) {
 			rss_conf.rss_key = rss_cfg->key;
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
index 251d0efe8..56a1be936 100644
--- a/drivers/net/hns3/hns3_ethdev_vf.c
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
@@ -543,6 +543,7 @@ hns3vf_dev_configure(struct rte_eth_dev *dev)
 
 	/* When RSS is not configured, redirect the packet queue 0 */
 	if ((uint32_t)mq_mode & ETH_MQ_RX_RSS_FLAG) {
+		conf->rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
 		rss_conf = conf->rx_adv_conf.rss_conf;
 		if (rss_conf.rss_key == NULL) {
 			rss_conf.rss_key = rss_cfg->key;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:48.790375842 +0100
+++ 0005-net-hns3-add-RSS-hash-offload-to-Rx-configuration.patch	2020-07-24 12:53:48.151003926 +0100
@@ -1,8 +1,10 @@
-From fdae939696a09b4010df004be06c491d9294e319 Mon Sep 17 00:00:00 2001
+From 36e0995b4d49f026bcb0eeb29c1e1d11b2b72179 Mon Sep 17 00:00:00 2001
 From: Lijun Ou <oulijun@huawei.com>
 Date: Fri, 22 May 2020 17:21:17 +0800
 Subject: [PATCH] net/hns3: add RSS hash offload to Rx configuration
 
+[ upstream commit fdae939696a09b4010df004be06c491d9294e319 ]
+
 Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
 enable/disable PMDs write to `rte_mbuf::hash::rss`. The hns3 PMD driver
 already can notify the validity of `rte_mbuf::hash:rss` to the
@@ -10,7 +12,6 @@
 
 Fixes: 19a3ca4c99cf ("net/hns3: add start/stop and configure operations")
 Fixes: c37ca66f2b27 ("net/hns3: support RSS")
-Cc: stable@dpdk.org
 
 Signed-off-by: Lijun Ou <oulijun@huawei.com>
 Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
@@ -20,10 +21,10 @@
  2 files changed, 2 insertions(+)
 
 diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
-index 1c06b8ff1..33d7c5c7b 100644
+index dbe747f9d..85d432d36 100644
 --- a/drivers/net/hns3/hns3_ethdev.c
 +++ b/drivers/net/hns3/hns3_ethdev.c
-@@ -2312,6 +2312,7 @@ hns3_dev_configure(struct rte_eth_dev *dev)
+@@ -2228,6 +2228,7 @@ hns3_dev_configure(struct rte_eth_dev *dev)
  
  	/* When RSS is not configured, redirect the packet queue 0 */
  	if ((uint32_t)mq_mode & ETH_MQ_RX_RSS_FLAG) {
@@ -32,10 +33,10 @@
  		if (rss_conf.rss_key == NULL) {
  			rss_conf.rss_key = rss_cfg->key;
 diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
-index 904562e03..16d601270 100644
+index 251d0efe8..56a1be936 100644
 --- a/drivers/net/hns3/hns3_ethdev_vf.c
 +++ b/drivers/net/hns3/hns3_ethdev_vf.c
-@@ -784,6 +784,7 @@ hns3vf_dev_configure(struct rte_eth_dev *dev)
+@@ -543,6 +543,7 @@ hns3vf_dev_configure(struct rte_eth_dev *dev)
  
  	/* When RSS is not configured, redirect the packet queue 0 */
  	if ((uint32_t)mq_mode & ETH_MQ_RX_RSS_FLAG) {

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

* [dpdk-stable] patch 'net/hns3: fix key length when configuring RSS' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (3 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/hns3: add RSS hash offload to Rx configuration' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/bnxt: fix performance for Arm' " luca.boccassi
                   ` (186 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Lijun Ou; +Cc: Wei Hu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 8a1ae3e12667d43260a9546146d7d35c17884c58 Mon Sep 17 00:00:00 2001
From: Lijun Ou <oulijun@huawei.com>
Date: Fri, 22 May 2020 17:21:18 +0800
Subject: [PATCH] net/hns3: fix key length when configuring RSS

[ upstream commit 40783b1280e1833615885dc98f3c796ad5addb54 ]

When users set the length of RSS hash key greater than the supported
length by hardware, the driver should intercept and can not configure
the wrong key into the hardware.

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

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
---
 drivers/net/hns3/hns3_flow.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 1b9dc1dae..7d5ba61c6 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1475,6 +1475,14 @@ hns3_config_rss_filter(struct rte_eth_dev *dev,
 		return -EINVAL;
 	}
 
+	if (rss_flow_conf.key_len &&
+	    rss_flow_conf.key_len > RTE_DIM(rss_info->key)) {
+		hns3_err(hw,
+			"input hash key(%u) greater than supported len(%zu)",
+			rss_flow_conf.key_len, RTE_DIM(rss_info->key));
+		return -EINVAL;
+	}
+
 	/* Filter the unsupported flow types */
 	flow_types = rss_flow_conf.types & HNS3_ETH_RSS_SUPPORT;
 	if (flow_types != rss_flow_conf.types)
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:48.836950551 +0100
+++ 0006-net-hns3-fix-key-length-when-configuring-RSS.patch	2020-07-24 12:53:48.155004000 +0100
@@ -1,14 +1,15 @@
-From 40783b1280e1833615885dc98f3c796ad5addb54 Mon Sep 17 00:00:00 2001
+From 8a1ae3e12667d43260a9546146d7d35c17884c58 Mon Sep 17 00:00:00 2001
 From: Lijun Ou <oulijun@huawei.com>
 Date: Fri, 22 May 2020 17:21:18 +0800
 Subject: [PATCH] net/hns3: fix key length when configuring RSS
 
+[ upstream commit 40783b1280e1833615885dc98f3c796ad5addb54 ]
+
 When users set the length of RSS hash key greater than the supported
 length by hardware, the driver should intercept and can not configure
 the wrong key into the hardware.
 
 Fixes: c37ca66f2b27 ("net/hns3: support RSS")
-Cc: stable@dpdk.org
 
 Signed-off-by: Lijun Ou <oulijun@huawei.com>
 Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
@@ -17,7 +18,7 @@
  1 file changed, 8 insertions(+)
 
 diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
-index aef301a8a..c7851b235 100644
+index 1b9dc1dae..7d5ba61c6 100644
 --- a/drivers/net/hns3/hns3_flow.c
 +++ b/drivers/net/hns3/hns3_flow.c
 @@ -1475,6 +1475,14 @@ hns3_config_rss_filter(struct rte_eth_dev *dev,

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

* [dpdk-stable] patch 'net/bnxt: fix performance for Arm' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (4 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/hns3: fix key length when configuring RSS' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/netvsc: fix warning when VF is removed' " luca.boccassi
                   ` (185 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Rahul Gupta; +Cc: Kalesh AP, Ajit Khaparde, Lance Richardson, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From e86198b452432b721a760e7c97624cccd1d7a6de Mon Sep 17 00:00:00 2001
From: Rahul Gupta <rahul.gupta@broadcom.com>
Date: Fri, 22 May 2020 23:12:09 +0530
Subject: [PATCH] net/bnxt: fix performance for Arm

[ upstream commit bfc1d45875e2c21deb11fa44a6ac4bc7035d33c6 ]

Eliminate unnecessary rte_smp_wmb() before writing to request/completion
doorbells. Use rte_cio_wmb() memory barrier instead of rte_io_wmb()
before writing to tx/rx request queue doorbells and use
rte_compiler_barrier() before writing to tx/rx completion queue
doorbells.

Fixes: 4af9d0c72941 ("net/bnxt: cleanup NQ doorbell")
Fixes: f8168ca0e690 ("net/bnxt: support thor controller")

Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
---
 drivers/net/bnxt/bnxt_cpr.h  |  6 +++---
 drivers/net/bnxt/bnxt_ring.h | 24 +++++++++++++-----------
 2 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_cpr.h b/drivers/net/bnxt/bnxt_cpr.h
index c2880783f..cccd6cdbe 100644
--- a/drivers/net/bnxt/bnxt_cpr.h
+++ b/drivers/net/bnxt/bnxt_cpr.h
@@ -64,9 +64,9 @@ struct bnxt_db_info;
 				(cons));				\
 } while (0)
 #define B_CP_DIS_DB(cpr, raw_cons)					\
-	rte_write32((DB_CP_FLAGS |					\
-		    RING_CMP(((cpr)->cp_ring_struct), raw_cons)),	\
-		    ((cpr)->cp_db.doorbell))
+	rte_write32_relaxed((DB_CP_FLAGS |				\
+			    RING_CMP(((cpr)->cp_ring_struct), raw_cons)), \
+			    ((cpr)->cp_db.doorbell))
 
 #define B_CP_DB(cpr, raw_cons, ring_mask)				\
 	rte_write32((DB_CP_FLAGS |					\
diff --git a/drivers/net/bnxt/bnxt_ring.h b/drivers/net/bnxt/bnxt_ring.h
index 48a39d788..9913aed05 100644
--- a/drivers/net/bnxt/bnxt_ring.h
+++ b/drivers/net/bnxt/bnxt_ring.h
@@ -82,10 +82,12 @@ void bnxt_free_rxtx_nq_ring(struct bnxt *bp);
 
 static inline void bnxt_db_write(struct bnxt_db_info *db, uint32_t idx)
 {
+	rte_cio_wmb();
+
 	if (db->db_64)
 		rte_write64_relaxed(db->db_key64 | idx, db->doorbell);
 	else
-		rte_write32(db->db_key32 | idx, db->doorbell);
+		rte_write32_relaxed(db->db_key32 | idx, db->doorbell);
 }
 
 /* Ring an NQ doorbell and disable interrupts for the ring. */
@@ -94,10 +96,10 @@ static inline void bnxt_db_nq(struct bnxt_cp_ring_info *cpr)
 	if (unlikely(!cpr->cp_db.db_64))
 		return;
 
-	rte_smp_wmb();
-	rte_write64(cpr->cp_db.db_key64 | DBR_TYPE_NQ |
-		    RING_CMP(cpr->cp_ring_struct, cpr->cp_raw_cons),
-		    cpr->cp_db.doorbell);
+	rte_cio_wmb();
+	rte_write64_relaxed(cpr->cp_db.db_key64 | DBR_TYPE_NQ |
+			    RING_CMP(cpr->cp_ring_struct, cpr->cp_raw_cons),
+			    cpr->cp_db.doorbell);
 }
 
 /* Ring an NQ doorbell and enable interrupts for the ring. */
@@ -106,10 +108,10 @@ static inline void bnxt_db_nq_arm(struct bnxt_cp_ring_info *cpr)
 	if (unlikely(!cpr->cp_db.db_64))
 		return;
 
-	rte_smp_wmb();
-	rte_write64(cpr->cp_db.db_key64 | DBR_TYPE_NQ_ARM |
-		    RING_CMP(cpr->cp_ring_struct, cpr->cp_raw_cons),
-		    cpr->cp_db.doorbell);
+	rte_cio_wmb();
+	rte_write64_relaxed(cpr->cp_db.db_key64 | DBR_TYPE_NQ_ARM |
+			    RING_CMP(cpr->cp_ring_struct, cpr->cp_raw_cons),
+			    cpr->cp_db.doorbell);
 }
 
 static inline void bnxt_db_cq(struct bnxt_cp_ring_info *cpr)
@@ -117,9 +119,9 @@ static inline void bnxt_db_cq(struct bnxt_cp_ring_info *cpr)
 	struct bnxt_db_info *db = &cpr->cp_db;
 	uint32_t idx = RING_CMP(cpr->cp_ring_struct, cpr->cp_raw_cons);
 
-	rte_smp_wmb();
+	rte_compiler_barrier();
 	if (db->db_64)
-		rte_write64(db->db_key64 | idx, db->doorbell);
+		rte_write64_relaxed(db->db_key64 | idx, db->doorbell);
 	else
 		B_CP_DIS_DB(cpr, cpr->cp_raw_cons);
 }
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:48.875692444 +0100
+++ 0007-net-bnxt-fix-performance-for-Arm.patch	2020-07-24 12:53:48.155004000 +0100
@@ -1,8 +1,10 @@
-From bfc1d45875e2c21deb11fa44a6ac4bc7035d33c6 Mon Sep 17 00:00:00 2001
+From e86198b452432b721a760e7c97624cccd1d7a6de Mon Sep 17 00:00:00 2001
 From: Rahul Gupta <rahul.gupta@broadcom.com>
 Date: Fri, 22 May 2020 23:12:09 +0530
 Subject: [PATCH] net/bnxt: fix performance for Arm
 
+[ upstream commit bfc1d45875e2c21deb11fa44a6ac4bc7035d33c6 ]
+
 Eliminate unnecessary rte_smp_wmb() before writing to request/completion
 doorbells. Use rte_cio_wmb() memory barrier instead of rte_io_wmb()
 before writing to tx/rx request queue doorbells and use
@@ -11,7 +13,6 @@
 
 Fixes: 4af9d0c72941 ("net/bnxt: cleanup NQ doorbell")
 Fixes: f8168ca0e690 ("net/bnxt: support thor controller")
-Cc: stable@dpdk.org
 
 Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
 Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

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

* [dpdk-stable] patch 'net/netvsc: fix warning when VF is removed' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (5 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/bnxt: fix performance for Arm' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/netvsc: do not query VF link state' " luca.boccassi
                   ` (184 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 370b18ccd659b433b9ff7cde3ea7fd9eb800097b Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Tue, 19 May 2020 09:52:27 -0700
Subject: [PATCH] net/netvsc: fix warning when VF is removed

[ upstream commit c6854a41266a962d1f013065db7828517b246fef ]

The code to unset owner of VF device was changing port to invalid
value before calling unset.

Fixes: 4a9efcddaddd ("net/netvsc: fix VF support with secondary process")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/netvsc/hn_vf.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/netvsc/hn_vf.c b/drivers/net/netvsc/hn_vf.c
index 1261b2e2e..97333b502 100644
--- a/drivers/net/netvsc/hn_vf.c
+++ b/drivers/net/netvsc/hn_vf.c
@@ -127,12 +127,12 @@ static void hn_vf_remove(struct hn_data *hv)
 		/* Stop incoming packets from arriving on VF */
 		hn_nvs_set_datapath(hv, NVS_DATAPATH_SYNTHETIC);
 
+		/* Give back ownership */
+		rte_eth_dev_owner_unset(hv->vf_port, hv->owner.id);
+
 		/* Stop transmission over VF */
 		hv->vf_port = HN_INVALID_PORT;
 		rte_smp_wmb();
-
-		/* Give back ownership */
-		rte_eth_dev_owner_unset(hv->vf_port, hv->owner.id);
 	}
 	rte_spinlock_unlock(&hv->vf_lock);
 }
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:48.912396938 +0100
+++ 0008-net-netvsc-fix-warning-when-VF-is-removed.patch	2020-07-24 12:53:48.155004000 +0100
@@ -1,13 +1,14 @@
-From c6854a41266a962d1f013065db7828517b246fef Mon Sep 17 00:00:00 2001
+From 370b18ccd659b433b9ff7cde3ea7fd9eb800097b Mon Sep 17 00:00:00 2001
 From: Stephen Hemminger <stephen@networkplumber.org>
 Date: Tue, 19 May 2020 09:52:27 -0700
 Subject: [PATCH] net/netvsc: fix warning when VF is removed
 
+[ upstream commit c6854a41266a962d1f013065db7828517b246fef ]
+
 The code to unset owner of VF device was changing port to invalid
 value before calling unset.
 
 Fixes: 4a9efcddaddd ("net/netvsc: fix VF support with secondary process")
-Cc: stable@dpdk.org
 
 Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
 ---
@@ -15,24 +16,25 @@
  1 file changed, 3 insertions(+), 3 deletions(-)
 
 diff --git a/drivers/net/netvsc/hn_vf.c b/drivers/net/netvsc/hn_vf.c
-index b7e3ba46b..a745c7c36 100644
+index 1261b2e2e..97333b502 100644
 --- a/drivers/net/netvsc/hn_vf.c
 +++ b/drivers/net/netvsc/hn_vf.c
-@@ -120,11 +120,11 @@ static void hn_vf_remove(struct hn_data *hv)
+@@ -127,12 +127,12 @@ static void hn_vf_remove(struct hn_data *hv)
  		/* Stop incoming packets from arriving on VF */
  		hn_nvs_set_datapath(hv, NVS_DATAPATH_SYNTHETIC);
  
--		/* Stop transmission over VF */
--		hv->vf_port = HN_INVALID_PORT;
--
- 		/* Give back ownership */
- 		rte_eth_dev_owner_unset(hv->vf_port, hv->owner.id);
++		/* Give back ownership */
++		rte_eth_dev_owner_unset(hv->vf_port, hv->owner.id);
 +
-+		/* Stop transmission over VF */
-+		hv->vf_port = HN_INVALID_PORT;
+ 		/* Stop transmission over VF */
+ 		hv->vf_port = HN_INVALID_PORT;
+ 		rte_smp_wmb();
+-
+-		/* Give back ownership */
+-		rte_eth_dev_owner_unset(hv->vf_port, hv->owner.id);
  	}
+ 	rte_spinlock_unlock(&hv->vf_lock);
  }
- 
 -- 
 2.20.1
 

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

* [dpdk-stable] patch 'net/netvsc: do not query VF link state' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (6 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/netvsc: fix warning when VF is removed' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/netvsc: do not spin forever waiting for reply' " luca.boccassi
                   ` (183 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From bbcbaf834f0ef6e42c17fb47745953747b370e3d Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Tue, 19 May 2020 09:52:28 -0700
Subject: [PATCH] net/netvsc: do not query VF link state

[ upstream commit a4f53bec7c0a8eebeb8ccff0afa46bfedf932916 ]

When the primary device link state is queried, there is no
need to query the VF state as well. The application only sees
the state of the synthetic device.

Fixes: dc7680e8597c ("net/netvsc: support integrated VF")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/netvsc/hn_ethdev.c |  4 +-
 drivers/net/netvsc/hn_var.h    |  3 --
 drivers/net/netvsc/hn_vf.c     | 99 +++++-----------------------------
 3 files changed, 15 insertions(+), 91 deletions(-)

diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c
index 6950682a9..20cf1cc90 100644
--- a/drivers/net/netvsc/hn_ethdev.c
+++ b/drivers/net/netvsc/hn_ethdev.c
@@ -201,7 +201,7 @@ static int hn_parse_args(const struct rte_eth_dev *dev)
  */
 int
 hn_dev_link_update(struct rte_eth_dev *dev,
-		   int wait_to_complete)
+		   int wait_to_complete __rte_unused)
 {
 	struct hn_data *hv = dev->data->dev_private;
 	struct rte_eth_link link, old;
@@ -215,8 +215,6 @@ hn_dev_link_update(struct rte_eth_dev *dev,
 
 	hn_rndis_get_linkspeed(hv);
 
-	hn_vf_link_update(dev, wait_to_complete);
-
 	link = (struct rte_eth_link) {
 		.link_duplex = ETH_LINK_FULL_DUPLEX,
 		.link_autoneg = ETH_LINK_SPEED_FIXED,
diff --git a/drivers/net/netvsc/hn_var.h b/drivers/net/netvsc/hn_var.h
index b4c617173..4c1e6b8c3 100644
--- a/drivers/net/netvsc/hn_var.h
+++ b/drivers/net/netvsc/hn_var.h
@@ -140,7 +140,6 @@ struct hn_data {
 	uint16_t	rss_ind[128];
 
 	struct rte_eth_dev_owner owner;
-	struct rte_intr_handle vf_intr;
 
 	struct vmbus_channel *channels[HN_MAX_CHANNELS];
 };
@@ -222,8 +221,6 @@ int	hn_vf_mc_addr_list(struct rte_eth_dev *dev,
 			   struct rte_ether_addr *mc_addr_set,
 			   uint32_t nb_mc_addr);
 
-int	hn_vf_link_update(struct rte_eth_dev *dev,
-			  int wait_to_complete);
 int	hn_vf_tx_queue_setup(struct rte_eth_dev *dev,
 			     uint16_t queue_idx, uint16_t nb_desc,
 			     unsigned int socket_id,
diff --git a/drivers/net/netvsc/hn_vf.c b/drivers/net/netvsc/hn_vf.c
index 97333b502..4e774d9d9 100644
--- a/drivers/net/netvsc/hn_vf.c
+++ b/drivers/net/netvsc/hn_vf.c
@@ -100,16 +100,8 @@ int hn_vf_add(struct rte_eth_dev *dev, struct hn_data *hv)
 
 	rte_spinlock_lock(&hv->vf_lock);
 	err = hn_vf_attach(hv, port);
-
-	if (err == 0) {
-		dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC;
-		hv->vf_intr = (struct rte_intr_handle) {
-			.fd = -1,
-			.type = RTE_INTR_HANDLE_EXT,
-		};
-		dev->intr_handle = &hv->vf_intr;
+	if (err == 0)
 		hn_nvs_set_datapath(hv, NVS_DATAPATH_VF);
-	}
 	rte_spinlock_unlock(&hv->vf_lock);
 
 	return err;
@@ -231,80 +223,6 @@ int hn_vf_info_get(struct hn_data *hv, struct rte_eth_dev_info *info)
 	return ret;
 }
 
-int hn_vf_link_update(struct rte_eth_dev *dev,
-		      int wait_to_complete)
-{
-	struct hn_data *hv = dev->data->dev_private;
-	struct rte_eth_dev *vf_dev;
-	int ret = 0;
-
-	rte_spinlock_lock(&hv->vf_lock);
-	vf_dev = hn_get_vf_dev(hv);
-	if (vf_dev && vf_dev->dev_ops->link_update)
-		ret = (*vf_dev->dev_ops->link_update)(vf_dev, wait_to_complete);
-	rte_spinlock_unlock(&hv->vf_lock);
-
-	return ret;
-}
-
-/* called when VF has link state interrupts enabled */
-static int hn_vf_lsc_event(uint16_t port_id __rte_unused,
-			   enum rte_eth_event_type event,
-			   void *cb_arg, void *out __rte_unused)
-{
-	struct rte_eth_dev *dev = cb_arg;
-
-	if (event != RTE_ETH_EVENT_INTR_LSC)
-		return 0;
-
-	/* if link state has changed pass on */
-	if (hn_dev_link_update(dev, 0) == 0)
-		return 0; /* no change */
-
-	return _rte_eth_dev_callback_process(dev,
-					     RTE_ETH_EVENT_INTR_LSC,
-					     NULL);
-}
-
-static int _hn_vf_configure(struct rte_eth_dev *dev,
-			    uint16_t vf_port,
-			    const struct rte_eth_conf *dev_conf)
-{
-	struct rte_eth_conf vf_conf = *dev_conf;
-	struct rte_eth_dev *vf_dev;
-	int ret;
-
-	vf_dev = &rte_eth_devices[vf_port];
-	if (dev_conf->intr_conf.lsc &&
-	    (vf_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC)) {
-		PMD_DRV_LOG(DEBUG, "enabling LSC for VF %u",
-			    vf_port);
-		vf_conf.intr_conf.lsc = 1;
-	} else {
-		PMD_DRV_LOG(DEBUG, "disabling LSC for VF %u",
-			    vf_port);
-		vf_conf.intr_conf.lsc = 0;
-	}
-
-	ret = rte_eth_dev_configure(vf_port,
-				    dev->data->nb_rx_queues,
-				    dev->data->nb_tx_queues,
-				    &vf_conf);
-	if (ret) {
-		PMD_DRV_LOG(ERR,
-			    "VF configuration failed: %d", ret);
-	} else if (vf_conf.intr_conf.lsc) {
-		ret = rte_eth_dev_callback_register(vf_port,
-						    RTE_ETH_DEV_INTR_LSC,
-						    hn_vf_lsc_event, dev);
-		if (ret)
-			PMD_DRV_LOG(ERR,
-				    "Failed to register LSC callback for VF %u",
-				    vf_port);
-	}
-	return ret;
-}
-
 /*
  * Configure VF if present.
  * Force VF to have same number of queues as synthetic device
@@ -313,11 +231,22 @@ int hn_vf_configure(struct rte_eth_dev *dev,
 		    const struct rte_eth_conf *dev_conf)
 {
 	struct hn_data *hv = dev->data->dev_private;
+	struct rte_eth_conf vf_conf = *dev_conf;
 	int ret = 0;
 
+	/* link state interrupt does not matter here. */
+	vf_conf.intr_conf.lsc = 0;
+
 	rte_spinlock_lock(&hv->vf_lock);
-	if (hv->vf_port != HN_INVALID_PORT)
-		ret = _hn_vf_configure(dev, hv->vf_port, dev_conf);
+	if (hv->vf_port != HN_INVALID_PORT) {
+		ret = rte_eth_dev_configure(hv->vf_port,
+					    dev->data->nb_rx_queues,
+					    dev->data->nb_tx_queues,
+					    &vf_conf);
+		if (ret != 0)
+			PMD_DRV_LOG(ERR,
+				    "VF configuration failed: %d", ret);
+	}
 	rte_spinlock_unlock(&hv->vf_lock);
 	return ret;
 }
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:48.946131528 +0100
+++ 0009-net-netvsc-do-not-query-VF-link-state.patch	2020-07-24 12:53:48.159004075 +0100
@@ -1,27 +1,28 @@
-From a4f53bec7c0a8eebeb8ccff0afa46bfedf932916 Mon Sep 17 00:00:00 2001
+From bbcbaf834f0ef6e42c17fb47745953747b370e3d Mon Sep 17 00:00:00 2001
 From: Stephen Hemminger <stephen@networkplumber.org>
 Date: Tue, 19 May 2020 09:52:28 -0700
 Subject: [PATCH] net/netvsc: do not query VF link state
 
+[ upstream commit a4f53bec7c0a8eebeb8ccff0afa46bfedf932916 ]
+
 When the primary device link state is queried, there is no
 need to query the VF state as well. The application only sees
 the state of the synthetic device.
 
 Fixes: dc7680e8597c ("net/netvsc: support integrated VF")
-Cc: stable@dpdk.org
 
 Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
 ---
  drivers/net/netvsc/hn_ethdev.c |  4 +-
  drivers/net/netvsc/hn_var.h    |  3 --
- drivers/net/netvsc/hn_vf.c     | 98 +++++-----------------------------
- 3 files changed, 15 insertions(+), 90 deletions(-)
+ drivers/net/netvsc/hn_vf.c     | 99 +++++-----------------------------
+ 3 files changed, 15 insertions(+), 91 deletions(-)
 
 diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c
-index 0f4827c54..ac182a548 100644
+index 6950682a9..20cf1cc90 100644
 --- a/drivers/net/netvsc/hn_ethdev.c
 +++ b/drivers/net/netvsc/hn_ethdev.c
-@@ -202,7 +202,7 @@ static int hn_parse_args(const struct rte_eth_dev *dev)
+@@ -201,7 +201,7 @@ static int hn_parse_args(const struct rte_eth_dev *dev)
   */
  int
  hn_dev_link_update(struct rte_eth_dev *dev,
@@ -30,7 +31,7 @@
  {
  	struct hn_data *hv = dev->data->dev_private;
  	struct rte_eth_link link, old;
-@@ -216,8 +216,6 @@ hn_dev_link_update(struct rte_eth_dev *dev,
+@@ -215,8 +215,6 @@ hn_dev_link_update(struct rte_eth_dev *dev,
  
  	hn_rndis_get_linkspeed(hv);
  
@@ -40,10 +41,10 @@
  		.link_duplex = ETH_LINK_FULL_DUPLEX,
  		.link_autoneg = ETH_LINK_SPEED_FIXED,
 diff --git a/drivers/net/netvsc/hn_var.h b/drivers/net/netvsc/hn_var.h
-index 20363389a..881832d85 100644
+index b4c617173..4c1e6b8c3 100644
 --- a/drivers/net/netvsc/hn_var.h
 +++ b/drivers/net/netvsc/hn_var.h
-@@ -141,7 +141,6 @@ struct hn_data {
+@@ -140,7 +140,6 @@ struct hn_data {
  	uint16_t	rss_ind[128];
  
  	struct rte_eth_dev_owner owner;
@@ -51,7 +52,7 @@
  
  	struct vmbus_channel *channels[HN_MAX_CHANNELS];
  };
-@@ -228,8 +227,6 @@ int	hn_vf_mc_addr_list(struct rte_eth_dev *dev,
+@@ -222,8 +221,6 @@ int	hn_vf_mc_addr_list(struct rte_eth_dev *dev,
  			   struct rte_ether_addr *mc_addr_set,
  			   uint32_t nb_mc_addr);
  
@@ -61,13 +62,14 @@
  			     uint16_t queue_idx, uint16_t nb_desc,
  			     unsigned int socket_id,
 diff --git a/drivers/net/netvsc/hn_vf.c b/drivers/net/netvsc/hn_vf.c
-index a745c7c36..f5f15c046 100644
+index 97333b502..4e774d9d9 100644
 --- a/drivers/net/netvsc/hn_vf.c
 +++ b/drivers/net/netvsc/hn_vf.c
-@@ -97,15 +97,8 @@ int hn_vf_add(struct rte_eth_dev *dev, struct hn_data *hv)
- 	}
+@@ -100,16 +100,8 @@ int hn_vf_add(struct rte_eth_dev *dev, struct hn_data *hv)
  
+ 	rte_spinlock_lock(&hv->vf_lock);
  	err = hn_vf_attach(hv, port);
+-
 -	if (err == 0) {
 -		dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC;
 -		hv->vf_intr = (struct rte_intr_handle) {
@@ -78,10 +80,10 @@
 +	if (err == 0)
  		hn_nvs_set_datapath(hv, NVS_DATAPATH_VF);
 -	}
+ 	rte_spinlock_unlock(&hv->vf_lock);
  
  	return err;
- }
-@@ -223,80 +216,6 @@ int hn_vf_info_get(struct hn_data *hv, struct rte_eth_dev_info *info)
+@@ -231,80 +223,6 @@ int hn_vf_info_get(struct hn_data *hv, struct rte_eth_dev_info *info)
  	return ret;
  }
  
@@ -92,11 +94,11 @@
 -	struct rte_eth_dev *vf_dev;
 -	int ret = 0;
 -
--	rte_rwlock_read_lock(&hv->vf_lock);
+-	rte_spinlock_lock(&hv->vf_lock);
 -	vf_dev = hn_get_vf_dev(hv);
 -	if (vf_dev && vf_dev->dev_ops->link_update)
 -		ret = (*vf_dev->dev_ops->link_update)(vf_dev, wait_to_complete);
--	rte_rwlock_read_unlock(&hv->vf_lock);
+-	rte_spinlock_unlock(&hv->vf_lock);
 -
 -	return ret;
 -}
@@ -162,7 +164,7 @@
  /*
   * Configure VF if present.
   * Force VF to have same number of queues as synthetic device
-@@ -305,11 +224,22 @@ int hn_vf_configure(struct rte_eth_dev *dev,
+@@ -313,11 +231,22 @@ int hn_vf_configure(struct rte_eth_dev *dev,
  		    const struct rte_eth_conf *dev_conf)
  {
  	struct hn_data *hv = dev->data->dev_private;
@@ -172,7 +174,7 @@
 +	/* link state interrupt does not matter here. */
 +	vf_conf.intr_conf.lsc = 0;
 +
- 	rte_rwlock_read_lock(&hv->vf_lock);
+ 	rte_spinlock_lock(&hv->vf_lock);
 -	if (hv->vf_port != HN_INVALID_PORT)
 -		ret = _hn_vf_configure(dev, hv->vf_port, dev_conf);
 +	if (hv->vf_port != HN_INVALID_PORT) {
@@ -184,7 +186,7 @@
 +			PMD_DRV_LOG(ERR,
 +				    "VF configuration failed: %d", ret);
 +	}
- 	rte_rwlock_read_unlock(&hv->vf_lock);
+ 	rte_spinlock_unlock(&hv->vf_lock);
  	return ret;
  }
 -- 

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

* [dpdk-stable] patch 'net/netvsc: do not spin forever waiting for reply' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (7 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/netvsc: do not query VF link state' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'app/testpmd: fix memory leak on error path' " luca.boccassi
                   ` (182 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 895e0773bd95e6fcc935128fa8ab34c7d5b3f881 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Tue, 19 May 2020 09:52:30 -0700
Subject: [PATCH] net/netvsc: do not spin forever waiting for reply

[ upstream commit 3c9be81be917e1659a3a9ab332c277280986ed03 ]

Because of bugs in driver or host a reply to a request might
never occur. Better to give an error than spin forever.

Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/netvsc/hn_rndis.c | 30 ++++++++++++++++++++++++++++--
 1 file changed, 28 insertions(+), 2 deletions(-)

diff --git a/drivers/net/netvsc/hn_rndis.c b/drivers/net/netvsc/hn_rndis.c
index 2b4714042..bce3dab68 100644
--- a/drivers/net/netvsc/hn_rndis.c
+++ b/drivers/net/netvsc/hn_rndis.c
@@ -10,6 +10,7 @@
 #include <stdio.h>
 #include <errno.h>
 #include <unistd.h>
+#include <time.h>
 
 #include <rte_ethdev_driver.h>
 #include <rte_ethdev.h>
@@ -33,6 +34,9 @@
 #include "hn_rndis.h"
 #include "ndis.h"
 
+#define RNDIS_TIMEOUT_SEC 5
+#define RNDIS_DELAY_MS    10
+
 #define HN_RNDIS_XFER_SIZE		0x4000
 
 #define HN_NDIS_TXCSUM_CAP_IP4		\
@@ -348,7 +352,7 @@ void hn_rndis_receive_response(struct hn_data *hv,
 	rte_smp_wmb();
 
 	if (rte_atomic32_cmpset(&hv->rndis_pending, hdr->rid, 0) == 0) {
-		PMD_DRV_LOG(ERR,
+		PMD_DRV_LOG(NOTICE,
 			    "received id %#x pending id %#x",
 			    hdr->rid, (uint32_t)hv->rndis_pending);
 	}
@@ -371,6 +375,11 @@ static int hn_rndis_exec1(struct hn_data *hv,
 		return -EIO;
 	}
 
+	if (rid == 0) {
+		PMD_DRV_LOG(ERR, "Invalid request id");
+		return -EINVAL;
+	}
+
 	if (comp != NULL &&
 	    rte_atomic32_cmpset(&hv->rndis_pending, 0, rid) == 0) {
 		PMD_DRV_LOG(ERR,
@@ -385,9 +394,26 @@ static int hn_rndis_exec1(struct hn_data *hv,
 	}
 
 	if (comp) {
+		time_t start = time(NULL);
+
 		/* Poll primary channel until response received */
-		while (hv->rndis_pending == rid)
+		while (hv->rndis_pending == rid) {
+			if (hv->closed)
+				return -ENETDOWN;
+
+			if (time(NULL) - start > RNDIS_TIMEOUT_SEC) {
+				PMD_DRV_LOG(ERR,
+					    "RNDIS response timed out");
+
+				rte_atomic32_cmpset(&hv->rndis_pending, rid, 0);
+				return -ETIMEDOUT;
+			}
+
+			if (rte_vmbus_chan_rx_empty(hv->primary->chan))
+				rte_delay_ms(RNDIS_DELAY_MS);
+
 			hn_process_events(hv, 0, 1);
+		}
 
 		memcpy(comp, hv->rndis_resp, comp_len);
 	}
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:48.984085277 +0100
+++ 0010-net-netvsc-do-not-spin-forever-waiting-for-reply.patch	2020-07-24 12:53:48.159004075 +0100
@@ -1,13 +1,14 @@
-From 3c9be81be917e1659a3a9ab332c277280986ed03 Mon Sep 17 00:00:00 2001
+From 895e0773bd95e6fcc935128fa8ab34c7d5b3f881 Mon Sep 17 00:00:00 2001
 From: Stephen Hemminger <stephen@networkplumber.org>
 Date: Tue, 19 May 2020 09:52:30 -0700
 Subject: [PATCH] net/netvsc: do not spin forever waiting for reply
 
+[ upstream commit 3c9be81be917e1659a3a9ab332c277280986ed03 ]
+
 Because of bugs in driver or host a reply to a request might
 never occur. Better to give an error than spin forever.
 
 Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device")
-Cc: stable@dpdk.org
 
 Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
 ---
@@ -15,7 +16,7 @@
  1 file changed, 28 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/net/netvsc/hn_rndis.c b/drivers/net/netvsc/hn_rndis.c
-index 6a850ce5f..d186ddeab 100644
+index 2b4714042..bce3dab68 100644
 --- a/drivers/net/netvsc/hn_rndis.c
 +++ b/drivers/net/netvsc/hn_rndis.c
 @@ -10,6 +10,7 @@
@@ -26,7 +27,7 @@
  
  #include <rte_ethdev_driver.h>
  #include <rte_ethdev.h>
-@@ -34,6 +35,9 @@
+@@ -33,6 +34,9 @@
  #include "hn_rndis.h"
  #include "ndis.h"
  
@@ -36,7 +37,7 @@
  #define HN_RNDIS_XFER_SIZE		0x4000
  
  #define HN_NDIS_TXCSUM_CAP_IP4		\
-@@ -354,7 +358,7 @@ void hn_rndis_receive_response(struct hn_data *hv,
+@@ -348,7 +352,7 @@ void hn_rndis_receive_response(struct hn_data *hv,
  	rte_smp_wmb();
  
  	if (rte_atomic32_cmpset(&hv->rndis_pending, hdr->rid, 0) == 0) {
@@ -45,7 +46,7 @@
  			    "received id %#x pending id %#x",
  			    hdr->rid, (uint32_t)hv->rndis_pending);
  	}
-@@ -377,6 +381,11 @@ static int hn_rndis_exec1(struct hn_data *hv,
+@@ -371,6 +375,11 @@ static int hn_rndis_exec1(struct hn_data *hv,
  		return -EIO;
  	}
  
@@ -57,7 +58,7 @@
  	if (comp != NULL &&
  	    rte_atomic32_cmpset(&hv->rndis_pending, 0, rid) == 0) {
  		PMD_DRV_LOG(ERR,
-@@ -391,9 +400,26 @@ static int hn_rndis_exec1(struct hn_data *hv,
+@@ -385,9 +394,26 @@ static int hn_rndis_exec1(struct hn_data *hv,
  	}
  
  	if (comp) {

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

* [dpdk-stable] patch 'app/testpmd: fix memory leak on error path' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (8 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/netvsc: do not spin forever waiting for reply' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/mlx5: remove needless Tx queue initialization check' " luca.boccassi
                   ` (181 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Yunjian Wang; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 77b9982fa2eba4652be86d61c5662958a2902f0c Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian@huawei.com>
Date: Mon, 25 May 2020 09:46:23 +0800
Subject: [PATCH] app/testpmd: fix memory leak on error path

[ upstream commit eb577e575d160eae08bcd9b7acf8a9d8fe795f89 ]

This patch fixes the resource leak issue.

Fixes: e63b50162aa3 ("app/testpmd: clean metering and policing commands")

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 app/test-pmd/cmdline_mtr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/app/test-pmd/cmdline_mtr.c b/app/test-pmd/cmdline_mtr.c
index ab5c8642d..045c2e28d 100644
--- a/app/test-pmd/cmdline_mtr.c
+++ b/app/test-pmd/cmdline_mtr.c
@@ -1262,6 +1262,7 @@ static void cmd_set_port_meter_policer_action_parsed(void *parsed_result,
 	ret = rte_mtr_policer_actions_update(port_id, mtr_id,
 		action_mask, actions, &error);
 	if (ret != 0) {
+		free(actions);
 		print_err_msg(&error);
 		return;
 	}
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:49.024237896 +0100
+++ 0011-app-testpmd-fix-memory-leak-on-error-path.patch	2020-07-24 12:53:48.159004075 +0100
@@ -1,12 +1,13 @@
-From eb577e575d160eae08bcd9b7acf8a9d8fe795f89 Mon Sep 17 00:00:00 2001
+From 77b9982fa2eba4652be86d61c5662958a2902f0c Mon Sep 17 00:00:00 2001
 From: Yunjian Wang <wangyunjian@huawei.com>
 Date: Mon, 25 May 2020 09:46:23 +0800
 Subject: [PATCH] app/testpmd: fix memory leak on error path
 
+[ upstream commit eb577e575d160eae08bcd9b7acf8a9d8fe795f89 ]
+
 This patch fixes the resource leak issue.
 
 Fixes: e63b50162aa3 ("app/testpmd: clean metering and policing commands")
-Cc: stable@dpdk.org
 
 Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
 Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
@@ -15,7 +16,7 @@
  1 file changed, 1 insertion(+)
 
 diff --git a/app/test-pmd/cmdline_mtr.c b/app/test-pmd/cmdline_mtr.c
-index caa7e9864..ee16244de 100644
+index ab5c8642d..045c2e28d 100644
 --- a/app/test-pmd/cmdline_mtr.c
 +++ b/app/test-pmd/cmdline_mtr.c
 @@ -1262,6 +1262,7 @@ static void cmd_set_port_meter_policer_action_parsed(void *parsed_result,

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

* [dpdk-stable] patch 'net/mlx5: remove needless Tx queue initialization check' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (9 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'app/testpmd: fix memory leak on error path' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/mlx5: fix unreachable MPLS error path' " luca.boccassi
                   ` (180 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Michael Baum; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From efe4acdd4a6962bf704b8f7eaffb4731aaa60a05 Mon Sep 17 00:00:00 2001
From: Michael Baum <michaelba@mellanox.com>
Date: Wed, 27 May 2020 08:37:56 +0000
Subject: [PATCH] net/mlx5: remove needless Tx queue initialization check

[ upstream commit c55ec83b5822af0a1be9ad016714b8adc68b1a51 ]

The mlx5_txq_obj_new function defines a pointer named txq_data and
assign value into it. After assigning, the code writer is sure that the
variable does not point to NULL and even express it using assertion.

During the function, the function does dereferencing to the pointer
several times and at no point change its value. However, at the end of
the function at the error label when it wants to free one of the fields
of the structure that txq_data points to, it checks again whether
txq_data is invalid.
This check is unnecessary since it knows for sure that txq_data is
valid.

Remove the aforementioned needless check.

Fixes: 644906881881 ("net/mlx5: add free on completion queue")

Signed-off-by: Michael Baum <michaelba@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
 drivers/net/mlx5/mlx5_txq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
index c7751e83c..42dcd7a4b 100644
--- a/drivers/net/mlx5/mlx5_txq.c
+++ b/drivers/net/mlx5/mlx5_txq.c
@@ -786,7 +786,7 @@ error:
 		claim_zero(mlx5_glue->destroy_cq(tmpl.cq));
 	if (tmpl.qp)
 		claim_zero(mlx5_glue->destroy_qp(tmpl.qp));
-	if (txq_data && txq_data->fcqs)
+	if (txq_data->fcqs)
 		rte_free(txq_data->fcqs);
 	if (txq_obj)
 		rte_free(txq_obj);
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:49.061713647 +0100
+++ 0012-net-mlx5-remove-needless-Tx-queue-initialization-che.patch	2020-07-24 12:53:48.163004149 +0100
@@ -1,8 +1,10 @@
-From c55ec83b5822af0a1be9ad016714b8adc68b1a51 Mon Sep 17 00:00:00 2001
+From efe4acdd4a6962bf704b8f7eaffb4731aaa60a05 Mon Sep 17 00:00:00 2001
 From: Michael Baum <michaelba@mellanox.com>
 Date: Wed, 27 May 2020 08:37:56 +0000
 Subject: [PATCH] net/mlx5: remove needless Tx queue initialization check
 
+[ upstream commit c55ec83b5822af0a1be9ad016714b8adc68b1a51 ]
+
 The mlx5_txq_obj_new function defines a pointer named txq_data and
 assign value into it. After assigning, the code writer is sure that the
 variable does not point to NULL and even express it using assertion.
@@ -18,7 +20,6 @@
 Remove the aforementioned needless check.
 
 Fixes: 644906881881 ("net/mlx5: add free on completion queue")
-Cc: stable@dpdk.org
 
 Signed-off-by: Michael Baum <michaelba@mellanox.com>
 Acked-by: Matan Azrad <matan@mellanox.com>
@@ -27,10 +28,10 @@
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
-index 7cc620a90..80d99ff94 100644
+index c7751e83c..42dcd7a4b 100644
 --- a/drivers/net/mlx5/mlx5_txq.c
 +++ b/drivers/net/mlx5/mlx5_txq.c
-@@ -793,7 +793,7 @@ error:
+@@ -786,7 +786,7 @@ error:
  		claim_zero(mlx5_glue->destroy_cq(tmpl.cq));
  	if (tmpl.qp)
  		claim_zero(mlx5_glue->destroy_qp(tmpl.qp));

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

* [dpdk-stable] patch 'net/mlx5: fix unreachable MPLS error path' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (10 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/mlx5: remove needless Tx queue initialization check' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/mlx5: fix secondary process resources release' " luca.boccassi
                   ` (179 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Michael Baum; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From edd6234fbd3b8698fab41e7f41ed0aea5b2a80ea Mon Sep 17 00:00:00 2001
From: Michael Baum <michaelba@mellanox.com>
Date: Wed, 27 May 2020 08:37:57 +0000
Subject: [PATCH] net/mlx5: fix unreachable MPLS error path

[ upstream commit 01de93f2451730d480db8db18921e1bca7cb1f3e ]

The mlx5_flow_validate_item_mpls function checks MPLS item validation.
It first checks if the device supports MPLS, it is done using the ifdef
condition that if it fails to skip to endif and return the appropriate
error.

When MPLS is supported, the preprocessor will copy the body of the
function ending with return 0 followed by the lines that report MPLS
support.
In fact, these lines are unreachable because before them the function
returns 0 and in any case they are unnecessary.

Replace the endif by else and move endif to the end of the
function.

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

Signed-off-by: Michael Baum <michaelba@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
 drivers/net/mlx5/mlx5_flow.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index e05c35a41..400273f25 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -2230,11 +2230,12 @@ mlx5_flow_validate_item_mpls(struct rte_eth_dev *dev __rte_unused,
 	if (ret < 0)
 		return ret;
 	return 0;
-#endif
+#else
 	return rte_flow_error_set(error, ENOTSUP,
 				  RTE_FLOW_ERROR_TYPE_ITEM, item,
 				  "MPLS is not supported by Verbs, please"
 				  " update.");
+#endif
 }
 
 /**
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:49.096437178 +0100
+++ 0013-net-mlx5-fix-unreachable-MPLS-error-path.patch	2020-07-24 12:53:48.167004224 +0100
@@ -1,8 +1,10 @@
-From 01de93f2451730d480db8db18921e1bca7cb1f3e Mon Sep 17 00:00:00 2001
+From edd6234fbd3b8698fab41e7f41ed0aea5b2a80ea Mon Sep 17 00:00:00 2001
 From: Michael Baum <michaelba@mellanox.com>
 Date: Wed, 27 May 2020 08:37:57 +0000
 Subject: [PATCH] net/mlx5: fix unreachable MPLS error path
 
+[ upstream commit 01de93f2451730d480db8db18921e1bca7cb1f3e ]
+
 The mlx5_flow_validate_item_mpls function checks MPLS item validation.
 It first checks if the device supports MPLS, it is done using the ifdef
 condition that if it fails to skip to endif and return the appropriate
@@ -18,7 +20,6 @@
 function.
 
 Fixes: 23c1d42c7138 ("net/mlx5: split flow validation to dedicated function")
-Cc: stable@dpdk.org
 
 Signed-off-by: Michael Baum <michaelba@mellanox.com>
 Acked-by: Matan Azrad <matan@mellanox.com>
@@ -27,10 +28,10 @@
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
-index ae478a510..f2c3cf90d 100644
+index e05c35a41..400273f25 100644
 --- a/drivers/net/mlx5/mlx5_flow.c
 +++ b/drivers/net/mlx5/mlx5_flow.c
-@@ -2269,11 +2269,12 @@ mlx5_flow_validate_item_mpls(struct rte_eth_dev *dev __rte_unused,
+@@ -2230,11 +2230,12 @@ mlx5_flow_validate_item_mpls(struct rte_eth_dev *dev __rte_unused,
  	if (ret < 0)
  		return ret;
  	return 0;

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

* [dpdk-stable] patch 'net/mlx5: fix secondary process resources release' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (11 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/mlx5: fix unreachable MPLS error path' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/mlx5: fix interrupt installation timing' " luca.boccassi
                   ` (178 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Suanming Mou; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From f32fd4561c6e74e184e3a30d55e7de6581a24a6f Mon Sep 17 00:00:00 2001
From: Suanming Mou <suanmingm@mellanox.com>
Date: Thu, 28 May 2020 14:59:49 +0800
Subject: [PATCH] net/mlx5: fix secondary process resources release

[ upstream commit 2786b7bf9084b32dde9a346d92ab1c27f0ffc476 ]

When secondary process starts, it will allocate its own process private
data, and also does remap to UAR register of the Tx queue. Once the
secondary process exits, these resources should be released accordingly.
And the shared resources owned by primary should not be touched.

Currently, once one port in the secondary process spawn failed, all the
other spawned ports will also be released during process exits. However,
the mlx5_dev_close() function does not add the cases for secondary
process, it means call the mlx5_dev_close() function directly in
secondary process releases the resources it should not touch.

Add the case for secondary process release to its own resources in
mlx5_dev_close() function to help it quits gracefully.

Fixes: 942d13e6e7d1 ("net/mlx5: fix sharing context destroy order")
Fixes: 3a8207423a0f ("net/mlx5: close all ports on remove")

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
 drivers/net/mlx5/mlx5.c      | 47 +++++++++++++++++++++++++-----------
 drivers/net/mlx5/mlx5_rxtx.h |  1 +
 drivers/net/mlx5/mlx5_txq.c  | 24 ++++++++++++++++++
 3 files changed, 58 insertions(+), 14 deletions(-)

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 8879df317..1e34f6263 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -1234,6 +1234,17 @@ mlx5_dev_close(struct rte_eth_dev *dev)
 	unsigned int i;
 	int ret;
 
+	if (rte_eal_process_type() == RTE_PROC_SECONDARY) {
+		/* Check if process_private released. */
+		if (!dev->process_private)
+			return;
+		mlx5_tx_uar_uninit_secondary(dev);
+		mlx5_proc_priv_uninit(dev);
+		rte_eth_dev_release_port(dev);
+		return;
+	}
+	if (!priv->sh)
+		return;
 	DRV_LOG(DEBUG, "port %u closing device \"%s\"",
 		dev->data->port_id,
 		((priv->sh->ctx != NULL) ? priv->sh->ctx->device->name : ""));
@@ -1282,16 +1293,13 @@ mlx5_dev_close(struct rte_eth_dev *dev)
 		close(priv->nl_socket_rdma);
 	if (priv->vmwa_context)
 		mlx5_vlan_vmwa_exit(priv->vmwa_context);
-	if (priv->sh) {
-		/*
-		 * Free the shared context in last turn, because the cleanup
-		 * routines above may use some shared fields, like
-		 * mlx5_nl_mac_addr_flush() uses ibdev_path for retrieveing
-		 * ifindex if Netlink fails.
-		 */
-		mlx5_free_shared_ibctx(priv->sh);
-		priv->sh = NULL;
-	}
+	/*
+	 * Free the shared context in last turn, because the cleanup
+	 * routines above may use some shared fields, like
+	 * mlx5_nl_mac_addr_flush() uses ibdev_path for retrieveing
+	 * ifindex if Netlink fails.
+	 */
+	mlx5_free_shared_ibctx(priv->sh);
 	ret = mlx5_hrxq_verify(dev);
 	if (ret)
 		DRV_LOG(WARNING, "port %u some hash Rx queue still remain",
@@ -2164,11 +2172,11 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
 		/* Receive command fd from primary process */
 		err = mlx5_mp_req_verbs_cmd_fd(eth_dev);
 		if (err < 0)
-			return NULL;
+			goto err_secondary;
 		/* Remap UAR for Tx queues. */
 		err = mlx5_tx_uar_init_secondary(eth_dev, err);
 		if (err)
-			return NULL;
+			goto err_secondary;
 		/*
 		 * Ethdev pointer is still required as input since
 		 * the primary device is not accessible from the
@@ -2177,6 +2185,9 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
 		eth_dev->rx_pkt_burst = mlx5_select_rx_function(eth_dev);
 		eth_dev->tx_pkt_burst = mlx5_select_tx_function(eth_dev);
 		return eth_dev;
+err_secondary:
+		mlx5_dev_close(eth_dev);
+		return NULL;
 	}
 	/*
 	 * Some parameters ("tx_db_nc" in particularly) are needed in
@@ -3445,8 +3456,16 @@ mlx5_pci_remove(struct rte_pci_device *pci_dev)
 {
 	uint16_t port_id;
 
-	RTE_ETH_FOREACH_DEV_OF(port_id, &pci_dev->device)
-		rte_eth_dev_close(port_id);
+	RTE_ETH_FOREACH_DEV_OF(port_id, &pci_dev->device) {
+		/*
+		 * mlx5_dev_close() is not registered to secondary process,
+		 * call the close function explicitly for secondary process.
+		 */
+		if (rte_eal_process_type() == RTE_PROC_SECONDARY)
+			mlx5_dev_close(&rte_eth_devices[port_id]);
+		else
+			rte_eth_dev_close(port_id);
+	}
 	return 0;
 }
 
diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h
index a50f057c1..daa67e2f5 100644
--- a/drivers/net/mlx5/mlx5_rxtx.h
+++ b/drivers/net/mlx5/mlx5_rxtx.h
@@ -429,6 +429,7 @@ int mlx5_tx_hairpin_queue_setup
 	 const struct rte_eth_hairpin_conf *hairpin_conf);
 void mlx5_tx_queue_release(void *dpdk_txq);
 int mlx5_tx_uar_init_secondary(struct rte_eth_dev *dev, int fd);
+void mlx5_tx_uar_uninit_secondary(struct rte_eth_dev *dev);
 struct mlx5_txq_obj *mlx5_txq_obj_new(struct rte_eth_dev *dev, uint16_t idx,
 				      enum mlx5_txq_obj_type type);
 struct mlx5_txq_obj *mlx5_txq_obj_get(struct rte_eth_dev *dev, uint16_t idx);
diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
index 42dcd7a4b..1947e15f6 100644
--- a/drivers/net/mlx5/mlx5_txq.c
+++ b/drivers/net/mlx5/mlx5_txq.c
@@ -424,6 +424,30 @@ txq_uar_uninit_secondary(struct mlx5_txq_ctrl *txq_ctrl)
 	munmap(RTE_PTR_ALIGN_FLOOR(addr, page_size), page_size);
 }
 
+/**
+ * Deinitialize Tx UAR registers for secondary process.
+ *
+ * @param dev
+ *   Pointer to Ethernet device.
+ */
+void
+mlx5_tx_uar_uninit_secondary(struct rte_eth_dev *dev)
+{
+	struct mlx5_priv *priv = dev->data->dev_private;
+	struct mlx5_txq_data *txq;
+	struct mlx5_txq_ctrl *txq_ctrl;
+	unsigned int i;
+
+	assert(rte_eal_process_type() == RTE_PROC_SECONDARY);
+	for (i = 0; i != priv->txqs_n; ++i) {
+		if (!(*priv->txqs)[i])
+			continue;
+		txq = (*priv->txqs)[i];
+		txq_ctrl = container_of(txq, struct mlx5_txq_ctrl, txq);
+		txq_uar_uninit_secondary(txq_ctrl);
+	}
+}
+
 /**
  * Initialize Tx UAR registers for secondary process.
  *
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:49.138701107 +0100
+++ 0014-net-mlx5-fix-secondary-process-resources-release.patch	2020-07-24 12:53:48.175004373 +0100
@@ -1,8 +1,10 @@
-From 2786b7bf9084b32dde9a346d92ab1c27f0ffc476 Mon Sep 17 00:00:00 2001
+From f32fd4561c6e74e184e3a30d55e7de6581a24a6f Mon Sep 17 00:00:00 2001
 From: Suanming Mou <suanmingm@mellanox.com>
 Date: Thu, 28 May 2020 14:59:49 +0800
 Subject: [PATCH] net/mlx5: fix secondary process resources release
 
+[ upstream commit 2786b7bf9084b32dde9a346d92ab1c27f0ffc476 ]
+
 When secondary process starts, it will allocate its own process private
 data, and also does remap to UAR register of the Tx queue. Once the
 secondary process exits, these resources should be released accordingly.
@@ -19,7 +21,6 @@
 
 Fixes: 942d13e6e7d1 ("net/mlx5: fix sharing context destroy order")
 Fixes: 3a8207423a0f ("net/mlx5: close all ports on remove")
-Cc: stable@dpdk.org
 
 Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
 Acked-by: Matan Azrad <matan@mellanox.com>
@@ -30,10 +31,10 @@
  3 files changed, 58 insertions(+), 14 deletions(-)
 
 diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
-index 5589772eb..81102631a 100644
+index 8879df317..1e34f6263 100644
 --- a/drivers/net/mlx5/mlx5.c
 +++ b/drivers/net/mlx5/mlx5.c
-@@ -1423,6 +1423,17 @@ mlx5_dev_close(struct rte_eth_dev *dev)
+@@ -1234,6 +1234,17 @@ mlx5_dev_close(struct rte_eth_dev *dev)
  	unsigned int i;
  	int ret;
  
@@ -51,10 +52,10 @@
  	DRV_LOG(DEBUG, "port %u closing device \"%s\"",
  		dev->data->port_id,
  		((priv->sh->ctx != NULL) ? priv->sh->ctx->device->name : ""));
-@@ -1512,16 +1523,13 @@ mlx5_dev_close(struct rte_eth_dev *dev)
- 	if (ret)
- 		DRV_LOG(WARNING, "port %u some flows still remain",
- 			dev->data->port_id);
+@@ -1282,16 +1293,13 @@ mlx5_dev_close(struct rte_eth_dev *dev)
+ 		close(priv->nl_socket_rdma);
+ 	if (priv->vmwa_context)
+ 		mlx5_vlan_vmwa_exit(priv->vmwa_context);
 -	if (priv->sh) {
 -		/*
 -		 * Free the shared context in last turn, because the cleanup
@@ -72,12 +73,12 @@
 +	 * ifindex if Netlink fails.
 +	 */
 +	mlx5_free_shared_ibctx(priv->sh);
- 	if (priv->domain_id != RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID) {
- 		unsigned int c = 0;
- 		uint16_t port_id;
-@@ -2409,11 +2417,11 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
+ 	ret = mlx5_hrxq_verify(dev);
+ 	if (ret)
+ 		DRV_LOG(WARNING, "port %u some hash Rx queue still remain",
+@@ -2164,11 +2172,11 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
  		/* Receive command fd from primary process */
- 		err = mlx5_mp_req_verbs_cmd_fd(&mp_id);
+ 		err = mlx5_mp_req_verbs_cmd_fd(eth_dev);
  		if (err < 0)
 -			return NULL;
 +			goto err_secondary;
@@ -89,7 +90,7 @@
  		/*
  		 * Ethdev pointer is still required as input since
  		 * the primary device is not accessible from the
-@@ -2422,6 +2430,9 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
+@@ -2177,6 +2185,9 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
  		eth_dev->rx_pkt_burst = mlx5_select_rx_function(eth_dev);
  		eth_dev->tx_pkt_burst = mlx5_select_tx_function(eth_dev);
  		return eth_dev;
@@ -99,7 +100,7 @@
  	}
  	/*
  	 * Some parameters ("tx_db_nc" in particularly) are needed in
-@@ -3707,8 +3718,16 @@ mlx5_pci_remove(struct rte_pci_device *pci_dev)
+@@ -3445,8 +3456,16 @@ mlx5_pci_remove(struct rte_pci_device *pci_dev)
  {
  	uint16_t port_id;
  
@@ -119,10 +120,10 @@
  }
  
 diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h
-index 48f2b7941..26621ff19 100644
+index a50f057c1..daa67e2f5 100644
 --- a/drivers/net/mlx5/mlx5_rxtx.h
 +++ b/drivers/net/mlx5/mlx5_rxtx.h
-@@ -434,6 +434,7 @@ int mlx5_tx_hairpin_queue_setup
+@@ -429,6 +429,7 @@ int mlx5_tx_hairpin_queue_setup
  	 const struct rte_eth_hairpin_conf *hairpin_conf);
  void mlx5_tx_queue_release(void *dpdk_txq);
  int mlx5_tx_uar_init_secondary(struct rte_eth_dev *dev, int fd);
@@ -131,10 +132,10 @@
  				      enum mlx5_txq_obj_type type);
  struct mlx5_txq_obj *mlx5_txq_obj_get(struct rte_eth_dev *dev, uint16_t idx);
 diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
-index 80d99ff94..2047a9a4e 100644
+index 42dcd7a4b..1947e15f6 100644
 --- a/drivers/net/mlx5/mlx5_txq.c
 +++ b/drivers/net/mlx5/mlx5_txq.c
-@@ -427,6 +427,30 @@ txq_uar_uninit_secondary(struct mlx5_txq_ctrl *txq_ctrl)
+@@ -424,6 +424,30 @@ txq_uar_uninit_secondary(struct mlx5_txq_ctrl *txq_ctrl)
  	munmap(RTE_PTR_ALIGN_FLOOR(addr, page_size), page_size);
  }
  
@@ -152,7 +153,7 @@
 +	struct mlx5_txq_ctrl *txq_ctrl;
 +	unsigned int i;
 +
-+	MLX5_ASSERT(rte_eal_process_type() == RTE_PROC_SECONDARY);
++	assert(rte_eal_process_type() == RTE_PROC_SECONDARY);
 +	for (i = 0; i != priv->txqs_n; ++i) {
 +		if (!(*priv->txqs)[i])
 +			continue;

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

* [dpdk-stable] patch 'net/mlx5: fix interrupt installation timing' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (12 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/mlx5: fix secondary process resources release' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/failsafe: fix RSS RETA size info' " luca.boccassi
                   ` (177 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Suanming Mou; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 5da51166d7493f5a99724d8c424c4a9c2eb5b760 Mon Sep 17 00:00:00 2001
From: Suanming Mou <suanmingm@mellanox.com>
Date: Thu, 28 May 2020 17:22:09 +0800
Subject: [PATCH] net/mlx5: fix interrupt installation timing

[ upstream commit 33860cfab62ed9a3673b1077899c1c527b09e385 ]

Currently, the DevX counter query works asynchronously with Devx
interrupt handler return the query result. When port closes, the
interrupt handler will be uninstalled and the Devx comp obj will
also be destroyed. Meanwhile the query is still not cancelled.

In this case, counter query may use the invalid Devx comp which
has been destroyed, and query failure with invalid FD will be
reported.

Adjust the shared interrupt install and uninstall timing to make
the counter asynchronous query stop before interrupt uninstall.

Fixes: f15db67df09c ("net/mlx5: accelerate DV flow counter query")

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
 drivers/net/mlx5/mlx5.c         | 101 ++++++++++---
 drivers/net/mlx5/mlx5.h         |   5 -
 drivers/net/mlx5/mlx5_ethdev.c  | 243 --------------------------------
 drivers/net/mlx5/mlx5_trigger.c |  16 ++-
 4 files changed, 96 insertions(+), 269 deletions(-)

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 1e34f6263..bb718f27f 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -12,6 +12,7 @@
 #include <stdlib.h>
 #include <errno.h>
 #include <net/if.h>
+#include <fcntl.h>
 #include <sys/mman.h>
 #include <linux/rtnetlink.h>
 
@@ -470,6 +471,85 @@ mlx5_restore_doorbell_mapping_env(int value)
 		setenv(MLX5_SHUT_UP_BF, value ? "1" : "0", 1);
 }
 
+/**
+ * Install shared asynchronous device events handler.
+ * This function is implemented to support event sharing
+ * between multiple ports of single IB device.
+ *
+ * @param sh
+ *   Pointer to mlx5_ibv_shared object.
+ */
+static void
+mlx5_dev_shared_handler_install(struct mlx5_ibv_shared *sh)
+{
+	int ret;
+	int flags;
+
+	sh->intr_handle.fd = -1;
+	flags = fcntl(sh->ctx->async_fd, F_GETFL);
+	ret = fcntl(sh->ctx->async_fd, F_SETFL, flags | O_NONBLOCK);
+	if (ret) {
+		DRV_LOG(INFO, "failed to change file descriptor async event"
+			" queue");
+	} else {
+		sh->intr_handle.fd = sh->ctx->async_fd;
+		sh->intr_handle.type = RTE_INTR_HANDLE_EXT;
+		if (rte_intr_callback_register(&sh->intr_handle,
+					mlx5_dev_interrupt_handler, sh)) {
+			DRV_LOG(INFO, "Fail to install the shared interrupt.");
+			sh->intr_handle.fd = -1;
+		}
+	}
+	if (sh->devx) {
+#ifdef HAVE_IBV_DEVX_ASYNC
+		sh->intr_handle_devx.fd = -1;
+		sh->devx_comp = mlx5_glue->devx_create_cmd_comp(sh->ctx);
+		if (!sh->devx_comp) {
+			DRV_LOG(INFO, "failed to allocate devx_comp.");
+			return;
+		}
+		flags = fcntl(sh->devx_comp->fd, F_GETFL);
+		ret = fcntl(sh->devx_comp->fd, F_SETFL, flags | O_NONBLOCK);
+		if (ret) {
+			DRV_LOG(INFO, "failed to change file descriptor"
+				" devx comp");
+			return;
+		}
+		sh->intr_handle_devx.fd = sh->devx_comp->fd;
+		sh->intr_handle_devx.type = RTE_INTR_HANDLE_EXT;
+		if (rte_intr_callback_register(&sh->intr_handle_devx,
+					mlx5_dev_interrupt_handler_devx, sh)) {
+			DRV_LOG(INFO, "Fail to install the devx shared"
+				" interrupt.");
+			sh->intr_handle_devx.fd = -1;
+		}
+#endif /* HAVE_IBV_DEVX_ASYNC */
+	}
+}
+
+/**
+ * Uninstall shared asynchronous device events handler.
+ * This function is implemented to support event sharing
+ * between multiple ports of single IB device.
+ *
+ * @param dev
+ *   Pointer to mlx5_ibv_shared object.
+ */
+static void
+mlx5_dev_shared_handler_uninstall(struct mlx5_ibv_shared *sh)
+{
+	if (sh->intr_handle.fd >= 0)
+		mlx5_intr_callback_unregister(&sh->intr_handle,
+					      mlx5_dev_interrupt_handler, sh);
+#ifdef HAVE_IBV_DEVX_ASYNC
+	if (sh->intr_handle_devx.fd >= 0)
+		rte_intr_callback_unregister(&sh->intr_handle_devx,
+				  mlx5_dev_interrupt_handler_devx, sh);
+	if (sh->devx_comp)
+		mlx5_glue->devx_destroy_cmd_comp(sh->devx_comp);
+#endif
+}
+
 /**
  * Allocate shared IB device context. If there is multiport device the
  * master and representors will share this context, if there is single
@@ -564,7 +644,6 @@ mlx5_alloc_shared_ibctx(const struct mlx5_dev_spawn_data *spawn,
 		sizeof(sh->ibdev_name));
 	strncpy(sh->ibdev_path, sh->ctx->device->ibdev_path,
 		sizeof(sh->ibdev_path));
-	pthread_mutex_init(&sh->intr_mutex, NULL);
 	/*
 	 * Setting port_id to max unallowed value means
 	 * there is no interrupt subhandler installed for
@@ -624,6 +703,7 @@ mlx5_alloc_shared_ibctx(const struct mlx5_dev_spawn_data *spawn,
 		err = rte_errno;
 		goto error;
 	}
+	mlx5_dev_shared_handler_install(sh);
 	mlx5_flow_counters_mng_init(sh);
 	/* Add device to memory callback list. */
 	rte_rwlock_write_lock(&mlx5_shared_data->mem_event_rwlock);
@@ -697,20 +777,7 @@ mlx5_free_shared_ibctx(struct mlx5_ibv_shared *sh)
 	 *  Only primary process handles async device events.
 	 **/
 	mlx5_flow_counters_mng_close(sh);
-	assert(!sh->intr_cnt);
-	if (sh->intr_cnt)
-		mlx5_intr_callback_unregister
-			(&sh->intr_handle, mlx5_dev_interrupt_handler, sh);
-#ifdef HAVE_MLX5_DEVX_ASYNC_SUPPORT
-	if (sh->devx_intr_cnt) {
-		if (sh->intr_handle_devx.fd)
-			rte_intr_callback_unregister(&sh->intr_handle_devx,
-					  mlx5_dev_interrupt_handler_devx, sh);
-		if (sh->devx_comp)
-			mlx5dv_devx_destroy_cmd_comp(sh->devx_comp);
-	}
-#endif
-	pthread_mutex_destroy(&sh->intr_mutex);
+	mlx5_dev_shared_handler_uninstall(sh);
 	if (sh->pd)
 		claim_zero(mlx5_glue->dealloc_pd(sh->pd));
 	if (sh->tis)
@@ -1248,9 +1315,6 @@ mlx5_dev_close(struct rte_eth_dev *dev)
 	DRV_LOG(DEBUG, "port %u closing device \"%s\"",
 		dev->data->port_id,
 		((priv->sh->ctx != NULL) ? priv->sh->ctx->device->name : ""));
-	/* In case mlx5_dev_stop() has not been called. */
-	mlx5_dev_interrupt_handler_uninstall(dev);
-	mlx5_dev_interrupt_handler_devx_uninstall(dev);
 	mlx5_traffic_disable(dev);
 	mlx5_flow_flush(dev, NULL);
 	mlx5_flow_meter_flush(dev, NULL);
@@ -3362,7 +3426,6 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 		rte_eth_copy_pci_info(list[i].eth_dev, pci_dev);
 		/* Restore non-PCI flags cleared by the above call. */
 		list[i].eth_dev->data->dev_flags |= restore;
-		mlx5_dev_interrupt_handler_devx_install(list[i].eth_dev);
 		rte_eth_dev_probing_finish(list[i].eth_dev);
 	}
 	if (i != ns) {
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index e4af5d40d..e53934d45 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -682,10 +682,7 @@ struct mlx5_ibv_shared {
 		push_vlan_action_list; /* List of push VLAN actions. */
 	struct mlx5_flow_counter_mng cmng; /* Counters management structure. */
 	/* Shared interrupt handler section. */
-	pthread_mutex_t intr_mutex; /* Interrupt config mutex. */
-	uint32_t intr_cnt; /* Interrupt handler reference counter. */
 	struct rte_intr_handle intr_handle; /* Interrupt handler for device. */
-	uint32_t devx_intr_cnt; /* Devx interrupt handler reference counter. */
 	struct rte_intr_handle intr_handle_devx; /* DEVX interrupt handler. */
 	struct mlx5dv_devx_cmd_comp *devx_comp; /* DEVX async comp obj. */
 	struct mlx5_devx_obj *tis; /* TIS object. */
@@ -838,8 +835,6 @@ void mlx5_dev_interrupt_handler(void *arg);
 void mlx5_dev_interrupt_handler_devx(void *arg);
 void mlx5_dev_interrupt_handler_uninstall(struct rte_eth_dev *dev);
 void mlx5_dev_interrupt_handler_install(struct rte_eth_dev *dev);
-void mlx5_dev_interrupt_handler_devx_uninstall(struct rte_eth_dev *dev);
-void mlx5_dev_interrupt_handler_devx_install(struct rte_eth_dev *dev);
 int mlx5_set_link_down(struct rte_eth_dev *dev);
 int mlx5_set_link_up(struct rte_eth_dev *dev);
 int mlx5_is_removed(struct rte_eth_dev *dev);
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index 3b4c5dbe7..3b1f18b3f 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -1475,249 +1475,6 @@ mlx5_dev_interrupt_handler_devx(void *cb_arg)
 #endif /* HAVE_IBV_DEVX_ASYNC */
 }
 
-/**
- * Uninstall shared asynchronous device events handler.
- * This function is implemented to support event sharing
- * between multiple ports of single IB device.
- *
- * @param dev
- *   Pointer to Ethernet device.
- */
-static void
-mlx5_dev_shared_handler_uninstall(struct rte_eth_dev *dev)
-{
-	struct mlx5_priv *priv = dev->data->dev_private;
-	struct mlx5_ibv_shared *sh = priv->sh;
-
-	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
-		return;
-	pthread_mutex_lock(&sh->intr_mutex);
-	assert(priv->ibv_port);
-	assert(priv->ibv_port <= sh->max_port);
-	assert(dev->data->port_id < RTE_MAX_ETHPORTS);
-	if (sh->port[priv->ibv_port - 1].ih_port_id >= RTE_MAX_ETHPORTS)
-		goto exit;
-	assert(sh->port[priv->ibv_port - 1].ih_port_id ==
-					(uint32_t)dev->data->port_id);
-	assert(sh->intr_cnt);
-	sh->port[priv->ibv_port - 1].ih_port_id = RTE_MAX_ETHPORTS;
-	if (!sh->intr_cnt || --sh->intr_cnt)
-		goto exit;
-	mlx5_intr_callback_unregister(&sh->intr_handle,
-				     mlx5_dev_interrupt_handler, sh);
-	sh->intr_handle.fd = 0;
-	sh->intr_handle.type = RTE_INTR_HANDLE_UNKNOWN;
-exit:
-	pthread_mutex_unlock(&sh->intr_mutex);
-}
-
-/**
- * Uninstall devx shared asynchronous device events handler.
- * This function is implemeted to support event sharing
- * between multiple ports of single IB device.
- *
- * @param dev
- *   Pointer to Ethernet device.
- */
-static void
-mlx5_dev_shared_handler_devx_uninstall(struct rte_eth_dev *dev)
-{
-	struct mlx5_priv *priv = dev->data->dev_private;
-	struct mlx5_ibv_shared *sh = priv->sh;
-
-	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
-		return;
-	pthread_mutex_lock(&sh->intr_mutex);
-	assert(priv->ibv_port);
-	assert(priv->ibv_port <= sh->max_port);
-	assert(dev->data->port_id < RTE_MAX_ETHPORTS);
-	if (sh->port[priv->ibv_port - 1].devx_ih_port_id >= RTE_MAX_ETHPORTS)
-		goto exit;
-	assert(sh->port[priv->ibv_port - 1].devx_ih_port_id ==
-					(uint32_t)dev->data->port_id);
-	sh->port[priv->ibv_port - 1].devx_ih_port_id = RTE_MAX_ETHPORTS;
-	if (!sh->devx_intr_cnt || --sh->devx_intr_cnt)
-		goto exit;
-	if (sh->intr_handle_devx.fd) {
-		rte_intr_callback_unregister(&sh->intr_handle_devx,
-					     mlx5_dev_interrupt_handler_devx,
-					     sh);
-		sh->intr_handle_devx.fd = 0;
-		sh->intr_handle_devx.type = RTE_INTR_HANDLE_UNKNOWN;
-	}
-	if (sh->devx_comp) {
-		mlx5_glue->devx_destroy_cmd_comp(sh->devx_comp);
-		sh->devx_comp = NULL;
-	}
-exit:
-	pthread_mutex_unlock(&sh->intr_mutex);
-}
-
-/**
- * Install shared asynchronous device events handler.
- * This function is implemented to support event sharing
- * between multiple ports of single IB device.
- *
- * @param dev
- *   Pointer to Ethernet device.
- */
-static void
-mlx5_dev_shared_handler_install(struct rte_eth_dev *dev)
-{
-	struct mlx5_priv *priv = dev->data->dev_private;
-	struct mlx5_ibv_shared *sh = priv->sh;
-	int ret;
-	int flags;
-
-	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
-		return;
-	pthread_mutex_lock(&sh->intr_mutex);
-	assert(priv->ibv_port);
-	assert(priv->ibv_port <= sh->max_port);
-	assert(dev->data->port_id < RTE_MAX_ETHPORTS);
-	if (sh->port[priv->ibv_port - 1].ih_port_id < RTE_MAX_ETHPORTS) {
-		/* The handler is already installed for this port. */
-		assert(sh->intr_cnt);
-		goto exit;
-	}
-	if (sh->intr_cnt) {
-		sh->port[priv->ibv_port - 1].ih_port_id =
-						(uint32_t)dev->data->port_id;
-		sh->intr_cnt++;
-		goto exit;
-	}
-	/* No shared handler installed. */
-	assert(sh->ctx->async_fd > 0);
-	flags = fcntl(sh->ctx->async_fd, F_GETFL);
-	ret = fcntl(sh->ctx->async_fd, F_SETFL, flags | O_NONBLOCK);
-	if (ret) {
-		DRV_LOG(INFO, "failed to change file descriptor async event"
-			" queue");
-		/* Indicate there will be no interrupts. */
-		dev->data->dev_conf.intr_conf.lsc = 0;
-		dev->data->dev_conf.intr_conf.rmv = 0;
-	} else {
-		sh->intr_handle.fd = sh->ctx->async_fd;
-		sh->intr_handle.type = RTE_INTR_HANDLE_EXT;
-		rte_intr_callback_register(&sh->intr_handle,
-					   mlx5_dev_interrupt_handler, sh);
-		sh->intr_cnt++;
-		sh->port[priv->ibv_port - 1].ih_port_id =
-						(uint32_t)dev->data->port_id;
-	}
-exit:
-	pthread_mutex_unlock(&sh->intr_mutex);
-}
-
-/**
- * Install devx shared asyncronous device events handler.
- * This function is implemeted to support event sharing
- * between multiple ports of single IB device.
- *
- * @param dev
- *   Pointer to Ethernet device.
- */
-static void
-mlx5_dev_shared_handler_devx_install(struct rte_eth_dev *dev)
-{
-	struct mlx5_priv *priv = dev->data->dev_private;
-	struct mlx5_ibv_shared *sh = priv->sh;
-
-	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
-		return;
-	pthread_mutex_lock(&sh->intr_mutex);
-	assert(priv->ibv_port);
-	assert(priv->ibv_port <= sh->max_port);
-	assert(dev->data->port_id < RTE_MAX_ETHPORTS);
-	if (sh->port[priv->ibv_port - 1].devx_ih_port_id < RTE_MAX_ETHPORTS) {
-		/* The handler is already installed for this port. */
-		assert(sh->devx_intr_cnt);
-		goto exit;
-	}
-	if (sh->devx_intr_cnt) {
-		sh->devx_intr_cnt++;
-		sh->port[priv->ibv_port - 1].devx_ih_port_id =
-					(uint32_t)dev->data->port_id;
-		goto exit;
-	}
-	if (priv->config.devx) {
-#ifndef HAVE_IBV_DEVX_ASYNC
-		goto exit;
-#else
-		sh->devx_comp = mlx5_glue->devx_create_cmd_comp(sh->ctx);
-		if (sh->devx_comp) {
-			int flags = fcntl(sh->devx_comp->fd, F_GETFL);
-			int ret = fcntl(sh->devx_comp->fd, F_SETFL,
-				    flags | O_NONBLOCK);
-
-			if (ret) {
-				DRV_LOG(INFO, "failed to change file descriptor"
-					" devx async event queue");
-			} else {
-				sh->intr_handle_devx.fd = sh->devx_comp->fd;
-				sh->intr_handle_devx.type = RTE_INTR_HANDLE_EXT;
-				rte_intr_callback_register
-					(&sh->intr_handle_devx,
-					 mlx5_dev_interrupt_handler_devx, sh);
-				sh->devx_intr_cnt++;
-				sh->port[priv->ibv_port - 1].devx_ih_port_id =
-						(uint32_t)dev->data->port_id;
-			}
-		}
-#endif /* HAVE_IBV_DEVX_ASYNC */
-	}
-exit:
-	pthread_mutex_unlock(&sh->intr_mutex);
-}
-
-/**
- * Uninstall interrupt handler.
- *
- * @param dev
- *   Pointer to Ethernet device.
- */
-void
-mlx5_dev_interrupt_handler_uninstall(struct rte_eth_dev *dev)
-{
-	mlx5_dev_shared_handler_uninstall(dev);
-}
-
-/**
- * Install interrupt handler.
- *
- * @param dev
- *   Pointer to Ethernet device.
- */
-void
-mlx5_dev_interrupt_handler_install(struct rte_eth_dev *dev)
-{
-	mlx5_dev_shared_handler_install(dev);
-}
-
-/**
- * Devx uninstall interrupt handler.
- *
- * @param dev
- *   Pointer to Ethernet device.
- */
-void
-mlx5_dev_interrupt_handler_devx_uninstall(struct rte_eth_dev *dev)
-{
-	mlx5_dev_shared_handler_devx_uninstall(dev);
-}
-
-/**
- * Devx install interrupt handler.
- *
- * @param dev
- *   Pointer to Ethernet device.
- */
-void
-mlx5_dev_interrupt_handler_devx_install(struct rte_eth_dev *dev)
-{
-	mlx5_dev_shared_handler_devx_install(dev);
-}
-
 /**
  * DPDK callback to bring the link DOWN.
  *
diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c
index 6fc4190f4..04b06e11d 100644
--- a/drivers/net/mlx5/mlx5_trigger.c
+++ b/drivers/net/mlx5/mlx5_trigger.c
@@ -327,7 +327,18 @@ mlx5_dev_start(struct rte_eth_dev *dev)
 	dev->rx_pkt_burst = mlx5_select_rx_function(dev);
 	/* Enable datapath on secondary process. */
 	mlx5_mp_req_start_rxtx(dev);
-	mlx5_dev_interrupt_handler_install(dev);
+	if (priv->sh->intr_handle.fd >= 0) {
+		priv->sh->port[priv->ibv_port - 1].ih_port_id =
+					(uint32_t)dev->data->port_id;
+	} else {
+		DRV_LOG(INFO, "port %u starts without LSC and RMV interrupts.",
+			dev->data->port_id);
+		dev->data->dev_conf.intr_conf.lsc = 0;
+		dev->data->dev_conf.intr_conf.rmv = 0;
+	}
+	if (priv->sh->intr_handle_devx.fd >= 0)
+		priv->sh->port[priv->ibv_port - 1].devx_ih_port_id =
+					(uint32_t)dev->data->port_id;
 	return 0;
 error:
 	ret = rte_errno; /* Save rte_errno before cleanup. */
@@ -366,7 +377,8 @@ mlx5_dev_stop(struct rte_eth_dev *dev)
 	mlx5_flow_stop(dev, &priv->flows);
 	mlx5_traffic_disable(dev);
 	mlx5_rx_intr_vec_disable(dev);
-	mlx5_dev_interrupt_handler_uninstall(dev);
+	priv->sh->port[priv->ibv_port - 1].ih_port_id = RTE_MAX_ETHPORTS;
+	priv->sh->port[priv->ibv_port - 1].devx_ih_port_id = RTE_MAX_ETHPORTS;
 	mlx5_txq_stop(dev);
 	mlx5_rxq_stop(dev);
 }
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:49.183945780 +0100
+++ 0015-net-mlx5-fix-interrupt-installation-timing.patch	2020-07-24 12:53:48.183004522 +0100
@@ -1,8 +1,10 @@
-From 33860cfab62ed9a3673b1077899c1c527b09e385 Mon Sep 17 00:00:00 2001
+From 5da51166d7493f5a99724d8c424c4a9c2eb5b760 Mon Sep 17 00:00:00 2001
 From: Suanming Mou <suanmingm@mellanox.com>
 Date: Thu, 28 May 2020 17:22:09 +0800
 Subject: [PATCH] net/mlx5: fix interrupt installation timing
 
+[ upstream commit 33860cfab62ed9a3673b1077899c1c527b09e385 ]
+
 Currently, the DevX counter query works asynchronously with Devx
 interrupt handler return the query result. When port closes, the
 interrupt handler will be uninstalled and the Devx comp obj will
@@ -16,7 +18,6 @@
 the counter asynchronous query stop before interrupt uninstall.
 
 Fixes: f15db67df09c ("net/mlx5: accelerate DV flow counter query")
-Cc: stable@dpdk.org
 
 Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
 Acked-by: Matan Azrad <matan@mellanox.com>
@@ -24,14 +25,14 @@
  drivers/net/mlx5/mlx5.c         | 101 ++++++++++---
  drivers/net/mlx5/mlx5.h         |   5 -
  drivers/net/mlx5/mlx5_ethdev.c  | 243 --------------------------------
- drivers/net/mlx5/mlx5_trigger.c |  17 ++-
- 4 files changed, 97 insertions(+), 269 deletions(-)
+ drivers/net/mlx5/mlx5_trigger.c |  16 ++-
+ 4 files changed, 96 insertions(+), 269 deletions(-)
 
 diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
-index 81102631a..469ff7368 100644
+index 1e34f6263..bb718f27f 100644
 --- a/drivers/net/mlx5/mlx5.c
 +++ b/drivers/net/mlx5/mlx5.c
-@@ -10,6 +10,7 @@
+@@ -12,6 +12,7 @@
  #include <stdlib.h>
  #include <errno.h>
  #include <net/if.h>
@@ -39,7 +40,7 @@
  #include <sys/mman.h>
  #include <linux/rtnetlink.h>
  
-@@ -655,6 +656,85 @@ mlx5_restore_doorbell_mapping_env(int value)
+@@ -470,6 +471,85 @@ mlx5_restore_doorbell_mapping_env(int value)
  		setenv(MLX5_SHUT_UP_BF, value ? "1" : "0", 1);
  }
  
@@ -125,7 +126,7 @@
  /**
   * Allocate shared IB device context. If there is multiport device the
   * master and representors will share this context, if there is single
-@@ -749,7 +829,6 @@ mlx5_alloc_shared_ibctx(const struct mlx5_dev_spawn_data *spawn,
+@@ -564,7 +644,6 @@ mlx5_alloc_shared_ibctx(const struct mlx5_dev_spawn_data *spawn,
  		sizeof(sh->ibdev_name));
  	strncpy(sh->ibdev_path, sh->ctx->device->ibdev_path,
  		sizeof(sh->ibdev_path));
@@ -133,19 +134,19 @@
  	/*
  	 * Setting port_id to max unallowed value means
  	 * there is no interrupt subhandler installed for
-@@ -810,6 +889,7 @@ mlx5_alloc_shared_ibctx(const struct mlx5_dev_spawn_data *spawn,
+@@ -624,6 +703,7 @@ mlx5_alloc_shared_ibctx(const struct mlx5_dev_spawn_data *spawn,
  		err = rte_errno;
  		goto error;
  	}
 +	mlx5_dev_shared_handler_install(sh);
- 	mlx5_flow_aging_init(sh);
  	mlx5_flow_counters_mng_init(sh);
- 	mlx5_flow_ipool_create(sh, config);
-@@ -886,20 +966,7 @@ mlx5_free_shared_ibctx(struct mlx5_ibv_shared *sh)
+ 	/* Add device to memory callback list. */
+ 	rte_rwlock_write_lock(&mlx5_shared_data->mem_event_rwlock);
+@@ -697,20 +777,7 @@ mlx5_free_shared_ibctx(struct mlx5_ibv_shared *sh)
+ 	 *  Only primary process handles async device events.
  	 **/
  	mlx5_flow_counters_mng_close(sh);
- 	mlx5_flow_ipool_destroy(sh);
--	MLX5_ASSERT(!sh->intr_cnt);
+-	assert(!sh->intr_cnt);
 -	if (sh->intr_cnt)
 -		mlx5_intr_callback_unregister
 -			(&sh->intr_handle, mlx5_dev_interrupt_handler, sh);
@@ -163,17 +164,17 @@
  	if (sh->pd)
  		claim_zero(mlx5_glue->dealloc_pd(sh->pd));
  	if (sh->tis)
-@@ -1437,9 +1504,6 @@ mlx5_dev_close(struct rte_eth_dev *dev)
+@@ -1248,9 +1315,6 @@ mlx5_dev_close(struct rte_eth_dev *dev)
  	DRV_LOG(DEBUG, "port %u closing device \"%s\"",
  		dev->data->port_id,
  		((priv->sh->ctx != NULL) ? priv->sh->ctx->device->name : ""));
 -	/* In case mlx5_dev_stop() has not been called. */
 -	mlx5_dev_interrupt_handler_uninstall(dev);
 -	mlx5_dev_interrupt_handler_devx_uninstall(dev);
- 	/*
- 	 * If default mreg copy action is removed at the stop stage,
- 	 * the search will return none and nothing will be done anymore.
-@@ -3624,7 +3688,6 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
+ 	mlx5_traffic_disable(dev);
+ 	mlx5_flow_flush(dev, NULL);
+ 	mlx5_flow_meter_flush(dev, NULL);
+@@ -3362,7 +3426,6 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
  		rte_eth_copy_pci_info(list[i].eth_dev, pci_dev);
  		/* Restore non-PCI flags cleared by the above call. */
  		list[i].eth_dev->data->dev_flags |= restore;
@@ -182,12 +183,12 @@
  	}
  	if (i != ns) {
 diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
-index d9f5d816f..2908c8b8d 100644
+index e4af5d40d..e53934d45 100644
 --- a/drivers/net/mlx5/mlx5.h
 +++ b/drivers/net/mlx5/mlx5.h
-@@ -512,10 +512,7 @@ struct mlx5_ibv_shared {
- 	struct mlx5_indexed_pool *ipool[MLX5_IPOOL_MAX];
- 	/* Memory Pool for mlx5 flow resources. */
+@@ -682,10 +682,7 @@ struct mlx5_ibv_shared {
+ 		push_vlan_action_list; /* List of push VLAN actions. */
+ 	struct mlx5_flow_counter_mng cmng; /* Counters management structure. */
  	/* Shared interrupt handler section. */
 -	pthread_mutex_t intr_mutex; /* Interrupt config mutex. */
 -	uint32_t intr_cnt; /* Interrupt handler reference counter. */
@@ -196,7 +197,7 @@
  	struct rte_intr_handle intr_handle_devx; /* DEVX interrupt handler. */
  	struct mlx5dv_devx_cmd_comp *devx_comp; /* DEVX async comp obj. */
  	struct mlx5_devx_obj *tis; /* TIS object. */
-@@ -671,8 +668,6 @@ void mlx5_dev_interrupt_handler(void *arg);
+@@ -838,8 +835,6 @@ void mlx5_dev_interrupt_handler(void *arg);
  void mlx5_dev_interrupt_handler_devx(void *arg);
  void mlx5_dev_interrupt_handler_uninstall(struct rte_eth_dev *dev);
  void mlx5_dev_interrupt_handler_install(struct rte_eth_dev *dev);
@@ -206,10 +207,10 @@
  int mlx5_set_link_up(struct rte_eth_dev *dev);
  int mlx5_is_removed(struct rte_eth_dev *dev);
 diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
-index 47f11b963..b837ce636 100644
+index 3b4c5dbe7..3b1f18b3f 100644
 --- a/drivers/net/mlx5/mlx5_ethdev.c
 +++ b/drivers/net/mlx5/mlx5_ethdev.c
-@@ -1444,249 +1444,6 @@ mlx5_dev_interrupt_handler_devx(void *cb_arg)
+@@ -1475,249 +1475,6 @@ mlx5_dev_interrupt_handler_devx(void *cb_arg)
  #endif /* HAVE_IBV_DEVX_ASYNC */
  }
  
@@ -230,14 +231,14 @@
 -	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
 -		return;
 -	pthread_mutex_lock(&sh->intr_mutex);
--	MLX5_ASSERT(priv->ibv_port);
--	MLX5_ASSERT(priv->ibv_port <= sh->max_port);
--	MLX5_ASSERT(dev->data->port_id < RTE_MAX_ETHPORTS);
+-	assert(priv->ibv_port);
+-	assert(priv->ibv_port <= sh->max_port);
+-	assert(dev->data->port_id < RTE_MAX_ETHPORTS);
 -	if (sh->port[priv->ibv_port - 1].ih_port_id >= RTE_MAX_ETHPORTS)
 -		goto exit;
--	MLX5_ASSERT(sh->port[priv->ibv_port - 1].ih_port_id ==
+-	assert(sh->port[priv->ibv_port - 1].ih_port_id ==
 -					(uint32_t)dev->data->port_id);
--	MLX5_ASSERT(sh->intr_cnt);
+-	assert(sh->intr_cnt);
 -	sh->port[priv->ibv_port - 1].ih_port_id = RTE_MAX_ETHPORTS;
 -	if (!sh->intr_cnt || --sh->intr_cnt)
 -		goto exit;
@@ -266,13 +267,13 @@
 -	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
 -		return;
 -	pthread_mutex_lock(&sh->intr_mutex);
--	MLX5_ASSERT(priv->ibv_port);
--	MLX5_ASSERT(priv->ibv_port <= sh->max_port);
--	MLX5_ASSERT(dev->data->port_id < RTE_MAX_ETHPORTS);
+-	assert(priv->ibv_port);
+-	assert(priv->ibv_port <= sh->max_port);
+-	assert(dev->data->port_id < RTE_MAX_ETHPORTS);
 -	if (sh->port[priv->ibv_port - 1].devx_ih_port_id >= RTE_MAX_ETHPORTS)
 -		goto exit;
--	MLX5_ASSERT(sh->port[priv->ibv_port - 1].devx_ih_port_id ==
--		    (uint32_t)dev->data->port_id);
+-	assert(sh->port[priv->ibv_port - 1].devx_ih_port_id ==
+-					(uint32_t)dev->data->port_id);
 -	sh->port[priv->ibv_port - 1].devx_ih_port_id = RTE_MAX_ETHPORTS;
 -	if (!sh->devx_intr_cnt || --sh->devx_intr_cnt)
 -		goto exit;
@@ -310,12 +311,12 @@
 -	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
 -		return;
 -	pthread_mutex_lock(&sh->intr_mutex);
--	MLX5_ASSERT(priv->ibv_port);
--	MLX5_ASSERT(priv->ibv_port <= sh->max_port);
--	MLX5_ASSERT(dev->data->port_id < RTE_MAX_ETHPORTS);
+-	assert(priv->ibv_port);
+-	assert(priv->ibv_port <= sh->max_port);
+-	assert(dev->data->port_id < RTE_MAX_ETHPORTS);
 -	if (sh->port[priv->ibv_port - 1].ih_port_id < RTE_MAX_ETHPORTS) {
 -		/* The handler is already installed for this port. */
--		MLX5_ASSERT(sh->intr_cnt);
+-		assert(sh->intr_cnt);
 -		goto exit;
 -	}
 -	if (sh->intr_cnt) {
@@ -325,7 +326,7 @@
 -		goto exit;
 -	}
 -	/* No shared handler installed. */
--	MLX5_ASSERT(sh->ctx->async_fd > 0);
+-	assert(sh->ctx->async_fd > 0);
 -	flags = fcntl(sh->ctx->async_fd, F_GETFL);
 -	ret = fcntl(sh->ctx->async_fd, F_SETFL, flags | O_NONBLOCK);
 -	if (ret) {
@@ -364,12 +365,12 @@
 -	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
 -		return;
 -	pthread_mutex_lock(&sh->intr_mutex);
--	MLX5_ASSERT(priv->ibv_port);
--	MLX5_ASSERT(priv->ibv_port <= sh->max_port);
--	MLX5_ASSERT(dev->data->port_id < RTE_MAX_ETHPORTS);
+-	assert(priv->ibv_port);
+-	assert(priv->ibv_port <= sh->max_port);
+-	assert(dev->data->port_id < RTE_MAX_ETHPORTS);
 -	if (sh->port[priv->ibv_port - 1].devx_ih_port_id < RTE_MAX_ETHPORTS) {
 -		/* The handler is already installed for this port. */
--		MLX5_ASSERT(sh->devx_intr_cnt);
+-		assert(sh->devx_intr_cnt);
 -		goto exit;
 -	}
 -	if (sh->devx_intr_cnt) {
@@ -460,18 +461,10 @@
   * DPDK callback to bring the link DOWN.
   *
 diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c
-index 8106598ff..f12319376 100644
+index 6fc4190f4..04b06e11d 100644
 --- a/drivers/net/mlx5/mlx5_trigger.c
 +++ b/drivers/net/mlx5/mlx5_trigger.c
-@@ -269,6 +269,7 @@ error:
- int
- mlx5_dev_start(struct rte_eth_dev *dev)
- {
-+	struct mlx5_priv *priv = dev->data->dev_private;
- 	int ret;
- 	int fine_inline;
- 
-@@ -340,7 +341,18 @@ mlx5_dev_start(struct rte_eth_dev *dev)
+@@ -327,7 +327,18 @@ mlx5_dev_start(struct rte_eth_dev *dev)
  	dev->rx_pkt_burst = mlx5_select_rx_function(dev);
  	/* Enable datapath on secondary process. */
  	mlx5_mp_req_start_rxtx(dev);
@@ -491,9 +484,9 @@
  	return 0;
  error:
  	ret = rte_errno; /* Save rte_errno before cleanup. */
-@@ -382,7 +394,8 @@ mlx5_dev_stop(struct rte_eth_dev *dev)
- 	/* All RX queue flags will be cleared in the flush interface. */
- 	mlx5_flow_list_flush(dev, &priv->flows, true);
+@@ -366,7 +377,8 @@ mlx5_dev_stop(struct rte_eth_dev *dev)
+ 	mlx5_flow_stop(dev, &priv->flows);
+ 	mlx5_traffic_disable(dev);
  	mlx5_rx_intr_vec_disable(dev);
 -	mlx5_dev_interrupt_handler_uninstall(dev);
 +	priv->sh->port[priv->ibv_port - 1].ih_port_id = RTE_MAX_ETHPORTS;

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

* [dpdk-stable] patch 'net/failsafe: fix RSS RETA size info' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (13 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/mlx5: fix interrupt installation timing' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/mlx5: fix vectorized Rx burst termination' " luca.boccassi
                   ` (176 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Ian Dolzhansky
  Cc: Andrew Rybchenko, Gaetan Rivet, Stephen Hemminger, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From d307ec9062a72b247154d657b041323b734264b7 Mon Sep 17 00:00:00 2001
From: Ian Dolzhansky <ian.dolzhansky@oktetlabs.ru>
Date: Wed, 27 May 2020 15:34:33 +0100
Subject: [PATCH] net/failsafe: fix RSS RETA size info

[ upstream commit 6e8bdf7266db71f43f47f40704ab1122f60c3f17 ]

Failsafe driver has been indicating zero for RSS redirection table size
after device info reporting had been reworked. Report proper value.

Fixes: 4586be3743d4 ("net/failsafe: fix reported device info")

Signed-off-by: Ian Dolzhansky <ian.dolzhansky@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Gaetan Rivet <grive@u256.net>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/failsafe/failsafe_ops.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c
index e1d08e46c..96f7e456f 100644
--- a/drivers/net/failsafe/failsafe_ops.c
+++ b/drivers/net/failsafe/failsafe_ops.c
@@ -1068,6 +1068,13 @@ fs_dev_merge_info(struct rte_eth_dev_info *info,
 	info->rx_queue_offload_capa &= sinfo->rx_queue_offload_capa;
 	info->tx_queue_offload_capa &= sinfo->tx_queue_offload_capa;
 	info->flow_type_rss_offloads &= sinfo->flow_type_rss_offloads;
+
+	/*
+	 * RETA size is a GCD of RETA sizes indicated by sub-devices.
+	 * Each of these sizes is a power of 2, so use the lower one.
+	 */
+	info->reta_size = RTE_MIN(info->reta_size, sinfo->reta_size);
+
 	info->hash_key_size = RTE_MIN(info->hash_key_size,
 				      sinfo->hash_key_size);
 }
@@ -1119,6 +1126,7 @@ fs_dev_infos_get(struct rte_eth_dev *dev,
 	infos->max_hash_mac_addrs = UINT32_MAX;
 	infos->max_vfs = UINT16_MAX;
 	infos->max_vmdq_pools = UINT16_MAX;
+	infos->reta_size = UINT16_MAX;
 	infos->hash_key_size = UINT8_MAX;
 
 	/*
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:49.225027465 +0100
+++ 0016-net-failsafe-fix-RSS-RETA-size-info.patch	2020-07-24 12:53:48.183004522 +0100
@@ -1,13 +1,14 @@
-From 6e8bdf7266db71f43f47f40704ab1122f60c3f17 Mon Sep 17 00:00:00 2001
+From d307ec9062a72b247154d657b041323b734264b7 Mon Sep 17 00:00:00 2001
 From: Ian Dolzhansky <ian.dolzhansky@oktetlabs.ru>
 Date: Wed, 27 May 2020 15:34:33 +0100
 Subject: [PATCH] net/failsafe: fix RSS RETA size info
 
+[ upstream commit 6e8bdf7266db71f43f47f40704ab1122f60c3f17 ]
+
 Failsafe driver has been indicating zero for RSS redirection table size
 after device info reporting had been reworked. Report proper value.
 
 Fixes: 4586be3743d4 ("net/failsafe: fix reported device info")
-Cc: stable@dpdk.org
 
 Signed-off-by: Ian Dolzhansky <ian.dolzhansky@oktetlabs.ru>
 Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>

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

* [dpdk-stable] patch 'net/mlx5: fix vectorized Rx burst termination' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (14 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/failsafe: fix RSS RETA size info' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/hns3: remove unsupported VLAN capabilities' " luca.boccassi
                   ` (175 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Alexander Kozyrev; +Cc: Viacheslav Ovsiienko, Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From e4e924134232556d751dd9aa192c1123c9544a8a Mon Sep 17 00:00:00 2001
From: Alexander Kozyrev <akozyrev@mellanox.com>
Date: Tue, 2 Jun 2020 03:50:41 +0000
Subject: [PATCH] net/mlx5: fix vectorized Rx burst termination

[ upstream commit c9cc554ba423641d3515671269c5648dab3bb9ad ]

Maximum burst size of Vectorized Rx burst routine is set to
MLX5_VPMD_RX_MAX_BURST(64). This limits the performance of any
application that would like to gather more than 64 packets from
the single Rx burst for batch processing (i.e. VPP).

The situation gets worse with a mix of zipped and unzipped CQEs.
They are processed separately and the Rx burst function returns
small number of packets every call.

Repeat the cycle of gathering packets from the vectorized Rx routine
until a requested number of packets are collected or there are no
more CQEs left to process.

Fixes: 6cb559d67b83 ("net/mlx5: add vectorized Rx/Tx burst for x86")

Signed-off-by: Alexander Kozyrev <akozyrev@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
 drivers/net/mlx5/mlx5_rxtx_vec.c         | 17 ++++++++++++-----
 drivers/net/mlx5/mlx5_rxtx_vec_altivec.h | 13 ++++++++++---
 drivers/net/mlx5/mlx5_rxtx_vec_neon.h    | 13 ++++++++++---
 drivers/net/mlx5/mlx5_rxtx_vec_sse.h     | 13 ++++++++++---
 4 files changed, 42 insertions(+), 14 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxtx_vec.c b/drivers/net/mlx5/mlx5_rxtx_vec.c
index d85f90874..dbb4cfaeb 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec.c
+++ b/drivers/net/mlx5/mlx5_rxtx_vec.c
@@ -103,13 +103,20 @@ uint16_t
 mlx5_rx_burst_vec(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
 {
 	struct mlx5_rxq_data *rxq = dpdk_rxq;
-	uint16_t nb_rx;
+	uint16_t nb_rx = 0;
+	uint16_t tn = 0;
 	uint64_t err = 0;
+	bool no_cq = false;
 
-	nb_rx = rxq_burst_v(rxq, pkts, pkts_n, &err);
-	if (unlikely(err | rxq->err_state))
-		nb_rx = rxq_handle_pending_error(rxq, pkts, nb_rx);
-	return nb_rx;
+	do {
+		nb_rx = rxq_burst_v(rxq, pkts + tn, pkts_n - tn, &err, &no_cq);
+		if (unlikely(err | rxq->err_state))
+			nb_rx = rxq_handle_pending_error(rxq, pkts + tn, nb_rx);
+		tn += nb_rx;
+		if (unlikely(no_cq))
+			break;
+	} while (tn != pkts_n);
+	return tn;
 }
 
 /**
diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h b/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h
index feb17fe1c..c167672f5 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h
+++ b/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h
@@ -564,13 +564,15 @@ rxq_cq_to_ptype_oflags_v(struct mlx5_rxq_data *rxq,
  * @param[out] err
  *   Pointer to a flag. Set non-zero value if pkts array has at least one error
  *   packet to handle.
+ * @param[out] no_cq
+ *  Pointer to a boolean. Set true if no new CQE seen.
  *
  * @return
  *   Number of packets received including errors (<= pkts_n).
  */
 static inline uint16_t
 rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
-	    uint64_t *err)
+	    uint64_t *err, bool *no_cq)
 {
 	const uint16_t q_n = 1 << rxq->cqe_n;
 	const uint16_t q_mask = q_n - 1;
@@ -663,8 +665,10 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
 	/* Not to cross queue end. */
 	pkts_n = RTE_MIN(pkts_n, q_n - elts_idx);
 	pkts_n = RTE_MIN(pkts_n, q_n - cq_idx);
-	if (!pkts_n)
+	if (!pkts_n) {
+		*no_cq = !rcvd_pkt;
 		return rcvd_pkt;
+	}
 	/* At this point, there shouldn't be any remaining packets. */
 	assert(rxq->decompressed == 0);
 
@@ -1079,8 +1083,10 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
 			break;
 	}
 	/* If no new CQE seen, return without updating cq_db. */
-	if (unlikely(!nocmp_n && comp_idx == MLX5_VPMD_DESCS_PER_LOOP))
+	if (unlikely(!nocmp_n && comp_idx == MLX5_VPMD_DESCS_PER_LOOP)) {
+		*no_cq = true;
 		return rcvd_pkt;
+	}
 	/* Update the consumer indexes for non-compressed CQEs. */
 	assert(nocmp_n <= pkts_n);
 	rxq->cq_ci += nocmp_n;
@@ -1108,6 +1114,7 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
 	}
 	rte_compiler_barrier();
 	*rxq->cq_db = rte_cpu_to_be_32(rxq->cq_ci);
+	*no_cq = !rcvd_pkt;
 	return rcvd_pkt;
 }
 
diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
index f92ece429..b2cf857fd 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
+++ b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
@@ -377,13 +377,15 @@ rxq_cq_to_ptype_oflags_v(struct mlx5_rxq_data *rxq,
  * @param[out] err
  *   Pointer to a flag. Set non-zero value if pkts array has at least one error
  *   packet to handle.
+ * @param[out] no_cq
+ *   Pointer to a boolean. Set true if no new CQE seen.
  *
  * @return
  *   Number of packets received including errors (<= pkts_n).
  */
 static inline uint16_t
 rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
-	    uint64_t *err)
+	    uint64_t *err, bool *no_cq)
 {
 	const uint16_t q_n = 1 << rxq->cqe_n;
 	const uint16_t q_mask = q_n - 1;
@@ -484,8 +486,10 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
 	/* Not to cross queue end. */
 	pkts_n = RTE_MIN(pkts_n, q_n - elts_idx);
 	pkts_n = RTE_MIN(pkts_n, q_n - cq_idx);
-	if (!pkts_n)
+	if (!pkts_n) {
+		*no_cq = !rcvd_pkt;
 		return rcvd_pkt;
+	}
 	/* At this point, there shouldn't be any remained packets. */
 	assert(rxq->decompressed == 0);
 	/*
@@ -744,8 +748,10 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
 			break;
 	}
 	/* If no new CQE seen, return without updating cq_db. */
-	if (unlikely(!nocmp_n && comp_idx == MLX5_VPMD_DESCS_PER_LOOP))
+	if (unlikely(!nocmp_n && comp_idx == MLX5_VPMD_DESCS_PER_LOOP)) {
+		*no_cq = true;
 		return rcvd_pkt;
+	}
 	/* Update the consumer indexes for non-compressed CQEs. */
 	assert(nocmp_n <= pkts_n);
 	rxq->cq_ci += nocmp_n;
@@ -773,6 +779,7 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
 	}
 	rte_cio_wmb();
 	*rxq->cq_db = rte_cpu_to_be_32(rxq->cq_ci);
+	*no_cq = !rcvd_pkt;
 	return rcvd_pkt;
 }
 
diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h b/drivers/net/mlx5/mlx5_rxtx_vec_sse.h
index bb59163a2..9935299d5 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h
+++ b/drivers/net/mlx5/mlx5_rxtx_vec_sse.h
@@ -383,13 +383,15 @@ rxq_cq_to_ptype_oflags_v(struct mlx5_rxq_data *rxq, __m128i cqes[4],
  * @param[out] err
  *   Pointer to a flag. Set non-zero value if pkts array has at least one error
  *   packet to handle.
+ * @param[out] no_cq
+ *   Pointer to a boolean. Set true if no new CQE seen.
  *
  * @return
  *   Number of packets received including errors (<= pkts_n).
  */
 static inline uint16_t
 rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
-	    uint64_t *err)
+	    uint64_t *err, bool *no_cq)
 {
 	const uint16_t q_n = 1 << rxq->cqe_n;
 	const uint16_t q_mask = q_n - 1;
@@ -471,8 +473,10 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
 	/* Not to cross queue end. */
 	pkts_n = RTE_MIN(pkts_n, q_n - elts_idx);
 	pkts_n = RTE_MIN(pkts_n, q_n - cq_idx);
-	if (!pkts_n)
+	if (!pkts_n) {
+		*no_cq = !rcvd_pkt;
 		return rcvd_pkt;
+	}
 	/* At this point, there shouldn't be any remained packets. */
 	assert(rxq->decompressed == 0);
 	/*
@@ -694,8 +698,10 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
 			break;
 	}
 	/* If no new CQE seen, return without updating cq_db. */
-	if (unlikely(!nocmp_n && comp_idx == MLX5_VPMD_DESCS_PER_LOOP))
+	if (unlikely(!nocmp_n && comp_idx == MLX5_VPMD_DESCS_PER_LOOP)) {
+		*no_cq = true;
 		return rcvd_pkt;
+	}
 	/* Update the consumer indexes for non-compressed CQEs. */
 	assert(nocmp_n <= pkts_n);
 	rxq->cq_ci += nocmp_n;
@@ -723,6 +729,7 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
 	}
 	rte_compiler_barrier();
 	*rxq->cq_db = rte_cpu_to_be_32(rxq->cq_ci);
+	*no_cq = !rcvd_pkt;
 	return rcvd_pkt;
 }
 
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:49.263432540 +0100
+++ 0017-net-mlx5-fix-vectorized-Rx-burst-termination.patch	2020-07-24 12:53:48.187004597 +0100
@@ -1,8 +1,10 @@
-From c9cc554ba423641d3515671269c5648dab3bb9ad Mon Sep 17 00:00:00 2001
+From e4e924134232556d751dd9aa192c1123c9544a8a Mon Sep 17 00:00:00 2001
 From: Alexander Kozyrev <akozyrev@mellanox.com>
 Date: Tue, 2 Jun 2020 03:50:41 +0000
 Subject: [PATCH] net/mlx5: fix vectorized Rx burst termination
 
+[ upstream commit c9cc554ba423641d3515671269c5648dab3bb9ad ]
+
 Maximum burst size of Vectorized Rx burst routine is set to
 MLX5_VPMD_RX_MAX_BURST(64). This limits the performance of any
 application that would like to gather more than 64 packets from
@@ -17,7 +19,6 @@
 more CQEs left to process.
 
 Fixes: 6cb559d67b83 ("net/mlx5: add vectorized Rx/Tx burst for x86")
-Cc: stable@dpdk.org
 
 Signed-off-by: Alexander Kozyrev <akozyrev@mellanox.com>
 Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
@@ -30,7 +31,7 @@
  4 files changed, 42 insertions(+), 14 deletions(-)
 
 diff --git a/drivers/net/mlx5/mlx5_rxtx_vec.c b/drivers/net/mlx5/mlx5_rxtx_vec.c
-index 1518bdd5b..b38bd203c 100644
+index d85f90874..dbb4cfaeb 100644
 --- a/drivers/net/mlx5/mlx5_rxtx_vec.c
 +++ b/drivers/net/mlx5/mlx5_rxtx_vec.c
 @@ -103,13 +103,20 @@ uint16_t
@@ -60,7 +61,7 @@
  
  /**
 diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h b/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h
-index 26715ef45..b55138ac7 100644
+index feb17fe1c..c167672f5 100644
 --- a/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h
 +++ b/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h
 @@ -564,13 +564,15 @@ rxq_cq_to_ptype_oflags_v(struct mlx5_rxq_data *rxq,
@@ -90,7 +91,7 @@
  		return rcvd_pkt;
 +	}
  	/* At this point, there shouldn't be any remaining packets. */
- 	MLX5_ASSERT(rxq->decompressed == 0);
+ 	assert(rxq->decompressed == 0);
  
 @@ -1079,8 +1083,10 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
  			break;
@@ -102,7 +103,7 @@
  		return rcvd_pkt;
 +	}
  	/* Update the consumer indexes for non-compressed CQEs. */
- 	MLX5_ASSERT(nocmp_n <= pkts_n);
+ 	assert(nocmp_n <= pkts_n);
  	rxq->cq_ci += nocmp_n;
 @@ -1108,6 +1114,7 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
  	}
@@ -113,10 +114,10 @@
  }
  
 diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
-index ecafbf800..3007c0359 100644
+index f92ece429..b2cf857fd 100644
 --- a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
 +++ b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
-@@ -378,13 +378,15 @@ rxq_cq_to_ptype_oflags_v(struct mlx5_rxq_data *rxq,
+@@ -377,13 +377,15 @@ rxq_cq_to_ptype_oflags_v(struct mlx5_rxq_data *rxq,
   * @param[out] err
   *   Pointer to a flag. Set non-zero value if pkts array has at least one error
   *   packet to handle.
@@ -133,7 +134,7 @@
  {
  	const uint16_t q_n = 1 << rxq->cqe_n;
  	const uint16_t q_mask = q_n - 1;
-@@ -485,8 +487,10 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
+@@ -484,8 +486,10 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
  	/* Not to cross queue end. */
  	pkts_n = RTE_MIN(pkts_n, q_n - elts_idx);
  	pkts_n = RTE_MIN(pkts_n, q_n - cq_idx);
@@ -143,9 +144,9 @@
  		return rcvd_pkt;
 +	}
  	/* At this point, there shouldn't be any remained packets. */
- 	MLX5_ASSERT(rxq->decompressed == 0);
+ 	assert(rxq->decompressed == 0);
  	/*
-@@ -745,8 +749,10 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
+@@ -744,8 +748,10 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
  			break;
  	}
  	/* If no new CQE seen, return without updating cq_db. */
@@ -155,9 +156,9 @@
  		return rcvd_pkt;
 +	}
  	/* Update the consumer indexes for non-compressed CQEs. */
- 	MLX5_ASSERT(nocmp_n <= pkts_n);
+ 	assert(nocmp_n <= pkts_n);
  	rxq->cq_ci += nocmp_n;
-@@ -774,6 +780,7 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
+@@ -773,6 +779,7 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
  	}
  	rte_cio_wmb();
  	*rxq->cq_db = rte_cpu_to_be_32(rxq->cq_ci);
@@ -166,10 +167,10 @@
  }
  
 diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h b/drivers/net/mlx5/mlx5_rxtx_vec_sse.h
-index 6847ae782..da5960ad8 100644
+index bb59163a2..9935299d5 100644
 --- a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h
 +++ b/drivers/net/mlx5/mlx5_rxtx_vec_sse.h
-@@ -385,13 +385,15 @@ rxq_cq_to_ptype_oflags_v(struct mlx5_rxq_data *rxq, __m128i cqes[4],
+@@ -383,13 +383,15 @@ rxq_cq_to_ptype_oflags_v(struct mlx5_rxq_data *rxq, __m128i cqes[4],
   * @param[out] err
   *   Pointer to a flag. Set non-zero value if pkts array has at least one error
   *   packet to handle.
@@ -186,7 +187,7 @@
  {
  	const uint16_t q_n = 1 << rxq->cqe_n;
  	const uint16_t q_mask = q_n - 1;
-@@ -473,8 +475,10 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
+@@ -471,8 +473,10 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
  	/* Not to cross queue end. */
  	pkts_n = RTE_MIN(pkts_n, q_n - elts_idx);
  	pkts_n = RTE_MIN(pkts_n, q_n - cq_idx);
@@ -196,9 +197,9 @@
  		return rcvd_pkt;
 +	}
  	/* At this point, there shouldn't be any remained packets. */
- 	MLX5_ASSERT(rxq->decompressed == 0);
+ 	assert(rxq->decompressed == 0);
  	/*
-@@ -696,8 +700,10 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
+@@ -694,8 +698,10 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
  			break;
  	}
  	/* If no new CQE seen, return without updating cq_db. */
@@ -208,9 +209,9 @@
  		return rcvd_pkt;
 +	}
  	/* Update the consumer indexes for non-compressed CQEs. */
- 	MLX5_ASSERT(nocmp_n <= pkts_n);
+ 	assert(nocmp_n <= pkts_n);
  	rxq->cq_ci += nocmp_n;
-@@ -725,6 +731,7 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
+@@ -723,6 +729,7 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
  	}
  	rte_compiler_barrier();
  	*rxq->cq_db = rte_cpu_to_be_32(rxq->cq_ci);

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

* [dpdk-stable] patch 'net/hns3: remove unsupported VLAN capabilities' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (15 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/mlx5: fix vectorized Rx burst termination' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/hns3: fix VLAN strip configuration when setting PVID' " luca.boccassi
                   ` (174 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Chengchang Tang; +Cc: Wei Hu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 5fd7ff3abfeec493c1b121953cab71205d2aa45c Mon Sep 17 00:00:00 2001
From: Chengchang Tang <tangchengchang@huawei.com>
Date: Wed, 3 Jun 2020 17:31:58 +0800
Subject: [PATCH] net/hns3: remove unsupported VLAN capabilities

[ upstream commit 85c420f5941d0a0e463493e7659fe6ed96afc71b ]

This patch removes unsupported vlan capabilities to avoid misleading
users.

Fixes: a5475d61fa34 ("net/hns3: support VF")
Fixes: 1f5ca0b460cd ("net/hns3: support some device operations")

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
---
 drivers/net/hns3/hns3_ethdev.c    | 2 --
 drivers/net/hns3/hns3_ethdev_vf.c | 1 -
 2 files changed, 3 deletions(-)

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index 85d432d36..f2b0fd704 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -2379,9 +2379,7 @@ hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
 				 DEV_RX_OFFLOAD_KEEP_CRC |
 				 DEV_RX_OFFLOAD_SCATTER |
 				 DEV_RX_OFFLOAD_VLAN_STRIP |
-				 DEV_RX_OFFLOAD_QINQ_STRIP |
 				 DEV_RX_OFFLOAD_VLAN_FILTER |
-				 DEV_RX_OFFLOAD_VLAN_EXTEND |
 				 DEV_RX_OFFLOAD_JUMBO_FRAME |
 				 DEV_RX_OFFLOAD_RSS_HASH);
 	info->tx_queue_offload_capa = DEV_TX_OFFLOAD_MBUF_FAST_FREE;
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
index 56a1be936..22cd9eb33 100644
--- a/drivers/net/hns3/hns3_ethdev_vf.c
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
@@ -665,7 +665,6 @@ hns3vf_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
 				 DEV_RX_OFFLOAD_KEEP_CRC |
 				 DEV_RX_OFFLOAD_SCATTER |
 				 DEV_RX_OFFLOAD_VLAN_STRIP |
-				 DEV_RX_OFFLOAD_QINQ_STRIP |
 				 DEV_RX_OFFLOAD_VLAN_FILTER |
 				 DEV_RX_OFFLOAD_JUMBO_FRAME |
 				 DEV_RX_OFFLOAD_RSS_HASH);
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:49.304406636 +0100
+++ 0018-net-hns3-remove-unsupported-VLAN-capabilities.patch	2020-07-24 12:53:48.191004671 +0100
@@ -1,14 +1,15 @@
-From 85c420f5941d0a0e463493e7659fe6ed96afc71b Mon Sep 17 00:00:00 2001
+From 5fd7ff3abfeec493c1b121953cab71205d2aa45c Mon Sep 17 00:00:00 2001
 From: Chengchang Tang <tangchengchang@huawei.com>
 Date: Wed, 3 Jun 2020 17:31:58 +0800
 Subject: [PATCH] net/hns3: remove unsupported VLAN capabilities
 
+[ upstream commit 85c420f5941d0a0e463493e7659fe6ed96afc71b ]
+
 This patch removes unsupported vlan capabilities to avoid misleading
 users.
 
 Fixes: a5475d61fa34 ("net/hns3: support VF")
 Fixes: 1f5ca0b460cd ("net/hns3: support some device operations")
-Cc: stable@dpdk.org
 
 Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
 Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
@@ -18,10 +19,10 @@
  2 files changed, 3 deletions(-)
 
 diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
-index 33d7c5c7b..4030bd32a 100644
+index 85d432d36..f2b0fd704 100644
 --- a/drivers/net/hns3/hns3_ethdev.c
 +++ b/drivers/net/hns3/hns3_ethdev.c
-@@ -2461,9 +2461,7 @@ hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
+@@ -2379,9 +2379,7 @@ hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
  				 DEV_RX_OFFLOAD_KEEP_CRC |
  				 DEV_RX_OFFLOAD_SCATTER |
  				 DEV_RX_OFFLOAD_VLAN_STRIP |
@@ -32,10 +33,10 @@
  				 DEV_RX_OFFLOAD_RSS_HASH);
  	info->tx_queue_offload_capa = DEV_TX_OFFLOAD_MBUF_FAST_FREE;
 diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
-index 16d601270..0fdee4d67 100644
+index 56a1be936..22cd9eb33 100644
 --- a/drivers/net/hns3/hns3_ethdev_vf.c
 +++ b/drivers/net/hns3/hns3_ethdev_vf.c
-@@ -908,7 +908,6 @@ hns3vf_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
+@@ -665,7 +665,6 @@ hns3vf_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
  				 DEV_RX_OFFLOAD_KEEP_CRC |
  				 DEV_RX_OFFLOAD_SCATTER |
  				 DEV_RX_OFFLOAD_VLAN_STRIP |

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

* [dpdk-stable] patch 'net/hns3: fix VLAN strip configuration when setting PVID' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (16 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/hns3: remove unsupported VLAN capabilities' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/hns3: fix VLAN tags reported in Rx' " luca.boccassi
                   ` (173 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Chengchang Tang; +Cc: Wei Hu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From c9e3e5fd3661202efe9859ad75498c55d35868e4 Mon Sep 17 00:00:00 2001
From: Chengchang Tang <tangchengchang@huawei.com>
Date: Wed, 3 Jun 2020 17:31:59 +0800
Subject: [PATCH] net/hns3: fix VLAN strip configuration when setting PVID

[ upstream commit 4c623ca40013c58d73aec67717583e3ee1cb45e3 ]

Currently, based on hns3 PF device, hardware will strip 2 vlan tags when
ULP calls rte_eth_dev_set_vlan_pvid API function to set a PVID whether
vlan strip related offload is turned on by calling rte_eth_dev_configure
or rte_eth_dev_set_vlan_offload API function.

When receiving a QinQ packet with the pvid tag, if ULP does not
configure the vlan strip by the method mentioned above, a layer of vlan
tag will be lost to ULP, which is not the expected result.

It is supposed to configure the vlan strip according to the upper level
process's configuration.

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

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
---
 drivers/net/hns3/hns3_ethdev.c | 29 +++++++++++++++++------------
 1 file changed, 17 insertions(+), 12 deletions(-)

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index f2b0fd704..e7eeb7875 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -823,25 +823,28 @@ hns3_update_vlan_filter_entries(struct hns3_adapter *hns,
 }
 
 static int
-hns3_en_rx_strip_all(struct hns3_adapter *hns, int on)
+hns3_en_pvid_strip(struct hns3_adapter *hns, int on)
 {
+	struct hns3_rx_vtag_cfg *old_cfg = &hns->pf.vtag_config.rx_vcfg;
 	struct hns3_rx_vtag_cfg rx_vlan_cfg;
-	struct hns3_hw *hw = &hns->hw;
 	bool rx_strip_en;
 	int ret;
 
-	rx_strip_en = on ? true : false;
-	rx_vlan_cfg.strip_tag1_en = rx_strip_en;
-	rx_vlan_cfg.strip_tag2_en = rx_strip_en;
+	rx_strip_en = old_cfg->rx_vlan_offload_en ? true : false;
+	if (on) {
+		rx_vlan_cfg.strip_tag1_en = rx_strip_en;
+		rx_vlan_cfg.strip_tag2_en = true;
+	} else {
+		rx_vlan_cfg.strip_tag1_en = false;
+		rx_vlan_cfg.strip_tag2_en = rx_strip_en;
+	}
 	rx_vlan_cfg.vlan1_vlan_prionly = false;
 	rx_vlan_cfg.vlan2_vlan_prionly = false;
-	rx_vlan_cfg.rx_vlan_offload_en = rx_strip_en;
+	rx_vlan_cfg.rx_vlan_offload_en = old_cfg->rx_vlan_offload_en;
 
 	ret = hns3_set_vlan_rx_offload_cfg(hns, &rx_vlan_cfg);
-	if (ret) {
-		hns3_err(hw, "enable strip rx failed, ret =%d", ret);
+	if (ret)
 		return ret;
-	}
 
 	hns3_update_rx_offload_cfg(hns, &rx_vlan_cfg);
 	return ret;
@@ -868,13 +871,15 @@ hns3_vlan_pvid_configure(struct hns3_adapter *hns, uint16_t pvid, int on)
 				    HNS3_PORT_BASE_VLAN_DISABLE;
 	ret = hns3_vlan_txvlan_cfg(hns, port_base_vlan_state, pvid);
 	if (ret) {
-		hns3_err(hw, "Failed to config tx vlan, ret =%d", ret);
+		hns3_err(hw, "failed to config tx vlan for pvid, ret = %d",
+			 ret);
 		return ret;
 	}
 
-	ret = hns3_en_rx_strip_all(hns, on);
+	ret = hns3_en_pvid_strip(hns, on);
 	if (ret) {
-		hns3_err(hw, "Failed to config rx vlan strip, ret =%d", ret);
+		hns3_err(hw, "failed to config rx vlan strip for pvid, "
+			 "ret = %d", ret);
 		return ret;
 	}
 
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:49.352013441 +0100
+++ 0019-net-hns3-fix-VLAN-strip-configuration-when-setting-P.patch	2020-07-24 12:53:48.199004820 +0100
@@ -1,8 +1,10 @@
-From 4c623ca40013c58d73aec67717583e3ee1cb45e3 Mon Sep 17 00:00:00 2001
+From c9e3e5fd3661202efe9859ad75498c55d35868e4 Mon Sep 17 00:00:00 2001
 From: Chengchang Tang <tangchengchang@huawei.com>
 Date: Wed, 3 Jun 2020 17:31:59 +0800
 Subject: [PATCH] net/hns3: fix VLAN strip configuration when setting PVID
 
+[ upstream commit 4c623ca40013c58d73aec67717583e3ee1cb45e3 ]
+
 Currently, based on hns3 PF device, hardware will strip 2 vlan tags when
 ULP calls rte_eth_dev_set_vlan_pvid API function to set a PVID whether
 vlan strip related offload is turned on by calling rte_eth_dev_configure
@@ -16,7 +18,6 @@
 process's configuration.
 
 Fixes: 411d23b9eafb ("net/hns3: support VLAN")
-Cc: stable@dpdk.org
 
 Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
 Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
@@ -25,10 +26,10 @@
  1 file changed, 17 insertions(+), 12 deletions(-)
 
 diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
-index 4030bd32a..244a3b827 100644
+index f2b0fd704..e7eeb7875 100644
 --- a/drivers/net/hns3/hns3_ethdev.c
 +++ b/drivers/net/hns3/hns3_ethdev.c
-@@ -832,25 +832,28 @@ hns3_update_vlan_filter_entries(struct hns3_adapter *hns,
+@@ -823,25 +823,28 @@ hns3_update_vlan_filter_entries(struct hns3_adapter *hns,
  }
  
  static int
@@ -66,7 +67,7 @@
  
  	hns3_update_rx_offload_cfg(hns, &rx_vlan_cfg);
  	return ret;
-@@ -877,13 +880,15 @@ hns3_vlan_pvid_configure(struct hns3_adapter *hns, uint16_t pvid, int on)
+@@ -868,13 +871,15 @@ hns3_vlan_pvid_configure(struct hns3_adapter *hns, uint16_t pvid, int on)
  				    HNS3_PORT_BASE_VLAN_DISABLE;
  	ret = hns3_vlan_txvlan_cfg(hns, port_base_vlan_state, pvid);
  	if (ret) {

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

* [dpdk-stable] patch 'net/hns3: fix VLAN tags reported in Rx' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (17 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/hns3: fix VLAN strip configuration when setting PVID' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/i40e: enable NEON Rx/Tx in meson' " luca.boccassi
                   ` (172 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Wei Hu (Xavier); +Cc: Chengchang Tang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 7e6fa0689b7ec6566ab96123deb340c409e0d097 Mon Sep 17 00:00:00 2001
From: "Wei Hu (Xavier)" <xavier.huwei@huawei.com>
Date: Wed, 3 Jun 2020 17:32:00 +0800
Subject: [PATCH] net/hns3: fix VLAN tags reported in Rx

[ upstream commit e28bc1476558467b2898abab306b2317bada3d78 ]

Currently, based on hns3 network engine, driver always reports the
incoming packet's VLAN tags to the structure rte_mbuf those are the
output parameter pointers in '.rx_pkt_burst' ops implementation
function, and never reports PKT_RX_VLAN_STRIPPED flag to the structure
rte_mbuf even if Upper Level Process configured hardware strip by
calling rte_eth_dev_configure or rte_eth_dev_set_vlan_offload API
function. It makes the ULP unable to know the stripping of VLAN.

It is supposed to present the stripped flags to the mbuf ol_flags, and
report the right VLAN tag.

And as hardware constraints, the stripped VLAN tag will always in the Rx
descriptor. Even if setting a PVID based on the function, the PVID will
be reported to the Rx descriptor. So the driver need to determine which
VLAN tag should be reported to output the structure rte_mbuf in
'.rx_pkt_burst' ops implementation function named hns3_recv_pkts.

Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations")
Fixes: 411d23b9eafb ("net/hns3: support VLAN")

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
---
 drivers/net/hns3/hns3_ethdev.c | 48 +++++++++++----------------
 drivers/net/hns3/hns3_ethdev.h | 15 +++++----
 drivers/net/hns3/hns3_rxtx.c   | 60 +++++++++++++++++++++++++++++++---
 3 files changed, 83 insertions(+), 40 deletions(-)

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index e7eeb7875..f1066c079 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -35,8 +35,6 @@
 #define HNS3_DEFAULT_PORT_CONF_QUEUES_NUM	1
 
 #define HNS3_SERVICE_INTERVAL		1000000 /* us */
-#define HNS3_PORT_BASE_VLAN_DISABLE	0
-#define HNS3_PORT_BASE_VLAN_ENABLE	1
 #define HNS3_INVLID_PVID		0xFFFF
 
 #define HNS3_FILTER_TYPE_VF		0
@@ -303,15 +301,14 @@ static int
 hns3_restore_vlan_table(struct hns3_adapter *hns)
 {
 	struct hns3_user_vlan_table *vlan_entry;
+	struct hns3_hw *hw = &hns->hw;
 	struct hns3_pf *pf = &hns->pf;
 	uint16_t vlan_id;
 	int ret = 0;
 
-	if (pf->port_base_vlan_cfg.state == HNS3_PORT_BASE_VLAN_ENABLE) {
-		ret = hns3_vlan_pvid_configure(hns, pf->port_base_vlan_cfg.pvid,
-					       1);
-		return ret;
-	}
+	if (hw->port_base_vlan_cfg.state == HNS3_PORT_BASE_VLAN_ENABLE)
+		return hns3_vlan_pvid_configure(hns,
+						hw->port_base_vlan_cfg.pvid, 1);
 
 	LIST_FOREACH(vlan_entry, &pf->vlan_list, next) {
 		if (vlan_entry->hd_tbl_status) {
@@ -328,7 +325,7 @@ hns3_restore_vlan_table(struct hns3_adapter *hns)
 static int
 hns3_vlan_filter_configure(struct hns3_adapter *hns, uint16_t vlan_id, int on)
 {
-	struct hns3_pf *pf = &hns->pf;
+	struct hns3_hw *hw = &hns->hw;
 	bool writen_to_tbl = false;
 	int ret = 0;
 
@@ -346,7 +343,7 @@ hns3_vlan_filter_configure(struct hns3_adapter *hns, uint16_t vlan_id, int on)
 	 * vlan list. The vlan id in vlan list will be writen in vlan filter
 	 * table until port base vlan disabled
 	 */
-	if (pf->port_base_vlan_cfg.state == HNS3_PORT_BASE_VLAN_DISABLE) {
+	if (hw->port_base_vlan_cfg.state == HNS3_PORT_BASE_VLAN_DISABLE) {
 		ret = hns3_set_port_vlan_filter(hns, vlan_id, on);
 		writen_to_tbl = true;
 	}
@@ -500,11 +497,10 @@ static int
 hns3_en_hw_strip_rxvtag(struct hns3_adapter *hns, bool enable)
 {
 	struct hns3_rx_vtag_cfg rxvlan_cfg;
-	struct hns3_pf *pf = &hns->pf;
 	struct hns3_hw *hw = &hns->hw;
 	int ret;
 
-	if (pf->port_base_vlan_cfg.state == HNS3_PORT_BASE_VLAN_DISABLE) {
+	if (hw->port_base_vlan_cfg.state == HNS3_PORT_BASE_VLAN_DISABLE) {
 		rxvlan_cfg.strip_tag1_en = false;
 		rxvlan_cfg.strip_tag2_en = enable;
 	} else {
@@ -719,12 +715,12 @@ hns3_vlan_txvlan_cfg(struct hns3_adapter *hns, uint16_t port_base_vlan_state,
 static void
 hns3_store_port_base_vlan_info(struct hns3_adapter *hns, uint16_t pvid, int on)
 {
-	struct hns3_pf *pf = &hns->pf;
+	struct hns3_hw *hw = &hns->hw;
 
-	pf->port_base_vlan_cfg.state = on ?
+	hw->port_base_vlan_cfg.state = on ?
 	    HNS3_PORT_BASE_VLAN_ENABLE : HNS3_PORT_BASE_VLAN_DISABLE;
 
-	pf->port_base_vlan_cfg.pvid = pvid;
+	hw->port_base_vlan_cfg.pvid = pvid;
 }
 
 static void
@@ -768,13 +764,12 @@ static void
 hns3_remove_all_vlan_table(struct hns3_adapter *hns)
 {
 	struct hns3_hw *hw = &hns->hw;
-	struct hns3_pf *pf = &hns->pf;
 	int ret;
 
 	hns3_rm_all_vlan_table(hns, true);
-	if (pf->port_base_vlan_cfg.pvid != HNS3_INVLID_PVID) {
+	if (hw->port_base_vlan_cfg.pvid != HNS3_INVLID_PVID) {
 		ret = hns3_set_port_vlan_filter(hns,
-						pf->port_base_vlan_cfg.pvid, 0);
+						hw->port_base_vlan_cfg.pvid, 0);
 		if (ret) {
 			hns3_err(hw, "Failed to remove all vlan table, ret =%d",
 				 ret);
@@ -788,7 +783,6 @@ hns3_update_vlan_filter_entries(struct hns3_adapter *hns,
 				uint16_t port_base_vlan_state,
 				uint16_t new_pvid, uint16_t old_pvid)
 {
-	struct hns3_pf *pf = &hns->pf;
 	struct hns3_hw *hw = &hns->hw;
 	int ret = 0;
 
@@ -816,7 +810,7 @@ hns3_update_vlan_filter_entries(struct hns3_adapter *hns,
 		}
 	}
 
-	if (new_pvid == pf->port_base_vlan_cfg.pvid)
+	if (new_pvid == hw->port_base_vlan_cfg.pvid)
 		hns3_add_all_vlan_table(hns);
 
 	return ret;
@@ -853,17 +847,16 @@ hns3_en_pvid_strip(struct hns3_adapter *hns, int on)
 static int
 hns3_vlan_pvid_configure(struct hns3_adapter *hns, uint16_t pvid, int on)
 {
-	struct hns3_pf *pf = &hns->pf;
 	struct hns3_hw *hw = &hns->hw;
 	uint16_t port_base_vlan_state;
 	uint16_t old_pvid;
 	int ret;
 
-	if (on == 0 && pvid != pf->port_base_vlan_cfg.pvid) {
-		if (pf->port_base_vlan_cfg.pvid != HNS3_INVLID_PVID)
+	if (on == 0 && pvid != hw->port_base_vlan_cfg.pvid) {
+		if (hw->port_base_vlan_cfg.pvid != HNS3_INVLID_PVID)
 			hns3_warn(hw, "Invalid operation! As current pvid set "
 				  "is %u, disable pvid %u is invalid",
-				  pf->port_base_vlan_cfg.pvid, pvid);
+				  hw->port_base_vlan_cfg.pvid, pvid);
 		return 0;
 	}
 
@@ -885,7 +878,7 @@ hns3_vlan_pvid_configure(struct hns3_adapter *hns, uint16_t pvid, int on)
 
 	if (pvid == HNS3_INVLID_PVID)
 		goto out;
-	old_pvid = pf->port_base_vlan_cfg.pvid;
+	old_pvid = hw->port_base_vlan_cfg.pvid;
 	ret = hns3_update_vlan_filter_entries(hns, port_base_vlan_state, pvid,
 					      old_pvid);
 	if (ret) {
@@ -921,11 +914,8 @@ hns3_vlan_pvid_set(struct rte_eth_dev *dev, uint16_t pvid, int on)
 static void
 init_port_base_vlan_info(struct hns3_hw *hw)
 {
-	struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
-	struct hns3_pf *pf = &hns->pf;
-
-	pf->port_base_vlan_cfg.state = HNS3_PORT_BASE_VLAN_DISABLE;
-	pf->port_base_vlan_cfg.pvid = HNS3_INVLID_PVID;
+	hw->port_base_vlan_cfg.state = HNS3_PORT_BASE_VLAN_DISABLE;
+	hw->port_base_vlan_cfg.pvid = HNS3_INVLID_PVID;
 }
 
 static int
diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h
index cdbfc70b2..e7d9fe0e0 100644
--- a/drivers/net/hns3/hns3_ethdev.h
+++ b/drivers/net/hns3/hns3_ethdev.h
@@ -161,6 +161,13 @@ struct hns3_fake_queue_data {
 	uint16_t nb_fake_tx_queues; /* Number of fake TX queues. */
 };
 
+#define HNS3_PORT_BASE_VLAN_DISABLE	0
+#define HNS3_PORT_BASE_VLAN_ENABLE	1
+struct hns3_port_base_vlan_config {
+	uint16_t state;
+	uint16_t pvid;
+};
+
 /* Primary process maintains driver state in main thread.
  *
  * +---------------+
@@ -384,6 +391,8 @@ struct hns3_hw {
 	uint16_t tx_qnum_per_tc;    /* TX queue number per TC */
 
 	uint32_t flag;
+
+	struct hns3_port_base_vlan_config port_base_vlan_cfg;
 	/*
 	 * PMD setup and configuration is not thread safe. Since it is not
 	 * performance sensitive, it is better to guarantee thread-safety
@@ -413,11 +422,6 @@ struct hns3_user_vlan_table {
 	uint16_t vlan_id;
 };
 
-struct hns3_port_base_vlan_config {
-	uint16_t state;
-	uint16_t pvid;
-};
-
 /* Vlan tag configuration for RX direction */
 struct hns3_rx_vtag_cfg {
 	uint8_t rx_vlan_offload_en; /* Whether enable rx vlan offload */
@@ -493,7 +497,6 @@ struct hns3_pf {
 	bool support_sfp_query;
 
 	struct hns3_vtag_cfg vtag_config;
-	struct hns3_port_base_vlan_config port_base_vlan_cfg;
 	LIST_HEAD(vlan_tbl, hns3_user_vlan_table) vlan_list;
 
 	struct hns3_fdir_info fdir; /* flow director info */
diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index dcaeab267..3251515fe 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -1255,9 +1255,9 @@ rxd_pkt_info_to_pkt_type(uint32_t pkt_info, uint32_t ol_info)
 
 	static const uint32_t l2table[HNS3_L2TBL_NUM] = {
 		RTE_PTYPE_L2_ETHER,
-		RTE_PTYPE_L2_ETHER_VLAN,
 		RTE_PTYPE_L2_ETHER_QINQ,
-		0
+		RTE_PTYPE_L2_ETHER_VLAN,
+		RTE_PTYPE_L2_ETHER_VLAN
 	};
 
 	static const uint32_t l3table[HNS3_L3TBL_NUM] = {
@@ -1450,6 +1450,58 @@ hns3_rx_set_cksum_flag(struct rte_mbuf *rxm, uint64_t packet_type,
 	}
 }
 
+static inline void
+hns3_rxd_to_vlan_tci(struct rte_eth_dev *dev, struct rte_mbuf *mb,
+		     uint32_t l234_info, const struct hns3_desc *rxd)
+{
+#define HNS3_STRP_STATUS_NUM		0x4
+
+#define HNS3_NO_STRP_VLAN_VLD		0x0
+#define HNS3_INNER_STRP_VLAN_VLD	0x1
+#define HNS3_OUTER_STRP_VLAN_VLD	0x2
+	struct hns3_adapter *hns = dev->data->dev_private;
+	struct hns3_hw *hw = &hns->hw;
+	uint32_t strip_status;
+	uint32_t report_mode;
+
+	/*
+	 * Since HW limitation, the vlan tag will always be inserted into RX
+	 * descriptor when strip the tag from packet, driver needs to determine
+	 * reporting which tag to mbuf according to the PVID configuration
+	 * and vlan striped status.
+	 */
+	static const uint32_t report_type[][HNS3_STRP_STATUS_NUM] = {
+		{
+			HNS3_NO_STRP_VLAN_VLD,
+			HNS3_OUTER_STRP_VLAN_VLD,
+			HNS3_INNER_STRP_VLAN_VLD,
+			HNS3_OUTER_STRP_VLAN_VLD
+		},
+		{
+			HNS3_NO_STRP_VLAN_VLD,
+			HNS3_NO_STRP_VLAN_VLD,
+			HNS3_NO_STRP_VLAN_VLD,
+			HNS3_INNER_STRP_VLAN_VLD
+		}
+	};
+	strip_status = hns3_get_field(l234_info, HNS3_RXD_STRP_TAGP_M,
+				      HNS3_RXD_STRP_TAGP_S);
+	report_mode = report_type[hw->port_base_vlan_cfg.state][strip_status];
+	switch (report_mode) {
+	case HNS3_NO_STRP_VLAN_VLD:
+		mb->vlan_tci = 0;
+		return;
+	case HNS3_INNER_STRP_VLAN_VLD:
+		mb->ol_flags |= PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED;
+		mb->vlan_tci = rte_le_to_cpu_16(rxd->rx.vlan_tag);
+		return;
+	case HNS3_OUTER_STRP_VLAN_VLD:
+		mb->ol_flags |= PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED;
+		mb->vlan_tci = rte_le_to_cpu_16(rxd->rx.ot_vlan_tag);
+		return;
+	}
+}
+
 uint16_t
 hns3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 {
@@ -1625,10 +1677,8 @@ hns3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 			hns3_rx_set_cksum_flag(first_seg,
 					       first_seg->packet_type,
 					       cksum_err);
+		hns3_rxd_to_vlan_tci(dev, first_seg, l234_info, &rxd);
 
-		first_seg->vlan_tci = rte_le_to_cpu_16(rxd.rx.vlan_tag);
-		first_seg->vlan_tci_outer =
-			rte_le_to_cpu_16(rxd.rx.ot_vlan_tag);
 		rx_pkts[nb_rx++] = first_seg;
 		first_seg = NULL;
 		continue;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:49.391038171 +0100
+++ 0020-net-hns3-fix-VLAN-tags-reported-in-Rx.patch	2020-07-24 12:53:48.207004969 +0100
@@ -1,8 +1,10 @@
-From e28bc1476558467b2898abab306b2317bada3d78 Mon Sep 17 00:00:00 2001
+From 7e6fa0689b7ec6566ab96123deb340c409e0d097 Mon Sep 17 00:00:00 2001
 From: "Wei Hu (Xavier)" <xavier.huwei@huawei.com>
 Date: Wed, 3 Jun 2020 17:32:00 +0800
 Subject: [PATCH] net/hns3: fix VLAN tags reported in Rx
 
+[ upstream commit e28bc1476558467b2898abab306b2317bada3d78 ]
+
 Currently, based on hns3 network engine, driver always reports the
 incoming packet's VLAN tags to the structure rte_mbuf those are the
 output parameter pointers in '.rx_pkt_burst' ops implementation
@@ -22,18 +24,17 @@
 
 Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations")
 Fixes: 411d23b9eafb ("net/hns3: support VLAN")
-Cc: stable@dpdk.org
 
 Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
 Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
 ---
- drivers/net/hns3/hns3_ethdev.c | 44 ++++++++++---------------
+ drivers/net/hns3/hns3_ethdev.c | 48 +++++++++++----------------
  drivers/net/hns3/hns3_ethdev.h | 15 +++++----
  drivers/net/hns3/hns3_rxtx.c   | 60 +++++++++++++++++++++++++++++++---
- 3 files changed, 82 insertions(+), 37 deletions(-)
+ 3 files changed, 83 insertions(+), 40 deletions(-)
 
 diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
-index 244a3b827..62d87582d 100644
+index e7eeb7875..f1066c079 100644
 --- a/drivers/net/hns3/hns3_ethdev.c
 +++ b/drivers/net/hns3/hns3_ethdev.c
 @@ -35,8 +35,6 @@
@@ -45,7 +46,7 @@
  #define HNS3_INVLID_PVID		0xFFFF
  
  #define HNS3_FILTER_TYPE_VF		0
-@@ -313,13 +311,14 @@ static int
+@@ -303,15 +301,14 @@ static int
  hns3_restore_vlan_table(struct hns3_adapter *hns)
  {
  	struct hns3_user_vlan_table *vlan_entry;
@@ -54,15 +55,18 @@
  	uint16_t vlan_id;
  	int ret = 0;
  
--	if (pf->port_base_vlan_cfg.state == HNS3_PORT_BASE_VLAN_ENABLE)
+-	if (pf->port_base_vlan_cfg.state == HNS3_PORT_BASE_VLAN_ENABLE) {
+-		ret = hns3_vlan_pvid_configure(hns, pf->port_base_vlan_cfg.pvid,
+-					       1);
+-		return ret;
+-	}
 +	if (hw->port_base_vlan_cfg.state == HNS3_PORT_BASE_VLAN_ENABLE)
- 		return hns3_vlan_pvid_configure(hns,
--						pf->port_base_vlan_cfg.pvid, 1);
++		return hns3_vlan_pvid_configure(hns,
 +						hw->port_base_vlan_cfg.pvid, 1);
  
  	LIST_FOREACH(vlan_entry, &pf->vlan_list, next) {
  		if (vlan_entry->hd_tbl_status) {
-@@ -336,7 +335,7 @@ hns3_restore_vlan_table(struct hns3_adapter *hns)
+@@ -328,7 +325,7 @@ hns3_restore_vlan_table(struct hns3_adapter *hns)
  static int
  hns3_vlan_filter_configure(struct hns3_adapter *hns, uint16_t vlan_id, int on)
  {
@@ -71,7 +75,7 @@
  	bool writen_to_tbl = false;
  	int ret = 0;
  
-@@ -354,7 +353,7 @@ hns3_vlan_filter_configure(struct hns3_adapter *hns, uint16_t vlan_id, int on)
+@@ -346,7 +343,7 @@ hns3_vlan_filter_configure(struct hns3_adapter *hns, uint16_t vlan_id, int on)
  	 * vlan list. The vlan id in vlan list will be writen in vlan filter
  	 * table until port base vlan disabled
  	 */
@@ -80,7 +84,7 @@
  		ret = hns3_set_port_vlan_filter(hns, vlan_id, on);
  		writen_to_tbl = true;
  	}
-@@ -507,11 +506,10 @@ static int
+@@ -500,11 +497,10 @@ static int
  hns3_en_hw_strip_rxvtag(struct hns3_adapter *hns, bool enable)
  {
  	struct hns3_rx_vtag_cfg rxvlan_cfg;
@@ -93,7 +97,7 @@
  		rxvlan_cfg.strip_tag1_en = false;
  		rxvlan_cfg.strip_tag2_en = enable;
  	} else {
-@@ -728,12 +726,12 @@ hns3_vlan_txvlan_cfg(struct hns3_adapter *hns, uint16_t port_base_vlan_state,
+@@ -719,12 +715,12 @@ hns3_vlan_txvlan_cfg(struct hns3_adapter *hns, uint16_t port_base_vlan_state,
  static void
  hns3_store_port_base_vlan_info(struct hns3_adapter *hns, uint16_t pvid, int on)
  {
@@ -109,7 +113,7 @@
  }
  
  static void
-@@ -777,13 +775,12 @@ static void
+@@ -768,13 +764,12 @@ static void
  hns3_remove_all_vlan_table(struct hns3_adapter *hns)
  {
  	struct hns3_hw *hw = &hns->hw;
@@ -125,7 +129,7 @@
  		if (ret) {
  			hns3_err(hw, "Failed to remove all vlan table, ret =%d",
  				 ret);
-@@ -797,7 +794,6 @@ hns3_update_vlan_filter_entries(struct hns3_adapter *hns,
+@@ -788,7 +783,6 @@ hns3_update_vlan_filter_entries(struct hns3_adapter *hns,
  				uint16_t port_base_vlan_state,
  				uint16_t new_pvid, uint16_t old_pvid)
  {
@@ -133,7 +137,7 @@
  	struct hns3_hw *hw = &hns->hw;
  	int ret = 0;
  
-@@ -825,7 +821,7 @@ hns3_update_vlan_filter_entries(struct hns3_adapter *hns,
+@@ -816,7 +810,7 @@ hns3_update_vlan_filter_entries(struct hns3_adapter *hns,
  		}
  	}
  
@@ -142,7 +146,7 @@
  		hns3_add_all_vlan_table(hns);
  
  	return ret;
-@@ -862,17 +858,16 @@ hns3_en_pvid_strip(struct hns3_adapter *hns, int on)
+@@ -853,17 +847,16 @@ hns3_en_pvid_strip(struct hns3_adapter *hns, int on)
  static int
  hns3_vlan_pvid_configure(struct hns3_adapter *hns, uint16_t pvid, int on)
  {
@@ -163,7 +167,7 @@
  		return 0;
  	}
  
-@@ -894,7 +889,7 @@ hns3_vlan_pvid_configure(struct hns3_adapter *hns, uint16_t pvid, int on)
+@@ -885,7 +878,7 @@ hns3_vlan_pvid_configure(struct hns3_adapter *hns, uint16_t pvid, int on)
  
  	if (pvid == HNS3_INVLID_PVID)
  		goto out;
@@ -172,7 +176,7 @@
  	ret = hns3_update_vlan_filter_entries(hns, port_base_vlan_state, pvid,
  					      old_pvid);
  	if (ret) {
-@@ -930,11 +925,8 @@ hns3_vlan_pvid_set(struct rte_eth_dev *dev, uint16_t pvid, int on)
+@@ -921,11 +914,8 @@ hns3_vlan_pvid_set(struct rte_eth_dev *dev, uint16_t pvid, int on)
  static void
  init_port_base_vlan_info(struct hns3_hw *hw)
  {
@@ -187,10 +191,10 @@
  
  static int
 diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h
-index bc458cb44..21412c44c 100644
+index cdbfc70b2..e7d9fe0e0 100644
 --- a/drivers/net/hns3/hns3_ethdev.h
 +++ b/drivers/net/hns3/hns3_ethdev.h
-@@ -171,6 +171,13 @@ struct hns3_fake_queue_data {
+@@ -161,6 +161,13 @@ struct hns3_fake_queue_data {
  	uint16_t nb_fake_tx_queues; /* Number of fake TX queues. */
  };
  
@@ -204,7 +208,7 @@
  /* Primary process maintains driver state in main thread.
   *
   * +---------------+
-@@ -395,6 +402,8 @@ struct hns3_hw {
+@@ -384,6 +391,8 @@ struct hns3_hw {
  	uint16_t tx_qnum_per_tc;    /* TX queue number per TC */
  
  	uint32_t flag;
@@ -213,7 +217,7 @@
  	/*
  	 * PMD setup and configuration is not thread safe. Since it is not
  	 * performance sensitive, it is better to guarantee thread-safety
-@@ -424,11 +433,6 @@ struct hns3_user_vlan_table {
+@@ -413,11 +422,6 @@ struct hns3_user_vlan_table {
  	uint16_t vlan_id;
  };
  
@@ -225,7 +229,7 @@
  /* Vlan tag configuration for RX direction */
  struct hns3_rx_vtag_cfg {
  	uint8_t rx_vlan_offload_en; /* Whether enable rx vlan offload */
-@@ -504,7 +508,6 @@ struct hns3_pf {
+@@ -493,7 +497,6 @@ struct hns3_pf {
  	bool support_sfp_query;
  
  	struct hns3_vtag_cfg vtag_config;
@@ -234,7 +238,7 @@
  
  	struct hns3_fdir_info fdir; /* flow director info */
 diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
-index 25ba3b820..4341c6d60 100644
+index dcaeab267..3251515fe 100644
 --- a/drivers/net/hns3/hns3_rxtx.c
 +++ b/drivers/net/hns3/hns3_rxtx.c
 @@ -1255,9 +1255,9 @@ rxd_pkt_info_to_pkt_type(uint32_t pkt_info, uint32_t ol_info)

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

* [dpdk-stable] patch 'net/i40e: enable NEON Rx/Tx in meson' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (18 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/hns3: fix VLAN tags reported in Rx' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'app/testpmd: fix stats error message' " luca.boccassi
                   ` (171 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Ruifeng Wang
  Cc: David Marchand, Honnappa Nagarahalli, Phil Yang,
	Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 2e222d5f27b08cc151bd449beae276cee5f42615 Mon Sep 17 00:00:00 2001
From: Ruifeng Wang <ruifeng.wang@arm.com>
Date: Fri, 5 Jun 2020 13:20:55 +0800
Subject: [PATCH] net/i40e: enable NEON Rx/Tx in meson

[ upstream commit 83ea3b5fa09152da5033f64164f7487296f21f64 ]

The i40e neon vector implementation is not compiled with meson.
Add the file to meson for Arm platform.

Fixes: e940646b20fa ("drivers/net: build Intel NIC PMDs with meson")

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/i40e/meson.build | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/i40e/meson.build b/drivers/net/i40e/meson.build
index b01babba1..3d5fc7111 100644
--- a/drivers/net/i40e/meson.build
+++ b/drivers/net/i40e/meson.build
@@ -45,6 +45,9 @@ if arch_subdir == 'x86'
 				c_args: [cflags, '-mavx2'])
 		objs += i40e_avx2_lib.extract_objects('i40e_rxtx_vec_avx2.c')
 	endif
+elif arch_subdir == 'arm'
+       dpdk_conf.set('RTE_LIBRTE_I40E_INC_VECTOR', 1)
+       sources += files('i40e_rxtx_vec_neon.c')
 endif
 
 install_headers('rte_pmd_i40e.h')
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:49.438038735 +0100
+++ 0021-net-i40e-enable-NEON-Rx-Tx-in-meson.patch	2020-07-24 12:53:48.207004969 +0100
@@ -1,13 +1,14 @@
-From 83ea3b5fa09152da5033f64164f7487296f21f64 Mon Sep 17 00:00:00 2001
+From 2e222d5f27b08cc151bd449beae276cee5f42615 Mon Sep 17 00:00:00 2001
 From: Ruifeng Wang <ruifeng.wang@arm.com>
 Date: Fri, 5 Jun 2020 13:20:55 +0800
 Subject: [PATCH] net/i40e: enable NEON Rx/Tx in meson
 
+[ upstream commit 83ea3b5fa09152da5033f64164f7487296f21f64 ]
+
 The i40e neon vector implementation is not compiled with meson.
 Add the file to meson for Arm platform.
 
 Fixes: e940646b20fa ("drivers/net: build Intel NIC PMDs with meson")
-Cc: stable@dpdk.org
 
 Reported-by: David Marchand <david.marchand@redhat.com>
 Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
@@ -19,13 +20,13 @@
  1 file changed, 3 insertions(+)
 
 diff --git a/drivers/net/i40e/meson.build b/drivers/net/i40e/meson.build
-index c452420ee..211d45d88 100644
+index b01babba1..3d5fc7111 100644
 --- a/drivers/net/i40e/meson.build
 +++ b/drivers/net/i40e/meson.build
-@@ -47,6 +47,9 @@ if arch_subdir == 'x86'
- elif arch_subdir == 'ppc'
-        dpdk_conf.set('RTE_LIBRTE_I40E_INC_VECTOR', 1)
-        sources += files('i40e_rxtx_vec_altivec.c')
+@@ -45,6 +45,9 @@ if arch_subdir == 'x86'
+ 				c_args: [cflags, '-mavx2'])
+ 		objs += i40e_avx2_lib.extract_objects('i40e_rxtx_vec_avx2.c')
+ 	endif
 +elif arch_subdir == 'arm'
 +       dpdk_conf.set('RTE_LIBRTE_I40E_INC_VECTOR', 1)
 +       sources += files('i40e_rxtx_vec_neon.c')

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

* [dpdk-stable] patch 'app/testpmd: fix stats error message' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (19 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/i40e: enable NEON Rx/Tx in meson' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'mbuf: remove unused next member in dynamic flag/field' " luca.boccassi
                   ` (170 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Wei Hu (Xavier); +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From f6b4eb4e8488c734aa2c3bba7078f305276caab0 Mon Sep 17 00:00:00 2001
From: "Wei Hu (Xavier)" <xavier.huwei@huawei.com>
Date: Sat, 6 Jun 2020 11:46:37 +0800
Subject: [PATCH] app/testpmd: fix stats error message

[ upstream commit 5fd722308ef21819931d25e7a140ff5a292b19d9 ]

There are coverity defects related "Argument cannot be negative"

This patch fixes them by passing '-ret' to the function strerror() when
ret is negative.

Coverity issue: 349913, 358437, 358449, 358450
Fixes: da328f7f115a ("ethdev: change xstats reset function to return int")
Fixes: 9eb974221f44 ("app/testpmd: fix statistics after reset")

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 app/test-pmd/config.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 42eba68b3..d5d246617 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -233,12 +233,14 @@ nic_stats_clear(portid_t port_id)
 	ret = rte_eth_stats_reset(port_id);
 	if (ret != 0) {
 		printf("%s: Error: failed to reset stats (port %u): %s",
-		       __func__, port_id, strerror(ret));
+		       __func__, port_id, strerror(-ret));
 		return;
 	}
 
 	ret = rte_eth_stats_get(port_id, &ports[port_id].stats);
 	if (ret != 0) {
+		if (ret < 0)
+			ret = -ret;
 		printf("%s: Error: failed to get stats (port %u): %s",
 		       __func__, port_id, strerror(ret));
 		return;
@@ -322,12 +324,14 @@ nic_xstats_clear(portid_t port_id)
 	ret = rte_eth_xstats_reset(port_id);
 	if (ret != 0) {
 		printf("%s: Error: failed to reset xstats (port %u): %s",
-		       __func__, port_id, strerror(ret));
+		       __func__, port_id, strerror(-ret));
 		return;
 	}
 
 	ret = rte_eth_stats_get(port_id, &ports[port_id].stats);
 	if (ret != 0) {
+		if (ret < 0)
+			ret = -ret;
 		printf("%s: Error: failed to get stats (port %u): %s",
 		       __func__, port_id, strerror(ret));
 		return;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:49.469273842 +0100
+++ 0022-app-testpmd-fix-stats-error-message.patch	2020-07-24 12:53:48.207004969 +0100
@@ -1,8 +1,10 @@
-From 5fd722308ef21819931d25e7a140ff5a292b19d9 Mon Sep 17 00:00:00 2001
+From f6b4eb4e8488c734aa2c3bba7078f305276caab0 Mon Sep 17 00:00:00 2001
 From: "Wei Hu (Xavier)" <xavier.huwei@huawei.com>
 Date: Sat, 6 Jun 2020 11:46:37 +0800
 Subject: [PATCH] app/testpmd: fix stats error message
 
+[ upstream commit 5fd722308ef21819931d25e7a140ff5a292b19d9 ]
+
 There are coverity defects related "Argument cannot be negative"
 
 This patch fixes them by passing '-ret' to the function strerror() when
@@ -11,7 +13,6 @@
 Coverity issue: 349913, 358437, 358449, 358450
 Fixes: da328f7f115a ("ethdev: change xstats reset function to return int")
 Fixes: 9eb974221f44 ("app/testpmd: fix statistics after reset")
-Cc: stable@dpdk.org
 
 Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
 Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
@@ -20,10 +21,10 @@
  1 file changed, 6 insertions(+), 2 deletions(-)
 
 diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
-index 5381207cc..016bcb09c 100644
+index 42eba68b3..d5d246617 100644
 --- a/app/test-pmd/config.c
 +++ b/app/test-pmd/config.c
-@@ -244,12 +244,14 @@ nic_stats_clear(portid_t port_id)
+@@ -233,12 +233,14 @@ nic_stats_clear(portid_t port_id)
  	ret = rte_eth_stats_reset(port_id);
  	if (ret != 0) {
  		printf("%s: Error: failed to reset stats (port %u): %s",
@@ -39,7 +40,7 @@
  		printf("%s: Error: failed to get stats (port %u): %s",
  		       __func__, port_id, strerror(ret));
  		return;
-@@ -333,12 +335,14 @@ nic_xstats_clear(portid_t port_id)
+@@ -322,12 +324,14 @@ nic_xstats_clear(portid_t port_id)
  	ret = rte_eth_xstats_reset(port_id);
  	if (ret != 0) {
  		printf("%s: Error: failed to reset xstats (port %u): %s",

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

* [dpdk-stable] patch 'mbuf: remove unused next member in dynamic flag/field' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (20 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'app/testpmd: fix stats error message' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'test/mbuf: fix a dynamic flag log' " luca.boccassi
                   ` (169 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Xiaolong Ye; +Cc: Olivier Matz, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From d1243b7c1a4236ecc7adc54840db5cc4efd7b8e4 Mon Sep 17 00:00:00 2001
From: Xiaolong Ye <xiaolong.ye@intel.com>
Date: Tue, 9 Jun 2020 15:12:56 +0800
Subject: [PATCH] mbuf: remove unused next member in dynamic flag/field

[ upstream commit c67a423c53e9f891204fafcd9481ee1db0ec3b80 ]

TAILQ_ENTRY next is not needed in struct mbuf_dynfield_elt and
mbuf_dynflag_elt, since they are actually chained by rte_tailq_entry's
next field when calling TAILQ_INSERT_TAIL(mbuf_dynfield/dynflag_list, te,
next).

Fixes: 4958ca3a443a ("mbuf: support dynamic fields and flags")

Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---
 lib/librte_mbuf/rte_mbuf_dyn.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/lib/librte_mbuf/rte_mbuf_dyn.c b/lib/librte_mbuf/rte_mbuf_dyn.c
index d6931f847..953e3ec31 100644
--- a/lib/librte_mbuf/rte_mbuf_dyn.c
+++ b/lib/librte_mbuf/rte_mbuf_dyn.c
@@ -19,7 +19,6 @@
 #define RTE_MBUF_DYN_MZNAME "rte_mbuf_dyn"
 
 struct mbuf_dynfield_elt {
-	TAILQ_ENTRY(mbuf_dynfield_elt) next;
 	struct rte_mbuf_dynfield params;
 	size_t offset;
 };
@@ -31,7 +30,6 @@ static struct rte_tailq_elem mbuf_dynfield_tailq = {
 EAL_REGISTER_TAILQ(mbuf_dynfield_tailq);
 
 struct mbuf_dynflag_elt {
-	TAILQ_ENTRY(mbuf_dynflag_elt) next;
 	struct rte_mbuf_dynflag params;
 	unsigned int bitnum;
 };
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:49.513285924 +0100
+++ 0023-mbuf-remove-unused-next-member-in-dynamic-flag-field.patch	2020-07-24 12:53:48.211005044 +0100
@@ -1,15 +1,16 @@
-From c67a423c53e9f891204fafcd9481ee1db0ec3b80 Mon Sep 17 00:00:00 2001
+From d1243b7c1a4236ecc7adc54840db5cc4efd7b8e4 Mon Sep 17 00:00:00 2001
 From: Xiaolong Ye <xiaolong.ye@intel.com>
 Date: Tue, 9 Jun 2020 15:12:56 +0800
 Subject: [PATCH] mbuf: remove unused next member in dynamic flag/field
 
+[ upstream commit c67a423c53e9f891204fafcd9481ee1db0ec3b80 ]
+
 TAILQ_ENTRY next is not needed in struct mbuf_dynfield_elt and
 mbuf_dynflag_elt, since they are actually chained by rte_tailq_entry's
 next field when calling TAILQ_INSERT_TAIL(mbuf_dynfield/dynflag_list, te,
 next).
 
 Fixes: 4958ca3a443a ("mbuf: support dynamic fields and flags")
-Cc: stable@dpdk.org
 
 Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
 Acked-by: Olivier Matz <olivier.matz@6wind.com>

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

* [dpdk-stable] patch 'test/mbuf: fix a dynamic flag log' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (21 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'mbuf: remove unused next member in dynamic flag/field' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'eal/windows: fix symbol export' " luca.boccassi
                   ` (168 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Xiaolong Ye; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 031482ddd203b0080e59a253cfccc01e58d530a3 Mon Sep 17 00:00:00 2001
From: Xiaolong Ye <xiaolong.ye@intel.com>
Date: Tue, 9 Jun 2020 16:24:29 +0800
Subject: [PATCH] test/mbuf: fix a dynamic flag log

[ upstream commit 72ea8d4050c12cf04bb4ac6ac16c3c084b811426 ]

Fixes: 4958ca3a443a ("mbuf: support dynamic fields and flags")

Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
---
 app/test/test_mbuf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
index f2922e05e..bf04025a8 100644
--- a/app/test/test_mbuf.c
+++ b/app/test/test_mbuf.c
@@ -2519,7 +2519,7 @@ test_mbuf_dyn(struct rte_mempool *pktmbuf_pool)
 	flag3 = rte_mbuf_dynflag_register_bitnum(&dynflag3,
 						rte_bsf64(PKT_LAST_FREE));
 	if (flag3 != rte_bsf64(PKT_LAST_FREE))
-		GOTO_FAIL("failed to register dynamic flag 3, flag2=%d: %s",
+		GOTO_FAIL("failed to register dynamic flag 3, flag3=%d: %s",
 			flag3, strerror(errno));
 
 	printf("dynflag: flag=%d, flag2=%d, flag3=%d\n", flag, flag2, flag3);
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:49.549571647 +0100
+++ 0024-test-mbuf-fix-a-dynamic-flag-log.patch	2020-07-24 12:53:48.211005044 +0100
@@ -1,10 +1,11 @@
-From 72ea8d4050c12cf04bb4ac6ac16c3c084b811426 Mon Sep 17 00:00:00 2001
+From 031482ddd203b0080e59a253cfccc01e58d530a3 Mon Sep 17 00:00:00 2001
 From: Xiaolong Ye <xiaolong.ye@intel.com>
 Date: Tue, 9 Jun 2020 16:24:29 +0800
 Subject: [PATCH] test/mbuf: fix a dynamic flag log
 
+[ upstream commit 72ea8d4050c12cf04bb4ac6ac16c3c084b811426 ]
+
 Fixes: 4958ca3a443a ("mbuf: support dynamic fields and flags")
-Cc: stable@dpdk.org
 
 Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
 ---
@@ -12,10 +13,10 @@
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
-index 71bdab691..06e44f0a7 100644
+index f2922e05e..bf04025a8 100644
 --- a/app/test/test_mbuf.c
 +++ b/app/test/test_mbuf.c
-@@ -2647,7 +2647,7 @@ test_mbuf_dyn(struct rte_mempool *pktmbuf_pool)
+@@ -2519,7 +2519,7 @@ test_mbuf_dyn(struct rte_mempool *pktmbuf_pool)
  	flag3 = rte_mbuf_dynflag_register_bitnum(&dynflag3,
  						rte_bsf64(PKT_LAST_FREE));
  	if (flag3 != rte_bsf64(PKT_LAST_FREE))

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

* [dpdk-stable] patch 'eal/windows: fix symbol export' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (22 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'test/mbuf: fix a dynamic flag log' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'app/testpmd: fix error detection in MTU command' " luca.boccassi
                   ` (167 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: David Marchand; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From afd842b48e9af1eded17f83e0f9f680d7d72697a Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Wed, 10 Jun 2020 16:30:49 +0200
Subject: [PATCH] eal/windows: fix symbol export

[ upstream commit b6f0621201be2cd02c72bc3f30b324aa8c2ca60e ]

rte_eal_get_configuration() has been made private in 19.11, remove
leftover in Windows export list.

Fixes: f58cef079b05 ("eal: make the global configuration private")

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/librte_eal/rte_eal_exports.def | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/librte_eal/rte_eal_exports.def b/lib/librte_eal/rte_eal_exports.def
index 12a6c79d6..c1bdee1c4 100644
--- a/lib/librte_eal/rte_eal_exports.def
+++ b/lib/librte_eal/rte_eal_exports.def
@@ -1,6 +1,5 @@
 EXPORTS
 	__rte_panic
-	rte_eal_get_configuration
 	rte_eal_init
 	rte_eal_mp_remote_launch
 	rte_eal_mp_wait_lcore
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:49.587539275 +0100
+++ 0025-eal-windows-fix-symbol-export.patch	2020-07-24 12:53:48.211005044 +0100
@@ -1,8 +1,10 @@
-From b6f0621201be2cd02c72bc3f30b324aa8c2ca60e Mon Sep 17 00:00:00 2001
+From afd842b48e9af1eded17f83e0f9f680d7d72697a Mon Sep 17 00:00:00 2001
 From: David Marchand <david.marchand@redhat.com>
 Date: Wed, 10 Jun 2020 16:30:49 +0200
 Subject: [PATCH] eal/windows: fix symbol export
 
+[ upstream commit b6f0621201be2cd02c72bc3f30b324aa8c2ca60e ]
+
 rte_eal_get_configuration() has been made private in 19.11, remove
 leftover in Windows export list.
 

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

* [dpdk-stable] patch 'app/testpmd: fix error detection in MTU command' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (23 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'eal/windows: fix symbol export' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/hns3: fix flow director error message' " luca.boccassi
                   ` (166 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Shy Shyman; +Cc: Ferruh Yigit, Phil Yang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 2333f80c8f65ad5dd876f8b03228867f0e5122de Mon Sep 17 00:00:00 2001
From: Shy Shyman <shys@mellanox.com>
Date: Mon, 8 Jun 2020 17:17:47 +0300
Subject: [PATCH] app/testpmd: fix error detection in MTU command

[ upstream commit 3b931ddb5e1fe8b29caafbad53738005ee9fef0c ]

MTU is used in testpmd to set the maximum payload size for packets.
According to testpmd, the setting influence RX only.
In rte_ethdev there's no relation between MTU setting and JUMBO offload
or rx_max_pkt_len.

The previous fix in patch referenced below was meant to update the
correlated variables of max_pkt_len and JUMBO offload, but by doing so
it assumes that MTU setting can only exist when JUMBO offload supported
in the device. For example fail-safe device does supports set MTU and
doesn't support JUMBO offload, and in this case, though set MTU
succeeds, an error message is still printed since the JUMBO packet
offload is disabled.

The fix separates the two conditions to make sure the error
triggers only in case the set_mtu action actually failed.

Fixes: 150c9ac2df13 ("app/testpmd: update Rx offload after setting MTU")

Signed-off-by: Shy Shyman <shys@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
---
 app/test-pmd/config.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index d5d246617..e345cea6d 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1262,8 +1262,9 @@ port_mtu_set(portid_t port_id, uint16_t mtu)
 		return;
 	}
 	diag = rte_eth_dev_set_mtu(port_id, mtu);
-	if (diag == 0 &&
-	    dev_info.rx_offload_capa & DEV_RX_OFFLOAD_JUMBO_FRAME) {
+	if (diag)
+		printf("Set MTU failed. diag=%d\n", diag);
+	else if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_JUMBO_FRAME) {
 		/*
 		 * Ether overhead in driver is equal to the difference of
 		 * max_rx_pktlen and max_mtu in rte_eth_dev_info when the
@@ -1278,10 +1279,7 @@ port_mtu_set(portid_t port_id, uint16_t mtu)
 		} else
 			rte_port->dev_conf.rxmode.offloads &=
 						~DEV_RX_OFFLOAD_JUMBO_FRAME;
-
-		return;
 	}
-	printf("Set MTU failed. diag=%d\n", diag);
 }
 
 /* Generic flow management functions. */
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:49.620698065 +0100
+++ 0026-app-testpmd-fix-error-detection-in-MTU-command.patch	2020-07-24 12:53:48.215005118 +0100
@@ -1,8 +1,10 @@
-From 3b931ddb5e1fe8b29caafbad53738005ee9fef0c Mon Sep 17 00:00:00 2001
+From 2333f80c8f65ad5dd876f8b03228867f0e5122de Mon Sep 17 00:00:00 2001
 From: Shy Shyman <shys@mellanox.com>
 Date: Mon, 8 Jun 2020 17:17:47 +0300
 Subject: [PATCH] app/testpmd: fix error detection in MTU command
 
+[ upstream commit 3b931ddb5e1fe8b29caafbad53738005ee9fef0c ]
+
 MTU is used in testpmd to set the maximum payload size for packets.
 According to testpmd, the setting influence RX only.
 In rte_ethdev there's no relation between MTU setting and JUMBO offload
@@ -20,7 +22,6 @@
 triggers only in case the set_mtu action actually failed.
 
 Fixes: 150c9ac2df13 ("app/testpmd: update Rx offload after setting MTU")
-Cc: stable@dpdk.org
 
 Signed-off-by: Shy Shyman <shys@mellanox.com>
 Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
@@ -30,10 +31,10 @@
  1 file changed, 3 insertions(+), 5 deletions(-)
 
 diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
-index 016bcb09c..a7112c998 100644
+index d5d246617..e345cea6d 100644
 --- a/app/test-pmd/config.c
 +++ b/app/test-pmd/config.c
-@@ -1281,8 +1281,9 @@ port_mtu_set(portid_t port_id, uint16_t mtu)
+@@ -1262,8 +1262,9 @@ port_mtu_set(portid_t port_id, uint16_t mtu)
  		return;
  	}
  	diag = rte_eth_dev_set_mtu(port_id, mtu);
@@ -45,7 +46,7 @@
  		/*
  		 * Ether overhead in driver is equal to the difference of
  		 * max_rx_pktlen and max_mtu in rte_eth_dev_info when the
-@@ -1297,10 +1298,7 @@ port_mtu_set(portid_t port_id, uint16_t mtu)
+@@ -1278,10 +1279,7 @@ port_mtu_set(portid_t port_id, uint16_t mtu)
  		} else
  			rte_port->dev_conf.rxmode.offloads &=
  						~DEV_RX_OFFLOAD_JUMBO_FRAME;

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

* [dpdk-stable] patch 'net/hns3: fix flow director error message' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (24 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'app/testpmd: fix error detection in MTU command' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/hns3: ignore function return on reset error path' " luca.boccassi
                   ` (165 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Wei Hu (Xavier); +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 2118606fd3f11cf4778b312e08faac0549db0401 Mon Sep 17 00:00:00 2001
From: "Wei Hu (Xavier)" <xavier.huwei@huawei.com>
Date: Tue, 9 Jun 2020 16:44:14 +0800
Subject: [PATCH] net/hns3: fix flow director error message

[ upstream commit 41b966ffb4f70792d8cd851173eab15bca183a7c ]

There is a coverity defect related "Argument cannot be negative".

This patch fixes it by passing '-ret' to the function strerror() when
ret is negative.

Coverity issue: 349933
Fixes: fcba820d9b9e ("net/hns3: support flow director")

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
---
 drivers/net/hns3/hns3_fdir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/hns3/hns3_fdir.c b/drivers/net/hns3/hns3_fdir.c
index 53c6448cd..79f3f0d14 100644
--- a/drivers/net/hns3/hns3_fdir.c
+++ b/drivers/net/hns3/hns3_fdir.c
@@ -893,7 +893,7 @@ static int hns3_insert_fdir_filter(struct hns3_hw *hw,
 	if (ret < 0) {
 		rte_spinlock_unlock(&fdir_info->flows_lock);
 		hns3_err(hw, "Hash table full? err:%d(%s)!", ret,
-			 strerror(ret));
+			 strerror(-ret));
 		return ret;
 	}
 
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:49.656840290 +0100
+++ 0027-net-hns3-fix-flow-director-error-message.patch	2020-07-24 12:53:48.215005118 +0100
@@ -1,8 +1,10 @@
-From 41b966ffb4f70792d8cd851173eab15bca183a7c Mon Sep 17 00:00:00 2001
+From 2118606fd3f11cf4778b312e08faac0549db0401 Mon Sep 17 00:00:00 2001
 From: "Wei Hu (Xavier)" <xavier.huwei@huawei.com>
 Date: Tue, 9 Jun 2020 16:44:14 +0800
 Subject: [PATCH] net/hns3: fix flow director error message
 
+[ upstream commit 41b966ffb4f70792d8cd851173eab15bca183a7c ]
+
 There is a coverity defect related "Argument cannot be negative".
 
 This patch fixes it by passing '-ret' to the function strerror() when
@@ -10,7 +12,6 @@
 
 Coverity issue: 349933
 Fixes: fcba820d9b9e ("net/hns3: support flow director")
-Cc: stable@dpdk.org
 
 Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
 ---
@@ -18,7 +19,7 @@
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/drivers/net/hns3/hns3_fdir.c b/drivers/net/hns3/hns3_fdir.c
-index 4c5928ffc..7bc5bf831 100644
+index 53c6448cd..79f3f0d14 100644
 --- a/drivers/net/hns3/hns3_fdir.c
 +++ b/drivers/net/hns3/hns3_fdir.c
 @@ -893,7 +893,7 @@ static int hns3_insert_fdir_filter(struct hns3_hw *hw,

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

* [dpdk-stable] patch 'net/hns3: ignore function return on reset error path' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (25 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/hns3: fix flow director error message' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/hns3: fix unintended sign extension in fd operation' " luca.boccassi
                   ` (164 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Hongbo Zheng; +Cc: Wei Hu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 0596f4a6e1872526253528ae825e9340b849cf77 Mon Sep 17 00:00:00 2001
From: Hongbo Zheng <zhenghongbo3@huawei.com>
Date: Tue, 9 Jun 2020 16:44:15 +0800
Subject: [PATCH] net/hns3: ignore function return on reset error path

[ upstream commit 80cd38e1b530973926c007d65a84600e8c27740d ]

There is a coverity defect related "Unchecked return value".

The internal static hns3_reset_err_handle function is reset error
process of hns3 PMD driver. If failure in reset process, it does not
mean that the network port is completely unavailable, so the command
interface between driver and firmware still needs to be initialized.
Regardless of whether the execution of the function named hns3_cmd_init
is successful or not, the next process after execution must be
continued, so there is no need to check the return value. If
hns3_cmd_init fails to execute, there will be corresponding log
information inside hns3_cmd_init.

This patch adds '(void)' Type conversion to avoid coverity warning.

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

Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
---
 drivers/net/hns3/hns3_intr.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/hns3/hns3_intr.c b/drivers/net/hns3/hns3_intr.c
index 9953a1d98..46d617c68 100644
--- a/drivers/net/hns3/hns3_intr.c
+++ b/drivers/net/hns3/hns3_intr.c
@@ -882,8 +882,14 @@ hns3_reset_err_handle(struct hns3_adapter *hns)
 		return true;
 	}
 
+	/*
+	 * Failure to reset does not mean that the network port is
+	 * completely unavailable, so cmd still needs to be initialized.
+	 * Regardless of whether the execution is successful or not, the
+	 * flow after execution must be continued.
+	 */
 	if (rte_atomic16_read(&hw->reset.disable_cmd))
-		hns3_cmd_init(hw);
+		(void)hns3_cmd_init(hw);
 reset_fail:
 	hw->reset.attempts = 0;
 	hw->reset.stats.fail_cnt++;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:49.694877763 +0100
+++ 0028-net-hns3-ignore-function-return-on-reset-error-path.patch	2020-07-24 12:53:48.215005118 +0100
@@ -1,8 +1,10 @@
-From 80cd38e1b530973926c007d65a84600e8c27740d Mon Sep 17 00:00:00 2001
+From 0596f4a6e1872526253528ae825e9340b849cf77 Mon Sep 17 00:00:00 2001
 From: Hongbo Zheng <zhenghongbo3@huawei.com>
 Date: Tue, 9 Jun 2020 16:44:15 +0800
 Subject: [PATCH] net/hns3: ignore function return on reset error path
 
+[ upstream commit 80cd38e1b530973926c007d65a84600e8c27740d ]
+
 There is a coverity defect related "Unchecked return value".
 
 The internal static hns3_reset_err_handle function is reset error
@@ -19,7 +21,6 @@
 
 Coverity issue: 349934
 Fixes: 2790c6464725 ("net/hns3: support device reset")
-Cc: stable@dpdk.org
 
 Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
 Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>

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

* [dpdk-stable] patch 'net/hns3: fix unintended sign extension in fd operation' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (26 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/hns3: ignore function return on reset error path' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/hns3: fix unintended sign extension in dump " luca.boccassi
                   ` (163 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Wei Hu (Xavier); +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 9cd77fe6e7ea86eeac5dc7f8eff407e3c14ec8dd Mon Sep 17 00:00:00 2001
From: "Wei Hu (Xavier)" <xavier.huwei@huawei.com>
Date: Tue, 9 Jun 2020 16:44:16 +0800
Subject: [PATCH] net/hns3: fix unintended sign extension in fd operation

[ upstream commit 5c471cb581ebd9a06918dbf5092f4228cc1e565e ]

Currently, there are coverity defects warning as below:

CID 349937 (#1 of 1): Unintended sign extension (SIGN_EXTENSION)
sign_extension: Suspicious implicit sign extension: port_number with
type uint16_t (16 bits, unsigned) is promoted in port_number << cur_pos
to type int (32 bits, signed), then sign-extended to type unsigned long
(64 bits, unsigned). If port_number << cur_pos is greater than
0x7FFFFFFF, the upper bits of the result will all be 1.

CID 349893 (#1 of 1): Unintended sign extension (SIGN_EXTENSION)
sign_extension: Suspicious implicit sign extension: vlan_tag with type
uint8_t (8 bits, unsigned) is promoted in vlan_tag << cur_pos to type
int (32 bits, signed), then sign-extended to type unsigned long (64
bits, unsigned). If vlan_tag << cur_pos is greater than 0x7FFFFFFF, the
upper bits of the result will all be 1.

This patch fixes them by replacing the data type of port_number and
vlan_tag with uint32_t in the inner static function named
hns3_fd_convert_meta_data of hns3 PMD driver.

Coverity issue: 349937, 349893
Fixes: fcba820d9b9e ("net/hns3: support flow director")

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
---
 drivers/net/hns3/hns3_fdir.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/hns3/hns3_fdir.c b/drivers/net/hns3/hns3_fdir.c
index 79f3f0d14..98a044f56 100644
--- a/drivers/net/hns3/hns3_fdir.c
+++ b/drivers/net/hns3/hns3_fdir.c
@@ -619,7 +619,7 @@ static void hns3_fd_convert_meta_data(struct hns3_fd_key_cfg *cfg,
 				      uint8_t *key_x, uint8_t *key_y)
 {
 	uint16_t meta_data = 0;
-	uint16_t port_number;
+	uint32_t port_number;
 	uint8_t cur_pos = 0;
 	uint8_t tuple_size;
 	uint8_t shift_bits;
@@ -637,7 +637,7 @@ static void hns3_fd_convert_meta_data(struct hns3_fd_key_cfg *cfg,
 				     rule->key_conf.spec.tunnel_type ? 1 : 0);
 			cur_pos += tuple_size;
 		} else if (i == VLAN_NUMBER) {
-			uint8_t vlan_tag;
+			uint32_t vlan_tag;
 			uint8_t vlan_num;
 			if (rule->key_conf.spec.tunnel_type == 0)
 				vlan_num = rule->key_conf.vlan_num;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:49.729579730 +0100
+++ 0029-net-hns3-fix-unintended-sign-extension-in-fd-operati.patch	2020-07-24 12:53:48.219005193 +0100
@@ -1,8 +1,10 @@
-From 5c471cb581ebd9a06918dbf5092f4228cc1e565e Mon Sep 17 00:00:00 2001
+From 9cd77fe6e7ea86eeac5dc7f8eff407e3c14ec8dd Mon Sep 17 00:00:00 2001
 From: "Wei Hu (Xavier)" <xavier.huwei@huawei.com>
 Date: Tue, 9 Jun 2020 16:44:16 +0800
 Subject: [PATCH] net/hns3: fix unintended sign extension in fd operation
 
+[ upstream commit 5c471cb581ebd9a06918dbf5092f4228cc1e565e ]
+
 Currently, there are coverity defects warning as below:
 
 CID 349937 (#1 of 1): Unintended sign extension (SIGN_EXTENSION)
@@ -25,7 +27,6 @@
 
 Coverity issue: 349937, 349893
 Fixes: fcba820d9b9e ("net/hns3: support flow director")
-Cc: stable@dpdk.org
 
 Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
 ---
@@ -33,7 +34,7 @@
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/net/hns3/hns3_fdir.c b/drivers/net/hns3/hns3_fdir.c
-index 7bc5bf831..6ab439d06 100644
+index 79f3f0d14..98a044f56 100644
 --- a/drivers/net/hns3/hns3_fdir.c
 +++ b/drivers/net/hns3/hns3_fdir.c
 @@ -619,7 +619,7 @@ static void hns3_fd_convert_meta_data(struct hns3_fd_key_cfg *cfg,

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

* [dpdk-stable] patch 'net/hns3: fix unintended sign extension in dump operation' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (27 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/hns3: fix unintended sign extension in fd operation' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/mlx5: fix typos in meter error messages' " luca.boccassi
                   ` (162 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Hongbo Zheng; +Cc: Wei Hu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 54161c5e70e1a93e8abee37f0ddd5a8021954a70 Mon Sep 17 00:00:00 2001
From: Hongbo Zheng <zhenghongbo3@huawei.com>
Date: Tue, 9 Jun 2020 16:44:17 +0800
Subject: [PATCH] net/hns3: fix unintended sign extension in dump operation

[ upstream commit 5045e2b25ab1ce9ded4023b60fda7489a2b06663 ]

There are coverity defects related "Unintended sign extension" in the
internal static function named hns3_get_regs_length used for dumping reg
operation.

This patch fixes them by replacing the data type of cmdq_lines,
common_lines, ring_lines and tqp_intr_lines with uint32_t in the inner
static function named hns3_get_regs_length of hns3 PMD driver.

Coverity issue: 349917, 349914
Fixes: 936eda25e8da ("net/hns3: support dump register")

Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
---
 drivers/net/hns3/hns3_regs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/hns3/hns3_regs.c b/drivers/net/hns3/hns3_regs.c
index a3f2a51f9..63c8602a8 100644
--- a/drivers/net/hns3/hns3_regs.c
+++ b/drivers/net/hns3/hns3_regs.c
@@ -116,7 +116,7 @@ static int
 hns3_get_regs_length(struct hns3_hw *hw, uint32_t *length)
 {
 	struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
-	int cmdq_lines, common_lines, ring_lines, tqp_intr_lines;
+	uint32_t cmdq_lines, common_lines, ring_lines, tqp_intr_lines;
 	uint32_t regs_num_32_bit, regs_num_64_bit;
 	uint32_t len;
 	int ret;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:49.767769770 +0100
+++ 0030-net-hns3-fix-unintended-sign-extension-in-dump-opera.patch	2020-07-24 12:53:48.219005193 +0100
@@ -1,8 +1,10 @@
-From 5045e2b25ab1ce9ded4023b60fda7489a2b06663 Mon Sep 17 00:00:00 2001
+From 54161c5e70e1a93e8abee37f0ddd5a8021954a70 Mon Sep 17 00:00:00 2001
 From: Hongbo Zheng <zhenghongbo3@huawei.com>
 Date: Tue, 9 Jun 2020 16:44:17 +0800
 Subject: [PATCH] net/hns3: fix unintended sign extension in dump operation
 
+[ upstream commit 5045e2b25ab1ce9ded4023b60fda7489a2b06663 ]
+
 There are coverity defects related "Unintended sign extension" in the
 internal static function named hns3_get_regs_length used for dumping reg
 operation.
@@ -13,7 +15,6 @@
 
 Coverity issue: 349917, 349914
 Fixes: 936eda25e8da ("net/hns3: support dump register")
-Cc: stable@dpdk.org
 
 Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
 Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>

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

* [dpdk-stable] patch 'net/mlx5: fix typos in meter error messages' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (28 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/hns3: fix unintended sign extension in dump " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/mlx5: do not select legacy MPW implicitly' " luca.boccassi
                   ` (161 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Ali Alnubani; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 4da73de47991612e4901a2a1c32578a38d267ad1 Mon Sep 17 00:00:00 2001
From: Ali Alnubani <alialnu@mellanox.com>
Date: Mon, 8 Jun 2020 17:02:57 +0300
Subject: [PATCH] net/mlx5: fix typos in meter error messages

[ upstream commit 3efac8085e2c596ce469b45349f85f2929b6aba4 ]

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

Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
 drivers/net/mlx5/mlx5_flow_meter.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_meter.c b/drivers/net/mlx5/mlx5_flow_meter.c
index c4d28b282..62e3a3590 100644
--- a/drivers/net/mlx5/mlx5_flow_meter.c
+++ b/drivers/net/mlx5/mlx5_flow_meter.c
@@ -301,7 +301,7 @@ mlx5_flow_mtr_cap_get(struct rte_eth_dev *dev,
 	if (!priv->mtr_en)
 		return -rte_mtr_error_set(error, ENOTSUP,
 					  RTE_MTR_ERROR_TYPE_UNSPECIFIED, NULL,
-					  "Meter is not support");
+					  "Meter is not supported");
 	memset(cap, 0, sizeof(*cap));
 	cap->n_max = 1 << qattr->log_max_flow_meter;
 	cap->n_shared_max = cap->n_max;
@@ -347,7 +347,7 @@ mlx5_flow_meter_profile_add(struct rte_eth_dev *dev,
 	if (!priv->mtr_en)
 		return -rte_mtr_error_set(error, ENOTSUP,
 					  RTE_MTR_ERROR_TYPE_UNSPECIFIED, NULL,
-					  "Meter is not support");
+					  "Meter is not supported");
 	/* Check input params. */
 	ret = mlx5_flow_meter_profile_validate(dev, meter_profile_id,
 					       profile, error);
@@ -400,19 +400,19 @@ mlx5_flow_meter_profile_delete(struct rte_eth_dev *dev,
 	if (!priv->mtr_en)
 		return -rte_mtr_error_set(error, ENOTSUP,
 					  RTE_MTR_ERROR_TYPE_UNSPECIFIED, NULL,
-					  "Meter is not support");
+					  "Meter is not supported");
 	/* Meter profile must exist. */
 	fmp = mlx5_flow_meter_profile_find(priv, meter_profile_id);
 	if (fmp == NULL)
 		return -rte_mtr_error_set(error, ENOENT,
 					  RTE_MTR_ERROR_TYPE_METER_PROFILE_ID,
 					  &meter_profile_id,
-					  "Meter profile id invalid.");
+					  "Meter profile id is invalid.");
 	/* Check profile is unused. */
 	if (fmp->ref_cnt)
 		return -rte_mtr_error_set(error, EBUSY,
 					  RTE_MTR_ERROR_TYPE_METER_PROFILE_ID,
-					  NULL, "Meter profile in use.");
+					  NULL, "Meter profile is in use.");
 	/* Remove from list. */
 	TAILQ_REMOVE(&priv->flow_meter_profiles, fmp, next);
 	rte_free(fmp);
@@ -633,7 +633,7 @@ mlx5_flow_meter_create(struct rte_eth_dev *dev, uint32_t meter_id,
 	if (!priv->mtr_en)
 		return -rte_mtr_error_set(error, ENOTSUP,
 					  RTE_MTR_ERROR_TYPE_UNSPECIFIED, NULL,
-					  "Meter is not support");
+					  "Meter is not supported");
 	/* Validate the parameters. */
 	ret = mlx5_flow_meter_validate(priv, meter_id, params, error);
 	if (ret)
@@ -718,7 +718,7 @@ mlx5_flow_meter_destroy(struct rte_eth_dev *dev, uint32_t meter_id,
 	if (!priv->mtr_en)
 		return -rte_mtr_error_set(error, ENOTSUP,
 					  RTE_MTR_ERROR_TYPE_UNSPECIFIED, NULL,
-					  "Meter is not support");
+					  "Meter is not supported");
 	/* Meter object must exist. */
 	fm = mlx5_flow_meter_find(priv, meter_id);
 	if (fm == NULL)
@@ -823,7 +823,7 @@ mlx5_flow_meter_enable(struct rte_eth_dev *dev,
 	if (!priv->mtr_en)
 		return -rte_mtr_error_set(error, ENOTSUP,
 					  RTE_MTR_ERROR_TYPE_UNSPECIFIED, NULL,
-					  "Meter is not support");
+					  "Meter is not supported");
 	/* Meter object must exist. */
 	fm = mlx5_flow_meter_find(priv, meter_id);
 	if (fm == NULL)
@@ -864,7 +864,7 @@ mlx5_flow_meter_disable(struct rte_eth_dev *dev,
 	if (!priv->mtr_en)
 		return -rte_mtr_error_set(error, ENOTSUP,
 					  RTE_MTR_ERROR_TYPE_UNSPECIFIED, NULL,
-					  "Meter is not support");
+					  "Meter is not supported");
 	/* Meter object must exist. */
 	fm = mlx5_flow_meter_find(priv, meter_id);
 	if (fm == NULL)
@@ -912,7 +912,7 @@ mlx5_flow_meter_profile_update(struct rte_eth_dev *dev,
 	if (!priv->mtr_en)
 		return -rte_mtr_error_set(error, ENOTSUP,
 					  RTE_MTR_ERROR_TYPE_UNSPECIFIED, NULL,
-					  "Meter is not support");
+					  "Meter is not supported");
 	/* Meter profile must exist. */
 	fmp = mlx5_flow_meter_profile_find(priv, meter_profile_id);
 	if (fmp == NULL)
@@ -975,7 +975,7 @@ mlx5_flow_meter_stats_update(struct rte_eth_dev *dev,
 	if (!priv->mtr_en)
 		return -rte_mtr_error_set(error, ENOTSUP,
 					  RTE_MTR_ERROR_TYPE_UNSPECIFIED, NULL,
-					  "Meter is not support");
+					  "Meter is not supported");
 	/* Meter object must exist. */
 	fm = mlx5_flow_meter_find(priv, meter_id);
 	if (fm == NULL)
@@ -1032,7 +1032,7 @@ mlx5_flow_meter_stats_read(struct rte_eth_dev *dev,
 	if (!priv->mtr_en)
 		return -rte_mtr_error_set(error, ENOTSUP,
 					  RTE_MTR_ERROR_TYPE_UNSPECIFIED, NULL,
-					  "Meter is not support");
+					  "Meter is not supported");
 	/* Meter object must exist. */
 	fm = mlx5_flow_meter_find(priv, meter_id);
 	if (fm == NULL)
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:49.801199843 +0100
+++ 0031-net-mlx5-fix-typos-in-meter-error-messages.patch	2020-07-24 12:53:48.219005193 +0100
@@ -1,10 +1,11 @@
-From 3efac8085e2c596ce469b45349f85f2929b6aba4 Mon Sep 17 00:00:00 2001
+From 4da73de47991612e4901a2a1c32578a38d267ad1 Mon Sep 17 00:00:00 2001
 From: Ali Alnubani <alialnu@mellanox.com>
 Date: Mon, 8 Jun 2020 17:02:57 +0300
 Subject: [PATCH] net/mlx5: fix typos in meter error messages
 
+[ upstream commit 3efac8085e2c596ce469b45349f85f2929b6aba4 ]
+
 Fixes: 3bd26b23cefc ("net/mlx5: support meter profile operations")
-Cc: stable@dpdk.org
 
 Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
 Acked-by: Matan Azrad <matan@mellanox.com>
@@ -13,10 +14,10 @@
  1 file changed, 12 insertions(+), 12 deletions(-)
 
 diff --git a/drivers/net/mlx5/mlx5_flow_meter.c b/drivers/net/mlx5/mlx5_flow_meter.c
-index 08f7dc8d1..86c334b08 100644
+index c4d28b282..62e3a3590 100644
 --- a/drivers/net/mlx5/mlx5_flow_meter.c
 +++ b/drivers/net/mlx5/mlx5_flow_meter.c
-@@ -303,7 +303,7 @@ mlx5_flow_mtr_cap_get(struct rte_eth_dev *dev,
+@@ -301,7 +301,7 @@ mlx5_flow_mtr_cap_get(struct rte_eth_dev *dev,
  	if (!priv->mtr_en)
  		return -rte_mtr_error_set(error, ENOTSUP,
  					  RTE_MTR_ERROR_TYPE_UNSPECIFIED, NULL,
@@ -25,7 +26,7 @@
  	memset(cap, 0, sizeof(*cap));
  	cap->n_max = 1 << qattr->log_max_flow_meter;
  	cap->n_shared_max = cap->n_max;
-@@ -349,7 +349,7 @@ mlx5_flow_meter_profile_add(struct rte_eth_dev *dev,
+@@ -347,7 +347,7 @@ mlx5_flow_meter_profile_add(struct rte_eth_dev *dev,
  	if (!priv->mtr_en)
  		return -rte_mtr_error_set(error, ENOTSUP,
  					  RTE_MTR_ERROR_TYPE_UNSPECIFIED, NULL,
@@ -34,7 +35,7 @@
  	/* Check input params. */
  	ret = mlx5_flow_meter_profile_validate(dev, meter_profile_id,
  					       profile, error);
-@@ -402,19 +402,19 @@ mlx5_flow_meter_profile_delete(struct rte_eth_dev *dev,
+@@ -400,19 +400,19 @@ mlx5_flow_meter_profile_delete(struct rte_eth_dev *dev,
  	if (!priv->mtr_en)
  		return -rte_mtr_error_set(error, ENOTSUP,
  					  RTE_MTR_ERROR_TYPE_UNSPECIFIED, NULL,
@@ -57,7 +58,7 @@
  	/* Remove from list. */
  	TAILQ_REMOVE(&priv->flow_meter_profiles, fmp, next);
  	rte_free(fmp);
-@@ -636,7 +636,7 @@ mlx5_flow_meter_create(struct rte_eth_dev *dev, uint32_t meter_id,
+@@ -633,7 +633,7 @@ mlx5_flow_meter_create(struct rte_eth_dev *dev, uint32_t meter_id,
  	if (!priv->mtr_en)
  		return -rte_mtr_error_set(error, ENOTSUP,
  					  RTE_MTR_ERROR_TYPE_UNSPECIFIED, NULL,
@@ -66,7 +67,7 @@
  	/* Validate the parameters. */
  	ret = mlx5_flow_meter_validate(priv, meter_id, params, error);
  	if (ret)
-@@ -723,7 +723,7 @@ mlx5_flow_meter_destroy(struct rte_eth_dev *dev, uint32_t meter_id,
+@@ -718,7 +718,7 @@ mlx5_flow_meter_destroy(struct rte_eth_dev *dev, uint32_t meter_id,
  	if (!priv->mtr_en)
  		return -rte_mtr_error_set(error, ENOTSUP,
  					  RTE_MTR_ERROR_TYPE_UNSPECIFIED, NULL,
@@ -75,7 +76,7 @@
  	/* Meter object must exist. */
  	fm = mlx5_flow_meter_find(priv, meter_id);
  	if (fm == NULL)
-@@ -828,7 +828,7 @@ mlx5_flow_meter_enable(struct rte_eth_dev *dev,
+@@ -823,7 +823,7 @@ mlx5_flow_meter_enable(struct rte_eth_dev *dev,
  	if (!priv->mtr_en)
  		return -rte_mtr_error_set(error, ENOTSUP,
  					  RTE_MTR_ERROR_TYPE_UNSPECIFIED, NULL,
@@ -84,7 +85,7 @@
  	/* Meter object must exist. */
  	fm = mlx5_flow_meter_find(priv, meter_id);
  	if (fm == NULL)
-@@ -869,7 +869,7 @@ mlx5_flow_meter_disable(struct rte_eth_dev *dev,
+@@ -864,7 +864,7 @@ mlx5_flow_meter_disable(struct rte_eth_dev *dev,
  	if (!priv->mtr_en)
  		return -rte_mtr_error_set(error, ENOTSUP,
  					  RTE_MTR_ERROR_TYPE_UNSPECIFIED, NULL,
@@ -93,7 +94,7 @@
  	/* Meter object must exist. */
  	fm = mlx5_flow_meter_find(priv, meter_id);
  	if (fm == NULL)
-@@ -917,7 +917,7 @@ mlx5_flow_meter_profile_update(struct rte_eth_dev *dev,
+@@ -912,7 +912,7 @@ mlx5_flow_meter_profile_update(struct rte_eth_dev *dev,
  	if (!priv->mtr_en)
  		return -rte_mtr_error_set(error, ENOTSUP,
  					  RTE_MTR_ERROR_TYPE_UNSPECIFIED, NULL,
@@ -102,7 +103,7 @@
  	/* Meter profile must exist. */
  	fmp = mlx5_flow_meter_profile_find(priv, meter_profile_id);
  	if (fmp == NULL)
-@@ -980,7 +980,7 @@ mlx5_flow_meter_stats_update(struct rte_eth_dev *dev,
+@@ -975,7 +975,7 @@ mlx5_flow_meter_stats_update(struct rte_eth_dev *dev,
  	if (!priv->mtr_en)
  		return -rte_mtr_error_set(error, ENOTSUP,
  					  RTE_MTR_ERROR_TYPE_UNSPECIFIED, NULL,
@@ -111,7 +112,7 @@
  	/* Meter object must exist. */
  	fm = mlx5_flow_meter_find(priv, meter_id);
  	if (fm == NULL)
-@@ -1037,7 +1037,7 @@ mlx5_flow_meter_stats_read(struct rte_eth_dev *dev,
+@@ -1032,7 +1032,7 @@ mlx5_flow_meter_stats_read(struct rte_eth_dev *dev,
  	if (!priv->mtr_en)
  		return -rte_mtr_error_set(error, ENOTSUP,
  					  RTE_MTR_ERROR_TYPE_UNSPECIFIED, NULL,

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

* [dpdk-stable] patch 'net/mlx5: do not select legacy MPW implicitly' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (29 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/mlx5: fix typos in meter error messages' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/mlx5: fix descriptors number adjustment' " luca.boccassi
                   ` (160 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Alexander Kozyrev; +Cc: Viacheslav Ovsiienko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From f0ba791d7bafa43caecac02748cb655529633c63 Mon Sep 17 00:00:00 2001
From: Alexander Kozyrev <akozyrev@mellanox.com>
Date: Thu, 11 Jun 2020 17:42:00 +0000
Subject: [PATCH] net/mlx5: do not select legacy MPW implicitly

[ upstream commit a23d96ae59e21f7b0ada43d2757a726fc565005a ]

The Legacy MPW (multi-packet write) should not be engaged implicitly.
We should exclude this function from a Tx burst routine selection
process unless it is requested specifically by setting the txq_mpw_en
devarg.  Exclude this function from the selection process the same way
it is done for the Enhanced MPW in the mlx5_select_tx_function()
routine.

Fixes: eb8121ab9dac ("net/mlx5: introduce Tx burst routine template")

Signed-off-by: Alexander Kozyrev <akozyrev@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
---
 drivers/net/mlx5/mlx5_rxtx.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index 488a87f59..90625e71f 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -5365,6 +5365,9 @@ mlx5_select_tx_function(struct rte_eth_dev *dev)
 			/* Does not meet requested offloads at all. */
 			continue;
 		}
+		if ((olx ^ tmp) & MLX5_TXOFF_CONFIG_MPW)
+			/* Do not enable legacy MPW if not configured. */
+			continue;
 		if ((olx ^ tmp) & MLX5_TXOFF_CONFIG_EMPW)
 			/* Do not enable eMPW if not configured. */
 			continue;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:49.835804063 +0100
+++ 0032-net-mlx5-do-not-select-legacy-MPW-implicitly.patch	2020-07-24 12:53:48.223005267 +0100
@@ -1,8 +1,10 @@
-From a23d96ae59e21f7b0ada43d2757a726fc565005a Mon Sep 17 00:00:00 2001
+From f0ba791d7bafa43caecac02748cb655529633c63 Mon Sep 17 00:00:00 2001
 From: Alexander Kozyrev <akozyrev@mellanox.com>
 Date: Thu, 11 Jun 2020 17:42:00 +0000
 Subject: [PATCH] net/mlx5: do not select legacy MPW implicitly
 
+[ upstream commit a23d96ae59e21f7b0ada43d2757a726fc565005a ]
+
 The Legacy MPW (multi-packet write) should not be engaged implicitly.
 We should exclude this function from a Tx burst routine selection
 process unless it is requested specifically by setting the txq_mpw_en
@@ -11,7 +13,6 @@
 routine.
 
 Fixes: eb8121ab9dac ("net/mlx5: introduce Tx burst routine template")
-Cc: stable@dpdk.org
 
 Signed-off-by: Alexander Kozyrev <akozyrev@mellanox.com>
 Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
@@ -20,10 +21,10 @@
  1 file changed, 3 insertions(+)
 
 diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
-index 22cdf1518..4d67925e5 100644
+index 488a87f59..90625e71f 100644
 --- a/drivers/net/mlx5/mlx5_rxtx.c
 +++ b/drivers/net/mlx5/mlx5_rxtx.c
-@@ -5542,6 +5542,9 @@ mlx5_select_tx_function(struct rte_eth_dev *dev)
+@@ -5365,6 +5365,9 @@ mlx5_select_tx_function(struct rte_eth_dev *dev)
  			/* Does not meet requested offloads at all. */
  			continue;
  		}

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

* [dpdk-stable] patch 'net/mlx5: fix descriptors number adjustment' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (30 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/mlx5: do not select legacy MPW implicitly' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/mlx5: fix LRO checksum' " luca.boccassi
                   ` (159 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Alexander Kozyrev; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 999f56858138a9766168e75b0f72f27f4925cb49 Mon Sep 17 00:00:00 2001
From: Alexander Kozyrev <akozyrev@mellanox.com>
Date: Thu, 11 Jun 2020 17:43:27 +0000
Subject: [PATCH] net/mlx5: fix descriptors number adjustment

[ upstream commit e891b54a9ea4e52631def99314e9ea0f47cb7352 ]

The number of descriptors to configure in a Rx/Tx queue is passed to
the mlx5_tx/rx_queue_pre_setup() function by value. That means any
adjustments of this variable are local and cannot affect the actual
value that is used to allocate mbufs in the mlx5_txq/rxq_new()
functions. Pass the number as a reference to actually update it.

Fixes: 6218063b39a6 ("net/mlx5: refactor Rx data path")
Fixes: 1d88ba171942 ("net/mlx5: refactor Tx data path")

Signed-off-by: Alexander Kozyrev <akozyrev@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
 drivers/net/mlx5/mlx5_rxq.c | 14 +++++++-------
 drivers/net/mlx5/mlx5_txq.c | 22 +++++++++++-----------
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 2b6ab21b9..baa868360 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -446,19 +446,19 @@ mlx5_rxq_releasable(struct rte_eth_dev *dev, uint16_t idx)
  *   0 on success, a negative errno value otherwise and rte_errno is set.
  */
 static int
-mlx5_rx_queue_pre_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc)
+mlx5_rx_queue_pre_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t *desc)
 {
 	struct mlx5_priv *priv = dev->data->dev_private;
 
-	if (!rte_is_power_of_2(desc)) {
-		desc = 1 << log2above(desc);
+	if (!rte_is_power_of_2(*desc)) {
+		*desc = 1 << log2above(*desc);
 		DRV_LOG(WARNING,
 			"port %u increased number of descriptors in Rx queue %u"
 			" to the next power of two (%d)",
-			dev->data->port_id, idx, desc);
+			dev->data->port_id, idx, *desc);
 	}
 	DRV_LOG(DEBUG, "port %u configuring Rx queue %u for %u descriptors",
-		dev->data->port_id, idx, desc);
+		dev->data->port_id, idx, *desc);
 	if (idx >= priv->rxqs_n) {
 		DRV_LOG(ERR, "port %u Rx queue index out of range (%u >= %u)",
 			dev->data->port_id, idx, priv->rxqs_n);
@@ -504,7 +504,7 @@ mlx5_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,
 		container_of(rxq, struct mlx5_rxq_ctrl, rxq);
 	int res;
 
-	res = mlx5_rx_queue_pre_setup(dev, idx, desc);
+	res = mlx5_rx_queue_pre_setup(dev, idx, &desc);
 	if (res)
 		return res;
 	rxq_ctrl = mlx5_rxq_new(dev, idx, desc, socket, conf, mp);
@@ -545,7 +545,7 @@ mlx5_rx_hairpin_queue_setup(struct rte_eth_dev *dev, uint16_t idx,
 		container_of(rxq, struct mlx5_rxq_ctrl, rxq);
 	int res;
 
-	res = mlx5_rx_queue_pre_setup(dev, idx, desc);
+	res = mlx5_rx_queue_pre_setup(dev, idx, &desc);
 	if (res)
 		return res;
 	if (hairpin_conf->peer_count != 1 ||
diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
index 1947e15f6..ff1e4fc85 100644
--- a/drivers/net/mlx5/mlx5_txq.c
+++ b/drivers/net/mlx5/mlx5_txq.c
@@ -147,27 +147,27 @@ mlx5_get_tx_port_offloads(struct rte_eth_dev *dev)
  *   0 on success, a negative errno value otherwise and rte_errno is set.
  */
 static int
-mlx5_tx_queue_pre_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc)
+mlx5_tx_queue_pre_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t *desc)
 {
 	struct mlx5_priv *priv = dev->data->dev_private;
 
-	if (desc <= MLX5_TX_COMP_THRESH) {
+	if (*desc <= MLX5_TX_COMP_THRESH) {
 		DRV_LOG(WARNING,
 			"port %u number of descriptors requested for Tx queue"
 			" %u must be higher than MLX5_TX_COMP_THRESH, using %u"
-			" instead of %u",
-			dev->data->port_id, idx, MLX5_TX_COMP_THRESH + 1, desc);
-		desc = MLX5_TX_COMP_THRESH + 1;
+			" instead of %u", dev->data->port_id, idx,
+			MLX5_TX_COMP_THRESH + 1, *desc);
+		*desc = MLX5_TX_COMP_THRESH + 1;
 	}
-	if (!rte_is_power_of_2(desc)) {
-		desc = 1 << log2above(desc);
+	if (!rte_is_power_of_2(*desc)) {
+		*desc = 1 << log2above(*desc);
 		DRV_LOG(WARNING,
 			"port %u increased number of descriptors in Tx queue"
 			" %u to the next power of two (%d)",
-			dev->data->port_id, idx, desc);
+			dev->data->port_id, idx, *desc);
 	}
 	DRV_LOG(DEBUG, "port %u configuring queue %u for %u descriptors",
-		dev->data->port_id, idx, desc);
+		dev->data->port_id, idx, *desc);
 	if (idx >= priv->txqs_n) {
 		DRV_LOG(ERR, "port %u Tx queue index out of range (%u >= %u)",
 			dev->data->port_id, idx, priv->txqs_n);
@@ -210,7 +210,7 @@ mlx5_tx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,
 		container_of(txq, struct mlx5_txq_ctrl, txq);
 	int res;
 
-	res = mlx5_tx_queue_pre_setup(dev, idx, desc);
+	res = mlx5_tx_queue_pre_setup(dev, idx, &desc);
 	if (res)
 		return res;
 	txq_ctrl = mlx5_txq_new(dev, idx, desc, socket, conf);
@@ -251,7 +251,7 @@ mlx5_tx_hairpin_queue_setup(struct rte_eth_dev *dev, uint16_t idx,
 		container_of(txq, struct mlx5_txq_ctrl, txq);
 	int res;
 
-	res = mlx5_tx_queue_pre_setup(dev, idx, desc);
+	res = mlx5_tx_queue_pre_setup(dev, idx, &desc);
 	if (res)
 		return res;
 	if (hairpin_conf->peer_count != 1 ||
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:49.871247065 +0100
+++ 0033-net-mlx5-fix-descriptors-number-adjustment.patch	2020-07-24 12:53:48.227005342 +0100
@@ -1,8 +1,10 @@
-From e891b54a9ea4e52631def99314e9ea0f47cb7352 Mon Sep 17 00:00:00 2001
+From 999f56858138a9766168e75b0f72f27f4925cb49 Mon Sep 17 00:00:00 2001
 From: Alexander Kozyrev <akozyrev@mellanox.com>
 Date: Thu, 11 Jun 2020 17:43:27 +0000
 Subject: [PATCH] net/mlx5: fix descriptors number adjustment
 
+[ upstream commit e891b54a9ea4e52631def99314e9ea0f47cb7352 ]
+
 The number of descriptors to configure in a Rx/Tx queue is passed to
 the mlx5_tx/rx_queue_pre_setup() function by value. That means any
 adjustments of this variable are local and cannot affect the actual
@@ -11,7 +13,6 @@
 
 Fixes: 6218063b39a6 ("net/mlx5: refactor Rx data path")
 Fixes: 1d88ba171942 ("net/mlx5: refactor Tx data path")
-Cc: stable@dpdk.org
 
 Signed-off-by: Alexander Kozyrev <akozyrev@mellanox.com>
 Acked-by: Matan Azrad <matan@mellanox.com>
@@ -21,10 +22,10 @@
  2 files changed, 18 insertions(+), 18 deletions(-)
 
 diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
-index 78046fd86..dda0073c8 100644
+index 2b6ab21b9..baa868360 100644
 --- a/drivers/net/mlx5/mlx5_rxq.c
 +++ b/drivers/net/mlx5/mlx5_rxq.c
-@@ -453,19 +453,19 @@ mlx5_rxq_releasable(struct rte_eth_dev *dev, uint16_t idx)
+@@ -446,19 +446,19 @@ mlx5_rxq_releasable(struct rte_eth_dev *dev, uint16_t idx)
   *   0 on success, a negative errno value otherwise and rte_errno is set.
   */
  static int
@@ -49,7 +50,7 @@
  	if (idx >= priv->rxqs_n) {
  		DRV_LOG(ERR, "port %u Rx queue index out of range (%u >= %u)",
  			dev->data->port_id, idx, priv->rxqs_n);
-@@ -511,7 +511,7 @@ mlx5_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,
+@@ -504,7 +504,7 @@ mlx5_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,
  		container_of(rxq, struct mlx5_rxq_ctrl, rxq);
  	int res;
  
@@ -58,7 +59,7 @@
  	if (res)
  		return res;
  	rxq_ctrl = mlx5_rxq_new(dev, idx, desc, socket, conf, mp);
-@@ -552,7 +552,7 @@ mlx5_rx_hairpin_queue_setup(struct rte_eth_dev *dev, uint16_t idx,
+@@ -545,7 +545,7 @@ mlx5_rx_hairpin_queue_setup(struct rte_eth_dev *dev, uint16_t idx,
  		container_of(rxq, struct mlx5_rxq_ctrl, rxq);
  	int res;
  
@@ -68,10 +69,10 @@
  		return res;
  	if (hairpin_conf->peer_count != 1 ||
 diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
-index 507febffc..35b3ade86 100644
+index 1947e15f6..ff1e4fc85 100644
 --- a/drivers/net/mlx5/mlx5_txq.c
 +++ b/drivers/net/mlx5/mlx5_txq.c
-@@ -150,27 +150,27 @@ mlx5_get_tx_port_offloads(struct rte_eth_dev *dev)
+@@ -147,27 +147,27 @@ mlx5_get_tx_port_offloads(struct rte_eth_dev *dev)
   *   0 on success, a negative errno value otherwise and rte_errno is set.
   */
  static int
@@ -108,7 +109,7 @@
  	if (idx >= priv->txqs_n) {
  		DRV_LOG(ERR, "port %u Tx queue index out of range (%u >= %u)",
  			dev->data->port_id, idx, priv->txqs_n);
-@@ -213,7 +213,7 @@ mlx5_tx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,
+@@ -210,7 +210,7 @@ mlx5_tx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,
  		container_of(txq, struct mlx5_txq_ctrl, txq);
  	int res;
  
@@ -117,7 +118,7 @@
  	if (res)
  		return res;
  	txq_ctrl = mlx5_txq_new(dev, idx, desc, socket, conf);
-@@ -254,7 +254,7 @@ mlx5_tx_hairpin_queue_setup(struct rte_eth_dev *dev, uint16_t idx,
+@@ -251,7 +251,7 @@ mlx5_tx_hairpin_queue_setup(struct rte_eth_dev *dev, uint16_t idx,
  		container_of(txq, struct mlx5_txq_ctrl, txq);
  	int res;
  

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

* [dpdk-stable] patch 'net/mlx5: fix LRO checksum' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (31 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/mlx5: fix descriptors number adjustment' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/ice/base: fix return value' " luca.boccassi
                   ` (158 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Dong Zhou; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From caedd7c3682922aeb7b3ba7747655da90cc8dac4 Mon Sep 17 00:00:00 2001
From: Dong Zhou <dongz@mellanox.com>
Date: Fri, 12 Jun 2020 11:57:46 +0300
Subject: [PATCH] net/mlx5: fix LRO checksum

[ upstream commit eb10fe7fb150d3a9c1ef01134403f85890d5e06e ]

The TCP checksum includes IPV4 pseudo-header checksum and L3
payload checksum which include TCP header and TCP payload.
When mlx5 LRO is enabled, HW will calculate the TCP payload
checksum, PMD need complete the IPV4 pseudo-header checksum
and the TCP header checksum.

The mlx5_lro_update_tcp_hdr function completes the TCP header
checksum, but this function using lower 4 bits of data-offset
field in TCP header to get the whole TCP header length, this
will cause TCP header checksum wrong calculation.

Update the code using higher 4 bits of data-offset field
instead of lower 4 bits.

Fixes: e4c2a16eb1de ("net/mlx5: handle LRO packets in Rx queue")

Signed-off-by: Dong Zhou <dongz@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
 drivers/net/mlx5/mlx5_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index 90625e71f..a9c618128 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -1439,7 +1439,7 @@ mlx5_lro_update_tcp_hdr(struct rte_tcp_hdr *restrict tcp,
 	if (cqe->lro_tcppsh_abort_dupack & MLX5_CQE_LRO_PUSH_MASK)
 		tcp->tcp_flags |= RTE_TCP_PSH_FLAG;
 	tcp->cksum = 0;
-	csum += rte_raw_cksum(tcp, (tcp->data_off & 0xF) * 4);
+	csum += rte_raw_cksum(tcp, (tcp->data_off >> 4) * 4);
 	csum = ((csum & 0xffff0000) >> 16) + (csum & 0xffff);
 	csum = (~csum) & 0xffff;
 	if (csum == 0)
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:49.914474559 +0100
+++ 0034-net-mlx5-fix-LRO-checksum.patch	2020-07-24 12:53:48.231005416 +0100
@@ -1,8 +1,10 @@
-From eb10fe7fb150d3a9c1ef01134403f85890d5e06e Mon Sep 17 00:00:00 2001
+From caedd7c3682922aeb7b3ba7747655da90cc8dac4 Mon Sep 17 00:00:00 2001
 From: Dong Zhou <dongz@mellanox.com>
 Date: Fri, 12 Jun 2020 11:57:46 +0300
 Subject: [PATCH] net/mlx5: fix LRO checksum
 
+[ upstream commit eb10fe7fb150d3a9c1ef01134403f85890d5e06e ]
+
 The TCP checksum includes IPV4 pseudo-header checksum and L3
 payload checksum which include TCP header and TCP payload.
 When mlx5 LRO is enabled, HW will calculate the TCP payload
@@ -18,7 +20,6 @@
 instead of lower 4 bits.
 
 Fixes: e4c2a16eb1de ("net/mlx5: handle LRO packets in Rx queue")
-Cc: stable@dpdk.org
 
 Signed-off-by: Dong Zhou <dongz@mellanox.com>
 Acked-by: Matan Azrad <matan@mellanox.com>
@@ -27,10 +28,10 @@
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
-index 4d67925e5..e4106bf0a 100644
+index 90625e71f..a9c618128 100644
 --- a/drivers/net/mlx5/mlx5_rxtx.c
 +++ b/drivers/net/mlx5/mlx5_rxtx.c
-@@ -1529,7 +1529,7 @@ mlx5_lro_update_tcp_hdr(struct rte_tcp_hdr *restrict tcp,
+@@ -1439,7 +1439,7 @@ mlx5_lro_update_tcp_hdr(struct rte_tcp_hdr *restrict tcp,
  	if (cqe->lro_tcppsh_abort_dupack & MLX5_CQE_LRO_PUSH_MASK)
  		tcp->tcp_flags |= RTE_TCP_PSH_FLAG;
  	tcp->cksum = 0;

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

* [dpdk-stable] patch 'net/ice/base: fix return value' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (32 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/mlx5: fix LRO checksum' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/ice/base: fix memory leak on error path' " luca.boccassi
                   ` (157 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Qi Zhang; +Cc: Kiran Patil, Paul M Stillwell Jr, Qiming Yang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 91525a17efb3b86a0c153bf9246f4e2a0214add3 Mon Sep 17 00:00:00 2001
From: Qi Zhang <qi.z.zhang@intel.com>
Date: Mon, 15 Jun 2020 10:04:57 +0800
Subject: [PATCH] net/ice/base: fix return value

[ upstream commit 4f13a6735fd60587c9c6ae93414b6df01c833214 ]

Function ice_rem_adv_rule_id return incorrect error code (ICE_ERR_PARAM)
whereas it should have returned ICE_ERR_DOES_NOT_EXIST return code
if filter list is empty or unable to find "rule" in list

Fixes: f89aa3affa9e ("net/ice/base: support removing advanced rule")

Signed-off-by: Kiran Patil <kiran.patil@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
---
 drivers/net/ice/base/ice_switch.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c
index 34d0a164e..72b04f84f 100644
--- a/drivers/net/ice/base/ice_switch.c
+++ b/drivers/net/ice/base/ice_switch.c
@@ -6487,7 +6487,8 @@ ice_rem_adv_rule_by_id(struct ice_hw *hw,
 						list_itr->lkups_cnt, &rinfo);
 		}
 	}
-	return ICE_ERR_PARAM;
+	/* either list is empty or unable to find rule */
+	return ICE_ERR_DOES_NOT_EXIST;
 }
 
 /**
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:49.960154745 +0100
+++ 0035-net-ice-base-fix-return-value.patch	2020-07-24 12:53:48.239005565 +0100
@@ -1,14 +1,15 @@
-From 4f13a6735fd60587c9c6ae93414b6df01c833214 Mon Sep 17 00:00:00 2001
+From 91525a17efb3b86a0c153bf9246f4e2a0214add3 Mon Sep 17 00:00:00 2001
 From: Qi Zhang <qi.z.zhang@intel.com>
 Date: Mon, 15 Jun 2020 10:04:57 +0800
 Subject: [PATCH] net/ice/base: fix return value
 
+[ upstream commit 4f13a6735fd60587c9c6ae93414b6df01c833214 ]
+
 Function ice_rem_adv_rule_id return incorrect error code (ICE_ERR_PARAM)
 whereas it should have returned ICE_ERR_DOES_NOT_EXIST return code
 if filter list is empty or unable to find "rule" in list
 
 Fixes: f89aa3affa9e ("net/ice/base: support removing advanced rule")
-Cc: stable@dpdk.org
 
 Signed-off-by: Kiran Patil <kiran.patil@intel.com>
 Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
@@ -19,10 +20,10 @@
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c
-index 01dcace55..5c53b9ec3 100644
+index 34d0a164e..72b04f84f 100644
 --- a/drivers/net/ice/base/ice_switch.c
 +++ b/drivers/net/ice/base/ice_switch.c
-@@ -7661,7 +7661,8 @@ ice_rem_adv_rule_by_id(struct ice_hw *hw,
+@@ -6487,7 +6487,8 @@ ice_rem_adv_rule_by_id(struct ice_hw *hw,
  						list_itr->lkups_cnt, &rinfo);
  		}
  	}

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

* [dpdk-stable] patch 'net/ice/base: fix memory leak on error path' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (33 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/ice/base: fix return value' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/ice/base: fix reference count on VSI list update' " luca.boccassi
                   ` (156 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Qi Zhang; +Cc: Surabhi Boob, Paul M Stillwell Jr, Qiming Yang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 26c98b7ec335eb0e3e1d0146e798e53f88f36b0d Mon Sep 17 00:00:00 2001
From: Qi Zhang <qi.z.zhang@intel.com>
Date: Mon, 15 Jun 2020 10:04:59 +0800
Subject: [PATCH] net/ice/base: fix memory leak on error path

[ upstream commit be45049b3c4340499dad5648f455f7b443975671 ]

Handles memory leaks during control queue initialization and
buffer allocation failures. The MACRO - ICE_FREE_CQ_BUFS is modified to
re-use for this fix.

Fixes: 6c1f26be50a2 ("net/ice/base: add control queue information")

Signed-off-by: Surabhi Boob <surabhi.boob@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
---
 drivers/net/ice/base/ice_controlq.c | 39 ++++++++++++++++++-----------
 1 file changed, 24 insertions(+), 15 deletions(-)

diff --git a/drivers/net/ice/base/ice_controlq.c b/drivers/net/ice/base/ice_controlq.c
index feffb5198..0b651e7db 100644
--- a/drivers/net/ice/base/ice_controlq.c
+++ b/drivers/net/ice/base/ice_controlq.c
@@ -180,7 +180,9 @@ unwind_alloc_rq_bufs:
 	i--;
 	for (; i >= 0; i--)
 		ice_free_dma_mem(hw, &cq->rq.r.rq_bi[i]);
+	cq->rq.r.rq_bi = NULL;
 	ice_free(hw, cq->rq.dma_head);
+	cq->rq.dma_head = NULL;
 
 	return ICE_ERR_NO_MEMORY;
 }
@@ -218,7 +220,9 @@ unwind_alloc_sq_bufs:
 	i--;
 	for (; i >= 0; i--)
 		ice_free_dma_mem(hw, &cq->sq.r.sq_bi[i]);
+	cq->sq.r.sq_bi = NULL;
 	ice_free(hw, cq->sq.dma_head);
+	cq->sq.dma_head = NULL;
 
 	return ICE_ERR_NO_MEMORY;
 }
@@ -277,6 +281,24 @@ ice_cfg_rq_regs(struct ice_hw *hw, struct ice_ctl_q_info *cq)
 	return ICE_SUCCESS;
 }
 
+#define ICE_FREE_CQ_BUFS(hw, qi, ring)					\
+do {									\
+	/* free descriptors */						\
+	if ((qi)->ring.r.ring##_bi) {					\
+		int i;							\
+									\
+		for (i = 0; i < (qi)->num_##ring##_entries; i++)	\
+			if ((qi)->ring.r.ring##_bi[i].pa)		\
+				ice_free_dma_mem((hw),			\
+					&(qi)->ring.r.ring##_bi[i]);	\
+	}								\
+	/* free the buffer info list */					\
+	if ((qi)->ring.cmd_buf)						\
+		ice_free(hw, (qi)->ring.cmd_buf);			\
+	/* free DMA head */						\
+	ice_free(hw, (qi)->ring.dma_head);				\
+} while (0)
+
 /**
  * ice_init_sq - main initialization routine for Control ATQ
  * @hw: pointer to the hardware structure
@@ -332,6 +354,7 @@ static enum ice_status ice_init_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq)
 	goto init_ctrlq_exit;
 
 init_ctrlq_free_rings:
+	ICE_FREE_CQ_BUFS(hw, cq, sq);
 	ice_free_cq_ring(hw, &cq->sq);
 
 init_ctrlq_exit:
@@ -393,27 +416,13 @@ static enum ice_status ice_init_rq(struct ice_hw *hw, struct ice_ctl_q_info *cq)
 	goto init_ctrlq_exit;
 
 init_ctrlq_free_rings:
+	ICE_FREE_CQ_BUFS(hw, cq, rq);
 	ice_free_cq_ring(hw, &cq->rq);
 
 init_ctrlq_exit:
 	return ret_code;
 }
 
-#define ICE_FREE_CQ_BUFS(hw, qi, ring)					\
-do {									\
-	int i;								\
-	/* free descriptors */						\
-	for (i = 0; i < (qi)->num_##ring##_entries; i++)		\
-		if ((qi)->ring.r.ring##_bi[i].pa)			\
-			ice_free_dma_mem((hw),				\
-					 &(qi)->ring.r.ring##_bi[i]);	\
-	/* free the buffer info list */					\
-	if ((qi)->ring.cmd_buf)						\
-		ice_free(hw, (qi)->ring.cmd_buf);			\
-	/* free DMA head */						\
-	ice_free(hw, (qi)->ring.dma_head);				\
-} while (0)
-
 /**
  * ice_shutdown_sq - shutdown the Control ATQ
  * @hw: pointer to the hardware structure
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:50.001747359 +0100
+++ 0036-net-ice-base-fix-memory-leak-on-error-path.patch	2020-07-24 12:53:48.239005565 +0100
@@ -1,14 +1,15 @@
-From be45049b3c4340499dad5648f455f7b443975671 Mon Sep 17 00:00:00 2001
+From 26c98b7ec335eb0e3e1d0146e798e53f88f36b0d Mon Sep 17 00:00:00 2001
 From: Qi Zhang <qi.z.zhang@intel.com>
 Date: Mon, 15 Jun 2020 10:04:59 +0800
 Subject: [PATCH] net/ice/base: fix memory leak on error path
 
+[ upstream commit be45049b3c4340499dad5648f455f7b443975671 ]
+
 Handles memory leaks during control queue initialization and
 buffer allocation failures. The MACRO - ICE_FREE_CQ_BUFS is modified to
 re-use for this fix.
 
 Fixes: 6c1f26be50a2 ("net/ice/base: add control queue information")
-Cc: stable@dpdk.org
 
 Signed-off-by: Surabhi Boob <surabhi.boob@intel.com>
 Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
@@ -19,10 +20,10 @@
  1 file changed, 24 insertions(+), 15 deletions(-)
 
 diff --git a/drivers/net/ice/base/ice_controlq.c b/drivers/net/ice/base/ice_controlq.c
-index 3ef86fa03..f278ef636 100644
+index feffb5198..0b651e7db 100644
 --- a/drivers/net/ice/base/ice_controlq.c
 +++ b/drivers/net/ice/base/ice_controlq.c
-@@ -182,7 +182,9 @@ unwind_alloc_rq_bufs:
+@@ -180,7 +180,9 @@ unwind_alloc_rq_bufs:
  	i--;
  	for (; i >= 0; i--)
  		ice_free_dma_mem(hw, &cq->rq.r.rq_bi[i]);
@@ -32,7 +33,7 @@
  
  	return ICE_ERR_NO_MEMORY;
  }
-@@ -220,7 +222,9 @@ unwind_alloc_sq_bufs:
+@@ -218,7 +220,9 @@ unwind_alloc_sq_bufs:
  	i--;
  	for (; i >= 0; i--)
  		ice_free_dma_mem(hw, &cq->sq.r.sq_bi[i]);
@@ -42,7 +43,7 @@
  
  	return ICE_ERR_NO_MEMORY;
  }
-@@ -279,6 +283,24 @@ ice_cfg_rq_regs(struct ice_hw *hw, struct ice_ctl_q_info *cq)
+@@ -277,6 +281,24 @@ ice_cfg_rq_regs(struct ice_hw *hw, struct ice_ctl_q_info *cq)
  	return ICE_SUCCESS;
  }
  
@@ -67,7 +68,7 @@
  /**
   * ice_init_sq - main initialization routine for Control ATQ
   * @hw: pointer to the hardware structure
-@@ -334,6 +356,7 @@ static enum ice_status ice_init_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq)
+@@ -332,6 +354,7 @@ static enum ice_status ice_init_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq)
  	goto init_ctrlq_exit;
  
  init_ctrlq_free_rings:
@@ -75,7 +76,7 @@
  	ice_free_cq_ring(hw, &cq->sq);
  
  init_ctrlq_exit:
-@@ -395,27 +418,13 @@ static enum ice_status ice_init_rq(struct ice_hw *hw, struct ice_ctl_q_info *cq)
+@@ -393,27 +416,13 @@ static enum ice_status ice_init_rq(struct ice_hw *hw, struct ice_ctl_q_info *cq)
  	goto init_ctrlq_exit;
  
  init_ctrlq_free_rings:

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

* [dpdk-stable] patch 'net/ice/base: fix reference count on VSI list update' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (34 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/ice/base: fix memory leak on error path' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/ice/base: fix initializing resource for field vector' " luca.boccassi
                   ` (155 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Qi Zhang; +Cc: Wei Zhao, Paul M Stillwell Jr, Qiming Yang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From c92e3b5e69b907b1739bde61184459e4e31301c6 Mon Sep 17 00:00:00 2001
From: Qi Zhang <qi.z.zhang@intel.com>
Date: Mon, 15 Jun 2020 10:05:09 +0800
Subject: [PATCH] net/ice/base: fix reference count on VSI list update

[ upstream commit fda75f4c409917112b1a9694ce9969187bcfb779 ]

The parameter ref_cnt is used for tracking how many
rules are reusing this VSI list, so it can only be
updated when a rule which using this list be deleted.

Fixes: f89aa3affa9e ("net/ice/base: support removing advanced rule")

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
---
 drivers/net/ice/base/ice_switch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c
index 72b04f84f..940e4ce40 100644
--- a/drivers/net/ice/base/ice_switch.c
+++ b/drivers/net/ice/base/ice_switch.c
@@ -6333,6 +6333,7 @@ ice_adv_rem_update_vsi_list(struct ice_hw *hw, u16 vsi_handle,
 				  tmp_fltr.fwd_id.hw_vsi_id, status);
 			return status;
 		}
+		fm_list->vsi_list_info->ref_cnt--;
 
 		/* Remove the VSI list since it is no longer used */
 		status = ice_remove_vsi_list_rule(hw, vsi_list_id, lkup_type);
@@ -6411,7 +6412,6 @@ ice_rem_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
 	if (list_elem->rule_info.sw_act.fltr_act != ICE_FWD_TO_VSI_LIST) {
 		remove_rule = true;
 	} else if (list_elem->vsi_count > 1) {
-		list_elem->vsi_list_info->ref_cnt--;
 		remove_rule = false;
 		vsi_handle = rinfo->sw_act.vsi_handle;
 		status = ice_adv_rem_update_vsi_list(hw, vsi_handle, list_elem);
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:50.044016631 +0100
+++ 0037-net-ice-base-fix-reference-count-on-VSI-list-update.patch	2020-07-24 12:53:48.247005714 +0100
@@ -1,14 +1,15 @@
-From fda75f4c409917112b1a9694ce9969187bcfb779 Mon Sep 17 00:00:00 2001
+From c92e3b5e69b907b1739bde61184459e4e31301c6 Mon Sep 17 00:00:00 2001
 From: Qi Zhang <qi.z.zhang@intel.com>
 Date: Mon, 15 Jun 2020 10:05:09 +0800
 Subject: [PATCH] net/ice/base: fix reference count on VSI list update
 
+[ upstream commit fda75f4c409917112b1a9694ce9969187bcfb779 ]
+
 The parameter ref_cnt is used for tracking how many
 rules are reusing this VSI list, so it can only be
 updated when a rule which using this list be deleted.
 
 Fixes: f89aa3affa9e ("net/ice/base: support removing advanced rule")
-Cc: stable@dpdk.org
 
 Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
 Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
@@ -19,10 +20,10 @@
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c
-index 84102368b..9c7e55ff9 100644
+index 72b04f84f..940e4ce40 100644
 --- a/drivers/net/ice/base/ice_switch.c
 +++ b/drivers/net/ice/base/ice_switch.c
-@@ -7488,6 +7488,7 @@ ice_adv_rem_update_vsi_list(struct ice_hw *hw, u16 vsi_handle,
+@@ -6333,6 +6333,7 @@ ice_adv_rem_update_vsi_list(struct ice_hw *hw, u16 vsi_handle,
  				  tmp_fltr.fwd_id.hw_vsi_id, status);
  			return status;
  		}
@@ -30,7 +31,7 @@
  
  		/* Remove the VSI list since it is no longer used */
  		status = ice_remove_vsi_list_rule(hw, vsi_list_id, lkup_type);
-@@ -7566,7 +7567,6 @@ ice_rem_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
+@@ -6411,7 +6412,6 @@ ice_rem_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
  	if (list_elem->rule_info.sw_act.fltr_act != ICE_FWD_TO_VSI_LIST) {
  		remove_rule = true;
  	} else if (list_elem->vsi_count > 1) {

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

* [dpdk-stable] patch 'net/ice/base: fix initializing resource for field vector' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (35 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/ice/base: fix reference count on VSI list update' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/cxgbe: fix CLIP leak in filter error path' " luca.boccassi
                   ` (154 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Qi Zhang; +Cc: Wei Zhao, Paul M Stillwell Jr, Qiming Yang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From fa18d27bc8e0657504b0ec666a7201cd63175a8e Mon Sep 17 00:00:00 2001
From: Qi Zhang <qi.z.zhang@intel.com>
Date: Mon, 15 Jun 2020 10:05:11 +0800
Subject: [PATCH] net/ice/base: fix initializing resource for field vector

[ upstream commit 383cb0d49c10c102d7ff54560fa298be5306c807 ]

This patch add initialization for prof_res_bm_init flag
to zero in order that the possible resource for field vector
in the package file can be initialized.(in ice_init_prof_result_bm)

Fixes: 453d087ccaff ("net/ice/base: add common functions")

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
---
 drivers/net/ice/base/ice_common.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c
index 77f68561e..25e30b937 100644
--- a/drivers/net/ice/base/ice_common.c
+++ b/drivers/net/ice/base/ice_common.c
@@ -461,6 +461,7 @@ static enum ice_status ice_init_fltr_mgmt_struct(struct ice_hw *hw)
 		return ICE_ERR_NO_MEMORY;
 
 	INIT_LIST_HEAD(&sw->vsi_list_map_head);
+	sw->prof_res_bm_init = 0;
 
 	return ice_init_def_sw_recp(hw);
 }
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:50.084763198 +0100
+++ 0038-net-ice-base-fix-initializing-resource-for-field-vec.patch	2020-07-24 12:53:48.251005789 +0100
@@ -1,14 +1,15 @@
-From 383cb0d49c10c102d7ff54560fa298be5306c807 Mon Sep 17 00:00:00 2001
+From fa18d27bc8e0657504b0ec666a7201cd63175a8e Mon Sep 17 00:00:00 2001
 From: Qi Zhang <qi.z.zhang@intel.com>
 Date: Mon, 15 Jun 2020 10:05:11 +0800
 Subject: [PATCH] net/ice/base: fix initializing resource for field vector
 
+[ upstream commit 383cb0d49c10c102d7ff54560fa298be5306c807 ]
+
 This patch add initialization for prof_res_bm_init flag
 to zero in order that the possible resource for field vector
 in the package file can be initialized.(in ice_init_prof_result_bm)
 
 Fixes: 453d087ccaff ("net/ice/base: add common functions")
-Cc: stable@dpdk.org
 
 Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
 Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
@@ -19,17 +20,17 @@
  1 file changed, 1 insertion(+)
 
 diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c
-index 54112e8f2..baaeee321 100644
+index 77f68561e..25e30b937 100644
 --- a/drivers/net/ice/base/ice_common.c
 +++ b/drivers/net/ice/base/ice_common.c
-@@ -536,6 +536,7 @@ enum ice_status ice_init_fltr_mgmt_struct(struct ice_hw *hw)
+@@ -461,6 +461,7 @@ static enum ice_status ice_init_fltr_mgmt_struct(struct ice_hw *hw)
  		return ICE_ERR_NO_MEMORY;
  
  	INIT_LIST_HEAD(&sw->vsi_list_map_head);
 +	sw->prof_res_bm_init = 0;
  
- 	status = ice_init_def_sw_recp(hw, &hw->switch_info->recp_list);
- 	if (status) {
+ 	return ice_init_def_sw_recp(hw);
+ }
 -- 
 2.20.1
 

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

* [dpdk-stable] patch 'net/cxgbe: fix CLIP leak in filter error path' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (36 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/ice/base: fix initializing resource for field vector' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/cxgbe: fix double MPS alloc by flow validate and create' " luca.boccassi
                   ` (153 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Rahul Lakkireddy; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 3c1368a539cc4353188cb73bdb1dbcba0d654b47 Mon Sep 17 00:00:00 2001
From: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Date: Sat, 13 Jun 2020 03:37:23 +0530
Subject: [PATCH] net/cxgbe: fix CLIP leak in filter error path

[ upstream commit 844b21299f1a10ac350528365dc761e2934512ee ]

Free up Compressed Local IP (CLIP) entry properly during filter
creation failure path. Also consolidate all various tables
cleanup to a common function and invoke it from both wild-card
and exact-match filter paths.

Fixes: af44a577988b ("net/cxgbe: support to offload flows to HASH region")

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
---
 drivers/net/cxgbe/cxgbe_filter.c | 68 +++++++++++++++-----------------
 1 file changed, 31 insertions(+), 37 deletions(-)

diff --git a/drivers/net/cxgbe/cxgbe_filter.c b/drivers/net/cxgbe/cxgbe_filter.c
index b9d9d5d39..8a8031cb9 100644
--- a/drivers/net/cxgbe/cxgbe_filter.c
+++ b/drivers/net/cxgbe/cxgbe_filter.c
@@ -269,6 +269,22 @@ int cxgbe_alloc_ftid(struct adapter *adap, u8 nentries)
 	return pos < size ? pos : -1;
 }
 
+/**
+ * Clear a filter and release any of its resources that we own.  This also
+ * clears the filter's "pending" status.
+ */
+static void clear_filter(struct filter_entry *f)
+{
+	if (f->clipt)
+		cxgbe_clip_release(f->dev, f->clipt);
+
+	/* The zeroing of the filter rule below clears the filter valid,
+	 * pending, locked flags etc. so it's all we need for
+	 * this operation.
+	 */
+	memset(f, 0, sizeof(*f));
+}
+
 /**
  * Construct hash filter ntuple.
  */
@@ -555,7 +571,7 @@ static int cxgbe_set_hash_filter(struct rte_eth_dev *dev,
 
 	f = t4_os_alloc(sizeof(*f));
 	if (!f)
-		goto out_err;
+		return -ENOMEM;
 
 	f->fs = *fs;
 	f->ctx = ctx;
@@ -592,7 +608,7 @@ static int cxgbe_set_hash_filter(struct rte_eth_dev *dev,
 		mbuf = rte_pktmbuf_alloc(ctrlq->mb_pool);
 		if (!mbuf) {
 			ret = -ENOMEM;
-			goto free_clip;
+			goto free_atid;
 		}
 
 		mbuf->data_len = size;
@@ -622,33 +638,15 @@ static int cxgbe_set_hash_filter(struct rte_eth_dev *dev,
 	t4_mgmt_tx(ctrlq, mbuf);
 	return 0;
 
-free_clip:
-	cxgbe_clip_release(f->dev, f->clipt);
 free_atid:
 	cxgbe_free_atid(t, atid);
 
 out_err:
+	clear_filter(f);
 	t4_os_free(f);
 	return ret;
 }
 
-/**
- * Clear a filter and release any of its resources that we own.  This also
- * clears the filter's "pending" status.
- */
-static void clear_filter(struct filter_entry *f)
-{
-	if (f->clipt)
-		cxgbe_clip_release(f->dev, f->clipt);
-
-	/*
-	 * The zeroing of the filter rule below clears the filter valid,
-	 * pending, locked flags etc. so it's all we need for
-	 * this operation.
-	 */
-	memset(f, 0, sizeof(*f));
-}
-
 /**
  * t4_mk_filtdelwr - create a delete filter WR
  * @adap: adapter context
@@ -1007,16 +1005,6 @@ int cxgbe_set_filter(struct rte_eth_dev *dev, unsigned int filter_id,
 		return ret;
 	}
 
-	/*
-	 * Allocate a clip table entry only if we have non-zero IPv6 address
-	 */
-	if (chip_ver > CHELSIO_T5 && fs->type &&
-	    memcmp(fs->val.lip, bitoff, sizeof(bitoff))) {
-		f->clipt = cxgbe_clip_alloc(dev, (u32 *)&fs->val.lip);
-		if (!f->clipt)
-			goto free_tid;
-	}
-
 	/*
 	 * Convert the filter specification into our internal format.
 	 * We copy the PF/VF specification into the Outer VLAN field
@@ -1027,6 +1015,16 @@ int cxgbe_set_filter(struct rte_eth_dev *dev, unsigned int filter_id,
 	f->fs.iq = iq;
 	f->dev = dev;
 
+	/* Allocate a clip table entry only if we have non-zero IPv6 address. */
+	if (chip_ver > CHELSIO_T5 && f->fs.type &&
+	    memcmp(f->fs.val.lip, bitoff, sizeof(bitoff))) {
+		f->clipt = cxgbe_clip_alloc(dev, (u32 *)&f->fs.val.lip);
+		if (!f->clipt) {
+			ret = -ENOMEM;
+			goto free_tid;
+		}
+	}
+
 	/*
 	 * Attempt to set the filter.  If we don't succeed, we clear
 	 * it and return the failure.
@@ -1107,6 +1105,7 @@ void cxgbe_hash_filter_rpl(struct adapter *adap,
 		}
 
 		cxgbe_free_atid(t, ftid);
+		clear_filter(f);
 		t4_os_free(f);
 	}
 
@@ -1331,13 +1330,8 @@ void cxgbe_hash_del_filter_rpl(struct adapter *adap,
 	}
 
 	ctx = f->ctx;
-	f->ctx = NULL;
-
-	f->valid = 0;
-
-	if (f->clipt)
-		cxgbe_clip_release(f->dev, f->clipt);
 
+	clear_filter(f);
 	cxgbe_remove_tid(t, 0, tid, 0);
 	t4_os_free(f);
 
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:50.121429259 +0100
+++ 0039-net-cxgbe-fix-CLIP-leak-in-filter-error-path.patch	2020-07-24 12:53:48.251005789 +0100
@@ -1,15 +1,16 @@
-From 844b21299f1a10ac350528365dc761e2934512ee Mon Sep 17 00:00:00 2001
+From 3c1368a539cc4353188cb73bdb1dbcba0d654b47 Mon Sep 17 00:00:00 2001
 From: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
 Date: Sat, 13 Jun 2020 03:37:23 +0530
 Subject: [PATCH] net/cxgbe: fix CLIP leak in filter error path
 
+[ upstream commit 844b21299f1a10ac350528365dc761e2934512ee ]
+
 Free up Compressed Local IP (CLIP) entry properly during filter
 creation failure path. Also consolidate all various tables
 cleanup to a common function and invoke it from both wild-card
 and exact-match filter paths.
 
 Fixes: af44a577988b ("net/cxgbe: support to offload flows to HASH region")
-Cc: stable@dpdk.org
 
 Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
 ---
@@ -17,10 +18,10 @@
  1 file changed, 31 insertions(+), 37 deletions(-)
 
 diff --git a/drivers/net/cxgbe/cxgbe_filter.c b/drivers/net/cxgbe/cxgbe_filter.c
-index 27e96c73e..45602d468 100644
+index b9d9d5d39..8a8031cb9 100644
 --- a/drivers/net/cxgbe/cxgbe_filter.c
 +++ b/drivers/net/cxgbe/cxgbe_filter.c
-@@ -284,6 +284,22 @@ int cxgbe_alloc_ftid(struct adapter *adap, u8 nentries)
+@@ -269,6 +269,22 @@ int cxgbe_alloc_ftid(struct adapter *adap, u8 nentries)
  	return pos < size ? pos : -1;
  }
  
@@ -43,7 +44,7 @@
  /**
   * Construct hash filter ntuple.
   */
-@@ -583,7 +599,7 @@ static int cxgbe_set_hash_filter(struct rte_eth_dev *dev,
+@@ -555,7 +571,7 @@ static int cxgbe_set_hash_filter(struct rte_eth_dev *dev,
  
  	f = t4_os_alloc(sizeof(*f));
  	if (!f)
@@ -52,7 +53,7 @@
  
  	f->fs = *fs;
  	f->ctx = ctx;
-@@ -631,7 +647,7 @@ static int cxgbe_set_hash_filter(struct rte_eth_dev *dev,
+@@ -592,7 +608,7 @@ static int cxgbe_set_hash_filter(struct rte_eth_dev *dev,
  		mbuf = rte_pktmbuf_alloc(ctrlq->mb_pool);
  		if (!mbuf) {
  			ret = -ENOMEM;
@@ -61,7 +62,7 @@
  		}
  
  		mbuf->data_len = size;
-@@ -661,33 +677,15 @@ static int cxgbe_set_hash_filter(struct rte_eth_dev *dev,
+@@ -622,33 +638,15 @@ static int cxgbe_set_hash_filter(struct rte_eth_dev *dev,
  	t4_mgmt_tx(ctrlq, mbuf);
  	return 0;
  
@@ -96,7 +97,7 @@
  /**
   * t4_mk_filtdelwr - create a delete filter WR
   * @adap: adapter context
-@@ -1070,16 +1068,6 @@ int cxgbe_set_filter(struct rte_eth_dev *dev, unsigned int filter_id,
+@@ -1007,16 +1005,6 @@ int cxgbe_set_filter(struct rte_eth_dev *dev, unsigned int filter_id,
  		return ret;
  	}
  
@@ -113,7 +114,7 @@
  	/*
  	 * Convert the filter specification into our internal format.
  	 * We copy the PF/VF specification into the Outer VLAN field
-@@ -1090,6 +1078,16 @@ int cxgbe_set_filter(struct rte_eth_dev *dev, unsigned int filter_id,
+@@ -1027,6 +1015,16 @@ int cxgbe_set_filter(struct rte_eth_dev *dev, unsigned int filter_id,
  	f->fs.iq = iq;
  	f->dev = dev;
  
@@ -127,10 +128,10 @@
 +		}
 +	}
 +
- 	iconf = adapter->params.tp.ingress_config;
- 
- 	/* Either PFVF or OVLAN can be active, but not both
-@@ -1192,6 +1190,7 @@ void cxgbe_hash_filter_rpl(struct adapter *adap,
+ 	/*
+ 	 * Attempt to set the filter.  If we don't succeed, we clear
+ 	 * it and return the failure.
+@@ -1107,6 +1105,7 @@ void cxgbe_hash_filter_rpl(struct adapter *adap,
  		}
  
  		cxgbe_free_atid(t, ftid);
@@ -138,7 +139,7 @@
  		t4_os_free(f);
  	}
  
-@@ -1416,13 +1415,8 @@ void cxgbe_hash_del_filter_rpl(struct adapter *adap,
+@@ -1331,13 +1330,8 @@ void cxgbe_hash_del_filter_rpl(struct adapter *adap,
  	}
  
  	ctx = f->ctx;

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

* [dpdk-stable] patch 'net/cxgbe: fix double MPS alloc by flow validate and create' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (37 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/cxgbe: fix CLIP leak in filter error path' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:57 ` [dpdk-stable] patch 'meter: remove inline functions from export list' " luca.boccassi
                   ` (152 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Rahul Lakkireddy; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 9f61da6849dfdb2e17fa23dceb3001eacceaf6c0 Mon Sep 17 00:00:00 2001
From: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Date: Sat, 13 Jun 2020 03:37:25 +0530
Subject: [PATCH] net/cxgbe: fix double MPS alloc by flow validate and create

[ upstream commit be5f4d5ced10f9d7edc8ba4b3f1d98b9d476d367 ]

The Multi Port Switch (MPS) entry is allocated twice when both
flow validate and create are invoked, but only freed once during
flow destroy. Avoid double alloc by moving MPS entry allocation
closer to when the filter create request is sent to hardware and
will be ignored for filter validate request.

Fixes: fefee7a619a4 ("net/cxgbe: add flow ops to match based on dest MAC")

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
---
 drivers/net/cxgbe/cxgbe_filter.c | 32 ++++++++++++++++++++++++++++++++
 drivers/net/cxgbe/cxgbe_filter.h |  4 +++-
 drivers/net/cxgbe/cxgbe_flow.c   | 28 +++-------------------------
 3 files changed, 38 insertions(+), 26 deletions(-)

diff --git a/drivers/net/cxgbe/cxgbe_filter.c b/drivers/net/cxgbe/cxgbe_filter.c
index 8a8031cb9..07337bb4b 100644
--- a/drivers/net/cxgbe/cxgbe_filter.c
+++ b/drivers/net/cxgbe/cxgbe_filter.c
@@ -8,6 +8,7 @@
 #include "base/t4_tcb.h"
 #include "base/t4_regs.h"
 #include "cxgbe_filter.h"
+#include "mps_tcam.h"
 #include "clip_tbl.h"
 #include "l2t.h"
 
@@ -275,9 +276,14 @@ int cxgbe_alloc_ftid(struct adapter *adap, u8 nentries)
  */
 static void clear_filter(struct filter_entry *f)
 {
+	struct port_info *pi = ethdev2pinfo(f->dev);
+
 	if (f->clipt)
 		cxgbe_clip_release(f->dev, f->clipt);
 
+	if (f->fs.mask.macidx)
+		cxgbe_mpstcam_remove(pi, f->fs.val.macidx);
+
 	/* The zeroing of the filter rule below clears the filter valid,
 	 * pending, locked flags etc. so it's all we need for
 	 * this operation.
@@ -578,6 +584,19 @@ static int cxgbe_set_hash_filter(struct rte_eth_dev *dev,
 	f->dev = dev;
 	f->fs.iq = iq;
 
+	/* Allocate MPS TCAM entry to match Destination MAC. */
+	if (f->fs.mask.macidx) {
+		int idx;
+
+		idx = cxgbe_mpstcam_alloc(pi, f->fs.val.dmac, f->fs.mask.dmac);
+		if (idx <= 0) {
+			ret = -ENOMEM;
+			goto out_err;
+		}
+
+		f->fs.val.macidx = idx;
+	}
+
 	/*
 	 * If the new filter requires loopback Destination MAC and/or VLAN
 	 * rewriting then we need to allocate a Layer 2 Table (L2T) entry for
@@ -1015,6 +1034,19 @@ int cxgbe_set_filter(struct rte_eth_dev *dev, unsigned int filter_id,
 	f->fs.iq = iq;
 	f->dev = dev;
 
+	/* Allocate MPS TCAM entry to match Destination MAC. */
+	if (f->fs.mask.macidx) {
+		int idx;
+
+		idx = cxgbe_mpstcam_alloc(pi, f->fs.val.dmac, f->fs.mask.dmac);
+		if (idx <= 0) {
+			ret = -ENOMEM;
+			goto free_tid;
+		}
+
+		f->fs.val.macidx = idx;
+	}
+
 	/* Allocate a clip table entry only if we have non-zero IPv6 address. */
 	if (chip_ver > CHELSIO_T5 && f->fs.type &&
 	    memcmp(f->fs.val.lip, bitoff, sizeof(bitoff))) {
diff --git a/drivers/net/cxgbe/cxgbe_filter.h b/drivers/net/cxgbe/cxgbe_filter.h
index 06021c854..e69e9d3f5 100644
--- a/drivers/net/cxgbe/cxgbe_filter.h
+++ b/drivers/net/cxgbe/cxgbe_filter.h
@@ -69,8 +69,10 @@ struct ch_filter_tuple {
 	uint16_t lport;		/* local port */
 	uint16_t fport;		/* foreign port */
 
+	uint8_t dmac[6];        /* Destination MAC to match */
+
 	/* reservations for future additions */
-	uint8_t rsvd[12];
+	uint8_t rsvd[6];
 };
 
 /*
diff --git a/drivers/net/cxgbe/cxgbe_flow.c b/drivers/net/cxgbe/cxgbe_flow.c
index 2fb77b4ab..1298fb12a 100644
--- a/drivers/net/cxgbe/cxgbe_flow.c
+++ b/drivers/net/cxgbe/cxgbe_flow.c
@@ -190,20 +190,9 @@ ch_rte_parsetype_eth(const void *dmask, const struct rte_flow_item *item,
 					  "src mac filtering not supported");
 
 	if (!rte_is_zero_ether_addr(&mask->dst)) {
-		const u8 *addr = (const u8 *)&spec->dst.addr_bytes[0];
-		const u8 *m = (const u8 *)&mask->dst.addr_bytes[0];
-		struct rte_flow *flow = (struct rte_flow *)fs->private;
-		struct port_info *pi = (struct port_info *)
-					(flow->dev->data->dev_private);
-		int idx;
-
-		idx = cxgbe_mpstcam_alloc(pi, addr, m);
-		if (idx <= 0)
-			return rte_flow_error_set(e, idx,
-						  RTE_FLOW_ERROR_TYPE_ITEM,
-						  NULL, "unable to allocate mac"
-						  " entry in h/w");
-		CXGBE_FILL_FS(idx, 0x1ff, macidx);
+		CXGBE_FILL_FS(0, 0x1ff, macidx);
+		CXGBE_FILL_FS_MEMCPY(spec->dst.addr_bytes, mask->dst.addr_bytes,
+				     dmac);
 	}
 
 	/* Only set outer ethertype, if we didn't encounter VLAN item yet.
@@ -1085,17 +1074,6 @@ static int __cxgbe_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow)
 		return ctx.result;
 	}
 
-	fs = &flow->fs;
-	if (fs->mask.macidx) {
-		struct port_info *pi = (struct port_info *)
-					(dev->data->dev_private);
-		int ret;
-
-		ret = cxgbe_mpstcam_remove(pi, fs->val.macidx);
-		if (!ret)
-			return ret;
-	}
-
 	return 0;
 }
 
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:50.161782954 +0100
+++ 0040-net-cxgbe-fix-double-MPS-alloc-by-flow-validate-and-.patch	2020-07-24 12:53:48.255005863 +0100
@@ -1,8 +1,10 @@
-From be5f4d5ced10f9d7edc8ba4b3f1d98b9d476d367 Mon Sep 17 00:00:00 2001
+From 9f61da6849dfdb2e17fa23dceb3001eacceaf6c0 Mon Sep 17 00:00:00 2001
 From: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
 Date: Sat, 13 Jun 2020 03:37:25 +0530
 Subject: [PATCH] net/cxgbe: fix double MPS alloc by flow validate and create
 
+[ upstream commit be5f4d5ced10f9d7edc8ba4b3f1d98b9d476d367 ]
+
 The Multi Port Switch (MPS) entry is allocated twice when both
 flow validate and create are invoked, but only freed once during
 flow destroy. Avoid double alloc by moving MPS entry allocation
@@ -10,7 +12,6 @@
 will be ignored for filter validate request.
 
 Fixes: fefee7a619a4 ("net/cxgbe: add flow ops to match based on dest MAC")
-Cc: stable@dpdk.org
 
 Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
 ---
@@ -20,7 +21,7 @@
  3 files changed, 38 insertions(+), 26 deletions(-)
 
 diff --git a/drivers/net/cxgbe/cxgbe_filter.c b/drivers/net/cxgbe/cxgbe_filter.c
-index 06233e41e..317830f58 100644
+index 8a8031cb9..07337bb4b 100644
 --- a/drivers/net/cxgbe/cxgbe_filter.c
 +++ b/drivers/net/cxgbe/cxgbe_filter.c
 @@ -8,6 +8,7 @@
@@ -30,8 +31,8 @@
 +#include "mps_tcam.h"
  #include "clip_tbl.h"
  #include "l2t.h"
- #include "smt.h"
-@@ -290,12 +291,17 @@ int cxgbe_alloc_ftid(struct adapter *adap, u8 nentries)
+ 
+@@ -275,9 +276,14 @@ int cxgbe_alloc_ftid(struct adapter *adap, u8 nentries)
   */
  static void clear_filter(struct filter_entry *f)
  {
@@ -40,16 +41,13 @@
  	if (f->clipt)
  		cxgbe_clip_release(f->dev, f->clipt);
  
- 	if (f->l2t)
- 		cxgbe_l2t_release(f->l2t);
- 
 +	if (f->fs.mask.macidx)
 +		cxgbe_mpstcam_remove(pi, f->fs.val.macidx);
 +
  	/* The zeroing of the filter rule below clears the filter valid,
  	 * pending, locked flags etc. so it's all we need for
  	 * this operation.
-@@ -609,6 +615,19 @@ static int cxgbe_set_hash_filter(struct rte_eth_dev *dev,
+@@ -578,6 +584,19 @@ static int cxgbe_set_hash_filter(struct rte_eth_dev *dev,
  	f->dev = dev;
  	f->fs.iq = iq;
  
@@ -69,7 +67,7 @@
  	/*
  	 * If the new filter requires loopback Destination MAC and/or VLAN
  	 * rewriting then we need to allocate a Layer 2 Table (L2T) entry for
-@@ -1067,6 +1086,19 @@ int cxgbe_set_filter(struct rte_eth_dev *dev, unsigned int filter_id,
+@@ -1015,6 +1034,19 @@ int cxgbe_set_filter(struct rte_eth_dev *dev, unsigned int filter_id,
  	f->fs.iq = iq;
  	f->dev = dev;
  
@@ -90,7 +88,7 @@
  	if (chip_ver > CHELSIO_T5 && f->fs.type &&
  	    memcmp(f->fs.val.lip, bitoff, sizeof(bitoff))) {
 diff --git a/drivers/net/cxgbe/cxgbe_filter.h b/drivers/net/cxgbe/cxgbe_filter.h
-index e79c052de..46ebf8333 100644
+index 06021c854..e69e9d3f5 100644
 --- a/drivers/net/cxgbe/cxgbe_filter.h
 +++ b/drivers/net/cxgbe/cxgbe_filter.h
 @@ -69,8 +69,10 @@ struct ch_filter_tuple {
@@ -106,10 +104,10 @@
  
  /*
 diff --git a/drivers/net/cxgbe/cxgbe_flow.c b/drivers/net/cxgbe/cxgbe_flow.c
-index 166c39ba5..dd8ee7bbd 100644
+index 2fb77b4ab..1298fb12a 100644
 --- a/drivers/net/cxgbe/cxgbe_flow.c
 +++ b/drivers/net/cxgbe/cxgbe_flow.c
-@@ -194,20 +194,9 @@ ch_rte_parsetype_eth(const void *dmask, const struct rte_flow_item *item,
+@@ -190,20 +190,9 @@ ch_rte_parsetype_eth(const void *dmask, const struct rte_flow_item *item,
  					  "src mac filtering not supported");
  
  	if (!rte_is_zero_ether_addr(&mask->dst)) {
@@ -132,8 +130,8 @@
 +				     dmac);
  	}
  
- 	CXGBE_FILL_FS(be16_to_cpu(spec->type),
-@@ -1212,17 +1201,6 @@ static int __cxgbe_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow)
+ 	/* Only set outer ethertype, if we didn't encounter VLAN item yet.
+@@ -1085,17 +1074,6 @@ static int __cxgbe_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow)
  		return ctx.result;
  	}
  

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

* [dpdk-stable] patch 'meter: remove inline functions from export list' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (38 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'net/cxgbe: fix double MPS alloc by flow validate and create' " luca.boccassi
@ 2020-07-24 11:57 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'eal/linux: fix epoll fd list rebuild for interrupts' " luca.boccassi
                   ` (151 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:57 UTC (permalink / raw)
  To: Fady Bader; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 451a93ce727a0adf151f8b4e808b4f16c55933bb Mon Sep 17 00:00:00 2001
From: Fady Bader <fady@mellanox.com>
Date: Wed, 17 Jun 2020 11:24:31 +0300
Subject: [PATCH] meter: remove inline functions from export list

[ upstream commit f6da77d92ddc76bb5bd0ea9bf4ff044c9fde1a9b ]

The code didn't compile when using exported meter functions under Windows.

error LNK2001: unresolved external symbol
rte_meter_srtcm_color_aware_check
error LNK2001: unresolved external symbol
rte_meter_srtcm_color_blind_check
error LNK2001: unresolved external symbol
rte_meter_trtcm_color_aware_check
error LNK2001: unresolved external symbol
rte_meter_trtcm_color_blind_check
error LNK2001: unresolved external symbol
rte_meter_trtcm_rfc4115_color_aware_check
error LNK2001: unresolved external symbol
rte_meter_trtcm_rfc4115_color_blind_check

The cause was that there were some inline functions that were included in
the export list.
To solve this the functions were removed from rte_meter_version.map export
list which are implemented in the header and shouldn't be exported.

Fixes: 655796d2b5fb ("meter: support RFC4115 trTCM")
Fixes: 9d41beed24b0 ("lib: provide initial versioning")

Signed-off-by: Fady Bader <fady@mellanox.com>
---
 lib/librte_meter/rte_meter_version.map | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/lib/librte_meter/rte_meter_version.map b/lib/librte_meter/rte_meter_version.map
index 46410b036..3fc7ddd19 100644
--- a/lib/librte_meter/rte_meter_version.map
+++ b/lib/librte_meter/rte_meter_version.map
@@ -1,12 +1,8 @@
 DPDK_20.0 {
 	global:
 
-	rte_meter_srtcm_color_aware_check;
-	rte_meter_srtcm_color_blind_check;
 	rte_meter_srtcm_config;
 	rte_meter_srtcm_profile_config;
-	rte_meter_trtcm_color_aware_check;
-	rte_meter_trtcm_color_blind_check;
 	rte_meter_trtcm_config;
 	rte_meter_trtcm_profile_config;
 
@@ -16,8 +12,6 @@ DPDK_20.0 {
 EXPERIMENTAL {
 	global:
 
-	rte_meter_trtcm_rfc4115_color_aware_check;
-	rte_meter_trtcm_rfc4115_color_blind_check;
 	rte_meter_trtcm_rfc4115_config;
 	rte_meter_trtcm_rfc4115_profile_config;
 };
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:50.199270985 +0100
+++ 0041-meter-remove-inline-functions-from-export-list.patch	2020-07-24 12:53:48.255005863 +0100
@@ -1,8 +1,10 @@
-From f6da77d92ddc76bb5bd0ea9bf4ff044c9fde1a9b Mon Sep 17 00:00:00 2001
+From 451a93ce727a0adf151f8b4e808b4f16c55933bb Mon Sep 17 00:00:00 2001
 From: Fady Bader <fady@mellanox.com>
 Date: Wed, 17 Jun 2020 11:24:31 +0300
 Subject: [PATCH] meter: remove inline functions from export list
 
+[ upstream commit f6da77d92ddc76bb5bd0ea9bf4ff044c9fde1a9b ]
+
 The code didn't compile when using exported meter functions under Windows.
 
 error LNK2001: unresolved external symbol
@@ -25,7 +27,6 @@
 
 Fixes: 655796d2b5fb ("meter: support RFC4115 trTCM")
 Fixes: 9d41beed24b0 ("lib: provide initial versioning")
-Cc: stable@dpdk.org
 
 Signed-off-by: Fady Bader <fady@mellanox.com>
 ---
@@ -33,7 +34,7 @@
  1 file changed, 6 deletions(-)
 
 diff --git a/lib/librte_meter/rte_meter_version.map b/lib/librte_meter/rte_meter_version.map
-index b493bcebe..58859d4d7 100644
+index 46410b036..3fc7ddd19 100644
 --- a/lib/librte_meter/rte_meter_version.map
 +++ b/lib/librte_meter/rte_meter_version.map
 @@ -1,12 +1,8 @@
@@ -50,14 +51,14 @@
  	rte_meter_trtcm_profile_config;
  
 @@ -16,8 +12,6 @@ DPDK_20.0 {
- DPDK_21 {
+ EXPERIMENTAL {
  	global:
  
 -	rte_meter_trtcm_rfc4115_color_aware_check;
 -	rte_meter_trtcm_rfc4115_color_blind_check;
  	rte_meter_trtcm_rfc4115_config;
  	rte_meter_trtcm_rfc4115_profile_config;
- 
+ };
 -- 
 2.20.1
 

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

* [dpdk-stable] patch 'eal/linux: fix epoll fd list rebuild for interrupts' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (39 preceding siblings ...)
  2020-07-24 11:57 ` [dpdk-stable] patch 'meter: remove inline functions from export list' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'test/bpf: fix few small issues' " luca.boccassi
                   ` (150 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Harman Kalra; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 318c4a44965c100702b95d58c18c6c1c22bd25a7 Mon Sep 17 00:00:00 2001
From: Harman Kalra <hkalra@marvell.com>
Date: Fri, 19 Jun 2020 19:29:28 +0530
Subject: [PATCH] eal/linux: fix epoll fd list rebuild for interrupts

[ upstream commit 02b73b1e93a2e319e5751e0e662e6271f6f3367e ]

An issue has been observed where epoll file descriptor
list rebuilds every time an interrupt/alarm event is
received.

eal_intr_process_interrupts() should notify pipe fd only
if any source is removed from the source list i.e (rv > 0)

Fixes: 0c7ce182a760 ("eal: add pending interrupt callback unregister")

Signed-off-by: Harman Kalra <hkalra@marvell.com>
---
 lib/librte_eal/linux/eal/eal_interrupts.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_eal/linux/eal/eal_interrupts.c b/lib/librte_eal/linux/eal/eal_interrupts.c
index 14ebb108c..5a58f05fa 100644
--- a/lib/librte_eal/linux/eal/eal_interrupts.c
+++ b/lib/librte_eal/linux/eal/eal_interrupts.c
@@ -984,7 +984,7 @@ eal_intr_process_interrupts(struct epoll_event *events, int nfds)
 		}
 
 		/* notify the pipe fd waited by epoll_wait to rebuild the wait list */
-		if (rv >= 0 && write(intr_pipe.writefd, "1", 1) < 0) {
+		if (rv > 0 && write(intr_pipe.writefd, "1", 1) < 0) {
 			rte_spinlock_unlock(&intr_lock);
 			return -EPIPE;
 		}
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:50.234272972 +0100
+++ 0042-eal-linux-fix-epoll-fd-list-rebuild-for-interrupts.patch	2020-07-24 12:53:48.255005863 +0100
@@ -1,8 +1,10 @@
-From 02b73b1e93a2e319e5751e0e662e6271f6f3367e Mon Sep 17 00:00:00 2001
+From 318c4a44965c100702b95d58c18c6c1c22bd25a7 Mon Sep 17 00:00:00 2001
 From: Harman Kalra <hkalra@marvell.com>
 Date: Fri, 19 Jun 2020 19:29:28 +0530
 Subject: [PATCH] eal/linux: fix epoll fd list rebuild for interrupts
 
+[ upstream commit 02b73b1e93a2e319e5751e0e662e6271f6f3367e ]
+
 An issue has been observed where epoll file descriptor
 list rebuilds every time an interrupt/alarm event is
 received.
@@ -11,18 +13,17 @@
 if any source is removed from the source list i.e (rv > 0)
 
 Fixes: 0c7ce182a760 ("eal: add pending interrupt callback unregister")
-Cc: stable@dpdk.org
 
 Signed-off-by: Harman Kalra <hkalra@marvell.com>
 ---
- lib/librte_eal/linux/eal_interrupts.c | 2 +-
+ lib/librte_eal/linux/eal/eal_interrupts.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/lib/librte_eal/linux/eal_interrupts.c b/lib/librte_eal/linux/eal_interrupts.c
-index 16e7a7d51..84eeaa1bc 100644
---- a/lib/librte_eal/linux/eal_interrupts.c
-+++ b/lib/librte_eal/linux/eal_interrupts.c
-@@ -1010,7 +1010,7 @@ eal_intr_process_interrupts(struct epoll_event *events, int nfds)
+diff --git a/lib/librte_eal/linux/eal/eal_interrupts.c b/lib/librte_eal/linux/eal/eal_interrupts.c
+index 14ebb108c..5a58f05fa 100644
+--- a/lib/librte_eal/linux/eal/eal_interrupts.c
++++ b/lib/librte_eal/linux/eal/eal_interrupts.c
+@@ -984,7 +984,7 @@ eal_intr_process_interrupts(struct epoll_event *events, int nfds)
  		}
  
  		/* notify the pipe fd waited by epoll_wait to rebuild the wait list */

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

* [dpdk-stable] patch 'test/bpf: fix few small issues' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (40 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'eal/linux: fix epoll fd list rebuild for interrupts' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'bpf: fix add/sub min/max estimations' " luca.boccassi
                   ` (149 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Konstantin Ananyev; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 3e457e69b6a0b0b4f7220481aac1766197916253 Mon Sep 17 00:00:00 2001
From: Konstantin Ananyev <konstantin.ananyev@intel.com>
Date: Wed, 27 May 2020 15:16:49 +0100
Subject: [PATCH] test/bpf: fix few small issues

[ upstream commit 83633ba230761647b5014301c1f98b670d03e375 ]

Address for few small issues:
 - unreachable return statement
 - failed test-case can finish with 'success' status

Also use unified cmp_res() function to check return value.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
 app/test/test_bpf.c | 39 ++++++++++++++-------------------------
 1 file changed, 14 insertions(+), 25 deletions(-)

diff --git a/app/test/test_bpf.c b/app/test/test_bpf.c
index ee534687a..4a61a7d7c 100644
--- a/app/test/test_bpf.c
+++ b/app/test/test_bpf.c
@@ -1797,13 +1797,6 @@ test_call1_check(uint64_t rc, const void *arg)
 	dummy_func1(arg, &v32, &v64);
 	v64 += v32;
 
-	if (v64 != rc) {
-		printf("%s@%d: invalid return value "
-			"expected=0x%" PRIx64 ", actual=0x%" PRIx64 "\n",
-			__func__, __LINE__, v64, rc);
-		return -1;
-	}
-	return 0;
 	return cmp_res(__func__, v64, rc, dv, dv, sizeof(*dv));
 }
 
@@ -1934,13 +1927,7 @@ test_call2_check(uint64_t rc, const void *arg)
 	dummy_func2(&a, &b);
 	v = a.u64 + a.u32 + b.u16 + b.u8;
 
-	if (v != rc) {
-		printf("%s@%d: invalid return value "
-			"expected=0x%" PRIx64 ", actual=0x%" PRIx64 "\n",
-			__func__, __LINE__, v, rc);
-		return -1;
-	}
-	return 0;
+	return cmp_res(__func__, v, rc, arg, arg, 0);
 }
 
 static const struct rte_bpf_xsym test_call2_xsym[] = {
@@ -2429,7 +2416,6 @@ test_call5_check(uint64_t rc, const void *arg)
 	v = 0;
 
 fail:
-
 	return cmp_res(__func__, v, rc, &v, &rc, sizeof(v));
 }
 
@@ -2458,6 +2444,7 @@ static const struct rte_bpf_xsym test_call5_xsym[] = {
 	},
 };
 
+/* all bpf test cases */
 static const struct bpf_test tests[] = {
 	{
 		.name = "test_store1",
@@ -2738,7 +2725,6 @@ run_test(const struct bpf_test *tst)
 	}
 
 	tst->prepare(tbuf);
-
 	rc = rte_bpf_exec(bpf, tbuf);
 	ret = tst->check_result(rc, tbuf);
 	if (ret != 0) {
@@ -2746,17 +2732,20 @@ run_test(const struct bpf_test *tst)
 			__func__, __LINE__, tst->name, ret, strerror(ret));
 	}
 
+	/* repeat the same test with jit, when possible */
 	rte_bpf_get_jit(bpf, &jit);
-	if (jit.func == NULL)
-		return 0;
+	if (jit.func != NULL) {
 
-	tst->prepare(tbuf);
-	rc = jit.func(tbuf);
-	rv = tst->check_result(rc, tbuf);
-	ret |= rv;
-	if (rv != 0) {
-		printf("%s@%d: check_result(%s) failed, error: %d(%s);\n",
-			__func__, __LINE__, tst->name, rv, strerror(ret));
+		tst->prepare(tbuf);
+		rc = jit.func(tbuf);
+		rv = tst->check_result(rc, tbuf);
+		ret |= rv;
+		if (rv != 0) {
+			printf("%s@%d: check_result(%s) failed, "
+				"error: %d(%s);\n",
+				__func__, __LINE__, tst->name,
+				rv, strerror(ret));
+		}
 	}
 
 	rte_bpf_destroy(bpf);
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:50.270670479 +0100
+++ 0043-test-bpf-fix-few-small-issues.patch	2020-07-24 12:53:48.255005863 +0100
@@ -1,16 +1,16 @@
-From 83633ba230761647b5014301c1f98b670d03e375 Mon Sep 17 00:00:00 2001
+From 3e457e69b6a0b0b4f7220481aac1766197916253 Mon Sep 17 00:00:00 2001
 From: Konstantin Ananyev <konstantin.ananyev@intel.com>
 Date: Wed, 27 May 2020 15:16:49 +0100
 Subject: [PATCH] test/bpf: fix few small issues
 
+[ upstream commit 83633ba230761647b5014301c1f98b670d03e375 ]
+
 Address for few small issues:
  - unreachable return statement
  - failed test-case can finish with 'success' status
 
 Also use unified cmp_res() function to check return value.
 
-Cc: stable@dpdk.org
-
 Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
 ---
  app/test/test_bpf.c | 39 ++++++++++++++-------------------------

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

* [dpdk-stable] patch 'bpf: fix add/sub min/max estimations' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (41 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'test/bpf: fix few small issues' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'net: fix IPv4 checksum' " luca.boccassi
                   ` (148 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Konstantin Ananyev; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 66d977367bc4645400785fca42128318d3dd773b Mon Sep 17 00:00:00 2001
From: Konstantin Ananyev <konstantin.ananyev@intel.com>
Date: Wed, 27 May 2020 15:16:50 +0100
Subject: [PATCH] bpf: fix add/sub min/max estimations

[ upstream commit 20c19d9df5f08840d96204dcc65437223c434325 ]

eval_add()/eval_sub() not always correctly estimate
minimum and maximum possible values of add/sub operations.

Fixes: 8021917293d0 ("bpf: add extra validation for input BPF program")

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
 lib/librte_bpf/bpf_validate.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/librte_bpf/bpf_validate.c b/lib/librte_bpf/bpf_validate.c
index 6bd6f78e9..80d21fabb 100644
--- a/lib/librte_bpf/bpf_validate.c
+++ b/lib/librte_bpf/bpf_validate.c
@@ -226,7 +226,7 @@ eval_add(struct bpf_reg_val *rd, const struct bpf_reg_val *rs, uint64_t msk)
 	struct bpf_reg_val rv;
 
 	rv.u.min = (rd->u.min + rs->u.min) & msk;
-	rv.u.max = (rd->u.min + rs->u.max) & msk;
+	rv.u.max = (rd->u.max + rs->u.max) & msk;
 	rv.s.min = (rd->s.min + rs->s.min) & msk;
 	rv.s.max = (rd->s.max + rs->s.max) & msk;
 
@@ -254,10 +254,10 @@ eval_sub(struct bpf_reg_val *rd, const struct bpf_reg_val *rs, uint64_t msk)
 {
 	struct bpf_reg_val rv;
 
-	rv.u.min = (rd->u.min - rs->u.min) & msk;
-	rv.u.max = (rd->u.min - rs->u.max) & msk;
-	rv.s.min = (rd->s.min - rs->s.min) & msk;
-	rv.s.max = (rd->s.max - rs->s.max) & msk;
+	rv.u.min = (rd->u.min - rs->u.max) & msk;
+	rv.u.max = (rd->u.max - rs->u.min) & msk;
+	rv.s.min = (rd->s.min - rs->s.max) & msk;
+	rv.s.max = (rd->s.max - rs->s.min) & msk;
 
 	/*
 	 * if at least one of the operands is not constant,
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:50.313085064 +0100
+++ 0044-bpf-fix-add-sub-min-max-estimations.patch	2020-07-24 12:53:48.259005938 +0100
@@ -1,13 +1,14 @@
-From 20c19d9df5f08840d96204dcc65437223c434325 Mon Sep 17 00:00:00 2001
+From 66d977367bc4645400785fca42128318d3dd773b Mon Sep 17 00:00:00 2001
 From: Konstantin Ananyev <konstantin.ananyev@intel.com>
 Date: Wed, 27 May 2020 15:16:50 +0100
 Subject: [PATCH] bpf: fix add/sub min/max estimations
 
+[ upstream commit 20c19d9df5f08840d96204dcc65437223c434325 ]
+
 eval_add()/eval_sub() not always correctly estimate
 minimum and maximum possible values of add/sub operations.
 
 Fixes: 8021917293d0 ("bpf: add extra validation for input BPF program")
-Cc: stable@dpdk.org
 
 Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
 ---

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

* [dpdk-stable] patch 'net: fix IPv4 checksum' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (42 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'bpf: fix add/sub min/max estimations' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'examples: add flush after stats printing' " luca.boccassi
                   ` (147 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Hongzhi Guo; +Cc: Morten Brørup, Olivier Matz, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 430b02f1a047df789916fe0bcd980a3048d2c364 Mon Sep 17 00:00:00 2001
From: Hongzhi Guo <guohongzhi1@huawei.com>
Date: Tue, 26 May 2020 18:08:05 +0800
Subject: [PATCH] net: fix IPv4 checksum
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit 06602c671a5ee23f517456424b216b2427c4334c ]

0xffff is invalid for IPv4 checksum (RFC1624)

Fixes: 6006818cfb26 ("net: new checksum functions")

Signed-off-by: Hongzhi Guo <guohongzhi1@huawei.com>
Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---
 lib/librte_net/rte_ip.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h
index 1ceb7b793..ece2e433c 100644
--- a/lib/librte_net/rte_ip.h
+++ b/lib/librte_net/rte_ip.h
@@ -267,7 +267,7 @@ rte_ipv4_cksum(const struct rte_ipv4_hdr *ipv4_hdr)
 {
 	uint16_t cksum;
 	cksum = rte_raw_cksum(ipv4_hdr, sizeof(struct rte_ipv4_hdr));
-	return (cksum == 0xffff) ? cksum : (uint16_t)~cksum;
+	return (uint16_t)~cksum;
 }
 
 /**
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:50.351818251 +0100
+++ 0045-net-fix-IPv4-checksum.patch	2020-07-24 12:53:48.259005938 +0100
@@ -1,4 +1,4 @@
-From 06602c671a5ee23f517456424b216b2427c4334c Mon Sep 17 00:00:00 2001
+From 430b02f1a047df789916fe0bcd980a3048d2c364 Mon Sep 17 00:00:00 2001
 From: Hongzhi Guo <guohongzhi1@huawei.com>
 Date: Tue, 26 May 2020 18:08:05 +0800
 Subject: [PATCH] net: fix IPv4 checksum
@@ -6,10 +6,11 @@
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
 
+[ upstream commit 06602c671a5ee23f517456424b216b2427c4334c ]
+
 0xffff is invalid for IPv4 checksum (RFC1624)
 
 Fixes: 6006818cfb26 ("net: new checksum functions")
-Cc: stable@dpdk.org
 
 Signed-off-by: Hongzhi Guo <guohongzhi1@huawei.com>
 Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
@@ -19,7 +20,7 @@
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h
-index 4c4437a54..292f63fd7 100644
+index 1ceb7b793..ece2e433c 100644
 --- a/lib/librte_net/rte_ip.h
 +++ b/lib/librte_net/rte_ip.h
 @@ -267,7 +267,7 @@ rte_ipv4_cksum(const struct rte_ipv4_hdr *ipv4_hdr)

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

* [dpdk-stable] patch 'examples: add flush after stats printing' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (43 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'net: fix IPv4 checksum' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'sched: fix subport freeing' " luca.boccassi
                   ` (146 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Georgiy Levashov; +Cc: Andrew Rybchenko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 0f7c8f75f2028230812f41473a702177dbd5aee2 Mon Sep 17 00:00:00 2001
From: Georgiy Levashov <georgiy.levashov@oktetlabs.ru>
Date: Tue, 28 Apr 2020 14:27:41 +0100
Subject: [PATCH] examples: add flush after stats printing

[ upstream commit 3ee6f706519c0a7456f3d8a79048150dfa6d2581 ]

When printf()'s stdout is line-buffered for terminal, it is fully
buffered for pipes. So, stdout listener can only get the output
when it is flushed (on program termination, when buffer is filled or
manual flush).

stdout buffer might fill slowly since every stats report could be small.

Also when it is fully filled it might contain a part of the last stats
report which makes it very inconvenient for any automation which reads
and parses the output.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Georgiy Levashov <georgiy.levashov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/bbdev_app/main.c             | 2 ++
 examples/ioat/ioatfwd.c               | 2 ++
 examples/kni/main.c                   | 2 ++
 examples/l2fwd-crypto/main.c          | 2 ++
 examples/l2fwd-event/main.c           | 2 ++
 examples/l2fwd-jobstats/main.c        | 3 +++
 examples/l2fwd-keepalive/main.c       | 2 ++
 examples/l2fwd/main.c                 | 2 ++
 examples/link_status_interrupt/main.c | 2 ++
 examples/tep_termination/main.c       | 2 ++
 examples/vhost/main.c                 | 2 ++
 11 files changed, 23 insertions(+)

diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c
index fb38dc3a7..68a46050c 100644
--- a/examples/bbdev_app/main.c
+++ b/examples/bbdev_app/main.c
@@ -659,6 +659,8 @@ print_stats(struct stats_lcore_params *stats_lcore)
 		print_lcore_stats(stats_lcore->lconf[l_id].lcore_stats, l_id);
 	}
 
+	fflush(stdout);
+
 	free(xstats);
 	free(xstats_names);
 }
diff --git a/examples/ioat/ioatfwd.c b/examples/ioat/ioatfwd.c
index 53de23179..b66ee73bc 100644
--- a/examples/ioat/ioatfwd.c
+++ b/examples/ioat/ioatfwd.c
@@ -294,6 +294,8 @@ print_stats(char *prgname)
 		printf("\n");
 		print_total_stats(&delta_ts);
 
+		fflush(stdout);
+
 		ts.total_packets_tx += delta_ts.total_packets_tx;
 		ts.total_packets_rx += delta_ts.total_packets_rx;
 		ts.total_packets_dropped += delta_ts.total_packets_dropped;
diff --git a/examples/kni/main.c b/examples/kni/main.c
index d48a59fcb..7edc73ab9 100644
--- a/examples/kni/main.c
+++ b/examples/kni/main.c
@@ -158,6 +158,8 @@ print_stats(void)
 						kni_stats[i].tx_dropped);
 	}
 	printf("======  ==============  ============  ============  ============  ============\n");
+
+	fflush(stdout);
 }
 
 /* Custom handling of signals to handle stats and kni processing */
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index fcb55c370..827da9b3e 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -334,6 +334,8 @@ print_stats(void)
 		   total_packets_dropped,
 		   total_packets_errors);
 	printf("\n====================================================\n");
+
+	fflush(stdout);
 }
 
 static int
diff --git a/examples/l2fwd-event/main.c b/examples/l2fwd-event/main.c
index 384b71238..7969a1c31 100644
--- a/examples/l2fwd-event/main.c
+++ b/examples/l2fwd-event/main.c
@@ -385,6 +385,8 @@ print_stats(struct l2fwd_resources *rsrc)
 		   total_packets_rx,
 		   total_packets_dropped);
 	printf("\n====================================================\n");
+
+	fflush(stdout);
 }
 
 static void
diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c
index e0255080e..c2180c2d1 100644
--- a/examples/l2fwd-jobstats/main.c
+++ b/examples/l2fwd-jobstats/main.c
@@ -329,6 +329,9 @@ show_stats_cb(__rte_unused void *param)
 	}
 
 	printf("\n====================================================\n");
+
+	fflush(stdout);
+
 	rte_eal_alarm_set(timer_period * US_PER_S, show_stats_cb, NULL);
 }
 
diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c
index 3d59e2ca9..ba2745c91 100644
--- a/examples/l2fwd-keepalive/main.c
+++ b/examples/l2fwd-keepalive/main.c
@@ -160,6 +160,8 @@ print_stats(__attribute__((unused)) struct rte_timer *ptr_timer,
 		   total_packets_rx,
 		   total_packets_dropped);
 	printf("\n====================================================\n");
+
+	fflush(stdout);
 }
 
 static void
diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index fcef23273..e3767a315 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -146,6 +146,8 @@ print_stats(void)
 		   total_packets_rx,
 		   total_packets_dropped);
 	printf("\n====================================================\n");
+
+	fflush(stdout);
 }
 
 static void
diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
index 72f86e502..6b8c153b5 100644
--- a/examples/link_status_interrupt/main.c
+++ b/examples/link_status_interrupt/main.c
@@ -162,6 +162,8 @@ print_stats(void)
 		   total_packets_rx,
 		   total_packets_dropped);
 	printf("\n====================================================\n");
+
+	fflush(stdout);
 }
 
 static void
diff --git a/examples/tep_termination/main.c b/examples/tep_termination/main.c
index ab956ad7c..b9fffca02 100644
--- a/examples/tep_termination/main.c
+++ b/examples/tep_termination/main.c
@@ -1110,6 +1110,8 @@ print_stats(__rte_unused void *arg)
 			dev_ll = dev_ll->next;
 		}
 		printf("\n================================================\n");
+
+		fflush(stdout);
 	}
 
 	return NULL;
diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index ab649bf14..312829e8b 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -1334,6 +1334,8 @@ print_stats(__rte_unused void *arg)
 		}
 
 		printf("===================================================\n");
+
+		fflush(stdout);
 	}
 
 	return NULL;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:50.386118180 +0100
+++ 0046-examples-add-flush-after-stats-printing.patch	2020-07-24 12:53:48.267006087 +0100
@@ -1,8 +1,10 @@
-From 3ee6f706519c0a7456f3d8a79048150dfa6d2581 Mon Sep 17 00:00:00 2001
+From 0f7c8f75f2028230812f41473a702177dbd5aee2 Mon Sep 17 00:00:00 2001
 From: Georgiy Levashov <georgiy.levashov@oktetlabs.ru>
 Date: Tue, 28 Apr 2020 14:27:41 +0100
 Subject: [PATCH] examples: add flush after stats printing
 
+[ upstream commit 3ee6f706519c0a7456f3d8a79048150dfa6d2581 ]
+
 When printf()'s stdout is line-buffered for terminal, it is fully
 buffered for pipes. So, stdout listener can only get the output
 when it is flushed (on program termination, when buffer is filled or
@@ -15,7 +17,6 @@
 and parses the output.
 
 Fixes: af75078fece3 ("first public release")
-Cc: stable@dpdk.org
 
 Signed-off-by: Georgiy Levashov <georgiy.levashov@oktetlabs.ru>
 Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
@@ -60,7 +61,7 @@
  		ts.total_packets_rx += delta_ts.total_packets_rx;
  		ts.total_packets_dropped += delta_ts.total_packets_dropped;
 diff --git a/examples/kni/main.c b/examples/kni/main.c
-index 80dd0353e..f5d12a5b8 100644
+index d48a59fcb..7edc73ab9 100644
 --- a/examples/kni/main.c
 +++ b/examples/kni/main.c
 @@ -158,6 +158,8 @@ print_stats(void)
@@ -86,10 +87,10 @@
  
  static int
 diff --git a/examples/l2fwd-event/main.c b/examples/l2fwd-event/main.c
-index 9593ef11e..4fe500333 100644
+index 384b71238..7969a1c31 100644
 --- a/examples/l2fwd-event/main.c
 +++ b/examples/l2fwd-event/main.c
-@@ -516,6 +516,8 @@ print_stats(struct l2fwd_resources *rsrc)
+@@ -385,6 +385,8 @@ print_stats(struct l2fwd_resources *rsrc)
  		   total_packets_rx,
  		   total_packets_dropped);
  	printf("\n====================================================\n");
@@ -99,7 +100,7 @@
  
  static void
 diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c
-index 396fd89db..47a3b0976 100644
+index e0255080e..c2180c2d1 100644
 --- a/examples/l2fwd-jobstats/main.c
 +++ b/examples/l2fwd-jobstats/main.c
 @@ -329,6 +329,9 @@ show_stats_cb(__rte_unused void *param)
@@ -113,10 +114,10 @@
  }
  
 diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c
-index b7585d55e..b2742633b 100644
+index 3d59e2ca9..ba2745c91 100644
 --- a/examples/l2fwd-keepalive/main.c
 +++ b/examples/l2fwd-keepalive/main.c
-@@ -160,6 +160,8 @@ print_stats(__rte_unused struct rte_timer *ptr_timer,
+@@ -160,6 +160,8 @@ print_stats(__attribute__((unused)) struct rte_timer *ptr_timer,
  		   total_packets_rx,
  		   total_packets_dropped);
  	printf("\n====================================================\n");
@@ -126,7 +127,7 @@
  
  static void
 diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
-index f8d14b843..4a41aac63 100644
+index fcef23273..e3767a315 100644
 --- a/examples/l2fwd/main.c
 +++ b/examples/l2fwd/main.c
 @@ -146,6 +146,8 @@ print_stats(void)
@@ -139,7 +140,7 @@
  
  static void
 diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
-index 25efe2b09..9bbcadfcf 100644
+index 72f86e502..6b8c153b5 100644
 --- a/examples/link_status_interrupt/main.c
 +++ b/examples/link_status_interrupt/main.c
 @@ -162,6 +162,8 @@ print_stats(void)

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

* [dpdk-stable] patch 'sched: fix subport freeing' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (44 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'examples: add flush after stats printing' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'sched: fix 64-bit rate' " luca.boccassi
                   ` (145 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Hrvoje Habjanic; +Cc: Stephen Hemminger, Jasvinder Singh, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 748d2e4c16a67f83ae67ffaa35c2b6ec7b17f286 Mon Sep 17 00:00:00 2001
From: Hrvoje Habjanic <hrvoje.habjanic@zg.ht.hr>
Date: Tue, 26 May 2020 19:24:55 +0200
Subject: [PATCH] sched: fix subport freeing

[ upstream commit fbd8981cddf9ea558d5480cc3b02d3334482210f ]

In function rte_sched_subport_free, there is code to free all allocated
stuff related to scheduler subport.
First there are some checks, and in the end, rte_bitmap_free is called.

Now, rte_bitmap_free is a dummy function, and it just checks if
provided pointer to bitmap is valid or not. So, actual memory for
subport is not freed.

This patch fixes this by removing call to rte_bitmap_free, and
instead calling rte_free.

Fixes: d9213b829a31 ("sched: remove pipe params config from port level")

Signed-off-by: Hrvoje Habjanic <hrvoje.habjanic@zg.ht.hr>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
---
 lib/librte_sched/rte_sched.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c
index c0983ddda..f15a3b515 100644
--- a/lib/librte_sched/rte_sched.c
+++ b/lib/librte_sched/rte_sched.c
@@ -888,7 +888,7 @@ rte_sched_subport_free(struct rte_sched_port *port,
 		}
 	}
 
-	rte_bitmap_free(subport->bmp);
+	rte_free(subport);
 }
 
 void
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:50.429674275 +0100
+++ 0047-sched-fix-subport-freeing.patch	2020-07-24 12:53:48.267006087 +0100
@@ -1,8 +1,10 @@
-From fbd8981cddf9ea558d5480cc3b02d3334482210f Mon Sep 17 00:00:00 2001
+From 748d2e4c16a67f83ae67ffaa35c2b6ec7b17f286 Mon Sep 17 00:00:00 2001
 From: Hrvoje Habjanic <hrvoje.habjanic@zg.ht.hr>
 Date: Tue, 26 May 2020 19:24:55 +0200
 Subject: [PATCH] sched: fix subport freeing
 
+[ upstream commit fbd8981cddf9ea558d5480cc3b02d3334482210f ]
+
 In function rte_sched_subport_free, there is code to free all allocated
 stuff related to scheduler subport.
 First there are some checks, and in the end, rte_bitmap_free is called.
@@ -15,7 +17,6 @@
 instead calling rte_free.
 
 Fixes: d9213b829a31 ("sched: remove pipe params config from port level")
-Cc: stable@dpdk.org
 
 Signed-off-by: Hrvoje Habjanic <hrvoje.habjanic@zg.ht.hr>
 Acked-by: Stephen Hemminger <stephen@networkplumber.org>

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

* [dpdk-stable] patch 'sched: fix 64-bit rate' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (45 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'sched: fix subport freeing' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'bus/vmbus: fix ring buffer mapping' " luca.boccassi
                   ` (144 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Archit Pandey; +Cc: Jasvinder Singh, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 02200584e02b86974f8fd126bf6d3b9c64d9225f Mon Sep 17 00:00:00 2001
From: Archit Pandey <architpandeynitk@gmail.com>
Date: Tue, 2 Jun 2020 14:25:28 +0530
Subject: [PATCH] sched: fix 64-bit rate

[ upstream commit 78621061f7f8d20544f81b391a62acb735275add ]

64-bit support was missing from the functions pipe_profile_check
and rte_sched_subport_config_pipe_profile_table.

Fixes: 68c1f26d4236 ("sched: support 64-bit values")

Signed-off-by: Archit Pandey <architpandeynitk@gmail.com>
Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
---
 lib/librte_sched/rte_sched.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c
index f15a3b515..68a171b50 100644
--- a/lib/librte_sched/rte_sched.c
+++ b/lib/librte_sched/rte_sched.c
@@ -304,7 +304,7 @@ rte_sched_port_tc_queue(struct rte_sched_port *port, uint32_t qindex)
 
 static int
 pipe_profile_check(struct rte_sched_pipe_params *params,
-	uint32_t rate, uint16_t *qsize)
+	uint64_t rate, uint16_t *qsize)
 {
 	uint32_t i;
 
@@ -624,7 +624,7 @@ rte_sched_pipe_profile_convert(struct rte_sched_subport *subport,
 
 static void
 rte_sched_subport_config_pipe_profile_table(struct rte_sched_subport *subport,
-	struct rte_sched_subport_params *params, uint32_t rate)
+	struct rte_sched_subport_params *params, uint64_t rate)
 {
 	uint32_t i;
 
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:50.463559270 +0100
+++ 0048-sched-fix-64-bit-rate.patch	2020-07-24 12:53:48.271006162 +0100
@@ -1,13 +1,14 @@
-From 78621061f7f8d20544f81b391a62acb735275add Mon Sep 17 00:00:00 2001
+From 02200584e02b86974f8fd126bf6d3b9c64d9225f Mon Sep 17 00:00:00 2001
 From: Archit Pandey <architpandeynitk@gmail.com>
 Date: Tue, 2 Jun 2020 14:25:28 +0530
 Subject: [PATCH] sched: fix 64-bit rate
 
+[ upstream commit 78621061f7f8d20544f81b391a62acb735275add ]
+
 64-bit support was missing from the functions pipe_profile_check
 and rte_sched_subport_config_pipe_profile_table.
 
 Fixes: 68c1f26d4236 ("sched: support 64-bit values")
-Cc: stable@dpdk.org
 
 Signed-off-by: Archit Pandey <architpandeynitk@gmail.com>
 Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>

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

* [dpdk-stable] patch 'bus/vmbus: fix ring buffer mapping' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (46 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'sched: fix 64-bit rate' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'eal: remove redundant newline in alert message' " luca.boccassi
                   ` (143 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Long Li; +Cc: Stephen Hemminger, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 72dae964fdb23f613e384c4e0b811ab146b72fd1 Mon Sep 17 00:00:00 2001
From: Long Li <longli@microsoft.com>
Date: Thu, 11 Jun 2020 17:48:25 -0700
Subject: [PATCH] bus/vmbus: fix ring buffer mapping

[ upstream commit 1aef0aef3615d8b8d9d82cbb2d42afc2ae2bce7f ]

vmbus_map_addr is used as the next start virtual address for mapping ring
buffer. However it's updated based on ring_buf, which is a pointer to an
address on the stack. The next ring buffer may be mapped to an unexpected
address.

Fix this by calculating vmbus_map_addr based on returned virtual address.

Fixes: 3f9277031a2e ("bus/vmbus: fix check for mmap failure")

Signed-off-by: Long Li <longli@microsoft.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/bus/vmbus/linux/vmbus_uio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bus/vmbus/linux/vmbus_uio.c b/drivers/bus/vmbus/linux/vmbus_uio.c
index 5451bfd15..5dc0c47de 100644
--- a/drivers/bus/vmbus/linux/vmbus_uio.c
+++ b/drivers/bus/vmbus/linux/vmbus_uio.c
@@ -242,7 +242,7 @@ static int vmbus_uio_map_subchan(const struct rte_vmbus_device *dev,
 	*ring_size = file_size / 2;
 	*ring_buf = mapaddr;
 
-	vmbus_map_addr = RTE_PTR_ADD(ring_buf, file_size);
+	vmbus_map_addr = RTE_PTR_ADD(mapaddr, file_size);
 	return 0;
 }
 
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:50.503055446 +0100
+++ 0049-bus-vmbus-fix-ring-buffer-mapping.patch	2020-07-24 12:53:48.271006162 +0100
@@ -1,8 +1,10 @@
-From 1aef0aef3615d8b8d9d82cbb2d42afc2ae2bce7f Mon Sep 17 00:00:00 2001
+From 72dae964fdb23f613e384c4e0b811ab146b72fd1 Mon Sep 17 00:00:00 2001
 From: Long Li <longli@microsoft.com>
 Date: Thu, 11 Jun 2020 17:48:25 -0700
 Subject: [PATCH] bus/vmbus: fix ring buffer mapping
 
+[ upstream commit 1aef0aef3615d8b8d9d82cbb2d42afc2ae2bce7f ]
+
 vmbus_map_addr is used as the next start virtual address for mapping ring
 buffer. However it's updated based on ring_buf, which is a pointer to an
 address on the stack. The next ring buffer may be mapped to an unexpected
@@ -11,7 +13,6 @@
 Fix this by calculating vmbus_map_addr based on returned virtual address.
 
 Fixes: 3f9277031a2e ("bus/vmbus: fix check for mmap failure")
-Cc: stable@dpdk.org
 
 Signed-off-by: Long Li <longli@microsoft.com>
 Acked-by: Stephen Hemminger <stephen@networkplumber.org>

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

* [dpdk-stable] patch 'eal: remove redundant newline in alert message' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (47 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'bus/vmbus: fix ring buffer mapping' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'bus/pci: fix VF memory access' " luca.boccassi
                   ` (142 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: David Marchand; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From d5daa8c70fe9976df76a5f7908dc7540b042791c Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Wed, 10 Jun 2020 16:30:24 +0200
Subject: [PATCH] eal: remove redundant newline in alert message

[ upstream commit d58314aa3ccb57776fbc6d27d024cce4097dd619 ]

rte_eal_init_alert() already appends a newline.

Fixes: 0a529578f162 ("eal: clean up unused files on initialization")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 lib/librte_eal/freebsd/eal/eal.c | 2 +-
 lib/librte_eal/linux/eal/eal.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_eal/freebsd/eal/eal.c b/lib/librte_eal/freebsd/eal/eal.c
index 6ae37e7e6..2a995ee3f 100644
--- a/lib/librte_eal/freebsd/eal/eal.c
+++ b/lib/librte_eal/freebsd/eal/eal.c
@@ -949,7 +949,7 @@ rte_eal_init(int argc, char **argv)
 	 * place, so no cleanup needed.
 	 */
 	if (!internal_config.no_shconf && eal_clean_runtime_dir() < 0) {
-		rte_eal_init_alert("Cannot clear runtime directory\n");
+		rte_eal_init_alert("Cannot clear runtime directory");
 		return -1;
 	}
 
diff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/eal.c
index e6d4cc717..8f1bcab39 100644
--- a/lib/librte_eal/linux/eal/eal.c
+++ b/lib/librte_eal/linux/eal/eal.c
@@ -1288,7 +1288,7 @@ rte_eal_init(int argc, char **argv)
 	 * place, so no cleanup needed.
 	 */
 	if (!internal_config.no_shconf && eal_clean_runtime_dir() < 0) {
-		rte_eal_init_alert("Cannot clear runtime directory\n");
+		rte_eal_init_alert("Cannot clear runtime directory");
 		return -1;
 	}
 
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:50.538024271 +0100
+++ 0050-eal-remove-redundant-newline-in-alert-message.patch	2020-07-24 12:53:48.271006162 +0100
@@ -1,25 +1,26 @@
-From d58314aa3ccb57776fbc6d27d024cce4097dd619 Mon Sep 17 00:00:00 2001
+From d5daa8c70fe9976df76a5f7908dc7540b042791c Mon Sep 17 00:00:00 2001
 From: David Marchand <david.marchand@redhat.com>
 Date: Wed, 10 Jun 2020 16:30:24 +0200
 Subject: [PATCH] eal: remove redundant newline in alert message
 
+[ upstream commit d58314aa3ccb57776fbc6d27d024cce4097dd619 ]
+
 rte_eal_init_alert() already appends a newline.
 
 Fixes: 0a529578f162 ("eal: clean up unused files on initialization")
-Cc: stable@dpdk.org
 
 Signed-off-by: David Marchand <david.marchand@redhat.com>
 Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
 ---
- lib/librte_eal/freebsd/eal.c | 2 +-
- lib/librte_eal/linux/eal.c   | 2 +-
+ lib/librte_eal/freebsd/eal/eal.c | 2 +-
+ lib/librte_eal/linux/eal/eal.c   | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
 
-diff --git a/lib/librte_eal/freebsd/eal.c b/lib/librte_eal/freebsd/eal.c
-index c41f265fa..00fc66bf7 100644
---- a/lib/librte_eal/freebsd/eal.c
-+++ b/lib/librte_eal/freebsd/eal.c
-@@ -952,7 +952,7 @@ rte_eal_init(int argc, char **argv)
+diff --git a/lib/librte_eal/freebsd/eal/eal.c b/lib/librte_eal/freebsd/eal/eal.c
+index 6ae37e7e6..2a995ee3f 100644
+--- a/lib/librte_eal/freebsd/eal/eal.c
++++ b/lib/librte_eal/freebsd/eal/eal.c
+@@ -949,7 +949,7 @@ rte_eal_init(int argc, char **argv)
  	 * place, so no cleanup needed.
  	 */
  	if (!internal_config.no_shconf && eal_clean_runtime_dir() < 0) {
@@ -27,12 +28,12 @@
 +		rte_eal_init_alert("Cannot clear runtime directory");
  		return -1;
  	}
- 	if (!internal_config.no_telemetry) {
-diff --git a/lib/librte_eal/linux/eal.c b/lib/librte_eal/linux/eal.c
-index f162124a3..28a8b7851 100644
---- a/lib/librte_eal/linux/eal.c
-+++ b/lib/librte_eal/linux/eal.c
-@@ -1290,7 +1290,7 @@ rte_eal_init(int argc, char **argv)
+ 
+diff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/eal.c
+index e6d4cc717..8f1bcab39 100644
+--- a/lib/librte_eal/linux/eal/eal.c
++++ b/lib/librte_eal/linux/eal/eal.c
+@@ -1288,7 +1288,7 @@ rte_eal_init(int argc, char **argv)
  	 * place, so no cleanup needed.
  	 */
  	if (!internal_config.no_shconf && eal_clean_runtime_dir() < 0) {
@@ -40,7 +41,7 @@
 +		rte_eal_init_alert("Cannot clear runtime directory");
  		return -1;
  	}
- 	if (!internal_config.no_telemetry) {
+ 
 -- 
 2.20.1
 

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

* [dpdk-stable] patch 'bus/pci: fix VF memory access' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (48 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'eal: remove redundant newline in alert message' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'mbuf: fix boundary check at dynamic field registration' " luca.boccassi
                   ` (141 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Haiyue Wang
  Cc: Anatoly Burakov, Harman Kalra, David Marchand, Thierry Martin,
	dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 2381dc9e10050265ee3c6abf178328eee4322804 Mon Sep 17 00:00:00 2001
From: Haiyue Wang <haiyue.wang@intel.com>
Date: Thu, 25 Jun 2020 11:50:46 +0800
Subject: [PATCH] bus/pci: fix VF memory access

[ upstream commit 54f3fb127d9c265a5724d193e5c7c6db29fb4150 ]

To fix CVE-2020-12888, the linux vfio-pci module will invalidate mmaps
and block MMIO access on disabled memory, it will send a SIGBUS to the
application:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=abafbc551fdd

When the application opens the vfio PCI device, the vfio-pci module will
enable the bus memory space through PCI read/write access. According to
the PCIe specification, the 'Memory Space Enable' is always zero for VF:

             Table 9-13 Command Register Changes

Bit Location | PF and VF Register Differences | PF         | VF
             | From Base                      | Attributes | Attributes
-------------+--------------------------------+------------+-----------
             | Memory Space Enable - Does not |            |
             | apply to VFs. Must be hardwired|  Base      |  0b
     1       | to 0b for VFs. VF Memory Space |            |
             | is controlled by the VF MSE bit|            |
             | in the VF Control register.    |            |
-------------+--------------------------------+------------+-----------

Afterwards the vfio-pci will initialize its own virtual PCI config space
data ('vconfig') by reading the VF's physical PCI config space, then the
'Memory Space Enable' bit in vconfig will always be 0b value. This will
make the vfio-pci treat the BAR memory space as disabled, and the SIGBUS
will be triggered if access these BARs.

By investigation, the VF PCI device *passthrough* into the Guest OS by
QEMU has the 'Memory Space Enable' with 1b value. That's because every
PCI driver will start to enable the memory space, and this action will
be hooked by vfio-pci virtual PCI read/write to set the 'Memory Space
Enable' in vconfig space to 1b. So VF runs in guest OS has 'Mem+', but
VF runs in host OS has 'Mem-'.

Align with PCI working mode in Guest/QEMU/Host, in DPDK, enable the PCI
bus memory space explicitly to avoid access on disabled memory.

Fixes: 33604c31354a ("vfio: refactor PCI BAR mapping")

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: Harman Kalra <hkalra@marvell.com>
Tested-by: David Marchand <david.marchand@redhat.com>
Tested-by: Thierry Martin <thierry.martin.public@gmail.com>
---
 drivers/bus/pci/linux/pci_vfio.c | 37 ++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c
index 64cd84a68..ba60e7ce9 100644
--- a/drivers/bus/pci/linux/pci_vfio.c
+++ b/drivers/bus/pci/linux/pci_vfio.c
@@ -149,6 +149,38 @@ pci_vfio_get_msix_bar(int fd, struct pci_msix_table *msix_table)
 	return 0;
 }
 
+/* enable PCI bus memory space */
+static int
+pci_vfio_enable_bus_memory(int dev_fd)
+{
+	uint16_t cmd;
+	int ret;
+
+	ret = pread64(dev_fd, &cmd, sizeof(cmd),
+		      VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX) +
+		      PCI_COMMAND);
+
+	if (ret != sizeof(cmd)) {
+		RTE_LOG(ERR, EAL, "Cannot read command from PCI config space!\n");
+		return -1;
+	}
+
+	if (cmd & PCI_COMMAND_MEMORY)
+		return 0;
+
+	cmd |= PCI_COMMAND_MEMORY;
+	ret = pwrite64(dev_fd, &cmd, sizeof(cmd),
+		       VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX) +
+		       PCI_COMMAND);
+
+	if (ret != sizeof(cmd)) {
+		RTE_LOG(ERR, EAL, "Cannot write command to PCI config space!\n");
+		return -1;
+	}
+
+	return 0;
+}
+
 /* set PCI bus mastering */
 static int
 pci_vfio_set_bus_master(int dev_fd, bool op)
@@ -427,6 +459,11 @@ pci_rte_vfio_setup_device(struct rte_pci_device *dev, int vfio_dev_fd)
 		return -1;
 	}
 
+	if (pci_vfio_enable_bus_memory(vfio_dev_fd)) {
+		RTE_LOG(ERR, EAL, "Cannot enable bus memory!\n");
+		return -1;
+	}
+
 	/* set bus mastering for the device */
 	if (pci_vfio_set_bus_master(vfio_dev_fd, true)) {
 		RTE_LOG(ERR, EAL, "Cannot set up bus mastering!\n");
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:50.576143210 +0100
+++ 0051-bus-pci-fix-VF-memory-access.patch	2020-07-24 12:53:48.275006236 +0100
@@ -1,8 +1,10 @@
-From 54f3fb127d9c265a5724d193e5c7c6db29fb4150 Mon Sep 17 00:00:00 2001
+From 2381dc9e10050265ee3c6abf178328eee4322804 Mon Sep 17 00:00:00 2001
 From: Haiyue Wang <haiyue.wang@intel.com>
 Date: Thu, 25 Jun 2020 11:50:46 +0800
 Subject: [PATCH] bus/pci: fix VF memory access
 
+[ upstream commit 54f3fb127d9c265a5724d193e5c7c6db29fb4150 ]
+
 To fix CVE-2020-12888, the linux vfio-pci module will invalidate mmaps
 and block MMIO access on disabled memory, it will send a SIGBUS to the
 application:
@@ -41,7 +43,6 @@
 bus memory space explicitly to avoid access on disabled memory.
 
 Fixes: 33604c31354a ("vfio: refactor PCI BAR mapping")
-Cc: stable@dpdk.org
 
 Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
 Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

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

* [dpdk-stable] patch 'mbuf: fix boundary check at dynamic field registration' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (49 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'bus/pci: fix VF memory access' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'mbuf: fix error code in dynamic field/flag " luca.boccassi
                   ` (140 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Xiaolong Ye; +Cc: Olivier Matz, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From f32952bfab8ea4160ce82e2c1b6262397fa635bd Mon Sep 17 00:00:00 2001
From: Xiaolong Ye <xiaolong.ye@intel.com>
Date: Sat, 13 Jun 2020 23:49:17 +0800
Subject: [PATCH] mbuf: fix boundary check at dynamic field registration

[ upstream commit f8eb26dda8bfc806ff71f65966dc17210686fc20 ]

We should make sure off + size < sizeof(struct rte_mbuf) to avoid
possible out-of-bounds access of free_space array, there is no issue
currently due to the low bits of free_flags (which is adjacent to
free_space) are always set to 0. But we shouldn't rely on it since it's
fragile and layout of struct mbuf_dyn_shm may be changed in the future.
This patch adds boundary check explicitly to avoid potential risk of
out-of-bounds access.

Fixes: 4958ca3a443a ("mbuf: support dynamic fields and flags")

Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---
 lib/librte_mbuf/rte_mbuf_dyn.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/librte_mbuf/rte_mbuf_dyn.c b/lib/librte_mbuf/rte_mbuf_dyn.c
index 953e3ec31..13d6da6d1 100644
--- a/lib/librte_mbuf/rte_mbuf_dyn.c
+++ b/lib/librte_mbuf/rte_mbuf_dyn.c
@@ -69,7 +69,8 @@ process_score(void)
 
 	for (off = 0; off < sizeof(struct rte_mbuf); off++) {
 		/* get the size of the free zone */
-		for (size = 0; shm->free_space[off + size]; size++)
+		for (size = 0; (off + size) < sizeof(struct rte_mbuf) &&
+			     shm->free_space[off + size]; size++)
 			;
 		if (size == 0)
 			continue;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:50.613155067 +0100
+++ 0052-mbuf-fix-boundary-check-at-dynamic-field-registratio.patch	2020-07-24 12:53:48.275006236 +0100
@@ -1,8 +1,10 @@
-From f8eb26dda8bfc806ff71f65966dc17210686fc20 Mon Sep 17 00:00:00 2001
+From f32952bfab8ea4160ce82e2c1b6262397fa635bd Mon Sep 17 00:00:00 2001
 From: Xiaolong Ye <xiaolong.ye@intel.com>
 Date: Sat, 13 Jun 2020 23:49:17 +0800
 Subject: [PATCH] mbuf: fix boundary check at dynamic field registration
 
+[ upstream commit f8eb26dda8bfc806ff71f65966dc17210686fc20 ]
+
 We should make sure off + size < sizeof(struct rte_mbuf) to avoid
 possible out-of-bounds access of free_space array, there is no issue
 currently due to the low bits of free_flags (which is adjacent to
@@ -12,7 +14,6 @@
 out-of-bounds access.
 
 Fixes: 4958ca3a443a ("mbuf: support dynamic fields and flags")
-Cc: stable@dpdk.org
 
 Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
 Acked-by: Olivier Matz <olivier.matz@6wind.com>

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

* [dpdk-stable] patch 'mbuf: fix error code in dynamic field/flag registration' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (50 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'mbuf: fix boundary check at dynamic field registration' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'mbuf: fix free space update for dynamic field' " luca.boccassi
                   ` (139 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Xiaolong Ye; +Cc: Olivier Matz, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 862946d7be44ce2760558b274e90281363ab76dd Mon Sep 17 00:00:00 2001
From: Xiaolong Ye <xiaolong.ye@intel.com>
Date: Sat, 13 Jun 2020 23:49:18 +0800
Subject: [PATCH] mbuf: fix error code in dynamic field/flag registration

[ upstream commit 359386e15b4778e5924dcb90d5d686a1c865436f ]

Set rte_errno as ENOMEM when allocation failure.

Fixes: 4958ca3a443a ("mbuf: support dynamic fields and flags")

Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---
 lib/librte_mbuf/rte_mbuf_dyn.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lib/librte_mbuf/rte_mbuf_dyn.c b/lib/librte_mbuf/rte_mbuf_dyn.c
index 13d6da6d1..de7d2eb9a 100644
--- a/lib/librte_mbuf/rte_mbuf_dyn.c
+++ b/lib/librte_mbuf/rte_mbuf_dyn.c
@@ -278,12 +278,15 @@ __rte_mbuf_dynfield_register_offset(const struct rte_mbuf_dynfield *params,
 		mbuf_dynfield_tailq.head, mbuf_dynfield_list);
 
 	te = rte_zmalloc("MBUF_DYNFIELD_TAILQ_ENTRY", sizeof(*te), 0);
-	if (te == NULL)
+	if (te == NULL) {
+		rte_errno = ENOMEM;
 		return -1;
+	}
 
 	mbuf_dynfield = rte_zmalloc("mbuf_dynfield", sizeof(*mbuf_dynfield), 0);
 	if (mbuf_dynfield == NULL) {
 		rte_free(te);
+		rte_errno = ENOMEM;
 		return -1;
 	}
 
@@ -456,12 +459,15 @@ __rte_mbuf_dynflag_register_bitnum(const struct rte_mbuf_dynflag *params,
 		mbuf_dynflag_tailq.head, mbuf_dynflag_list);
 
 	te = rte_zmalloc("MBUF_DYNFLAG_TAILQ_ENTRY", sizeof(*te), 0);
-	if (te == NULL)
+	if (te == NULL) {
+		rte_errno = ENOMEM;
 		return -1;
+	}
 
 	mbuf_dynflag = rte_zmalloc("mbuf_dynflag", sizeof(*mbuf_dynflag), 0);
 	if (mbuf_dynflag == NULL) {
 		rte_free(te);
+		rte_errno = ENOMEM;
 		return -1;
 	}
 
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:50.649103082 +0100
+++ 0053-mbuf-fix-error-code-in-dynamic-field-flag-registrati.patch	2020-07-24 12:53:48.275006236 +0100
@@ -1,12 +1,13 @@
-From 359386e15b4778e5924dcb90d5d686a1c865436f Mon Sep 17 00:00:00 2001
+From 862946d7be44ce2760558b274e90281363ab76dd Mon Sep 17 00:00:00 2001
 From: Xiaolong Ye <xiaolong.ye@intel.com>
 Date: Sat, 13 Jun 2020 23:49:18 +0800
 Subject: [PATCH] mbuf: fix error code in dynamic field/flag registration
 
+[ upstream commit 359386e15b4778e5924dcb90d5d686a1c865436f ]
+
 Set rte_errno as ENOMEM when allocation failure.
 
 Fixes: 4958ca3a443a ("mbuf: support dynamic fields and flags")
-Cc: stable@dpdk.org
 
 Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
 Acked-by: Olivier Matz <olivier.matz@6wind.com>

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

* [dpdk-stable] patch 'mbuf: fix free space update for dynamic field' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (51 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'mbuf: fix error code in dynamic field/flag " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'mbuf: fix dynamic field dump log' " luca.boccassi
                   ` (138 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Xiaolong Ye; +Cc: Olivier Matz, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From a02840d607a77d63f35c918100145d17474263c5 Mon Sep 17 00:00:00 2001
From: Xiaolong Ye <xiaolong.ye@intel.com>
Date: Sat, 13 Jun 2020 23:49:19 +0800
Subject: [PATCH] mbuf: fix free space update for dynamic field

[ upstream commit 3a7fb882fdf32e1b50faac2331b2a48d89b4212e ]

The value free_space[i] is used to save the size of biggest aligned
element that can fit in the zone, current implementation has one flaw,
for example, if user registers dynfield1 (size = 4, align = 4, req = 124)
first, the free_space would be as below after registration:

  0070: 08 08 08 08 08 08 08 08
  0078: 08 08 08 08 00 00 00 00

Then if user continues to register dynfield2 (size = 4, align = 4),
free_space would become:

  0070: 00 00 00 00 04 04 04 04
  0078: 04 04 04 04 00 00 00 00

Further request dynfield3 (size = 8, align = 8) would fail to register
due to alignment requirement can't be satisfied, though there is enough
space remained in mbuf.

This patch fixes above issue by saving alignment only in aligned zone,
after the fix, above registrations order can be satisfied, free_space
would be like:

After dynfield1 registration:

  0070: 08 08 08 08 08 08 08 08
  0078: 04 04 04 04 00 00 00 00

After dynfield2 registration:

  0070: 08 08 08 08 08 08 08 08
  0078: 00 00 00 00 00 00 00 00

After dynfield3 registration:

  0070: 00 00 00 00 00 00 00 00
  0078: 00 00 00 00 00 00 00 00

This patch also reduces iterations in process_score() by jumping align
steps in each loop.

Fixes: 4958ca3a443a ("mbuf: support dynamic fields and flags")

Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---
 lib/librte_mbuf/rte_mbuf_dyn.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/lib/librte_mbuf/rte_mbuf_dyn.c b/lib/librte_mbuf/rte_mbuf_dyn.c
index de7d2eb9a..fd51e1b68 100644
--- a/lib/librte_mbuf/rte_mbuf_dyn.c
+++ b/lib/librte_mbuf/rte_mbuf_dyn.c
@@ -67,13 +67,16 @@ process_score(void)
 			shm->free_space[i] = 1;
 	}
 
-	for (off = 0; off < sizeof(struct rte_mbuf); off++) {
+	off = 0;
+	while (off < sizeof(struct rte_mbuf)) {
 		/* get the size of the free zone */
 		for (size = 0; (off + size) < sizeof(struct rte_mbuf) &&
 			     shm->free_space[off + size]; size++)
 			;
-		if (size == 0)
+		if (size == 0) {
+			off++;
 			continue;
+		}
 
 		/* get the alignment of biggest object that can fit in
 		 * the zone at this offset.
@@ -84,8 +87,10 @@ process_score(void)
 			;
 
 		/* save it in free_space[] */
-		for (i = off; i < off + size; i++)
+		for (i = off; i < off + align; i++)
 			shm->free_space[i] = RTE_MAX(align, shm->free_space[i]);
+
+		off += align;
 	}
 }
 
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:50.685126954 +0100
+++ 0054-mbuf-fix-free-space-update-for-dynamic-field.patch	2020-07-24 12:53:48.275006236 +0100
@@ -1,8 +1,10 @@
-From 3a7fb882fdf32e1b50faac2331b2a48d89b4212e Mon Sep 17 00:00:00 2001
+From a02840d607a77d63f35c918100145d17474263c5 Mon Sep 17 00:00:00 2001
 From: Xiaolong Ye <xiaolong.ye@intel.com>
 Date: Sat, 13 Jun 2020 23:49:19 +0800
 Subject: [PATCH] mbuf: fix free space update for dynamic field
 
+[ upstream commit 3a7fb882fdf32e1b50faac2331b2a48d89b4212e ]
+
 The value free_space[i] is used to save the size of biggest aligned
 element that can fit in the zone, current implementation has one flaw,
 for example, if user registers dynfield1 (size = 4, align = 4, req = 124)
@@ -44,7 +46,6 @@
 steps in each loop.
 
 Fixes: 4958ca3a443a ("mbuf: support dynamic fields and flags")
-Cc: stable@dpdk.org
 
 Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
 Acked-by: Olivier Matz <olivier.matz@6wind.com>

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

* [dpdk-stable] patch 'mbuf: fix dynamic field dump log' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (52 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'mbuf: fix free space update for dynamic field' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'doc: update build instructions in the Linux guide' " luca.boccassi
                   ` (137 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Xiaolong Ye; +Cc: Olivier Matz, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 6ee60749a3bd4966bcb6cff79bac86c416fdcace Mon Sep 17 00:00:00 2001
From: Xiaolong Ye <xiaolong.ye@intel.com>
Date: Sat, 13 Jun 2020 23:49:20 +0800
Subject: [PATCH] mbuf: fix dynamic field dump log

[ upstream commit d27a4cb3efe64b5441edd4cd214299e1e4b08ec8 ]

For each mbuf byte, free_space[i] == 0 means the space is occupied,
free_space[i] != 0 means space is free.

Fixes: 4958ca3a443a ("mbuf: support dynamic fields and flags")

Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---
 lib/librte_mbuf/rte_mbuf_dyn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_mbuf/rte_mbuf_dyn.c b/lib/librte_mbuf/rte_mbuf_dyn.c
index fd51e1b68..f071651ac 100644
--- a/lib/librte_mbuf/rte_mbuf_dyn.c
+++ b/lib/librte_mbuf/rte_mbuf_dyn.c
@@ -552,7 +552,7 @@ void rte_mbuf_dyn_dump(FILE *out)
 			dynflag->params.name, dynflag->bitnum,
 			dynflag->params.flags);
 	}
-	fprintf(out, "Free space in mbuf (0 = free, value = zone alignment):\n");
+	fprintf(out, "Free space in mbuf (0 = occupied, value = free zone alignment):\n");
 	for (i = 0; i < sizeof(struct rte_mbuf); i++) {
 		if ((i % 8) == 0)
 			fprintf(out, "  %4.4zx: ", i);
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:50.726217502 +0100
+++ 0055-mbuf-fix-dynamic-field-dump-log.patch	2020-07-24 12:53:48.275006236 +0100
@@ -1,13 +1,14 @@
-From d27a4cb3efe64b5441edd4cd214299e1e4b08ec8 Mon Sep 17 00:00:00 2001
+From 6ee60749a3bd4966bcb6cff79bac86c416fdcace Mon Sep 17 00:00:00 2001
 From: Xiaolong Ye <xiaolong.ye@intel.com>
 Date: Sat, 13 Jun 2020 23:49:20 +0800
 Subject: [PATCH] mbuf: fix dynamic field dump log
 
+[ upstream commit d27a4cb3efe64b5441edd4cd214299e1e4b08ec8 ]
+
 For each mbuf byte, free_space[i] == 0 means the space is occupied,
 free_space[i] != 0 means space is free.
 
 Fixes: 4958ca3a443a ("mbuf: support dynamic fields and flags")
-Cc: stable@dpdk.org
 
 Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
 Acked-by: Olivier Matz <olivier.matz@6wind.com>

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

* [dpdk-stable] patch 'doc: update build instructions in the Linux guide' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (53 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'mbuf: fix dynamic field dump log' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'build: fix drivers library path on Windows' " luca.boccassi
                   ` (136 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: Bruce Richardson, David Marchand, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 15318529bd10ad8cc0c90aa152b369c23853d580 Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas@monjalon.net>
Date: Wed, 17 Jun 2020 23:41:25 +0200
Subject: [PATCH] doc: update build instructions in the Linux guide

[ upstream commit 520bbb9cd9215c7139244b06f5041722e91bf14a ]

Before removing the "make" build system completely,
the Linux guide instructions are made more concise and accurate.
Some detailed explanations are also available in
doc/guides/prog_guide/dev_kit_root_make_help.rst

This is the swan song for makefile system,
in order to have accurate information backported in LTS.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: David Marchand <david.marchand@redhat.com>
---
 doc/guides/linux_gsg/build_dpdk.rst | 66 ++++++++---------------------
 1 file changed, 18 insertions(+), 48 deletions(-)

diff --git a/doc/guides/linux_gsg/build_dpdk.rst b/doc/guides/linux_gsg/build_dpdk.rst
index 4aeb4697d..c536e354e 100644
--- a/doc/guides/linux_gsg/build_dpdk.rst
+++ b/doc/guides/linux_gsg/build_dpdk.rst
@@ -167,60 +167,32 @@ Installation of DPDK Target Environment using Make
    is therefore recommended that DPDK installation is done using meson and
    ninja as described above.
 
-The format of a DPDK target is::
+Get a native target environment automatically::
 
-    ARCH-MACHINE-EXECENV-TOOLCHAIN
-
-where:
-
-* ``ARCH`` can be:  ``i686``, ``x86_64``, ``ppc_64``, ``arm64``
-
-* ``MACHINE`` can be:  ``native``, ``power8``, ``armv8a``
-
-* ``EXECENV`` can be:  ``linux``,  ``freebsd``
-
-* ``TOOLCHAIN`` can be:  ``gcc``,  ``icc``
-
-The targets to be installed depend on the 32-bit and/or 64-bit packages and compilers installed on the host.
-Available targets can be found in the DPDK/config directory.
-The defconfig\_ prefix should not be used.
+   make defconfig O=mybuild
 
 .. note::
 
-    Configuration files are provided with the ``RTE_MACHINE`` optimization level set.
     Within the configuration files, the ``RTE_MACHINE`` configuration value is set to native,
     which means that the compiled software is tuned for the platform on which it is built.
-    For more information on this setting, and its possible values, see the *DPDK Programmers Guide*.
 
-When using the Intel® C++ Compiler (icc), one of the following commands should be invoked for 64-bit or 32-bit use respectively.
-Notice that the shell scripts update the ``$PATH`` variable and therefore should not be performed in the same session.
-Also, verify the compiler's installation directory since the path may be different:
+Or get a specific target environment::
 
-.. code-block:: console
+   make config T=x86_64-native-linux-gcc O=mybuild
 
-    source /opt/intel/bin/iccvars.sh intel64
-    source /opt/intel/bin/iccvars.sh ia32
+The format of a DPDK target is "ARCH-MACHINE-EXECENV-TOOLCHAIN".
+Available targets can be found with::
 
-To install and make targets, use the ``make install T=<target>`` command in the top-level DPDK directory.
+   make help
 
-For example, to compile a 64-bit target using icc, run:
+Customize the target configuration in the generated ``.config`` file.
+Example for enabling the pcap PMD::
 
-.. code-block:: console
+   sed -ri 's,(PMD_PCAP=).*,\1y,' mybuild/.config
 
-    make install T=x86_64-native-linux-icc
+Compile the target::
 
-To compile a 32-bit build using gcc, the make command should be:
-
-.. code-block:: console
-
-    make install T=i686-native-linux-gcc
-
-To prepare a target without building it, for example, if the configuration changes need to be made before compilation,
-use the ``make config T=<target>`` command:
-
-.. code-block:: console
-
-    make config T=x86_64-native-linux-gcc
+   make -j4 O=mybuild
 
 .. warning::
 
@@ -229,15 +201,13 @@ use the ``make config T=<target>`` command:
     If the DPDK is not being built on the target machine,
     the ``RTE_KERNELDIR`` environment variable should be used to point the compilation at a copy of the kernel version to be used on the target machine.
 
-Once the target environment is created, the user may move to the target environment directory and continue to make code changes and re-compile.
-The user may also make modifications to the compile-time DPDK configuration by editing the .config file in the build directory.
-(This is a build-local copy of the defconfig file from the top- level config directory).
+Install the target in a separate directory::
 
-.. code-block:: console
+   make install O=mybuild DESTDIR=myinstall prefix=
 
-    cd x86_64-native-linux-gcc
-    vi .config
-    make
+The environment is ready to build a DPDK application::
+
+   RTE_SDK=$(pwd)/myinstall/share/dpdk RTE_TARGET=x86_64-native-linux-gcc make -C myapp
 
 In addition, the make clean command can be used to remove any existing compiled files for a subsequent full, clean rebuild of the code.
 
@@ -245,5 +215,5 @@ Browsing the Installed DPDK Environment Target
 ----------------------------------------------
 
 Once a target is created it contains all libraries, including poll-mode drivers, and header files for the DPDK environment that are required to build customer applications.
-In addition, the test and testpmd applications are built under the build/app directory, which may be used for testing.
+In addition, the test applications are built under the app directory, which may be used for testing.
 A kmod  directory is also present that contains kernel modules which may be loaded if needed.
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:50.762877735 +0100
+++ 0056-doc-update-build-instructions-in-the-Linux-guide.patch	2020-07-24 12:53:48.275006236 +0100
@@ -1,8 +1,10 @@
-From 520bbb9cd9215c7139244b06f5041722e91bf14a Mon Sep 17 00:00:00 2001
+From 15318529bd10ad8cc0c90aa152b369c23853d580 Mon Sep 17 00:00:00 2001
 From: Thomas Monjalon <thomas@monjalon.net>
 Date: Wed, 17 Jun 2020 23:41:25 +0200
 Subject: [PATCH] doc: update build instructions in the Linux guide
 
+[ upstream commit 520bbb9cd9215c7139244b06f5041722e91bf14a ]
+
 Before removing the "make" build system completely,
 the Linux guide instructions are made more concise and accurate.
 Some detailed explanations are also available in
@@ -11,8 +13,6 @@
 This is the swan song for makefile system,
 in order to have accurate information backported in LTS.
 
-Cc: stable@dpdk.org
-
 Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
 Acked-by: Bruce Richardson <bruce.richardson@intel.com>
 Acked-by: David Marchand <david.marchand@redhat.com>

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

* [dpdk-stable] patch 'build: fix drivers library path on Windows' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (54 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'doc: update build instructions in the Linux guide' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'pci: fix address domain format size' " luca.boccassi
                   ` (135 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Tal Shnaiderman; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 621b21301cc0fcf240a6fc0622f58ec8ff798136 Mon Sep 17 00:00:00 2001
From: Tal Shnaiderman <talshn@mellanox.com>
Date: Mon, 29 Jun 2020 15:37:38 +0300
Subject: [PATCH] build: fix drivers library path on Windows

[ upstream commit 77cca7ccec13b617c64f21c573c9e6ac5b4aed64 ]

import library (/IMPLIB) in meson.build should use
the 'drivers' and not 'libs' folder.

The error is: fatal error LNK1149: output filename matches input filename.
The fix uses the correct folder.

Fixes: 5ed3766981 ("drivers: process shared link dependencies as for libs")

Signed-off-by: Tal Shnaiderman <talshn@mellanox.com>
---
 drivers/meson.build | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/meson.build b/drivers/meson.build
index 32d68aa1d..4246cc32a 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -151,7 +151,7 @@ foreach class:dpdk_driver_classes
 			version_map = '@0@/@1@/@2@_version.map'.format(
 					meson.current_source_dir(),
 					drv_path, lib_name)
-			implib = dir_name + '.dll.a'
+			implib = 'lib' + lib_name + '.dll.a'
 
 			def_file = custom_target(lib_name + '_def',
 				command: [map_to_def_cmd, '@INPUT@', '@OUTPUT@'],
@@ -159,8 +159,12 @@ foreach class:dpdk_driver_classes
 				output: '@0@_exports.def'.format(lib_name))
 			lk_deps = [version_map, def_file]
 			if is_windows
-				lk_args = ['-Wl,/def:' + def_file.full_path(),
-					'-Wl,/implib:lib\\' + implib]
+				if is_ms_linker
+					lk_args = ['-Wl,/def:' + def_file.full_path(),
+						'-Wl,/implib:drivers\\' + implib]
+				else
+					lk_args = []
+				endif
 			else
 				lk_args = ['-Wl,--version-script=' + version_map]
 				# on unix systems check the output of the
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:50.802101153 +0100
+++ 0057-build-fix-drivers-library-path-on-Windows.patch	2020-07-24 12:53:48.275006236 +0100
@@ -1,8 +1,10 @@
-From 77cca7ccec13b617c64f21c573c9e6ac5b4aed64 Mon Sep 17 00:00:00 2001
+From 621b21301cc0fcf240a6fc0622f58ec8ff798136 Mon Sep 17 00:00:00 2001
 From: Tal Shnaiderman <talshn@mellanox.com>
 Date: Mon, 29 Jun 2020 15:37:38 +0300
 Subject: [PATCH] build: fix drivers library path on Windows
 
+[ upstream commit 77cca7ccec13b617c64f21c573c9e6ac5b4aed64 ]
+
 import library (/IMPLIB) in meson.build should use
 the 'drivers' and not 'libs' folder.
 
@@ -10,7 +12,6 @@
 The fix uses the correct folder.
 
 Fixes: 5ed3766981 ("drivers: process shared link dependencies as for libs")
-Cc: stable@dpdk.org
 
 Signed-off-by: Tal Shnaiderman <talshn@mellanox.com>
 ---
@@ -18,10 +19,10 @@
  1 file changed, 7 insertions(+), 3 deletions(-)
 
 diff --git a/drivers/meson.build b/drivers/meson.build
-index 6ce2d6b50..ccdc73868 100644
+index 32d68aa1d..4246cc32a 100644
 --- a/drivers/meson.build
 +++ b/drivers/meson.build
-@@ -153,7 +153,7 @@ foreach class:dpdk_driver_classes
+@@ -151,7 +151,7 @@ foreach class:dpdk_driver_classes
  			version_map = '@0@/@1@/@2@_version.map'.format(
  					meson.current_source_dir(),
  					drv_path, lib_name)
@@ -30,7 +31,7 @@
  
  			def_file = custom_target(lib_name + '_def',
  				command: [map_to_def_cmd, '@INPUT@', '@OUTPUT@'],
-@@ -161,8 +161,12 @@ foreach class:dpdk_driver_classes
+@@ -159,8 +159,12 @@ foreach class:dpdk_driver_classes
  				output: '@0@_exports.def'.format(lib_name))
  			lk_deps = [version_map, def_file]
  			if is_windows

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

* [dpdk-stable] patch 'pci: fix address domain format size' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (55 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'build: fix drivers library path on Windows' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'net/ice/base: fix VSI ID mask to 10 bits' " luca.boccassi
                   ` (134 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Tal Shnaiderman; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 9cd4c0f0a74ecd514e61c2ddf15ccb37bf58b3ee Mon Sep 17 00:00:00 2001
From: Tal Shnaiderman <talshn@mellanox.com>
Date: Mon, 29 Jun 2020 15:37:36 +0300
Subject: [PATCH] pci: fix address domain format size

[ upstream commit 8517072c8715556968b59e5872f580c7cad2e53c ]

the struct rte_pci_addr defines domain as uint32_t variable however
the PCI_PRI_FMT macro used for logging the struct sets the format
of domain to uint16_t.

The mismatch causes the following warning messages
in Windows clang build:

format specifies type 'unsigned short' but the argument
has type 'uint32_t' (aka 'unsigned int') [-Wformat]

Fixes: af75078fece3 ("first public release")

Signed-off-by: Tal Shnaiderman <talshn@mellanox.com>
---
 lib/librte_pci/rte_pci.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_pci/rte_pci.h b/lib/librte_pci/rte_pci.h
index 4087771c1..db8391965 100644
--- a/lib/librte_pci/rte_pci.h
+++ b/lib/librte_pci/rte_pci.h
@@ -22,7 +22,7 @@ extern "C" {
 #include <inttypes.h>
 
 /** Formatting string for PCI device identifier: Ex: 0000:00:01.0 */
-#define PCI_PRI_FMT "%.4" PRIx16 ":%.2" PRIx8 ":%.2" PRIx8 ".%" PRIx8
+#define PCI_PRI_FMT "%.4" PRIx32 ":%.2" PRIx8 ":%.2" PRIx8 ".%" PRIx8
 #define PCI_PRI_STR_SIZE sizeof("XXXXXXXX:XX:XX.X")
 
 /** Short formatting string, without domain, for PCI device: Ex: 00:01.0 */
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:50.838662061 +0100
+++ 0058-pci-fix-address-domain-format-size.patch	2020-07-24 12:53:48.275006236 +0100
@@ -1,8 +1,10 @@
-From 8517072c8715556968b59e5872f580c7cad2e53c Mon Sep 17 00:00:00 2001
+From 9cd4c0f0a74ecd514e61c2ddf15ccb37bf58b3ee Mon Sep 17 00:00:00 2001
 From: Tal Shnaiderman <talshn@mellanox.com>
 Date: Mon, 29 Jun 2020 15:37:36 +0300
 Subject: [PATCH] pci: fix address domain format size
 
+[ upstream commit 8517072c8715556968b59e5872f580c7cad2e53c ]
+
 the struct rte_pci_addr defines domain as uint32_t variable however
 the PCI_PRI_FMT macro used for logging the struct sets the format
 of domain to uint16_t.
@@ -14,7 +16,6 @@
 has type 'uint32_t' (aka 'unsigned int') [-Wformat]
 
 Fixes: af75078fece3 ("first public release")
-Cc: stable@dpdk.org
 
 Signed-off-by: Tal Shnaiderman <talshn@mellanox.com>
 ---
@@ -22,11 +23,11 @@
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/lib/librte_pci/rte_pci.h b/lib/librte_pci/rte_pci.h
-index 933707917..104b2bb85 100644
+index 4087771c1..db8391965 100644
 --- a/lib/librte_pci/rte_pci.h
 +++ b/lib/librte_pci/rte_pci.h
-@@ -23,7 +23,7 @@ extern "C" {
- #include <sys/types.h>
+@@ -22,7 +22,7 @@ extern "C" {
+ #include <inttypes.h>
  
  /** Formatting string for PCI device identifier: Ex: 0000:00:01.0 */
 -#define PCI_PRI_FMT "%.4" PRIx16 ":%.2" PRIx8 ":%.2" PRIx8 ".%" PRIx8

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

* [dpdk-stable] patch 'net/ice/base: fix VSI ID mask to 10 bits' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (56 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'pci: fix address domain format size' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'net/mlx5: remove redundant newline from logs' " luca.boccassi
                   ` (133 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Qi Zhang; +Cc: Kiran Patil, Paul M Stillwell Jr, Qiming Yang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From d4d6d0560a9fb1ce894bb37a389b912b35cb5743 Mon Sep 17 00:00:00 2001
From: Qi Zhang <qi.z.zhang@intel.com>
Date: Thu, 11 Jun 2020 16:43:29 +0800
Subject: [PATCH] net/ice/base: fix VSI ID mask to 10 bits

[ upstream commit 072158c6527c02277ea2a03f844f9b2103c33d42 ]

set_rss_lut failed due to incorrect vsi_id mask. vsi_id is 10 bit
but mask was 0x1FF whereas it should be 0x3FF.

For vsi_num >= 512, FW set_rss_lut has been failing with return code
EACCESS (vsi ownership issue) because software was providing
incorrect vsi_num (dropping 10th bit due to incorrect mask) for
set_rss_lut admin command

Fixes: a90fae1d0755 ("net/ice/base: add admin queue structures and commands")

Signed-off-by: Kiran Patil <kiran.patil@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
---
 drivers/net/ice/base/ice_adminq_cmd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ice/base/ice_adminq_cmd.h b/drivers/net/ice/base/ice_adminq_cmd.h
index d196434f4..2118247a7 100644
--- a/drivers/net/ice/base/ice_adminq_cmd.h
+++ b/drivers/net/ice/base/ice_adminq_cmd.h
@@ -1935,7 +1935,7 @@ struct ice_aqc_get_set_rss_keys {
 struct ice_aqc_get_set_rss_lut {
 #define ICE_AQC_GSET_RSS_LUT_VSI_VALID	BIT(15)
 #define ICE_AQC_GSET_RSS_LUT_VSI_ID_S	0
-#define ICE_AQC_GSET_RSS_LUT_VSI_ID_M	(0x1FF << ICE_AQC_GSET_RSS_LUT_VSI_ID_S)
+#define ICE_AQC_GSET_RSS_LUT_VSI_ID_M	(0x3FF << ICE_AQC_GSET_RSS_LUT_VSI_ID_S)
 	__le16 vsi_id;
 #define ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_S	0
 #define ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_M	\
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:50.874068911 +0100
+++ 0059-net-ice-base-fix-VSI-ID-mask-to-10-bits.patch	2020-07-24 12:53:48.279006311 +0100
@@ -1,8 +1,10 @@
-From 072158c6527c02277ea2a03f844f9b2103c33d42 Mon Sep 17 00:00:00 2001
+From d4d6d0560a9fb1ce894bb37a389b912b35cb5743 Mon Sep 17 00:00:00 2001
 From: Qi Zhang <qi.z.zhang@intel.com>
 Date: Thu, 11 Jun 2020 16:43:29 +0800
 Subject: [PATCH] net/ice/base: fix VSI ID mask to 10 bits
 
+[ upstream commit 072158c6527c02277ea2a03f844f9b2103c33d42 ]
+
 set_rss_lut failed due to incorrect vsi_id mask. vsi_id is 10 bit
 but mask was 0x1FF whereas it should be 0x3FF.
 
@@ -12,7 +14,6 @@
 set_rss_lut admin command
 
 Fixes: a90fae1d0755 ("net/ice/base: add admin queue structures and commands")
-Cc: stable@dpdk.org
 
 Signed-off-by: Kiran Patil <kiran.patil@intel.com>
 Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
@@ -23,10 +24,10 @@
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/drivers/net/ice/base/ice_adminq_cmd.h b/drivers/net/ice/base/ice_adminq_cmd.h
-index eaf6c3d0e..9ee5b4eb5 100644
+index d196434f4..2118247a7 100644
 --- a/drivers/net/ice/base/ice_adminq_cmd.h
 +++ b/drivers/net/ice/base/ice_adminq_cmd.h
-@@ -1992,7 +1992,7 @@ struct ice_aqc_get_set_rss_keys {
+@@ -1935,7 +1935,7 @@ struct ice_aqc_get_set_rss_keys {
  struct ice_aqc_get_set_rss_lut {
  #define ICE_AQC_GSET_RSS_LUT_VSI_VALID	BIT(15)
  #define ICE_AQC_GSET_RSS_LUT_VSI_ID_S	0

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

* [dpdk-stable] patch 'net/mlx5: remove redundant newline from logs' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (57 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'net/ice/base: fix VSI ID mask to 10 bits' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'net/qede: fix multicast drop in promiscuous mode' " luca.boccassi
                   ` (132 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: David Marchand; +Cc: Viacheslav Ovsiienko, Xiaoyu Min, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From c429d2d7431630334f28e9bcc009f4985eb0c780 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Wed, 17 Jun 2020 15:53:24 +0200
Subject: [PATCH] net/mlx5: remove redundant newline from logs

[ upstream commit 63783b0172476208d27999441880764d9ea1fedf ]

The DRV_LOG macro already appends a newline.

Fixes: 46287eacc1b1 ("net/mlx5: introduce hash list")
Fixes: 860897d2895a ("net/mlx5: reorganize flow tables with hash list")
Fixes: e484e4032332 ("net/mlx5: optimize tag traversal with hash list")
Fixes: 6801116688fe ("net/mlx5: fix multiple flow table hash list")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Xiaoyu Min <jackmin@mellanox.com>
---
 drivers/net/mlx5/mlx5.c       | 6 +++---
 drivers/net/mlx5/mlx5_utils.c | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index bb718f27f..ce76c96db 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -867,7 +867,7 @@ mlx5_alloc_table_hash_list(struct mlx5_priv *priv)
 	snprintf(s, sizeof(s), "%s_flow_table", priv->sh->ibdev_name);
 	sh->flow_tbls = mlx5_hlist_create(s, MLX5_FLOW_TABLE_HLIST_ARRAY_SIZE);
 	if (!sh->flow_tbls) {
-		DRV_LOG(ERR, "flow tables with hash creation failed.\n");
+		DRV_LOG(ERR, "flow tables with hash creation failed.");
 		err = ENOMEM;
 		return err;
 	}
@@ -951,7 +951,7 @@ mlx5_alloc_shared_dr(struct mlx5_priv *priv)
 	if (!sh->flow_tbls)
 		err = mlx5_alloc_table_hash_list(priv);
 	else
-		DRV_LOG(DEBUG, "sh->flow_tbls[%p] already created, reuse\n",
+		DRV_LOG(DEBUG, "sh->flow_tbls[%p] already created, reuse",
 			(void *)sh->flow_tbls);
 	if (err)
 		return err;
@@ -959,7 +959,7 @@ mlx5_alloc_shared_dr(struct mlx5_priv *priv)
 	snprintf(s, sizeof(s), "%s_tags", sh->ibdev_name);
 	sh->tag_table = mlx5_hlist_create(s, MLX5_TAGS_HLIST_ARRAY_SIZE);
 	if (!sh->tag_table) {
-		DRV_LOG(ERR, "tags with hash creation failed.\n");
+		DRV_LOG(ERR, "tags with hash creation failed.");
 		err = ENOMEM;
 		goto error;
 	}
diff --git a/drivers/net/mlx5/mlx5_utils.c b/drivers/net/mlx5/mlx5_utils.c
index 5d86615ea..c1c238941 100644
--- a/drivers/net/mlx5/mlx5_utils.c
+++ b/drivers/net/mlx5/mlx5_utils.c
@@ -20,7 +20,7 @@ mlx5_hlist_create(const char *name, uint32_t size)
 	if (!rte_is_power_of_2(size)) {
 		act_size = rte_align32pow2(size);
 		DRV_LOG(WARNING, "Size 0x%" PRIX32 " is not power of 2, will "
-			"be aligned to 0x%" PRIX32 ".\n", size, act_size);
+			"be aligned to 0x%" PRIX32 ".", size, act_size);
 	} else {
 		act_size = size;
 	}
@@ -29,7 +29,7 @@ mlx5_hlist_create(const char *name, uint32_t size)
 	/* Using zmalloc, then no need to initialize the heads. */
 	h = rte_zmalloc(name, alloc_size, RTE_CACHE_LINE_SIZE);
 	if (!h) {
-		DRV_LOG(ERR, "No memory for hash list %s creation\n",
+		DRV_LOG(ERR, "No memory for hash list %s creation",
 			name ? name : "None");
 		return NULL;
 	}
@@ -37,7 +37,7 @@ mlx5_hlist_create(const char *name, uint32_t size)
 		snprintf(h->name, MLX5_HLIST_NAMESIZE, "%s", name);
 	h->table_sz = act_size;
 	h->mask = act_size - 1;
-	DRV_LOG(DEBUG, "Hash list with %s size 0x%" PRIX32 " is created.\n",
+	DRV_LOG(DEBUG, "Hash list with %s size 0x%" PRIX32 " is created.",
 		h->name, act_size);
 	return h;
 }
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:50.913763643 +0100
+++ 0060-net-mlx5-remove-redundant-newline-from-logs.patch	2020-07-24 12:53:48.283006385 +0100
@@ -1,43 +1,30 @@
-From 63783b0172476208d27999441880764d9ea1fedf Mon Sep 17 00:00:00 2001
+From c429d2d7431630334f28e9bcc009f4985eb0c780 Mon Sep 17 00:00:00 2001
 From: David Marchand <david.marchand@redhat.com>
 Date: Wed, 17 Jun 2020 15:53:24 +0200
 Subject: [PATCH] net/mlx5: remove redundant newline from logs
 
+[ upstream commit 63783b0172476208d27999441880764d9ea1fedf ]
+
 The DRV_LOG macro already appends a newline.
 
 Fixes: 46287eacc1b1 ("net/mlx5: introduce hash list")
 Fixes: 860897d2895a ("net/mlx5: reorganize flow tables with hash list")
 Fixes: e484e4032332 ("net/mlx5: optimize tag traversal with hash list")
 Fixes: 6801116688fe ("net/mlx5: fix multiple flow table hash list")
-Cc: stable@dpdk.org
 
 Signed-off-by: David Marchand <david.marchand@redhat.com>
 Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
 Acked-by: Xiaoyu Min <jackmin@mellanox.com>
 ---
- drivers/net/mlx5/linux/mlx5_os.c | 2 +-
- drivers/net/mlx5/mlx5.c          | 2 +-
- drivers/net/mlx5/mlx5_utils.c    | 6 +++---
- 3 files changed, 5 insertions(+), 5 deletions(-)
+ drivers/net/mlx5/mlx5.c       | 6 +++---
+ drivers/net/mlx5/mlx5_utils.c | 6 +++---
+ 2 files changed, 6 insertions(+), 6 deletions(-)
 
-diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c
-index b330cd553..797887319 100644
---- a/drivers/net/mlx5/linux/mlx5_os.c
-+++ b/drivers/net/mlx5/linux/mlx5_os.c
-@@ -284,7 +284,7 @@ mlx5_alloc_shared_dr(struct mlx5_priv *priv)
- 	snprintf(s, sizeof(s), "%s_tags", sh->ibdev_name);
- 	sh->tag_table = mlx5_hlist_create(s, MLX5_TAGS_HLIST_ARRAY_SIZE);
- 	if (!sh->tag_table) {
--		DRV_LOG(ERR, "tags with hash creation failed.\n");
-+		DRV_LOG(ERR, "tags with hash creation failed.");
- 		err = ENOMEM;
- 		goto error;
- 	}
 diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
-index 5c86f6fb9..c13e71608 100644
+index bb718f27f..ce76c96db 100644
 --- a/drivers/net/mlx5/mlx5.c
 +++ b/drivers/net/mlx5/mlx5.c
-@@ -882,7 +882,7 @@ mlx5_alloc_table_hash_list(struct mlx5_priv *priv)
+@@ -867,7 +867,7 @@ mlx5_alloc_table_hash_list(struct mlx5_priv *priv)
  	snprintf(s, sizeof(s), "%s_flow_table", priv->sh->ibdev_name);
  	sh->flow_tbls = mlx5_hlist_create(s, MLX5_FLOW_TABLE_HLIST_ARRAY_SIZE);
  	if (!sh->flow_tbls) {
@@ -46,8 +33,26 @@
  		err = ENOMEM;
  		return err;
  	}
+@@ -951,7 +951,7 @@ mlx5_alloc_shared_dr(struct mlx5_priv *priv)
+ 	if (!sh->flow_tbls)
+ 		err = mlx5_alloc_table_hash_list(priv);
+ 	else
+-		DRV_LOG(DEBUG, "sh->flow_tbls[%p] already created, reuse\n",
++		DRV_LOG(DEBUG, "sh->flow_tbls[%p] already created, reuse",
+ 			(void *)sh->flow_tbls);
+ 	if (err)
+ 		return err;
+@@ -959,7 +959,7 @@ mlx5_alloc_shared_dr(struct mlx5_priv *priv)
+ 	snprintf(s, sizeof(s), "%s_tags", sh->ibdev_name);
+ 	sh->tag_table = mlx5_hlist_create(s, MLX5_TAGS_HLIST_ARRAY_SIZE);
+ 	if (!sh->tag_table) {
+-		DRV_LOG(ERR, "tags with hash creation failed.\n");
++		DRV_LOG(ERR, "tags with hash creation failed.");
+ 		err = ENOMEM;
+ 		goto error;
+ 	}
 diff --git a/drivers/net/mlx5/mlx5_utils.c b/drivers/net/mlx5/mlx5_utils.c
-index d29fbcbc8..6f3ba7ca4 100644
+index 5d86615ea..c1c238941 100644
 --- a/drivers/net/mlx5/mlx5_utils.c
 +++ b/drivers/net/mlx5/mlx5_utils.c
 @@ -20,7 +20,7 @@ mlx5_hlist_create(const char *name, uint32_t size)

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

* [dpdk-stable] patch 'net/qede: fix multicast drop in promiscuous mode' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (58 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'net/mlx5: remove redundant newline from logs' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'net/mvpp2: fix non-EAL thread support' " luca.boccassi
                   ` (131 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Devendra Singh Rawat; +Cc: Igor Russkikh, Rasesh Mody, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 889b24bdd1573d9839df7ffebae1e04592cdd090 Mon Sep 17 00:00:00 2001
From: Devendra Singh Rawat <dsinghrawat@marvell.com>
Date: Thu, 18 Jun 2020 13:45:55 +0530
Subject: [PATCH] net/qede: fix multicast drop in promiscuous mode

[ upstream commit b10231aed1edb9cdd74a0a021a38267255952f00 ]

After enabling promiscuous mode all packets whose destination MAC
address is a multicast address were being dropped. This fix configures
H/W to receive all traffic in promiscuous mode. Promiscuous mode also
overrides allmulticast mode on/off status.

Fixes: 40e9f6fc1558 ("net/qede: enable VF-VF traffic with unmatched dest address")

Signed-off-by: Devendra Singh Rawat <dsinghrawat@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: Rasesh Mody <rmody@marvell.com>
---
 drivers/net/qede/qede_ethdev.c | 25 +++++++++----------------
 1 file changed, 9 insertions(+), 16 deletions(-)

diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index 2a1c82ac9..abb82d336 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -551,17 +551,16 @@ qed_configure_filter_rx_mode(struct rte_eth_dev *eth_dev,
 		ECORE_ACCEPT_BCAST;
 
 	if (type == QED_FILTER_RX_MODE_TYPE_PROMISC) {
-		flags.rx_accept_filter |= ECORE_ACCEPT_UCAST_UNMATCHED;
+		flags.rx_accept_filter |= (ECORE_ACCEPT_UCAST_UNMATCHED |
+					   ECORE_ACCEPT_MCAST_UNMATCHED);
 		if (IS_VF(edev)) {
-			flags.tx_accept_filter |= ECORE_ACCEPT_UCAST_UNMATCHED;
-			DP_INFO(edev, "Enabling Tx unmatched flag for VF\n");
+			flags.tx_accept_filter |=
+						(ECORE_ACCEPT_UCAST_UNMATCHED |
+						 ECORE_ACCEPT_MCAST_UNMATCHED);
+			DP_INFO(edev, "Enabling Tx unmatched flags for VF\n");
 		}
 	} else if (type == QED_FILTER_RX_MODE_TYPE_MULTI_PROMISC) {
 		flags.rx_accept_filter |= ECORE_ACCEPT_MCAST_UNMATCHED;
-	} else if (type == (QED_FILTER_RX_MODE_TYPE_MULTI_PROMISC |
-				QED_FILTER_RX_MODE_TYPE_PROMISC)) {
-		flags.rx_accept_filter |= ECORE_ACCEPT_UCAST_UNMATCHED |
-			ECORE_ACCEPT_MCAST_UNMATCHED;
 	}
 
 	return ecore_filter_accept_cmd(edev, 0, flags, false, false,
@@ -1420,16 +1419,13 @@ qede_link_update(struct rte_eth_dev *eth_dev, __rte_unused int wait_to_complete)
 
 static int qede_promiscuous_enable(struct rte_eth_dev *eth_dev)
 {
-	struct qede_dev *qdev = eth_dev->data->dev_private;
-	struct ecore_dev *edev = &qdev->edev;
+	enum _ecore_status_t ecore_status;
+	struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev);
+	struct ecore_dev *edev = QEDE_INIT_EDEV(qdev);
 	enum qed_filter_rx_mode_type type = QED_FILTER_RX_MODE_TYPE_PROMISC;
-	enum _ecore_status_t ecore_status;
 
 	PMD_INIT_FUNC_TRACE(edev);
 
-	if (rte_eth_allmulticast_get(eth_dev->data->port_id) == 1)
-		type |= QED_FILTER_RX_MODE_TYPE_MULTI_PROMISC;
-
 	ecore_status = qed_configure_filter_rx_mode(eth_dev, type);
 
 	return ecore_status >= ECORE_SUCCESS ? 0 : -EAGAIN;
@@ -1803,9 +1799,6 @@ static int qede_allmulticast_enable(struct rte_eth_dev *eth_dev)
 	    QED_FILTER_RX_MODE_TYPE_MULTI_PROMISC;
 	enum _ecore_status_t ecore_status;
 
-	if (rte_eth_promiscuous_get(eth_dev->data->port_id) == 1)
-		type |= QED_FILTER_RX_MODE_TYPE_PROMISC;
-
 	ecore_status = qed_configure_filter_rx_mode(eth_dev, type);
 
 	return ecore_status >= ECORE_SUCCESS ? 0 : -EAGAIN;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:50.954777550 +0100
+++ 0061-net-qede-fix-multicast-drop-in-promiscuous-mode.patch	2020-07-24 12:53:48.283006385 +0100
@@ -1,15 +1,16 @@
-From b10231aed1edb9cdd74a0a021a38267255952f00 Mon Sep 17 00:00:00 2001
+From 889b24bdd1573d9839df7ffebae1e04592cdd090 Mon Sep 17 00:00:00 2001
 From: Devendra Singh Rawat <dsinghrawat@marvell.com>
 Date: Thu, 18 Jun 2020 13:45:55 +0530
 Subject: [PATCH] net/qede: fix multicast drop in promiscuous mode
 
+[ upstream commit b10231aed1edb9cdd74a0a021a38267255952f00 ]
+
 After enabling promiscuous mode all packets whose destination MAC
 address is a multicast address were being dropped. This fix configures
 H/W to receive all traffic in promiscuous mode. Promiscuous mode also
 overrides allmulticast mode on/off status.
 
 Fixes: 40e9f6fc1558 ("net/qede: enable VF-VF traffic with unmatched dest address")
-Cc: stable@dpdk.org
 
 Signed-off-by: Devendra Singh Rawat <dsinghrawat@marvell.com>
 Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
@@ -19,10 +20,10 @@
  1 file changed, 9 insertions(+), 16 deletions(-)
 
 diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
-index c4f8f1258..84d2d2c03 100644
+index 2a1c82ac9..abb82d336 100644
 --- a/drivers/net/qede/qede_ethdev.c
 +++ b/drivers/net/qede/qede_ethdev.c
-@@ -625,17 +625,16 @@ qed_configure_filter_rx_mode(struct rte_eth_dev *eth_dev,
+@@ -551,17 +551,16 @@ qed_configure_filter_rx_mode(struct rte_eth_dev *eth_dev,
  		ECORE_ACCEPT_BCAST;
  
  	if (type == QED_FILTER_RX_MODE_TYPE_PROMISC) {
@@ -46,7 +47,7 @@
  	}
  
  	return ecore_filter_accept_cmd(edev, 0, flags, false, false,
-@@ -1502,16 +1501,13 @@ qede_link_update(struct rte_eth_dev *eth_dev, __rte_unused int wait_to_complete)
+@@ -1420,16 +1419,13 @@ qede_link_update(struct rte_eth_dev *eth_dev, __rte_unused int wait_to_complete)
  
  static int qede_promiscuous_enable(struct rte_eth_dev *eth_dev)
  {
@@ -66,7 +67,7 @@
  	ecore_status = qed_configure_filter_rx_mode(eth_dev, type);
  
  	return ecore_status >= ECORE_SUCCESS ? 0 : -EAGAIN;
-@@ -1885,9 +1881,6 @@ static int qede_allmulticast_enable(struct rte_eth_dev *eth_dev)
+@@ -1803,9 +1799,6 @@ static int qede_allmulticast_enable(struct rte_eth_dev *eth_dev)
  	    QED_FILTER_RX_MODE_TYPE_MULTI_PROMISC;
  	enum _ecore_status_t ecore_status;
  

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

* [dpdk-stable] patch 'net/mvpp2: fix non-EAL thread support' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (59 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'net/qede: fix multicast drop in promiscuous mode' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'eal/arm: add vcopyq intrinsic for aarch32' " luca.boccassi
                   ` (130 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: David Marchand; +Cc: Liron Himi, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From c5c7ff58b62688907ae1962d7713c080e4a642fe Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Tue, 16 Jun 2020 11:47:00 +0200
Subject: [PATCH] net/mvpp2: fix non-EAL thread support

[ upstream commit b52d25ae4b1bbe9adba0d9276b7771ec27e3d151 ]

Caught by code inspection, for a non-EAL thread identified with
rte_lcore_id() == LCORE_ID_ANY, the code currently arbitrarily uses
lcore 0 while there is no guarantee this lcore is used.

Fixes: 3588aaa68eab ("net/mrvl: fix HIF objects allocation")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Liron Himi <lironh@marvell.com>
---
 drivers/net/mvpp2/mrvl_ethdev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c
index b98b1fd66..903727432 100644
--- a/drivers/net/mvpp2/mrvl_ethdev.c
+++ b/drivers/net/mvpp2/mrvl_ethdev.c
@@ -816,7 +816,7 @@ mrvl_flush_bpool(struct rte_eth_dev *dev)
 	unsigned int core_id = rte_lcore_id();
 
 	if (core_id == LCORE_ID_ANY)
-		core_id = 0;
+		core_id = rte_get_master_lcore();
 
 	hif = mrvl_get_hif(priv, core_id);
 
@@ -1620,7 +1620,7 @@ mrvl_fill_bpool(struct mrvl_rxq *rxq, int num)
 
 	core_id = rte_lcore_id();
 	if (core_id == LCORE_ID_ANY)
-		core_id = 0;
+		core_id = rte_get_master_lcore();
 
 	hif = mrvl_get_hif(rxq->priv, core_id);
 	if (!hif)
@@ -1770,7 +1770,7 @@ mrvl_rx_queue_release(void *rxq)
 	unsigned int core_id = rte_lcore_id();
 
 	if (core_id == LCORE_ID_ANY)
-		core_id = 0;
+		core_id = rte_get_master_lcore();
 
 	if (!q)
 		return;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:50.989532722 +0100
+++ 0062-net-mvpp2-fix-non-EAL-thread-support.patch	2020-07-24 12:53:48.287006460 +0100
@@ -1,14 +1,15 @@
-From b52d25ae4b1bbe9adba0d9276b7771ec27e3d151 Mon Sep 17 00:00:00 2001
+From c5c7ff58b62688907ae1962d7713c080e4a642fe Mon Sep 17 00:00:00 2001
 From: David Marchand <david.marchand@redhat.com>
 Date: Tue, 16 Jun 2020 11:47:00 +0200
 Subject: [PATCH] net/mvpp2: fix non-EAL thread support
 
+[ upstream commit b52d25ae4b1bbe9adba0d9276b7771ec27e3d151 ]
+
 Caught by code inspection, for a non-EAL thread identified with
 rte_lcore_id() == LCORE_ID_ANY, the code currently arbitrarily uses
 lcore 0 while there is no guarantee this lcore is used.
 
 Fixes: 3588aaa68eab ("net/mrvl: fix HIF objects allocation")
-Cc: stable@dpdk.org
 
 Signed-off-by: David Marchand <david.marchand@redhat.com>
 Acked-by: Liron Himi <lironh@marvell.com>

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

* [dpdk-stable] patch 'eal/arm: add vcopyq intrinsic for aarch32' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (60 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'net/mvpp2: fix non-EAL thread support' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'net/ixgbe: fix include of vector header file' " luca.boccassi
                   ` (129 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Ruifeng Wang; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 586e03ddd6c45d15a3f49258ec8c5b67f39b6710 Mon Sep 17 00:00:00 2001
From: Ruifeng Wang <ruifeng.wang@arm.com>
Date: Wed, 24 Jun 2020 15:10:12 +0800
Subject: [PATCH] eal/arm: add vcopyq intrinsic for aarch32

[ upstream commit 4eb25acdb773b30c94adb0080659c9280bca4ee1 ]

vcopyq_laneq_u32 should be implemented for aarch32 which doesn't have
the intrinsic.
This fixes build of examples/l3fwd for armv7.

Fixes: 3c4b4024c225 ("arch/arm: add vcopyq_laneq_u32 for old gcc")

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 lib/librte_eal/common/include/arch/arm/rte_vect.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/librte_eal/common/include/arch/arm/rte_vect.h b/lib/librte_eal/common/include/arch/arm/rte_vect.h
index 2a18a6854..71e56ec63 100644
--- a/lib/librte_eal/common/include/arch/arm/rte_vect.h
+++ b/lib/librte_eal/common/include/arch/arm/rte_vect.h
@@ -62,7 +62,11 @@ vaddvq_u16(uint16x8_t a)
 
 #endif
 
-#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION < 70000)
+#if defined(RTE_ARCH_ARM) || \
+(defined(RTE_ARCH_ARM64) && RTE_TOOLCHAIN_GCC && (GCC_VERSION < 70000))
+/* NEON intrinsic vcopyq_laneq_u32() is not supported in ARMv7-A(AArch32)
+ * On AArch64, this intrinsic is supported since GCC version 7.
+ */
 static inline uint32x4_t
 vcopyq_laneq_u32(uint32x4_t a, const int lane_a,
 		 uint32x4_t b, const int lane_b)
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:51.032535390 +0100
+++ 0063-eal-arm-add-vcopyq-intrinsic-for-aarch32.patch	2020-07-24 12:53:48.287006460 +0100
@@ -1,32 +1,33 @@
-From 4eb25acdb773b30c94adb0080659c9280bca4ee1 Mon Sep 17 00:00:00 2001
+From 586e03ddd6c45d15a3f49258ec8c5b67f39b6710 Mon Sep 17 00:00:00 2001
 From: Ruifeng Wang <ruifeng.wang@arm.com>
 Date: Wed, 24 Jun 2020 15:10:12 +0800
 Subject: [PATCH] eal/arm: add vcopyq intrinsic for aarch32
 
+[ upstream commit 4eb25acdb773b30c94adb0080659c9280bca4ee1 ]
+
 vcopyq_laneq_u32 should be implemented for aarch32 which doesn't have
 the intrinsic.
 This fixes build of examples/l3fwd for armv7.
 
 Fixes: 3c4b4024c225 ("arch/arm: add vcopyq_laneq_u32 for old gcc")
-Cc: stable@dpdk.org
 
 Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
 Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
 ---
- lib/librte_eal/arm/include/rte_vect.h | 6 +++++-
+ lib/librte_eal/common/include/arch/arm/rte_vect.h | 6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)
 
-diff --git a/lib/librte_eal/arm/include/rte_vect.h b/lib/librte_eal/arm/include/rte_vect.h
-index 9287a1117..01c51712a 100644
---- a/lib/librte_eal/arm/include/rte_vect.h
-+++ b/lib/librte_eal/arm/include/rte_vect.h
+diff --git a/lib/librte_eal/common/include/arch/arm/rte_vect.h b/lib/librte_eal/common/include/arch/arm/rte_vect.h
+index 2a18a6854..71e56ec63 100644
+--- a/lib/librte_eal/common/include/arch/arm/rte_vect.h
++++ b/lib/librte_eal/common/include/arch/arm/rte_vect.h
 @@ -62,7 +62,11 @@ vaddvq_u16(uint16x8_t a)
  
  #endif
  
--#if RTE_CC_IS_GNU && (GCC_VERSION < 70000)
+-#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION < 70000)
 +#if defined(RTE_ARCH_ARM) || \
-+(defined(RTE_ARCH_ARM64) && RTE_CC_IS_GNU && (GCC_VERSION < 70000))
++(defined(RTE_ARCH_ARM64) && RTE_TOOLCHAIN_GCC && (GCC_VERSION < 70000))
 +/* NEON intrinsic vcopyq_laneq_u32() is not supported in ARMv7-A(AArch32)
 + * On AArch64, this intrinsic is supported since GCC version 7.
 + */

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

* [dpdk-stable] patch 'net/ixgbe: fix include of vector header file' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (61 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'eal/arm: add vcopyq intrinsic for aarch32' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'bus/dpaa: fix iterating on a class type' " luca.boccassi
                   ` (128 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Ruifeng Wang; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 8eb46d419c27e53d2112090b19e2c48decd11638 Mon Sep 17 00:00:00 2001
From: Ruifeng Wang <ruifeng.wang@arm.com>
Date: Wed, 24 Jun 2020 15:10:14 +0800
Subject: [PATCH] net/ixgbe: fix include of vector header file

[ upstream commit 2b7a54f091f2049cc668278344d3f95325f54a9f ]

The include of 'arm_neon.h' causes issues to old gcc and aarch32.
Including 'rte_vect.h' instead fixes these issues.

Fixes: b20971b6cca0 ("net/ixgbe: implement vector driver for ARM")

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
index feb86c61e..27ff53570 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
@@ -5,13 +5,12 @@
 #include <stdint.h>
 #include <rte_ethdev_driver.h>
 #include <rte_malloc.h>
+#include <rte_vect.h>
 
 #include "ixgbe_ethdev.h"
 #include "ixgbe_rxtx.h"
 #include "ixgbe_rxtx_vec_common.h"
 
-#include <arm_neon.h>
-
 #pragma GCC diagnostic ignored "-Wcast-qual"
 
 static inline void
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:51.070723299 +0100
+++ 0064-net-ixgbe-fix-include-of-vector-header-file.patch	2020-07-24 12:53:48.287006460 +0100
@@ -1,13 +1,14 @@
-From 2b7a54f091f2049cc668278344d3f95325f54a9f Mon Sep 17 00:00:00 2001
+From 8eb46d419c27e53d2112090b19e2c48decd11638 Mon Sep 17 00:00:00 2001
 From: Ruifeng Wang <ruifeng.wang@arm.com>
 Date: Wed, 24 Jun 2020 15:10:14 +0800
 Subject: [PATCH] net/ixgbe: fix include of vector header file
 
+[ upstream commit 2b7a54f091f2049cc668278344d3f95325f54a9f ]
+
 The include of 'arm_neon.h' causes issues to old gcc and aarch32.
 Including 'rte_vect.h' instead fixes these issues.
 
 Fixes: b20971b6cca0 ("net/ixgbe: implement vector driver for ARM")
-Cc: stable@dpdk.org
 
 Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
 Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
@@ -16,7 +17,7 @@
  1 file changed, 1 insertion(+), 2 deletions(-)
 
 diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
-index 293b7c8bd..aa27ee177 100644
+index feb86c61e..27ff53570 100644
 --- a/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
 +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
 @@ -5,13 +5,12 @@

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

* [dpdk-stable] patch 'bus/dpaa: fix iterating on a class type' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (62 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'net/ixgbe: fix include of vector header file' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'bus/fslmc: " luca.boccassi
                   ` (127 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Maxime Coquelin; +Cc: Adrián Moreno, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 3f26d928cf387a3d333a36ed8d92e0bd2c2bb95c Mon Sep 17 00:00:00 2001
From: Maxime Coquelin <maxime.coquelin@redhat.com>
Date: Fri, 26 Jun 2020 16:04:28 +0200
Subject: [PATCH] bus/dpaa: fix iterating on a class type
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit be2ee360fe86cf041d1a07577919160e6557c679 ]

This patches fixes a null pointer dereferencing that happens
when the device string passed to the iterator is NULL. This
situation can happen when iterating on a class type.
For example:

RTE_DEV_FOREACH(dev, "class=eth", &dev_iter) {
    ...
}

Fixes: e79df833d3f6 ("bus/dpaa: support hotplug ops")

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Adrián Moreno <amorenoz@redhat.com>
---
 drivers/bus/dpaa/dpaa_bus.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index f27820db3..327d9269f 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -700,6 +700,11 @@ dpaa_bus_dev_iterate(const void *start, const char *str,
 	struct rte_dpaa_device *dev;
 	char *dup, *dev_name = NULL;
 
+	if (str == NULL) {
+		DPAA_BUS_DEBUG("No device string");
+		return NULL;
+	}
+
 	/* Expectation is that device would be name=device_name */
 	if (strncmp(str, "name=", 5) != 0) {
 		DPAA_BUS_DEBUG("Invalid device string (%s)\n", str);
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:51.106331209 +0100
+++ 0065-bus-dpaa-fix-iterating-on-a-class-type.patch	2020-07-24 12:53:48.287006460 +0100
@@ -1,4 +1,4 @@
-From be2ee360fe86cf041d1a07577919160e6557c679 Mon Sep 17 00:00:00 2001
+From 3f26d928cf387a3d333a36ed8d92e0bd2c2bb95c Mon Sep 17 00:00:00 2001
 From: Maxime Coquelin <maxime.coquelin@redhat.com>
 Date: Fri, 26 Jun 2020 16:04:28 +0200
 Subject: [PATCH] bus/dpaa: fix iterating on a class type
@@ -6,6 +6,8 @@
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
 
+[ upstream commit be2ee360fe86cf041d1a07577919160e6557c679 ]
+
 This patches fixes a null pointer dereferencing that happens
 when the device string passed to the iterator is NULL. This
 situation can happen when iterating on a class type.
@@ -16,7 +18,6 @@
 }
 
 Fixes: e79df833d3f6 ("bus/dpaa: support hotplug ops")
-Cc: stable@dpdk.org
 
 Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
 Acked-by: Adrián Moreno <amorenoz@redhat.com>
@@ -25,10 +26,10 @@
  1 file changed, 5 insertions(+)
 
 diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
-index d53fe6083..591e28c1e 100644
+index f27820db3..327d9269f 100644
 --- a/drivers/bus/dpaa/dpaa_bus.c
 +++ b/drivers/bus/dpaa/dpaa_bus.c
-@@ -703,6 +703,11 @@ dpaa_bus_dev_iterate(const void *start, const char *str,
+@@ -700,6 +700,11 @@ dpaa_bus_dev_iterate(const void *start, const char *str,
  	struct rte_dpaa_device *dev;
  	char *dup, *dev_name = NULL;
  

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

* [dpdk-stable] patch 'bus/fslmc: fix iterating on a class type' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (63 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'bus/dpaa: fix iterating on a class type' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'net/octeontx2: fix DMAC filtering' " luca.boccassi
                   ` (126 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Maxime Coquelin; +Cc: Adrián Moreno, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From f232d2d9db3324a689ac6c5cfc9cadd6c165c1d3 Mon Sep 17 00:00:00 2001
From: Maxime Coquelin <maxime.coquelin@redhat.com>
Date: Fri, 26 Jun 2020 16:04:29 +0200
Subject: [PATCH] bus/fslmc: fix iterating on a class type
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit 44255245433b3b4394474db100d478341aeb08fc ]

This patches fixes a null pointer dereferencing that happens
when the device string passed to the iterator is NULL. This
situation can happen when iterating on a class type.
For example:

RTE_DEV_FOREACH(dev, "class=eth", &dev_iter) {
    ...
}

Fixes: e67a61614d0b ("bus/fslmc: support device iteration")

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Adrián Moreno <amorenoz@redhat.com>
---
 drivers/bus/fslmc/fslmc_bus.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
index b3e964aa9..7431177f2 100644
--- a/drivers/bus/fslmc/fslmc_bus.c
+++ b/drivers/bus/fslmc/fslmc_bus.c
@@ -608,6 +608,11 @@ fslmc_bus_dev_iterate(const void *start, const char *str,
 	struct rte_dpaa2_device *dev;
 	char *dup, *dev_name = NULL;
 
+	if (str == NULL) {
+		DPAA2_BUS_DEBUG("No device string");
+		return NULL;
+	}
+
 	/* Expectation is that device would be name=device_name */
 	if (strncmp(str, "name=", 5) != 0) {
 		DPAA2_BUS_DEBUG("Invalid device string (%s)\n", str);
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:51.141507409 +0100
+++ 0066-bus-fslmc-fix-iterating-on-a-class-type.patch	2020-07-24 12:53:48.287006460 +0100
@@ -1,4 +1,4 @@
-From 44255245433b3b4394474db100d478341aeb08fc Mon Sep 17 00:00:00 2001
+From f232d2d9db3324a689ac6c5cfc9cadd6c165c1d3 Mon Sep 17 00:00:00 2001
 From: Maxime Coquelin <maxime.coquelin@redhat.com>
 Date: Fri, 26 Jun 2020 16:04:29 +0200
 Subject: [PATCH] bus/fslmc: fix iterating on a class type
@@ -6,6 +6,8 @@
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
 
+[ upstream commit 44255245433b3b4394474db100d478341aeb08fc ]
+
 This patches fixes a null pointer dereferencing that happens
 when the device string passed to the iterator is NULL. This
 situation can happen when iterating on a class type.
@@ -16,7 +18,6 @@
 }
 
 Fixes: e67a61614d0b ("bus/fslmc: support device iteration")
-Cc: stable@dpdk.org
 
 Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
 Acked-by: Adrián Moreno <amorenoz@redhat.com>
@@ -25,10 +26,10 @@
  1 file changed, 5 insertions(+)
 
 diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
-index afbd82e8d..ac46eb4fe 100644
+index b3e964aa9..7431177f2 100644
 --- a/drivers/bus/fslmc/fslmc_bus.c
 +++ b/drivers/bus/fslmc/fslmc_bus.c
-@@ -603,6 +603,11 @@ fslmc_bus_dev_iterate(const void *start, const char *str,
+@@ -608,6 +608,11 @@ fslmc_bus_dev_iterate(const void *start, const char *str,
  	struct rte_dpaa2_device *dev;
  	char *dup, *dev_name = NULL;
  

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

* [dpdk-stable] patch 'net/octeontx2: fix DMAC filtering' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (64 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'bus/fslmc: " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'common/mlx5: fix code arrangement in tag allocation' " luca.boccassi
                   ` (125 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Harman Kalra; +Cc: Sunil Kumar Kori, Jerin Jacob, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 2789a4d75c75e811d05f59ef0152d1f7de8315e5 Mon Sep 17 00:00:00 2001
From: Harman Kalra <hkalra@marvell.com>
Date: Wed, 3 Jun 2020 20:22:13 +0530
Subject: [PATCH] net/octeontx2: fix DMAC filtering

[ upstream commit 987984204bdc982e0f58393678dd50ba91c639c4 ]

Issue has been observed where packets are getting dropped
at DMAC filtering if a new dmac address is added before
starting of port.

Fixes: c43adf61682f ("net/octeontx2: add unicast MAC filter")

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
---
 drivers/net/octeontx2/otx2_ethdev.h     | 1 +
 drivers/net/octeontx2/otx2_ethdev_ops.c | 4 +++-
 drivers/net/octeontx2/otx2_mac.c        | 2 ++
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index 864356e36..0aadaecf7 100644
--- a/drivers/net/octeontx2/otx2_ethdev.h
+++ b/drivers/net/octeontx2/otx2_ethdev.h
@@ -267,6 +267,7 @@ struct otx2_eth_dev {
 	uint8_t mac_addr[RTE_ETHER_ADDR_LEN];
 	uint8_t mkex_pfl_name[MKEX_NAME_LEN];
 	uint8_t max_mac_entries;
+	bool dmac_filter_enable;
 	uint8_t lf_tx_stats;
 	uint8_t lf_rx_stats;
 	uint16_t flags;
diff --git a/drivers/net/octeontx2/otx2_ethdev_ops.c b/drivers/net/octeontx2/otx2_ethdev_ops.c
index 8f1635dba..93ef04803 100644
--- a/drivers/net/octeontx2/otx2_ethdev_ops.c
+++ b/drivers/net/octeontx2/otx2_ethdev_ops.c
@@ -148,8 +148,10 @@ otx2_nix_promisc_enable(struct rte_eth_dev *eth_dev)
 int
 otx2_nix_promisc_disable(struct rte_eth_dev *eth_dev)
 {
-	otx2_nix_promisc_config(eth_dev, 0);
+	struct otx2_eth_dev *dev = otx2_eth_pmd_priv(eth_dev);
+	otx2_nix_promisc_config(eth_dev, dev->dmac_filter_enable);
 	nix_cgx_promisc_config(eth_dev, 0);
+	dev->dmac_filter_enable = false;
 
 	return 0;
 }
diff --git a/drivers/net/octeontx2/otx2_mac.c b/drivers/net/octeontx2/otx2_mac.c
index 262d185e5..49a700ca1 100644
--- a/drivers/net/octeontx2/otx2_mac.c
+++ b/drivers/net/octeontx2/otx2_mac.c
@@ -76,6 +76,8 @@ otx2_nix_mac_addr_add(struct rte_eth_dev *eth_dev, struct rte_ether_addr *addr,
 
 	/* Enable promiscuous mode at NIX level */
 	otx2_nix_promisc_config(eth_dev, 1);
+	dev->dmac_filter_enable = true;
+	eth_dev->data->promiscuous = 0;
 
 done:
 	return rc;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:51.173175258 +0100
+++ 0067-net-octeontx2-fix-DMAC-filtering.patch	2020-07-24 12:53:48.291006534 +0100
@@ -1,14 +1,15 @@
-From 987984204bdc982e0f58393678dd50ba91c639c4 Mon Sep 17 00:00:00 2001
+From 2789a4d75c75e811d05f59ef0152d1f7de8315e5 Mon Sep 17 00:00:00 2001
 From: Harman Kalra <hkalra@marvell.com>
 Date: Wed, 3 Jun 2020 20:22:13 +0530
 Subject: [PATCH] net/octeontx2: fix DMAC filtering
 
+[ upstream commit 987984204bdc982e0f58393678dd50ba91c639c4 ]
+
 Issue has been observed where packets are getting dropped
 at DMAC filtering if a new dmac address is added before
 starting of port.
 
 Fixes: c43adf61682f ("net/octeontx2: add unicast MAC filter")
-Cc: stable@dpdk.org
 
 Signed-off-by: Harman Kalra <hkalra@marvell.com>
 Acked-by: Sunil Kumar Kori <skori@marvell.com>
@@ -20,10 +21,10 @@
  3 files changed, 6 insertions(+), 1 deletion(-)
 
 diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
-index 0fbf68b8e..16b0d8163 100644
+index 864356e36..0aadaecf7 100644
 --- a/drivers/net/octeontx2/otx2_ethdev.h
 +++ b/drivers/net/octeontx2/otx2_ethdev.h
-@@ -271,6 +271,7 @@ struct otx2_eth_dev {
+@@ -267,6 +267,7 @@ struct otx2_eth_dev {
  	uint8_t mac_addr[RTE_ETHER_ADDR_LEN];
  	uint8_t mkex_pfl_name[MKEX_NAME_LEN];
  	uint8_t max_mac_entries;
@@ -32,7 +33,7 @@
  	uint8_t lf_rx_stats;
  	uint16_t flags;
 diff --git a/drivers/net/octeontx2/otx2_ethdev_ops.c b/drivers/net/octeontx2/otx2_ethdev_ops.c
-index 80ac2b96e..faecf216c 100644
+index 8f1635dba..93ef04803 100644
 --- a/drivers/net/octeontx2/otx2_ethdev_ops.c
 +++ b/drivers/net/octeontx2/otx2_ethdev_ops.c
 @@ -148,8 +148,10 @@ otx2_nix_promisc_enable(struct rte_eth_dev *eth_dev)

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

* [dpdk-stable] patch 'common/mlx5: fix code arrangement in tag allocation' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (65 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'net/octeontx2: fix DMAC filtering' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'net/mlx5: fix iterator type in Rx queue management' " luca.boccassi
                   ` (124 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Michael Baum; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From dac5398ff22718581c4b564325aa87fbca645ac3 Mon Sep 17 00:00:00 2001
From: Michael Baum <michaelba@mellanox.com>
Date: Wed, 24 Jun 2020 13:20:31 +0000
Subject: [PATCH] common/mlx5: fix code arrangement in tag allocation

[ upstream commit ed5d23656e925ea8b271d4a84eec8e4046f66fa9 ]

Flow tag action is supported only when the driver has DR or DV support.
The tag allocation is adjusted to the modes DV or DR.

In case both DR and DV are not supported in the system, the driver
handles static code for error report.
This error code, wrongly, was compiled when DV is supported while in
this case it cannot be accessed at all.

Ignore the aforementioned static error code in case of DV by
preprocessor commands rearrangement.

Fixes: cbb66daa3c85 ("net/mlx5: prepare Direct Verbs for Direct Rule")

Signed-off-by: Michael Baum <michaelba@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
 drivers/net/mlx5/mlx5_glue.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_glue.c b/drivers/net/mlx5/mlx5_glue.c
index 44f63116a..65b63bd60 100644
--- a/drivers/net/mlx5/mlx5_glue.c
+++ b/drivers/net/mlx5/mlx5_glue.c
@@ -754,7 +754,7 @@ mlx5_glue_dv_create_flow_action_tag(uint32_t tag)
 #ifdef HAVE_IBV_FLOW_DV_SUPPORT
 #ifdef HAVE_MLX5DV_DR
 	return mlx5dv_dr_action_create_tag(tag);
-#else
+#else /* HAVE_MLX5DV_DR */
 	struct mlx5dv_flow_action_attr *action;
 	action = malloc(sizeof(*action));
 	if (!action)
@@ -762,11 +762,12 @@ mlx5_glue_dv_create_flow_action_tag(uint32_t tag)
 	action->type = MLX5DV_FLOW_ACTION_TAG;
 	action->tag_value = tag;
 	return action;
-#endif
-#endif
+#endif /* HAVE_MLX5DV_DR */
+#else /* HAVE_IBV_FLOW_DV_SUPPORT */
 	(void)tag;
 	errno = ENOTSUP;
 	return NULL;
+#endif /* HAVE_IBV_FLOW_DV_SUPPORT */
 }
 
 static void *
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:51.213459854 +0100
+++ 0068-common-mlx5-fix-code-arrangement-in-tag-allocation.patch	2020-07-24 12:53:48.291006534 +0100
@@ -1,8 +1,10 @@
-From ed5d23656e925ea8b271d4a84eec8e4046f66fa9 Mon Sep 17 00:00:00 2001
+From dac5398ff22718581c4b564325aa87fbca645ac3 Mon Sep 17 00:00:00 2001
 From: Michael Baum <michaelba@mellanox.com>
 Date: Wed, 24 Jun 2020 13:20:31 +0000
 Subject: [PATCH] common/mlx5: fix code arrangement in tag allocation
 
+[ upstream commit ed5d23656e925ea8b271d4a84eec8e4046f66fa9 ]
+
 Flow tag action is supported only when the driver has DR or DV support.
 The tag allocation is adjusted to the modes DV or DR.
 
@@ -15,19 +17,18 @@
 preprocessor commands rearrangement.
 
 Fixes: cbb66daa3c85 ("net/mlx5: prepare Direct Verbs for Direct Rule")
-Cc: stable@dpdk.org
 
 Signed-off-by: Michael Baum <michaelba@mellanox.com>
 Acked-by: Matan Azrad <matan@mellanox.com>
 ---
- drivers/common/mlx5/linux/mlx5_glue.c | 7 ++++---
+ drivers/net/mlx5/mlx5_glue.c | 7 ++++---
  1 file changed, 4 insertions(+), 3 deletions(-)
 
-diff --git a/drivers/common/mlx5/linux/mlx5_glue.c b/drivers/common/mlx5/linux/mlx5_glue.c
-index 62c4cc74b..048207eb7 100644
---- a/drivers/common/mlx5/linux/mlx5_glue.c
-+++ b/drivers/common/mlx5/linux/mlx5_glue.c
-@@ -752,7 +752,7 @@ mlx5_glue_dv_create_flow_action_tag(uint32_t tag)
+diff --git a/drivers/net/mlx5/mlx5_glue.c b/drivers/net/mlx5/mlx5_glue.c
+index 44f63116a..65b63bd60 100644
+--- a/drivers/net/mlx5/mlx5_glue.c
++++ b/drivers/net/mlx5/mlx5_glue.c
+@@ -754,7 +754,7 @@ mlx5_glue_dv_create_flow_action_tag(uint32_t tag)
  #ifdef HAVE_IBV_FLOW_DV_SUPPORT
  #ifdef HAVE_MLX5DV_DR
  	return mlx5dv_dr_action_create_tag(tag);
@@ -36,7 +37,7 @@
  	struct mlx5dv_flow_action_attr *action;
  	action = malloc(sizeof(*action));
  	if (!action)
-@@ -760,11 +760,12 @@ mlx5_glue_dv_create_flow_action_tag(uint32_t tag)
+@@ -762,11 +762,12 @@ mlx5_glue_dv_create_flow_action_tag(uint32_t tag)
  	action->type = MLX5DV_FLOW_ACTION_TAG;
  	action->tag_value = tag;
  	return action;

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

* [dpdk-stable] patch 'net/mlx5: fix iterator type in Rx queue management' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (66 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'common/mlx5: fix code arrangement in tag allocation' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'vhost: fix features definition location' " luca.boccassi
                   ` (123 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Michael Baum; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 245b44464f9d8a12ba5c0dadb9f1be13faf07226 Mon Sep 17 00:00:00 2001
From: Michael Baum <michaelba@mellanox.com>
Date: Wed, 24 Jun 2020 13:50:39 +0000
Subject: [PATCH] net/mlx5: fix iterator type in Rx queue management

[ upstream commit 0f006468c53c8151fa70ff41869c1a76316fe224 ]

The mlx5_check_vec_rx_support function in the mlx5_rxtx_vec.c file
passes the RX queues array in the loop. Similarly, the mlx5_mprq_enabled
function in the mlx5_rxq.c file passes the RX queues array in the loop.

In both cases, the iterator of the loop is called i and the variable
representing the array size is called rxqs_n.
The i variable is of UINT16_T type while the rxqs_n variable is of
unsigned int type. The size of the rxqs_n variable is much larger than
the number of iterations allowed by the i type, theoretically there may
be a situation where the value of the rxqs_n will be greater than can be
represented by 16 bits and the loop will never end.

Change the type of i to UINT32_T.

Fixes: 7d6bf6b866b8 ("net/mlx5: add Multi-Packet Rx support")
Fixes: 6cb559d67b83 ("net/mlx5: add vectorized Rx/Tx burst for x86")

Signed-off-by: Michael Baum <michaelba@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
 drivers/net/mlx5/mlx5_rxq.c      | 2 +-
 drivers/net/mlx5/mlx5_rxtx_vec.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index baa868360..e9e8f1278 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -105,7 +105,7 @@ inline int
 mlx5_mprq_enabled(struct rte_eth_dev *dev)
 {
 	struct mlx5_priv *priv = dev->data->dev_private;
-	uint16_t i;
+	uint32_t i;
 	uint16_t n = 0;
 	uint16_t n_ibv = 0;
 
diff --git a/drivers/net/mlx5/mlx5_rxtx_vec.c b/drivers/net/mlx5/mlx5_rxtx_vec.c
index dbb4cfaeb..0c705d1f7 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec.c
+++ b/drivers/net/mlx5/mlx5_rxtx_vec.c
@@ -156,7 +156,7 @@ int __attribute__((cold))
 mlx5_check_vec_rx_support(struct rte_eth_dev *dev)
 {
 	struct mlx5_priv *priv = dev->data->dev_private;
-	uint16_t i;
+	uint32_t i;
 
 	if (!priv->config.rx_vec_en)
 		return -ENOTSUP;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:51.246695698 +0100
+++ 0069-net-mlx5-fix-iterator-type-in-Rx-queue-management.patch	2020-07-24 12:53:48.295006608 +0100
@@ -1,8 +1,10 @@
-From 0f006468c53c8151fa70ff41869c1a76316fe224 Mon Sep 17 00:00:00 2001
+From 245b44464f9d8a12ba5c0dadb9f1be13faf07226 Mon Sep 17 00:00:00 2001
 From: Michael Baum <michaelba@mellanox.com>
 Date: Wed, 24 Jun 2020 13:50:39 +0000
 Subject: [PATCH] net/mlx5: fix iterator type in Rx queue management
 
+[ upstream commit 0f006468c53c8151fa70ff41869c1a76316fe224 ]
+
 The mlx5_check_vec_rx_support function in the mlx5_rxtx_vec.c file
 passes the RX queues array in the loop. Similarly, the mlx5_mprq_enabled
 function in the mlx5_rxq.c file passes the RX queues array in the loop.
@@ -19,7 +21,6 @@
 
 Fixes: 7d6bf6b866b8 ("net/mlx5: add Multi-Packet Rx support")
 Fixes: 6cb559d67b83 ("net/mlx5: add vectorized Rx/Tx burst for x86")
-Cc: stable@dpdk.org
 
 Signed-off-by: Michael Baum <michaelba@mellanox.com>
 Acked-by: Matan Azrad <matan@mellanox.com>
@@ -29,10 +30,10 @@
  2 files changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
-index bd0037b82..b436f0610 100644
+index baa868360..e9e8f1278 100644
 --- a/drivers/net/mlx5/mlx5_rxq.c
 +++ b/drivers/net/mlx5/mlx5_rxq.c
-@@ -108,7 +108,7 @@ inline int
+@@ -105,7 +105,7 @@ inline int
  mlx5_mprq_enabled(struct rte_eth_dev *dev)
  {
  	struct mlx5_priv *priv = dev->data->dev_private;
@@ -42,10 +43,10 @@
  	uint16_t n_ibv = 0;
  
 diff --git a/drivers/net/mlx5/mlx5_rxtx_vec.c b/drivers/net/mlx5/mlx5_rxtx_vec.c
-index b38bd203c..7fae2010f 100644
+index dbb4cfaeb..0c705d1f7 100644
 --- a/drivers/net/mlx5/mlx5_rxtx_vec.c
 +++ b/drivers/net/mlx5/mlx5_rxtx_vec.c
-@@ -156,7 +156,7 @@ int __rte_cold
+@@ -156,7 +156,7 @@ int __attribute__((cold))
  mlx5_check_vec_rx_support(struct rte_eth_dev *dev)
  {
  	struct mlx5_priv *priv = dev->data->dev_private;

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

* [dpdk-stable] patch 'vhost: fix features definition location' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (67 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'net/mlx5: fix iterator type in Rx queue management' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'test/ring: fix statistics in bulk enq/dequeue' " luca.boccassi
                   ` (122 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Matan Azrad; +Cc: Chenbo Xia, Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 4727f70f066486f5a749a73637216067f9c73dc1 Mon Sep 17 00:00:00 2001
From: Matan Azrad <matan@mellanox.com>
Date: Thu, 18 Jun 2020 19:08:20 +0000
Subject: [PATCH] vhost: fix features definition location

[ upstream commit da2b788041d2becb6ffa44b16456bd2041119269 ]

The vhost library provide an infrastructure in order to help the DPDK
users to manage vhost devices.

One of the infrastructure parts is the features enablement APIs.

Some features bits may be defined only in the internal file vhost.h in
case the kernel version doesn't include them.

Hence, user running on old kernel may not be able to manage thus
features.

Move all the feature bits definitions to the API file rte_vhost.h.

Fixes: db69be54b6ff ("vhost: hide internal code")
Fixes: 8d286dbeb8d7 ("vhost: fix multiple queue not enabled for old kernels")
Fixes: 3d3c6590b58c ("vhost: enable virtio MTU feature")
Fixes: 704098fc478c ("vhost: fix build with old kernels")

Signed-off-by: Matan Azrad <matan@mellanox.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 lib/librte_vhost/rte_vhost.h | 17 +++++++++++++++++
 lib/librte_vhost/vhost.h     | 17 -----------------
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/lib/librte_vhost/rte_vhost.h b/lib/librte_vhost/rte_vhost.h
index 532ee0dec..53a30a062 100644
--- a/lib/librte_vhost/rte_vhost.h
+++ b/lib/librte_vhost/rte_vhost.h
@@ -35,6 +35,23 @@ extern "C" {
 /* support only linear buffers (no chained mbufs) */
 #define RTE_VHOST_USER_LINEARBUF_SUPPORT	(1ULL << 6)
 
+/* Features. */
+#ifndef VIRTIO_NET_F_GUEST_ANNOUNCE
+ #define VIRTIO_NET_F_GUEST_ANNOUNCE 21
+#endif
+
+#ifndef VIRTIO_NET_F_MQ
+ #define VIRTIO_NET_F_MQ		22
+#endif
+
+#ifndef VIRTIO_NET_F_MTU
+ #define VIRTIO_NET_F_MTU 3
+#endif
+
+#ifndef VIRTIO_F_ANY_LAYOUT
+ #define VIRTIO_F_ANY_LAYOUT		27
+#endif
+
 /** Protocol features. */
 #ifndef VHOST_USER_PROTOCOL_F_MQ
 #define VHOST_USER_PROTOCOL_F_MQ	0
diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
index 844904ca3..deeca18f8 100644
--- a/lib/librte_vhost/vhost.h
+++ b/lib/librte_vhost/vhost.h
@@ -202,26 +202,9 @@ struct vhost_virtqueue {
 	TAILQ_HEAD(, vhost_iotlb_entry) iotlb_pending_list;
 } __rte_cache_aligned;
 
-/* Old kernels have no such macros defined */
-#ifndef VIRTIO_NET_F_GUEST_ANNOUNCE
- #define VIRTIO_NET_F_GUEST_ANNOUNCE 21
-#endif
-
-#ifndef VIRTIO_NET_F_MQ
- #define VIRTIO_NET_F_MQ		22
-#endif
-
 #define VHOST_MAX_VRING			0x100
 #define VHOST_MAX_QUEUE_PAIRS		0x80
 
-#ifndef VIRTIO_NET_F_MTU
- #define VIRTIO_NET_F_MTU 3
-#endif
-
-#ifndef VIRTIO_F_ANY_LAYOUT
- #define VIRTIO_F_ANY_LAYOUT		27
-#endif
-
 /* Declare IOMMU related bits for older kernels */
 #ifndef VIRTIO_F_IOMMU_PLATFORM
 
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:51.283017658 +0100
+++ 0070-vhost-fix-features-definition-location.patch	2020-07-24 12:53:48.295006608 +0100
@@ -1,8 +1,10 @@
-From da2b788041d2becb6ffa44b16456bd2041119269 Mon Sep 17 00:00:00 2001
+From 4727f70f066486f5a749a73637216067f9c73dc1 Mon Sep 17 00:00:00 2001
 From: Matan Azrad <matan@mellanox.com>
 Date: Thu, 18 Jun 2020 19:08:20 +0000
 Subject: [PATCH] vhost: fix features definition location
 
+[ upstream commit da2b788041d2becb6ffa44b16456bd2041119269 ]
+
 The vhost library provide an infrastructure in order to help the DPDK
 users to manage vhost devices.
 
@@ -20,7 +22,6 @@
 Fixes: 8d286dbeb8d7 ("vhost: fix multiple queue not enabled for old kernels")
 Fixes: 3d3c6590b58c ("vhost: enable virtio MTU feature")
 Fixes: 704098fc478c ("vhost: fix build with old kernels")
-Cc: stable@dpdk.org
 
 Signed-off-by: Matan Azrad <matan@mellanox.com>
 Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
@@ -31,10 +32,10 @@
  2 files changed, 17 insertions(+), 17 deletions(-)
 
 diff --git a/lib/librte_vhost/rte_vhost.h b/lib/librte_vhost/rte_vhost.h
-index 2fbc36464..8a5c332c8 100644
+index 532ee0dec..53a30a062 100644
 --- a/lib/librte_vhost/rte_vhost.h
 +++ b/lib/librte_vhost/rte_vhost.h
-@@ -36,6 +36,23 @@ extern "C" {
+@@ -35,6 +35,23 @@ extern "C" {
  /* support only linear buffers (no chained mbufs) */
  #define RTE_VHOST_USER_LINEARBUF_SUPPORT	(1ULL << 6)
  
@@ -59,10 +60,10 @@
  #ifndef VHOST_USER_PROTOCOL_F_MQ
  #define VHOST_USER_PROTOCOL_F_MQ	0
 diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
-index a0fe703ee..034463699 100644
+index 844904ca3..deeca18f8 100644
 --- a/lib/librte_vhost/vhost.h
 +++ b/lib/librte_vhost/vhost.h
-@@ -204,26 +204,9 @@ struct vhost_virtqueue {
+@@ -202,26 +202,9 @@ struct vhost_virtqueue {
  	TAILQ_HEAD(, vhost_iotlb_entry) iotlb_pending_list;
  } __rte_cache_aligned;
  

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

* [dpdk-stable] patch 'test/ring: fix statistics in bulk enq/dequeue' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (68 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'vhost: fix features definition location' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'test: fix build with ring PMD but no bond PMD' " luca.boccassi
                   ` (121 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Feifei Wang; +Cc: Ruifeng Wang, Phil Yang, Konstantin Ananyev, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 95ad1c1bad8db6b2ae58d5267b5e407bf7193ef7 Mon Sep 17 00:00:00 2001
From: Feifei Wang <feifei.wang2@arm.com>
Date: Mon, 8 Jun 2020 13:58:46 +0800
Subject: [PATCH] test/ring: fix statistics in bulk enq/dequeue

[ upstream commit 50959a899374cec9852eea3cd7dd638ee2d560ec ]

In size 32 bulk ring enq/dequeue performance test, the "Total count"
statistics is incorrect. For example, running the test on lcore 25 and
lcore 26, the output is as follows:

The test command:
$sudo ./arm64-armv8a-linuxapp-gcc/app/test -l 25-26
RTE>>ring_perf_autotest

Bulk enq/dequeue count on size 32
Core [25] count = 288268
Core [26] count = 288281
Total count (size: 32): 1066323

Fixed it by reset the counter at the beginning of each loop. The
revised output is as follows:

Bulk enq/dequeue count on size 32
Core [25] count = 285643
Core [26] count = 285688
Total count (size: 32): 571331

Fixes: 759cf9b5632c ("test/ring: enhance mp/mc coverage")

Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
 app/test/test_ring_perf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/app/test/test_ring_perf.c b/app/test/test_ring_perf.c
index 70ee46ffe..3cf27965d 100644
--- a/app/test/test_ring_perf.c
+++ b/app/test/test_ring_perf.c
@@ -296,12 +296,13 @@ load_loop_fn(void *p)
 static int
 run_on_all_cores(struct rte_ring *r)
 {
-	uint64_t total = 0;
+	uint64_t total;
 	struct thread_params param;
 	unsigned int i, c;
 
 	memset(&param, 0, sizeof(struct thread_params));
 	for (i = 0; i < RTE_DIM(bulk_sizes); i++) {
+		total = 0;
 		printf("\nBulk enq/dequeue count on size %u\n", bulk_sizes[i]);
 		param.size = bulk_sizes[i];
 		param.r = r;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:51.321140254 +0100
+++ 0071-test-ring-fix-statistics-in-bulk-enq-dequeue.patch	2020-07-24 12:53:48.295006608 +0100
@@ -1,8 +1,10 @@
-From 50959a899374cec9852eea3cd7dd638ee2d560ec Mon Sep 17 00:00:00 2001
+From 95ad1c1bad8db6b2ae58d5267b5e407bf7193ef7 Mon Sep 17 00:00:00 2001
 From: Feifei Wang <feifei.wang2@arm.com>
 Date: Mon, 8 Jun 2020 13:58:46 +0800
 Subject: [PATCH] test/ring: fix statistics in bulk enq/dequeue
 
+[ upstream commit 50959a899374cec9852eea3cd7dd638ee2d560ec ]
+
 In size 32 bulk ring enq/dequeue performance test, the "Total count"
 statistics is incorrect. For example, running the test on lcore 25 and
 lcore 26, the output is as follows:
@@ -25,7 +27,6 @@
 Total count (size: 32): 571331
 
 Fixes: 759cf9b5632c ("test/ring: enhance mp/mc coverage")
-Cc: stable@dpdk.org
 
 Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
 Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
@@ -36,19 +37,17 @@
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 diff --git a/app/test/test_ring_perf.c b/app/test/test_ring_perf.c
-index ee21faf71..ac9bf5608 100644
+index 70ee46ffe..3cf27965d 100644
 --- a/app/test/test_ring_perf.c
 +++ b/app/test/test_ring_perf.c
-@@ -380,7 +380,7 @@ load_loop_fn_16B(void *p)
+@@ -296,12 +296,13 @@ load_loop_fn(void *p)
  static int
- run_on_all_cores(struct rte_ring *r, const int esize)
+ run_on_all_cores(struct rte_ring *r)
  {
 -	uint64_t total = 0;
 +	uint64_t total;
  	struct thread_params param;
- 	lcore_function_t *lcore_f;
  	unsigned int i, c;
-@@ -392,6 +392,7 @@ run_on_all_cores(struct rte_ring *r, const int esize)
  
  	memset(&param, 0, sizeof(struct thread_params));
  	for (i = 0; i < RTE_DIM(bulk_sizes); i++) {

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

* [dpdk-stable] patch 'test: fix build with ring PMD but no bond PMD' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (69 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'test/ring: fix statistics in bulk enq/dequeue' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'mem: fix 32-bit init config with meson' " luca.boccassi
                   ` (120 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: David Marchand, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From ff89fb4fe754c59fa09d32a5874367638b32ba20 Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Wed, 27 May 2020 15:57:45 +0100
Subject: [PATCH] test: fix build with ring PMD but no bond PMD

[ upstream commit 949c97ae310af049075c8745208e8795b9071d9c ]

If the bonding pmd is disabled, all autotest associated with it should be
disabled. However, some of those tests also depended upon the ring PMD so
were placed in a block depending on that driver - and unfortunately that
driver alone. This caused build failures if the ring PMD was enabled but
the bonding PMD disabled, due to missing header files and driver libs.

This error can be reproduced by configuring DPDK using e.g.

  meson configure -Ddisable_drivers=net/[!r]* build

(which will disable all drivers not starting with "r"), and then building
using ninja.

Fix this by moving all link bonding autotests to the one block and putting
a second conditional check within that block for those also requiring the
ring PMD.

Fixes: 7f6ef1664027 ("test/bonding: allow disabling driver")
Fixes: 207b1c813f39 ("test: fix build without ring PMD")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
---
 app/test/meson.build | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index 8524a986a..d7d0e7871 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -322,6 +322,10 @@ endif
 # they are used via a driver-specific API.
 if dpdk_conf.has('RTE_LIBRTE_BOND_PMD')
 	test_deps += 'pmd_bond'
+	if dpdk_conf.has('RTE_LIBRTE_RING_PMD')
+		test_sources += 'test_link_bonding_mode4.c'
+		driver_test_names += 'link_bonding_mode4_autotest'
+	endif
 endif
 if dpdk_conf.has('RTE_LIBRTE_RING_PMD')
 	test_deps += 'pmd_ring'
@@ -330,7 +334,6 @@ if dpdk_conf.has('RTE_LIBRTE_RING_PMD')
 	test_sources += 'test_event_eth_tx_adapter.c'
 	test_sources += 'test_bitratestats.c'
 	test_sources += 'test_latencystats.c'
-	test_sources += 'test_link_bonding_mode4.c'
 	test_sources += 'sample_packet_forward.c'
 	test_sources += 'test_pdump.c'
 	fast_test_names += 'ring_pmd_autotest'
@@ -338,7 +341,6 @@ if dpdk_conf.has('RTE_LIBRTE_RING_PMD')
 	fast_test_names += 'event_eth_tx_adapter_autotest'
 	fast_test_names += 'bitratestats_autotest'
 	fast_test_names += 'latencystats_autotest'
-	driver_test_names += 'link_bonding_mode4_autotest'
 	fast_test_names += 'pdump_autotest'
 endif
 
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:51.360596281 +0100
+++ 0072-test-fix-build-with-ring-PMD-but-no-bond-PMD.patch	2020-07-24 12:53:48.295006608 +0100
@@ -1,8 +1,10 @@
-From 949c97ae310af049075c8745208e8795b9071d9c Mon Sep 17 00:00:00 2001
+From ff89fb4fe754c59fa09d32a5874367638b32ba20 Mon Sep 17 00:00:00 2001
 From: Bruce Richardson <bruce.richardson@intel.com>
 Date: Wed, 27 May 2020 15:57:45 +0100
 Subject: [PATCH] test: fix build with ring PMD but no bond PMD
 
+[ upstream commit 949c97ae310af049075c8745208e8795b9071d9c ]
+
 If the bonding pmd is disabled, all autotest associated with it should be
 disabled. However, some of those tests also depended upon the ring PMD so
 were placed in a block depending on that driver - and unfortunately that
@@ -30,13 +32,13 @@
  1 file changed, 4 insertions(+), 2 deletions(-)
 
 diff --git a/app/test/meson.build b/app/test/meson.build
-index 5233ead46..10f23d53b 100644
+index 8524a986a..d7d0e7871 100644
 --- a/app/test/meson.build
 +++ b/app/test/meson.build
-@@ -352,6 +352,10 @@ if dpdk_conf.has('RTE_LIBRTE_BOND_PMD')
+@@ -322,6 +322,10 @@ endif
+ # they are used via a driver-specific API.
+ if dpdk_conf.has('RTE_LIBRTE_BOND_PMD')
  	test_deps += 'pmd_bond'
- 	test_sources += ['test_link_bonding.c', 'test_link_bonding_rssconf.c']
- 	driver_test_names += ['link_bonding_autotest', 'link_bonding_rssconf_autotest']
 +	if dpdk_conf.has('RTE_LIBRTE_RING_PMD')
 +		test_sources += 'test_link_bonding_mode4.c'
 +		driver_test_names += 'link_bonding_mode4_autotest'
@@ -44,20 +46,20 @@
  endif
  if dpdk_conf.has('RTE_LIBRTE_RING_PMD')
  	test_deps += 'pmd_ring'
-@@ -360,7 +364,6 @@ if dpdk_conf.has('RTE_LIBRTE_RING_PMD')
+@@ -330,7 +334,6 @@ if dpdk_conf.has('RTE_LIBRTE_RING_PMD')
  	test_sources += 'test_event_eth_tx_adapter.c'
  	test_sources += 'test_bitratestats.c'
  	test_sources += 'test_latencystats.c'
 -	test_sources += 'test_link_bonding_mode4.c'
  	test_sources += 'sample_packet_forward.c'
  	test_sources += 'test_pdump.c'
- 	fast_tests += [['ring_pmd_autotest', true]]
-@@ -368,7 +371,6 @@ if dpdk_conf.has('RTE_LIBRTE_RING_PMD')
- 	fast_tests += [['event_eth_tx_adapter_autotest', false]]
- 	fast_tests += [['bitratestats_autotest', true]]
- 	fast_tests += [['latencystats_autotest', true]]
+ 	fast_test_names += 'ring_pmd_autotest'
+@@ -338,7 +341,6 @@ if dpdk_conf.has('RTE_LIBRTE_RING_PMD')
+ 	fast_test_names += 'event_eth_tx_adapter_autotest'
+ 	fast_test_names += 'bitratestats_autotest'
+ 	fast_test_names += 'latencystats_autotest'
 -	driver_test_names += 'link_bonding_mode4_autotest'
- 	fast_tests += [['pdump_autotest', true]]
+ 	fast_test_names += 'pdump_autotest'
  endif
  
 -- 

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

* [dpdk-stable] patch 'mem: fix 32-bit init config with meson' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (70 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'test: fix build with ring PMD but no bond PMD' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'examples/eventdev: fix 32-bit coremask' " luca.boccassi
                   ` (119 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 63cfb8b938d405896b8026b8726bd24bfc9ded8d Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Thu, 2 Jul 2020 11:57:21 +0100
Subject: [PATCH] mem: fix 32-bit init config with meson

[ upstream commit b29ac33ffccf856825c42dc11185b112f569ba57 ]

When building with meson, the default size of virtual address space
reserved for mapping pages was globally set at 512GB, which is too big for
use in 32-bit processes. To match the behaviour with "make", we configure
this to be 512GB for 64-bit and 2GB for 32-bit builds.

Bugzilla ID: 498
Fixes: 66cc45e293ed ("mem: replace memseg with memseg lists")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 config/meson.build  | 5 +++++
 config/rte_config.h | 1 -
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/config/meson.build b/config/meson.build
index 78bfdf309..9f77802d0 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -214,6 +214,11 @@ dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
 dpdk_conf.set('RTE_MAX_VFIO_GROUPS', 64)
 dpdk_conf.set('RTE_DRIVER_MEMPOOL_BUCKET_SIZE_KB', 64)
 dpdk_conf.set('RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', true)
+if dpdk_conf.get('RTE_ARCH_64')
+	dpdk_conf.set('RTE_MAX_MEM_MB', 524288)
+else # for 32-bit we need smaller reserved memory areas
+	dpdk_conf.set('RTE_MAX_MEM_MB', 2048)
+endif
 
 
 compile_time_cpuflags = []
diff --git a/config/rte_config.h b/config/rte_config.h
index d30786bc0..765251a25 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -38,7 +38,6 @@
 #define RTE_MAX_MEM_MB_PER_LIST 32768
 #define RTE_MAX_MEMSEG_PER_TYPE 32768
 #define RTE_MAX_MEM_MB_PER_TYPE 65536
-#define RTE_MAX_MEM_MB 524288
 #define RTE_MAX_MEMZONE 2560
 #define RTE_MAX_TAILQ 32
 #define RTE_LOG_DP_LEVEL RTE_LOG_INFO
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:51.392667367 +0100
+++ 0073-mem-fix-32-bit-init-config-with-meson.patch	2020-07-24 12:53:48.299006683 +0100
@@ -1,8 +1,10 @@
-From b29ac33ffccf856825c42dc11185b112f569ba57 Mon Sep 17 00:00:00 2001
+From 63cfb8b938d405896b8026b8726bd24bfc9ded8d Mon Sep 17 00:00:00 2001
 From: Bruce Richardson <bruce.richardson@intel.com>
 Date: Thu, 2 Jul 2020 11:57:21 +0100
 Subject: [PATCH] mem: fix 32-bit init config with meson
 
+[ upstream commit b29ac33ffccf856825c42dc11185b112f569ba57 ]
+
 When building with meson, the default size of virtual address space
 reserved for mapping pages was globally set at 512GB, which is too big for
 use in 32-bit processes. To match the behaviour with "make", we configure
@@ -10,7 +12,6 @@
 
 Bugzilla ID: 498
 Fixes: 66cc45e293ed ("mem: replace memseg with memseg lists")
-Cc: stable@dpdk.org
 
 Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
 Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
@@ -20,10 +21,10 @@
  2 files changed, 5 insertions(+), 1 deletion(-)
 
 diff --git a/config/meson.build b/config/meson.build
-index 351e268c1..241d62acc 100644
+index 78bfdf309..9f77802d0 100644
 --- a/config/meson.build
 +++ b/config/meson.build
-@@ -238,6 +238,11 @@ dpdk_conf.set('RTE_ENABLE_TRACE_FP', get_option('enable_trace_fp'))
+@@ -214,6 +214,11 @@ dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
  dpdk_conf.set('RTE_MAX_VFIO_GROUPS', 64)
  dpdk_conf.set('RTE_DRIVER_MEMPOOL_BUCKET_SIZE_KB', 64)
  dpdk_conf.set('RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', true)
@@ -36,7 +37,7 @@
  
  compile_time_cpuflags = []
 diff --git a/config/rte_config.h b/config/rte_config.h
-index e9201fd46..086acf74a 100644
+index d30786bc0..765251a25 100644
 --- a/config/rte_config.h
 +++ b/config/rte_config.h
 @@ -38,7 +38,6 @@

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

* [dpdk-stable] patch 'examples/eventdev: fix 32-bit coremask' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (71 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'mem: fix 32-bit init config with meson' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'event/octeontx2: fix device reconfigure' " luca.boccassi
                   ` (118 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Harry van Haaren; +Cc: Jun W Zhou, Mao Jiang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 11908b39262384c5a2cd96e6a27ef5b259e61e49 Mon Sep 17 00:00:00 2001
From: Harry van Haaren <harry.van.haaren@intel.com>
Date: Tue, 16 Jun 2020 17:56:03 +0100
Subject: [PATCH] examples/eventdev: fix 32-bit coremask

[ upstream commit ff0f1040b66edcbaf93fc217ea452e4a9ae424e2 ]

This commit fixes a bug in 32-bit environments when a core mask greater
than 32-bits is requested. The fix is to convert the bitmask logic to
64 bits, aligning 64 and 32 bit implementations.

Fixes: adb5d548 ("examples/eventdev_pipeline_sw_pmd: add sample app")

Reported-by: Jun W Zhou <junx.w.zhou@intel.com>
Suggested-by: Mao Jiang <maox.jiang@intel.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
---
 examples/eventdev_pipeline/main.c            | 10 +++++-----
 examples/eventdev_pipeline/pipeline_common.h |  8 ++++----
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index 21958269f..4ac582153 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -81,7 +81,7 @@ parse_coremask(const char *coremask)
 		val = xdigit2val(c);
 		for (j = 0; j < BITS_HEX && idx < MAX_NUM_CORE; j++, idx++) {
 			if ((1 << j) & val) {
-				mask |= (1UL << idx);
+				mask |= (1ULL << idx);
 				count++;
 			}
 		}
@@ -232,10 +232,10 @@ parse_app_args(int argc, char **argv)
 		usage();
 
 	for (i = 0; i < MAX_NUM_CORE; i++) {
-		fdata->rx_core[i] = !!(rx_lcore_mask & (1UL << i));
-		fdata->tx_core[i] = !!(tx_lcore_mask & (1UL << i));
-		fdata->sched_core[i] = !!(sched_lcore_mask & (1UL << i));
-		fdata->worker_core[i] = !!(worker_lcore_mask & (1UL << i));
+		fdata->rx_core[i] = !!(rx_lcore_mask & (1ULL << i));
+		fdata->tx_core[i] = !!(tx_lcore_mask & (1ULL << i));
+		fdata->sched_core[i] = !!(sched_lcore_mask & (1ULL << i));
+		fdata->worker_core[i] = !!(worker_lcore_mask & (1ULL << i));
 
 		if (fdata->worker_core[i])
 			cdata.num_workers++;
diff --git a/examples/eventdev_pipeline/pipeline_common.h b/examples/eventdev_pipeline/pipeline_common.h
index c7245f7f0..6a4287602 100644
--- a/examples/eventdev_pipeline/pipeline_common.h
+++ b/examples/eventdev_pipeline/pipeline_common.h
@@ -51,10 +51,10 @@ struct fastpath_data {
 	bool rx_single;
 	bool tx_single;
 	bool sched_single;
-	unsigned int rx_core[MAX_NUM_CORE];
-	unsigned int tx_core[MAX_NUM_CORE];
-	unsigned int sched_core[MAX_NUM_CORE];
-	unsigned int worker_core[MAX_NUM_CORE];
+	uint64_t rx_core[MAX_NUM_CORE];
+	uint64_t tx_core[MAX_NUM_CORE];
+	uint64_t sched_core[MAX_NUM_CORE];
+	uint64_t worker_core[MAX_NUM_CORE];
 	struct setup_data cap;
 } __rte_cache_aligned;
 
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:51.431352056 +0100
+++ 0074-examples-eventdev-fix-32-bit-coremask.patch	2020-07-24 12:53:48.299006683 +0100
@@ -1,14 +1,15 @@
-From ff0f1040b66edcbaf93fc217ea452e4a9ae424e2 Mon Sep 17 00:00:00 2001
+From 11908b39262384c5a2cd96e6a27ef5b259e61e49 Mon Sep 17 00:00:00 2001
 From: Harry van Haaren <harry.van.haaren@intel.com>
 Date: Tue, 16 Jun 2020 17:56:03 +0100
 Subject: [PATCH] examples/eventdev: fix 32-bit coremask
 
+[ upstream commit ff0f1040b66edcbaf93fc217ea452e4a9ae424e2 ]
+
 This commit fixes a bug in 32-bit environments when a core mask greater
 than 32-bits is requested. The fix is to convert the bitmask logic to
 64 bits, aligning 64 and 32 bit implementations.
 
 Fixes: adb5d548 ("examples/eventdev_pipeline_sw_pmd: add sample app")
-Cc: stable@dpdk.org
 
 Reported-by: Jun W Zhou <junx.w.zhou@intel.com>
 Suggested-by: Mao Jiang <maox.jiang@intel.com>

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

* [dpdk-stable] patch 'event/octeontx2: fix device reconfigure' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (72 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'examples/eventdev: fix 32-bit coremask' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'event/octeontx2: fix sub event type' " luca.boccassi
                   ` (117 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Pavan Nikhilesh; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From c3b33b6d91e2e795d16cd90ddb2f5d316ecc052d Mon Sep 17 00:00:00 2001
From: Pavan Nikhilesh <pbhagavatula@marvell.com>
Date: Mon, 29 Jun 2020 07:03:26 +0530
Subject: [PATCH] event/octeontx2: fix device reconfigure

[ upstream commit 8b787cba705323ba79e35e0f19bfba51ab6d953a ]

When event device is re-configured maintain the event queue to event port
links and event port status instead of resetting them.

Fixes: cd24e70258bd ("event/octeontx2: add device configure function")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 drivers/event/octeontx2/otx2_evdev.c | 60 +++++++++++++++++++++++-----
 1 file changed, 50 insertions(+), 10 deletions(-)

diff --git a/drivers/event/octeontx2/otx2_evdev.c b/drivers/event/octeontx2/otx2_evdev.c
index 2daeba42c..f7766812b 100644
--- a/drivers/event/octeontx2/otx2_evdev.c
+++ b/drivers/event/octeontx2/otx2_evdev.c
@@ -685,6 +685,46 @@ sso_clr_links(const struct rte_eventdev *event_dev)
 	}
 }
 
+static void
+sso_restore_links(const struct rte_eventdev *event_dev)
+{
+	struct otx2_sso_evdev *dev = sso_pmd_priv(event_dev);
+	uint16_t *links_map;
+	int i, j;
+
+	for (i = 0; i < dev->nb_event_ports; i++) {
+		links_map = event_dev->data->links_map;
+		/* Point links_map to this port specific area */
+		links_map += (i * RTE_EVENT_MAX_QUEUES_PER_DEV);
+		if (dev->dual_ws) {
+			struct otx2_ssogws_dual *ws;
+
+			ws = event_dev->data->ports[i];
+			for (j = 0; j < dev->nb_event_queues; j++) {
+				if (links_map[j] == 0xdead)
+					continue;
+				sso_port_link_modify((struct otx2_ssogws *)
+						&ws->ws_state[0], j, true);
+				sso_port_link_modify((struct otx2_ssogws *)
+						&ws->ws_state[1], j, true);
+				sso_func_trace("Restoring port %d queue %d "
+						"link", i, j);
+			}
+		} else {
+			struct otx2_ssogws *ws;
+
+			ws = event_dev->data->ports[i];
+			for (j = 0; j < dev->nb_event_queues; j++) {
+				if (links_map[j] == 0xdead)
+					continue;
+				sso_port_link_modify(ws, j, true);
+				sso_func_trace("Restoring port %d queue %d "
+						"link", i, j);
+			}
+		}
+	}
+}
+
 static void
 sso_set_port_ops(struct otx2_ssogws *ws, uintptr_t base)
 {
@@ -725,18 +765,15 @@ sso_configure_dual_ports(const struct rte_eventdev *event_dev)
 		struct otx2_ssogws_dual *ws;
 		uintptr_t base;
 
-		/* Free memory prior to re-allocation if needed */
 		if (event_dev->data->ports[i] != NULL) {
 			ws = event_dev->data->ports[i];
-			rte_free(ws);
-			ws = NULL;
-		}
-
-		/* Allocate event port memory */
-		ws = rte_zmalloc_socket("otx2_sso_ws",
+		} else {
+			/* Allocate event port memory */
+			ws = rte_zmalloc_socket("otx2_sso_ws",
 					sizeof(struct otx2_ssogws_dual),
 					RTE_CACHE_LINE_SIZE,
 					event_dev->data->socket_id);
+		}
 		if (ws == NULL) {
 			otx2_err("Failed to alloc memory for port=%d", i);
 			rc = -ENOMEM;
@@ -1021,8 +1058,11 @@ otx2_sso_configure(const struct rte_eventdev *event_dev)
 		return -EINVAL;
 	}
 
-	if (dev->configured)
+	if (dev->configured) {
 		sso_unregister_irqs(event_dev);
+		/* Clear any prior port-queue mapping. */
+		sso_clr_links(event_dev);
+	}
 
 	if (dev->nb_event_queues) {
 		/* Finit any previous queues. */
@@ -1057,8 +1097,8 @@ otx2_sso_configure(const struct rte_eventdev *event_dev)
 		goto teardown_hwggrp;
 	}
 
-	/* Clear any prior port-queue mapping. */
-	sso_clr_links(event_dev);
+	/* Restore any prior port-queue mapping. */
+	sso_restore_links(event_dev);
 	rc = sso_ggrp_alloc_xaq(dev);
 	if (rc < 0) {
 		otx2_err("Failed to alloc xaq to ggrp %d", rc);
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:51.465454456 +0100
+++ 0075-event-octeontx2-fix-device-reconfigure.patch	2020-07-24 12:53:48.299006683 +0100
@@ -1,13 +1,14 @@
-From 8b787cba705323ba79e35e0f19bfba51ab6d953a Mon Sep 17 00:00:00 2001
+From c3b33b6d91e2e795d16cd90ddb2f5d316ecc052d Mon Sep 17 00:00:00 2001
 From: Pavan Nikhilesh <pbhagavatula@marvell.com>
 Date: Mon, 29 Jun 2020 07:03:26 +0530
 Subject: [PATCH] event/octeontx2: fix device reconfigure
 
+[ upstream commit 8b787cba705323ba79e35e0f19bfba51ab6d953a ]
+
 When event device is re-configured maintain the event queue to event port
 links and event port status instead of resetting them.
 
 Fixes: cd24e70258bd ("event/octeontx2: add device configure function")
-Cc: stable@dpdk.org
 
 Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
 ---
@@ -15,10 +16,10 @@
  1 file changed, 50 insertions(+), 10 deletions(-)
 
 diff --git a/drivers/event/octeontx2/otx2_evdev.c b/drivers/event/octeontx2/otx2_evdev.c
-index 630073de5..b8b57c388 100644
+index 2daeba42c..f7766812b 100644
 --- a/drivers/event/octeontx2/otx2_evdev.c
 +++ b/drivers/event/octeontx2/otx2_evdev.c
-@@ -725,6 +725,46 @@ sso_clr_links(const struct rte_eventdev *event_dev)
+@@ -685,6 +685,46 @@ sso_clr_links(const struct rte_eventdev *event_dev)
  	}
  }
  
@@ -65,7 +66,7 @@
  static void
  sso_set_port_ops(struct otx2_ssogws *ws, uintptr_t base)
  {
-@@ -765,18 +805,15 @@ sso_configure_dual_ports(const struct rte_eventdev *event_dev)
+@@ -725,18 +765,15 @@ sso_configure_dual_ports(const struct rte_eventdev *event_dev)
  		struct otx2_ssogws_dual *ws;
  		uintptr_t base;
  
@@ -88,7 +89,7 @@
  		if (ws == NULL) {
  			otx2_err("Failed to alloc memory for port=%d", i);
  			rc = -ENOMEM;
-@@ -1061,8 +1098,11 @@ otx2_sso_configure(const struct rte_eventdev *event_dev)
+@@ -1021,8 +1058,11 @@ otx2_sso_configure(const struct rte_eventdev *event_dev)
  		return -EINVAL;
  	}
  
@@ -101,7 +102,7 @@
  
  	if (dev->nb_event_queues) {
  		/* Finit any previous queues. */
-@@ -1097,8 +1137,8 @@ otx2_sso_configure(const struct rte_eventdev *event_dev)
+@@ -1057,8 +1097,8 @@ otx2_sso_configure(const struct rte_eventdev *event_dev)
  		goto teardown_hwggrp;
  	}
  

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

* [dpdk-stable] patch 'event/octeontx2: fix sub event type' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (73 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'event/octeontx2: fix device reconfigure' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'devtools: fix path in forbidden token check' " luca.boccassi
                   ` (116 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Pavan Nikhilesh; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From f2e1decce9f0d3fae23a206c587a3cba8485eaa0 Mon Sep 17 00:00:00 2001
From: Pavan Nikhilesh <pbhagavatula@marvell.com>
Date: Mon, 29 Jun 2020 07:03:27 +0530
Subject: [PATCH] event/octeontx2: fix sub event type

[ upstream commit 3c1a1c43cd93fa7c73a460d6f88ca5de7ca1e9c0 ]

In OCTEONTX2 event device we use sub_event_type to store the ethernet
port identifier when we receive work from OCTEONTX2 ethernet device.
This violates the event device spec as sub_event_type should be 0 in
the initial receive stage.
Set sub_event_type to 0 after copying the port id.

Fixes: 0fe4accd8ec8 ("event/octeontx2: add Rx adapter fastpath ops")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 drivers/event/octeontx2/otx2_worker_dual.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/event/octeontx2/otx2_worker_dual.h b/drivers/event/octeontx2/otx2_worker_dual.h
index 5134e3d52..fb6a8cd0d 100644
--- a/drivers/event/octeontx2/otx2_worker_dual.h
+++ b/drivers/event/octeontx2/otx2_worker_dual.h
@@ -69,8 +69,11 @@ otx2_ssogws_dual_get_work(struct otx2_ssogws_state *ws,
 
 	if (event.sched_type != SSO_TT_EMPTY &&
 	    event.event_type == RTE_EVENT_TYPE_ETHDEV) {
-		otx2_wqe_to_mbuf(get_work1, mbuf, event.sub_event_type,
-				 (uint32_t) event.get_work0, flags, lookup_mem);
+		uint8_t port = event.sub_event_type;
+
+		event.sub_event_type = 0;
+		otx2_wqe_to_mbuf(get_work1, mbuf, port,
+				 event.flow_id, flags, lookup_mem);
 		/* Extracting tstamp, if PTP enabled. CGX will prepend the
 		 * timestamp at starting of packet data and it can be derieved
 		 * from WQE 9 dword which corresponds to SG iova.
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:51.501030484 +0100
+++ 0076-event-octeontx2-fix-sub-event-type.patch	2020-07-24 12:53:48.299006683 +0100
@@ -1,8 +1,10 @@
-From 3c1a1c43cd93fa7c73a460d6f88ca5de7ca1e9c0 Mon Sep 17 00:00:00 2001
+From f2e1decce9f0d3fae23a206c587a3cba8485eaa0 Mon Sep 17 00:00:00 2001
 From: Pavan Nikhilesh <pbhagavatula@marvell.com>
 Date: Mon, 29 Jun 2020 07:03:27 +0530
 Subject: [PATCH] event/octeontx2: fix sub event type
 
+[ upstream commit 3c1a1c43cd93fa7c73a460d6f88ca5de7ca1e9c0 ]
+
 In OCTEONTX2 event device we use sub_event_type to store the ethernet
 port identifier when we receive work from OCTEONTX2 ethernet device.
 This violates the event device spec as sub_event_type should be 0 in
@@ -10,7 +12,6 @@
 Set sub_event_type to 0 after copying the port id.
 
 Fixes: 0fe4accd8ec8 ("event/octeontx2: add Rx adapter fastpath ops")
-Cc: stable@dpdk.org
 
 Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
 ---
@@ -18,10 +19,10 @@
  1 file changed, 5 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/event/octeontx2/otx2_worker_dual.h b/drivers/event/octeontx2/otx2_worker_dual.h
-index c88420eb4..60aa14cca 100644
+index 5134e3d52..fb6a8cd0d 100644
 --- a/drivers/event/octeontx2/otx2_worker_dual.h
 +++ b/drivers/event/octeontx2/otx2_worker_dual.h
-@@ -65,8 +65,11 @@ otx2_ssogws_dual_get_work(struct otx2_ssogws_state *ws,
+@@ -69,8 +69,11 @@ otx2_ssogws_dual_get_work(struct otx2_ssogws_state *ws,
  
  	if (event.sched_type != SSO_TT_EMPTY &&
  	    event.event_type == RTE_EVENT_TYPE_ETHDEV) {

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

* [dpdk-stable] patch 'devtools: fix path in forbidden token check' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (74 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'event/octeontx2: fix sub event type' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'sched: fix port time rounding' " luca.boccassi
                   ` (115 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: David Marchand; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From d1d309474c4b718655da73d6330cced02d4bd6bf Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Mon, 6 Jul 2020 10:00:21 +0200
Subject: [PATCH] devtools: fix path in forbidden token check

[ upstream commit 8d4a222e12f8ce99714fad5011d76bd6a38c36e3 ]

Fix displayed filename by adjusting the extraction from the patch.

Before:
Warning in /lib/librte_eal/linux/eal.c:

After:
Warning in lib/librte_eal/linux/eal.c:

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

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 devtools/check-forbidden-tokens.awk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/devtools/check-forbidden-tokens.awk b/devtools/check-forbidden-tokens.awk
index 8c89de3d4..f86cbe8dc 100755
--- a/devtools/check-forbidden-tokens.awk
+++ b/devtools/check-forbidden-tokens.awk
@@ -62,7 +62,7 @@ BEGIN {
 }
 END {
 	if (count > 0) {
-		print "Warning in " substr(last_file,6) ":"
+		print "Warning in " substr(last_file,7) ":"
 		print MESSAGE
 		exit RET_ON_FAIL
 	}
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:51.535683292 +0100
+++ 0077-devtools-fix-path-in-forbidden-token-check.patch	2020-07-24 12:53:48.299006683 +0100
@@ -1,8 +1,10 @@
-From 8d4a222e12f8ce99714fad5011d76bd6a38c36e3 Mon Sep 17 00:00:00 2001
+From d1d309474c4b718655da73d6330cced02d4bd6bf Mon Sep 17 00:00:00 2001
 From: David Marchand <david.marchand@redhat.com>
 Date: Mon, 6 Jul 2020 10:00:21 +0200
 Subject: [PATCH] devtools: fix path in forbidden token check
 
+[ upstream commit 8d4a222e12f8ce99714fad5011d76bd6a38c36e3 ]
+
 Fix displayed filename by adjusting the extraction from the patch.
 
 Before:
@@ -12,7 +14,6 @@
 Warning in lib/librte_eal/linux/eal.c:
 
 Fixes: 7413e7f2aeb3 ("devtools: alert on new calls to exit from libs")
-Cc: stable@dpdk.org
 
 Signed-off-by: David Marchand <david.marchand@redhat.com>
 ---

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

* [dpdk-stable] patch 'sched: fix port time rounding' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (75 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'devtools: fix path in forbidden token check' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'lib: remind experimental status in headers' " luca.boccassi
                   ` (114 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Alan Dewar; +Cc: Jasvinder Singh, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 7dfa5c18513abc6734cd47c0ce4851456d09c255 Mon Sep 17 00:00:00 2001
From: Alan Dewar <alan.dewar@att.com>
Date: Thu, 25 Jun 2020 10:59:30 +0100
Subject: [PATCH] sched: fix port time rounding

[ upstream commit 83415d4fd88c925002655aa755601998a3cdef2c ]

The QoS scheduler works off port time that is computed from the number
of CPU cycles that have elapsed since the last time the port was
polled.   It divides the number of elapsed cycles to calculate how
many bytes can be sent, however this division can generate rounding
errors, where some fraction of a byte sent may be lost.

Lose enough of these fractional bytes and the QoS scheduler
underperforms.  The problem is worse with low bandwidths.

To compensate for this rounding error this fix doesn't advance the
port's time_cpu_cycles by the number of cycles that have elapsed,
but by multiplying the computed number of bytes that can be sent
(which has been rounded down) by number of cycles per byte.
This will mean that port's time_cpu_cycles will lag behind the CPU
cycles momentarily.  At the next poll, the lag will be taken into
account.

Fixes: de3cfa2c98 ("sched: initial import")

Signed-off-by: Alan Dewar <alan.dewar@att.com>
Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
---
 lib/librte_sched/rte_sched.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c
index 68a171b50..0fa074166 100644
--- a/lib/librte_sched/rte_sched.c
+++ b/lib/librte_sched/rte_sched.c
@@ -222,6 +222,7 @@ struct rte_sched_port {
 	uint64_t time_cpu_bytes;      /* Current CPU time measured in bytes */
 	uint64_t time;                /* Current NIC TX time measured in bytes */
 	struct rte_reciprocal inv_cycles_per_byte; /* CPU cycles per byte */
+	uint64_t cycles_per_byte;
 
 	/* Grinders */
 	struct rte_mbuf **pkts_out;
@@ -852,6 +853,7 @@ rte_sched_port_config(struct rte_sched_port_params *params)
 	cycles_per_byte = (rte_get_tsc_hz() << RTE_SCHED_TIME_SHIFT)
 		/ params->rate;
 	port->inv_cycles_per_byte = rte_reciprocal_value(cycles_per_byte);
+	port->cycles_per_byte = cycles_per_byte;
 
 	/* Grinders */
 	port->pkts_out = NULL;
@@ -2673,16 +2675,21 @@ static inline void
 rte_sched_port_time_resync(struct rte_sched_port *port)
 {
 	uint64_t cycles = rte_get_tsc_cycles();
-	uint64_t cycles_diff = cycles - port->time_cpu_cycles;
+	uint64_t cycles_diff;
 	uint64_t bytes_diff;
 	uint32_t i;
 
+	if (cycles < port->time_cpu_cycles)
+		port->time_cpu_cycles = 0;
+
+	cycles_diff = cycles - port->time_cpu_cycles;
 	/* Compute elapsed time in bytes */
 	bytes_diff = rte_reciprocal_divide(cycles_diff << RTE_SCHED_TIME_SHIFT,
 					   port->inv_cycles_per_byte);
 
 	/* Advance port time */
-	port->time_cpu_cycles = cycles;
+	port->time_cpu_cycles +=
+		(bytes_diff * port->cycles_per_byte) >> RTE_SCHED_TIME_SHIFT;
 	port->time_cpu_bytes += bytes_diff;
 	if (port->time < port->time_cpu_bytes)
 		port->time = port->time_cpu_bytes;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:51.570962574 +0100
+++ 0078-sched-fix-port-time-rounding.patch	2020-07-24 12:53:48.303006758 +0100
@@ -1,8 +1,10 @@
-From 83415d4fd88c925002655aa755601998a3cdef2c Mon Sep 17 00:00:00 2001
+From 7dfa5c18513abc6734cd47c0ce4851456d09c255 Mon Sep 17 00:00:00 2001
 From: Alan Dewar <alan.dewar@att.com>
 Date: Thu, 25 Jun 2020 10:59:30 +0100
 Subject: [PATCH] sched: fix port time rounding
 
+[ upstream commit 83415d4fd88c925002655aa755601998a3cdef2c ]
+
 The QoS scheduler works off port time that is computed from the number
 of CPU cycles that have elapsed since the last time the port was
 polled.   It divides the number of elapsed cycles to calculate how
@@ -21,7 +23,6 @@
 account.
 
 Fixes: de3cfa2c98 ("sched: initial import")
-Cc: stable@dpdk.org
 
 Signed-off-by: Alan Dewar <alan.dewar@att.com>
 Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>

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

* [dpdk-stable] patch 'lib: remind experimental status in headers' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (76 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'sched: fix port time rounding' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'rawdev: remove remaining experimental tags' " luca.boccassi
                   ` (113 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: David Marchand; +Cc: Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From e2acbb7f711e0080871bf935b36c28d481411c7d Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Fri, 26 Jun 2020 10:16:38 +0200
Subject: [PATCH] lib: remind experimental status in headers

[ upstream commit 74f4d6424da1297bd6e83dcb7bd84444ca8c59dd ]

The following libraries are experimental, all of their functions can
be changed or removed:

- librte_bbdev
- librte_bpf
- librte_compressdev
- librte_fib
- librte_flow_classify
- librte_graph
- librte_ipsec
- librte_node
- librte_rcu
- librte_rib
- librte_stack
- librte_telemetry

Their status is properly announced in MAINTAINERS.
Remind this status in their headers in a common fashion (aligned to ABI
docs).

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 doc/guides/contributing/abi_policy.rst       | 12 +++++-------
 lib/librte_bbdev/rte_bbdev.h                 |  3 ++-
 lib/librte_bpf/rte_bpf.h                     |  6 +++++-
 lib/librte_compressdev/rte_compressdev.h     |  6 +++++-
 lib/librte_fib/rte_fib.h                     |  7 +++++++
 lib/librte_fib/rte_fib6.h                    |  7 +++++++
 lib/librte_flow_classify/rte_flow_classify.h |  6 ++++--
 lib/librte_ipsec/rte_ipsec.h                 |  6 +++++-
 lib/librte_rcu/rte_rcu_qsbr.h                |  7 ++++++-
 lib/librte_rib/rte_rib.h                     |  7 +++++++
 lib/librte_rib/rte_rib6.h                    |  7 +++++++
 lib/librte_stack/rte_stack.h                 |  7 +++++--
 lib/librte_telemetry/rte_telemetry.h         |  7 ++++++-
 13 files changed, 71 insertions(+), 17 deletions(-)

diff --git a/doc/guides/contributing/abi_policy.rst b/doc/guides/contributing/abi_policy.rst
index 2198519d9..87942c8ac 100644
--- a/doc/guides/contributing/abi_policy.rst
+++ b/doc/guides/contributing/abi_policy.rst
@@ -27,8 +27,8 @@ General Guidelines
 #. The removal of symbols is considered an :ref:`ABI breakage <abi_breakages>`,
    once approved these will form part of the next ABI version.
 #. Libraries or APIs marked as :ref:`experimental <experimental_apis>` may
-   change without constraint, as they are not considered part of an ABI version.
-   Experimental libraries have the major ABI version ``0``.
+   be changed or removed without prior notice, as they are not considered part
+   of an ABI version.
 #. Updates to the :ref:`minimum hardware requirements <hw_rqmts>`, which drop
    support for hardware which was previously supported, should be treated as an
    ABI change.
@@ -289,7 +289,7 @@ APIs
 ~~~~
 
 APIs marked as ``experimental`` are not considered part of an ABI version and
-may change without warning at any time. Since changes to APIs are most likely
+may be changed or removed without prior notice. Since changes to APIs are most likely
 immediately after their introduction, as users begin to take advantage of those
 new APIs and start finding issues with them, new DPDK APIs will be automatically
 marked as ``experimental`` to allow for a period of stabilization before they
@@ -320,7 +320,5 @@ Libraries
 ~~~~~~~~~
 
 Libraries marked as ``experimental`` are entirely not considered part of an ABI
-version, and may change without warning at any time. Experimental libraries
-always have a major ABI version of ``0`` to indicate they exist outside of
-:ref:`abi_versioning` , with the minor version incremented with each ABI change
-to library.
+version.
+All functions in such libraries may be changed or removed without prior notice.
diff --git a/lib/librte_bbdev/rte_bbdev.h b/lib/librte_bbdev/rte_bbdev.h
index 1f58a0762..6fcf44826 100644
--- a/lib/librte_bbdev/rte_bbdev.h
+++ b/lib/librte_bbdev/rte_bbdev.h
@@ -11,7 +11,8 @@
  * Wireless base band device abstraction APIs.
  *
  * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
+ * @b EXPERIMENTAL:
+ * All functions in this file may be changed or removed without prior notice.
  *
  * This API allows an application to discover, configure and use a device to
  * process operations. An asynchronous API (enqueue, followed by later dequeue)
diff --git a/lib/librte_bpf/rte_bpf.h b/lib/librte_bpf/rte_bpf.h
index cbf1cddac..e2d419b4e 100644
--- a/lib/librte_bpf/rte_bpf.h
+++ b/lib/librte_bpf/rte_bpf.h
@@ -7,9 +7,13 @@
 
 /**
  * @file rte_bpf.h
- * @b EXPERIMENTAL: this API may change without prior notice
  *
  * RTE BPF support.
+ *
+ * @warning
+ * @b EXPERIMENTAL:
+ * All functions in this file may be changed or removed without prior notice.
+ *
  * librte_bpf provides a framework to load and execute eBPF bytecode
  * inside user-space dpdk based applications.
  * It supports basic set of features from eBPF spec
diff --git a/lib/librte_compressdev/rte_compressdev.h b/lib/librte_compressdev/rte_compressdev.h
index 8052efe67..2840c27c6 100644
--- a/lib/librte_compressdev/rte_compressdev.h
+++ b/lib/librte_compressdev/rte_compressdev.h
@@ -8,7 +8,11 @@
 /**
  * @file rte_compressdev.h
  *
- * RTE Compression Device APIs
+ * RTE Compression Device APIs.
+ *
+ * @warning
+ * @b EXPERIMENTAL:
+ * All functions in this file may be changed or removed without prior notice.
  *
  * Defines comp device APIs for the provisioning of compression operations.
  */
diff --git a/lib/librte_fib/rte_fib.h b/lib/librte_fib/rte_fib.h
index af3bbf07e..84ee774d2 100644
--- a/lib/librte_fib/rte_fib.h
+++ b/lib/librte_fib/rte_fib.h
@@ -8,6 +8,13 @@
 
 /**
  * @file
+ *
+ * RTE FIB library.
+ *
+ * @warning
+ * @b EXPERIMENTAL:
+ * All functions in this file may be changed or removed without prior notice.
+ *
  * FIB (Forwarding information base) implementation
  * for IPv4 Longest Prefix Match
  */
diff --git a/lib/librte_fib/rte_fib6.h b/lib/librte_fib/rte_fib6.h
index 66c71c84c..bbfcf23a8 100644
--- a/lib/librte_fib/rte_fib6.h
+++ b/lib/librte_fib/rte_fib6.h
@@ -8,6 +8,13 @@
 
 /**
  * @file
+ *
+ * RTE FIB6 library.
+ *
+ * @warning
+ * @b EXPERIMENTAL:
+ * All functions in this file may be changed or removed without prior notice.
+ *
  * FIB (Forwarding information base) implementation
  * for IPv6 Longest Prefix Match
  */
diff --git a/lib/librte_flow_classify/rte_flow_classify.h b/lib/librte_flow_classify/rte_flow_classify.h
index 74d1ecaf5..82ea92b6a 100644
--- a/lib/librte_flow_classify/rte_flow_classify.h
+++ b/lib/librte_flow_classify/rte_flow_classify.h
@@ -8,9 +8,11 @@
 /**
  * @file
  *
- * RTE Flow Classify Library
+ * RTE Flow Classify Library.
  *
- * @b EXPERIMENTAL: this API may change without prior notice
+ * @warning
+ * @b EXPERIMENTAL:
+ * All functions in this file may be changed or removed without prior notice.
  *
  * This library provides flow record information with some measured properties.
  *
diff --git a/lib/librte_ipsec/rte_ipsec.h b/lib/librte_ipsec/rte_ipsec.h
index f3b1f936b..f2da7ace9 100644
--- a/lib/librte_ipsec/rte_ipsec.h
+++ b/lib/librte_ipsec/rte_ipsec.h
@@ -7,9 +7,13 @@
 
 /**
  * @file rte_ipsec.h
- * @b EXPERIMENTAL: this API may change without prior notice
  *
  * RTE IPsec support.
+ *
+ * @warning
+ * @b EXPERIMENTAL:
+ * All functions in this file may be changed or removed without prior notice.
+ *
  * librte_ipsec provides a framework for data-path IPsec protocol
  * processing (ESP/AH).
  */
diff --git a/lib/librte_rcu/rte_rcu_qsbr.h b/lib/librte_rcu/rte_rcu_qsbr.h
index 0b5585925..078de261f 100644
--- a/lib/librte_rcu/rte_rcu_qsbr.h
+++ b/lib/librte_rcu/rte_rcu_qsbr.h
@@ -7,7 +7,12 @@
 
 /**
  * @file
- * RTE Quiescent State Based Reclamation (QSBR)
+ *
+ * RTE Quiescent State Based Reclamation (QSBR).
+ *
+ * @warning
+ * @b EXPERIMENTAL:
+ * All functions in this file may be changed or removed without prior notice.
  *
  * Quiescent State (QS) is any point in the thread execution
  * where the thread does not hold a reference to a data structure
diff --git a/lib/librte_rib/rte_rib.h b/lib/librte_rib/rte_rib.h
index 6b70de980..da558c417 100644
--- a/lib/librte_rib/rte_rib.h
+++ b/lib/librte_rib/rte_rib.h
@@ -8,6 +8,13 @@
 
 /**
  * @file
+ *
+ * RTE RIB library.
+ *
+ * @warning
+ * @b EXPERIMENTAL:
+ * All functions in this file may be changed or removed without prior notice.
+ *
  * Level compressed tree implementation for IPv4 Longest Prefix Match
  */
 
diff --git a/lib/librte_rib/rte_rib6.h b/lib/librte_rib/rte_rib6.h
index 871457138..4b284c913 100644
--- a/lib/librte_rib/rte_rib6.h
+++ b/lib/librte_rib/rte_rib6.h
@@ -8,6 +8,13 @@
 
 /**
  * @file
+ *
+ * RTE rib6 library.
+ *
+ * @warning
+ * @b EXPERIMENTAL:
+ * All functions in this file may be changed or removed without prior notice.
+ *
  * Level compressed tree implementation for IPv6 Longest Prefix Match
  */
 
diff --git a/lib/librte_stack/rte_stack.h b/lib/librte_stack/rte_stack.h
index 27ddb199e..abf642076 100644
--- a/lib/librte_stack/rte_stack.h
+++ b/lib/librte_stack/rte_stack.h
@@ -4,9 +4,12 @@
 
 /**
  * @file rte_stack.h
- * @b EXPERIMENTAL: this API may change without prior notice
  *
- * RTE Stack
+ * RTE Stack.
+ *
+ * @warning
+ * @b EXPERIMENTAL:
+ * All functions in this file may be changed or removed without prior notice.
  *
  * librte_stack provides an API for configuration and use of a bounded stack of
  * pointers. Push and pop operations are MT-safe, allowing concurrent access,
diff --git a/lib/librte_telemetry/rte_telemetry.h b/lib/librte_telemetry/rte_telemetry.h
index aedb31859..f1376ea35 100644
--- a/lib/librte_telemetry/rte_telemetry.h
+++ b/lib/librte_telemetry/rte_telemetry.h
@@ -9,7 +9,12 @@
 
 /**
  * @file
- * RTE Telemetry
+ *
+ * RTE Telemetry.
+ *
+ * @warning
+ * @b EXPERIMENTAL:
+ * All functions in this file may be changed or removed without prior notice.
  *
  * The telemetry library provides a method to retrieve statistics from
  * DPDK by sending a JSON encoded message over a socket. DPDK will send
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:51.608482723 +0100
+++ 0079-lib-remind-experimental-status-in-headers.patch	2020-07-24 12:53:48.307006832 +0100
@@ -1,8 +1,10 @@
-From 74f4d6424da1297bd6e83dcb7bd84444ca8c59dd Mon Sep 17 00:00:00 2001
+From e2acbb7f711e0080871bf935b36c28d481411c7d Mon Sep 17 00:00:00 2001
 From: David Marchand <david.marchand@redhat.com>
 Date: Fri, 26 Jun 2020 10:16:38 +0200
 Subject: [PATCH] lib: remind experimental status in headers
 
+[ upstream commit 74f4d6424da1297bd6e83dcb7bd84444ca8c59dd ]
+
 The following libraries are experimental, all of their functions can
 be changed or removed:
 
@@ -23,45 +25,40 @@
 Remind this status in their headers in a common fashion (aligned to ABI
 docs).
 
-Cc: stable@dpdk.org
-
 Signed-off-by: David Marchand <david.marchand@redhat.com>
 Acked-by: Bruce Richardson <bruce.richardson@intel.com>
 ---
- doc/guides/contributing/abi_policy.rst       |  8 +++++---
+ doc/guides/contributing/abi_policy.rst       | 12 +++++-------
  lib/librte_bbdev/rte_bbdev.h                 |  3 ++-
  lib/librte_bpf/rte_bpf.h                     |  6 +++++-
  lib/librte_compressdev/rte_compressdev.h     |  6 +++++-
  lib/librte_fib/rte_fib.h                     |  7 +++++++
  lib/librte_fib/rte_fib6.h                    |  7 +++++++
  lib/librte_flow_classify/rte_flow_classify.h |  6 ++++--
- lib/librte_graph/rte_graph.h                 |  3 ++-
- lib/librte_graph/rte_graph_worker.h          |  3 ++-
  lib/librte_ipsec/rte_ipsec.h                 |  6 +++++-
- lib/librte_node/rte_node_eth_api.h           |  3 ++-
- lib/librte_node/rte_node_ip4_api.h           |  3 ++-
  lib/librte_rcu/rte_rcu_qsbr.h                |  7 ++++++-
  lib/librte_rib/rte_rib.h                     |  7 +++++++
  lib/librte_rib/rte_rib6.h                    |  7 +++++++
  lib/librte_stack/rte_stack.h                 |  7 +++++--
- lib/librte_telemetry/rte_telemetry.h         | 10 ++++++----
- 17 files changed, 79 insertions(+), 20 deletions(-)
+ lib/librte_telemetry/rte_telemetry.h         |  7 ++++++-
+ 13 files changed, 71 insertions(+), 17 deletions(-)
 
 diff --git a/doc/guides/contributing/abi_policy.rst b/doc/guides/contributing/abi_policy.rst
-index 1b2fa2786..d0affa9e6 100644
+index 2198519d9..87942c8ac 100644
 --- a/doc/guides/contributing/abi_policy.rst
 +++ b/doc/guides/contributing/abi_policy.rst
-@@ -27,7 +27,8 @@ General Guidelines
+@@ -27,8 +27,8 @@ General Guidelines
  #. The removal of symbols is considered an :ref:`ABI breakage <abi_breakages>`,
     once approved these will form part of the next ABI version.
  #. Libraries or APIs marked as :ref:`experimental <experimental_apis>` may
 -   change without constraint, as they are not considered part of an ABI version.
+-   Experimental libraries have the major ABI version ``0``.
 +   be changed or removed without prior notice, as they are not considered part
 +   of an ABI version.
  #. Updates to the :ref:`minimum hardware requirements <hw_rqmts>`, which drop
     support for hardware which was previously supported, should be treated as an
     ABI change.
-@@ -294,7 +295,7 @@ APIs
+@@ -289,7 +289,7 @@ APIs
  ~~~~
  
  APIs marked as ``experimental`` are not considered part of an ABI version and
@@ -70,15 +67,18 @@
  immediately after their introduction, as users begin to take advantage of those
  new APIs and start finding issues with them, new DPDK APIs will be automatically
  marked as ``experimental`` to allow for a period of stabilization before they
-@@ -330,4 +331,5 @@ Libraries
+@@ -320,7 +320,5 @@ Libraries
  ~~~~~~~~~
  
  Libraries marked as ``experimental`` are entirely not considered part of an ABI
--version, and may change without warning at any time.
+-version, and may change without warning at any time. Experimental libraries
+-always have a major ABI version of ``0`` to indicate they exist outside of
+-:ref:`abi_versioning` , with the minor version incremented with each ABI change
+-to library.
 +version.
 +All functions in such libraries may be changed or removed without prior notice.
 diff --git a/lib/librte_bbdev/rte_bbdev.h b/lib/librte_bbdev/rte_bbdev.h
-index ecd95a823..57291373f 100644
+index 1f58a0762..6fcf44826 100644
 --- a/lib/librte_bbdev/rte_bbdev.h
 +++ b/lib/librte_bbdev/rte_bbdev.h
 @@ -11,7 +11,8 @@
@@ -181,36 +181,8 @@
   *
   * This library provides flow record information with some measured properties.
   *
-diff --git a/lib/librte_graph/rte_graph.h b/lib/librte_graph/rte_graph.h
-index 9a26ffc18..b32c4bc21 100644
---- a/lib/librte_graph/rte_graph.h
-+++ b/lib/librte_graph/rte_graph.h
-@@ -9,7 +9,8 @@
-  * @file rte_graph.h
-  *
-  * @warning
-- * @b EXPERIMENTAL: this API may change without prior notice
-+ * @b EXPERIMENTAL:
-+ * All functions in this file may be changed or removed without prior notice.
-  *
-  * Graph architecture abstracts the data processing functions as
-  * "node" and "link" them together to create a complex "graph" to enable
-diff --git a/lib/librte_graph/rte_graph_worker.h b/lib/librte_graph/rte_graph_worker.h
-index 4c3ddcbde..eef77f732 100644
---- a/lib/librte_graph/rte_graph_worker.h
-+++ b/lib/librte_graph/rte_graph_worker.h
-@@ -9,7 +9,8 @@
-  * @file rte_graph_worker.h
-  *
-  * @warning
-- * @b EXPERIMENTAL: this API may change without prior notice
-+ * @b EXPERIMENTAL:
-+ * All functions in this file may be changed or removed without prior notice.
-  *
-  * This API allows a worker thread to walk over a graph and nodes to create,
-  * process, enqueue and move streams of objects to the next nodes.
 diff --git a/lib/librte_ipsec/rte_ipsec.h b/lib/librte_ipsec/rte_ipsec.h
-index 6666cf761..de05f4e93 100644
+index f3b1f936b..f2da7ace9 100644
 --- a/lib/librte_ipsec/rte_ipsec.h
 +++ b/lib/librte_ipsec/rte_ipsec.h
 @@ -7,9 +7,13 @@
@@ -228,36 +200,8 @@
   * librte_ipsec provides a framework for data-path IPsec protocol
   * processing (ESP/AH).
   */
-diff --git a/lib/librte_node/rte_node_eth_api.h b/lib/librte_node/rte_node_eth_api.h
-index e9a53afe5..4e28f86d7 100644
---- a/lib/librte_node/rte_node_eth_api.h
-+++ b/lib/librte_node/rte_node_eth_api.h
-@@ -9,7 +9,8 @@
-  * @file rte_node_eth_api.h
-  *
-  * @warning
-- * @b EXPERIMENTAL: this API may change without prior notice
-+ * @b EXPERIMENTAL:
-+ * All functions in this file may be changed or removed without prior notice.
-  *
-  * This API allows to setup ethdev_rx and ethdev_tx nodes
-  * and its queue associations.
-diff --git a/lib/librte_node/rte_node_ip4_api.h b/lib/librte_node/rte_node_ip4_api.h
-index 31a752b00..eb9ebd5f8 100644
---- a/lib/librte_node/rte_node_ip4_api.h
-+++ b/lib/librte_node/rte_node_ip4_api.h
-@@ -9,7 +9,8 @@
-  * @file rte_node_ip4_api.h
-  *
-  * @warning
-- * @b EXPERIMENTAL: this API may change without prior notice
-+ * @b EXPERIMENTAL:
-+ * All functions in this file may be changed or removed without prior notice.
-  *
-  * This API allows to do control path functions of ip4_* nodes
-  * like ip4_lookup, ip4_rewrite.
 diff --git a/lib/librte_rcu/rte_rcu_qsbr.h b/lib/librte_rcu/rte_rcu_qsbr.h
-index fd4eb52b7..a98e8f0f8 100644
+index 0b5585925..078de261f 100644
 --- a/lib/librte_rcu/rte_rcu_qsbr.h
 +++ b/lib/librte_rcu/rte_rcu_qsbr.h
 @@ -7,7 +7,12 @@
@@ -330,16 +274,12 @@
   * librte_stack provides an API for configuration and use of a bounded stack of
   * pointers. Push and pop operations are MT-safe, allowing concurrent access,
 diff --git a/lib/librte_telemetry/rte_telemetry.h b/lib/librte_telemetry/rte_telemetry.h
-index eb7f2c917..d13010b8f 100644
+index aedb31859..f1376ea35 100644
 --- a/lib/librte_telemetry/rte_telemetry.h
 +++ b/lib/librte_telemetry/rte_telemetry.h
-@@ -20,11 +20,13 @@
- #define RTE_TEL_MAX_ARRAY_ENTRIES 512
+@@ -9,7 +9,12 @@
  
  /**
-- * @warning
-- * @b EXPERIMENTAL: all functions in this file may change without prior notice
-- *
   * @file
 - * RTE Telemetry
 + *
@@ -350,7 +290,7 @@
 + * All functions in this file may be changed or removed without prior notice.
   *
   * The telemetry library provides a method to retrieve statistics from
-  * DPDK by sending a request message over a socket. DPDK will send
+  * DPDK by sending a JSON encoded message over a socket. DPDK will send
 -- 
 2.20.1
 

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

* [dpdk-stable] patch 'rawdev: remove remaining experimental tags' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (77 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'lib: remind experimental status in headers' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'eal/armv8: fix timer frequency calibration with PMU' " luca.boccassi
                   ` (112 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Hemant Agrawal
  Cc: Thomas Monjalon, Ferruh Yigit, David Marchand, Shreyansh Jain,
	Nipun Gupta, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 9af164a1f46ec71e276e10abbb4d0b71c5ef1c00 Mon Sep 17 00:00:00 2001
From: Hemant Agrawal <hemant.agrawal@nxp.com>
Date: Tue, 7 Jul 2020 14:24:07 +0530
Subject: [PATCH] rawdev: remove remaining experimental tags

[ upstream commit c843fca96c849bd85204707e791accb57adb9e59 ]

The experimental tags were removed, but the comment
is still having API classification as EXPERIMENTAL

Fixes: 931cc531aad2 ("rawdev: remove experimental tag")

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: David Marchand <david.marchand@redhat.com>
---
 MAINTAINERS                        | 4 ++--
 lib/librte_rawdev/rte_rawdev.h     | 3 ---
 lib/librte_rawdev/rte_rawdev_pmd.h | 3 ---
 3 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 10c4e1a61..98c0dd060 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -456,8 +456,8 @@ F: lib/librte_eventdev/*crypto_adapter*
 F: app/test/test_event_crypto_adapter.c
 F: doc/guides/prog_guide/event_crypto_adapter.rst
 
-Raw device API - EXPERIMENTAL
-M: Shreyansh Jain <shreyansh.jain@nxp.com>
+Raw device API
+M: Nipun Gupta <nipun.gupta@nxp.com>
 M: Hemant Agrawal <hemant.agrawal@nxp.com>
 F: lib/librte_rawdev/
 F: drivers/raw/skeleton/
diff --git a/lib/librte_rawdev/rte_rawdev.h b/lib/librte_rawdev/rte_rawdev.h
index ed011ca22..7a1f3213e 100644
--- a/lib/librte_rawdev/rte_rawdev.h
+++ b/lib/librte_rawdev/rte_rawdev.h
@@ -12,9 +12,6 @@
  *
  * This API allow applications to configure and use generic devices having
  * no specific type already available in DPDK.
- *
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
  */
 
 #ifdef __cplusplus
diff --git a/lib/librte_rawdev/rte_rawdev_pmd.h b/lib/librte_rawdev/rte_rawdev_pmd.h
index cb3555ab5..4395a2182 100644
--- a/lib/librte_rawdev/rte_rawdev_pmd.h
+++ b/lib/librte_rawdev/rte_rawdev_pmd.h
@@ -11,9 +11,6 @@
  * @note
  * Driver facing APIs for a raw device. These are not to be called directly by
  * any application.
- *
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
  */
 
 #ifdef __cplusplus
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:51.651928290 +0100
+++ 0080-rawdev-remove-remaining-experimental-tags.patch	2020-07-24 12:53:48.307006832 +0100
@@ -1,37 +1,40 @@
-From c843fca96c849bd85204707e791accb57adb9e59 Mon Sep 17 00:00:00 2001
+From 9af164a1f46ec71e276e10abbb4d0b71c5ef1c00 Mon Sep 17 00:00:00 2001
 From: Hemant Agrawal <hemant.agrawal@nxp.com>
 Date: Tue, 7 Jul 2020 14:24:07 +0530
 Subject: [PATCH] rawdev: remove remaining experimental tags
 
+[ upstream commit c843fca96c849bd85204707e791accb57adb9e59 ]
+
 The experimental tags were removed, but the comment
 is still having API classification as EXPERIMENTAL
 
 Fixes: 931cc531aad2 ("rawdev: remove experimental tag")
-Cc: stable@dpdk.org
 
 Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
 Acked-by: Thomas Monjalon <thomas@monjalon.net>
 Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
 Acked-by: David Marchand <david.marchand@redhat.com>
 ---
- MAINTAINERS                        | 2 +-
+ MAINTAINERS                        | 4 ++--
  lib/librte_rawdev/rte_rawdev.h     | 3 ---
  lib/librte_rawdev/rte_rawdev_pmd.h | 3 ---
- 3 files changed, 1 insertion(+), 7 deletions(-)
+ 3 files changed, 2 insertions(+), 8 deletions(-)
 
 diff --git a/MAINTAINERS b/MAINTAINERS
-index 27fcd6d64..6ba02d73a 100644
+index 10c4e1a61..98c0dd060 100644
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -490,7 +490,7 @@ F: lib/librte_eventdev/*crypto_adapter*
+@@ -456,8 +456,8 @@ F: lib/librte_eventdev/*crypto_adapter*
  F: app/test/test_event_crypto_adapter.c
  F: doc/guides/prog_guide/event_crypto_adapter.rst
  
 -Raw device API - EXPERIMENTAL
+-M: Shreyansh Jain <shreyansh.jain@nxp.com>
 +Raw device API
- M: Nipun Gupta <nipun.gupta@nxp.com>
++M: Nipun Gupta <nipun.gupta@nxp.com>
  M: Hemant Agrawal <hemant.agrawal@nxp.com>
  F: lib/librte_rawdev/
+ F: drivers/raw/skeleton/
 diff --git a/lib/librte_rawdev/rte_rawdev.h b/lib/librte_rawdev/rte_rawdev.h
 index ed011ca22..7a1f3213e 100644
 --- a/lib/librte_rawdev/rte_rawdev.h

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

* [dpdk-stable] patch 'eal/armv8: fix timer frequency calibration with PMU' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (78 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'rawdev: remove remaining experimental tags' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'eal: fix lcore accessors for non-EAL threads' " luca.boccassi
                   ` (111 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Honnappa Nagarahalli
  Cc: Ruifeng Wang, Dharmik Thakkar, Phil Yang, Jerin Jacob, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 9fd723070318d14eef5b7b5c535a29956e861e36 Mon Sep 17 00:00:00 2001
From: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Date: Fri, 26 Jun 2020 15:35:01 -0500
Subject: [PATCH] eal/armv8: fix timer frequency calibration with PMU

[ upstream commit 97c910139baf007b729388b0c3c24b894e4b6d3e ]

get_tsc_freq uses 'nanosleep' system call to calculate the CPU
frequency. However, 'nanosleep' results in the process getting
un-scheduled. The kernel saves and restores the PMU state. This
ensures that the PMU cycles are not counted towards a sleeping
process. When RTE_ARM_EAL_RDTSC_USE_PMU is defined, this results
in incorrect CPU frequency calculation. This logic is replaced
with generic counter based loop.

Bugzilla ID: 450
Fixes: f91bcbb2d9a6 ("eal/armv8: use high-resolution cycle counter")

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
---
 lib/librte_eal/common/arch/arm/rte_cycles.c   | 27 +++++++++--
 .../common/include/arch/arm/rte_cycles_64.h   | 45 ++++++++++++++++---
 2 files changed, 63 insertions(+), 9 deletions(-)

diff --git a/lib/librte_eal/common/arch/arm/rte_cycles.c b/lib/librte_eal/common/arch/arm/rte_cycles.c
index 3500d523e..5bd29b24b 100644
--- a/lib/librte_eal/common/arch/arm/rte_cycles.c
+++ b/lib/librte_eal/common/arch/arm/rte_cycles.c
@@ -3,14 +3,35 @@
  */
 
 #include "eal_private.h"
+#include "rte_cycles.h"
 
 uint64_t
 get_tsc_freq_arch(void)
 {
 #if defined RTE_ARCH_ARM64 && !defined RTE_ARM_EAL_RDTSC_USE_PMU
-	uint64_t freq;
-	asm volatile("mrs %0, cntfrq_el0" : "=r" (freq));
-	return freq;
+	return __rte_arm64_cntfrq();
+#elif defined RTE_ARCH_ARM64 && defined RTE_ARM_EAL_RDTSC_USE_PMU
+#define CYC_PER_1MHZ 1E6
+	/* Use the generic counter ticks to calculate the PMU
+	 * cycle frequency.
+	 */
+	uint64_t ticks;
+	uint64_t start_ticks, cur_ticks;
+	uint64_t start_pmu_cycles, end_pmu_cycles;
+
+	/* Number of ticks for 1/10 second */
+	ticks = __rte_arm64_cntfrq() / 10;
+
+	start_ticks = __rte_arm64_cntvct_precise();
+	start_pmu_cycles = rte_rdtsc_precise();
+	do {
+		cur_ticks = __rte_arm64_cntvct();
+	} while ((cur_ticks - start_ticks) < ticks);
+	end_pmu_cycles = rte_rdtsc_precise();
+
+	/* Adjust the cycles to next 1Mhz */
+	return RTE_ALIGN_MUL_CEIL(end_pmu_cycles - start_pmu_cycles,
+			CYC_PER_1MHZ) * 10;
 #else
 	return 0;
 #endif
diff --git a/lib/librte_eal/common/include/arch/arm/rte_cycles_64.h b/lib/librte_eal/common/include/arch/arm/rte_cycles_64.h
index da557b6a1..e41f9dbd6 100644
--- a/lib/librte_eal/common/include/arch/arm/rte_cycles_64.h
+++ b/lib/librte_eal/common/include/arch/arm/rte_cycles_64.h
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  * Copyright(c) 2015 Cavium, Inc
+ * Copyright(c) 2020 Arm Limited
  */
 
 #ifndef _RTE_CYCLES_ARM64_H_
@@ -11,6 +12,33 @@ extern "C" {
 
 #include "generic/rte_cycles.h"
 
+/** Read generic counter frequency */
+static __rte_always_inline uint64_t
+__rte_arm64_cntfrq(void)
+{
+	uint64_t freq;
+
+	asm volatile("mrs %0, cntfrq_el0" : "=r" (freq));
+	return freq;
+}
+
+/** Read generic counter */
+static __rte_always_inline uint64_t
+__rte_arm64_cntvct(void)
+{
+	uint64_t tsc;
+
+	asm volatile("mrs %0, cntvct_el0" : "=r" (tsc));
+	return tsc;
+}
+
+static __rte_always_inline uint64_t
+__rte_arm64_cntvct_precise(void)
+{
+	asm volatile("isb" : : : "memory");
+	return __rte_arm64_cntvct();
+}
+
 /**
  * Read the time base register.
  *
@@ -25,10 +53,7 @@ extern "C" {
 static inline uint64_t
 rte_rdtsc(void)
 {
-	uint64_t tsc;
-
-	asm volatile("mrs %0, cntvct_el0" : "=r" (tsc));
-	return tsc;
+	return __rte_arm64_cntvct();
 }
 #else
 /**
@@ -49,14 +74,22 @@ rte_rdtsc(void)
  * asm volatile("msr pmcr_el0, %0" : : "r" (val));
  *
  */
-static inline uint64_t
-rte_rdtsc(void)
+
+/** Read PMU cycle counter */
+static __rte_always_inline uint64_t
+__rte_arm64_pmccntr(void)
 {
 	uint64_t tsc;
 
 	asm volatile("mrs %0, pmccntr_el0" : "=r"(tsc));
 	return tsc;
 }
+
+static inline uint64_t
+rte_rdtsc(void)
+{
+	return __rte_arm64_pmccntr();
+}
 #endif
 
 static inline uint64_t
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:51.688834869 +0100
+++ 0081-eal-armv8-fix-timer-frequency-calibration-with-PMU.patch	2020-07-24 12:53:48.307006832 +0100
@@ -1,8 +1,10 @@
-From 97c910139baf007b729388b0c3c24b894e4b6d3e Mon Sep 17 00:00:00 2001
+From 9fd723070318d14eef5b7b5c535a29956e861e36 Mon Sep 17 00:00:00 2001
 From: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
 Date: Fri, 26 Jun 2020 15:35:01 -0500
 Subject: [PATCH] eal/armv8: fix timer frequency calibration with PMU
 
+[ upstream commit 97c910139baf007b729388b0c3c24b894e4b6d3e ]
+
 get_tsc_freq uses 'nanosleep' system call to calculate the CPU
 frequency. However, 'nanosleep' results in the process getting
 un-scheduled. The kernel saves and restores the PMU state. This
@@ -13,7 +15,6 @@
 
 Bugzilla ID: 450
 Fixes: f91bcbb2d9a6 ("eal/armv8: use high-resolution cycle counter")
-Cc: stable@dpdk.org
 
 Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
 Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
@@ -21,14 +22,57 @@
 Reviewed-by: Phil Yang <phil.yang@arm.com>
 Acked-by: Jerin Jacob <jerinj@marvell.com>
 ---
- lib/librte_eal/arm/include/rte_cycles_64.h | 45 +++++++++++++++++++---
- lib/librte_eal/arm/rte_cycles.c            | 27 +++++++++++--
+ lib/librte_eal/common/arch/arm/rte_cycles.c   | 27 +++++++++--
+ .../common/include/arch/arm/rte_cycles_64.h   | 45 ++++++++++++++++---
  2 files changed, 63 insertions(+), 9 deletions(-)
 
-diff --git a/lib/librte_eal/arm/include/rte_cycles_64.h b/lib/librte_eal/arm/include/rte_cycles_64.h
+diff --git a/lib/librte_eal/common/arch/arm/rte_cycles.c b/lib/librte_eal/common/arch/arm/rte_cycles.c
+index 3500d523e..5bd29b24b 100644
+--- a/lib/librte_eal/common/arch/arm/rte_cycles.c
++++ b/lib/librte_eal/common/arch/arm/rte_cycles.c
+@@ -3,14 +3,35 @@
+  */
+ 
+ #include "eal_private.h"
++#include "rte_cycles.h"
+ 
+ uint64_t
+ get_tsc_freq_arch(void)
+ {
+ #if defined RTE_ARCH_ARM64 && !defined RTE_ARM_EAL_RDTSC_USE_PMU
+-	uint64_t freq;
+-	asm volatile("mrs %0, cntfrq_el0" : "=r" (freq));
+-	return freq;
++	return __rte_arm64_cntfrq();
++#elif defined RTE_ARCH_ARM64 && defined RTE_ARM_EAL_RDTSC_USE_PMU
++#define CYC_PER_1MHZ 1E6
++	/* Use the generic counter ticks to calculate the PMU
++	 * cycle frequency.
++	 */
++	uint64_t ticks;
++	uint64_t start_ticks, cur_ticks;
++	uint64_t start_pmu_cycles, end_pmu_cycles;
++
++	/* Number of ticks for 1/10 second */
++	ticks = __rte_arm64_cntfrq() / 10;
++
++	start_ticks = __rte_arm64_cntvct_precise();
++	start_pmu_cycles = rte_rdtsc_precise();
++	do {
++		cur_ticks = __rte_arm64_cntvct();
++	} while ((cur_ticks - start_ticks) < ticks);
++	end_pmu_cycles = rte_rdtsc_precise();
++
++	/* Adjust the cycles to next 1Mhz */
++	return RTE_ALIGN_MUL_CEIL(end_pmu_cycles - start_pmu_cycles,
++			CYC_PER_1MHZ) * 10;
+ #else
+ 	return 0;
+ #endif
+diff --git a/lib/librte_eal/common/include/arch/arm/rte_cycles_64.h b/lib/librte_eal/common/include/arch/arm/rte_cycles_64.h
 index da557b6a1..e41f9dbd6 100644
---- a/lib/librte_eal/arm/include/rte_cycles_64.h
-+++ b/lib/librte_eal/arm/include/rte_cycles_64.h
+--- a/lib/librte_eal/common/include/arch/arm/rte_cycles_64.h
++++ b/lib/librte_eal/common/include/arch/arm/rte_cycles_64.h
 @@ -1,5 +1,6 @@
  /* SPDX-License-Identifier: BSD-3-Clause
   * Copyright(c) 2015 Cavium, Inc
@@ -107,49 +151,6 @@
  #endif
  
  static inline uint64_t
-diff --git a/lib/librte_eal/arm/rte_cycles.c b/lib/librte_eal/arm/rte_cycles.c
-index 3500d523e..5bd29b24b 100644
---- a/lib/librte_eal/arm/rte_cycles.c
-+++ b/lib/librte_eal/arm/rte_cycles.c
-@@ -3,14 +3,35 @@
-  */
- 
- #include "eal_private.h"
-+#include "rte_cycles.h"
- 
- uint64_t
- get_tsc_freq_arch(void)
- {
- #if defined RTE_ARCH_ARM64 && !defined RTE_ARM_EAL_RDTSC_USE_PMU
--	uint64_t freq;
--	asm volatile("mrs %0, cntfrq_el0" : "=r" (freq));
--	return freq;
-+	return __rte_arm64_cntfrq();
-+#elif defined RTE_ARCH_ARM64 && defined RTE_ARM_EAL_RDTSC_USE_PMU
-+#define CYC_PER_1MHZ 1E6
-+	/* Use the generic counter ticks to calculate the PMU
-+	 * cycle frequency.
-+	 */
-+	uint64_t ticks;
-+	uint64_t start_ticks, cur_ticks;
-+	uint64_t start_pmu_cycles, end_pmu_cycles;
-+
-+	/* Number of ticks for 1/10 second */
-+	ticks = __rte_arm64_cntfrq() / 10;
-+
-+	start_ticks = __rte_arm64_cntvct_precise();
-+	start_pmu_cycles = rte_rdtsc_precise();
-+	do {
-+		cur_ticks = __rte_arm64_cntvct();
-+	} while ((cur_ticks - start_ticks) < ticks);
-+	end_pmu_cycles = rte_rdtsc_precise();
-+
-+	/* Adjust the cycles to next 1Mhz */
-+	return RTE_ALIGN_MUL_CEIL(end_pmu_cycles - start_pmu_cycles,
-+			CYC_PER_1MHZ) * 10;
- #else
- 	return 0;
- #endif
 -- 
 2.20.1
 

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

* [dpdk-stable] patch 'eal: fix lcore accessors for non-EAL threads' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (79 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'eal/armv8: fix timer frequency calibration with PMU' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'vfio: remove unused variable' " luca.boccassi
                   ` (110 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: David Marchand, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 9422d38844e14f7ba8b2ad329e5313e74c05d172 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Wed, 8 Apr 2020 13:24:19 -0700
Subject: [PATCH] eal: fix lcore accessors for non-EAL threads

[ upstream commit 67ae5936c4fc36863d146acbddfe107e1ad00a13 ]

If rte_lcore_index() is asked to give the index of the
current lcore (argument -1) and is called from a non-EAL thread
then it would invalid result. The result would come
lcore_config[-1].core_index which is some other data in the
per-thread area.

The resolution is to return -1 which is what rte_lcore_index()
returns if handed an invalid lcore.

Same issue existed with rte_lcore_to_cpu_id().

Bugzilla ID: 446
Fixes: 26cc3bbe4dc0 ("eal: add lcore accessors")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: David Marchand <david.marchand@redhat.com>
---
 lib/librte_eal/common/eal_common_lcore.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/lib/librte_eal/common/eal_common_lcore.c b/lib/librte_eal/common/eal_common_lcore.c
index 39efadef1..3ecca3869 100644
--- a/lib/librte_eal/common/eal_common_lcore.c
+++ b/lib/librte_eal/common/eal_common_lcore.c
@@ -31,8 +31,12 @@ int rte_lcore_index(int lcore_id)
 	if (unlikely(lcore_id >= RTE_MAX_LCORE))
 		return -1;
 
-	if (lcore_id < 0)
+	if (lcore_id < 0) {
+		if (rte_lcore_id() == LCORE_ID_ANY)
+			return -1;
+
 		lcore_id = (int)rte_lcore_id();
+	}
 
 	return lcore_config[lcore_id].core_index;
 }
@@ -42,8 +46,12 @@ int rte_lcore_to_cpu_id(int lcore_id)
 	if (unlikely(lcore_id >= RTE_MAX_LCORE))
 		return -1;
 
-	if (lcore_id < 0)
+	if (lcore_id < 0) {
+		if (rte_lcore_id() == LCORE_ID_ANY)
+			return -1;
+
 		lcore_id = (int)rte_lcore_id();
+	}
 
 	return lcore_config[lcore_id].core_id;
 }
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:51.724862485 +0100
+++ 0082-eal-fix-lcore-accessors-for-non-EAL-threads.patch	2020-07-24 12:53:48.307006832 +0100
@@ -1,8 +1,10 @@
-From 67ae5936c4fc36863d146acbddfe107e1ad00a13 Mon Sep 17 00:00:00 2001
+From 9422d38844e14f7ba8b2ad329e5313e74c05d172 Mon Sep 17 00:00:00 2001
 From: Stephen Hemminger <stephen@networkplumber.org>
 Date: Wed, 8 Apr 2020 13:24:19 -0700
 Subject: [PATCH] eal: fix lcore accessors for non-EAL threads
 
+[ upstream commit 67ae5936c4fc36863d146acbddfe107e1ad00a13 ]
+
 If rte_lcore_index() is asked to give the index of the
 current lcore (argument -1) and is called from a non-EAL thread
 then it would invalid result. The result would come
@@ -24,7 +26,7 @@
  1 file changed, 10 insertions(+), 2 deletions(-)
 
 diff --git a/lib/librte_eal/common/eal_common_lcore.c b/lib/librte_eal/common/eal_common_lcore.c
-index 5404922a8..1d0523419 100644
+index 39efadef1..3ecca3869 100644
 --- a/lib/librte_eal/common/eal_common_lcore.c
 +++ b/lib/librte_eal/common/eal_common_lcore.c
 @@ -31,8 +31,12 @@ int rte_lcore_index(int lcore_id)

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

* [dpdk-stable] patch 'vfio: remove unused variable' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (80 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'eal: fix lcore accessors for non-EAL threads' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'eal: fix uuid header dependencies' " luca.boccassi
                   ` (109 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Yunjian Wang; +Cc: David Marchand, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 3f7b84c931a0887ee1f65634a034c2efc2f3deef Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian@huawei.com>
Date: Sat, 16 May 2020 15:58:39 +0800
Subject: [PATCH] vfio: remove unused variable

[ upstream commit f4823a3982fd62993a1a128c2a0396cdbe01be8a ]

The 'group_status' has never been used and can be removed.

Fixes: 94c0776b1bad ("vfio: support hotplug")

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
---
 lib/librte_eal/linux/eal/eal_vfio.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/lib/librte_eal/linux/eal/eal_vfio.c b/lib/librte_eal/linux/eal/eal_vfio.c
index 62ffe13e0..1b703bf9e 100644
--- a/lib/librte_eal/linux/eal/eal_vfio.c
+++ b/lib/librte_eal/linux/eal/eal_vfio.c
@@ -886,9 +886,6 @@ int
 rte_vfio_release_device(const char *sysfs_base, const char *dev_addr,
 		    int vfio_dev_fd)
 {
-	struct vfio_group_status group_status = {
-			.argsz = sizeof(group_status)
-	};
 	struct vfio_config *vfio_cfg;
 	int vfio_group_fd;
 	int iommu_group_num;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:51.761136780 +0100
+++ 0083-vfio-remove-unused-variable.patch	2020-07-24 12:53:48.311006907 +0100
@@ -1,24 +1,25 @@
-From f4823a3982fd62993a1a128c2a0396cdbe01be8a Mon Sep 17 00:00:00 2001
+From 3f7b84c931a0887ee1f65634a034c2efc2f3deef Mon Sep 17 00:00:00 2001
 From: Yunjian Wang <wangyunjian@huawei.com>
 Date: Sat, 16 May 2020 15:58:39 +0800
 Subject: [PATCH] vfio: remove unused variable
 
+[ upstream commit f4823a3982fd62993a1a128c2a0396cdbe01be8a ]
+
 The 'group_status' has never been used and can be removed.
 
 Fixes: 94c0776b1bad ("vfio: support hotplug")
-Cc: stable@dpdk.org
 
 Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
 Reviewed-by: David Marchand <david.marchand@redhat.com>
 ---
- lib/librte_eal/linux/eal_vfio.c | 3 ---
+ lib/librte_eal/linux/eal/eal_vfio.c | 3 ---
  1 file changed, 3 deletions(-)
 
-diff --git a/lib/librte_eal/linux/eal_vfio.c b/lib/librte_eal/linux/eal_vfio.c
-index abb12a354..14358949e 100644
---- a/lib/librte_eal/linux/eal_vfio.c
-+++ b/lib/librte_eal/linux/eal_vfio.c
-@@ -933,9 +933,6 @@ int
+diff --git a/lib/librte_eal/linux/eal/eal_vfio.c b/lib/librte_eal/linux/eal/eal_vfio.c
+index 62ffe13e0..1b703bf9e 100644
+--- a/lib/librte_eal/linux/eal/eal_vfio.c
++++ b/lib/librte_eal/linux/eal/eal_vfio.c
+@@ -886,9 +886,6 @@ int
  rte_vfio_release_device(const char *sysfs_base, const char *dev_addr,
  		    int vfio_dev_fd)
  {

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

* [dpdk-stable] patch 'eal: fix uuid header dependencies' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (81 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'vfio: remove unused variable' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'test: fix rpath for drivers with meson' " luca.boccassi
                   ` (108 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Haiyue Wang; +Cc: David Marchand, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 67920a0346554ea2cdc2fcb2a318b0afc974d5c4 Mon Sep 17 00:00:00 2001
From: Haiyue Wang <haiyue.wang@intel.com>
Date: Fri, 3 Jul 2020 22:57:17 +0800
Subject: [PATCH] eal: fix uuid header dependencies
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit edca6d883eb0137bc3caf7f93651a67360ebdf96 ]

Add the dependent header files explicitly, so that the user just needs
to include the 'rte_uuid.h' header file directly to avoid compile error:
 (1). rte_uuid.h:97:55: error: unknown type name ‘size_t’
 (2). rte_uuid.h:58:2: error: implicit declaration of function ‘memcpy’

Fixes: 6bc67c497a51 ("eal: add uuid API")

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: David Marchand <david.marchand@redhat.com>
---
 lib/librte_eal/common/include/rte_uuid.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/librte_eal/common/include/rte_uuid.h b/lib/librte_eal/common/include/rte_uuid.h
index 044afbdfa..8b42e070a 100644
--- a/lib/librte_eal/common/include/rte_uuid.h
+++ b/lib/librte_eal/common/include/rte_uuid.h
@@ -15,6 +15,8 @@ extern "C" {
 #endif
 
 #include <stdbool.h>
+#include <stddef.h>
+#include <string.h>
 
 /**
  * Struct describing a Universal Unique Identifier
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:51.801627231 +0100
+++ 0084-eal-fix-uuid-header-dependencies.patch	2020-07-24 12:53:48.311006907 +0100
@@ -1,4 +1,4 @@
-From edca6d883eb0137bc3caf7f93651a67360ebdf96 Mon Sep 17 00:00:00 2001
+From 67920a0346554ea2cdc2fcb2a318b0afc974d5c4 Mon Sep 17 00:00:00 2001
 From: Haiyue Wang <haiyue.wang@intel.com>
 Date: Fri, 3 Jul 2020 22:57:17 +0800
 Subject: [PATCH] eal: fix uuid header dependencies
@@ -6,24 +6,25 @@
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
 
+[ upstream commit edca6d883eb0137bc3caf7f93651a67360ebdf96 ]
+
 Add the dependent header files explicitly, so that the user just needs
 to include the 'rte_uuid.h' header file directly to avoid compile error:
  (1). rte_uuid.h:97:55: error: unknown type name ‘size_t’
  (2). rte_uuid.h:58:2: error: implicit declaration of function ‘memcpy’
 
 Fixes: 6bc67c497a51 ("eal: add uuid API")
-Cc: stable@dpdk.org
 
 Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
 Acked-by: David Marchand <david.marchand@redhat.com>
 ---
- lib/librte_eal/include/rte_uuid.h | 2 ++
+ lib/librte_eal/common/include/rte_uuid.h | 2 ++
  1 file changed, 2 insertions(+)
 
-diff --git a/lib/librte_eal/include/rte_uuid.h b/lib/librte_eal/include/rte_uuid.h
+diff --git a/lib/librte_eal/common/include/rte_uuid.h b/lib/librte_eal/common/include/rte_uuid.h
 index 044afbdfa..8b42e070a 100644
---- a/lib/librte_eal/include/rte_uuid.h
-+++ b/lib/librte_eal/include/rte_uuid.h
+--- a/lib/librte_eal/common/include/rte_uuid.h
++++ b/lib/librte_eal/common/include/rte_uuid.h
 @@ -15,6 +15,8 @@ extern "C" {
  #endif
  

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

* [dpdk-stable] patch 'test: fix rpath for drivers with meson' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (82 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'eal: fix uuid header dependencies' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'rawdev: allow getting info for unknown device' " luca.boccassi
                   ` (107 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Timothy Redaelli; +Cc: Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From e427f713e45fb6d153cc210ca0db43daf961ce85 Mon Sep 17 00:00:00 2001
From: Timothy Redaelli <tredaelli@redhat.com>
Date: Wed, 1 Jul 2020 19:16:38 +0200
Subject: [PATCH] test: fix rpath for drivers with meson

[ upstream commit f62093e7390d39c160205a4915ce0b4de116a0c3 ]

This commit fixes the setting of relative rpath on dpdk-test for
drivers ($libdir/dpdk/pmd-$abiver) to the correct absolute rpath
($prefix$libdir/dpdk/pmd-$abiver).

Fixes: b5dc795a8a55 ("test: build app with meson as dpdk-test")

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 app/test/meson.build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index d7d0e7871..3b2774b3e 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -393,7 +393,8 @@ dpdk_test = executable('dpdk-test',
 	link_whole: link_libs,
 	dependencies: test_dep_objs,
 	c_args: [cflags, '-DALLOW_EXPERIMENTAL_API'],
-	install_rpath: driver_install_path,
+	install_rpath: join_paths(get_option('prefix'),
+			 driver_install_path),
 	install: true)
 
 # some perf tests (eg: memcpy perf autotest)take very long
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:51.836608003 +0100
+++ 0085-test-fix-rpath-for-drivers-with-meson.patch	2020-07-24 12:53:48.311006907 +0100
@@ -1,14 +1,15 @@
-From f62093e7390d39c160205a4915ce0b4de116a0c3 Mon Sep 17 00:00:00 2001
+From e427f713e45fb6d153cc210ca0db43daf961ce85 Mon Sep 17 00:00:00 2001
 From: Timothy Redaelli <tredaelli@redhat.com>
 Date: Wed, 1 Jul 2020 19:16:38 +0200
 Subject: [PATCH] test: fix rpath for drivers with meson
 
+[ upstream commit f62093e7390d39c160205a4915ce0b4de116a0c3 ]
+
 This commit fixes the setting of relative rpath on dpdk-test for
 drivers ($libdir/dpdk/pmd-$abiver) to the correct absolute rpath
 ($prefix$libdir/dpdk/pmd-$abiver).
 
 Fixes: b5dc795a8a55 ("test: build app with meson as dpdk-test")
-Cc: stable@dpdk.org
 
 Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
 Acked-by: Bruce Richardson <bruce.richardson@intel.com>
@@ -17,19 +18,19 @@
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 diff --git a/app/test/meson.build b/app/test/meson.build
-index 56591db4e..39f295d73 100644
+index d7d0e7871..3b2774b3e 100644
 --- a/app/test/meson.build
 +++ b/app/test/meson.build
-@@ -425,7 +425,8 @@ dpdk_test = executable('dpdk-test',
+@@ -393,7 +393,8 @@ dpdk_test = executable('dpdk-test',
  	link_whole: link_libs,
  	dependencies: test_dep_objs,
- 	c_args: cflags,
+ 	c_args: [cflags, '-DALLOW_EXPERIMENTAL_API'],
 -	install_rpath: driver_install_path,
 +	install_rpath: join_paths(get_option('prefix'),
 +			 driver_install_path),
  	install: true)
  
- has_hugepage = run_command('has-hugepage.sh').stdout().strip() != '0'
+ # some perf tests (eg: memcpy perf autotest)take very long
 -- 
 2.20.1
 

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

* [dpdk-stable] patch 'rawdev: allow getting info for unknown device' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (83 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'test: fix rpath for drivers with meson' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'rawdev: fill NUMA socket ID in info' " luca.boccassi
                   ` (106 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Hemant Agrawal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 2e4b38d8f9ad20fa84486315ae9e117cb037a8c1 Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Mon, 6 Jul 2020 11:31:30 +0100
Subject: [PATCH] rawdev: allow getting info for unknown device

[ upstream commit 201a68c67839b879b39aa897b6bdb024a49ae436 ]

To call the rte_rawdev_info_get() function, the user currently has to know
the underlying type of the device in order to pass an appropriate structure
or buffer as the dev_private pointer in the info structure. By allowing a
NULL value for this field, we can skip getting the device-specific info and
just return the generic info - including the device name and driver, which
can be used to determine the device type - to the user.

This ensures that basic info can be get for all rawdevs, without knowing
the type, and even if the info driver API call has not been implemented for
the device.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 lib/librte_rawdev/rte_rawdev.c | 6 ++++--
 lib/librte_rawdev/rte_rawdev.h | 8 +++++++-
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/lib/librte_rawdev/rte_rawdev.c b/lib/librte_rawdev/rte_rawdev.c
index b6f1e1c77..f6efa6b67 100644
--- a/lib/librte_rawdev/rte_rawdev.c
+++ b/lib/librte_rawdev/rte_rawdev.c
@@ -89,8 +89,10 @@ rte_rawdev_info_get(uint16_t dev_id, struct rte_rawdev_info *dev_info)
 
 	rawdev = &rte_rawdevs[dev_id];
 
-	RTE_FUNC_PTR_OR_ERR_RET(*rawdev->dev_ops->dev_info_get, -ENOTSUP);
-	(*rawdev->dev_ops->dev_info_get)(rawdev, dev_info->dev_private);
+	if (dev_info->dev_private != NULL) {
+		RTE_FUNC_PTR_OR_ERR_RET(*rawdev->dev_ops->dev_info_get, -ENOTSUP);
+		(*rawdev->dev_ops->dev_info_get)(rawdev, dev_info->dev_private);
+	}
 
 	if (dev_info) {
 
diff --git a/lib/librte_rawdev/rte_rawdev.h b/lib/librte_rawdev/rte_rawdev.h
index 7a1f3213e..32f6b8bb0 100644
--- a/lib/librte_rawdev/rte_rawdev.h
+++ b/lib/librte_rawdev/rte_rawdev.h
@@ -74,7 +74,13 @@ struct rte_rawdev_info;
  *
  * @param[out] dev_info
  *   A pointer to a structure of type *rte_rawdev_info* to be filled with the
- *   contextual information of the device.
+ *   contextual information of the device. The dev_info->dev_private field
+ *   should point to an appropriate buffer space for holding the device-
+ *   specific info for that hardware.
+ *   If the dev_private field is set to NULL, then the device-specific info
+ *   function will not be called and only basic information about the device
+ *   will be returned. This can be used to safely query the type of a rawdev
+ *   instance without needing to know the size of the private data to return.
  *
  * @return
  *   - 0: Success, driver updates the contextual information of the raw device
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:51.872395908 +0100
+++ 0086-rawdev-allow-getting-info-for-unknown-device.patch	2020-07-24 12:53:48.311006907 +0100
@@ -1,8 +1,10 @@
-From 201a68c67839b879b39aa897b6bdb024a49ae436 Mon Sep 17 00:00:00 2001
+From 2e4b38d8f9ad20fa84486315ae9e117cb037a8c1 Mon Sep 17 00:00:00 2001
 From: Bruce Richardson <bruce.richardson@intel.com>
 Date: Mon, 6 Jul 2020 11:31:30 +0100
 Subject: [PATCH] rawdev: allow getting info for unknown device
 
+[ upstream commit 201a68c67839b879b39aa897b6bdb024a49ae436 ]
+
 To call the rte_rawdev_info_get() function, the user currently has to know
 the underlying type of the device in order to pass an appropriate structure
 or buffer as the dev_private pointer in the info structure. By allowing a
@@ -14,8 +16,6 @@
 the type, and even if the info driver API call has not been implemented for
 the device.
 
-Cc: stable@dpdk.org
-
 Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
 Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
 ---
@@ -24,10 +24,10 @@
  2 files changed, 11 insertions(+), 3 deletions(-)
 
 diff --git a/lib/librte_rawdev/rte_rawdev.c b/lib/librte_rawdev/rte_rawdev.c
-index 2eb7b3bc3..e634a567f 100644
+index b6f1e1c77..f6efa6b67 100644
 --- a/lib/librte_rawdev/rte_rawdev.c
 +++ b/lib/librte_rawdev/rte_rawdev.c
-@@ -87,8 +87,10 @@ rte_rawdev_info_get(uint16_t dev_id, struct rte_rawdev_info *dev_info)
+@@ -89,8 +89,10 @@ rte_rawdev_info_get(uint16_t dev_id, struct rte_rawdev_info *dev_info)
  
  	rawdev = &rte_rawdevs[dev_id];
  

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

* [dpdk-stable] patch 'rawdev: fill NUMA socket ID in info' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (84 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'rawdev: allow getting info for unknown device' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'rawdev: export dump function in map file' " luca.boccassi
                   ` (105 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Hemant Agrawal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From a5cb10a2284eb486f28902dea07bc7379bf4b2dd Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Mon, 6 Jul 2020 11:31:31 +0100
Subject: [PATCH] rawdev: fill NUMA socket ID in info

[ upstream commit 26892215922595e117f19e522bf05183213392ff ]

The rawdev info struct has a socket_id field which was not filled in.

We can also omit the checks for the parameter struct being null, since
that is previously checked in the function.

Fixes: c88b3f2558ed ("rawdev: introduce raw device library")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 lib/librte_rawdev/rte_rawdev.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/lib/librte_rawdev/rte_rawdev.c b/lib/librte_rawdev/rte_rawdev.c
index f6efa6b67..fe289cefd 100644
--- a/lib/librte_rawdev/rte_rawdev.c
+++ b/lib/librte_rawdev/rte_rawdev.c
@@ -94,11 +94,9 @@ rte_rawdev_info_get(uint16_t dev_id, struct rte_rawdev_info *dev_info)
 		(*rawdev->dev_ops->dev_info_get)(rawdev, dev_info->dev_private);
 	}
 
-	if (dev_info) {
-
-		dev_info->driver_name = rawdev->driver_name;
-		dev_info->device = rawdev->device;
-	}
+	dev_info->driver_name = rawdev->driver_name;
+	dev_info->device = rawdev->device;
+	dev_info->socket_id = rawdev->socket_id;
 
 	return 0;
 }
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:51.910614413 +0100
+++ 0087-rawdev-fill-NUMA-socket-ID-in-info.patch	2020-07-24 12:53:48.311006907 +0100
@@ -1,15 +1,16 @@
-From 26892215922595e117f19e522bf05183213392ff Mon Sep 17 00:00:00 2001
+From a5cb10a2284eb486f28902dea07bc7379bf4b2dd Mon Sep 17 00:00:00 2001
 From: Bruce Richardson <bruce.richardson@intel.com>
 Date: Mon, 6 Jul 2020 11:31:31 +0100
 Subject: [PATCH] rawdev: fill NUMA socket ID in info
 
+[ upstream commit 26892215922595e117f19e522bf05183213392ff ]
+
 The rawdev info struct has a socket_id field which was not filled in.
 
 We can also omit the checks for the parameter struct being null, since
 that is previously checked in the function.
 
 Fixes: c88b3f2558ed ("rawdev: introduce raw device library")
-Cc: stable@dpdk.org
 
 Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
 Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
@@ -18,10 +19,10 @@
  1 file changed, 3 insertions(+), 5 deletions(-)
 
 diff --git a/lib/librte_rawdev/rte_rawdev.c b/lib/librte_rawdev/rte_rawdev.c
-index e634a567f..8f84d0b22 100644
+index f6efa6b67..fe289cefd 100644
 --- a/lib/librte_rawdev/rte_rawdev.c
 +++ b/lib/librte_rawdev/rte_rawdev.c
-@@ -92,11 +92,9 @@ rte_rawdev_info_get(uint16_t dev_id, struct rte_rawdev_info *dev_info)
+@@ -94,11 +94,9 @@ rte_rawdev_info_get(uint16_t dev_id, struct rte_rawdev_info *dev_info)
  		(*rawdev->dev_ops->dev_info_get)(rawdev, dev_info->dev_private);
  	}
  

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

* [dpdk-stable] patch 'rawdev: export dump function in map file' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (85 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'rawdev: fill NUMA socket ID in info' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'cfgfile: fix stack buffer underflow' " luca.boccassi
                   ` (104 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Hemant Agrawal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 07e906580406ab5795f4d8630a6c27b4bd25a629 Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Mon, 6 Jul 2020 11:31:32 +0100
Subject: [PATCH] rawdev: export dump function in map file

[ upstream commit a8550b773184c202cee408aee8621d682ccb21dc ]

The rte_rawdev_dump function was missing from the map file,
meaning it was unavailable for use when linking dynamically.

Fixes: c88b3f2558ed ("rawdev: introduce raw device library")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 lib/librte_rawdev/rte_rawdev_version.map | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/librte_rawdev/rte_rawdev_version.map b/lib/librte_rawdev/rte_rawdev_version.map
index d847c9e0d..63b54f598 100644
--- a/lib/librte_rawdev/rte_rawdev_version.map
+++ b/lib/librte_rawdev/rte_rawdev_version.map
@@ -5,6 +5,7 @@ DPDK_20.0 {
 	rte_rawdev_configure;
 	rte_rawdev_count;
 	rte_rawdev_dequeue_buffers;
+	rte_rawdev_dump;
 	rte_rawdev_enqueue_buffers;
 	rte_rawdev_firmware_load;
 	rte_rawdev_firmware_status_get;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:51.946286150 +0100
+++ 0088-rawdev-export-dump-function-in-map-file.patch	2020-07-24 12:53:48.311006907 +0100
@@ -1,13 +1,14 @@
-From a8550b773184c202cee408aee8621d682ccb21dc Mon Sep 17 00:00:00 2001
+From 07e906580406ab5795f4d8630a6c27b4bd25a629 Mon Sep 17 00:00:00 2001
 From: Bruce Richardson <bruce.richardson@intel.com>
 Date: Mon, 6 Jul 2020 11:31:32 +0100
 Subject: [PATCH] rawdev: export dump function in map file
 
+[ upstream commit a8550b773184c202cee408aee8621d682ccb21dc ]
+
 The rte_rawdev_dump function was missing from the map file,
 meaning it was unavailable for use when linking dynamically.
 
 Fixes: c88b3f2558ed ("rawdev: introduce raw device library")
-Cc: stable@dpdk.org
 
 Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
 Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>

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

* [dpdk-stable] patch 'cfgfile: fix stack buffer underflow' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (86 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'rawdev: export dump function in map file' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'rib: add C++ include guard' " luca.boccassi
                   ` (103 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 3b710031029e919462866fc7fb2692b3bfa7c78d Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Wed, 1 Jul 2020 20:05:58 -0700
Subject: [PATCH] cfgfile: fix stack buffer underflow

[ upstream commit 041a3971c8f47f7850586c601b7002652dc9327c ]

If cfgfile is give a line with comment character at the start
of the line, it will dereference outside of the buffer.

Detected with address sanitizer:

SUMMARY: AddressSanitizer: stack-buffer-underflow
lib/librte_cfgfile/rte_cfgfile.c:194 in rte_cfgfile_load_with_params
Shadow bytes around the buggy address:
  0x200fff79f6a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x200fff79f6b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x200fff79f6c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x200fff79f6d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x200fff79f6e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x200fff79f6f0: 00 00 00 00 f1 f1 f1[f1]00 00 00 00 00 00 00 00
  0x200fff79f700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x200fff79f710: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x200fff79f720: 04 f2 f2 f2 f3 f3 f3 f3 00 00 00 00 00 00 00 00
  0x200fff79f730: 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 f2
  0x200fff79f740: f2 f2 f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==2189==ABORTING

Fixes: a6a47ac9c2c9 ("cfgfile: rework load function")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/librte_cfgfile/rte_cfgfile.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/librte_cfgfile/rte_cfgfile.c b/lib/librte_cfgfile/rte_cfgfile.c
index 9049fd9c2..0c419d6ad 100644
--- a/lib/librte_cfgfile/rte_cfgfile.c
+++ b/lib/librte_cfgfile/rte_cfgfile.c
@@ -191,7 +191,8 @@ rte_cfgfile_load_with_params(const char *filename, int flags,
 		}
 		/* skip parsing if comment character found */
 		pos = memchr(buffer, params->comment_character, len);
-		if (pos != NULL && (*(pos-1) != '\\')) {
+		if (pos != NULL &&
+		    (pos == buffer || *(pos-1) != '\\')) {
 			*pos = '\0';
 			len = pos -  buffer;
 		}
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:51.984248021 +0100
+++ 0089-cfgfile-fix-stack-buffer-underflow.patch	2020-07-24 12:53:48.315006981 +0100
@@ -1,8 +1,10 @@
-From 041a3971c8f47f7850586c601b7002652dc9327c Mon Sep 17 00:00:00 2001
+From 3b710031029e919462866fc7fb2692b3bfa7c78d Mon Sep 17 00:00:00 2001
 From: Stephen Hemminger <stephen@networkplumber.org>
 Date: Wed, 1 Jul 2020 20:05:58 -0700
 Subject: [PATCH] cfgfile: fix stack buffer underflow
 
+[ upstream commit 041a3971c8f47f7850586c601b7002652dc9327c ]
+
 If cfgfile is give a line with comment character at the start
 of the line, it will dereference outside of the buffer.
 
@@ -44,7 +46,6 @@
 ==2189==ABORTING
 
 Fixes: a6a47ac9c2c9 ("cfgfile: rework load function")
-Cc: stable@dpdk.org
 
 Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
 Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
@@ -53,7 +54,7 @@
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 diff --git a/lib/librte_cfgfile/rte_cfgfile.c b/lib/librte_cfgfile/rte_cfgfile.c
-index f132e4056..002022263 100644
+index 9049fd9c2..0c419d6ad 100644
 --- a/lib/librte_cfgfile/rte_cfgfile.c
 +++ b/lib/librte_cfgfile/rte_cfgfile.c
 @@ -191,7 +191,8 @@ rte_cfgfile_load_with_params(const char *filename, int flags,

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

* [dpdk-stable] patch 'rib: add C++ include guard' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (87 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'cfgfile: fix stack buffer underflow' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'service: fix lcore iteration' " luca.boccassi
                   ` (102 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Vladimir Medvedkin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 09cea03334ff8ee569fd49f1eb1ed13069bc24b9 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Thu, 25 Jun 2020 13:32:08 -0700
Subject: [PATCH] rib: add C++ include guard

[ upstream commit b2a0b9f0447a64dd03aa210c49d70572077555ea ]

All include files should be safe from C++

Fixes: 5a5793a5ffa2 ("rib: add RIB library")
Fixes: f7e861e21c46 ("rib: support IPv6")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
---
 lib/librte_rib/rte_rib.h  |  8 ++++++++
 lib/librte_rib/rte_rib6.h | 10 +++++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/lib/librte_rib/rte_rib.h b/lib/librte_rib/rte_rib.h
index da558c417..9369661dc 100644
--- a/lib/librte_rib/rte_rib.h
+++ b/lib/librte_rib/rte_rib.h
@@ -20,6 +20,10 @@
 
 #include <rte_compat.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * rte_rib_get_nxt() flags
  */
@@ -281,4 +285,8 @@ __rte_experimental
 void
 rte_rib_free(struct rte_rib *rib);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_RIB_H_ */
diff --git a/lib/librte_rib/rte_rib6.h b/lib/librte_rib/rte_rib6.h
index 4b284c913..e7560fa8a 100644
--- a/lib/librte_rib/rte_rib6.h
+++ b/lib/librte_rib/rte_rib6.h
@@ -21,6 +21,10 @@
 #include <rte_memcpy.h>
 #include <rte_compat.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define RTE_RIB6_IPV6_ADDR_SIZE	16
 
 /**
@@ -338,4 +342,8 @@ __rte_experimental
 void
 rte_rib6_free(struct rte_rib6 *rib);
 
-#endif /* _RTE_RIB_H_ */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _RTE_RIB6_H_ */
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:52.019269650 +0100
+++ 0090-rib-add-C-include-guard.patch	2020-07-24 12:53:48.315006981 +0100
@@ -1,13 +1,14 @@
-From b2a0b9f0447a64dd03aa210c49d70572077555ea Mon Sep 17 00:00:00 2001
+From 09cea03334ff8ee569fd49f1eb1ed13069bc24b9 Mon Sep 17 00:00:00 2001
 From: Stephen Hemminger <stephen@networkplumber.org>
 Date: Thu, 25 Jun 2020 13:32:08 -0700
 Subject: [PATCH] rib: add C++ include guard
 
+[ upstream commit b2a0b9f0447a64dd03aa210c49d70572077555ea ]
+
 All include files should be safe from C++
 
 Fixes: 5a5793a5ffa2 ("rib: add RIB library")
 Fixes: f7e861e21c46 ("rib: support IPv6")
-Cc: stable@dpdk.org
 
 Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
 Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
@@ -17,7 +18,7 @@
  2 files changed, 17 insertions(+), 1 deletion(-)
 
 diff --git a/lib/librte_rib/rte_rib.h b/lib/librte_rib/rte_rib.h
-index a9bb42f6f..f80752e5b 100644
+index da558c417..9369661dc 100644
 --- a/lib/librte_rib/rte_rib.h
 +++ b/lib/librte_rib/rte_rib.h
 @@ -20,6 +20,10 @@
@@ -31,7 +32,7 @@
  /**
   * rte_rib_get_nxt() flags
   */
-@@ -282,4 +286,8 @@ __rte_experimental
+@@ -281,4 +285,8 @@ __rte_experimental
  void
  rte_rib_free(struct rte_rib *rib);
  
@@ -41,7 +42,7 @@
 +
  #endif /* _RTE_RIB_H_ */
 diff --git a/lib/librte_rib/rte_rib6.h b/lib/librte_rib/rte_rib6.h
-index 24faf4632..b5e10569b 100644
+index 4b284c913..e7560fa8a 100644
 --- a/lib/librte_rib/rte_rib6.h
 +++ b/lib/librte_rib/rte_rib6.h
 @@ -21,6 +21,10 @@
@@ -55,7 +56,7 @@
  #define RTE_RIB6_IPV6_ADDR_SIZE	16
  
  /**
-@@ -339,4 +343,8 @@ __rte_experimental
+@@ -338,4 +342,8 @@ __rte_experimental
  void
  rte_rib6_free(struct rte_rib6 *rib);
  

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

* [dpdk-stable] patch 'service: fix lcore iteration' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (88 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'rib: add C++ include guard' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'drivers/crypto: add missing OOP feature flag' " luca.boccassi
                   ` (101 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Igor Romanov
  Cc: Andrew Rybchenko, Harry van Haaren, Honnappa Nagarahalli, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From eceee0c93bfb15a0cf3480c9fd96ac01fafb8edc Mon Sep 17 00:00:00 2001
From: Igor Romanov <igor.romanov@oktetlabs.ru>
Date: Tue, 7 Jul 2020 11:45:24 +0100
Subject: [PATCH] service: fix lcore iteration

[ upstream commit f3c256b621262e581d3edcca383df83875ab7ebe ]

The service core list is populated, but not used. Incorrect
lcore states are examined for a service.

Use the populated list to iterate over service cores.

Fixes: e484ccddbe1b ("service: avoid false sharing on core state")

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 lib/librte_eal/common/rte_service.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c
index d5dd32d8d..eca6ccc59 100644
--- a/lib/librte_eal/common/rte_service.c
+++ b/lib/librte_eal/common/rte_service.c
@@ -397,7 +397,7 @@ rte_service_may_be_active(uint32_t id)
 		return -EINVAL;
 
 	for (i = 0; i < lcore_count; i++) {
-		if (lcore_states[i].service_active_on_lcore[id])
+		if (lcore_states[ids[i]].service_active_on_lcore[id])
 			return 1;
 	}
 
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:52.054228510 +0100
+++ 0091-service-fix-lcore-iteration.patch	2020-07-24 12:53:48.315006981 +0100
@@ -1,15 +1,16 @@
-From f3c256b621262e581d3edcca383df83875ab7ebe Mon Sep 17 00:00:00 2001
+From eceee0c93bfb15a0cf3480c9fd96ac01fafb8edc Mon Sep 17 00:00:00 2001
 From: Igor Romanov <igor.romanov@oktetlabs.ru>
 Date: Tue, 7 Jul 2020 11:45:24 +0100
 Subject: [PATCH] service: fix lcore iteration
 
+[ upstream commit f3c256b621262e581d3edcca383df83875ab7ebe ]
+
 The service core list is populated, but not used. Incorrect
 lcore states are examined for a service.
 
 Use the populated list to iterate over service cores.
 
 Fixes: e484ccddbe1b ("service: avoid false sharing on core state")
-Cc: stable@dpdk.org
 
 Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
 Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
@@ -20,10 +21,10 @@
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c
-index 6123a2124..e2795f857 100644
+index d5dd32d8d..eca6ccc59 100644
 --- a/lib/librte_eal/common/rte_service.c
 +++ b/lib/librte_eal/common/rte_service.c
-@@ -422,7 +422,7 @@ rte_service_may_be_active(uint32_t id)
+@@ -397,7 +397,7 @@ rte_service_may_be_active(uint32_t id)
  		return -EINVAL;
  
  	for (i = 0; i < lcore_count; i++) {

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

* [dpdk-stable] patch 'drivers/crypto: add missing OOP feature flag' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (89 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'service: fix lcore iteration' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'test/crypto: fix asymmetric session mempool creation' " luca.boccassi
                   ` (100 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Pablo de Lara; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From b4c9242d0552f5a8bbd88adb45e7d1ae548d5d5a Mon Sep 17 00:00:00 2001
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Date: Thu, 4 Jun 2020 08:51:12 +0000
Subject: [PATCH] drivers/crypto: add missing OOP feature flag

[ upstream commit cd346367f898d619edf53f13628d6e539dbcab40 ]

ZUC, SNOW3G and KASUMI PMDs support Out-of-place operations,
but their feature flags did not reflect this.

Fixes: 2717246ecd7d ("cryptodev: replace mbuf scatter gather flag")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 doc/guides/cryptodevs/features/kasumi.ini | 1 +
 doc/guides/cryptodevs/features/snow3g.ini | 1 +
 doc/guides/cryptodevs/features/zuc.ini    | 1 +
 drivers/crypto/kasumi/rte_kasumi_pmd.c    | 1 +
 drivers/crypto/snow3g/rte_snow3g_pmd.c    | 1 +
 drivers/crypto/zuc/rte_zuc_pmd.c          | 1 +
 6 files changed, 6 insertions(+)

diff --git a/doc/guides/cryptodevs/features/kasumi.ini b/doc/guides/cryptodevs/features/kasumi.ini
index f3d061009..7ee866e8f 100644
--- a/doc/guides/cryptodevs/features/kasumi.ini
+++ b/doc/guides/cryptodevs/features/kasumi.ini
@@ -6,6 +6,7 @@
 [Features]
 Symmetric crypto       = Y
 Sym operation chaining = Y
+OOP LB  In LB  Out     = Y
 
 ;
 ; Supported crypto algorithms of the 'kasumi' crypto driver.
diff --git a/doc/guides/cryptodevs/features/snow3g.ini b/doc/guides/cryptodevs/features/snow3g.ini
index ec2daf6c6..c4a1a8448 100644
--- a/doc/guides/cryptodevs/features/snow3g.ini
+++ b/doc/guides/cryptodevs/features/snow3g.ini
@@ -6,6 +6,7 @@
 [Features]
 Symmetric crypto       = Y
 Sym operation chaining = Y
+OOP LB  In LB  Out     = Y
 
 ;
 ; Supported crypto algorithms of the 'snow3g' crypto driver.
diff --git a/doc/guides/cryptodevs/features/zuc.ini b/doc/guides/cryptodevs/features/zuc.ini
index 9b6a4287e..29cc258aa 100644
--- a/doc/guides/cryptodevs/features/zuc.ini
+++ b/doc/guides/cryptodevs/features/zuc.ini
@@ -6,6 +6,7 @@
 [Features]
 Symmetric crypto       = Y
 Sym operation chaining = Y
+OOP LB  In LB  Out     = Y
 
 ;
 ; Supported crypto algorithms of the 'zuc' crypto driver.
diff --git a/drivers/crypto/kasumi/rte_kasumi_pmd.c b/drivers/crypto/kasumi/rte_kasumi_pmd.c
index c87dca5f4..dd85928c5 100644
--- a/drivers/crypto/kasumi/rte_kasumi_pmd.c
+++ b/drivers/crypto/kasumi/rte_kasumi_pmd.c
@@ -557,6 +557,7 @@ cryptodev_kasumi_create(const char *name,
 
 	dev->feature_flags = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO |
 			RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING |
+			RTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUT |
 			cpu_flags;
 
 	internals = dev->data->dev_private;
diff --git a/drivers/crypto/snow3g/rte_snow3g_pmd.c b/drivers/crypto/snow3g/rte_snow3g_pmd.c
index 2b1b90b01..32d94c5ab 100644
--- a/drivers/crypto/snow3g/rte_snow3g_pmd.c
+++ b/drivers/crypto/snow3g/rte_snow3g_pmd.c
@@ -568,6 +568,7 @@ cryptodev_snow3g_create(const char *name,
 
 	dev->feature_flags = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO |
 			RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING |
+			RTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUT |
 			cpu_flags;
 
 	internals = dev->data->dev_private;
diff --git a/drivers/crypto/zuc/rte_zuc_pmd.c b/drivers/crypto/zuc/rte_zuc_pmd.c
index 265aabaeb..bc02d9d4a 100644
--- a/drivers/crypto/zuc/rte_zuc_pmd.c
+++ b/drivers/crypto/zuc/rte_zuc_pmd.c
@@ -476,6 +476,7 @@ cryptodev_zuc_create(const char *name,
 
 	dev->feature_flags = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO |
 			RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING |
+			RTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUT |
 			cpu_flags;
 
 	internals = dev->data->dev_private;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:52.089927483 +0100
+++ 0092-drivers-crypto-add-missing-OOP-feature-flag.patch	2020-07-24 12:53:48.315006981 +0100
@@ -1,102 +1,97 @@
-From cd346367f898d619edf53f13628d6e539dbcab40 Mon Sep 17 00:00:00 2001
+From b4c9242d0552f5a8bbd88adb45e7d1ae548d5d5a Mon Sep 17 00:00:00 2001
 From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
 Date: Thu, 4 Jun 2020 08:51:12 +0000
 Subject: [PATCH] drivers/crypto: add missing OOP feature flag
 
+[ upstream commit cd346367f898d619edf53f13628d6e539dbcab40 ]
+
 ZUC, SNOW3G and KASUMI PMDs support Out-of-place operations,
 but their feature flags did not reflect this.
 
 Fixes: 2717246ecd7d ("cryptodev: replace mbuf scatter gather flag")
-Cc: stable@dpdk.org
 
 Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
 ---
  doc/guides/cryptodevs/features/kasumi.ini | 1 +
  doc/guides/cryptodevs/features/snow3g.ini | 1 +
  doc/guides/cryptodevs/features/zuc.ini    | 1 +
- drivers/crypto/kasumi/rte_kasumi_pmd.c    | 3 ++-
- drivers/crypto/snow3g/rte_snow3g_pmd.c    | 3 ++-
- drivers/crypto/zuc/rte_zuc_pmd.c          | 3 ++-
- 6 files changed, 9 insertions(+), 3 deletions(-)
+ drivers/crypto/kasumi/rte_kasumi_pmd.c    | 1 +
+ drivers/crypto/snow3g/rte_snow3g_pmd.c    | 1 +
+ drivers/crypto/zuc/rte_zuc_pmd.c          | 1 +
+ 6 files changed, 6 insertions(+)
 
 diff --git a/doc/guides/cryptodevs/features/kasumi.ini b/doc/guides/cryptodevs/features/kasumi.ini
-index 8380a5765..fbdb47e89 100644
+index f3d061009..7ee866e8f 100644
 --- a/doc/guides/cryptodevs/features/kasumi.ini
 +++ b/doc/guides/cryptodevs/features/kasumi.ini
-@@ -8,6 +8,7 @@ Symmetric crypto       = Y
+@@ -6,6 +6,7 @@
+ [Features]
+ Symmetric crypto       = Y
  Sym operation chaining = Y
- Symmetric sessionless  = Y
- Non-Byte aligned data  = Y
 +OOP LB  In LB  Out     = Y
  
  ;
  ; Supported crypto algorithms of the 'kasumi' crypto driver.
 diff --git a/doc/guides/cryptodevs/features/snow3g.ini b/doc/guides/cryptodevs/features/snow3g.ini
-index b2caefe3a..14ac7e4b6 100644
+index ec2daf6c6..c4a1a8448 100644
 --- a/doc/guides/cryptodevs/features/snow3g.ini
 +++ b/doc/guides/cryptodevs/features/snow3g.ini
-@@ -8,6 +8,7 @@ Symmetric crypto       = Y
+@@ -6,6 +6,7 @@
+ [Features]
+ Symmetric crypto       = Y
  Sym operation chaining = Y
- Symmetric sessionless  = Y
- Non-Byte aligned data  = Y
 +OOP LB  In LB  Out     = Y
  
  ;
  ; Supported crypto algorithms of the 'snow3g' crypto driver.
 diff --git a/doc/guides/cryptodevs/features/zuc.ini b/doc/guides/cryptodevs/features/zuc.ini
-index 21d074f9b..1c53454a6 100644
+index 9b6a4287e..29cc258aa 100644
 --- a/doc/guides/cryptodevs/features/zuc.ini
 +++ b/doc/guides/cryptodevs/features/zuc.ini
-@@ -8,6 +8,7 @@ Symmetric crypto       = Y
+@@ -6,6 +6,7 @@
+ [Features]
+ Symmetric crypto       = Y
  Sym operation chaining = Y
- Symmetric sessionless  = Y
- Non-Byte aligned data  = Y
 +OOP LB  In LB  Out     = Y
  
  ;
  ; Supported crypto algorithms of the 'zuc' crypto driver.
 diff --git a/drivers/crypto/kasumi/rte_kasumi_pmd.c b/drivers/crypto/kasumi/rte_kasumi_pmd.c
-index c3f0dfc2f..5ff1b5c56 100644
+index c87dca5f4..dd85928c5 100644
 --- a/drivers/crypto/kasumi/rte_kasumi_pmd.c
 +++ b/drivers/crypto/kasumi/rte_kasumi_pmd.c
-@@ -551,7 +551,8 @@ cryptodev_kasumi_create(const char *name,
+@@ -557,6 +557,7 @@ cryptodev_kasumi_create(const char *name,
+ 
  	dev->feature_flags = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO |
  			RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING |
- 			RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA |
--			RTE_CRYPTODEV_FF_SYM_SESSIONLESS;
-+			RTE_CRYPTODEV_FF_SYM_SESSIONLESS |
-+			RTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUT;
++			RTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUT |
+ 			cpu_flags;
  
- 	mgr = alloc_mb_mgr(0);
- 	if (mgr == NULL)
+ 	internals = dev->data->dev_private;
 diff --git a/drivers/crypto/snow3g/rte_snow3g_pmd.c b/drivers/crypto/snow3g/rte_snow3g_pmd.c
-index 558e01e70..962868e1f 100644
+index 2b1b90b01..32d94c5ab 100644
 --- a/drivers/crypto/snow3g/rte_snow3g_pmd.c
 +++ b/drivers/crypto/snow3g/rte_snow3g_pmd.c
-@@ -563,7 +563,8 @@ cryptodev_snow3g_create(const char *name,
+@@ -568,6 +568,7 @@ cryptodev_snow3g_create(const char *name,
+ 
  	dev->feature_flags = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO |
  			RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING |
- 			RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA |
--			RTE_CRYPTODEV_FF_SYM_SESSIONLESS;
-+			RTE_CRYPTODEV_FF_SYM_SESSIONLESS |
-+			RTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUT;
++			RTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUT |
+ 			cpu_flags;
  
- 	mgr = alloc_mb_mgr(0);
- 	if (mgr == NULL)
+ 	internals = dev->data->dev_private;
 diff --git a/drivers/crypto/zuc/rte_zuc_pmd.c b/drivers/crypto/zuc/rte_zuc_pmd.c
-index 20cb5a160..a9ff31828 100644
+index 265aabaeb..bc02d9d4a 100644
 --- a/drivers/crypto/zuc/rte_zuc_pmd.c
 +++ b/drivers/crypto/zuc/rte_zuc_pmd.c
-@@ -480,7 +480,8 @@ cryptodev_zuc_create(const char *name,
+@@ -476,6 +476,7 @@ cryptodev_zuc_create(const char *name,
+ 
  	dev->feature_flags = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO |
  			RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING |
- 			RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA |
--			RTE_CRYPTODEV_FF_SYM_SESSIONLESS;
-+			RTE_CRYPTODEV_FF_SYM_SESSIONLESS |
-+			RTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUT;
++			RTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUT |
+ 			cpu_flags;
  
- 	mb_mgr = alloc_mb_mgr(0);
- 	if (mb_mgr == NULL)
+ 	internals = dev->data->dev_private;
 -- 
 2.20.1
 

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

* [dpdk-stable] patch 'test/crypto: fix asymmetric session mempool creation' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (90 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'drivers/crypto: add missing OOP feature flag' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'common/cpt: fix encryption offset' " luca.boccassi
                   ` (99 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Adam Dybkowski; +Cc: Fiona Trahe, Akhil Goyal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 656aac2d399dbcdd5ed0bbc4f2311324236d2550 Mon Sep 17 00:00:00 2001
From: Adam Dybkowski <adamx.dybkowski@intel.com>
Date: Mon, 8 Jun 2020 15:15:01 +0200
Subject: [PATCH] test/crypto: fix asymmetric session mempool creation

[ upstream commit 0ad83afdf3352e5e61e8c137131524ee6b2506ce ]

This patch fixes the element size of the mempool used
for allocating asym crypto sessions and their private data.

Fixes: 2c6dab9cd93d ("test/crypto: add RSA and Mod tests")

Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
---
 app/test/test_cryptodev_asym.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c
index 69df29304..a0802994f 100644
--- a/app/test/test_cryptodev_asym.c
+++ b/app/test/test_cryptodev_asym.c
@@ -933,8 +933,9 @@ testsuite_setup(void)
 	}
 
 	/* setup asym session pool */
-	unsigned int session_size =
-		rte_cryptodev_asym_get_private_session_size(dev_id);
+	unsigned int session_size = RTE_MAX(
+		rte_cryptodev_asym_get_private_session_size(dev_id),
+		rte_cryptodev_asym_get_header_session_size());
 	/*
 	 * Create mempool with TEST_NUM_SESSIONS * 2,
 	 * to include the session headers
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:52.127793508 +0100
+++ 0093-test-crypto-fix-asymmetric-session-mempool-creation.patch	2020-07-24 12:53:48.319007056 +0100
@@ -1,13 +1,14 @@
-From 0ad83afdf3352e5e61e8c137131524ee6b2506ce Mon Sep 17 00:00:00 2001
+From 656aac2d399dbcdd5ed0bbc4f2311324236d2550 Mon Sep 17 00:00:00 2001
 From: Adam Dybkowski <adamx.dybkowski@intel.com>
 Date: Mon, 8 Jun 2020 15:15:01 +0200
 Subject: [PATCH] test/crypto: fix asymmetric session mempool creation
 
+[ upstream commit 0ad83afdf3352e5e61e8c137131524ee6b2506ce ]
+
 This patch fixes the element size of the mempool used
 for allocating asym crypto sessions and their private data.
 
 Fixes: 2c6dab9cd93d ("test/crypto: add RSA and Mod tests")
-Cc: stable@dpdk.org
 
 Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
 Acked-by: Fiona Trahe <fiona.trahe@intel.com>
@@ -17,10 +18,10 @@
  1 file changed, 3 insertions(+), 2 deletions(-)
 
 diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c
-index b8e050048..dc62ed7bf 100644
+index 69df29304..a0802994f 100644
 --- a/app/test/test_cryptodev_asym.c
 +++ b/app/test/test_cryptodev_asym.c
-@@ -935,8 +935,9 @@ testsuite_setup(void)
+@@ -933,8 +933,9 @@ testsuite_setup(void)
  	}
  
  	/* setup asym session pool */

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

* [dpdk-stable] patch 'common/cpt: fix encryption offset' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (91 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'test/crypto: fix asymmetric session mempool creation' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'crypto/qat: fix AES-XTS capabilities' " luca.boccassi
                   ` (98 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Ankur Dwivedi; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 094550b236fd9acc5954a910b5c1ec8e953351d1 Mon Sep 17 00:00:00 2001
From: Ankur Dwivedi <adwivedi@marvell.com>
Date: Fri, 3 Jul 2020 11:11:37 +0530
Subject: [PATCH] common/cpt: fix encryption offset

[ upstream commit 0058f30514f13e5d5412e97973a9c9254e36edb1 ]

In case of gmac auth the encryption offset should be set to zero.

Fixes: b74652f3a91f ("common/cpt: add microcode interface for encryption")
Fixes: 177b41ceee61 ("common/cpt: add microcode interface for decryption")

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
---
 drivers/common/cpt/cpt_ucode.h | 24 ++++++++++--------------
 1 file changed, 10 insertions(+), 14 deletions(-)

diff --git a/drivers/common/cpt/cpt_ucode.h b/drivers/common/cpt/cpt_ucode.h
index 9dc0fc652..e92e3678c 100644
--- a/drivers/common/cpt/cpt_ucode.h
+++ b/drivers/common/cpt/cpt_ucode.h
@@ -718,9 +718,6 @@ cpt_enc_hmac_prep(uint32_t flags,
 	m_vaddr = (uint8_t *)m_vaddr + size;
 	m_dma += size;
 
-	if (hash_type == GMAC_TYPE)
-		encr_data_len = 0;
-
 	if (unlikely(!(flags & VALID_IV_BUF))) {
 		iv_len = 0;
 		iv_offset = ENCR_IV_OFFSET(d_offs);
@@ -752,6 +749,11 @@ cpt_enc_hmac_prep(uint32_t flags,
 	opcode.s.major = CPT_MAJOR_OP_FC;
 	opcode.s.minor = 0;
 
+	if (hash_type == GMAC_TYPE) {
+		encr_offset = 0;
+		encr_data_len = 0;
+	}
+
 	auth_dlen = auth_offset + auth_data_len;
 	enc_dlen = encr_data_len + encr_offset;
 	if (unlikely(encr_data_len & 0xf)) {
@@ -762,11 +764,6 @@ cpt_enc_hmac_prep(uint32_t flags,
 			enc_dlen = ROUNDUP16(encr_data_len) + encr_offset;
 	}
 
-	if (unlikely(hash_type == GMAC_TYPE)) {
-		encr_offset = auth_dlen;
-		enc_dlen = 0;
-	}
-
 	if (unlikely(auth_dlen > enc_dlen)) {
 		inputlen = auth_dlen;
 		outputlen = auth_dlen + mac_len;
@@ -1069,9 +1066,6 @@ cpt_dec_hmac_prep(uint32_t flags,
 	hash_type = cpt_ctx->hash_type;
 	mac_len = cpt_ctx->mac_len;
 
-	if (hash_type == GMAC_TYPE)
-		encr_data_len = 0;
-
 	if (unlikely(!(flags & VALID_IV_BUF))) {
 		iv_len = 0;
 		iv_offset = ENCR_IV_OFFSET(d_offs);
@@ -1128,6 +1122,11 @@ cpt_dec_hmac_prep(uint32_t flags,
 	opcode.s.major = CPT_MAJOR_OP_FC;
 	opcode.s.minor = 1;
 
+	if (hash_type == GMAC_TYPE) {
+		encr_offset = 0;
+		encr_data_len = 0;
+	}
+
 	enc_dlen = encr_offset + encr_data_len;
 	auth_dlen = auth_offset + auth_data_len;
 
@@ -1139,9 +1138,6 @@ cpt_dec_hmac_prep(uint32_t flags,
 		outputlen = enc_dlen;
 	}
 
-	if (hash_type == GMAC_TYPE)
-		encr_offset = inputlen;
-
 	vq_cmd_w0.u64 = 0;
 	vq_cmd_w0.s.param1 = encr_data_len;
 	vq_cmd_w0.s.param2 = auth_data_len;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:52.168539463 +0100
+++ 0094-common-cpt-fix-encryption-offset.patch	2020-07-24 12:53:48.323007130 +0100
@@ -1,13 +1,14 @@
-From 0058f30514f13e5d5412e97973a9c9254e36edb1 Mon Sep 17 00:00:00 2001
+From 094550b236fd9acc5954a910b5c1ec8e953351d1 Mon Sep 17 00:00:00 2001
 From: Ankur Dwivedi <adwivedi@marvell.com>
 Date: Fri, 3 Jul 2020 11:11:37 +0530
 Subject: [PATCH] common/cpt: fix encryption offset
 
+[ upstream commit 0058f30514f13e5d5412e97973a9c9254e36edb1 ]
+
 In case of gmac auth the encryption offset should be set to zero.
 
 Fixes: b74652f3a91f ("common/cpt: add microcode interface for encryption")
 Fixes: 177b41ceee61 ("common/cpt: add microcode interface for decryption")
-Cc: stable@dpdk.org
 
 Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
 ---
@@ -15,10 +16,10 @@
  1 file changed, 10 insertions(+), 14 deletions(-)
 
 diff --git a/drivers/common/cpt/cpt_ucode.h b/drivers/common/cpt/cpt_ucode.h
-index 34ccd08a4..ab595eb58 100644
+index 9dc0fc652..e92e3678c 100644
 --- a/drivers/common/cpt/cpt_ucode.h
 +++ b/drivers/common/cpt/cpt_ucode.h
-@@ -682,9 +682,6 @@ cpt_enc_hmac_prep(uint32_t flags,
+@@ -718,9 +718,6 @@ cpt_enc_hmac_prep(uint32_t flags,
  	m_vaddr = (uint8_t *)m_vaddr + size;
  	m_dma += size;
  
@@ -28,7 +29,7 @@
  	if (unlikely(!(flags & VALID_IV_BUF))) {
  		iv_len = 0;
  		iv_offset = ENCR_IV_OFFSET(d_offs);
-@@ -716,6 +713,11 @@ cpt_enc_hmac_prep(uint32_t flags,
+@@ -752,6 +749,11 @@ cpt_enc_hmac_prep(uint32_t flags,
  	opcode.s.major = CPT_MAJOR_OP_FC;
  	opcode.s.minor = 0;
  
@@ -40,7 +41,7 @@
  	auth_dlen = auth_offset + auth_data_len;
  	enc_dlen = encr_data_len + encr_offset;
  	if (unlikely(encr_data_len & 0xf)) {
-@@ -726,11 +728,6 @@ cpt_enc_hmac_prep(uint32_t flags,
+@@ -762,11 +764,6 @@ cpt_enc_hmac_prep(uint32_t flags,
  			enc_dlen = ROUNDUP16(encr_data_len) + encr_offset;
  	}
  
@@ -52,7 +53,7 @@
  	if (unlikely(auth_dlen > enc_dlen)) {
  		inputlen = auth_dlen;
  		outputlen = auth_dlen + mac_len;
-@@ -1033,9 +1030,6 @@ cpt_dec_hmac_prep(uint32_t flags,
+@@ -1069,9 +1066,6 @@ cpt_dec_hmac_prep(uint32_t flags,
  	hash_type = cpt_ctx->hash_type;
  	mac_len = cpt_ctx->mac_len;
  
@@ -62,7 +63,7 @@
  	if (unlikely(!(flags & VALID_IV_BUF))) {
  		iv_len = 0;
  		iv_offset = ENCR_IV_OFFSET(d_offs);
-@@ -1092,6 +1086,11 @@ cpt_dec_hmac_prep(uint32_t flags,
+@@ -1128,6 +1122,11 @@ cpt_dec_hmac_prep(uint32_t flags,
  	opcode.s.major = CPT_MAJOR_OP_FC;
  	opcode.s.minor = 1;
  
@@ -74,7 +75,7 @@
  	enc_dlen = encr_offset + encr_data_len;
  	auth_dlen = auth_offset + auth_data_len;
  
-@@ -1103,9 +1102,6 @@ cpt_dec_hmac_prep(uint32_t flags,
+@@ -1139,9 +1138,6 @@ cpt_dec_hmac_prep(uint32_t flags,
  		outputlen = enc_dlen;
  	}
  

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

* [dpdk-stable] patch 'crypto/qat: fix AES-XTS capabilities' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (92 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'common/cpt: fix encryption offset' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'crypto/dpaax_sec: fix 18-bit PDCP cases with HFN override' " luca.boccassi
                   ` (97 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Adam Dybkowski; +Cc: Fiona Trahe, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From ccfb5eed19ae1b382590818c17aa7550dcecc149 Mon Sep 17 00:00:00 2001
From: Adam Dybkowski <adamx.dybkowski@intel.com>
Date: Fri, 26 Jun 2020 13:23:42 +0200
Subject: [PATCH] crypto/qat: fix AES-XTS capabilities

[ upstream commit 12e4f2b7197d54fe358c98f633b9c4fdacfaa67e ]

This patch fixes the increment field of the AES-XTS cipher key size.

Fixes: 7d5ef3bb32cd ("crypto/qat: support XTS")

Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
---
 drivers/crypto/qat/qat_sym_capabilities.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/qat/qat_sym_capabilities.h b/drivers/crypto/qat/qat_sym_capabilities.h
index dbeea4340..8591795aa 100644
--- a/drivers/crypto/qat/qat_sym_capabilities.h
+++ b/drivers/crypto/qat/qat_sym_capabilities.h
@@ -419,7 +419,7 @@
 				.key_size = {				\
 					.min = 32,			\
 					.max = 64,			\
-					.increment = 0			\
+					.increment = 32			\
 				},					\
 				.iv_size = {				\
 					.min = 16,			\
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:52.208046795 +0100
+++ 0095-crypto-qat-fix-AES-XTS-capabilities.patch	2020-07-24 12:53:48.323007130 +0100
@@ -1,12 +1,13 @@
-From 12e4f2b7197d54fe358c98f633b9c4fdacfaa67e Mon Sep 17 00:00:00 2001
+From ccfb5eed19ae1b382590818c17aa7550dcecc149 Mon Sep 17 00:00:00 2001
 From: Adam Dybkowski <adamx.dybkowski@intel.com>
 Date: Fri, 26 Jun 2020 13:23:42 +0200
 Subject: [PATCH] crypto/qat: fix AES-XTS capabilities
 
+[ upstream commit 12e4f2b7197d54fe358c98f633b9c4fdacfaa67e ]
+
 This patch fixes the increment field of the AES-XTS cipher key size.
 
 Fixes: 7d5ef3bb32cd ("crypto/qat: support XTS")
-Cc: stable@dpdk.org
 
 Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
 Acked-by: Fiona Trahe <fiona.trahe@intel.com>
@@ -15,7 +16,7 @@
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/drivers/crypto/qat/qat_sym_capabilities.h b/drivers/crypto/qat/qat_sym_capabilities.h
-index 7b8b13b4f..b16581fff 100644
+index dbeea4340..8591795aa 100644
 --- a/drivers/crypto/qat/qat_sym_capabilities.h
 +++ b/drivers/crypto/qat/qat_sym_capabilities.h
 @@ -419,7 +419,7 @@

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

* [dpdk-stable] patch 'crypto/dpaax_sec: fix 18-bit PDCP cases with HFN override' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (93 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'crypto/qat: fix AES-XTS capabilities' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'crypto/dpaax_sec: fix inline query for descriptors' " luca.boccassi
                   ` (96 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Akhil Goyal; +Cc: Hemant Agrawal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From a0ba121fcbf194c0a17c8db2508b75677dc3f769 Mon Sep 17 00:00:00 2001
From: Akhil Goyal <akhil.goyal@nxp.com>
Date: Mon, 1 Jun 2020 22:47:45 +0530
Subject: [PATCH] crypto/dpaax_sec: fix 18-bit PDCP cases with HFN override

[ upstream commit f6ab96f13d7a23b39fb5135b64ed8e99c425c7a9 ]

In case of RTA_SEC_ERA = 8, where the length of shared desc
is large for some of PDCP cases, the descriptor buffer cannot
hold 2 extra words when HFN override is enabled. As a result,
the descriptor fails.

This patch converts one of the keys from immediate key to
reference key hence reducing the length of the descriptor.

Fixes: 2e4cbdb4b2c2 ("crypto/dpaax_sec: support PDCP U-Plane with integrity")

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/common/dpaax/caamflib/desc/pdcp.h   | 44 +++++++++++++++++++++
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c |  8 ++++
 drivers/crypto/dpaa_sec/dpaa_sec.c          | 33 +++-------------
 3 files changed, 58 insertions(+), 27 deletions(-)

diff --git a/drivers/common/dpaax/caamflib/desc/pdcp.h b/drivers/common/dpaax/caamflib/desc/pdcp.h
index b5e2d24e4..99eb0f71a 100644
--- a/drivers/common/dpaax/caamflib/desc/pdcp.h
+++ b/drivers/common/dpaax/caamflib/desc/pdcp.h
@@ -262,6 +262,50 @@ enum pdb_type_e {
 	PDCP_PDB_TYPE_INVALID
 };
 
+/**
+ * rta_inline_pdcp_query() - Provide indications if a key can be passed as
+ *                           immediate data or shall be referenced in a
+ *                           shared descriptor.
+ * Return: 0 if data can be inlined or 1 if referenced.
+ */
+static inline int
+rta_inline_pdcp_query(enum auth_type_pdcp auth_alg,
+		      enum cipher_type_pdcp cipher_alg,
+		      enum pdcp_sn_size sn_size,
+		      int8_t hfn_ovd)
+{
+	/**
+	 * Shared Descriptors for some of the cases does not fit in the
+	 * MAX_DESC_SIZE of the descriptor especially when non-protocol
+	 * descriptors are formed as in 18bit cases and when HFN override
+	 * is enabled as 2 extra words are added in the job descriptor.
+	 * The cases which exceed are for RTA_SEC_ERA=8 and HFN override
+	 * enabled and 18bit uplane and either of following Algo combinations.
+	 * - SNOW-AES
+	 * - AES-SNOW
+	 * - SNOW-SNOW
+	 * - ZUC-SNOW
+	 *
+	 * We cannot make inline for all cases, as this will impact performance
+	 * due to extra memory accesses for the keys.
+	 */
+	if ((rta_sec_era == RTA_SEC_ERA_8) && hfn_ovd &&
+			(sn_size == PDCP_SN_SIZE_18) &&
+			((cipher_alg == PDCP_CIPHER_TYPE_SNOW &&
+				auth_alg == PDCP_AUTH_TYPE_AES) ||
+			(cipher_alg == PDCP_CIPHER_TYPE_AES &&
+				auth_alg == PDCP_AUTH_TYPE_SNOW) ||
+			(cipher_alg == PDCP_CIPHER_TYPE_SNOW &&
+				auth_alg == PDCP_AUTH_TYPE_SNOW) ||
+			(cipher_alg == PDCP_CIPHER_TYPE_ZUC &&
+				auth_alg == PDCP_AUTH_TYPE_SNOW))) {
+
+		return 1;
+	}
+
+	return 0;
+}
+
 /*
  * Function for appending the portion of a PDCP Control Plane shared descriptor
  * which performs NULL encryption and integrity (i.e. copies the input frame
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index 6ed2701ab..434310cfd 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -3145,6 +3145,14 @@ dpaa2_sec_set_pdcp_session(struct rte_cryptodev *dev,
 		goto out;
 	}
 
+	if (rta_inline_pdcp_query(authdata.algtype,
+				cipherdata.algtype,
+				session->pdcp.sn_size,
+				session->pdcp.hfn_ovd)) {
+		cipherdata.key = DPAA2_VADDR_TO_IOVA(cipherdata.key);
+		cipherdata.key_type = RTA_DATA_PTR;
+	}
+
 	if (pdcp_xform->domain == RTE_SECURITY_PDCP_MODE_CONTROL) {
 		if (session->dir == DIR_ENC)
 			bufsize = cnstr_shdsc_pdcp_c_plane_encap(
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index df684d265..4442469e2 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -237,7 +237,6 @@ dpaa_sec_prep_pdcp_cdb(dpaa_sec_session *ses)
 	struct sec_cdb *cdb = &ses->cdb;
 	struct alginfo *p_authdata = NULL;
 	int32_t shared_desc_len = 0;
-	int err;
 #if RTE_BYTE_ORDER == RTE_BIG_ENDIAN
 	int swap = false;
 #else
@@ -251,10 +250,6 @@ dpaa_sec_prep_pdcp_cdb(dpaa_sec_session *ses)
 	cipherdata.algtype = ses->cipher_key.alg;
 	cipherdata.algmode = ses->cipher_key.algmode;
 
-	cdb->sh_desc[0] = cipherdata.keylen;
-	cdb->sh_desc[1] = 0;
-	cdb->sh_desc[2] = 0;
-
 	if (ses->auth_alg) {
 		authdata.key = (size_t)ses->auth_key.data;
 		authdata.keylen = ses->auth_key.length;
@@ -264,33 +259,17 @@ dpaa_sec_prep_pdcp_cdb(dpaa_sec_session *ses)
 		authdata.algmode = ses->auth_key.algmode;
 
 		p_authdata = &authdata;
-
-		cdb->sh_desc[1] = authdata.keylen;
-	}
-
-	err = rta_inline_query(IPSEC_AUTH_VAR_AES_DEC_BASE_DESC_LEN,
-			       MIN_JOB_DESC_SIZE,
-			       (unsigned int *)cdb->sh_desc,
-			       &cdb->sh_desc[2], 2);
-	if (err < 0) {
-		DPAA_SEC_ERR("Crypto: Incorrect key lengths");
-		return err;
 	}
 
-	if (!(cdb->sh_desc[2] & 1) && cipherdata.keylen) {
+	if (rta_inline_pdcp_query(authdata.algtype,
+				cipherdata.algtype,
+				ses->pdcp.sn_size,
+				ses->pdcp.hfn_ovd)) {
 		cipherdata.key =
-			(size_t)rte_dpaa_mem_vtop((void *)(size_t)cipherdata.key);
+			(size_t)rte_dpaa_mem_vtop((void *)
+					(size_t)cipherdata.key);
 		cipherdata.key_type = RTA_DATA_PTR;
 	}
-	if (!(cdb->sh_desc[2] & (1 << 1)) &&  authdata.keylen) {
-		authdata.key =
-			(size_t)rte_dpaa_mem_vtop((void *)(size_t)authdata.key);
-		authdata.key_type = RTA_DATA_PTR;
-	}
-
-	cdb->sh_desc[0] = 0;
-	cdb->sh_desc[1] = 0;
-	cdb->sh_desc[2] = 0;
 
 	if (ses->pdcp.domain == RTE_SECURITY_PDCP_MODE_CONTROL) {
 		if (ses->dir == DIR_ENC)
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:52.244900566 +0100
+++ 0096-crypto-dpaax_sec-fix-18-bit-PDCP-cases-with-HFN-over.patch	2020-07-24 12:53:48.331007279 +0100
@@ -1,8 +1,10 @@
-From f6ab96f13d7a23b39fb5135b64ed8e99c425c7a9 Mon Sep 17 00:00:00 2001
+From a0ba121fcbf194c0a17c8db2508b75677dc3f769 Mon Sep 17 00:00:00 2001
 From: Akhil Goyal <akhil.goyal@nxp.com>
 Date: Mon, 1 Jun 2020 22:47:45 +0530
 Subject: [PATCH] crypto/dpaax_sec: fix 18-bit PDCP cases with HFN override
 
+[ upstream commit f6ab96f13d7a23b39fb5135b64ed8e99c425c7a9 ]
+
 In case of RTA_SEC_ERA = 8, where the length of shared desc
 is large for some of PDCP cases, the descriptor buffer cannot
 hold 2 extra words when HFN override is enabled. As a result,
@@ -12,7 +14,6 @@
 reference key hence reducing the length of the descriptor.
 
 Fixes: 2e4cbdb4b2c2 ("crypto/dpaax_sec: support PDCP U-Plane with integrity")
-Cc: stable@dpdk.org
 
 Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
 Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
@@ -78,10 +79,10 @@
   * Function for appending the portion of a PDCP Control Plane shared descriptor
   * which performs NULL encryption and integrity (i.e. copies the input frame
 diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
-index 12f833136..60fdced78 100644
+index 6ed2701ab..434310cfd 100644
 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
 +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
-@@ -3154,6 +3154,14 @@ dpaa2_sec_set_pdcp_session(struct rte_cryptodev *dev,
+@@ -3145,6 +3145,14 @@ dpaa2_sec_set_pdcp_session(struct rte_cryptodev *dev,
  		goto out;
  	}
  
@@ -97,10 +98,10 @@
  		if (session->dir == DIR_ENC)
  			bufsize = cnstr_shdsc_pdcp_c_plane_encap(
 diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
-index d9fa8bb36..01e79c8ea 100644
+index df684d265..4442469e2 100644
 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c
 +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
-@@ -240,7 +240,6 @@ dpaa_sec_prep_pdcp_cdb(dpaa_sec_session *ses)
+@@ -237,7 +237,6 @@ dpaa_sec_prep_pdcp_cdb(dpaa_sec_session *ses)
  	struct sec_cdb *cdb = &ses->cdb;
  	struct alginfo *p_authdata = NULL;
  	int32_t shared_desc_len = 0;
@@ -108,7 +109,7 @@
  #if RTE_BYTE_ORDER == RTE_BIG_ENDIAN
  	int swap = false;
  #else
-@@ -254,10 +253,6 @@ dpaa_sec_prep_pdcp_cdb(dpaa_sec_session *ses)
+@@ -251,10 +250,6 @@ dpaa_sec_prep_pdcp_cdb(dpaa_sec_session *ses)
  	cipherdata.algtype = ses->cipher_key.alg;
  	cipherdata.algmode = ses->cipher_key.algmode;
  
@@ -119,7 +120,7 @@
  	if (ses->auth_alg) {
  		authdata.key = (size_t)ses->auth_key.data;
  		authdata.keylen = ses->auth_key.length;
-@@ -267,33 +262,17 @@ dpaa_sec_prep_pdcp_cdb(dpaa_sec_session *ses)
+@@ -264,33 +259,17 @@ dpaa_sec_prep_pdcp_cdb(dpaa_sec_session *ses)
  		authdata.algmode = ses->auth_key.algmode;
  
  		p_authdata = &authdata;

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

* [dpdk-stable] patch 'crypto/dpaax_sec: fix inline query for descriptors' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (94 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'crypto/dpaax_sec: fix 18-bit PDCP cases with HFN override' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'crypto/dpaa2_sec: fix HFN override' " luca.boccassi
                   ` (95 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Akhil Goyal; +Cc: Hemant Agrawal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 9b5cf4fecdee61d25ba9cc32d880d117b6f66c89 Mon Sep 17 00:00:00 2001
From: Akhil Goyal <akhil.goyal@nxp.com>
Date: Fri, 5 Jun 2020 01:34:10 +0530
Subject: [PATCH] crypto/dpaax_sec: fix inline query for descriptors

[ upstream commit 453b9593a3cfe62ce1f64c65382090ec8adb3ec0 ]

The maximum length of job descriptor which is formed
is 13 words and hence rta_inline_query should take
care of the max descriptor(shared + job) lengths and
thus find out of the key can be referenced or immediate.

Fixes: 05b12700cd4c ("crypto/dpaa_sec: support null algos for protocol offload")
Fixes: 13273250eec5 ("crypto/dpaa2_sec: support AES-GCM and CTR")

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/common/dpaax/caamflib/desc.h        | 2 +-
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 4 ++--
 drivers/crypto/dpaa_sec/dpaa_sec.c          | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/common/dpaax/caamflib/desc.h b/drivers/common/dpaax/caamflib/desc.h
index e4139aaa9..635d6bad0 100644
--- a/drivers/common/dpaax/caamflib/desc.h
+++ b/drivers/common/dpaax/caamflib/desc.h
@@ -26,7 +26,7 @@ extern enum rta_sec_era rta_sec_era;
 #define CAAM_CMD_SZ sizeof(uint32_t)
 #define CAAM_PTR_SZ sizeof(dma_addr_t)
 #define CAAM_DESC_BYTES_MAX (CAAM_CMD_SZ * MAX_CAAM_DESCSIZE)
-#define DESC_JOB_IO_LEN (CAAM_CMD_SZ * 5 + CAAM_PTR_SZ * 3)
+#define DESC_JOB_IO_LEN (CAAM_CMD_SZ * 7 + CAAM_PTR_SZ * 3)
 
 /* Block size of any entity covered/uncovered with a KEK/TKEK */
 #define KEK_BLOCKSIZE		16
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index 434310cfd..9f8399e2b 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -2192,7 +2192,7 @@ dpaa2_sec_aead_init(struct rte_cryptodev *dev,
 
 	priv->flc_desc[0].desc[0] = aeaddata.keylen;
 	err = rta_inline_query(IPSEC_AUTH_VAR_AES_DEC_BASE_DESC_LEN,
-			       MIN_JOB_DESC_SIZE,
+			       DESC_JOB_IO_LEN,
 			       (unsigned int *)priv->flc_desc[0].desc,
 			       &priv->flc_desc[0].desc[1], 1);
 
@@ -2410,7 +2410,7 @@ dpaa2_sec_aead_chain_init(struct rte_cryptodev *dev,
 	priv->flc_desc[0].desc[0] = cipherdata.keylen;
 	priv->flc_desc[0].desc[1] = authdata.keylen;
 	err = rta_inline_query(IPSEC_AUTH_VAR_AES_DEC_BASE_DESC_LEN,
-			       MIN_JOB_DESC_SIZE,
+			       DESC_JOB_IO_LEN,
 			       (unsigned int *)priv->flc_desc[0].desc,
 			       &priv->flc_desc[0].desc[2], 2);
 
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index 4442469e2..35f1feac4 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -348,7 +348,7 @@ dpaa_sec_prep_ipsec_cdb(dpaa_sec_session *ses)
 	cdb->sh_desc[0] = cipherdata.keylen;
 	cdb->sh_desc[1] = authdata.keylen;
 	err = rta_inline_query(IPSEC_AUTH_VAR_AES_DEC_BASE_DESC_LEN,
-			       MIN_JOB_DESC_SIZE,
+			       DESC_JOB_IO_LEN,
 			       (unsigned int *)cdb->sh_desc,
 			       &cdb->sh_desc[2], 2);
 
@@ -534,7 +534,7 @@ dpaa_sec_prep_cdb(dpaa_sec_session *ses)
 		cdb->sh_desc[0] = alginfo_c.keylen;
 		cdb->sh_desc[1] = alginfo_a.keylen;
 		err = rta_inline_query(IPSEC_AUTH_VAR_AES_DEC_BASE_DESC_LEN,
-				       MIN_JOB_DESC_SIZE,
+				       DESC_JOB_IO_LEN,
 				       (unsigned int *)cdb->sh_desc,
 				       &cdb->sh_desc[2], 2);
 
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:52.287828866 +0100
+++ 0097-crypto-dpaax_sec-fix-inline-query-for-descriptors.patch	2020-07-24 12:53:48.339007429 +0100
@@ -1,8 +1,10 @@
-From 453b9593a3cfe62ce1f64c65382090ec8adb3ec0 Mon Sep 17 00:00:00 2001
+From 9b5cf4fecdee61d25ba9cc32d880d117b6f66c89 Mon Sep 17 00:00:00 2001
 From: Akhil Goyal <akhil.goyal@nxp.com>
 Date: Fri, 5 Jun 2020 01:34:10 +0530
 Subject: [PATCH] crypto/dpaax_sec: fix inline query for descriptors
 
+[ upstream commit 453b9593a3cfe62ce1f64c65382090ec8adb3ec0 ]
+
 The maximum length of job descriptor which is formed
 is 13 words and hence rta_inline_query should take
 care of the max descriptor(shared + job) lengths and
@@ -10,7 +12,6 @@
 
 Fixes: 05b12700cd4c ("crypto/dpaa_sec: support null algos for protocol offload")
 Fixes: 13273250eec5 ("crypto/dpaa2_sec: support AES-GCM and CTR")
-Cc: stable@dpdk.org
 
 Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
 Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
@@ -34,7 +35,7 @@
  /* Block size of any entity covered/uncovered with a KEK/TKEK */
  #define KEK_BLOCKSIZE		16
 diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
-index 60fdced78..c56fb2152 100644
+index 434310cfd..9f8399e2b 100644
 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
 +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
 @@ -2192,7 +2192,7 @@ dpaa2_sec_aead_init(struct rte_cryptodev *dev,
@@ -46,7 +47,7 @@
  			       (unsigned int *)priv->flc_desc[0].desc,
  			       &priv->flc_desc[0].desc[1], 1);
  
-@@ -2416,7 +2416,7 @@ dpaa2_sec_aead_chain_init(struct rte_cryptodev *dev,
+@@ -2410,7 +2410,7 @@ dpaa2_sec_aead_chain_init(struct rte_cryptodev *dev,
  	priv->flc_desc[0].desc[0] = cipherdata.keylen;
  	priv->flc_desc[0].desc[1] = authdata.keylen;
  	err = rta_inline_query(IPSEC_AUTH_VAR_AES_DEC_BASE_DESC_LEN,
@@ -56,10 +57,10 @@
  			       &priv->flc_desc[0].desc[2], 2);
  
 diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
-index 01e79c8ea..5ce7e3582 100644
+index 4442469e2..35f1feac4 100644
 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c
 +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
-@@ -351,7 +351,7 @@ dpaa_sec_prep_ipsec_cdb(dpaa_sec_session *ses)
+@@ -348,7 +348,7 @@ dpaa_sec_prep_ipsec_cdb(dpaa_sec_session *ses)
  	cdb->sh_desc[0] = cipherdata.keylen;
  	cdb->sh_desc[1] = authdata.keylen;
  	err = rta_inline_query(IPSEC_AUTH_VAR_AES_DEC_BASE_DESC_LEN,
@@ -68,7 +69,7 @@
  			       (unsigned int *)cdb->sh_desc,
  			       &cdb->sh_desc[2], 2);
  
-@@ -537,7 +537,7 @@ dpaa_sec_prep_cdb(dpaa_sec_session *ses)
+@@ -534,7 +534,7 @@ dpaa_sec_prep_cdb(dpaa_sec_session *ses)
  		cdb->sh_desc[0] = alginfo_c.keylen;
  		cdb->sh_desc[1] = alginfo_a.keylen;
  		err = rta_inline_query(IPSEC_AUTH_VAR_AES_DEC_BASE_DESC_LEN,

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

* [dpdk-stable] patch 'crypto/dpaa2_sec: fix HFN override' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (95 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'crypto/dpaax_sec: fix inline query for descriptors' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'common/dpaax: fix 12-bit null auth case' " luca.boccassi
                   ` (94 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Akhil Goyal; +Cc: Hemant Agrawal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From a11062d5d3a0ead9c215621f5b78d7ca502cf8d8 Mon Sep 17 00:00:00 2001
From: Akhil Goyal <akhil.goyal@nxp.com>
Date: Fri, 14 Feb 2020 15:35:18 +0530
Subject: [PATCH] crypto/dpaa2_sec: fix HFN override

[ upstream commit 91d581dc1b6f5164c63cc7a3f857a1d72b231d47 ]

HFN is set as a uint32_t but the value retrieved is
uint8_t. Fixed the type casting to get the correct value.

Fixes: bef594ec5cc8 ("crypto/dpaa2_sec: support PDCP offload")
Fixes: af61f0750948 ("crypto/dpaa2_sec: support scatter gather for proto offloads")

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index 9f8399e2b..0cc98b3c2 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  *
  *   Copyright (c) 2016 Freescale Semiconductor, Inc. All rights reserved.
- *   Copyright 2016-2019 NXP
+ *   Copyright 2016-2020 NXP
  *
  */
 
@@ -168,7 +168,8 @@ build_proto_compound_sg_fd(dpaa2_sec_session *sess,
 	 * mbuf priv after sym_op.
 	 */
 	if (sess->ctxt_type == DPAA2_SEC_PDCP && sess->pdcp.hfn_ovd) {
-		uint32_t hfn_ovd = *((uint8_t *)op + sess->pdcp.hfn_ovd_offset);
+		uint32_t hfn_ovd = *(uint32_t *)((uint8_t *)op +
+					sess->pdcp.hfn_ovd_offset);
 		/*enable HFN override override */
 		DPAA2_SET_FLE_INTERNAL_JD(ip_fle, hfn_ovd);
 		DPAA2_SET_FLE_INTERNAL_JD(op_fle, hfn_ovd);
@@ -243,7 +244,8 @@ build_proto_compound_fd(dpaa2_sec_session *sess,
 	 * mbuf priv after sym_op.
 	 */
 	if (sess->ctxt_type == DPAA2_SEC_PDCP && sess->pdcp.hfn_ovd) {
-		uint32_t hfn_ovd = *((uint8_t *)op + sess->pdcp.hfn_ovd_offset);
+		uint32_t hfn_ovd = *(uint32_t *)((uint8_t *)op +
+					sess->pdcp.hfn_ovd_offset);
 		/*enable HFN override override */
 		DPAA2_SET_FLE_INTERNAL_JD(ip_fle, hfn_ovd);
 		DPAA2_SET_FLE_INTERNAL_JD(op_fle, hfn_ovd);
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:52.332640773 +0100
+++ 0098-crypto-dpaa2_sec-fix-HFN-override.patch	2020-07-24 12:53:48.339007429 +0100
@@ -1,14 +1,15 @@
-From 91d581dc1b6f5164c63cc7a3f857a1d72b231d47 Mon Sep 17 00:00:00 2001
+From a11062d5d3a0ead9c215621f5b78d7ca502cf8d8 Mon Sep 17 00:00:00 2001
 From: Akhil Goyal <akhil.goyal@nxp.com>
 Date: Fri, 14 Feb 2020 15:35:18 +0530
 Subject: [PATCH] crypto/dpaa2_sec: fix HFN override
 
+[ upstream commit 91d581dc1b6f5164c63cc7a3f857a1d72b231d47 ]
+
 HFN is set as a uint32_t but the value retrieved is
 uint8_t. Fixed the type casting to get the correct value.
 
 Fixes: bef594ec5cc8 ("crypto/dpaa2_sec: support PDCP offload")
 Fixes: af61f0750948 ("crypto/dpaa2_sec: support scatter gather for proto offloads")
-Cc: stable@dpdk.org
 
 Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
 Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
@@ -17,7 +18,7 @@
  1 file changed, 5 insertions(+), 3 deletions(-)
 
 diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
-index c56fb2152..109e61ae1 100644
+index 9f8399e2b..0cc98b3c2 100644
 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
 +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
 @@ -1,7 +1,7 @@
@@ -29,7 +30,7 @@
   *
   */
  
-@@ -164,7 +164,8 @@ build_proto_compound_sg_fd(dpaa2_sec_session *sess,
+@@ -168,7 +168,8 @@ build_proto_compound_sg_fd(dpaa2_sec_session *sess,
  	 * mbuf priv after sym_op.
  	 */
  	if (sess->ctxt_type == DPAA2_SEC_PDCP && sess->pdcp.hfn_ovd) {
@@ -39,7 +40,7 @@
  		/*enable HFN override override */
  		DPAA2_SET_FLE_INTERNAL_JD(ip_fle, hfn_ovd);
  		DPAA2_SET_FLE_INTERNAL_JD(op_fle, hfn_ovd);
-@@ -239,7 +240,8 @@ build_proto_compound_fd(dpaa2_sec_session *sess,
+@@ -243,7 +244,8 @@ build_proto_compound_fd(dpaa2_sec_session *sess,
  	 * mbuf priv after sym_op.
  	 */
  	if (sess->ctxt_type == DPAA2_SEC_PDCP && sess->pdcp.hfn_ovd) {

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

* [dpdk-stable] patch 'common/dpaax: fix 12-bit null auth case' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (96 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'crypto/dpaa2_sec: fix HFN override' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'eventdev: fix race condition on timer list counter' " luca.boccassi
                   ` (93 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Akhil Goyal; +Cc: Hemant Agrawal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 8d4e11926d3afc849a98ea2416c7c5d3ed570083 Mon Sep 17 00:00:00 2001
From: Akhil Goyal <akhil.goyal@nxp.com>
Date: Wed, 8 Jan 2020 18:22:31 +0530
Subject: [PATCH] common/dpaax: fix 12-bit null auth case

[ upstream commit b86a32234f67560068f8388077846ac35ca81f17 ]

In cases of NULL auth in PDCP, the descriptors
should be based on ALGORITHM command instead of
PROTOCOL command.
It was done in case of encap, but was missing in
decap.

Fixes: 526cdf60f1e5 ("crypto/dpaa2_sec: update desc for PDCP 18-bit enc-auth")

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/common/dpaax/caamflib/desc/pdcp.h | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/common/dpaax/caamflib/desc/pdcp.h b/drivers/common/dpaax/caamflib/desc/pdcp.h
index 99eb0f71a..476115323 100644
--- a/drivers/common/dpaax/caamflib/desc/pdcp.h
+++ b/drivers/common/dpaax/caamflib/desc/pdcp.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: BSD-3-Clause or GPL-2.0+
  * Copyright 2008-2013 Freescale Semiconductor, Inc.
- * Copyright 2019 NXP
+ * Copyright 2019-2020 NXP
  */
 
 #ifndef __DESC_PDCP_H__
@@ -3528,6 +3528,15 @@ cnstr_shdsc_pdcp_u_plane_decap(uint32_t *descbuf,
 				KEY(p, KEY2, authdata->key_enc_flags,
 				    (uint64_t)authdata->key, authdata->keylen,
 				    INLINE_KEY(authdata));
+			else if (authdata && authdata->algtype == 0) {
+				err = pdcp_insert_uplane_with_int_op(p, swap,
+						cipherdata, authdata,
+						sn_size, era_2_sw_hfn_ovrd,
+						OP_TYPE_DECAP_PROTOCOL);
+				if (err)
+					return err;
+				break;
+			}
 
 			/* Insert Cipher Key */
 			KEY(p, KEY1, cipherdata->key_enc_flags,
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:52.369976559 +0100
+++ 0099-common-dpaax-fix-12-bit-null-auth-case.patch	2020-07-24 12:53:48.343007503 +0100
@@ -1,8 +1,10 @@
-From b86a32234f67560068f8388077846ac35ca81f17 Mon Sep 17 00:00:00 2001
+From 8d4e11926d3afc849a98ea2416c7c5d3ed570083 Mon Sep 17 00:00:00 2001
 From: Akhil Goyal <akhil.goyal@nxp.com>
 Date: Wed, 8 Jan 2020 18:22:31 +0530
 Subject: [PATCH] common/dpaax: fix 12-bit null auth case
 
+[ upstream commit b86a32234f67560068f8388077846ac35ca81f17 ]
+
 In cases of NULL auth in PDCP, the descriptors
 should be based on ALGORITHM command instead of
 PROTOCOL command.
@@ -10,7 +12,6 @@
 decap.
 
 Fixes: 526cdf60f1e5 ("crypto/dpaa2_sec: update desc for PDCP 18-bit enc-auth")
-Cc: stable@dpdk.org
 
 Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
 Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>

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

* [dpdk-stable] patch 'eventdev: fix race condition on timer list counter' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (97 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'common/dpaax: fix 12-bit null auth case' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:58 ` [dpdk-stable] patch 'eventdev: use C11 atomics for lcore timer armed flag' " luca.boccassi
                   ` (92 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Phil Yang
  Cc: Dharmik Thakkar, Ruifeng Wang, Erik Gabriel Carrillo, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From b01bf3ceeeb3bfe4c1146cb58f92362f279f11f6 Mon Sep 17 00:00:00 2001
From: Phil Yang <phil.yang@arm.com>
Date: Tue, 7 Jul 2020 23:54:50 +0800
Subject: [PATCH] eventdev: fix race condition on timer list counter

[ upstream commit aceb737d6f3210556a139514d304bf8f315a043f ]

The n_poll_lcores counter and poll_lcore array are shared between lcores
and the update of these variables are out of the protection of spinlock
on each lcore timer list. The read-modify-write operations of the counter
are not atomic, so it has the potential of race condition between lcores.

Use c11 atomics with RELAXED ordering to prevent confliction.

Fixes: cc7b73ea9e3b ("eventdev: add new software timer adapter")

Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
---
 lib/librte_eventdev/rte_event_timer_adapter.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/lib/librte_eventdev/rte_event_timer_adapter.c b/lib/librte_eventdev/rte_event_timer_adapter.c
index 161e21a68..76885972e 100644
--- a/lib/librte_eventdev/rte_event_timer_adapter.c
+++ b/lib/librte_eventdev/rte_event_timer_adapter.c
@@ -579,6 +579,7 @@ swtim_callback(struct rte_timer *tim)
 	uint16_t nb_evs_invalid = 0;
 	uint64_t opaque;
 	int ret;
+	int n_lcores;
 
 	opaque = evtim->impl_opaque[1];
 	adapter = (struct rte_event_timer_adapter *)(uintptr_t)opaque;
@@ -601,8 +602,12 @@ swtim_callback(struct rte_timer *tim)
 				      "with immediate expiry value");
 		}
 
-		if (unlikely(rte_atomic16_test_and_set(&sw->in_use[lcore].v)))
-			sw->poll_lcores[sw->n_poll_lcores++] = lcore;
+		if (unlikely(rte_atomic16_test_and_set(&sw->in_use[lcore].v))) {
+			n_lcores = __atomic_fetch_add(&sw->n_poll_lcores, 1,
+						     __ATOMIC_RELAXED);
+			__atomic_store_n(&sw->poll_lcores[n_lcores], lcore,
+					__ATOMIC_RELAXED);
+		}
 	} else {
 		EVTIM_BUF_LOG_DBG("buffered an event timer expiry event");
 
@@ -1007,6 +1012,7 @@ __swtim_arm_burst(const struct rte_event_timer_adapter *adapter,
 	uint32_t lcore_id = rte_lcore_id();
 	struct rte_timer *tim, *tims[nb_evtims];
 	uint64_t cycles;
+	int n_lcores;
 
 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
 	/* Check that the service is running. */
@@ -1029,8 +1035,10 @@ __swtim_arm_burst(const struct rte_event_timer_adapter *adapter,
 	if (unlikely(rte_atomic16_test_and_set(&sw->in_use[lcore_id].v))) {
 		EVTIM_LOG_DBG("Adding lcore id = %u to list of lcores to poll",
 			      lcore_id);
-		sw->poll_lcores[sw->n_poll_lcores] = lcore_id;
-		++sw->n_poll_lcores;
+		n_lcores = __atomic_fetch_add(&sw->n_poll_lcores, 1,
+					     __ATOMIC_RELAXED);
+		__atomic_store_n(&sw->poll_lcores[n_lcores], lcore_id,
+				__ATOMIC_RELAXED);
 	}
 
 	ret = rte_mempool_get_bulk(sw->tim_pool, (void **)tims,
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:52.411591249 +0100
+++ 0100-eventdev-fix-race-condition-on-timer-list-counter.patch	2020-07-24 12:53:48.343007503 +0100
@@ -1,8 +1,10 @@
-From aceb737d6f3210556a139514d304bf8f315a043f Mon Sep 17 00:00:00 2001
+From b01bf3ceeeb3bfe4c1146cb58f92362f279f11f6 Mon Sep 17 00:00:00 2001
 From: Phil Yang <phil.yang@arm.com>
 Date: Tue, 7 Jul 2020 23:54:50 +0800
 Subject: [PATCH] eventdev: fix race condition on timer list counter
 
+[ upstream commit aceb737d6f3210556a139514d304bf8f315a043f ]
+
 The n_poll_lcores counter and poll_lcore array are shared between lcores
 and the update of these variables are out of the protection of spinlock
 on each lcore timer list. The read-modify-write operations of the counter
@@ -11,7 +13,6 @@
 Use c11 atomics with RELAXED ordering to prevent confliction.
 
 Fixes: cc7b73ea9e3b ("eventdev: add new software timer adapter")
-Cc: stable@dpdk.org
 
 Signed-off-by: Phil Yang <phil.yang@arm.com>
 Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
@@ -22,10 +23,10 @@
  1 file changed, 12 insertions(+), 4 deletions(-)
 
 diff --git a/lib/librte_eventdev/rte_event_timer_adapter.c b/lib/librte_eventdev/rte_event_timer_adapter.c
-index 232180326..370ea40a7 100644
+index 161e21a68..76885972e 100644
 --- a/lib/librte_eventdev/rte_event_timer_adapter.c
 +++ b/lib/librte_eventdev/rte_event_timer_adapter.c
-@@ -583,6 +583,7 @@ swtim_callback(struct rte_timer *tim)
+@@ -579,6 +579,7 @@ swtim_callback(struct rte_timer *tim)
  	uint16_t nb_evs_invalid = 0;
  	uint64_t opaque;
  	int ret;
@@ -33,7 +34,7 @@
  
  	opaque = evtim->impl_opaque[1];
  	adapter = (struct rte_event_timer_adapter *)(uintptr_t)opaque;
-@@ -605,8 +606,12 @@ swtim_callback(struct rte_timer *tim)
+@@ -601,8 +602,12 @@ swtim_callback(struct rte_timer *tim)
  				      "with immediate expiry value");
  		}
  
@@ -48,7 +49,7 @@
  	} else {
  		EVTIM_BUF_LOG_DBG("buffered an event timer expiry event");
  
-@@ -1011,6 +1016,7 @@ __swtim_arm_burst(const struct rte_event_timer_adapter *adapter,
+@@ -1007,6 +1012,7 @@ __swtim_arm_burst(const struct rte_event_timer_adapter *adapter,
  	uint32_t lcore_id = rte_lcore_id();
  	struct rte_timer *tim, *tims[nb_evtims];
  	uint64_t cycles;
@@ -56,7 +57,7 @@
  
  #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
  	/* Check that the service is running. */
-@@ -1033,8 +1039,10 @@ __swtim_arm_burst(const struct rte_event_timer_adapter *adapter,
+@@ -1029,8 +1035,10 @@ __swtim_arm_burst(const struct rte_event_timer_adapter *adapter,
  	if (unlikely(rte_atomic16_test_and_set(&sw->in_use[lcore_id].v))) {
  		EVTIM_LOG_DBG("Adding lcore id = %u to list of lcores to poll",
  			      lcore_id);

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

* [dpdk-stable] patch 'eventdev: use C11 atomics for lcore timer armed flag' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (98 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'eventdev: fix race condition on timer list counter' " luca.boccassi
@ 2020-07-24 11:58 ` " luca.boccassi
  2020-07-24 11:59 ` [dpdk-stable] patch 'eventdev: remove redundant reset on timer cancel' " luca.boccassi
                   ` (91 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:58 UTC (permalink / raw)
  To: Phil Yang
  Cc: Dharmik Thakkar, Ruifeng Wang, Erik Gabriel Carrillo, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 3939291be17174407903296e4f47986515e3e9fc Mon Sep 17 00:00:00 2001
From: Phil Yang <phil.yang@arm.com>
Date: Tue, 7 Jul 2020 23:54:51 +0800
Subject: [PATCH] eventdev: use C11 atomics for lcore timer armed flag

[ upstream commit 1028d63eb214c5961b2df9d4b5662dab082b839e ]

The in_use flag is a per core variable which is not shared between
lcores in the normal case and the access of this variable should be
ordered on the same core. However, if non-EAL thread pick the highest
lcore to insert timers into, there is the possibility of conflicts
on this flag between threads. Then the atomic compare-and-swap
operation is needed.

Use the C11 atomics instead of the generic rte_atomic operations to
avoid the unnecessary barrier on aarch64.

Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
---
 lib/librte_eventdev/rte_event_timer_adapter.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/lib/librte_eventdev/rte_event_timer_adapter.c b/lib/librte_eventdev/rte_event_timer_adapter.c
index 76885972e..678be9f0a 100644
--- a/lib/librte_eventdev/rte_event_timer_adapter.c
+++ b/lib/librte_eventdev/rte_event_timer_adapter.c
@@ -550,7 +550,7 @@ struct swtim {
 	uint32_t timer_data_id;
 	/* Track which cores have actually armed a timer */
 	struct {
-		rte_atomic16_t v;
+		uint16_t v;
 	} __rte_cache_aligned in_use[RTE_MAX_LCORE];
 	/* Track which cores' timer lists should be polled */
 	unsigned int poll_lcores[RTE_MAX_LCORE];
@@ -602,7 +602,8 @@ swtim_callback(struct rte_timer *tim)
 				      "with immediate expiry value");
 		}
 
-		if (unlikely(rte_atomic16_test_and_set(&sw->in_use[lcore].v))) {
+		if (unlikely(sw->in_use[lcore].v == 0)) {
+			sw->in_use[lcore].v = 1;
 			n_lcores = __atomic_fetch_add(&sw->n_poll_lcores, 1,
 						     __ATOMIC_RELAXED);
 			__atomic_store_n(&sw->poll_lcores[n_lcores], lcore,
@@ -830,7 +831,7 @@ swtim_init(struct rte_event_timer_adapter *adapter)
 
 	/* Initialize the variables that track in-use timer lists */
 	for (i = 0; i < RTE_MAX_LCORE; i++)
-		rte_atomic16_init(&sw->in_use[i].v);
+		sw->in_use[i].v = 0;
 
 	/* Initialize the timer subsystem and allocate timer data instance */
 	ret = rte_timer_subsystem_init();
@@ -1013,6 +1014,8 @@ __swtim_arm_burst(const struct rte_event_timer_adapter *adapter,
 	struct rte_timer *tim, *tims[nb_evtims];
 	uint64_t cycles;
 	int n_lcores;
+	/* Timer list for this lcore is not in use. */
+	uint16_t exp_state = 0;
 
 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
 	/* Check that the service is running. */
@@ -1031,8 +1034,12 @@ __swtim_arm_burst(const struct rte_event_timer_adapter *adapter,
 	/* If this is the first time we're arming an event timer on this lcore,
 	 * mark this lcore as "in use"; this will cause the service
 	 * function to process the timer list that corresponds to this lcore.
+	 * The atomic compare-and-swap operation can prevent the race condition
+	 * on in_use flag between multiple non-EAL threads.
 	 */
-	if (unlikely(rte_atomic16_test_and_set(&sw->in_use[lcore_id].v))) {
+	if (unlikely(__atomic_compare_exchange_n(&sw->in_use[lcore_id].v,
+			&exp_state, 1, 0,
+			__ATOMIC_RELAXED, __ATOMIC_RELAXED))) {
 		EVTIM_LOG_DBG("Adding lcore id = %u to list of lcores to poll",
 			      lcore_id);
 		n_lcores = __atomic_fetch_add(&sw->n_poll_lcores, 1,
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:52.442169935 +0100
+++ 0101-eventdev-use-C11-atomics-for-lcore-timer-armed-flag.patch	2020-07-24 12:53:48.343007503 +0100
@@ -1,8 +1,10 @@
-From 1028d63eb214c5961b2df9d4b5662dab082b839e Mon Sep 17 00:00:00 2001
+From 3939291be17174407903296e4f47986515e3e9fc Mon Sep 17 00:00:00 2001
 From: Phil Yang <phil.yang@arm.com>
 Date: Tue, 7 Jul 2020 23:54:51 +0800
 Subject: [PATCH] eventdev: use C11 atomics for lcore timer armed flag
 
+[ upstream commit 1028d63eb214c5961b2df9d4b5662dab082b839e ]
+
 The in_use flag is a per core variable which is not shared between
 lcores in the normal case and the access of this variable should be
 ordered on the same core. However, if non-EAL thread pick the highest
@@ -13,8 +15,6 @@
 Use the C11 atomics instead of the generic rte_atomic operations to
 avoid the unnecessary barrier on aarch64.
 
-Cc: stable@dpdk.org
-
 Signed-off-by: Phil Yang <phil.yang@arm.com>
 Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
 Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
@@ -24,10 +24,10 @@
  1 file changed, 11 insertions(+), 4 deletions(-)
 
 diff --git a/lib/librte_eventdev/rte_event_timer_adapter.c b/lib/librte_eventdev/rte_event_timer_adapter.c
-index 370ea40a7..4ed301382 100644
+index 76885972e..678be9f0a 100644
 --- a/lib/librte_eventdev/rte_event_timer_adapter.c
 +++ b/lib/librte_eventdev/rte_event_timer_adapter.c
-@@ -554,7 +554,7 @@ struct swtim {
+@@ -550,7 +550,7 @@ struct swtim {
  	uint32_t timer_data_id;
  	/* Track which cores have actually armed a timer */
  	struct {
@@ -36,7 +36,7 @@
  	} __rte_cache_aligned in_use[RTE_MAX_LCORE];
  	/* Track which cores' timer lists should be polled */
  	unsigned int poll_lcores[RTE_MAX_LCORE];
-@@ -606,7 +606,8 @@ swtim_callback(struct rte_timer *tim)
+@@ -602,7 +602,8 @@ swtim_callback(struct rte_timer *tim)
  				      "with immediate expiry value");
  		}
  
@@ -46,7 +46,7 @@
  			n_lcores = __atomic_fetch_add(&sw->n_poll_lcores, 1,
  						     __ATOMIC_RELAXED);
  			__atomic_store_n(&sw->poll_lcores[n_lcores], lcore,
-@@ -834,7 +835,7 @@ swtim_init(struct rte_event_timer_adapter *adapter)
+@@ -830,7 +831,7 @@ swtim_init(struct rte_event_timer_adapter *adapter)
  
  	/* Initialize the variables that track in-use timer lists */
  	for (i = 0; i < RTE_MAX_LCORE; i++)
@@ -55,7 +55,7 @@
  
  	/* Initialize the timer subsystem and allocate timer data instance */
  	ret = rte_timer_subsystem_init();
-@@ -1017,6 +1018,8 @@ __swtim_arm_burst(const struct rte_event_timer_adapter *adapter,
+@@ -1013,6 +1014,8 @@ __swtim_arm_burst(const struct rte_event_timer_adapter *adapter,
  	struct rte_timer *tim, *tims[nb_evtims];
  	uint64_t cycles;
  	int n_lcores;
@@ -64,7 +64,7 @@
  
  #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
  	/* Check that the service is running. */
-@@ -1035,8 +1038,12 @@ __swtim_arm_burst(const struct rte_event_timer_adapter *adapter,
+@@ -1031,8 +1034,12 @@ __swtim_arm_burst(const struct rte_event_timer_adapter *adapter,
  	/* If this is the first time we're arming an event timer on this lcore,
  	 * mark this lcore as "in use"; this will cause the service
  	 * function to process the timer list that corresponds to this lcore.

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

* [dpdk-stable] patch 'eventdev: remove redundant reset on timer cancel' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (99 preceding siblings ...)
  2020-07-24 11:58 ` [dpdk-stable] patch 'eventdev: use C11 atomics for lcore timer armed flag' " luca.boccassi
@ 2020-07-24 11:59 ` " luca.boccassi
  2020-07-24 11:59 ` [dpdk-stable] patch 'eventdev: relax SMP barriers with C11 atomics' " luca.boccassi
                   ` (90 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:59 UTC (permalink / raw)
  To: Phil Yang; +Cc: Dharmik Thakkar, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From d79a74d9bfe61030fbe46546f575d5028a839739 Mon Sep 17 00:00:00 2001
From: Phil Yang <phil.yang@arm.com>
Date: Tue, 7 Jul 2020 23:54:52 +0800
Subject: [PATCH] eventdev: remove redundant reset on timer cancel

[ upstream commit e84d9c62c671a502022a3a81358cac702d6f3a15 ]

There is no thread will access these impl_opaque data after timer
canceled. When new timer armed, it got refilled. So the cleanup
process is unnecessary.

Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
---
 lib/librte_eventdev/rte_event_timer_adapter.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/lib/librte_eventdev/rte_event_timer_adapter.c b/lib/librte_eventdev/rte_event_timer_adapter.c
index 678be9f0a..af5087132 100644
--- a/lib/librte_eventdev/rte_event_timer_adapter.c
+++ b/lib/librte_eventdev/rte_event_timer_adapter.c
@@ -1163,8 +1163,6 @@ swtim_cancel_burst(const struct rte_event_timer_adapter *adapter,
 		rte_mempool_put(sw->tim_pool, (void **)timp);
 
 		evtims[i]->state = RTE_EVENT_TIMER_CANCELED;
-		evtims[i]->impl_opaque[0] = 0;
-		evtims[i]->impl_opaque[1] = 0;
 
 		rte_smp_wmb();
 	}
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:52.480892713 +0100
+++ 0102-eventdev-remove-redundant-reset-on-timer-cancel.patch	2020-07-24 12:53:48.347007578 +0100
@@ -1,14 +1,14 @@
-From e84d9c62c671a502022a3a81358cac702d6f3a15 Mon Sep 17 00:00:00 2001
+From d79a74d9bfe61030fbe46546f575d5028a839739 Mon Sep 17 00:00:00 2001
 From: Phil Yang <phil.yang@arm.com>
 Date: Tue, 7 Jul 2020 23:54:52 +0800
 Subject: [PATCH] eventdev: remove redundant reset on timer cancel
 
+[ upstream commit e84d9c62c671a502022a3a81358cac702d6f3a15 ]
+
 There is no thread will access these impl_opaque data after timer
 canceled. When new timer armed, it got refilled. So the cleanup
 process is unnecessary.
 
-Cc: stable@dpdk.org
-
 Signed-off-by: Phil Yang <phil.yang@arm.com>
 Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
 ---
@@ -16,10 +16,10 @@
  1 file changed, 2 deletions(-)
 
 diff --git a/lib/librte_eventdev/rte_event_timer_adapter.c b/lib/librte_eventdev/rte_event_timer_adapter.c
-index 4ed301382..aa01b4d9f 100644
+index 678be9f0a..af5087132 100644
 --- a/lib/librte_eventdev/rte_event_timer_adapter.c
 +++ b/lib/librte_eventdev/rte_event_timer_adapter.c
-@@ -1167,8 +1167,6 @@ swtim_cancel_burst(const struct rte_event_timer_adapter *adapter,
+@@ -1163,8 +1163,6 @@ swtim_cancel_burst(const struct rte_event_timer_adapter *adapter,
  		rte_mempool_put(sw->tim_pool, (void **)timp);
  
  		evtims[i]->state = RTE_EVENT_TIMER_CANCELED;

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

* [dpdk-stable] patch 'eventdev: relax SMP barriers with C11 atomics' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (100 preceding siblings ...)
  2020-07-24 11:59 ` [dpdk-stable] patch 'eventdev: remove redundant reset on timer cancel' " luca.boccassi
@ 2020-07-24 11:59 ` " luca.boccassi
  2020-07-24 11:59 ` [dpdk-stable] patch 'service: fix core mapping reset' " luca.boccassi
                   ` (89 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:59 UTC (permalink / raw)
  To: Phil Yang
  Cc: Dharmik Thakkar, Ruifeng Wang, Erik Gabriel Carrillo, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 0a4303995ca42e53c942a6f79a4850f7e8df429b Mon Sep 17 00:00:00 2001
From: Phil Yang <phil.yang@arm.com>
Date: Tue, 7 Jul 2020 23:54:53 +0800
Subject: [PATCH] eventdev: relax SMP barriers with C11 atomics

[ upstream commit 030c2164117b87b7e81d06be9c228b555b00963e ]

The impl_opaque field is shared between the timer arm and cancel
operations. Meanwhile, the state flag acts as a guard variable to
make sure the update of impl_opaque is synchronized. The original
code uses rte_smp barriers to achieve that. This patch uses C11
atomics with an explicit one-way memory barrier instead of full
barriers rte_smp_w/rmb() to avoid the unnecessary barrier on aarch64.

Since compilers can generate the same instructions for volatile and
non-volatile variable in C11 __atomics built-ins, so remain the volatile
keyword in front of state enum to avoid the ABI break issue.

Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
---
 lib/librte_eventdev/rte_event_timer_adapter.c | 55 +++++++++++++------
 1 file changed, 37 insertions(+), 18 deletions(-)

diff --git a/lib/librte_eventdev/rte_event_timer_adapter.c b/lib/librte_eventdev/rte_event_timer_adapter.c
index af5087132..36c13fe3b 100644
--- a/lib/librte_eventdev/rte_event_timer_adapter.c
+++ b/lib/librte_eventdev/rte_event_timer_adapter.c
@@ -625,7 +625,8 @@ swtim_callback(struct rte_timer *tim)
 		sw->expired_timers[sw->n_expired_timers++] = tim;
 		sw->stats.evtim_exp_count++;
 
-		evtim->state = RTE_EVENT_TIMER_NOT_ARMED;
+		__atomic_store_n(&evtim->state, RTE_EVENT_TIMER_NOT_ARMED,
+				__ATOMIC_RELEASE);
 	}
 
 	if (event_buffer_batch_ready(&sw->buffer)) {
@@ -1016,6 +1017,7 @@ __swtim_arm_burst(const struct rte_event_timer_adapter *adapter,
 	int n_lcores;
 	/* Timer list for this lcore is not in use. */
 	uint16_t exp_state = 0;
+	enum rte_event_timer_state n_state;
 
 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
 	/* Check that the service is running. */
@@ -1056,30 +1058,36 @@ __swtim_arm_burst(const struct rte_event_timer_adapter *adapter,
 	}
 
 	for (i = 0; i < nb_evtims; i++) {
-		/* Don't modify the event timer state in these cases */
-		if (evtims[i]->state == RTE_EVENT_TIMER_ARMED) {
+		n_state = __atomic_load_n(&evtims[i]->state, __ATOMIC_ACQUIRE);
+		if (n_state == RTE_EVENT_TIMER_ARMED) {
 			rte_errno = EALREADY;
 			break;
-		} else if (!(evtims[i]->state == RTE_EVENT_TIMER_NOT_ARMED ||
-			     evtims[i]->state == RTE_EVENT_TIMER_CANCELED)) {
+		} else if (!(n_state == RTE_EVENT_TIMER_NOT_ARMED ||
+			     n_state == RTE_EVENT_TIMER_CANCELED)) {
 			rte_errno = EINVAL;
 			break;
 		}
 
 		ret = check_timeout(evtims[i], adapter);
 		if (unlikely(ret == -1)) {
-			evtims[i]->state = RTE_EVENT_TIMER_ERROR_TOOLATE;
+			__atomic_store_n(&evtims[i]->state,
+					RTE_EVENT_TIMER_ERROR_TOOLATE,
+					__ATOMIC_RELAXED);
 			rte_errno = EINVAL;
 			break;
 		} else if (unlikely(ret == -2)) {
-			evtims[i]->state = RTE_EVENT_TIMER_ERROR_TOOEARLY;
+			__atomic_store_n(&evtims[i]->state,
+					RTE_EVENT_TIMER_ERROR_TOOEARLY,
+					__ATOMIC_RELAXED);
 			rte_errno = EINVAL;
 			break;
 		}
 
 		if (unlikely(check_destination_event_queue(evtims[i],
 							   adapter) < 0)) {
-			evtims[i]->state = RTE_EVENT_TIMER_ERROR;
+			__atomic_store_n(&evtims[i]->state,
+					RTE_EVENT_TIMER_ERROR,
+					__ATOMIC_RELAXED);
 			rte_errno = EINVAL;
 			break;
 		}
@@ -1095,13 +1103,18 @@ __swtim_arm_burst(const struct rte_event_timer_adapter *adapter,
 					  SINGLE, lcore_id, NULL, evtims[i]);
 		if (ret < 0) {
 			/* tim was in RUNNING or CONFIG state */
-			evtims[i]->state = RTE_EVENT_TIMER_ERROR;
+			__atomic_store_n(&evtims[i]->state,
+					RTE_EVENT_TIMER_ERROR,
+					__ATOMIC_RELEASE);
 			break;
 		}
 
-		rte_smp_wmb();
 		EVTIM_LOG_DBG("armed an event timer");
-		evtims[i]->state = RTE_EVENT_TIMER_ARMED;
+		/* RELEASE ordering guarantees the adapter specific value
+		 * changes observed before the update of state.
+		 */
+		__atomic_store_n(&evtims[i]->state, RTE_EVENT_TIMER_ARMED,
+				__ATOMIC_RELEASE);
 	}
 
 	if (i < nb_evtims)
@@ -1128,6 +1141,7 @@ swtim_cancel_burst(const struct rte_event_timer_adapter *adapter,
 	struct rte_timer *timp;
 	uint64_t opaque;
 	struct swtim *sw = swtim_pmd_priv(adapter);
+	enum rte_event_timer_state n_state;
 
 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
 	/* Check that the service is running. */
@@ -1139,16 +1153,18 @@ swtim_cancel_burst(const struct rte_event_timer_adapter *adapter,
 
 	for (i = 0; i < nb_evtims; i++) {
 		/* Don't modify the event timer state in these cases */
-		if (evtims[i]->state == RTE_EVENT_TIMER_CANCELED) {
+		/* ACQUIRE ordering guarantees the access of implementation
+		 * specific opaque data under the correct state.
+		 */
+		n_state = __atomic_load_n(&evtims[i]->state, __ATOMIC_ACQUIRE);
+		if (n_state == RTE_EVENT_TIMER_CANCELED) {
 			rte_errno = EALREADY;
 			break;
-		} else if (evtims[i]->state != RTE_EVENT_TIMER_ARMED) {
+		} else if (n_state != RTE_EVENT_TIMER_ARMED) {
 			rte_errno = EINVAL;
 			break;
 		}
 
-		rte_smp_rmb();
-
 		opaque = evtims[i]->impl_opaque[0];
 		timp = (struct rte_timer *)(uintptr_t)opaque;
 		RTE_ASSERT(timp != NULL);
@@ -1162,9 +1178,12 @@ swtim_cancel_burst(const struct rte_event_timer_adapter *adapter,
 
 		rte_mempool_put(sw->tim_pool, (void **)timp);
 
-		evtims[i]->state = RTE_EVENT_TIMER_CANCELED;
-
-		rte_smp_wmb();
+		/* The RELEASE ordering here pairs with atomic ordering
+		 * to make sure the state update data observed between
+		 * threads.
+		 */
+		__atomic_store_n(&evtims[i]->state, RTE_EVENT_TIMER_CANCELED,
+				__ATOMIC_RELEASE);
 	}
 
 	return i;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:52.515148907 +0100
+++ 0103-eventdev-relax-SMP-barriers-with-C11-atomics.patch	2020-07-24 12:53:48.347007578 +0100
@@ -1,8 +1,10 @@
-From 030c2164117b87b7e81d06be9c228b555b00963e Mon Sep 17 00:00:00 2001
+From 0a4303995ca42e53c942a6f79a4850f7e8df429b Mon Sep 17 00:00:00 2001
 From: Phil Yang <phil.yang@arm.com>
 Date: Tue, 7 Jul 2020 23:54:53 +0800
 Subject: [PATCH] eventdev: relax SMP barriers with C11 atomics
 
+[ upstream commit 030c2164117b87b7e81d06be9c228b555b00963e ]
+
 The impl_opaque field is shared between the timer arm and cancel
 operations. Meanwhile, the state flag acts as a guard variable to
 make sure the update of impl_opaque is synchronized. The original
@@ -14,8 +16,6 @@
 non-volatile variable in C11 __atomics built-ins, so remain the volatile
 keyword in front of state enum to avoid the ABI break issue.
 
-Cc: stable@dpdk.org
-
 Signed-off-by: Phil Yang <phil.yang@arm.com>
 Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
 Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
@@ -25,10 +25,10 @@
  1 file changed, 37 insertions(+), 18 deletions(-)
 
 diff --git a/lib/librte_eventdev/rte_event_timer_adapter.c b/lib/librte_eventdev/rte_event_timer_adapter.c
-index aa01b4d9f..4c5e49ea3 100644
+index af5087132..36c13fe3b 100644
 --- a/lib/librte_eventdev/rte_event_timer_adapter.c
 +++ b/lib/librte_eventdev/rte_event_timer_adapter.c
-@@ -629,7 +629,8 @@ swtim_callback(struct rte_timer *tim)
+@@ -625,7 +625,8 @@ swtim_callback(struct rte_timer *tim)
  		sw->expired_timers[sw->n_expired_timers++] = tim;
  		sw->stats.evtim_exp_count++;
  
@@ -38,7 +38,7 @@
  	}
  
  	if (event_buffer_batch_ready(&sw->buffer)) {
-@@ -1020,6 +1021,7 @@ __swtim_arm_burst(const struct rte_event_timer_adapter *adapter,
+@@ -1016,6 +1017,7 @@ __swtim_arm_burst(const struct rte_event_timer_adapter *adapter,
  	int n_lcores;
  	/* Timer list for this lcore is not in use. */
  	uint16_t exp_state = 0;
@@ -46,7 +46,7 @@
  
  #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
  	/* Check that the service is running. */
-@@ -1060,30 +1062,36 @@ __swtim_arm_burst(const struct rte_event_timer_adapter *adapter,
+@@ -1056,30 +1058,36 @@ __swtim_arm_burst(const struct rte_event_timer_adapter *adapter,
  	}
  
  	for (i = 0; i < nb_evtims; i++) {
@@ -90,7 +90,7 @@
  			rte_errno = EINVAL;
  			break;
  		}
-@@ -1099,13 +1107,18 @@ __swtim_arm_burst(const struct rte_event_timer_adapter *adapter,
+@@ -1095,13 +1103,18 @@ __swtim_arm_burst(const struct rte_event_timer_adapter *adapter,
  					  SINGLE, lcore_id, NULL, evtims[i]);
  		if (ret < 0) {
  			/* tim was in RUNNING or CONFIG state */
@@ -112,7 +112,7 @@
  	}
  
  	if (i < nb_evtims)
-@@ -1132,6 +1145,7 @@ swtim_cancel_burst(const struct rte_event_timer_adapter *adapter,
+@@ -1128,6 +1141,7 @@ swtim_cancel_burst(const struct rte_event_timer_adapter *adapter,
  	struct rte_timer *timp;
  	uint64_t opaque;
  	struct swtim *sw = swtim_pmd_priv(adapter);
@@ -120,7 +120,7 @@
  
  #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
  	/* Check that the service is running. */
-@@ -1143,16 +1157,18 @@ swtim_cancel_burst(const struct rte_event_timer_adapter *adapter,
+@@ -1139,16 +1153,18 @@ swtim_cancel_burst(const struct rte_event_timer_adapter *adapter,
  
  	for (i = 0; i < nb_evtims; i++) {
  		/* Don't modify the event timer state in these cases */
@@ -143,7 +143,7 @@
  		opaque = evtims[i]->impl_opaque[0];
  		timp = (struct rte_timer *)(uintptr_t)opaque;
  		RTE_ASSERT(timp != NULL);
-@@ -1166,9 +1182,12 @@ swtim_cancel_burst(const struct rte_event_timer_adapter *adapter,
+@@ -1162,9 +1178,12 @@ swtim_cancel_burst(const struct rte_event_timer_adapter *adapter,
  
  		rte_mempool_put(sw->tim_pool, (void **)timp);
  

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

* [dpdk-stable] patch 'service: fix core mapping reset' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (101 preceding siblings ...)
  2020-07-24 11:59 ` [dpdk-stable] patch 'eventdev: relax SMP barriers with C11 atomics' " luca.boccassi
@ 2020-07-24 11:59 ` " luca.boccassi
  2020-07-24 11:59 ` [dpdk-stable] patch 'net/ixgbe: report 10Mbps link speed for x553' " luca.boccassi
                   ` (88 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:59 UTC (permalink / raw)
  To: Lukasz Wojciechowski; +Cc: Sarosh Arif, Harry van Haaren, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From cc8b7af31f74854edcb7124f56d976487bab7ed9 Mon Sep 17 00:00:00 2001
From: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Date: Wed, 8 Jul 2020 15:37:33 +0200
Subject: [PATCH] service: fix core mapping reset

[ upstream commit 048db4b6dcccaee9277ce5b4fbb2fe684b212e22 ]

The rte_service_lcore_reset_all function stops execution of services
on all lcores and switches them back from ROLE_SERVICE to ROLE_RTE.
However the thread loop for slave lcores (eal_thread_loop) distincts these
roles to set lcore state after processing delegated function.
It sets WAIT state for ROLE_SERVICE, but FINISHED for ROLE_RTE.
So changing the role to RTE before stopping work in slave lcores
causes lcores to end in FINISHED state. That is why the rte_eal_lcore_wait
must be run after rte_service_lcore_reset_all to bring back lcores to
launchable (WAIT) state.
This has been fixed in test app and clarified in API documentation.

Setting the state to WAIT in rte_service_runner_func is premature
as the rte_service_runner_func function is still a part of the lcore
function delegated to slave lcore. The state is overwritten anyway in
slave lcore thread loop. This premature setting state to WAIT might
however cause rte_eal_lcore_wait, that was called by the application,
to return before slave lcore thread set the FINISHED state. That's
why it is removed from librte_eal rte_service_runner_func function.

Bugzilla ID: 464
Fixes: 21698354c832 ("service: introduce service cores concept")
Fixes: f038a81e1c56 ("service: add unit tests")

Reported-by: Sarosh Arif <sarosh.arif@emumba.com>
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
---
 app/test/test_service_cores.c               | 1 +
 lib/librte_eal/common/include/rte_service.h | 4 ++++
 lib/librte_eal/common/rte_service.c         | 2 --
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/app/test/test_service_cores.c b/app/test/test_service_cores.c
index a922c7ddc..2a4978e29 100644
--- a/app/test/test_service_cores.c
+++ b/app/test/test_service_cores.c
@@ -114,6 +114,7 @@ unregister_all(void)
 	}
 
 	rte_service_lcore_reset_all();
+	rte_eal_mp_wait_lcore();
 
 	return TEST_SUCCESS;
 }
diff --git a/lib/librte_eal/common/include/rte_service.h b/lib/librte_eal/common/include/rte_service.h
index 3a1c735c5..e2d0a6dd3 100644
--- a/lib/librte_eal/common/include/rte_service.h
+++ b/lib/librte_eal/common/include/rte_service.h
@@ -304,6 +304,10 @@ int32_t rte_service_lcore_count(void);
  * from duty, just unmaps all services / cores, and stops() the service cores.
  * The runstate of services is not modified.
  *
+ * The cores that are stopped with this call, are in FINISHED state and
+ * the application must take care of bringing them back to a launchable state:
+ * e.g. call *rte_eal_lcore_wait* on the lcore_id.
+ *
  * @retval 0 Success
  */
 int32_t rte_service_lcore_reset_all(void);
diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c
index eca6ccc59..8fcccac85 100644
--- a/lib/librte_eal/common/rte_service.c
+++ b/lib/librte_eal/common/rte_service.c
@@ -447,8 +447,6 @@ service_runner_func(void *arg)
 		rte_smp_rmb();
 	}
 
-	lcore_config[lcore].state = WAIT;
-
 	return 0;
 }
 
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:52.548982028 +0100
+++ 0104-service-fix-core-mapping-reset.patch	2020-07-24 12:53:48.347007578 +0100
@@ -1,8 +1,10 @@
-From 048db4b6dcccaee9277ce5b4fbb2fe684b212e22 Mon Sep 17 00:00:00 2001
+From cc8b7af31f74854edcb7124f56d976487bab7ed9 Mon Sep 17 00:00:00 2001
 From: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
 Date: Wed, 8 Jul 2020 15:37:33 +0200
 Subject: [PATCH] service: fix core mapping reset
 
+[ upstream commit 048db4b6dcccaee9277ce5b4fbb2fe684b212e22 ]
+
 The rte_service_lcore_reset_all function stops execution of services
 on all lcores and switches them back from ROLE_SERVICE to ROLE_RTE.
 However the thread loop for slave lcores (eal_thread_loop) distincts these
@@ -25,19 +27,18 @@
 Bugzilla ID: 464
 Fixes: 21698354c832 ("service: introduce service cores concept")
 Fixes: f038a81e1c56 ("service: add unit tests")
-Cc: stable@dpdk.org
 
 Reported-by: Sarosh Arif <sarosh.arif@emumba.com>
 Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
 Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
 ---
- app/test/test_service_cores.c        | 1 +
- lib/librte_eal/common/rte_service.c  | 2 --
- lib/librte_eal/include/rte_service.h | 4 ++++
+ app/test/test_service_cores.c               | 1 +
+ lib/librte_eal/common/include/rte_service.h | 4 ++++
+ lib/librte_eal/common/rte_service.c         | 2 --
  3 files changed, 5 insertions(+), 2 deletions(-)
 
 diff --git a/app/test/test_service_cores.c b/app/test/test_service_cores.c
-index 4f003ed1a..ef1d8fcb9 100644
+index a922c7ddc..2a4978e29 100644
 --- a/app/test/test_service_cores.c
 +++ b/app/test/test_service_cores.c
 @@ -114,6 +114,7 @@ unregister_all(void)
@@ -48,23 +49,10 @@
  
  	return TEST_SUCCESS;
  }
-diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c
-index e2795f857..6a0e0ff65 100644
---- a/lib/librte_eal/common/rte_service.c
-+++ b/lib/librte_eal/common/rte_service.c
-@@ -475,8 +475,6 @@ service_runner_func(void *arg)
- 		cs->loops++;
- 	}
- 
--	lcore_config[lcore].state = WAIT;
--
- 	return 0;
- }
- 
-diff --git a/lib/librte_eal/include/rte_service.h b/lib/librte_eal/include/rte_service.h
+diff --git a/lib/librte_eal/common/include/rte_service.h b/lib/librte_eal/common/include/rte_service.h
 index 3a1c735c5..e2d0a6dd3 100644
---- a/lib/librte_eal/include/rte_service.h
-+++ b/lib/librte_eal/include/rte_service.h
+--- a/lib/librte_eal/common/include/rte_service.h
++++ b/lib/librte_eal/common/include/rte_service.h
 @@ -304,6 +304,10 @@ int32_t rte_service_lcore_count(void);
   * from duty, just unmaps all services / cores, and stops() the service cores.
   * The runstate of services is not modified.
@@ -76,6 +64,19 @@
   * @retval 0 Success
   */
  int32_t rte_service_lcore_reset_all(void);
+diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c
+index eca6ccc59..8fcccac85 100644
+--- a/lib/librte_eal/common/rte_service.c
++++ b/lib/librte_eal/common/rte_service.c
+@@ -447,8 +447,6 @@ service_runner_func(void *arg)
+ 		rte_smp_rmb();
+ 	}
+ 
+-	lcore_config[lcore].state = WAIT;
+-
+ 	return 0;
+ }
+ 
 -- 
 2.20.1
 

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

* [dpdk-stable] patch 'net/ixgbe: report 10Mbps link speed for x553' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (102 preceding siblings ...)
  2020-07-24 11:59 ` [dpdk-stable] patch 'service: fix core mapping reset' " luca.boccassi
@ 2020-07-24 11:59 ` " luca.boccassi
  2020-07-24 11:59 ` [dpdk-stable] patch 'net/iavf: fix uninitialized variable' " luca.boccassi
                   ` (87 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:59 UTC (permalink / raw)
  To: Wei Zhao; +Cc: Jeff Guo, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 50f47ceefb8766e3f9f39a73d333cdbfed371245 Mon Sep 17 00:00:00 2001
From: Wei Zhao <wei.zhao1@intel.com>
Date: Tue, 30 Jun 2020 09:16:51 +0800
Subject: [PATCH] net/ixgbe: report 10Mbps link speed for x553

[ upstream commit b23c52a451958a6140fc86fa72f51f5a8f4584da ]

For ixgbe x553(IXGBE_DEV_ID_X550EM_A_1G_T) it support 10M
link speed, so add the support link speed info for 10Mb/s.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 50edb69cb..9dcff9935 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -4316,6 +4316,10 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev,
 			link.link_speed = ETH_SPEED_NUM_100M;
 		break;
 
+	case IXGBE_LINK_SPEED_10_FULL:
+		link.link_speed = ETH_SPEED_NUM_10M;
+		break;
+
 	case IXGBE_LINK_SPEED_100_FULL:
 		link.link_speed = ETH_SPEED_NUM_100M;
 		break;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:52.588627489 +0100
+++ 0105-net-ixgbe-report-10Mbps-link-speed-for-x553.patch	2020-07-24 12:53:48.355007727 +0100
@@ -1,13 +1,14 @@
-From b23c52a451958a6140fc86fa72f51f5a8f4584da Mon Sep 17 00:00:00 2001
+From 50f47ceefb8766e3f9f39a73d333cdbfed371245 Mon Sep 17 00:00:00 2001
 From: Wei Zhao <wei.zhao1@intel.com>
 Date: Tue, 30 Jun 2020 09:16:51 +0800
 Subject: [PATCH] net/ixgbe: report 10Mbps link speed for x553
 
+[ upstream commit b23c52a451958a6140fc86fa72f51f5a8f4584da ]
+
 For ixgbe x553(IXGBE_DEV_ID_X550EM_A_1G_T) it support 10M
 link speed, so add the support link speed info for 10Mb/s.
 
 Fixes: af75078fece3 ("first public release")
-Cc: stable@dpdk.org
 
 Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
 Acked-by: Jeff Guo <jia.guo@intel.com>
@@ -16,10 +17,10 @@
  1 file changed, 4 insertions(+)
 
 diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
-index 248f21d14..095f1bde5 100644
+index 50edb69cb..9dcff9935 100644
 --- a/drivers/net/ixgbe/ixgbe_ethdev.c
 +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
-@@ -4307,6 +4307,10 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev,
+@@ -4316,6 +4316,10 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev,
  			link.link_speed = ETH_SPEED_NUM_100M;
  		break;
  

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

* [dpdk-stable] patch 'net/iavf: fix uninitialized variable' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (103 preceding siblings ...)
  2020-07-24 11:59 ` [dpdk-stable] patch 'net/ixgbe: report 10Mbps link speed for x553' " luca.boccassi
@ 2020-07-24 11:59 ` " luca.boccassi
  2020-07-24 11:59 ` [dpdk-stable] patch 'net/ixgbe/base: remove dead code' " luca.boccassi
                   ` (86 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:59 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Qi Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 8edaa43add38c967cd9b50b8e1cc16329596f445 Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit@intel.com>
Date: Tue, 23 Jun 2020 14:45:31 +0100
Subject: [PATCH] net/iavf: fix uninitialized variable
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit ca5e39f8535300b247d14865cd8c6b9b4acba38a ]

This is observed with experimental gcc 11, although the older gcc
versions don't complain about it, issue seems a valid one.
gcc version 11.0.0 20200621 (experimental) (GCC)

Build error
.../drivers/net/iavf/iavf_ethdev.c: In function ‘iavf_dev_link_update’:
.../drivers/net/iavf/iavf_ethdev.c:641:6:
    error: ‘new_link’ is used uninitialized [-Werror=uninitialized]
  641 |  if (rte_atomic64_cmpset((uint64_t *)&dev->data->dev_link,
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  642 |     *(uint64_t *)&dev->data->dev_link,
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  643 |     *(uint64_t *)&new_link) == 0)
      |     ~~~~~~~~~~~~~~~~~~~~~~~
.../drivers/net/iavf/iavf_ethdev.c:596:22:
    note: ‘new_link’ declared here
  596 |  struct rte_eth_link new_link;
      |                      ^~~~~~~~
cc1: all warnings being treated as error

All fields of the 'new_link' struct is already set in function, so the
'uninitialized' warning is hard to get. This is because the combination
of aligning and bitfield usage of the struct

The definition of the struct is:
struct rte_eth_link {
        uint32_t link_speed;        /**< ETH_SPEED_NUM_ */
        uint16_t link_duplex  : 1;  /**< ETH_LINK_[HALF/FULL]_DUPLEX */
        uint16_t link_autoneg : 1;  /**< ETH_LINK_[AUTONEG/FIXED] */
        uint16_t link_status  : 1;  /**< ETH_LINK_[DOWN/UP] */
} __rte_aligned(8);      /**< aligned for atomic64 read/write */

Overall the size of the 'struct rte_eth_link' is 64 bits, but function
only sets the 35 bits of it, because only 3 bits of 16 bits variable are
used.
When the struct cast to 'uint64_t' because of the 'rte_atomic64_cmpset'
the upper 29 bits are used without initialization.

To fix the uninitialized usage, memset the variable 'new_link' before
using it.

Fixes: 48de41ca11f0 ("net/avf: enable link status update")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/iavf/iavf_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 266200dbe..3f41eefff 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -593,6 +593,8 @@ iavf_dev_link_update(struct rte_eth_dev *dev,
 	struct rte_eth_link new_link;
 	struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 
+	memset(&new_link, 0, sizeof(new_link));
+
 	/* Only read status info stored in VF, and the info is updated
 	 *  when receive LINK_CHANGE evnet from PF by Virtchnnl.
 	 */
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:52.630171832 +0100
+++ 0106-net-iavf-fix-uninitialized-variable.patch	2020-07-24 12:53:48.359007801 +0100
@@ -1,4 +1,4 @@
-From ca5e39f8535300b247d14865cd8c6b9b4acba38a Mon Sep 17 00:00:00 2001
+From 8edaa43add38c967cd9b50b8e1cc16329596f445 Mon Sep 17 00:00:00 2001
 From: Ferruh Yigit <ferruh.yigit@intel.com>
 Date: Tue, 23 Jun 2020 14:45:31 +0100
 Subject: [PATCH] net/iavf: fix uninitialized variable
@@ -6,6 +6,8 @@
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
 
+[ upstream commit ca5e39f8535300b247d14865cd8c6b9b4acba38a ]
+
 This is observed with experimental gcc 11, although the older gcc
 versions don't complain about it, issue seems a valid one.
 gcc version 11.0.0 20200621 (experimental) (GCC)
@@ -48,7 +50,6 @@
 using it.
 
 Fixes: 48de41ca11f0 ("net/avf: enable link status update")
-Cc: stable@dpdk.org
 
 Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
 Acked-by: Qi Zhang <qi.z.zhang@intel.com>
@@ -57,10 +58,10 @@
  1 file changed, 2 insertions(+)
 
 diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
-index d69e5284e..b0dd49a8d 100644
+index 266200dbe..3f41eefff 100644
 --- a/drivers/net/iavf/iavf_ethdev.c
 +++ b/drivers/net/iavf/iavf_ethdev.c
-@@ -582,6 +582,8 @@ iavf_dev_link_update(struct rte_eth_dev *dev,
+@@ -593,6 +593,8 @@ iavf_dev_link_update(struct rte_eth_dev *dev,
  	struct rte_eth_link new_link;
  	struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
  

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

* [dpdk-stable] patch 'net/ixgbe/base: remove dead code' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (104 preceding siblings ...)
  2020-07-24 11:59 ` [dpdk-stable] patch 'net/iavf: fix uninitialized variable' " luca.boccassi
@ 2020-07-24 11:59 ` " luca.boccassi
  2020-07-24 11:59 ` [dpdk-stable] patch 'net/iavf: fix RSS RETA after restart' " luca.boccassi
                   ` (85 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:59 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Qi Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 829d08cc2c20aad0276eba50d286dd19904fd962 Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit@intel.com>
Date: Tue, 30 Jun 2020 15:45:54 +0100
Subject: [PATCH] net/ixgbe/base: remove dead code

[ upstream commit a6395d471e14e5a7432875dad8fb3533238c5167 ]

The question around getting rid of the assignments seems lived
long enough, if they are not needed until now, we can drop them.

Fixes: 39bca0ed994c ("ixgbe: DCB in base driver")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ixgbe/base/ixgbe_dcb_82598.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/net/ixgbe/base/ixgbe_dcb_82598.c b/drivers/net/ixgbe/base/ixgbe_dcb_82598.c
index bb309e28f..dc7b905c5 100644
--- a/drivers/net/ixgbe/base/ixgbe_dcb_82598.c
+++ b/drivers/net/ixgbe/base/ixgbe_dcb_82598.c
@@ -36,14 +36,6 @@ s32 ixgbe_dcb_get_tc_stats_82598(struct ixgbe_hw *hw,
 		stats->qprc[tc] += IXGBE_READ_REG(hw, IXGBE_QPRC(tc));
 		/* Received Bytes */
 		stats->qbrc[tc] += IXGBE_READ_REG(hw, IXGBE_QBRC(tc));
-
-#if 0
-		/* Can we get rid of these??  Consequently, getting rid
-		 * of the tc_stats structure.
-		 */
-		tc_stats_array[up]->in_overflow_discards = 0;
-		tc_stats_array[up]->out_overflow_discards = 0;
-#endif
 	}
 
 	return IXGBE_SUCCESS;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:52.669450951 +0100
+++ 0107-net-ixgbe-base-remove-dead-code.patch	2020-07-24 12:53:48.359007801 +0100
@@ -1,13 +1,14 @@
-From a6395d471e14e5a7432875dad8fb3533238c5167 Mon Sep 17 00:00:00 2001
+From 829d08cc2c20aad0276eba50d286dd19904fd962 Mon Sep 17 00:00:00 2001
 From: Ferruh Yigit <ferruh.yigit@intel.com>
 Date: Tue, 30 Jun 2020 15:45:54 +0100
 Subject: [PATCH] net/ixgbe/base: remove dead code
 
+[ upstream commit a6395d471e14e5a7432875dad8fb3533238c5167 ]
+
 The question around getting rid of the assignments seems lived
 long enough, if they are not needed until now, we can drop them.
 
 Fixes: 39bca0ed994c ("ixgbe: DCB in base driver")
-Cc: stable@dpdk.org
 
 Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
 Acked-by: Qi Zhang <qi.z.zhang@intel.com>

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

* [dpdk-stable] patch 'net/iavf: fix RSS RETA after restart' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (105 preceding siblings ...)
  2020-07-24 11:59 ` [dpdk-stable] patch 'net/ixgbe/base: remove dead code' " luca.boccassi
@ 2020-07-24 11:59 ` " luca.boccassi
  2020-07-24 11:59 ` [dpdk-stable] patch 'common/octeontx2: fix crash on running procinfo' " luca.boccassi
                   ` (84 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:59 UTC (permalink / raw)
  To: Junyu Jiang; +Cc: Qiming Yang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 80b3bfdd5adeb4a8f2f1dcfed8760d22e762ca7d Mon Sep 17 00:00:00 2001
From: Junyu Jiang <junyux.jiang@intel.com>
Date: Fri, 19 Jun 2020 07:44:02 +0000
Subject: [PATCH] net/iavf: fix RSS RETA after restart

[ upstream commit 1feb8e3f4e5c69071e5c461132a8b1bad05609af ]

This patch moved the RSS initialization from dev start to
dev configure, to fix the issue that RSS redirection table
can not be kept after restarting port.

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

Signed-off-by: Junyu Jiang <junyux.jiang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
---
 drivers/net/iavf/iavf_ethdev.c | 71 +++++++++++++++++-----------------
 1 file changed, 35 insertions(+), 36 deletions(-)

diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 3f41eefff..8ddd4aad9 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -132,34 +132,6 @@ static const struct eth_dev_ops iavf_eth_dev_ops = {
 	.rx_queue_intr_disable      = iavf_dev_rx_queue_intr_disable,
 };
 
-static int
-iavf_dev_configure(struct rte_eth_dev *dev)
-{
-	struct iavf_adapter *ad =
-		IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
-	struct iavf_info *vf =  IAVF_DEV_PRIVATE_TO_VF(ad);
-	struct rte_eth_conf *dev_conf = &dev->data->dev_conf;
-
-	ad->rx_bulk_alloc_allowed = true;
-	/* Initialize to TRUE. If any of Rx queues doesn't meet the
-	 * vector Rx/Tx preconditions, it will be reset.
-	 */
-	ad->rx_vec_allowed = true;
-	ad->tx_vec_allowed = true;
-
-	if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG)
-		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
-
-	/* Vlan stripping setting */
-	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN) {
-		if (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_VLAN_STRIP)
-			iavf_enable_vlan_strip(ad);
-		else
-			iavf_disable_vlan_strip(ad);
-	}
-	return 0;
-}
-
 static int
 iavf_init_rss(struct iavf_adapter *adapter)
 {
@@ -216,6 +188,41 @@ iavf_init_rss(struct iavf_adapter *adapter)
 	return 0;
 }
 
+static int
+iavf_dev_configure(struct rte_eth_dev *dev)
+{
+	struct iavf_adapter *ad =
+		IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
+	struct iavf_info *vf =  IAVF_DEV_PRIVATE_TO_VF(ad);
+	struct rte_eth_conf *dev_conf = &dev->data->dev_conf;
+
+	ad->rx_bulk_alloc_allowed = true;
+	/* Initialize to TRUE. If any of Rx queues doesn't meet the
+	 * vector Rx/Tx preconditions, it will be reset.
+	 */
+	ad->rx_vec_allowed = true;
+	ad->tx_vec_allowed = true;
+
+	if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG)
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
+	/* Vlan stripping setting */
+	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN) {
+		if (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_VLAN_STRIP)
+			iavf_enable_vlan_strip(ad);
+		else
+			iavf_disable_vlan_strip(ad);
+	}
+
+	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_RSS_PF) {
+		if (iavf_init_rss(ad) != 0) {
+			PMD_DRV_LOG(ERR, "configure rss failed");
+			return -1;
+		}
+	}
+	return 0;
+}
+
 static int
 iavf_init_rxq(struct rte_eth_dev *dev, struct iavf_rx_queue *rxq)
 {
@@ -436,13 +443,6 @@ iavf_dev_start(struct rte_eth_dev *dev)
 		return -1;
 	}
 
-	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_RSS_PF) {
-		if (iavf_init_rss(adapter) != 0) {
-			PMD_DRV_LOG(ERR, "configure rss failed");
-			goto err_rss;
-		}
-	}
-
 	if (iavf_configure_queues(adapter) != 0) {
 		PMD_DRV_LOG(ERR, "configure queues failed");
 		goto err_queue;
@@ -471,7 +471,6 @@ iavf_dev_start(struct rte_eth_dev *dev)
 err_mac:
 	iavf_add_del_all_mac_addr(adapter, FALSE);
 err_queue:
-err_rss:
 	return -1;
 }
 
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:52.704650483 +0100
+++ 0108-net-iavf-fix-RSS-RETA-after-restart.patch	2020-07-24 12:53:48.359007801 +0100
@@ -1,14 +1,15 @@
-From 1feb8e3f4e5c69071e5c461132a8b1bad05609af Mon Sep 17 00:00:00 2001
+From 80b3bfdd5adeb4a8f2f1dcfed8760d22e762ca7d Mon Sep 17 00:00:00 2001
 From: Junyu Jiang <junyux.jiang@intel.com>
 Date: Fri, 19 Jun 2020 07:44:02 +0000
 Subject: [PATCH] net/iavf: fix RSS RETA after restart
 
+[ upstream commit 1feb8e3f4e5c69071e5c461132a8b1bad05609af ]
+
 This patch moved the RSS initialization from dev start to
 dev configure, to fix the issue that RSS redirection table
 can not be kept after restarting port.
 
 Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")
-Cc: stable@dpdk.org
 
 Signed-off-by: Junyu Jiang <junyux.jiang@intel.com>
 Acked-by: Qiming Yang <qiming.yang@intel.com>
@@ -17,11 +18,11 @@
  1 file changed, 35 insertions(+), 36 deletions(-)
 
 diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
-index b0dd49a8d..c3aa4cd72 100644
+index 3f41eefff..8ddd4aad9 100644
 --- a/drivers/net/iavf/iavf_ethdev.c
 +++ b/drivers/net/iavf/iavf_ethdev.c
-@@ -122,34 +122,6 @@ static const struct eth_dev_ops iavf_eth_dev_ops = {
- 	.filter_ctrl                = iavf_dev_filter_ctrl,
+@@ -132,34 +132,6 @@ static const struct eth_dev_ops iavf_eth_dev_ops = {
+ 	.rx_queue_intr_disable      = iavf_dev_rx_queue_intr_disable,
  };
  
 -static int
@@ -55,7 +56,7 @@
  static int
  iavf_init_rss(struct iavf_adapter *adapter)
  {
-@@ -206,6 +178,41 @@ iavf_init_rss(struct iavf_adapter *adapter)
+@@ -216,6 +188,41 @@ iavf_init_rss(struct iavf_adapter *adapter)
  	return 0;
  }
  
@@ -97,7 +98,7 @@
  static int
  iavf_init_rxq(struct rte_eth_dev *dev, struct iavf_rx_queue *rxq)
  {
-@@ -426,13 +433,6 @@ iavf_dev_start(struct rte_eth_dev *dev)
+@@ -436,13 +443,6 @@ iavf_dev_start(struct rte_eth_dev *dev)
  		return -1;
  	}
  
@@ -111,9 +112,9 @@
  	if (iavf_configure_queues(adapter) != 0) {
  		PMD_DRV_LOG(ERR, "configure queues failed");
  		goto err_queue;
-@@ -461,7 +461,6 @@ iavf_dev_start(struct rte_eth_dev *dev)
+@@ -471,7 +471,6 @@ iavf_dev_start(struct rte_eth_dev *dev)
  err_mac:
- 	iavf_add_del_all_mac_addr(adapter, false);
+ 	iavf_add_del_all_mac_addr(adapter, FALSE);
  err_queue:
 -err_rss:
  	return -1;

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

* [dpdk-stable] patch 'common/octeontx2: fix crash on running procinfo' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (106 preceding siblings ...)
  2020-07-24 11:59 ` [dpdk-stable] patch 'net/iavf: fix RSS RETA after restart' " luca.boccassi
@ 2020-07-24 11:59 ` " luca.boccassi
  2020-07-24 11:59 ` [dpdk-stable] patch 'net/ice/base: fix GTP-U inner RSS IPv4 IPv6 co-exist' " luca.boccassi
                   ` (83 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:59 UTC (permalink / raw)
  To: Harman Kalra; +Cc: Jerin Jacob, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From f04eb5e26450b178b411c9b4840ef2c7ad9174f2 Mon Sep 17 00:00:00 2001
From: Harman Kalra <hkalra@marvell.com>
Date: Mon, 29 Jun 2020 18:56:05 +0530
Subject: [PATCH] common/octeontx2: fix crash on running procinfo

[ upstream commit 43330c4de3c768f6eedbc544f410ccff06b531a2 ]

Segmentation fault has been observed while running procinfo
with reset options i.e. --stats-reset and --xstats-reset.
Reason is procinfo runs as a secondary process and tries to
hold a lock which is part of struct mdev, which was not
allocated as part of shared memory.

Fixes: 5ca59711f771 ("common/octeontx2: add mailbox base support infra")

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
---
 drivers/common/octeontx2/otx2_mbox.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/common/octeontx2/otx2_mbox.c b/drivers/common/octeontx2/otx2_mbox.c
index c359bf42f..18bf5b88e 100644
--- a/drivers/common/octeontx2/otx2_mbox.c
+++ b/drivers/common/octeontx2/otx2_mbox.c
@@ -9,6 +9,7 @@
 
 #include <rte_atomic.h>
 #include <rte_cycles.h>
+#include <rte_malloc.h>
 
 #include "otx2_mbox.h"
 
@@ -35,7 +36,7 @@ otx2_mbox_fini(struct otx2_mbox *mbox)
 {
 	mbox->reg_base = 0;
 	mbox->hwbase = 0;
-	free(mbox->dev);
+	rte_free(mbox->dev);
 	mbox->dev = NULL;
 }
 
@@ -126,7 +127,9 @@ otx2_mbox_init(struct otx2_mbox *mbox, uintptr_t hwbase,
 		return -ENODEV;
 	}
 
-	mbox->dev = malloc(ndevs * sizeof(struct otx2_mbox_dev));
+	mbox->dev = rte_zmalloc("mbox dev",
+				ndevs * sizeof(struct otx2_mbox_dev),
+				OTX2_ALIGN);
 	if (!mbox->dev) {
 		otx2_mbox_fini(mbox);
 		return -ENOMEM;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:52.740891549 +0100
+++ 0109-common-octeontx2-fix-crash-on-running-procinfo.patch	2020-07-24 12:53:48.359007801 +0100
@@ -1,8 +1,10 @@
-From 43330c4de3c768f6eedbc544f410ccff06b531a2 Mon Sep 17 00:00:00 2001
+From f04eb5e26450b178b411c9b4840ef2c7ad9174f2 Mon Sep 17 00:00:00 2001
 From: Harman Kalra <hkalra@marvell.com>
 Date: Mon, 29 Jun 2020 18:56:05 +0530
 Subject: [PATCH] common/octeontx2: fix crash on running procinfo
 
+[ upstream commit 43330c4de3c768f6eedbc544f410ccff06b531a2 ]
+
 Segmentation fault has been observed while running procinfo
 with reset options i.e. --stats-reset and --xstats-reset.
 Reason is procinfo runs as a secondary process and tries to
@@ -10,7 +12,6 @@
 allocated as part of shared memory.
 
 Fixes: 5ca59711f771 ("common/octeontx2: add mailbox base support infra")
-Cc: stable@dpdk.org
 
 Signed-off-by: Harman Kalra <hkalra@marvell.com>
 Acked-by: Jerin Jacob <jerinj@marvell.com>
@@ -19,7 +20,7 @@
  1 file changed, 5 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/common/octeontx2/otx2_mbox.c b/drivers/common/octeontx2/otx2_mbox.c
-index 2b7810929..6df1e8ea6 100644
+index c359bf42f..18bf5b88e 100644
 --- a/drivers/common/octeontx2/otx2_mbox.c
 +++ b/drivers/common/octeontx2/otx2_mbox.c
 @@ -9,6 +9,7 @@
@@ -29,8 +30,8 @@
 +#include <rte_malloc.h>
  
  #include "otx2_mbox.h"
- #include "otx2_dev.h"
-@@ -36,7 +37,7 @@ otx2_mbox_fini(struct otx2_mbox *mbox)
+ 
+@@ -35,7 +36,7 @@ otx2_mbox_fini(struct otx2_mbox *mbox)
  {
  	mbox->reg_base = 0;
  	mbox->hwbase = 0;
@@ -39,7 +40,7 @@
  	mbox->dev = NULL;
  }
  
-@@ -128,7 +129,9 @@ otx2_mbox_init(struct otx2_mbox *mbox, uintptr_t hwbase, uintptr_t reg_base,
+@@ -126,7 +127,9 @@ otx2_mbox_init(struct otx2_mbox *mbox, uintptr_t hwbase,
  		return -ENODEV;
  	}
  

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

* [dpdk-stable] patch 'net/ice/base: fix GTP-U inner RSS IPv4 IPv6 co-exist' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (107 preceding siblings ...)
  2020-07-24 11:59 ` [dpdk-stable] patch 'common/octeontx2: fix crash on running procinfo' " luca.boccassi
@ 2020-07-24 11:59 ` " luca.boccassi
  2020-07-24 11:59 ` [dpdk-stable] patch 'net/hns3: clear residual hardware configurations on init' " luca.boccassi
                   ` (82 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:59 UTC (permalink / raw)
  To: Qi Zhang; +Cc: Junfeng Guo, Qiming Yang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 85098a10e2037b80670e9f67507feb59d96c4019 Mon Sep 17 00:00:00 2001
From: Qi Zhang <qi.z.zhang@intel.com>
Date: Wed, 1 Jul 2020 13:49:44 +0800
Subject: [PATCH] net/ice/base: fix GTP-U inner RSS IPv4 IPv6 co-exist

[ upstream commit bed9bb3139efd07817288dea85488435f79e0ab8 ]

An IP header combined with GTP-U header should be regarded as
inner layer for RSS, otherwise it mess the field vector between
an IPv4 rule and IPv6 rule e.g:

testpmd> flow create 0 ingress pattern eth / ipv4 / udp / gtpu / \
gtpu_psc  / ipv4 / udp / end actions rss types ipv4-udp end key_len \
0 queues end / end
testpmd> flow create 0 ingress pattern eth / ipv4 / udp / gtpu / \
gtpu_psc  / ipv6 / udp / end actions rss types ipv6-udp end key_len \
0 queues end / end

Fixes: b7d34ccc47b5 ("net/ice/base: packet encapsulation for RSS")

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
---
 drivers/net/ice/base/ice_flow.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/net/ice/base/ice_flow.c b/drivers/net/ice/base/ice_flow.c
index 9d58d284f..9d958b329 100644
--- a/drivers/net/ice/base/ice_flow.c
+++ b/drivers/net/ice/base/ice_flow.c
@@ -2124,6 +2124,13 @@ ice_add_rss_cfg_sync(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds,
 	if (status)
 		goto exit;
 
+	/* don't do RSS for GTPU outer */
+	if (segs_cnt == ICE_RSS_OUTER_HEADERS &&
+	    (segs[segs_cnt - 1].hdrs & ICE_FLOW_SEG_HDR_GTPU)) {
+		printf("ignore gtpu\n");
+		return ICE_SUCCESS;
+	}
+
 	/* Search for a flow profile that has matching headers, hash fields
 	 * and has the input VSI associated to it. If found, no further
 	 * operations required and exit.
@@ -2240,6 +2247,7 @@ ice_add_rss_cfg(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds,
 	ice_acquire_lock(&hw->rss_locks);
 	status = ice_add_rss_cfg_sync(hw, vsi_handle, hashed_flds, addl_hdrs,
 				      ICE_RSS_OUTER_HEADERS, symm);
+
 	if (!status)
 		status = ice_add_rss_cfg_sync(hw, vsi_handle, hashed_flds,
 					      addl_hdrs, ICE_RSS_INNER_HEADERS,
@@ -2273,6 +2281,10 @@ ice_rem_rss_cfg_sync(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds,
 	if (!segs)
 		return ICE_ERR_NO_MEMORY;
 
+	if (segs_cnt == ICE_RSS_OUTER_HEADERS &&
+	    segs[segs_cnt - 1].hdrs & ICE_FLOW_SEG_HDR_GTPU)
+		return ICE_SUCCESS;
+
 	/* Construct the packet segment info from the hashed fields */
 	status = ice_flow_set_rss_seg_info(&segs[segs_cnt - 1], hashed_flds,
 					   addl_hdrs);
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:52.776424996 +0100
+++ 0110-net-ice-base-fix-GTP-U-inner-RSS-IPv4-IPv6-co-exist.patch	2020-07-24 12:53:48.363007876 +0100
@@ -1,8 +1,10 @@
-From bed9bb3139efd07817288dea85488435f79e0ab8 Mon Sep 17 00:00:00 2001
+From 85098a10e2037b80670e9f67507feb59d96c4019 Mon Sep 17 00:00:00 2001
 From: Qi Zhang <qi.z.zhang@intel.com>
 Date: Wed, 1 Jul 2020 13:49:44 +0800
 Subject: [PATCH] net/ice/base: fix GTP-U inner RSS IPv4 IPv6 co-exist
 
+[ upstream commit bed9bb3139efd07817288dea85488435f79e0ab8 ]
+
 An IP header combined with GTP-U header should be regarded as
 inner layer for RSS, otherwise it mess the field vector between
 an IPv4 rule and IPv6 rule e.g:
@@ -15,7 +17,6 @@
 0 queues end / end
 
 Fixes: b7d34ccc47b5 ("net/ice/base: packet encapsulation for RSS")
-Cc: stable@dpdk.org
 
 Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
 Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
@@ -25,10 +26,10 @@
  1 file changed, 12 insertions(+)
 
 diff --git a/drivers/net/ice/base/ice_flow.c b/drivers/net/ice/base/ice_flow.c
-index 6adcda844..180fe4466 100644
+index 9d58d284f..9d958b329 100644
 --- a/drivers/net/ice/base/ice_flow.c
 +++ b/drivers/net/ice/base/ice_flow.c
-@@ -3557,6 +3557,13 @@ ice_add_rss_cfg_sync(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds,
+@@ -2124,6 +2124,13 @@ ice_add_rss_cfg_sync(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds,
  	if (status)
  		goto exit;
  
@@ -42,7 +43,7 @@
  	/* Search for a flow profile that has matching headers, hash fields
  	 * and has the input VSI associated to it. If found, no further
  	 * operations required and exit.
-@@ -3673,6 +3680,7 @@ ice_add_rss_cfg(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds,
+@@ -2240,6 +2247,7 @@ ice_add_rss_cfg(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds,
  	ice_acquire_lock(&hw->rss_locks);
  	status = ice_add_rss_cfg_sync(hw, vsi_handle, hashed_flds, addl_hdrs,
  				      ICE_RSS_OUTER_HEADERS, symm);
@@ -50,7 +51,7 @@
  	if (!status)
  		status = ice_add_rss_cfg_sync(hw, vsi_handle, hashed_flds,
  					      addl_hdrs, ICE_RSS_INNER_HEADERS,
-@@ -3706,6 +3714,10 @@ ice_rem_rss_cfg_sync(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds,
+@@ -2273,6 +2281,10 @@ ice_rem_rss_cfg_sync(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds,
  	if (!segs)
  		return ICE_ERR_NO_MEMORY;
  

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

* [dpdk-stable] patch 'net/hns3: clear residual hardware configurations on init' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (108 preceding siblings ...)
  2020-07-24 11:59 ` [dpdk-stable] patch 'net/ice/base: fix GTP-U inner RSS IPv4 IPv6 co-exist' " luca.boccassi
@ 2020-07-24 11:59 ` " luca.boccassi
  2020-07-24 11:59 ` [dpdk-stable] patch 'net/hns3: fix Rx buffer size' " luca.boccassi
                   ` (81 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:59 UTC (permalink / raw)
  To: Hongbo Zheng; +Cc: Wei Hu, Chengwen Feng, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From aaf0005929b0723a19ff3f49f8da325523d91d57 Mon Sep 17 00:00:00 2001
From: Hongbo Zheng <zhenghongbo3@huawei.com>
Date: Wed, 1 Jul 2020 19:54:38 +0800
Subject: [PATCH] net/hns3: clear residual hardware configurations on init

[ upstream commit 223d9eceaeeeb4d5156d4c96eec1a34434d6ecab ]

When the last driver exits abnormally, for example, it is killed by
'kill -9', it may be too late to clear the configuration and cause the
configuration to remain. Therefore, to ensure that the hardware
environment is clean during initialization, the PF driver actively clear
the hardware environment during initialization, including PF and
corresponding VFs' vlan, mac, flow table configurations, etc.

Fixes: d51867db65c1 ("net/hns3: add initialization")

Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
---
 drivers/net/hns3/hns3_cmd.h    |  3 +++
 drivers/net/hns3/hns3_ethdev.c | 27 +++++++++++++++++++++++++++
 2 files changed, 30 insertions(+)

diff --git a/drivers/net/hns3/hns3_cmd.h b/drivers/net/hns3/hns3_cmd.h
index 26d410396..ab16b07a6 100644
--- a/drivers/net/hns3/hns3_cmd.h
+++ b/drivers/net/hns3/hns3_cmd.h
@@ -207,6 +207,9 @@ enum hns3_opcode_type {
 	HNS3_OPC_FD_AD_OP               = 0x1204,
 	HNS3_OPC_FD_COUNTER_OP          = 0x1205,
 
+	/* Clear hardware state command */
+	HNS3_OPC_CLEAR_HW_STATE         = 0x700A,
+
 	/* SFP command */
 	HNS3_OPC_SFP_GET_SPEED          = 0x7104,
 
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index f1066c079..4a1bb174c 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -4180,6 +4180,21 @@ err_mac_init:
 	return ret;
 }
 
+static int
+hns3_clear_hw(struct hns3_hw *hw)
+{
+	struct hns3_cmd_desc desc;
+	int ret;
+
+	hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_CLEAR_HW_STATE, false);
+
+	ret = hns3_cmd_send(hw, &desc, 1);
+	if (ret && ret != -EOPNOTSUPP)
+		return ret;
+
+	return 0;
+}
+
 static int
 hns3_init_pf(struct rte_eth_dev *eth_dev)
 {
@@ -4210,6 +4225,18 @@ hns3_init_pf(struct rte_eth_dev *eth_dev)
 		goto err_cmd_init;
 	}
 
+	/*
+	 * To ensure that the hardware environment is clean during
+	 * initialization, the driver actively clear the hardware environment
+	 * during initialization, including PF and corresponding VFs' vlan, mac,
+	 * flow table configurations, etc.
+	 */
+	ret = hns3_clear_hw(hw);
+	if (ret) {
+		PMD_INIT_LOG(ERR, "failed to clear hardware: %d", ret);
+		goto err_cmd_init;
+	}
+
 	ret = rte_intr_callback_register(&pci_dev->intr_handle,
 					 hns3_interrupt_handler,
 					 eth_dev);
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:52.817439222 +0100
+++ 0111-net-hns3-clear-residual-hardware-configurations-on-i.patch	2020-07-24 12:53:48.367007950 +0100
@@ -1,8 +1,10 @@
-From 223d9eceaeeeb4d5156d4c96eec1a34434d6ecab Mon Sep 17 00:00:00 2001
+From aaf0005929b0723a19ff3f49f8da325523d91d57 Mon Sep 17 00:00:00 2001
 From: Hongbo Zheng <zhenghongbo3@huawei.com>
 Date: Wed, 1 Jul 2020 19:54:38 +0800
 Subject: [PATCH] net/hns3: clear residual hardware configurations on init
 
+[ upstream commit 223d9eceaeeeb4d5156d4c96eec1a34434d6ecab ]
+
 When the last driver exits abnormally, for example, it is killed by
 'kill -9', it may be too late to clear the configuration and cause the
 configuration to remain. Therefore, to ensure that the hardware
@@ -11,7 +13,6 @@
 corresponding VFs' vlan, mac, flow table configurations, etc.
 
 Fixes: d51867db65c1 ("net/hns3: add initialization")
-Cc: stable@dpdk.org
 
 Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
 Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
@@ -22,7 +23,7 @@
  2 files changed, 30 insertions(+)
 
 diff --git a/drivers/net/hns3/hns3_cmd.h b/drivers/net/hns3/hns3_cmd.h
-index da770ac95..b203e663e 100644
+index 26d410396..ab16b07a6 100644
 --- a/drivers/net/hns3/hns3_cmd.h
 +++ b/drivers/net/hns3/hns3_cmd.h
 @@ -207,6 +207,9 @@ enum hns3_opcode_type {
@@ -36,10 +37,10 @@
  	HNS3_OPC_SFP_GET_SPEED          = 0x7104,
  
 diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
-index 4afee5d47..8b18b47d4 100644
+index f1066c079..4a1bb174c 100644
 --- a/drivers/net/hns3/hns3_ethdev.c
 +++ b/drivers/net/hns3/hns3_ethdev.c
-@@ -4318,6 +4318,21 @@ err_mac_init:
+@@ -4180,6 +4180,21 @@ err_mac_init:
  	return ret;
  }
  
@@ -61,7 +62,7 @@
  static int
  hns3_init_pf(struct rte_eth_dev *eth_dev)
  {
-@@ -4348,6 +4363,18 @@ hns3_init_pf(struct rte_eth_dev *eth_dev)
+@@ -4210,6 +4225,18 @@ hns3_init_pf(struct rte_eth_dev *eth_dev)
  		goto err_cmd_init;
  	}
  

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

* [dpdk-stable] patch 'net/hns3: fix Rx buffer size' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (109 preceding siblings ...)
  2020-07-24 11:59 ` [dpdk-stable] patch 'net/hns3: clear residual hardware configurations on init' " luca.boccassi
@ 2020-07-24 11:59 ` " luca.boccassi
  2020-07-24 11:59 ` [dpdk-stable] patch 'net/hinic/base: check output of management sync channel' " luca.boccassi
                   ` (80 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:59 UTC (permalink / raw)
  To: Wei Hu (Xavier); +Cc: Chengchang Tang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 479064d41e9cbd7654abe1689043e4045e206bbd Mon Sep 17 00:00:00 2001
From: "Wei Hu (Xavier)" <xavier.huwei@huawei.com>
Date: Wed, 1 Jul 2020 19:54:40 +0800
Subject: [PATCH] net/hns3: fix Rx buffer size

[ upstream commit dfac40d93edf7dbac8ef41f775daba4e54a39263 ]

Currently, rx_buf_size of hns3 PMD driver is fixed on, and it's value
depends on the firmware which will decrease the flexibility of PMD.

The receive side mbufs was allocated from the mempool given by upper
application calling rte_eth_rx_queue_setup API function. So the memory
chunk used for net device DMA is depend on the data room size of the
objects in this mempool. Hns3 PMD driver should set the rx_buf_len
smaller than the data room size of mempool and our hardware only support
the following four specifications: 512, 1024, 2148 and 4096.

Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations")

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
---
 drivers/net/hns3/hns3_ethdev.c    |  3 +-
 drivers/net/hns3/hns3_ethdev.h    |  1 -
 drivers/net/hns3/hns3_ethdev_vf.c |  5 +--
 drivers/net/hns3/hns3_rxtx.c      | 56 +++++++++++++++++++++++++++++--
 drivers/net/hns3/hns3_rxtx.h      |  8 +++++
 5 files changed, 64 insertions(+), 9 deletions(-)

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index 4a1bb174c..4922e1bde 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -2362,7 +2362,7 @@ hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
 	info->max_rx_queues = queue_num;
 	info->max_tx_queues = hw->tqps_num;
 	info->max_rx_pktlen = HNS3_MAX_FRAME_LEN; /* CRC included */
-	info->min_rx_bufsize = hw->rx_buf_len;
+	info->min_rx_bufsize = HNS3_MIN_BD_BUF_SIZE;
 	info->max_mac_addrs = HNS3_UC_MACADDR_NUM;
 	info->max_mtu = info->max_rx_pktlen - HNS3_ETH_OVERHEAD;
 	info->rx_offload_capa = (DEV_RX_OFFLOAD_IPV4_CKSUM |
@@ -2709,7 +2709,6 @@ hns3_get_board_configuration(struct hns3_hw *hw)
 	hw->mac.media_type = cfg.media_type;
 	hw->rss_size_max = cfg.rss_size_max;
 	hw->rss_dis_flag = false;
-	hw->rx_buf_len = cfg.rx_buf_len;
 	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;
diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h
index e7d9fe0e0..155099e99 100644
--- a/drivers/net/hns3/hns3_ethdev.h
+++ b/drivers/net/hns3/hns3_ethdev.h
@@ -363,7 +363,6 @@ struct hns3_hw {
 	uint16_t tqps_num;          /* num task queue pairs of this function */
 	uint16_t intr_tqps_num;     /* num queue pairs mapping interrupt */
 	uint16_t rss_size_max;      /* HW defined max RSS task queue */
-	uint16_t rx_buf_len;
 	uint16_t num_tx_desc;       /* desc num of per tx queue */
 	uint16_t num_rx_desc;       /* desc num of per rx queue */
 
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
index 22cd9eb33..a2867f8ec 100644
--- a/drivers/net/hns3/hns3_ethdev_vf.c
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
@@ -652,7 +652,7 @@ hns3vf_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
 	info->max_rx_queues = q_num;
 	info->max_tx_queues = hw->tqps_num;
 	info->max_rx_pktlen = HNS3_MAX_FRAME_LEN; /* CRC included */
-	info->min_rx_bufsize = hw->rx_buf_len;
+	info->min_rx_bufsize = HNS3_MIN_BD_BUF_SIZE;
 	info->max_mac_addrs = HNS3_VF_UC_MACADDR_NUM;
 	info->max_mtu = info->max_rx_pktlen - HNS3_ETH_OVERHEAD;
 
@@ -816,8 +816,6 @@ hns3vf_check_tqp_info(struct hns3_hw *hw)
 		return -EINVAL;
 	}
 
-	if (hw->rx_buf_len == 0)
-		hw->rx_buf_len = HNS3_DEFAULT_RX_BUF_LEN;
 	hw->alloc_rss_size = RTE_MIN(hw->rss_size_max, hw->tqps_num);
 
 	return 0;
@@ -839,7 +837,6 @@ hns3vf_get_queue_info(struct hns3_hw *hw)
 
 	memcpy(&hw->tqps_num, &resp_msg[0], sizeof(uint16_t));
 	memcpy(&hw->rss_size_max, &resp_msg[2], sizeof(uint16_t));
-	memcpy(&hw->rx_buf_len, &resp_msg[4], sizeof(uint16_t));
 
 	return hns3vf_check_tqp_info(hw);
 }
diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index 3251515fe..c1ffa136b 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -884,7 +884,7 @@ hns3_fake_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx,
 	nb_rx_q = dev->data->nb_rx_queues;
 	rxq->io_base = (void *)((char *)hw->io_base + HNS3_TQP_REG_OFFSET +
 				(nb_rx_q + idx) * HNS3_TQP_REG_SIZE);
-	rxq->rx_buf_len = hw->rx_buf_len;
+	rxq->rx_buf_len = HNS3_MIN_BD_BUF_SIZE;
 
 	rte_spinlock_lock(&hw->lock);
 	hw->fkq_data.rx_queues[idx] = rxq;
@@ -1160,6 +1160,48 @@ hns3_dev_release_mbufs(struct hns3_adapter *hns)
 		}
 }
 
+static int
+hns3_rx_buf_len_calc(struct rte_mempool *mp, uint16_t *rx_buf_len)
+{
+	uint16_t vld_buf_size;
+	uint16_t num_hw_specs;
+	uint16_t i;
+
+	/*
+	 * hns3 network engine only support to set 4 typical specification, and
+	 * different buffer size will affect the max packet_len and the max
+	 * number of segmentation when hw gro is turned on in receive side. The
+	 * relationship between them is as follows:
+	 *      rx_buf_size     |  max_gro_pkt_len  |  max_gro_nb_seg
+	 * ---------------------|-------------------|----------------
+	 * HNS3_4K_BD_BUF_SIZE  |        60KB       |       15
+	 * HNS3_2K_BD_BUF_SIZE  |        62KB       |       31
+	 * HNS3_1K_BD_BUF_SIZE  |        63KB       |       63
+	 * HNS3_512_BD_BUF_SIZE |      31.5KB       |       63
+	 */
+	static const uint16_t hw_rx_buf_size[] = {
+		HNS3_4K_BD_BUF_SIZE,
+		HNS3_2K_BD_BUF_SIZE,
+		HNS3_1K_BD_BUF_SIZE,
+		HNS3_512_BD_BUF_SIZE
+	};
+
+	vld_buf_size = (uint16_t)(rte_pktmbuf_data_room_size(mp) -
+			RTE_PKTMBUF_HEADROOM);
+
+	if (vld_buf_size < HNS3_MIN_BD_BUF_SIZE)
+		return -EINVAL;
+
+	num_hw_specs = RTE_DIM(hw_rx_buf_size);
+	for (i = 0; i < num_hw_specs; i++) {
+		if (vld_buf_size >= hw_rx_buf_size[i]) {
+			*rx_buf_len = hw_rx_buf_size[i];
+			break;
+		}
+	}
+	return 0;
+}
+
 int
 hns3_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t nb_desc,
 		    unsigned int socket_id, const struct rte_eth_rxconf *conf,
@@ -1169,6 +1211,7 @@ hns3_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t nb_desc,
 	struct hns3_hw *hw = &hns->hw;
 	struct hns3_queue_info q_info;
 	struct hns3_rx_queue *rxq;
+	uint16_t rx_buf_size;
 	int rx_entry_len;
 
 	if (dev->data->dev_started) {
@@ -1193,6 +1236,15 @@ hns3_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t nb_desc,
 	q_info.nb_desc = nb_desc;
 	q_info.type = "hns3 RX queue";
 	q_info.ring_name = "rx_ring";
+
+	if (hns3_rx_buf_len_calc(mp, &rx_buf_size)) {
+		hns3_err(hw, "rxq mbufs' data room size:%u is not enough! "
+				"minimal data room size:%u.",
+				rte_pktmbuf_data_room_size(mp),
+				HNS3_MIN_BD_BUF_SIZE + RTE_PKTMBUF_HEADROOM);
+		return -EINVAL;
+	}
+
 	rxq = hns3_alloc_rxq_and_dma_zone(dev, &q_info);
 	if (rxq == NULL) {
 		hns3_err(hw,
@@ -1226,7 +1278,7 @@ hns3_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t nb_desc,
 	rxq->configured = true;
 	rxq->io_base = (void *)((char *)hw->io_base + HNS3_TQP_REG_OFFSET +
 				idx * HNS3_TQP_REG_SIZE);
-	rxq->rx_buf_len = hw->rx_buf_len;
+	rxq->rx_buf_len = rx_buf_size;
 	rxq->l2_errors = 0;
 	rxq->pkt_len_errors = 0;
 	rxq->l3_csum_erros = 0;
diff --git a/drivers/net/hns3/hns3_rxtx.h b/drivers/net/hns3/hns3_rxtx.h
index 771f3c9be..1fd1afd1d 100644
--- a/drivers/net/hns3/hns3_rxtx.h
+++ b/drivers/net/hns3/hns3_rxtx.h
@@ -11,6 +11,14 @@
 #define	HNS3_ALIGN_RING_DESC	32
 #define HNS3_RING_BASE_ALIGN	128
 
+#define HNS3_512_BD_BUF_SIZE	512
+#define HNS3_1K_BD_BUF_SIZE	1024
+#define HNS3_2K_BD_BUF_SIZE	2048
+#define HNS3_4K_BD_BUF_SIZE	4096
+
+#define HNS3_MIN_BD_BUF_SIZE	HNS3_512_BD_BUF_SIZE
+#define HNS3_MAX_BD_BUF_SIZE	HNS3_4K_BD_BUF_SIZE
+
 #define HNS3_BD_SIZE_512_TYPE			0
 #define HNS3_BD_SIZE_1024_TYPE			1
 #define HNS3_BD_SIZE_2048_TYPE			2
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:52.860342031 +0100
+++ 0112-net-hns3-fix-Rx-buffer-size.patch	2020-07-24 12:53:48.375008099 +0100
@@ -1,8 +1,10 @@
-From dfac40d93edf7dbac8ef41f775daba4e54a39263 Mon Sep 17 00:00:00 2001
+From 479064d41e9cbd7654abe1689043e4045e206bbd Mon Sep 17 00:00:00 2001
 From: "Wei Hu (Xavier)" <xavier.huwei@huawei.com>
 Date: Wed, 1 Jul 2020 19:54:40 +0800
 Subject: [PATCH] net/hns3: fix Rx buffer size
 
+[ upstream commit dfac40d93edf7dbac8ef41f775daba4e54a39263 ]
+
 Currently, rx_buf_size of hns3 PMD driver is fixed on, and it's value
 depends on the firmware which will decrease the flexibility of PMD.
 
@@ -14,7 +16,6 @@
 the following four specifications: 512, 1024, 2148 and 4096.
 
 Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations")
-Cc: stable@dpdk.org
 
 Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
 Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
@@ -27,10 +28,10 @@
  5 files changed, 64 insertions(+), 9 deletions(-)
 
 diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
-index b9868de54..13ce32432 100644
+index 4a1bb174c..4922e1bde 100644
 --- a/drivers/net/hns3/hns3_ethdev.c
 +++ b/drivers/net/hns3/hns3_ethdev.c
-@@ -2450,7 +2450,7 @@ hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
+@@ -2362,7 +2362,7 @@ hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
  	info->max_rx_queues = queue_num;
  	info->max_tx_queues = hw->tqps_num;
  	info->max_rx_pktlen = HNS3_MAX_FRAME_LEN; /* CRC included */
@@ -38,8 +39,8 @@
 +	info->min_rx_bufsize = HNS3_MIN_BD_BUF_SIZE;
  	info->max_mac_addrs = HNS3_UC_MACADDR_NUM;
  	info->max_mtu = info->max_rx_pktlen - HNS3_ETH_OVERHEAD;
- 	info->max_lro_pkt_size = HNS3_MAX_LRO_SIZE;
-@@ -2848,7 +2848,6 @@ hns3_get_board_configuration(struct hns3_hw *hw)
+ 	info->rx_offload_capa = (DEV_RX_OFFLOAD_IPV4_CKSUM |
+@@ -2709,7 +2709,6 @@ hns3_get_board_configuration(struct hns3_hw *hw)
  	hw->mac.media_type = cfg.media_type;
  	hw->rss_size_max = cfg.rss_size_max;
  	hw->rss_dis_flag = false;
@@ -48,10 +49,10 @@
  	hw->mac.phy_addr = cfg.phy_addr;
  	hw->mac.default_addr_setted = false;
 diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h
-index c390263bd..3c991f4ce 100644
+index e7d9fe0e0..155099e99 100644
 --- a/drivers/net/hns3/hns3_ethdev.h
 +++ b/drivers/net/hns3/hns3_ethdev.h
-@@ -375,7 +375,6 @@ struct hns3_hw {
+@@ -363,7 +363,6 @@ struct hns3_hw {
  	uint16_t tqps_num;          /* num task queue pairs of this function */
  	uint16_t intr_tqps_num;     /* num queue pairs mapping interrupt */
  	uint16_t rss_size_max;      /* HW defined max RSS task queue */
@@ -60,10 +61,10 @@
  	uint16_t num_rx_desc;       /* desc num of per rx queue */
  
 diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
-index 9c45ffae2..3c5998abe 100644
+index 22cd9eb33..a2867f8ec 100644
 --- a/drivers/net/hns3/hns3_ethdev_vf.c
 +++ b/drivers/net/hns3/hns3_ethdev_vf.c
-@@ -902,7 +902,7 @@ hns3vf_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
+@@ -652,7 +652,7 @@ hns3vf_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
  	info->max_rx_queues = q_num;
  	info->max_tx_queues = hw->tqps_num;
  	info->max_rx_pktlen = HNS3_MAX_FRAME_LEN; /* CRC included */
@@ -71,8 +72,8 @@
 +	info->min_rx_bufsize = HNS3_MIN_BD_BUF_SIZE;
  	info->max_mac_addrs = HNS3_VF_UC_MACADDR_NUM;
  	info->max_mtu = info->max_rx_pktlen - HNS3_ETH_OVERHEAD;
- 	info->max_lro_pkt_size = HNS3_MAX_LRO_SIZE;
-@@ -1096,8 +1096,6 @@ hns3vf_check_tqp_info(struct hns3_hw *hw)
+ 
+@@ -816,8 +816,6 @@ hns3vf_check_tqp_info(struct hns3_hw *hw)
  		return -EINVAL;
  	}
  
@@ -81,7 +82,7 @@
  	hw->alloc_rss_size = RTE_MIN(hw->rss_size_max, hw->tqps_num);
  
  	return 0;
-@@ -1162,7 +1160,6 @@ hns3vf_get_queue_info(struct hns3_hw *hw)
+@@ -839,7 +837,6 @@ hns3vf_get_queue_info(struct hns3_hw *hw)
  
  	memcpy(&hw->tqps_num, &resp_msg[0], sizeof(uint16_t));
  	memcpy(&hw->rss_size_max, &resp_msg[2], sizeof(uint16_t));
@@ -90,10 +91,10 @@
  	return hns3vf_check_tqp_info(hw);
  }
 diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
-index 0f9825f74..931d89a1a 100644
+index 3251515fe..c1ffa136b 100644
 --- a/drivers/net/hns3/hns3_rxtx.c
 +++ b/drivers/net/hns3/hns3_rxtx.c
-@@ -909,7 +909,7 @@ hns3_fake_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx,
+@@ -884,7 +884,7 @@ hns3_fake_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx,
  	nb_rx_q = dev->data->nb_rx_queues;
  	rxq->io_base = (void *)((char *)hw->io_base + HNS3_TQP_REG_OFFSET +
  				(nb_rx_q + idx) * HNS3_TQP_REG_SIZE);
@@ -102,7 +103,7 @@
  
  	rte_spinlock_lock(&hw->lock);
  	hw->fkq_data.rx_queues[idx] = rxq;
-@@ -1185,6 +1185,48 @@ hns3_dev_release_mbufs(struct hns3_adapter *hns)
+@@ -1160,6 +1160,48 @@ hns3_dev_release_mbufs(struct hns3_adapter *hns)
  		}
  }
  
@@ -151,7 +152,7 @@
  int
  hns3_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t nb_desc,
  		    unsigned int socket_id, const struct rte_eth_rxconf *conf,
-@@ -1194,6 +1236,7 @@ hns3_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t nb_desc,
+@@ -1169,6 +1211,7 @@ hns3_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t nb_desc,
  	struct hns3_hw *hw = &hns->hw;
  	struct hns3_queue_info q_info;
  	struct hns3_rx_queue *rxq;
@@ -159,7 +160,7 @@
  	int rx_entry_len;
  
  	if (dev->data->dev_started) {
-@@ -1218,6 +1261,15 @@ hns3_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t nb_desc,
+@@ -1193,6 +1236,15 @@ hns3_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t nb_desc,
  	q_info.nb_desc = nb_desc;
  	q_info.type = "hns3 RX queue";
  	q_info.ring_name = "rx_ring";
@@ -175,7 +176,7 @@
  	rxq = hns3_alloc_rxq_and_dma_zone(dev, &q_info);
  	if (rxq == NULL) {
  		hns3_err(hw,
-@@ -1252,7 +1304,7 @@ hns3_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t nb_desc,
+@@ -1226,7 +1278,7 @@ hns3_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t nb_desc,
  	rxq->configured = true;
  	rxq->io_base = (void *)((char *)hw->io_base + HNS3_TQP_REG_OFFSET +
  				idx * HNS3_TQP_REG_SIZE);
@@ -185,7 +186,7 @@
  	rxq->pkt_len_errors = 0;
  	rxq->l3_csum_erros = 0;
 diff --git a/drivers/net/hns3/hns3_rxtx.h b/drivers/net/hns3/hns3_rxtx.h
-index b85c64f65..ccd508b74 100644
+index 771f3c9be..1fd1afd1d 100644
 --- a/drivers/net/hns3/hns3_rxtx.h
 +++ b/drivers/net/hns3/hns3_rxtx.h
 @@ -11,6 +11,14 @@

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

* [dpdk-stable] patch 'net/hinic/base: check output of management sync channel' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (110 preceding siblings ...)
  2020-07-24 11:59 ` [dpdk-stable] patch 'net/hns3: fix Rx buffer size' " luca.boccassi
@ 2020-07-24 11:59 ` " luca.boccassi
  2020-07-24 11:59 ` [dpdk-stable] patch 'net/hinic/base: remove unused function parameters' " luca.boccassi
                   ` (79 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:59 UTC (permalink / raw)
  To: Xiaoyun Wang; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 8c67f69848d837e25707254c876eb5f61f166df8 Mon Sep 17 00:00:00 2001
From: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
Date: Sat, 27 Jun 2020 11:55:44 +0800
Subject: [PATCH] net/hinic/base: check output of management sync channel

[ upstream commit d807dd7d4cd8e3ef4d42bd945cfb8318e4fef5b6 ]

Add output buffer and out size info for some cmds that use management
sync channel, which can improve dfx capability when sent msg failed.

Fixes: 7fcd6b05b923 ("net/hinic/base: support cmdq mechanism")

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
---
 drivers/net/hinic/base/hinic_pmd_cmdq.c   |  31 ++++--
 drivers/net/hinic/base/hinic_pmd_hwdev.c  | 129 +++++++++++++++-------
 drivers/net/hinic/base/hinic_pmd_niccfg.c |  28 ++---
 drivers/net/hinic/base/hinic_pmd_nicio.c  |  36 ++++--
 4 files changed, 151 insertions(+), 73 deletions(-)

diff --git a/drivers/net/hinic/base/hinic_pmd_cmdq.c b/drivers/net/hinic/base/hinic_pmd_cmdq.c
index 2e98b9c28..1816636c3 100644
--- a/drivers/net/hinic/base/hinic_pmd_cmdq.c
+++ b/drivers/net/hinic/base/hinic_pmd_cmdq.c
@@ -426,27 +426,31 @@ static int hinic_set_cmdq_ctxts(struct hinic_hwdev *hwdev)
 {
 	struct hinic_cmdqs *cmdqs = hwdev->cmdqs;
 	struct hinic_cmdq_ctxt *cmdq_ctxt;
+	struct hinic_cmdq_ctxt cmdq_ctxt_out;
 	enum hinic_cmdq_type cmdq_type;
+	u16 out_size = sizeof(cmdq_ctxt_out);
 	u16 in_size;
 	int err;
 
 	cmdq_type = HINIC_CMDQ_SYNC;
+	memset(&cmdq_ctxt_out, 0, out_size);
 	for (; cmdq_type < HINIC_MAX_CMDQ_TYPES; cmdq_type++) {
 		cmdq_ctxt = &cmdqs->cmdq[cmdq_type].cmdq_ctxt;
 		cmdq_ctxt->resp_aeq_num = HINIC_AEQ1;
 		in_size = sizeof(*cmdq_ctxt);
 		err = hinic_msg_to_mgmt_sync(hwdev, HINIC_MOD_COMM,
 					     HINIC_MGMT_CMD_CMDQ_CTXT_SET,
-					     cmdq_ctxt, in_size, NULL,
-					     NULL, 0);
-		if (err) {
+					     cmdq_ctxt, in_size, &cmdq_ctxt_out,
+					     &out_size, 0);
+		if (err || !out_size || cmdq_ctxt_out.status) {
 			if (err == HINIC_MBOX_PF_BUSY_ACTIVE_FW ||
 				err == HINIC_DEV_BUSY_ACTIVE_FW) {
 				cmdqs->status |= HINIC_CMDQ_SET_FAIL;
 				PMD_DRV_LOG(ERR, "PF or VF fw is hot active");
 			}
-			PMD_DRV_LOG(ERR, "Set cmdq ctxt failed, err: %d", err);
-			return -EFAULT;
+			PMD_DRV_LOG(ERR, "Set cmdq ctxt failed, err: %d, status: 0x%x, out_size: 0x%x",
+				err, cmdq_ctxt_out.status, out_size);
+			return -EIO;
 		}
 	}
 
@@ -631,6 +635,8 @@ static void hinic_cmdqs_free(struct hinic_hwdev *hwdev)
 static int hinic_set_cmdq_depth(struct hinic_hwdev *hwdev, u16 cmdq_depth)
 {
 	struct hinic_root_ctxt root_ctxt;
+	u16 out_size = sizeof(root_ctxt);
+	int err;
 
 	memset(&root_ctxt, 0, sizeof(root_ctxt));
 	root_ctxt.mgmt_msg_head.resp_aeq_num = HINIC_AEQ1;
@@ -638,10 +644,17 @@ static int hinic_set_cmdq_depth(struct hinic_hwdev *hwdev, u16 cmdq_depth)
 	root_ctxt.ppf_idx = hinic_ppf_idx(hwdev);
 	root_ctxt.set_cmdq_depth = 1;
 	root_ctxt.cmdq_depth = (u8)ilog2(cmdq_depth);
-	return hinic_msg_to_mgmt_sync(hwdev, HINIC_MOD_COMM,
-				      HINIC_MGMT_CMD_VAT_SET,
-				      &root_ctxt, sizeof(root_ctxt),
-				      NULL, NULL, 0);
+	err = hinic_msg_to_mgmt_sync(hwdev, HINIC_MOD_COMM,
+				     HINIC_MGMT_CMD_VAT_SET,
+				     &root_ctxt, sizeof(root_ctxt),
+				     &root_ctxt, &out_size, 0);
+	if (err || !out_size || root_ctxt.mgmt_msg_head.status) {
+		PMD_DRV_LOG(ERR, "Set cmdq depth failed, err: %d, status: 0x%x, out_size: 0x%x",
+			err, root_ctxt.mgmt_msg_head.status, out_size);
+		return -EIO;
+	}
+
+	return 0;
 }
 
 int hinic_comm_cmdqs_init(struct hinic_hwdev *hwdev)
diff --git a/drivers/net/hinic/base/hinic_pmd_hwdev.c b/drivers/net/hinic/base/hinic_pmd_hwdev.c
index fc11ecd7a..45b976536 100644
--- a/drivers/net/hinic/base/hinic_pmd_hwdev.c
+++ b/drivers/net/hinic/base/hinic_pmd_hwdev.c
@@ -390,6 +390,8 @@ void hinic_osdep_deinit(struct hinic_hwdev *hwdev)
 int hinic_set_ci_table(void *hwdev, u16 q_id, struct hinic_sq_attr *attr)
 {
 	struct hinic_cons_idx_attr cons_idx_attr;
+	u16 out_size = sizeof(cons_idx_attr);
+	int err;
 
 	memset(&cons_idx_attr, 0, sizeof(cons_idx_attr));
 	cons_idx_attr.mgmt_msg_head.resp_aeq_num = HINIC_AEQ1;
@@ -406,10 +408,17 @@ int hinic_set_ci_table(void *hwdev, u16 q_id, struct hinic_sq_attr *attr)
 	cons_idx_attr.sq_id = q_id;
 	cons_idx_attr.ci_addr = attr->ci_dma_base;
 
-	return hinic_msg_to_mgmt_sync(hwdev, HINIC_MOD_COMM,
+	err = hinic_msg_to_mgmt_sync(hwdev, HINIC_MOD_COMM,
 				      HINIC_MGMT_CMD_L2NIC_SQ_CI_ATTR_SET,
 				      &cons_idx_attr, sizeof(cons_idx_attr),
-				      NULL, NULL, 0);
+				      &cons_idx_attr, &out_size, 0);
+	if (err || !out_size || cons_idx_attr.mgmt_msg_head.status) {
+		PMD_DRV_LOG(ERR, "Set ci attribute table failed, err: %d, status: 0x%x, out_size: 0x%x",
+			err, cons_idx_attr.mgmt_msg_head.status, out_size);
+		return -EIO;
+	}
+
+	return 0;
 }
 
 /**
@@ -422,7 +431,9 @@ int hinic_set_ci_table(void *hwdev, u16 q_id, struct hinic_sq_attr *attr)
  */
 int hinic_set_pagesize(void *hwdev, u8 page_size)
 {
-	struct hinic_page_size cmd;
+	struct hinic_page_size page_size_info;
+	u16 out_size = sizeof(page_size_info);
+	int err;
 
 	if (page_size > HINIC_PAGE_SIZE_MAX) {
 		PMD_DRV_LOG(ERR, "Invalid page_size %u, bigger than %u",
@@ -430,16 +441,23 @@ int hinic_set_pagesize(void *hwdev, u8 page_size)
 		return -EINVAL;
 	}
 
-	memset(&cmd, 0, sizeof(cmd));
-	cmd.mgmt_msg_head.resp_aeq_num = HINIC_AEQ1;
-	cmd.func_idx = hinic_global_func_id(hwdev);
-	cmd.ppf_idx = hinic_ppf_idx(hwdev);
-	cmd.page_size = page_size;
+	memset(&page_size_info, 0, sizeof(page_size_info));
+	page_size_info.mgmt_msg_head.resp_aeq_num = HINIC_AEQ1;
+	page_size_info.func_idx = hinic_global_func_id(hwdev);
+	page_size_info.ppf_idx = hinic_ppf_idx(hwdev);
+	page_size_info.page_size = page_size;
 
-	return hinic_msg_to_mgmt_sync(hwdev, HINIC_MOD_COMM,
-					HINIC_MGMT_CMD_PAGESIZE_SET,
-					&cmd, sizeof(cmd),
-					NULL, NULL, 0);
+	err = hinic_msg_to_mgmt_sync(hwdev, HINIC_MOD_COMM,
+				     HINIC_MGMT_CMD_PAGESIZE_SET,
+				     &page_size_info, sizeof(page_size_info),
+				     &page_size_info, &out_size, 0);
+	if (err || !out_size || page_size_info.mgmt_msg_head.status) {
+		PMD_DRV_LOG(ERR, "Set wq page size failed, err: %d, status: 0x%x, out_size: 0x%0x",
+			err, page_size_info.mgmt_msg_head.status, out_size);
+		return -EIO;
+	}
+
+	return 0;
 }
 
 static int wait_for_flr_finish(struct hinic_hwif *hwif)
@@ -546,7 +564,9 @@ static int hinic_pf_rx_tx_flush(struct hinic_hwdev *hwdev)
 	struct hinic_hwif *hwif = hwdev->hwif;
 	struct hinic_clear_doorbell clear_db;
 	struct hinic_clear_resource clr_res;
+	u16 out_size;
 	int err;
+	int ret = 0;
 
 	rte_delay_ms(100);
 
@@ -557,15 +577,19 @@ static int hinic_pf_rx_tx_flush(struct hinic_hwdev *hwdev)
 	}
 
 	hinic_disable_doorbell(hwif);
+	out_size = sizeof(clear_db);
 	memset(&clear_db, 0, sizeof(clear_db));
 	clear_db.mgmt_msg_head.resp_aeq_num = HINIC_AEQ1;
 	clear_db.func_idx = HINIC_HWIF_GLOBAL_IDX(hwif);
 	clear_db.ppf_idx  = HINIC_HWIF_PPF_IDX(hwif);
 	err = hinic_msg_to_mgmt_sync(hwdev, HINIC_MOD_COMM,
 				     HINIC_MGMT_CMD_FLUSH_DOORBELL, &clear_db,
-				     sizeof(clear_db), NULL, NULL, 0);
-	if (err)
-		PMD_DRV_LOG(WARNING, "Flush doorbell failed");
+				     sizeof(clear_db), &clear_db, &out_size, 0);
+	if (err || !out_size || clear_db.mgmt_msg_head.status) {
+		PMD_DRV_LOG(WARNING, "Flush doorbell failed, err: %d, status: 0x%x, out_size: 0x%x",
+			 err, clear_db.mgmt_msg_head.status, out_size);
+		ret = err ? err : (-EIO);
+	}
 
 	hinic_set_pf_status(hwif, HINIC_PF_STATUS_FLR_START_FLAG);
 	memset(&clr_res, 0, sizeof(clr_res));
@@ -576,20 +600,27 @@ static int hinic_pf_rx_tx_flush(struct hinic_hwdev *hwdev)
 	err = hinic_msg_to_mgmt_no_ack(hwdev, HINIC_MOD_COMM,
 				       HINIC_MGMT_CMD_START_FLR, &clr_res,
 				       sizeof(clr_res), NULL, NULL);
-	if (err)
-		PMD_DRV_LOG(WARNING, "Notice flush message failed");
+	if (err) {
+		PMD_DRV_LOG(WARNING, "Notice flush msg failed, err: %d", err);
+		ret = err;
+	}
 
 	err = wait_for_flr_finish(hwif);
-	if (err)
-		PMD_DRV_LOG(WARNING, "Wait firmware FLR timeout");
+	if (err) {
+		PMD_DRV_LOG(WARNING, "Wait firmware FLR timeout, err: %d", err);
+		ret = err;
+	}
 
 	hinic_enable_doorbell(hwif);
 
 	err = hinic_reinit_cmdq_ctxts(hwdev);
-	if (err)
-		PMD_DRV_LOG(WARNING, "Reinit cmdq failed when pf flush");
+	if (err) {
+		PMD_DRV_LOG(WARNING,
+			    "Reinit cmdq failed when pf flush, err: %d", err);
+		ret = err;
+	}
 
-	return 0;
+	return ret;
 }
 
 int hinic_func_rx_tx_flush(struct hinic_hwdev *hwdev)
@@ -623,9 +654,9 @@ static int hinic_get_interrupt_cfg(struct hinic_hwdev *hwdev,
 				     &msix_cfg, sizeof(msix_cfg),
 				     &msix_cfg, &out_size, 0);
 	if (err || !out_size || msix_cfg.mgmt_msg_head.status) {
-		PMD_DRV_LOG(ERR, "Get interrupt config failed, ret: %d",
-			msix_cfg.mgmt_msg_head.status);
-		return -EINVAL;
+		PMD_DRV_LOG(ERR, "Get interrupt config failed, err: %d, status: 0x%x, out size: 0x%x",
+			err, msix_cfg.mgmt_msg_head.status, out_size);
+		return -EIO;
 	}
 
 	interrupt_info->lli_credit_limit = msix_cfg.lli_credit_cnt;
@@ -683,9 +714,9 @@ int hinic_set_interrupt_cfg(struct hinic_hwdev *hwdev,
 				     &msix_cfg, sizeof(msix_cfg),
 				     &msix_cfg, &out_size, 0);
 	if (err || !out_size || msix_cfg.mgmt_msg_head.status) {
-		PMD_DRV_LOG(ERR, "Set interrupt config failed, ret: %d",
-			msix_cfg.mgmt_msg_head.status);
-		return -EINVAL;
+		PMD_DRV_LOG(ERR, "Set interrupt config failed, err: %d, status: 0x%x, out size: 0x%x",
+			err, msix_cfg.mgmt_msg_head.status, out_size);
+		return -EIO;
 	}
 
 	return 0;
@@ -770,6 +801,8 @@ static int set_vf_dma_attr_entry(struct hinic_hwdev *hwdev, u8 entry_idx,
 				enum hinic_pcie_tph tph_en)
 {
 	struct hinic_vf_dma_attr_table attr;
+	u16 out_size = sizeof(attr);
+	int err;
 
 	memset(&attr, 0, sizeof(attr));
 	attr.func_idx = hinic_global_func_id(hwdev);
@@ -782,9 +815,16 @@ static int set_vf_dma_attr_entry(struct hinic_hwdev *hwdev, u8 entry_idx,
 	attr.no_snooping = no_snooping;
 	attr.tph_en = tph_en;
 
-	return hinic_msg_to_mgmt_sync(hwdev, HINIC_MOD_COMM,
-					HINIC_MGMT_CMD_DMA_ATTR_SET,
-					&attr, sizeof(attr), NULL, NULL, 0);
+	err = hinic_msg_to_mgmt_sync(hwdev, HINIC_MOD_COMM,
+				     HINIC_MGMT_CMD_DMA_ATTR_SET,
+				     &attr, sizeof(attr), &attr, &out_size, 0);
+	if (err || !out_size || attr.mgmt_msg_head.status) {
+		PMD_DRV_LOG(ERR, "Set dma attribute failed, err: %d, status: 0x%x, out_size: 0x%x",
+			err, attr.mgmt_msg_head.status, out_size);
+		return -EIO;
+	}
+
+	return 0;
 }
 
 /**
@@ -926,17 +966,26 @@ static void fault_report_show(struct hinic_hwdev *hwdev,
 static int resources_state_set(struct hinic_hwdev *hwdev,
 			       enum hinic_res_state state)
 {
-	struct hinic_hwif *hwif = hwdev->hwif;
 	struct hinic_cmd_set_res_state res_state;
+	u16 out_size = sizeof(res_state);
+	int err;
 
 	memset(&res_state, 0, sizeof(res_state));
 	res_state.mgmt_msg_head.resp_aeq_num = HINIC_AEQ1;
-	res_state.func_idx = HINIC_HWIF_GLOBAL_IDX(hwif);
+	res_state.func_idx = HINIC_HWIF_GLOBAL_IDX(hwdev->hwif);
 	res_state.state = state;
 
-	return hinic_msg_to_mgmt_sync(hwdev, HINIC_MOD_COMM,
+	err = hinic_msg_to_mgmt_sync(hwdev, HINIC_MOD_COMM,
 				 HINIC_MGMT_CMD_RES_STATE_SET,
-				 &res_state, sizeof(res_state), NULL, NULL, 0);
+				 &res_state, sizeof(res_state),
+				 &res_state, &out_size, 0);
+	if (err || !out_size || res_state.mgmt_msg_head.status) {
+		PMD_DRV_LOG(ERR, "Set resources state failed, err: %d, status: 0x%x, out_size: 0x%x",
+			err, res_state.mgmt_msg_head.status, out_size);
+		return -EIO;
+	}
+
+	return 0;
 }
 
 /**
@@ -1020,6 +1069,7 @@ int hinic_l2nic_reset(struct hinic_hwdev *hwdev)
 {
 	struct hinic_hwif *hwif = hwdev->hwif;
 	struct hinic_l2nic_reset l2nic_reset;
+	u16 out_size = sizeof(l2nic_reset);
 	int err = 0;
 
 	err = hinic_set_vport_enable(hwdev, false);
@@ -1036,10 +1086,11 @@ int hinic_l2nic_reset(struct hinic_hwdev *hwdev)
 	err = hinic_msg_to_mgmt_sync(hwdev, HINIC_MOD_COMM,
 				     HINIC_MGMT_CMD_L2NIC_RESET,
 				     &l2nic_reset, sizeof(l2nic_reset),
-				     NULL, NULL, 0);
-	if (err || l2nic_reset.mgmt_msg_head.status) {
-		PMD_DRV_LOG(ERR, "Reset L2NIC resources failed");
-		return -EFAULT;
+				     &l2nic_reset, &out_size, 0);
+	if (err || !out_size || l2nic_reset.mgmt_msg_head.status) {
+		PMD_DRV_LOG(ERR, "Reset L2NIC resources failed, err: %d, status: 0x%x, out_size: 0x%x",
+			err, l2nic_reset.mgmt_msg_head.status, out_size);
+		return -EIO;
 	}
 
 	return 0;
diff --git a/drivers/net/hinic/base/hinic_pmd_niccfg.c b/drivers/net/hinic/base/hinic_pmd_niccfg.c
index 2dc431e28..ad81fdde4 100644
--- a/drivers/net/hinic/base/hinic_pmd_niccfg.c
+++ b/drivers/net/hinic/base/hinic_pmd_niccfg.c
@@ -18,7 +18,6 @@
 			buf_in, in_size,			\
 			buf_out, out_size, 0)
 
-
 #define TCAM_SET	0x1
 #define TCAM_CLEAR	0x2
 
@@ -396,9 +395,8 @@ int hinic_add_remove_vlan(void *hwdev, u16 vlan_id, u16 func_id, bool add)
 	vlan_info.func_id = func_id;
 	vlan_info.vlan_id = vlan_id;
 
-	err = l2nic_msg_to_mgmt_sync(hwdev, cmd, &vlan_info,
-				     sizeof(vlan_info), &vlan_info,
-				     &out_size);
+	err = l2nic_msg_to_mgmt_sync(hwdev, cmd, &vlan_info, sizeof(vlan_info),
+				     &vlan_info, &out_size);
 	if (err || !out_size || vlan_info.mgmt_msg_head.status) {
 		PMD_DRV_LOG(ERR,
 			"Failed to %s vlan, err: %d, status: 0x%x, out size: 0x%x\n",
@@ -485,8 +483,8 @@ int hinic_set_rx_vlan_offload(void *hwdev, u8 en)
 	vlan_cfg.vlan_rx_offload = en;
 
 	err = l2nic_msg_to_mgmt_sync(hwdev, HINIC_PORT_CMD_SET_RX_VLAN_OFFLOAD,
-					&vlan_cfg, sizeof(vlan_cfg),
-					&vlan_cfg, &out_size);
+				     &vlan_cfg, sizeof(vlan_cfg),
+				     &vlan_cfg, &out_size);
 	if (err || !out_size || vlan_cfg.mgmt_msg_head.status) {
 		PMD_DRV_LOG(ERR,
 			"Failed to set rx vlan offload, err: %d, status: 0x%x, out size: 0x%x\n",
@@ -642,7 +640,7 @@ int hinic_get_port_info(void *hwdev, struct nic_port_info *port_info)
 		PMD_DRV_LOG(ERR,
 			"Failed to get port info, err: %d, status: 0x%x, out size: 0x%x",
 			err, port_msg.mgmt_msg_head.status, out_size);
-		return err;
+		return -EIO;
 	}
 
 	port_info->autoneg_cap = port_msg.autoneg_cap;
@@ -1258,7 +1256,6 @@ int hinic_set_rx_vhd_mode(void *hwdev, u16 vhd_mode, u16 rx_buf_sz)
 		PMD_DRV_LOG(ERR,
 			"Failed to set vhd mode, err: %d, status: 0x%x, out size: 0x%x",
 			err, vhd_mode_cfg.mgmt_msg_head.status, out_size);
-
 		return -EIO;
 	}
 
@@ -1413,8 +1410,7 @@ int hinic_set_anti_attack(void *hwdev, bool enable)
 	rate.xbs = ANTI_ATTACK_DEFAULT_XBS;
 
 	err = l2nic_msg_to_mgmt_sync(hwdev, HINIC_PORT_CMD_SET_ANTI_ATTACK_RATE,
-				     &rate, sizeof(rate), &rate,
-				     &out_size);
+				     &rate, sizeof(rate), &rate, &out_size);
 	if (err || !out_size || rate.mgmt_msg_head.status) {
 		PMD_DRV_LOG(ERR, "can't %s port Anti-Attack rate limit, err: %d, status: 0x%x, out size: 0x%x",
 			(enable ? "enable" : "disable"), err,
@@ -1518,10 +1514,9 @@ int hinic_set_fast_recycle_mode(void *hwdev, u8 mode)
 				     sizeof(fast_recycled_mode),
 				     &fast_recycled_mode, &out_size, 0);
 	if (err || fast_recycled_mode.mgmt_msg_head.status || !out_size) {
-		PMD_DRV_LOG(ERR,
-			"Failed to set recycle mode, ret = %d",
-			fast_recycled_mode.mgmt_msg_head.status);
-		return -EFAULT;
+		PMD_DRV_LOG(ERR, "Failed to set recycle mode, err: %d, status: 0x%x, out size: 0x%x",
+			err, fast_recycled_mode.mgmt_msg_head.status, out_size);
+		return -EIO;
 	}
 
 	return 0;
@@ -1746,12 +1741,11 @@ int hinic_vf_get_default_cos(struct hinic_hwdev *hwdev, u8 *cos_id)
 
 	err = hinic_msg_to_mgmt_sync(hwdev, HINIC_MOD_L2NIC,
 				     HINIC_PORT_CMD_GET_VF_COS, &vf_cos,
-				     sizeof(vf_cos), &vf_cos,
-				     &out_size, 0);
+				     sizeof(vf_cos), &vf_cos, &out_size, 0);
 	if (err || !out_size || vf_cos.mgmt_msg_head.status) {
 		PMD_DRV_LOG(ERR, "Get VF default cos failed, err: %d, status: 0x%x, out size: 0x%x",
 			err, vf_cos.mgmt_msg_head.status, out_size);
-		return -EFAULT;
+		return -EIO;
 	}
 	*cos_id = vf_cos.state.default_cos;
 
diff --git a/drivers/net/hinic/base/hinic_pmd_nicio.c b/drivers/net/hinic/base/hinic_pmd_nicio.c
index d3e8f2e74..1ce065c6f 100644
--- a/drivers/net/hinic/base/hinic_pmd_nicio.c
+++ b/drivers/net/hinic/base/hinic_pmd_nicio.c
@@ -471,6 +471,8 @@ static int
 hinic_set_root_ctxt(void *hwdev, u16 rq_depth, u16 sq_depth, int rx_buf_sz)
 {
 	struct hinic_root_ctxt root_ctxt;
+	u16 out_size = sizeof(root_ctxt);
+	int err;
 
 	memset(&root_ctxt, 0, sizeof(root_ctxt));
 	root_ctxt.mgmt_msg_head.resp_aeq_num = HINIC_AEQ1;
@@ -483,10 +485,18 @@ hinic_set_root_ctxt(void *hwdev, u16 rq_depth, u16 sq_depth, int rx_buf_sz)
 	root_ctxt.rx_buf_sz = get_hw_rx_buf_size(rx_buf_sz);
 	root_ctxt.sq_depth  = (u16)ilog2(sq_depth);
 
-	return hinic_msg_to_mgmt_sync(hwdev, HINIC_MOD_COMM,
-				      HINIC_MGMT_CMD_VAT_SET,
-				      &root_ctxt, sizeof(root_ctxt),
-				      NULL, NULL, 0);
+	err = hinic_msg_to_mgmt_sync(hwdev, HINIC_MOD_COMM,
+				     HINIC_MGMT_CMD_VAT_SET,
+				     &root_ctxt, sizeof(root_ctxt),
+				     &root_ctxt, &out_size, 0);
+	if (err || !out_size || root_ctxt.mgmt_msg_head.status) {
+		PMD_DRV_LOG(ERR,
+			"Set root context failed, err: %d, status: 0x%x, out_size: 0x%x",
+			err, root_ctxt.mgmt_msg_head.status, out_size);
+		return -EIO;
+	}
+
+	return 0;
 }
 
 /**
@@ -499,6 +509,8 @@ hinic_set_root_ctxt(void *hwdev, u16 rq_depth, u16 sq_depth, int rx_buf_sz)
 static int hinic_clean_root_ctxt(void *hwdev)
 {
 	struct hinic_root_ctxt root_ctxt;
+	u16 out_size = sizeof(root_ctxt);
+	int err;
 
 	memset(&root_ctxt, 0, sizeof(root_ctxt));
 	root_ctxt.mgmt_msg_head.resp_aeq_num = HINIC_AEQ1;
@@ -511,10 +523,18 @@ static int hinic_clean_root_ctxt(void *hwdev)
 	root_ctxt.rx_buf_sz = 0;
 	root_ctxt.sq_depth  = 0;
 
-	return hinic_msg_to_mgmt_sync(hwdev, HINIC_MOD_COMM,
-				      HINIC_MGMT_CMD_VAT_SET,
-				      &root_ctxt, sizeof(root_ctxt),
-				      NULL, NULL, 0);
+	err = hinic_msg_to_mgmt_sync(hwdev, HINIC_MOD_COMM,
+				     HINIC_MGMT_CMD_VAT_SET,
+				     &root_ctxt, sizeof(root_ctxt),
+				     &root_ctxt, &out_size, 0);
+	if (err || !out_size || root_ctxt.mgmt_msg_head.status) {
+		PMD_DRV_LOG(ERR,
+			"Clean root context failed, err: %d, status: 0x%x, out_size: 0x%x",
+			err, root_ctxt.mgmt_msg_head.status, out_size);
+		return -EIO;
+	}
+
+	return 0;
 }
 
 /* init qps ctxt and set sq ci attr and arm all sq and set vat page_size */
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:52.898934974 +0100
+++ 0113-net-hinic-base-check-output-of-management-sync-chann.patch	2020-07-24 12:53:48.379008173 +0100
@@ -1,21 +1,22 @@
-From d807dd7d4cd8e3ef4d42bd945cfb8318e4fef5b6 Mon Sep 17 00:00:00 2001
+From 8c67f69848d837e25707254c876eb5f61f166df8 Mon Sep 17 00:00:00 2001
 From: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
 Date: Sat, 27 Jun 2020 11:55:44 +0800
 Subject: [PATCH] net/hinic/base: check output of management sync channel
 
+[ upstream commit d807dd7d4cd8e3ef4d42bd945cfb8318e4fef5b6 ]
+
 Add output buffer and out size info for some cmds that use management
 sync channel, which can improve dfx capability when sent msg failed.
 
 Fixes: 7fcd6b05b923 ("net/hinic/base: support cmdq mechanism")
-Cc: stable@dpdk.org
 
 Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
 ---
  drivers/net/hinic/base/hinic_pmd_cmdq.c   |  31 ++++--
  drivers/net/hinic/base/hinic_pmd_hwdev.c  | 129 +++++++++++++++-------
- drivers/net/hinic/base/hinic_pmd_niccfg.c |  27 ++---
+ drivers/net/hinic/base/hinic_pmd_niccfg.c |  28 ++---
  drivers/net/hinic/base/hinic_pmd_nicio.c  |  36 ++++--
- 4 files changed, 151 insertions(+), 72 deletions(-)
+ 4 files changed, 151 insertions(+), 73 deletions(-)
 
 diff --git a/drivers/net/hinic/base/hinic_pmd_cmdq.c b/drivers/net/hinic/base/hinic_pmd_cmdq.c
 index 2e98b9c28..1816636c3 100644
@@ -90,7 +91,7 @@
  
  int hinic_comm_cmdqs_init(struct hinic_hwdev *hwdev)
 diff --git a/drivers/net/hinic/base/hinic_pmd_hwdev.c b/drivers/net/hinic/base/hinic_pmd_hwdev.c
-index cc4207678..c132de09e 100644
+index fc11ecd7a..45b976536 100644
 --- a/drivers/net/hinic/base/hinic_pmd_hwdev.c
 +++ b/drivers/net/hinic/base/hinic_pmd_hwdev.c
 @@ -390,6 +390,8 @@ void hinic_osdep_deinit(struct hinic_hwdev *hwdev)
@@ -345,7 +346,7 @@
  
  	return 0;
 diff --git a/drivers/net/hinic/base/hinic_pmd_niccfg.c b/drivers/net/hinic/base/hinic_pmd_niccfg.c
-index c5663dfab..e894503d7 100644
+index 2dc431e28..ad81fdde4 100644
 --- a/drivers/net/hinic/base/hinic_pmd_niccfg.c
 +++ b/drivers/net/hinic/base/hinic_pmd_niccfg.c
 @@ -18,7 +18,6 @@
@@ -353,10 +354,10 @@
  			buf_out, out_size, 0)
  
 -
- /**
-  * hinic_init_function_table - Initialize function table.
-  *
-@@ -380,9 +379,8 @@ int hinic_add_remove_vlan(void *hwdev, u16 vlan_id, u16 func_id, bool add)
+ #define TCAM_SET	0x1
+ #define TCAM_CLEAR	0x2
+ 
+@@ -396,9 +395,8 @@ int hinic_add_remove_vlan(void *hwdev, u16 vlan_id, u16 func_id, bool add)
  	vlan_info.func_id = func_id;
  	vlan_info.vlan_id = vlan_id;
  
@@ -367,8 +368,8 @@
 +				     &vlan_info, &out_size);
  	if (err || !out_size || vlan_info.mgmt_msg_head.status) {
  		PMD_DRV_LOG(ERR,
- 			"Failed to %s vlan, err: %d, status: 0x%x, out size: 0x%x",
-@@ -469,8 +467,8 @@ int hinic_set_rx_vlan_offload(void *hwdev, u8 en)
+ 			"Failed to %s vlan, err: %d, status: 0x%x, out size: 0x%x\n",
+@@ -485,8 +483,8 @@ int hinic_set_rx_vlan_offload(void *hwdev, u8 en)
  	vlan_cfg.vlan_rx_offload = en;
  
  	err = l2nic_msg_to_mgmt_sync(hwdev, HINIC_PORT_CMD_SET_RX_VLAN_OFFLOAD,
@@ -378,8 +379,8 @@
 +				     &vlan_cfg, &out_size);
  	if (err || !out_size || vlan_cfg.mgmt_msg_head.status) {
  		PMD_DRV_LOG(ERR,
- 			"Failed to set rx vlan offload, err: %d, status: 0x%x, out size: 0x%x",
-@@ -626,7 +624,7 @@ int hinic_get_port_info(void *hwdev, struct nic_port_info *port_info)
+ 			"Failed to set rx vlan offload, err: %d, status: 0x%x, out size: 0x%x\n",
+@@ -642,7 +640,7 @@ int hinic_get_port_info(void *hwdev, struct nic_port_info *port_info)
  		PMD_DRV_LOG(ERR,
  			"Failed to get port info, err: %d, status: 0x%x, out size: 0x%x",
  			err, port_msg.mgmt_msg_head.status, out_size);
@@ -388,7 +389,7 @@
  	}
  
  	port_info->autoneg_cap = port_msg.autoneg_cap;
-@@ -1270,7 +1268,6 @@ int hinic_set_rx_vhd_mode(void *hwdev, u16 vhd_mode, u16 rx_buf_sz)
+@@ -1258,7 +1256,6 @@ int hinic_set_rx_vhd_mode(void *hwdev, u16 vhd_mode, u16 rx_buf_sz)
  		PMD_DRV_LOG(ERR,
  			"Failed to set vhd mode, err: %d, status: 0x%x, out size: 0x%x",
  			err, vhd_mode_cfg.mgmt_msg_head.status, out_size);
@@ -396,7 +397,7 @@
  		return -EIO;
  	}
  
-@@ -1425,8 +1422,7 @@ int hinic_set_anti_attack(void *hwdev, bool enable)
+@@ -1413,8 +1410,7 @@ int hinic_set_anti_attack(void *hwdev, bool enable)
  	rate.xbs = ANTI_ATTACK_DEFAULT_XBS;
  
  	err = l2nic_msg_to_mgmt_sync(hwdev, HINIC_PORT_CMD_SET_ANTI_ATTACK_RATE,
@@ -404,13 +405,14 @@
 -				     &out_size);
 +				     &rate, sizeof(rate), &rate, &out_size);
  	if (err || !out_size || rate.mgmt_msg_head.status) {
- 		PMD_DRV_LOG(ERR, "Can't %s port Anti-Attack rate limit, err: %d, status: 0x%x, out size: 0x%x",
+ 		PMD_DRV_LOG(ERR, "can't %s port Anti-Attack rate limit, err: %d, status: 0x%x, out size: 0x%x",
  			(enable ? "enable" : "disable"), err,
-@@ -1530,9 +1526,9 @@ int hinic_set_fast_recycle_mode(void *hwdev, u8 mode)
+@@ -1518,10 +1514,9 @@ int hinic_set_fast_recycle_mode(void *hwdev, u8 mode)
  				     sizeof(fast_recycled_mode),
  				     &fast_recycled_mode, &out_size, 0);
  	if (err || fast_recycled_mode.mgmt_msg_head.status || !out_size) {
--		PMD_DRV_LOG(ERR, "Failed to set recycle mode, ret: %d",
+-		PMD_DRV_LOG(ERR,
+-			"Failed to set recycle mode, ret = %d",
 -			fast_recycled_mode.mgmt_msg_head.status);
 -		return -EFAULT;
 +		PMD_DRV_LOG(ERR, "Failed to set recycle mode, err: %d, status: 0x%x, out size: 0x%x",
@@ -419,7 +421,7 @@
  	}
  
  	return 0;
-@@ -1756,12 +1752,11 @@ int hinic_vf_get_default_cos(struct hinic_hwdev *hwdev, u8 *cos_id)
+@@ -1746,12 +1741,11 @@ int hinic_vf_get_default_cos(struct hinic_hwdev *hwdev, u8 *cos_id)
  
  	err = hinic_msg_to_mgmt_sync(hwdev, HINIC_MOD_L2NIC,
  				     HINIC_PORT_CMD_GET_VF_COS, &vf_cos,
@@ -435,7 +437,7 @@
  	*cos_id = vf_cos.state.default_cos;
  
 diff --git a/drivers/net/hinic/base/hinic_pmd_nicio.c b/drivers/net/hinic/base/hinic_pmd_nicio.c
-index 7f7e11dbd..7ec3e4ce7 100644
+index d3e8f2e74..1ce065c6f 100644
 --- a/drivers/net/hinic/base/hinic_pmd_nicio.c
 +++ b/drivers/net/hinic/base/hinic_pmd_nicio.c
 @@ -471,6 +471,8 @@ static int

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

* [dpdk-stable] patch 'net/hinic/base: remove unused function parameters' has been queued to stable release 19.11.4
  2020-07-24 11:57 [dpdk-stable] patch 'vhost: remove zero-copy and client mode restriction' has been queued to stable release 19.11.4 luca.boccassi
                   ` (111 preceding siblings ...)
  2020-07-24 11:59 ` [dpdk-stable] patch 'net/hinic/base: check output of management sync channel' " luca.boccassi
@ 2020-07-24 11:59 ` " luca.boccassi
  2020-07-24 11:59 ` [dpdk-stable] patch 'net/hinic: fix setting promiscuous mode' " luca.boccassi
                   ` (78 subsequent siblings)
  191 siblings, 0 replies; 241+ messages in thread
From: luca.boccassi @ 2020-07-24 11:59 UTC (permalink / raw)
  To: Xiaoyun Wang; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 19.11.4

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

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

Thanks.

Luca Boccassi

---
From 5cae30960b80367cc858c79fdd04a951db88699d Mon Sep 17 00:00:00 2001
From: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
Date: Sat, 27 Jun 2020 11:55:45 +0800
Subject: [PATCH] net/hinic/base: remove unused function parameters

[ upstream commit 214164a6bf7f840c3f111430c4e7d6373195afe1 ]

Remove unused parameters for mgmt channel with no ack.

Fixes: a4957d87e05a ("net/hinic/base: add mgmt module")

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
---
 drivers/net/hinic/base/hinic_pmd_hwdev.c | 2 +-
 drivers/net/hinic/base/hinic_pmd_mgmt.c  | 3 +--
 drivers/net/hinic/base/hinic_pmd_mgmt.h  | 3 +--
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/net/hinic/base/hinic_pmd_hwdev.c b/drivers/net/hinic/base/hinic_pmd_hwdev.c
index 45b976536..8a0faa697 100644
--- a/drivers/net/hinic/base/hinic_pmd_hwdev.c
+++ b/drivers/net/hinic/base/hinic_pmd_hwdev.c
@@ -599,7 +599,7 @@ static int hinic_pf_rx_tx_flush(struct hinic_hwdev *hwdev)
 
 	err = hinic_msg_to_mgmt_no_ack(hwdev, HINIC_MOD_COMM,
 				       HINIC_MGMT_CMD_START_FLR, &clr_res,
-				       sizeof(clr_res), NULL, NULL);
+				       sizeof(clr_res));
 	if (err) {
 		PMD_DRV_LOG(WARNING, "Notice flush msg failed, err: %d", err);
 		ret = err;
diff --git a/drivers/net/hinic/base/hinic_pmd_mgmt.c b/drivers/net/hinic/base/hinic_pmd_mgmt.c
index ea79c300a..a57036d53 100644
--- a/drivers/net/hinic/base/hinic_pmd_mgmt.c
+++ b/drivers/net/hinic/base/hinic_pmd_mgmt.c
@@ -504,8 +504,7