Re: [PATCH] Maximal eth devices and [NOPATCH :-)] current kernel versions

Nico Schmoigl (cts@writemail.com)
Sun, 1 Aug 1999 17:55:42 +0200


--Message-Boundary-23935
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Content-description: Mail message body

> somebody in here, told that he uses more than 16 devices and that
> the kernel causes problems. I just made a quick patch, making the
> number of eth devices configurable. Please test it out.

Sorry, attachment did not went out of my box :-(

73
Nico

EMail: cts@writemail.com
PGP-fingerprint: 5DDB 09E4 3FF3 CD09 7559 1117 9C03 46E3 38FC 9E03

--Message-Boundary-23935
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Content-description: Text from file 'user-max-eth-devices-vs-2.3.12.diff'

diff -ur linux-2.3.12-vanilla/Documentation/Configure.help linux-2.3.12/Documentation/Configure.help
--- linux-2.3.12-vanilla/Documentation/Configure.help Sun Aug 1 15:36:12 1999
+++ linux-2.3.12/Documentation/Configure.help Sun Aug 1 17:23:17 1999
@@ -5886,6 +5886,21 @@
kernel: saying N will just cause this configure script to skip all
the questions about Ethernet network cards. If unsure, say N.

+Maximal number of attached eth devices
+CONFIG_MAX_USER_ETH_DEVICES
+ You can adjust the maximal number of devices which are using the eth
+ interface. By default this value is 16.
+
+ There is an internal security value of 2 which is added to your choice.
+ Please note that there are internal maximal numbers of the same NIC
+ type set by the drivers itself. They might need adjustment seperately!
+
+ If you are using the kernel as a small box (i.e. workstation) and you
+ do not need many ethernet devices, you could decrease this value to 2.
+
+ If unsure what all this means, leave the value to 16 - it will not do
+ any harm.
+
Sun LANCE Ethernet support
CONFIG_SUN_LANCE
This is support for lance Ethernet cards on Sun workstations such as
diff -ur linux-2.3.12-vanilla/drivers/net/Config.in linux-2.3.12/drivers/net/Config.in
--- linux-2.3.12-vanilla/drivers/net/Config.in Sun Aug 1 15:36:09 1999
+++ linux-2.3.12/drivers/net/Config.in Sun Aug 1 17:09:14 1999
@@ -33,6 +33,7 @@

bool 'Ethernet (10 or 100Mbit)' CONFIG_NET_ETHERNET
if [ "$CONFIG_NET_ETHERNET" = "y" ]; then
+ int 'Maximal number of attached eth devices' CONFIG_MAX_USER_ETH_DEVICES 16
if [ "$CONFIG_ARM" = "y" ]; then
if [ "$CONFIG_ARCH_ACORN" != "y" ]; then
tristate 'AM79C961A support' CONFIG_ARM_AM79C961A
diff -ur linux-2.3.12-vanilla/drivers/net/net_init.c linux-2.3.12/drivers/net/net_init.c
--- linux-2.3.12-vanilla/drivers/net/net_init.c Sat Jul 10 15:07:38 1999
+++ linux-2.3.12/drivers/net/net_init.c Sun Aug 1 17:05:30 1999
@@ -60,8 +60,13 @@
and a space waste]
*/

+#define MAX_ETH_DEVICE_SECURITY 2
+/* +2 is a bit of a security as it might be possible that you
+ * install one card more than you expected at first.
+*/
+
/* The list of used and available "eth" slots (for "eth0", "eth1", etc.) */
-#define MAX_ETH_CARDS 16
+#define MAX_ETH_CARDS CONFIG_MAX_USER_ETH_DEVICES+MAX_ETH_DEVICE_SECURITY
static struct device *ethdev_index[MAX_ETH_CARDS];


diff -ur linux-2.3.12-vanilla/scripts/Menuconfig linux-2.3.12/scripts/Menuconfig
--- linux-2.3.12-vanilla/scripts/Menuconfig Sat Jul 10 15:01:08 1999
+++ linux-2.3.12/scripts/Menuconfig Sun Aug 1 17:07:33 1999
@@ -198,6 +198,17 @@
}

#
+# define_int sets the value of a integer argument
+#
+# define_int define value
+#
+function define_int () {
+ echo "$1=$2" >>$CONFIG
+ echo "#define $1 ($2)" >>$CONFIG_H
+ eval "$1=$2"
+}
+
+#
# Add a menu item which will call our local int function.
#
function int () {
@@ -209,6 +220,17 @@
}

#
+# define_hex sets the value of a hexadecimal argument
+#
+# define_hex define value
+#
+function define_hex () {
+ echo "$1=$2" >>$CONFIG
+ echo "#define $1 0x${2#*[x,X]}" >>$CONFIG_H
+ eval "$1=$2"
+}
+
+#
# Add a menu item which will call our local hex function.
#
function hex () {
@@ -229,6 +251,17 @@
echo -ne "'$2' ' $1: \"$x\"$info' " >>MCmenu

echo -e "function $2 () { l_string '$1' '$2' '$3' '$x' ;}" >>MCradiolists
+}
+
+#
+# define_string sets the value of a string argument
+#
+# define_string define value
+#
+function define_string () {
+ echo "$1="'"'$2'"' >>$CONFIG
+ echo "#define $1 "'"'$2'"' >>$CONFIG_H
+ eval "$1=$2"
}

#

--Message-Boundary-23935--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/