patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 4/9] net/ice/base: fix for memory handling
       [not found] <20210108043508.301227-1-qi.z.zhang@intel.com>
@ 2021-01-08  4:35 ` Qi Zhang
  2021-01-08  4:35 ` [dpdk-stable] [PATCH 8/9] net/ice/base: updated the add scheduler node counter Qi Zhang
  1 sibling, 0 replies; 2+ messages in thread
From: Qi Zhang @ 2021-01-08  4:35 UTC (permalink / raw)
  To: qiming.yang
  Cc: haiyue.wang, jia.guo, dev, ferruh.yigit, Qi Zhang, stable,
	Andrii Pypchenko

Fixed memory handling when memory allocated in user space was handled
as memory allocated in kernel space within QV os_dep implementation
of the ice_memdup function.

Fixes: 93e84b1bfc92 ("net/ice/base: add basic Tx scheduler")
Cc: stable@dpdk.org

Signed-off-by: Andrii Pypchenko <andrii.pypchenko@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ice/base/ice_sched.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ice/base/ice_sched.c b/drivers/net/ice/base/ice_sched.c
index b75a44f54c..1cce8eaff1 100644
--- a/drivers/net/ice/base/ice_sched.c
+++ b/drivers/net/ice/base/ice_sched.c
@@ -1361,7 +1361,7 @@ enum ice_status ice_sched_query_res_alloc(struct ice_hw *hw)
 			 ice_memdup(hw, buf->layer_props,
 				    (hw->num_tx_sched_layers *
 				     sizeof(*hw->layer_info)),
-				    ICE_DMA_TO_DMA);
+				    ICE_NONDMA_TO_NONDMA);
 	if (!hw->layer_info) {
 		status = ICE_ERR_NO_MEMORY;
 		goto sched_query_out;
-- 
2.26.2


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

* [dpdk-stable] [PATCH 8/9] net/ice/base: updated the add scheduler node counter
       [not found] <20210108043508.301227-1-qi.z.zhang@intel.com>
  2021-01-08  4:35 ` [dpdk-stable] [PATCH 4/9] net/ice/base: fix for memory handling Qi Zhang
@ 2021-01-08  4:35 ` Qi Zhang
  1 sibling, 0 replies; 2+ messages in thread
From: Qi Zhang @ 2021-01-08  4:35 UTC (permalink / raw)
  To: qiming.yang
  Cc: haiyue.wang, jia.guo, dev, ferruh.yigit, Qi Zhang, stable, Victor Raj

The number of nodes added counter was updated incorrectly. This issue
was exposed when the driver tried to add more than 128 queues per TC.

Fix added to update the counter correctly.

Fixes: 93e84b1bfc92 ("net/ice/base: add basic Tx scheduler")
Cc: stable@dpdk.org

Signed-off-by: Victor Raj <victor.raj@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ice/base/ice_sched.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ice/base/ice_sched.c b/drivers/net/ice/base/ice_sched.c
index 53d76d17ee..7d4721e60c 100644
--- a/drivers/net/ice/base/ice_sched.c
+++ b/drivers/net/ice/base/ice_sched.c
@@ -1040,7 +1040,15 @@ ice_sched_add_nodes_to_layer(struct ice_port_info *pi,
 							 layer,	new_num_nodes,
 							 first_teid_ptr,
 							 &num_added);
-		*num_nodes_added += num_added;
+		if (status == ICE_SUCCESS)
+			*num_nodes_added += num_added;
+		/* added more nodes than requested ? */
+		if (*num_nodes_added > num_nodes) {
+			ice_debug(pi->hw, ICE_DBG_SCHED, "added extra nodes %d %d\n", num_nodes,
+				  *num_nodes_added);
+			status = ICE_ERR_CFG;
+			break;
+		}
 		/* break if all the nodes are added successfully */
 		if (status == ICE_SUCCESS && (*num_nodes_added == num_nodes))
 			break;
@@ -1063,7 +1071,7 @@ ice_sched_add_nodes_to_layer(struct ice_port_info *pi,
 			if (num_added)
 				first_teid_ptr = &temp;
 
-			new_num_nodes = num_nodes - num_added;
+			new_num_nodes = num_nodes - *num_nodes_added;
 		}
 	}
 	return status;
-- 
2.26.2


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

end of thread, other threads:[~2021-01-08  4:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20210108043508.301227-1-qi.z.zhang@intel.com>
2021-01-08  4:35 ` [dpdk-stable] [PATCH 4/9] net/ice/base: fix for memory handling Qi Zhang
2021-01-08  4:35 ` [dpdk-stable] [PATCH 8/9] net/ice/base: updated the add scheduler node counter Qi Zhang

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