Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Mar 2018 21:00:57 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r331587 - stable/11/sys/dev/mlx5/mlx5_en
Message-ID:  <201803262100.w2QL0vxA033151@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Mon Mar 26 21:00:57 2018
New Revision: 331587
URL: https://svnweb.freebsd.org/changeset/base/331587

Log:
  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

Modified:
  stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==============================================================================
--- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c	Mon Mar 26 20:59:26 2018	(r331586)
+++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c	Mon Mar 26 21:00:57 2018	(r331587)
@@ -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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803262100.w2QL0vxA033151>