From: Phil Oester <kernel@linuxace.com>
To: netdev@vger.kernel.org
Subject: [PATCH][BONDING] Allow setting max_bonds to zero
Date: Fri, 29 Feb 2008 10:52:57 -0800 [thread overview]
Message-ID: <20080229185257.GB28138@linuxace.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 2 bytes --]
[-- Attachment #2: patch-zerobonds --]
[-- Type: text/plain, Size: 1456 bytes --]
commit fc78750341ab174a16f865625b24377670e92e50
Author: Phil Oester <kernel@linuxace.com>
Date: Fri Feb 29 13:43:34 2008 -0500
If the bonding driver is compiled into the kernel, it will create a
"bond0" device by default. The patch below allows max_bonds to be
set to 0 to prevent any devices from being created.
Phil
Signed-off-by: Phil Oester <kernel@linuxace.com>
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 64597d8..2bef4b4 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -4624,11 +4624,11 @@ static int bond_check_params(struct bond_params *params)
}
}
- if (max_bonds < 1 || max_bonds > INT_MAX) {
+ if (max_bonds > INT_MAX) {
printk(KERN_WARNING DRV_NAME
- ": Warning: max_bonds (%d) not in range %d-%d, so it "
+ ": Warning: max_bonds (%d) not in range 0-%d, so it "
"was reset to BOND_DEFAULT_MAX_BONDS (%d)\n",
- max_bonds, 1, INT_MAX, BOND_DEFAULT_MAX_BONDS);
+ max_bonds, INT_MAX, BOND_DEFAULT_MAX_BONDS);
max_bonds = BOND_DEFAULT_MAX_BONDS;
}
@@ -4982,9 +4982,11 @@ static int __init bonding_init(void)
goto err;
}
- res = bond_create_sysfs();
- if (res)
- goto err;
+ if (max_bonds > 0) {
+ res = bond_create_sysfs();
+ if (res)
+ goto err;
+ }
register_netdevice_notifier(&bond_netdev_notifier);
register_inetaddr_notifier(&bond_inetaddr_notifier);
reply other threads:[~2008-02-29 18:52 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080229185257.GB28138@linuxace.com \
--to=kernel@linuxace.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.