net/i40e: fix TM level capability getting

Only queue nodes should be taken as leaf nodes, all
the other nodes are non-leaf nodes.
Correct it when getting the TM level capability.

Fixes: 0fb1ef1e79 ("net/i40e: support getting TM level capability")
Cc: stable@dpdk.org

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
This commit is contained in:
Wenzhuo Lu 2017-10-17 13:50:35 +08:00 committed by Ferruh Yigit
parent 1be6985827
commit 0d0f144831

View File

@ -755,15 +755,34 @@ i40e_level_capabilities_get(struct rte_eth_dev *dev,
cap->n_nodes_max = 1; cap->n_nodes_max = 1;
cap->n_nodes_nonleaf_max = 1; cap->n_nodes_nonleaf_max = 1;
cap->n_nodes_leaf_max = 0; cap->n_nodes_leaf_max = 0;
cap->non_leaf_nodes_identical = true; } else if (level_id == I40E_TM_NODE_TYPE_TC) {
cap->leaf_nodes_identical = true; /* TC */
cap->n_nodes_max = I40E_MAX_TRAFFIC_CLASS;
cap->n_nodes_nonleaf_max = I40E_MAX_TRAFFIC_CLASS;
cap->n_nodes_leaf_max = 0;
} else {
/* queue */
cap->n_nodes_max = hw->func_caps.num_tx_qp;
cap->n_nodes_nonleaf_max = 0;
cap->n_nodes_leaf_max = hw->func_caps.num_tx_qp;
}
cap->non_leaf_nodes_identical = true;
cap->leaf_nodes_identical = true;
if (level_id != I40E_TM_NODE_TYPE_QUEUE) {
cap->nonleaf.shaper_private_supported = true; cap->nonleaf.shaper_private_supported = true;
cap->nonleaf.shaper_private_dual_rate_supported = false; cap->nonleaf.shaper_private_dual_rate_supported = false;
cap->nonleaf.shaper_private_rate_min = 0; cap->nonleaf.shaper_private_rate_min = 0;
/* 40Gbps -> 5GBps */ /* 40Gbps -> 5GBps */
cap->nonleaf.shaper_private_rate_max = 5000000000ull; cap->nonleaf.shaper_private_rate_max = 5000000000ull;
cap->nonleaf.shaper_shared_n_max = 0; cap->nonleaf.shaper_shared_n_max = 0;
cap->nonleaf.sched_n_children_max = I40E_MAX_TRAFFIC_CLASS; if (level_id == I40E_TM_NODE_TYPE_PORT)
cap->nonleaf.sched_n_children_max =
I40E_MAX_TRAFFIC_CLASS;
else
cap->nonleaf.sched_n_children_max =
hw->func_caps.num_tx_qp;
cap->nonleaf.sched_sp_n_priorities_max = 1; cap->nonleaf.sched_sp_n_priorities_max = 1;
cap->nonleaf.sched_wfq_n_children_per_group_max = 0; cap->nonleaf.sched_wfq_n_children_per_group_max = 0;
cap->nonleaf.sched_wfq_n_groups_max = 0; cap->nonleaf.sched_wfq_n_groups_max = 0;
@ -773,21 +792,7 @@ i40e_level_capabilities_get(struct rte_eth_dev *dev,
return 0; return 0;
} }
/* TC or queue node */ /* queue node */
if (level_id == I40E_TM_NODE_TYPE_TC) {
/* TC */
cap->n_nodes_max = I40E_MAX_TRAFFIC_CLASS;
cap->n_nodes_nonleaf_max = I40E_MAX_TRAFFIC_CLASS;
cap->n_nodes_leaf_max = 0;
cap->non_leaf_nodes_identical = true;
} else {
/* queue */
cap->n_nodes_max = hw->func_caps.num_tx_qp;
cap->n_nodes_nonleaf_max = 0;
cap->n_nodes_leaf_max = hw->func_caps.num_tx_qp;
cap->non_leaf_nodes_identical = true;
}
cap->leaf_nodes_identical = true;
cap->leaf.shaper_private_supported = true; cap->leaf.shaper_private_supported = true;
cap->leaf.shaper_private_dual_rate_supported = false; cap->leaf.shaper_private_dual_rate_supported = false;
cap->leaf.shaper_private_rate_min = 0; cap->leaf.shaper_private_rate_min = 0;