net/mlx5: remove Rx queue object type field
Once the separation between Verbs and DevX is done using function pointers, the type field of the Rx queue object structure becomes redundant and no more code is used. Remove the unnecessary field from the structure. Signed-off-by: Michael Baum <michaelba@nvidia.com> Acked-by: Matan Azrad <matan@nvidia.com>
This commit is contained in:
parent
4c6d80f1c5
commit
e96242efa4
@ -368,7 +368,6 @@ mlx5_rxq_ibv_obj_new(struct rte_eth_dev *dev, uint16_t idx)
|
||||
MLX5_ASSERT(tmpl);
|
||||
priv->verbs_alloc_ctx.type = MLX5_VERBS_ALLOC_TYPE_RX_QUEUE;
|
||||
priv->verbs_alloc_ctx.obj = rxq_ctrl;
|
||||
tmpl->type = MLX5_RXQ_OBJ_TYPE_IBV;
|
||||
tmpl->rxq_ctrl = rxq_ctrl;
|
||||
if (rxq_ctrl->irq) {
|
||||
tmpl->ibv_channel =
|
||||
|
@ -676,18 +676,10 @@ TAILQ_HEAD(mlx5_flow_meters, mlx5_flow_meter);
|
||||
#define MLX5_PROC_PRIV(port_id) \
|
||||
((struct mlx5_proc_priv *)rte_eth_devices[port_id].process_private)
|
||||
|
||||
enum mlx5_rxq_obj_type {
|
||||
MLX5_RXQ_OBJ_TYPE_IBV, /* mlx5_rxq_obj with ibv_wq. */
|
||||
MLX5_RXQ_OBJ_TYPE_DEVX_RQ, /* mlx5_rxq_obj with mlx5_devx_rq. */
|
||||
MLX5_RXQ_OBJ_TYPE_DEVX_HAIRPIN,
|
||||
/* mlx5_rxq_obj with mlx5_devx_rq and hairpin support. */
|
||||
};
|
||||
|
||||
/* Verbs/DevX Rx queue elements. */
|
||||
struct mlx5_rxq_obj {
|
||||
LIST_ENTRY(mlx5_rxq_obj) next; /* Pointer to the next element. */
|
||||
struct mlx5_rxq_ctrl *rxq_ctrl; /* Back pointer to parent. */
|
||||
enum mlx5_rxq_obj_type type;
|
||||
int fd; /* File descriptor for event channel */
|
||||
RTE_STD_C11
|
||||
union {
|
||||
|
@ -208,7 +208,7 @@ mlx5_rxq_devx_obj_release(struct mlx5_rxq_obj *rxq_obj)
|
||||
{
|
||||
MLX5_ASSERT(rxq_obj);
|
||||
MLX5_ASSERT(rxq_obj->rq);
|
||||
if (rxq_obj->type == MLX5_RXQ_OBJ_TYPE_DEVX_HAIRPIN) {
|
||||
if (rxq_obj->rxq_ctrl->type == MLX5_RXQ_TYPE_HAIRPIN) {
|
||||
mlx5_devx_modify_rq(rxq_obj, MLX5_RXQ_MOD_RDY2RST);
|
||||
claim_zero(mlx5_devx_cmd_destroy(rxq_obj->rq));
|
||||
} else {
|
||||
@ -550,7 +550,6 @@ mlx5_rxq_obj_hairpin_new(struct rte_eth_dev *dev, uint16_t idx)
|
||||
|
||||
MLX5_ASSERT(rxq_data);
|
||||
MLX5_ASSERT(tmpl);
|
||||
tmpl->type = MLX5_RXQ_OBJ_TYPE_DEVX_HAIRPIN;
|
||||
tmpl->rxq_ctrl = rxq_ctrl;
|
||||
attr.hairpin = 1;
|
||||
max_wq_data = priv->config.hca_attr.log_max_hairpin_wq_data_sz;
|
||||
@ -611,7 +610,6 @@ mlx5_rxq_devx_obj_new(struct rte_eth_dev *dev, uint16_t idx)
|
||||
MLX5_ASSERT(tmpl);
|
||||
if (rxq_ctrl->type == MLX5_RXQ_TYPE_HAIRPIN)
|
||||
return mlx5_rxq_obj_hairpin_new(dev, idx);
|
||||
tmpl->type = MLX5_RXQ_OBJ_TYPE_DEVX_RQ;
|
||||
tmpl->rxq_ctrl = rxq_ctrl;
|
||||
if (rxq_ctrl->irq) {
|
||||
int devx_ev_flag =
|
||||
|
@ -116,9 +116,8 @@ mlx5_vlan_strip_queue_set(struct rte_eth_dev *dev, uint16_t queue, int on)
|
||||
}
|
||||
ret = priv->obj_ops.rxq_obj_modify_vlan_strip(rxq_ctrl->obj, on);
|
||||
if (ret) {
|
||||
DRV_LOG(ERR, "port %u failed to modify object %d stripping "
|
||||
"mode: %s", dev->data->port_id,
|
||||
rxq_ctrl->obj->type, strerror(rte_errno));
|
||||
DRV_LOG(ERR, "Port %u failed to modify object stripping mode:"
|
||||
" %s", dev->data->port_id, strerror(rte_errno));
|
||||
return;
|
||||
}
|
||||
/* Update related bits in RX queue. */
|
||||
|
Loading…
Reference in New Issue
Block a user