4 * Copyright(c) 2010-2017 Intel Corporation. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * * Neither the name of Intel Corporation nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 #include <rte_malloc.h>
36 #include "ixgbe_ethdev.h"
38 static int ixgbe_tm_capabilities_get(struct rte_eth_dev *dev,
39 struct rte_tm_capabilities *cap,
40 struct rte_tm_error *error);
41 static int ixgbe_shaper_profile_add(struct rte_eth_dev *dev,
42 uint32_t shaper_profile_id,
43 struct rte_tm_shaper_params *profile,
44 struct rte_tm_error *error);
45 static int ixgbe_shaper_profile_del(struct rte_eth_dev *dev,
46 uint32_t shaper_profile_id,
47 struct rte_tm_error *error);
48 static int ixgbe_node_add(struct rte_eth_dev *dev, uint32_t node_id,
49 uint32_t parent_node_id, uint32_t priority,
50 uint32_t weight, uint32_t level_id,
51 struct rte_tm_node_params *params,
52 struct rte_tm_error *error);
53 static int ixgbe_node_delete(struct rte_eth_dev *dev, uint32_t node_id,
54 struct rte_tm_error *error);
55 static int ixgbe_node_type_get(struct rte_eth_dev *dev, uint32_t node_id,
56 int *is_leaf, struct rte_tm_error *error);
58 const struct rte_tm_ops ixgbe_tm_ops = {
59 .capabilities_get = ixgbe_tm_capabilities_get,
60 .shaper_profile_add = ixgbe_shaper_profile_add,
61 .shaper_profile_delete = ixgbe_shaper_profile_del,
62 .node_add = ixgbe_node_add,
63 .node_delete = ixgbe_node_delete,
64 .node_type_get = ixgbe_node_type_get,
68 ixgbe_tm_ops_get(struct rte_eth_dev *dev __rte_unused,
74 *(const void **)arg = &ixgbe_tm_ops;
80 ixgbe_tm_conf_init(struct rte_eth_dev *dev)
82 struct ixgbe_tm_conf *tm_conf =
83 IXGBE_DEV_PRIVATE_TO_TM_CONF(dev->data->dev_private);
85 /* initialize shaper profile list */
86 TAILQ_INIT(&tm_conf->shaper_profile_list);
88 /* initialize node configuration */
90 TAILQ_INIT(&tm_conf->queue_list);
91 TAILQ_INIT(&tm_conf->tc_list);
92 tm_conf->nb_tc_node = 0;
93 tm_conf->nb_queue_node = 0;
94 tm_conf->committed = false;
98 ixgbe_tm_conf_uninit(struct rte_eth_dev *dev)
100 struct ixgbe_tm_conf *tm_conf =
101 IXGBE_DEV_PRIVATE_TO_TM_CONF(dev->data->dev_private);
102 struct ixgbe_tm_shaper_profile *shaper_profile;
103 struct ixgbe_tm_node *tm_node;
105 /* clear node configuration */
106 while ((tm_node = TAILQ_FIRST(&tm_conf->queue_list))) {
107 TAILQ_REMOVE(&tm_conf->queue_list, tm_node, node);
110 tm_conf->nb_queue_node = 0;
111 while ((tm_node = TAILQ_FIRST(&tm_conf->tc_list))) {
112 TAILQ_REMOVE(&tm_conf->tc_list, tm_node, node);
115 tm_conf->nb_tc_node = 0;
117 rte_free(tm_conf->root);
118 tm_conf->root = NULL;
121 /* Remove all shaper profiles */
122 while ((shaper_profile =
123 TAILQ_FIRST(&tm_conf->shaper_profile_list))) {
124 TAILQ_REMOVE(&tm_conf->shaper_profile_list,
125 shaper_profile, node);
126 rte_free(shaper_profile);
130 static inline uint8_t
131 ixgbe_tc_nb_get(struct rte_eth_dev *dev)
133 struct rte_eth_conf *eth_conf;
136 eth_conf = &dev->data->dev_conf;
137 if (eth_conf->txmode.mq_mode == ETH_MQ_TX_DCB) {
138 nb_tcs = eth_conf->tx_adv_conf.dcb_tx_conf.nb_tcs;
139 } else if (eth_conf->txmode.mq_mode == ETH_MQ_TX_VMDQ_DCB) {
140 if (eth_conf->tx_adv_conf.vmdq_dcb_tx_conf.nb_queue_pools ==
153 ixgbe_tm_capabilities_get(struct rte_eth_dev *dev,
154 struct rte_tm_capabilities *cap,
155 struct rte_tm_error *error)
157 struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
158 uint8_t tc_nb = ixgbe_tc_nb_get(dev);
163 if (tc_nb > hw->mac.max_tx_queues)
166 error->type = RTE_TM_ERROR_TYPE_NONE;
168 /* set all the parameters to 0 first. */
169 memset(cap, 0, sizeof(struct rte_tm_capabilities));
172 * here is the max capability not the current configuration.
174 /* port + TCs + queues */
175 cap->n_nodes_max = 1 + IXGBE_DCB_MAX_TRAFFIC_CLASS +
176 hw->mac.max_tx_queues;
177 cap->n_levels_max = 3;
178 cap->non_leaf_nodes_identical = 1;
179 cap->leaf_nodes_identical = 1;
180 cap->shaper_n_max = cap->n_nodes_max;
181 cap->shaper_private_n_max = cap->n_nodes_max;
182 cap->shaper_private_dual_rate_n_max = 0;
183 cap->shaper_private_rate_min = 0;
184 /* 10Gbps -> 1.25GBps */
185 cap->shaper_private_rate_max = 1250000000ull;
186 cap->shaper_shared_n_max = 0;
187 cap->shaper_shared_n_nodes_per_shaper_max = 0;
188 cap->shaper_shared_n_shapers_per_node_max = 0;
189 cap->shaper_shared_dual_rate_n_max = 0;
190 cap->shaper_shared_rate_min = 0;
191 cap->shaper_shared_rate_max = 0;
192 cap->sched_n_children_max = hw->mac.max_tx_queues;
194 * HW supports SP. But no plan to support it now.
195 * So, all the nodes should have the same priority.
197 cap->sched_sp_n_priorities_max = 1;
198 cap->sched_wfq_n_children_per_group_max = 0;
199 cap->sched_wfq_n_groups_max = 0;
201 * SW only supports fair round robin now.
202 * So, all the nodes should have the same weight.
204 cap->sched_wfq_weight_max = 1;
205 cap->cman_head_drop_supported = 0;
206 cap->dynamic_update_mask = 0;
207 cap->shaper_pkt_length_adjust_min = RTE_TM_ETH_FRAMING_OVERHEAD;
208 cap->shaper_pkt_length_adjust_max = RTE_TM_ETH_FRAMING_OVERHEAD_FCS;
209 cap->cman_wred_context_n_max = 0;
210 cap->cman_wred_context_private_n_max = 0;
211 cap->cman_wred_context_shared_n_max = 0;
212 cap->cman_wred_context_shared_n_nodes_per_context_max = 0;
213 cap->cman_wred_context_shared_n_contexts_per_node_max = 0;
219 static inline struct ixgbe_tm_shaper_profile *
220 ixgbe_shaper_profile_search(struct rte_eth_dev *dev,
221 uint32_t shaper_profile_id)
223 struct ixgbe_tm_conf *tm_conf =
224 IXGBE_DEV_PRIVATE_TO_TM_CONF(dev->data->dev_private);
225 struct ixgbe_shaper_profile_list *shaper_profile_list =
226 &tm_conf->shaper_profile_list;
227 struct ixgbe_tm_shaper_profile *shaper_profile;
229 TAILQ_FOREACH(shaper_profile, shaper_profile_list, node) {
230 if (shaper_profile_id == shaper_profile->shaper_profile_id)
231 return shaper_profile;
238 ixgbe_shaper_profile_param_check(struct rte_tm_shaper_params *profile,
239 struct rte_tm_error *error)
241 /* min rate not supported */
242 if (profile->committed.rate) {
243 error->type = RTE_TM_ERROR_TYPE_SHAPER_PROFILE_COMMITTED_RATE;
244 error->message = "committed rate not supported";
247 /* min bucket size not supported */
248 if (profile->committed.size) {
249 error->type = RTE_TM_ERROR_TYPE_SHAPER_PROFILE_COMMITTED_SIZE;
250 error->message = "committed bucket size not supported";
253 /* max bucket size not supported */
254 if (profile->peak.size) {
255 error->type = RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_SIZE;
256 error->message = "peak bucket size not supported";
259 /* length adjustment not supported */
260 if (profile->pkt_length_adjust) {
261 error->type = RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PKT_ADJUST_LEN;
262 error->message = "packet length adjustment not supported";
270 ixgbe_shaper_profile_add(struct rte_eth_dev *dev,
271 uint32_t shaper_profile_id,
272 struct rte_tm_shaper_params *profile,
273 struct rte_tm_error *error)
275 struct ixgbe_tm_conf *tm_conf =
276 IXGBE_DEV_PRIVATE_TO_TM_CONF(dev->data->dev_private);
277 struct ixgbe_tm_shaper_profile *shaper_profile;
280 if (!profile || !error)
283 ret = ixgbe_shaper_profile_param_check(profile, error);
287 shaper_profile = ixgbe_shaper_profile_search(dev, shaper_profile_id);
289 if (shaper_profile) {
290 error->type = RTE_TM_ERROR_TYPE_SHAPER_PROFILE_ID;
291 error->message = "profile ID exist";
295 shaper_profile = rte_zmalloc("ixgbe_tm_shaper_profile",
296 sizeof(struct ixgbe_tm_shaper_profile),
300 shaper_profile->shaper_profile_id = shaper_profile_id;
301 (void)rte_memcpy(&shaper_profile->profile, profile,
302 sizeof(struct rte_tm_shaper_params));
303 TAILQ_INSERT_TAIL(&tm_conf->shaper_profile_list,
304 shaper_profile, node);
310 ixgbe_shaper_profile_del(struct rte_eth_dev *dev,
311 uint32_t shaper_profile_id,
312 struct rte_tm_error *error)
314 struct ixgbe_tm_conf *tm_conf =
315 IXGBE_DEV_PRIVATE_TO_TM_CONF(dev->data->dev_private);
316 struct ixgbe_tm_shaper_profile *shaper_profile;
321 shaper_profile = ixgbe_shaper_profile_search(dev, shaper_profile_id);
323 if (!shaper_profile) {
324 error->type = RTE_TM_ERROR_TYPE_SHAPER_PROFILE_ID;
325 error->message = "profile ID not exist";
329 /* don't delete a profile if it's used by one or several nodes */
330 if (shaper_profile->reference_count) {
331 error->type = RTE_TM_ERROR_TYPE_SHAPER_PROFILE;
332 error->message = "profile in use";
336 TAILQ_REMOVE(&tm_conf->shaper_profile_list, shaper_profile, node);
337 rte_free(shaper_profile);
342 static inline struct ixgbe_tm_node *
343 ixgbe_tm_node_search(struct rte_eth_dev *dev, uint32_t node_id,
344 enum ixgbe_tm_node_type *node_type)
346 struct ixgbe_tm_conf *tm_conf =
347 IXGBE_DEV_PRIVATE_TO_TM_CONF(dev->data->dev_private);
348 struct ixgbe_tm_node *tm_node;
350 if (tm_conf->root && tm_conf->root->id == node_id) {
351 *node_type = IXGBE_TM_NODE_TYPE_PORT;
352 return tm_conf->root;
355 TAILQ_FOREACH(tm_node, &tm_conf->tc_list, node) {
356 if (tm_node->id == node_id) {
357 *node_type = IXGBE_TM_NODE_TYPE_TC;
362 TAILQ_FOREACH(tm_node, &tm_conf->queue_list, node) {
363 if (tm_node->id == node_id) {
364 *node_type = IXGBE_TM_NODE_TYPE_QUEUE;
373 ixgbe_queue_base_nb_get(struct rte_eth_dev *dev, uint16_t tc_node_no,
374 uint16_t *base, uint16_t *nb)
376 uint8_t nb_tcs = ixgbe_tc_nb_get(dev);
377 struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
378 uint16_t vf_num = pci_dev->max_vfs;
387 if (vf_num >= ETH_32_POOLS) {
390 } else if (vf_num >= ETH_16_POOLS) {
400 *base = vf_num * nb_tcs + tc_node_no;
404 if (nb_tcs == ETH_8_TCS) {
405 switch (tc_node_no) {
442 switch (tc_node_no) {
444 * If no VF and no DCB, only 64 queues can be used.
445 * This case also be covered by this "case 0".
471 ixgbe_node_param_check(uint32_t node_id, uint32_t parent_node_id,
472 uint32_t priority, uint32_t weight,
473 struct rte_tm_node_params *params,
474 struct rte_tm_error *error)
476 if (node_id == RTE_TM_NODE_ID_NULL) {
477 error->type = RTE_TM_ERROR_TYPE_NODE_ID;
478 error->message = "invalid node id";
483 error->type = RTE_TM_ERROR_TYPE_NODE_PRIORITY;
484 error->message = "priority should be 0";
489 error->type = RTE_TM_ERROR_TYPE_NODE_WEIGHT;
490 error->message = "weight must be 1";
494 /* not support shared shaper */
495 if (params->shared_shaper_id) {
496 error->type = RTE_TM_ERROR_TYPE_NODE_PARAMS_SHARED_SHAPER_ID;
497 error->message = "shared shaper not supported";
500 if (params->n_shared_shapers) {
501 error->type = RTE_TM_ERROR_TYPE_NODE_PARAMS_N_SHARED_SHAPERS;
502 error->message = "shared shaper not supported";
507 if (parent_node_id == RTE_TM_NODE_ID_NULL) {
508 /* check the unsupported parameters */
509 if (params->nonleaf.wfq_weight_mode) {
511 RTE_TM_ERROR_TYPE_NODE_PARAMS_WFQ_WEIGHT_MODE;
512 error->message = "WFQ not supported";
515 if (params->nonleaf.n_sp_priorities != 1) {
517 RTE_TM_ERROR_TYPE_NODE_PARAMS_N_SP_PRIORITIES;
518 error->message = "SP priority not supported";
520 } else if (params->nonleaf.wfq_weight_mode &&
521 !(*params->nonleaf.wfq_weight_mode)) {
523 RTE_TM_ERROR_TYPE_NODE_PARAMS_WFQ_WEIGHT_MODE;
524 error->message = "WFP should be byte mode";
531 /* for TC or queue node */
532 /* check the unsupported parameters */
533 if (params->leaf.cman) {
534 error->type = RTE_TM_ERROR_TYPE_NODE_PARAMS_CMAN;
535 error->message = "Congestion management not supported";
538 if (params->leaf.wred.wred_profile_id !=
539 RTE_TM_WRED_PROFILE_ID_NONE) {
541 RTE_TM_ERROR_TYPE_NODE_PARAMS_WRED_PROFILE_ID;
542 error->message = "WRED not supported";
545 if (params->leaf.wred.shared_wred_context_id) {
547 RTE_TM_ERROR_TYPE_NODE_PARAMS_SHARED_WRED_CONTEXT_ID;
548 error->message = "WRED not supported";
551 if (params->leaf.wred.n_shared_wred_contexts) {
553 RTE_TM_ERROR_TYPE_NODE_PARAMS_N_SHARED_WRED_CONTEXTS;
554 error->message = "WRED not supported";
562 * Now the TC and queue configuration is controlled by DCB.
563 * We need check if the node configuration follows the DCB configuration.
564 * In the future, we may use TM to cover DCB.
567 ixgbe_node_add(struct rte_eth_dev *dev, uint32_t node_id,
568 uint32_t parent_node_id, uint32_t priority,
569 uint32_t weight, uint32_t level_id,
570 struct rte_tm_node_params *params,
571 struct rte_tm_error *error)
573 struct ixgbe_tm_conf *tm_conf =
574 IXGBE_DEV_PRIVATE_TO_TM_CONF(dev->data->dev_private);
575 enum ixgbe_tm_node_type node_type = IXGBE_TM_NODE_TYPE_MAX;
576 enum ixgbe_tm_node_type parent_node_type = IXGBE_TM_NODE_TYPE_MAX;
577 struct ixgbe_tm_shaper_profile *shaper_profile;
578 struct ixgbe_tm_node *tm_node;
579 struct ixgbe_tm_node *parent_node;
585 if (!params || !error)
588 /* if already committed */
589 if (tm_conf->committed) {
590 error->type = RTE_TM_ERROR_TYPE_UNSPECIFIED;
591 error->message = "already committed";
595 ret = ixgbe_node_param_check(node_id, parent_node_id, priority, weight,
600 /* check if the node ID is already used */
601 if (ixgbe_tm_node_search(dev, node_id, &node_type)) {
602 error->type = RTE_TM_ERROR_TYPE_NODE_ID;
603 error->message = "node id already used";
607 /* check the shaper profile id */
608 shaper_profile = ixgbe_shaper_profile_search(dev,
609 params->shaper_profile_id);
610 if (!shaper_profile) {
611 error->type = RTE_TM_ERROR_TYPE_NODE_PARAMS_SHAPER_PROFILE_ID;
612 error->message = "shaper profile not exist";
616 /* root node if not have a parent */
617 if (parent_node_id == RTE_TM_NODE_ID_NULL) {
619 if (level_id != RTE_TM_NODE_LEVEL_ID_ANY &&
620 level_id > IXGBE_TM_NODE_TYPE_PORT) {
621 error->type = RTE_TM_ERROR_TYPE_NODE_PARAMS;
622 error->message = "Wrong level";
626 /* obviously no more than one root */
628 error->type = RTE_TM_ERROR_TYPE_NODE_PARENT_NODE_ID;
629 error->message = "already have a root";
633 /* add the root node */
634 tm_node = rte_zmalloc("ixgbe_tm_node",
635 sizeof(struct ixgbe_tm_node),
639 tm_node->id = node_id;
640 tm_node->priority = priority;
641 tm_node->weight = weight;
642 tm_node->reference_count = 0;
644 tm_node->parent = NULL;
645 tm_node->shaper_profile = shaper_profile;
646 (void)rte_memcpy(&tm_node->params, params,
647 sizeof(struct rte_tm_node_params));
648 tm_conf->root = tm_node;
650 /* increase the reference counter of the shaper profile */
651 shaper_profile->reference_count++;
656 /* TC or queue node */
657 /* check the parent node */
658 parent_node = ixgbe_tm_node_search(dev, parent_node_id,
661 error->type = RTE_TM_ERROR_TYPE_NODE_PARENT_NODE_ID;
662 error->message = "parent not exist";
665 if (parent_node_type != IXGBE_TM_NODE_TYPE_PORT &&
666 parent_node_type != IXGBE_TM_NODE_TYPE_TC) {
667 error->type = RTE_TM_ERROR_TYPE_NODE_PARENT_NODE_ID;
668 error->message = "parent is not port or TC";
672 if (level_id != RTE_TM_NODE_LEVEL_ID_ANY &&
673 level_id != parent_node_type + 1) {
674 error->type = RTE_TM_ERROR_TYPE_NODE_PARAMS;
675 error->message = "Wrong level";
679 /* check the node number */
680 if (parent_node_type == IXGBE_TM_NODE_TYPE_PORT) {
681 /* check TC number */
682 nb_tcs = ixgbe_tc_nb_get(dev);
683 if (tm_conf->nb_tc_node >= nb_tcs) {
684 error->type = RTE_TM_ERROR_TYPE_NODE_ID;
685 error->message = "too many TCs";
689 /* check queue number */
690 if (tm_conf->nb_queue_node >= dev->data->nb_tx_queues) {
691 error->type = RTE_TM_ERROR_TYPE_NODE_ID;
692 error->message = "too many queues";
696 ixgbe_queue_base_nb_get(dev, parent_node->no, &q_base, &q_nb);
697 if (parent_node->reference_count >= q_nb) {
698 error->type = RTE_TM_ERROR_TYPE_NODE_ID;
699 error->message = "too many queues than TC supported";
705 * For queue, the node id means queue id.
707 if (node_id >= dev->data->nb_tx_queues) {
708 error->type = RTE_TM_ERROR_TYPE_NODE_ID;
709 error->message = "too large queue id";
714 /* add the TC or queue node */
715 tm_node = rte_zmalloc("ixgbe_tm_node",
716 sizeof(struct ixgbe_tm_node),
720 tm_node->id = node_id;
721 tm_node->priority = priority;
722 tm_node->weight = weight;
723 tm_node->reference_count = 0;
724 tm_node->parent = parent_node;
725 tm_node->shaper_profile = shaper_profile;
726 (void)rte_memcpy(&tm_node->params, params,
727 sizeof(struct rte_tm_node_params));
728 if (parent_node_type == IXGBE_TM_NODE_TYPE_PORT) {
729 tm_node->no = parent_node->reference_count;
730 TAILQ_INSERT_TAIL(&tm_conf->tc_list,
732 tm_conf->nb_tc_node++;
734 tm_node->no = q_base + parent_node->reference_count;
735 TAILQ_INSERT_TAIL(&tm_conf->queue_list,
737 tm_conf->nb_queue_node++;
739 tm_node->parent->reference_count++;
741 /* increase the reference counter of the shaper profile */
742 shaper_profile->reference_count++;
748 ixgbe_node_delete(struct rte_eth_dev *dev, uint32_t node_id,
749 struct rte_tm_error *error)
751 struct ixgbe_tm_conf *tm_conf =
752 IXGBE_DEV_PRIVATE_TO_TM_CONF(dev->data->dev_private);
753 enum ixgbe_tm_node_type node_type = IXGBE_TM_NODE_TYPE_MAX;
754 struct ixgbe_tm_node *tm_node;
759 /* if already committed */
760 if (tm_conf->committed) {
761 error->type = RTE_TM_ERROR_TYPE_UNSPECIFIED;
762 error->message = "already committed";
766 if (node_id == RTE_TM_NODE_ID_NULL) {
767 error->type = RTE_TM_ERROR_TYPE_NODE_ID;
768 error->message = "invalid node id";
772 /* check the if the node id exists */
773 tm_node = ixgbe_tm_node_search(dev, node_id, &node_type);
775 error->type = RTE_TM_ERROR_TYPE_NODE_ID;
776 error->message = "no such node";
780 /* the node should have no child */
781 if (tm_node->reference_count) {
782 error->type = RTE_TM_ERROR_TYPE_NODE_ID;
784 "cannot delete a node which has children";
789 if (node_type == IXGBE_TM_NODE_TYPE_PORT) {
790 tm_node->shaper_profile->reference_count--;
792 tm_conf->root = NULL;
796 /* TC or queue node */
797 tm_node->shaper_profile->reference_count--;
798 tm_node->parent->reference_count--;
799 if (node_type == IXGBE_TM_NODE_TYPE_TC) {
800 TAILQ_REMOVE(&tm_conf->tc_list, tm_node, node);
801 tm_conf->nb_tc_node--;
803 TAILQ_REMOVE(&tm_conf->queue_list, tm_node, node);
804 tm_conf->nb_queue_node--;
812 ixgbe_node_type_get(struct rte_eth_dev *dev, uint32_t node_id,
813 int *is_leaf, struct rte_tm_error *error)
815 enum ixgbe_tm_node_type node_type = IXGBE_TM_NODE_TYPE_MAX;
816 struct ixgbe_tm_node *tm_node;
818 if (!is_leaf || !error)
821 if (node_id == RTE_TM_NODE_ID_NULL) {
822 error->type = RTE_TM_ERROR_TYPE_NODE_ID;
823 error->message = "invalid node id";
827 /* check if the node id exists */
828 tm_node = ixgbe_tm_node_search(dev, node_id, &node_type);
830 error->type = RTE_TM_ERROR_TYPE_NODE_ID;
831 error->message = "no such node";
835 if (node_type == IXGBE_TM_NODE_TYPE_QUEUE)