From: Wenzhuo Lu <wenzhuo.lu@intel.com>
To: dev@dpdk.org
Cc: Wenzhuo Lu <wenzhuo.lu@intel.com>
Subject: [dpdk-dev] [PATCH v2 1/7] net/i40e: fix TM node parameter checking
Date: Tue, 17 Oct 2017 13:50:34 +0800 [thread overview]
Message-ID: <1508219440-97150-2-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: 03a249b62bbd ("net/i40e: support adding TM node")
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
drivers/net/i40e/i40e_tm.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/net/i40e/i40e_tm.c b/drivers/net/i40e/i40e_tm.c
index d90313a..fe99215 100644
--- a/drivers/net/i40e/i40e_tm.c
+++ b/drivers/net/i40e/i40e_tm.c
@@ -374,11 +374,13 @@ static int i40e_hierarchy_commit(struct rte_eth_dev *dev,
}
static int
-i40e_node_param_check(uint32_t node_id, uint32_t parent_node_id,
+i40e_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)
{
+ struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+
if (node_id == RTE_TM_NODE_ID_NULL) {
error->type = RTE_TM_ERROR_TYPE_NODE_ID;
error->message = "invalid node id";
@@ -409,8 +411,8 @@ static int i40e_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 >= hw->func_caps.num_tx_qp) {
if (params->nonleaf.wfq_weight_mode) {
error->type =
RTE_TM_ERROR_TYPE_NODE_PARAMS_WFQ_WEIGHT_MODE;
@@ -433,7 +435,7 @@ static int i40e_hierarchy_commit(struct rte_eth_dev *dev,
return 0;
}
- /* for TC or queue node */
+ /* for leaf node */
if (params->leaf.cman) {
error->type = RTE_TM_ERROR_TYPE_NODE_PARAMS_CMAN;
error->message = "Congestion management not supported";
@@ -494,7 +496,7 @@ static int i40e_hierarchy_commit(struct rte_eth_dev *dev,
return -EINVAL;
}
- ret = i40e_node_param_check(node_id, parent_node_id, priority, weight,
+ ret = i40e_node_param_check(dev, node_id, priority, weight,
params, error);
if (ret)
return ret;
--
1.9.3
next prev 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 ` Wenzhuo Lu [this message]
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 ` [dpdk-dev] [PATCH v2 3/7] net/ixgbe: fix TM node parameter checking Wenzhuo Lu
2017-10-17 5:50 ` [dpdk-dev] [PATCH v2 4/7] net/ixgbe: fix TM level capability getting 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-2-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).