summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_txq.c
diff options
context:
space:
mode:
authorNĂ©lio Laranjeiro <nelio.laranjeiro@6wind.com>2018-03-05 13:21:05 +0100
committerFerruh Yigit <ferruh.yigit@intel.com>2018-03-30 14:08:44 +0200
commit925061b58b487fba57f55847b1447417fed715fb (patch)
treec7b075f870f6378697376d372fb85d490d08553e /drivers/net/mlx5/mlx5_txq.c
parentaf4f09f28294fac762ff413fbf14b48c42c128fd (diff)
downloaddpdk-next-eventdev-925061b58b487fba57f55847b1447417fed715fb.zip
dpdk-next-eventdev-925061b58b487fba57f55847b1447417fed715fb.tar.gz
dpdk-next-eventdev-925061b58b487fba57f55847b1447417fed715fb.tar.xz
net/mlx5: change non failing function return values
These functions return int although they are not supposed to fail, resulting in unnecessary checks in their callers. Some are returning error where is should be a boolean. Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5_txq.c')
-rw-r--r--drivers/net/mlx5/mlx5_txq.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
index 54ed972..a5e2c7f 100644
--- a/drivers/net/mlx5/mlx5_txq.c
+++ b/drivers/net/mlx5/mlx5_txq.c
@@ -572,7 +572,7 @@ mlx5_txq_ibv_get(struct rte_eth_dev *dev, uint16_t idx)
* Verbs Tx queue object.
*
* @return
- * 0 on success, errno on failure.
+ * 1 while a reference on it exists, 0 when freed.
*/
int
mlx5_txq_ibv_release(struct mlx5_txq_ibv *txq_ibv)
@@ -587,7 +587,7 @@ mlx5_txq_ibv_release(struct mlx5_txq_ibv *txq_ibv)
rte_free(txq_ibv);
return 0;
}
- return EBUSY;
+ return 1;
}
/**
@@ -824,7 +824,7 @@ mlx5_txq_get(struct rte_eth_dev *dev, uint16_t idx)
* TX queue index.
*
* @return
- * 0 on success, errno on failure.
+ * 1 while a reference on it exists, 0 when freed.
*/
int
mlx5_txq_release(struct rte_eth_dev *dev, uint16_t idx)
@@ -839,13 +839,8 @@ mlx5_txq_release(struct rte_eth_dev *dev, uint16_t idx)
txq = container_of((*priv->txqs)[idx], struct mlx5_txq_ctrl, txq);
DEBUG("%p: Tx queue %p: refcnt %d", (void *)dev,
(void *)txq, rte_atomic32_read(&txq->refcnt));
- if (txq->ibv) {
- int ret;
-
- ret = mlx5_txq_ibv_release(txq->ibv);
- if (!ret)
- txq->ibv = NULL;
- }
+ if (txq->ibv && !mlx5_txq_ibv_release(txq->ibv))
+ txq->ibv = NULL;
for (i = 0; i != MLX5_PMD_TX_MP_CACHE; ++i) {
if (txq->txq.mp2mr[i]) {
mlx5_mr_release(txq->txq.mp2mr[i]);
@@ -862,7 +857,7 @@ mlx5_txq_release(struct rte_eth_dev *dev, uint16_t idx)
(*priv->txqs)[idx] = NULL;
return 0;
}
- return EBUSY;
+ return 1;
}
/**