* [PATCH][BONDING] Add max_bonds kernel parameter
@ 2008-02-29 18:51 Phil Oester
2008-02-29 19:03 ` Jay Vosburgh
0 siblings, 1 reply; 3+ messages in thread
From: Phil Oester @ 2008-02-29 18:51 UTC (permalink / raw)
To: netdev
[-- Attachment #1: Type: text/plain, Size: 2 bytes --]
[-- Attachment #2: patch-maxbonds --]
[-- Type: text/plain, Size: 1586 bytes --]
commit eb8694ab0a53343ebb45abeb2a9568d6267fa2f2
Author: Phil Oester <kernel@linuxace.com>
Date: Fri Feb 29 13:26:34 2008 -0500
The bonding driver (and initscripts) seem to assume everyone loads bonding
as a module. So when compiled into the kernel, changing the max_bonds
parameter can only be done in the source code.
Below adds a kernel command line parameter to change max_bonds when
compiled in.
Phil
Signed-off-by: Phil Oester <kernel@linuxace.com>
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 9a5b665..4b21045 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1071,6 +1071,10 @@ and is between 256 and 4096 characters. It is defined in the file
(machvec) in a generic kernel.
Example: machvec=hpzx1_swiotlb
+ max_bonds= [NET] Maximum number of bonded devices which can be
+ created and the default number of devices which
+ will be created automatically at boot.
+
max_loop= [LOOP] Maximum number of loopback devices that can
be mounted
Format: <1-256>
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 0942d82..64597d8 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -5032,3 +5032,12 @@ MODULE_SUPPORTED_DEVICE("most ethernet devices");
* End:
*/
+#ifndef MODULE
+static int __init max_bonds_setup(char *str)
+{
+ max_bonds = simple_strtol(str, NULL, 0);
+ return 1;
+}
+
+__setup("max_bonds=", max_bonds_setup);
+#endif
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH][BONDING] Add max_bonds kernel parameter
2008-02-29 18:51 [PATCH][BONDING] Add max_bonds kernel parameter Phil Oester
@ 2008-02-29 19:03 ` Jay Vosburgh
2008-02-29 19:31 ` Phil Oester
0 siblings, 1 reply; 3+ messages in thread
From: Jay Vosburgh @ 2008-02-29 19:03 UTC (permalink / raw)
To: Phil Oester; +Cc: netdev
Phil Oester <kernel@linuxace.com> wrote:
[...]
> The bonding driver (and initscripts) seem to assume everyone loads bonding
> as a module. So when compiled into the kernel, changing the max_bonds
> parameter can only be done in the source code.
The kernel should already handle options for compiled-in
modules. For bonding, you'd put something like "bonding.max_bonds=3" on
the kernel boot line. No need to patch bonding for this. This is
described in Documentation/kernel-parameters.txt (right at the top).
On your other patch, I don't see a big issue with allowing
max_bonds to be zero; I'll have a look at the details and test it out.
-J
---
-Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH][BONDING] Add max_bonds kernel parameter
2008-02-29 19:03 ` Jay Vosburgh
@ 2008-02-29 19:31 ` Phil Oester
0 siblings, 0 replies; 3+ messages in thread
From: Phil Oester @ 2008-02-29 19:31 UTC (permalink / raw)
To: Jay Vosburgh; +Cc: netdev
On Fri, Feb 29, 2008 at 11:03:56AM -0800, Jay Vosburgh wrote:
> The kernel should already handle options for compiled-in
> modules. For bonding, you'd put something like "bonding.max_bonds=3" on
> the kernel boot line. No need to patch bonding for this. This is
> described in Documentation/kernel-parameters.txt (right at the top).
Duh...guess I should've read the file I was patching. :-/
> On your other patch, I don't see a big issue with allowing
> max_bonds to be zero; I'll have a look at the details and test it out.
Thanks. Initscripts doesn't like it when it is set to zero,
but at least we can hopefully get the kernel to allow it, then
fixup initscipts later.
Phil
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-02-29 19:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-29 18:51 [PATCH][BONDING] Add max_bonds kernel parameter Phil Oester
2008-02-29 19:03 ` Jay Vosburgh
2008-02-29 19:31 ` Phil Oester
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).