net/mlx5: fix doorbell release on Rx queue release
Function mlx5_rxq_release() calls mlx5_release_dbr() to release the
doorbell allocated for this Rx queue.
This call is relevant only for Rx queue objects created using
DevX API.
This patch adds the required check, to call mlx5_release_dbr()
only when relevant.
It also updates mlx5_release_dbr() to use the input offset correctly.
Fixes: dc9ceff73c
("net/mlx5: create advanced RxQ via DevX")
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
This commit is contained in:
parent
94f00800d7
commit
a88209b04c
@ -1460,6 +1460,7 @@ mlx5_release_dbr(struct rte_eth_dev *dev, uint32_t umem_id, uint64_t offset)
|
||||
rte_free(page);
|
||||
} else {
|
||||
/* Mark in bitmap that this door-bell is not in use. */
|
||||
offset /= MLX5_DBR_SIZE;
|
||||
int i = offset / 64;
|
||||
int j = offset % 64;
|
||||
|
||||
|
@ -1242,6 +1242,7 @@ mlx5_rxq_obj_new(struct rte_eth_dev *dev, uint16_t idx,
|
||||
goto error;
|
||||
rxq_ctrl->dbr_offset = dbr_offset;
|
||||
rxq_ctrl->dbr_umem_id = dbr_page->umem->umem_id;
|
||||
rxq_ctrl->dbr_umem_id_valid = 1;
|
||||
rxq_data->rq_db = (uint32_t *)((uintptr_t)dbr_page->dbrs +
|
||||
(uintptr_t)rxq_ctrl->dbr_offset);
|
||||
}
|
||||
@ -1829,8 +1830,9 @@ mlx5_rxq_release(struct rte_eth_dev *dev, uint16_t idx)
|
||||
if (rxq_ctrl->obj && !mlx5_rxq_obj_release(rxq_ctrl->obj))
|
||||
rxq_ctrl->obj = NULL;
|
||||
if (rte_atomic32_dec_and_test(&rxq_ctrl->refcnt)) {
|
||||
claim_zero(mlx5_release_dbr(dev, rxq_ctrl->dbr_umem_id,
|
||||
rxq_ctrl->dbr_offset));
|
||||
if (rxq_ctrl->dbr_umem_id_valid)
|
||||
claim_zero(mlx5_release_dbr(dev, rxq_ctrl->dbr_umem_id,
|
||||
rxq_ctrl->dbr_offset));
|
||||
mlx5_mr_btree_free(&rxq_ctrl->rxq.mr_ctrl.cache_bh);
|
||||
LIST_REMOVE(rxq_ctrl, next);
|
||||
rte_free(rxq_ctrl);
|
||||
|
@ -184,6 +184,7 @@ struct mlx5_rxq_ctrl {
|
||||
struct mlx5_priv *priv; /* Back pointer to private data. */
|
||||
unsigned int socket; /* CPU socket ID for allocations. */
|
||||
unsigned int irq:1; /* Whether IRQ is enabled. */
|
||||
unsigned int dbr_umem_id_valid:1; /* dbr_umem_id holds a valid value. */
|
||||
uint32_t flow_mark_n; /* Number of Mark/Flag flows using this Queue. */
|
||||
uint32_t flow_tunnels_n[MLX5_FLOW_TUNNEL]; /* Tunnels counters. */
|
||||
uint32_t wqn; /* WQ number. */
|
||||
|
Loading…
Reference in New Issue
Block a user