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;
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));
}
}
}
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;
/**
* 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:
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,
/**
* 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:
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;
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;
NULL,
rte_strerror(EINVAL));
}
- ipn3ke_hw_tm_node_wr(hw, n);
+ ipn3ke_hw_tm_node_wr(hw, n, parent_node);
}
return 0;
return 0;
}
-