summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2018-03-26 21:00:57 +0000
committerhselasky <hselasky@FreeBSD.org>2018-03-26 21:00:57 +0000
commit416e417c09f50ba7c610027e9a673215c90eb7c8 (patch)
treecf8337a425d4a36cb0ee6569be240a89c83adca5
parentf2a88216d8399035757bfdcc8b18947d53f458da (diff)
downloadFreeBSD-src-416e417c09f50ba7c610027e9a673215c90eb7c8.zip
FreeBSD-src-416e417c09f50ba7c610027e9a673215c90eb7c8.tar.gz
MFC r330656:
Use the device unit number for naming the ifnet interface in mlx5en(4). Currently the ifnet interface is named mceX, where X is a monotonically incremented value. If the device is reset due to a fatal error, then the interface name will change. Using the device unit number will keep the naming consistent across the reset logic. Submitted by: Matthew Finlay <matt@mellanox.com> Sponsored by: Mellanox Technologies
-rw-r--r--sys/dev/mlx5/mlx5_en/mlx5_en_main.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
index c622dd2..b884132 100644
--- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
+++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
@@ -3327,7 +3327,6 @@ mlx5e_setup_pauseframes(struct mlx5e_priv *priv)
static void *
mlx5e_create_ifp(struct mlx5_core_dev *mdev)
{
- static volatile int mlx5_en_unit;
struct ifnet *ifp;
struct mlx5e_priv *priv;
u8 dev_addr[ETHER_ADDR_LEN] __aligned(4);
@@ -3351,7 +3350,7 @@ mlx5e_create_ifp(struct mlx5_core_dev *mdev)
goto err_free_priv;
}
ifp->if_softc = priv;
- if_initname(ifp, "mce", atomic_fetchadd_int(&mlx5_en_unit, 1));
+ if_initname(ifp, "mce", device_get_unit(mdev->pdev->dev.bsddev));
ifp->if_mtu = ETHERMTU;
ifp->if_init = mlx5e_open;
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
OpenPOWER on IntegriCloud