[dpdk-dev] [PATCH v2 5/6] net/mlx5: release Tx queue resource earlier than Rx
Yongseok Koh
yskoh at mellanox.com
Mon Apr 2 20:50:07 CEST 2018
Multi-Packet RQ uses mbuf indirection and direct mbufs come from the
private Mempool (rxq->mprq_mp) of PMD. To properly release the Mempool, it
is better to empty the Tx completeion array (txq->elts) before releasing
it.
Signed-off-by: Yongseok Koh <yskoh at mellanox.com>
---
drivers/net/mlx5/mlx5.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index aba44746f..51169e6ac 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -189,14 +189,6 @@ mlx5_dev_close(struct rte_eth_dev *dev)
/* Prevent crashes when queues are still in use. */
dev->rx_pkt_burst = removed_rx_burst;
dev->tx_pkt_burst = removed_tx_burst;
- if (priv->rxqs != NULL) {
- /* XXX race condition if mlx5_rx_burst() is still running. */
- usleep(1000);
- for (i = 0; (i != priv->rxqs_n); ++i)
- mlx5_rxq_release(dev, i);
- priv->rxqs_n = 0;
- priv->rxqs = NULL;
- }
if (priv->txqs != NULL) {
/* XXX race condition if mlx5_tx_burst() is still running. */
usleep(1000);
@@ -205,6 +197,14 @@ mlx5_dev_close(struct rte_eth_dev *dev)
priv->txqs_n = 0;
priv->txqs = NULL;
}
+ if (priv->rxqs != NULL) {
+ /* XXX race condition if mlx5_rx_burst() is still running. */
+ usleep(1000);
+ for (i = 0; (i != priv->rxqs_n); ++i)
+ mlx5_rxq_release(dev, i);
+ priv->rxqs_n = 0;
+ priv->rxqs = NULL;
+ }
if (priv->pd != NULL) {
assert(priv->ctx != NULL);
claim_zero(mlx5_glue->dealloc_pd(priv->pd));
--
2.11.0
More information about the dev
mailing list