summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2017-06-04 08:47:09 +0000
committerhselasky <hselasky@FreeBSD.org>2017-06-04 08:47:09 +0000
commit9779bfdbb17159be52de128b9016acd6591805d3 (patch)
tree34aca820bdd3e053e7a49d27dacaa2b9b41c839a
parent2f73d82b328db261c2a098a3b6c32db40476d5cc (diff)
downloadFreeBSD-src-9779bfdbb17159be52de128b9016acd6591805d3.zip
FreeBSD-src-9779bfdbb17159be52de128b9016acd6591805d3.tar.gz
MFC r319413:
Free hardware queue resource after port is stopped in the mlx4en(4) driver. Else if the port is up the resource might still be busy and the MTT free will fail. PR: 216493 Sponsored by: Mellanox Technologies
-rw-r--r--sys/ofed/drivers/net/mlx4/en_netdev.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/ofed/drivers/net/mlx4/en_netdev.c b/sys/ofed/drivers/net/mlx4/en_netdev.c
index 6ec5528..606d2b1 100644
--- a/sys/ofed/drivers/net/mlx4/en_netdev.c
+++ b/sys/ofed/drivers/net/mlx4/en_netdev.c
@@ -1732,13 +1732,12 @@ void mlx4_en_destroy_netdev(struct net_device *dev)
mutex_unlock(&mdev->state_lock);
}
- if (priv->allocated)
- mlx4_free_hwq_res(mdev->dev, &priv->res, MLX4_EN_PAGE_SIZE);
-
mutex_lock(&mdev->state_lock);
mlx4_en_stop_port(dev);
mutex_unlock(&mdev->state_lock);
+ if (priv->allocated)
+ mlx4_free_hwq_res(mdev->dev, &priv->res, MLX4_EN_PAGE_SIZE);
cancel_delayed_work(&priv->stats_task);
cancel_delayed_work(&priv->service_task);
OpenPOWER on IntegriCloud