X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fipn3ke%2Fipn3ke_tm.c;h=5a16c5f96ea93e710dca0441818fe805210e43c8;hb=a99564c680dd33d1dc4931985fd769c86e5791e5;hp=8baa2fbc15d9e086ae5a1c7c3d773f9ba4fc416e;hpb=c820468ac99cc1d13e9cdd1efe61c54be5749710;p=dpdk.git diff --git a/drivers/net/ipn3ke/ipn3ke_tm.c b/drivers/net/ipn3ke/ipn3ke_tm.c index 8baa2fbc15..5a16c5f96e 100644 --- a/drivers/net/ipn3ke/ipn3ke_tm.c +++ b/drivers/net/ipn3ke/ipn3ke_tm.c @@ -23,6 +23,7 @@ #include #include "ipn3ke_rawdev_api.h" +#include "ipn3ke_flow.h" #include "ipn3ke_logs.h" #include "ipn3ke_ethdev.h" @@ -1086,7 +1087,6 @@ ipn3ke_tm_node_add_check_mount(uint32_t tm_id, uint32_t node_id, uint32_t parent_node_id, uint32_t level_id, struct rte_tm_error *error) { - /*struct ipn3ke_tm_internals *tm = IPN3KE_DEV_PRIVATE_TO_TM(dev);*/ uint32_t node_index; uint32_t parent_index; uint32_t parent_index1; @@ -1509,12 +1509,6 @@ ipn3ke_tm_hierarchy_commit_check(struct rte_eth_dev *dev, RTE_TM_ERROR_TYPE_UNSPECIFIED, NULL, rte_strerror(EINVAL)); - } else { - return -rte_tm_error_set(error, - EINVAL, - RTE_TM_ERROR_TYPE_UNSPECIFIED, - NULL, - rte_strerror(EINVAL)); } } } @@ -1540,23 +1534,12 @@ ipn3ke_tm_hierarchy_commit_check(struct rte_eth_dev *dev, NULL, rte_strerror(EINVAL)); } - } else if (n->node_state == - IPN3KE_TM_NODE_STATE_CONFIGURED_DEL) { - if (n->level != IPN3KE_TM_NODE_LEVEL_VT || - n->n_children != 0) { - return -rte_tm_error_set(error, - EINVAL, - RTE_TM_ERROR_TYPE_UNSPECIFIED, - NULL, - rte_strerror(EINVAL)); - } else { - return -rte_tm_error_set(error, + } else if (n->node_state == IPN3KE_TM_NODE_STATE_CONFIGURED_DEL) + return -rte_tm_error_set(error, EINVAL, RTE_TM_ERROR_TYPE_UNSPECIFIED, NULL, rte_strerror(EINVAL)); - } - } } n = tm->h.port_commit_node; @@ -1578,7 +1561,8 @@ ipn3ke_tm_hierarchy_commit_check(struct rte_eth_dev *dev, static int ipn3ke_hw_tm_node_wr(struct ipn3ke_hw *hw, - struct ipn3ke_tm_node *n) + struct ipn3ke_tm_node *n, + struct ipn3ke_tm_node *parent_node) { uint32_t level; @@ -1649,11 +1633,12 @@ ipn3ke_hw_tm_node_wr(struct ipn3ke_hw *hw, /** * Configure Map */ - IPN3KE_MASK_WRITE_REG(hw, - IPN3KE_QOS_MAP_L2_X, - n->node_index, - n->parent_node->node_index, - IPN3KE_QOS_MAP_L2_MASK); + if (parent_node) + IPN3KE_MASK_WRITE_REG(hw, + IPN3KE_QOS_MAP_L2_X, + n->node_index, + parent_node->node_index, + IPN3KE_QOS_MAP_L2_MASK); break; case IPN3KE_TM_NODE_LEVEL_COS: @@ -1706,11 +1691,12 @@ ipn3ke_hw_tm_node_wr(struct ipn3ke_hw *hw, 0x80000000)) ; - IPN3KE_MASK_WRITE_REG(hw, - IPN3KE_QM_UID_CONFIG_DATA, - 0, - (1 << 8 | n->parent_node->parent_node->node_index), - 0x1FF); + if (parent_node && parent_node->parent_node) + IPN3KE_MASK_WRITE_REG(hw, + IPN3KE_QM_UID_CONFIG_DATA, + 0, + (1 << 8 | parent_node->parent_node->node_index), + 0x1FF); IPN3KE_MASK_WRITE_REG(hw, IPN3KE_QM_UID_CONFIG_CTRL, @@ -1727,11 +1713,12 @@ ipn3ke_hw_tm_node_wr(struct ipn3ke_hw *hw, /** * Configure Map */ - IPN3KE_MASK_WRITE_REG(hw, - IPN3KE_QOS_MAP_L1_X, - n->node_index, - n->parent_node->node_index, - IPN3KE_QOS_MAP_L1_MASK); + if (parent_node) + IPN3KE_MASK_WRITE_REG(hw, + IPN3KE_QOS_MAP_L1_X, + n->node_index, + parent_node->node_index, + IPN3KE_QOS_MAP_L1_MASK); break; default: @@ -1771,7 +1758,8 @@ ipn3ke_tm_hierarchy_hw_commit(struct rte_eth_dev *dev, NULL, rte_strerror(EINVAL)); } - ipn3ke_hw_tm_node_wr(hw, n); + parent_node = n->parent_node; + ipn3ke_hw_tm_node_wr(hw, n, parent_node); } nl = &tm->h.vt_commit_node_list; @@ -1801,7 +1789,7 @@ ipn3ke_tm_hierarchy_hw_commit(struct rte_eth_dev *dev, NULL, rte_strerror(EINVAL)); } - ipn3ke_hw_tm_node_wr(hw, n); + ipn3ke_hw_tm_node_wr(hw, n, parent_node); } nl = &tm->h.cos_commit_node_list; @@ -1835,7 +1823,7 @@ ipn3ke_tm_hierarchy_hw_commit(struct rte_eth_dev *dev, NULL, rte_strerror(EINVAL)); } - ipn3ke_hw_tm_node_wr(hw, n); + ipn3ke_hw_tm_node_wr(hw, n, parent_node); } return 0; @@ -2065,4 +2053,3 @@ ipn3ke_tm_ops_get(struct rte_eth_dev *ethdev, return 0; } -