
Story: 2007308 Task: 38795 Depends-On: https://review.opendev.org/#/c/722017/ Depends-On: https://review.opendev.org/#/c/722019/ Change-Id: I942b2aa6167120157a38af83135ed358b17ee78b Signed-off-by: Dongqi Chen <chen.dq@neusoft.com>
36 lines
1.1 KiB
Diff
36 lines
1.1 KiB
Diff
From ad08e36ea088aebb3c65f98b5ea87a9f095155b3 Mon Sep 17 00:00:00 2001
|
|
From: Chris Friesen <chris.friesen@windriver.com>
|
|
Date: Thu, 12 May 2016 18:00:00 -0400
|
|
Subject: [PATCH 05/10] Make kernel start eth devices at offset
|
|
|
|
In order to avoid naming collisions, we want to make the kernel
|
|
start naming its "ethX" devices at eth1000 instead of eth0. This
|
|
will let us rename to a range starting at eth0.
|
|
|
|
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
|
|
Signed-off-by: Zhang Zhiguo <zhangzhg@neusoft.com>
|
|
---
|
|
net/core/dev.c | 6 ++++++
|
|
1 file changed, 6 insertions(+)
|
|
|
|
diff --git a/net/core/dev.c b/net/core/dev.c
|
|
index 6a531ca..980860d 100644
|
|
--- a/net/core/dev.c
|
|
+++ b/net/core/dev.c
|
|
@@ -1100,6 +1100,12 @@ static int __dev_alloc_name(struct net *net, const char *name, char *buf)
|
|
set_bit(i, inuse);
|
|
}
|
|
|
|
+ /* STX extension, want kernel to start at eth1000 */
|
|
+ if (strcmp(name, "eth%d") == 0) {
|
|
+ for (i=0; i < 1000; i++)
|
|
+ set_bit(i, inuse);
|
|
+ }
|
|
+
|
|
i = find_first_zero_bit(inuse, max_netdevices);
|
|
free_page((unsigned long) inuse);
|
|
}
|
|
--
|
|
2.7.4
|
|
|