DPDK patches and discussions
 help / color / mirror / Atom feed
From: Qi Zhang <qi.z.zhang@intel.com>
To: qiming.yang@intel.com
Cc: haiyue.wang@intel.com, jia.guo@intel.com, dev@dpdk.org,
	ferruh.yigit@intel.com, Qi Zhang <qi.z.zhang@intel.com>,
	stable@dpdk.org, Victor Raj <victor.raj@intel.com>
Subject: [dpdk-dev] [PATCH 8/9] net/ice/base: updated the add scheduler node counter
Date: Fri,  8 Jan 2021 12:35:07 +0800
Message-ID: <20210108043508.301227-9-qi.z.zhang@intel.com> (raw)
In-Reply-To: <20210108043508.301227-1-qi.z.zhang@intel.com>

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


  parent reply	other threads:[~2021-01-08  4:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-08  4:34 [dpdk-dev] [PATCH 0/9] ice base update batch 2 Qi Zhang
2021-01-08  4:35 ` [dpdk-dev] [PATCH 1/9] net/ice/base: align add VSI and update VSI AQ command buffer Qi Zhang
2021-01-08  4:35 ` [dpdk-dev] [PATCH 2/9] net/ice/base: remove the deprecated field Qi Zhang
2021-01-08  4:35 ` [dpdk-dev] [PATCH 3/9] net/ice/base: add package PTYPE enable information Qi Zhang
2021-01-08  4:35 ` [dpdk-dev] [PATCH 4/9] net/ice/base: fix for memory handling Qi Zhang
2021-01-08  4:35 ` [dpdk-dev] [PATCH 5/9] net/ice/base: limit forced overrides based on FW version Qi Zhang
2021-01-08  4:35 ` [dpdk-dev] [PATCH 6/9] net/ice/base: support GTPU inner for AVF FDIR Qi Zhang
2021-01-08  4:35 ` [dpdk-dev] [PATCH 7/9] net/ice/base: cleanup style issues Qi Zhang
2021-01-08  4:35 ` Qi Zhang [this message]
2021-01-08  4:35 ` [dpdk-dev] [PATCH 9/9] net/ice/base: update Copyright date Qi Zhang
2021-01-08  6:05 ` [dpdk-dev] [PATCH 0/9] ice base update batch 2 Yang, Qiming
2021-01-08  8:06   ` Zhang, Qi Z
2021-01-08 18:14     ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210108043508.301227-9-qi.z.zhang@intel.com \
    --to=qi.z.zhang@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=haiyue.wang@intel.com \
    --cc=jia.guo@intel.com \
    --cc=qiming.yang@intel.com \
    --cc=stable@dpdk.org \
    --cc=victor.raj@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git