lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1422856985-16530-1-git-send-email-dsahern@gmail.com>
Date:	Sun,  1 Feb 2015 23:03:05 -0700
From:	David Ahern <dsahern@...il.com>
To:	netdev@...r.kernel.org
Cc:	sfeldma@...il.com, David Ahern <dsahern@...il.com>
Subject: [PATCH] net: rocker: Change netdev names to include slot number

Currently, rocker devices are given eth%d names. If you have multiple
rocker devices it is difficult to easily correlate eth%d names to a
rocker device and port. Change the device name to sw + PCI slot
number + p + id (sw%dp%d). This makes the device names easier to
correlate. ie., Rather than eth0, ..., eth N (N = number of ports in
device) the ports get netdev names like sw5p0, ..., sw5pN.

Signed-off-by: David Ahern <dsahern@...il.com>
---
 drivers/net/ethernet/rocker/rocker.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c
index 11f4ffcc113d..1d1cf84e6f47 100644
--- a/drivers/net/ethernet/rocker/rocker.c
+++ b/drivers/net/ethernet/rocker/rocker.c
@@ -4010,8 +4010,11 @@ static int rocker_probe_port(struct rocker *rocker, unsigned int port_number)
 	struct rocker_port *rocker_port;
 	struct net_device *dev;
 	int err;
+	char str[IFNAMSIZ];
 
-	dev = alloc_etherdev(sizeof(struct rocker_port));
+	snprintf(str, sizeof(str), "sw%dp%%d", pdev->slot->number);
+	dev = alloc_netdev_mqs(sizeof(struct rocker_port),
+			       str, NET_NAME_UNKNOWN, ether_setup, 1, 1);
 	if (!dev)
 		return -ENOMEM;
 	rocker_port = netdev_priv(dev);
-- 
1.9.3 (Apple Git-50)

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists