net/mlx4: fix Tx doorbell register unmap

If rdma-core library doesn't support remapping UAR registers, the register
shouldn't be unmapped on device stop.

Fixes: 0203d33a10 ("net/mlx4: support secondary process")

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
This commit is contained in:
Yongseok Koh 2019-04-08 11:23:13 -07:00 committed by Ferruh Yigit
parent bbda883ca0
commit b27669d691

View File

@ -314,8 +314,10 @@ static void
mlx4_dev_stop(struct rte_eth_dev *dev) mlx4_dev_stop(struct rte_eth_dev *dev)
{ {
struct mlx4_priv *priv = dev->data->dev_private; struct mlx4_priv *priv = dev->data->dev_private;
#ifdef HAVE_IBV_MLX4_UAR_MMAP_OFFSET
const size_t page_size = sysconf(_SC_PAGESIZE); const size_t page_size = sysconf(_SC_PAGESIZE);
int i; int i;
#endif
if (!priv->started) if (!priv->started)
return; return;
@ -329,6 +331,7 @@ mlx4_dev_stop(struct rte_eth_dev *dev)
mlx4_flow_sync(priv, NULL); mlx4_flow_sync(priv, NULL);
mlx4_rxq_intr_disable(priv); mlx4_rxq_intr_disable(priv);
mlx4_rss_deinit(priv); mlx4_rss_deinit(priv);
#ifdef HAVE_IBV_MLX4_UAR_MMAP_OFFSET
for (i = 0; i != dev->data->nb_tx_queues; ++i) { for (i = 0; i != dev->data->nb_tx_queues; ++i) {
struct txq *txq; struct txq *txq;
@ -338,6 +341,7 @@ mlx4_dev_stop(struct rte_eth_dev *dev)
munmap((void *)RTE_ALIGN_FLOOR((uintptr_t)txq->msq.db, munmap((void *)RTE_ALIGN_FLOOR((uintptr_t)txq->msq.db,
page_size), page_size); page_size), page_size);
} }
#endif
} }
/** /**