Skip to content

Commit

Permalink
net/mlx5: fix shared Rx queue list management
Browse files Browse the repository at this point in the history
[ upstream commit bcc220cb57d7a2c45703c7215aad2320ac0a1e51 ]

In shared Rx queue case, the shared control structure could only be
released after the last port's dereference in the group.

There is another management list that holding all of the used Rx
queues' structures for a port. If the reference count of a control
structure is changed to zero during port close, it can be removed
from the list directly without freeing the resource.

Fixes: 09c2555 ("net/mlx5: support shared Rx queue")

Signed-off-by: Bing Zhao <[email protected]>
Acked-by: Viacheslav Ovsiienko <[email protected]>
  • Loading branch information
zorrohahaha authored and kevintraynor committed Nov 16, 2023
1 parent d4eebaf commit ac941d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/mlx5/mlx5_rxq.c
Original file line number Diff line number Diff line change
Expand Up @@ -2161,14 +2161,14 @@ mlx5_rxq_release(struct rte_eth_dev *dev, uint16_t idx)
RTE_ETH_QUEUE_STATE_STOPPED;
}
} else { /* Refcnt zero, closing device. */
LIST_REMOVE(rxq_ctrl, next);
LIST_REMOVE(rxq, owner_entry);
if (LIST_EMPTY(&rxq_ctrl->owners)) {
if (rxq_ctrl->type == MLX5_RXQ_TYPE_STANDARD)
mlx5_mr_btree_free
(&rxq_ctrl->rxq.mr_ctrl.cache_bh);
if (rxq_ctrl->rxq.shared)
LIST_REMOVE(rxq_ctrl, share_entry);
LIST_REMOVE(rxq_ctrl, next);
mlx5_free(rxq_ctrl);
}
dev->data->rx_queues[idx] = NULL;
Expand Down

0 comments on commit ac941d3

Please sign in to comment.