DPDK patches and discussions
 help / color / mirror / Atom feed
From: Wenzhuo Lu <wenzhuo.lu@intel.com>
To: dev@dpdk.org
Cc: Wenzhuo Lu <wenzhuo.lu@intel.com>
Subject: [dpdk-dev] [PATCH v2 3/7] net/ixgbe: fix TM node parameter checking
Date: Tue, 17 Oct 2017 13:50:36 +0800	[thread overview]
Message-ID: <1508219440-97150-4-git-send-email-wenzhuo.lu@intel.com> (raw)
In-Reply-To: <1508219440-97150-1-git-send-email-wenzhuo.lu@intel.com>

Only queue nodes should be taken as leaf nodes, all
the other nodes are non-leaf nodes.
Correct it when checking the parameters of the TM
nodes.

Fixes: e0ff4d304ccf ("net/ixgbe: support adding TM node")
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
 drivers/net/ixgbe/ixgbe_tm.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_tm.c b/drivers/net/ixgbe/ixgbe_tm.c
index cdcf45c..e7d8d39 100644
--- a/drivers/net/ixgbe/ixgbe_tm.c
+++ b/drivers/net/ixgbe/ixgbe_tm.c
@@ -482,7 +482,7 @@ static int ixgbe_hierarchy_commit(struct rte_eth_dev *dev,
 }
 
 static int
-ixgbe_node_param_check(uint32_t node_id, uint32_t parent_node_id,
+ixgbe_node_param_check(struct rte_eth_dev *dev, uint32_t node_id,
 		       uint32_t priority, uint32_t weight,
 		       struct rte_tm_node_params *params,
 		       struct rte_tm_error *error)
@@ -517,8 +517,8 @@ static int ixgbe_hierarchy_commit(struct rte_eth_dev *dev,
 		return -EINVAL;
 	}
 
-	/* for root node */
-	if (parent_node_id == RTE_TM_NODE_ID_NULL) {
+	/* for non-leaf node */
+	if (node_id >= dev->data->nb_tx_queues) {
 		/* check the unsupported parameters */
 		if (params->nonleaf.wfq_weight_mode) {
 			error->type =
@@ -542,7 +542,7 @@ static int ixgbe_hierarchy_commit(struct rte_eth_dev *dev,
 		return 0;
 	}
 
-	/* for TC or queue node */
+	/* for leaf node */
 	/* check the unsupported parameters */
 	if (params->leaf.cman) {
 		error->type = RTE_TM_ERROR_TYPE_NODE_PARAMS_CMAN;
@@ -606,7 +606,7 @@ static int ixgbe_hierarchy_commit(struct rte_eth_dev *dev,
 		return -EINVAL;
 	}
 
-	ret = ixgbe_node_param_check(node_id, parent_node_id, priority, weight,
+	ret = ixgbe_node_param_check(dev, node_id, priority, weight,
 				     params, error);
 	if (ret)
 		return ret;
-- 
1.9.3

  parent reply	other threads:[~2017-10-17  5:49 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-13  2:58 [dpdk-dev] [PATCH 0/6] fix TM (Traffic Management) issues on i40e and ixgbe Wenzhuo Lu
2017-10-13  2:58 ` [dpdk-dev] [PATCH 1/6] net/i40e: fix TM node parameter checking Wenzhuo Lu
2017-10-13  2:58 ` [dpdk-dev] [PATCH 2/6] net/i40e: fix TM level capability getting Wenzhuo Lu
2017-10-13  2:58 ` [dpdk-dev] [PATCH 3/6] net/ixgbe: fix TM node parameter checking Wenzhuo Lu
2017-10-13  2:58 ` [dpdk-dev] [PATCH 4/6] net/ixgbe: fix TM level capability getting Wenzhuo Lu
2017-10-13  2:58 ` [dpdk-dev] [PATCH 5/6] net/i40e: fix not supporting NULL TM profile Wenzhuo Lu
2017-10-13  2:58 ` [dpdk-dev] [PATCH 6/6] net/ixgbe: " Wenzhuo Lu
2017-10-17  5:50 ` [dpdk-dev] [PATCH v2 0/7] fix TM (Traffic Management) issues on i40e and ixgbe Wenzhuo Lu
2017-10-17  5:50   ` [dpdk-dev] [PATCH v2 1/7] net/i40e: fix TM node parameter checking Wenzhuo Lu
2017-10-17  5:50   ` [dpdk-dev] [PATCH v2 2/7] net/i40e: fix TM level capability getting Wenzhuo Lu
2017-10-17  5:50   ` Wenzhuo Lu [this message]
2017-10-17  5:50   ` [dpdk-dev] [PATCH v2 4/7] net/ixgbe: " Wenzhuo Lu
2017-10-17  5:50   ` [dpdk-dev] [PATCH v2 5/7] net/i40e: fix not supporting NULL TM profile Wenzhuo Lu
2017-10-17  5:50   ` [dpdk-dev] [PATCH v2 6/7] net/ixgbe: " Wenzhuo Lu
2017-10-17  5:50   ` [dpdk-dev] [PATCH v2 7/7] net/i40e: fix wrong parent when adding TM node Wenzhuo Lu
2017-10-20 14:18   ` [dpdk-dev] [PATCH v2 0/7] fix TM (Traffic Management) issues on i40e and ixgbe Dumitrescu, Cristian
2017-10-23 17:02     ` Ferruh Yigit
2017-10-20 14:17 ` [dpdk-dev] [PATCH 0/6] " Dumitrescu, Cristian

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=1508219440-97150-4-git-send-email-wenzhuo.lu@intel.com \
    --to=wenzhuo.lu@intel.com \
    --cc=dev@dpdk.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).