mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rajasekhar Inguva <irajasek@in.ibm.com>
To: girouard@us.ibm.com
Cc: ctindel@ieee.org, willy@meta-x.org,
	linux kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH]:Ethernet Bonding Driver-2.4.17
Date: Sat, 16 Feb 2002 17:14:45 +0530	[thread overview]
Message-ID: <3C6E462D.39039598@in.ibm.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1775 bytes --]

Hi all,

The patch is WRT a problem with the Ethernet Bonding Driver when
compiled as a module. Tested on 2.4.17
and the patch is also against 2.4.17.

# insmod bonding max_bonds=2
Using /lib/modules/2.4.17/kernel/drivers/net/bonding.o
Warning: /lib/modules/2.4.17/kernel/drivers/net/bonding.o parameter
max_bonds
has max < min!
/lib/modules/2.4.17/kernel/drivers/net/bonding.o: unknown parameter type
'(' for
max_bonds

and the module fails to load.

The problem seems to be with the way MODULE_PARM was written for
max_bonds. 

MODULE_PARM(max_bonds,"1-" __MODULE_STRING(INT_MAX) "i"); 

INT_MAX is defined to be ((int)(~0U>>1)) and 'insmod' gets the string
"1-((int)(~0U>>1))i" which it is failing to understand.

As max_bonds is an integer and not an array, i feel omitting the min-max
range would be a better option.

And if a negative or zero value is supplied to max_bonds while loading,
it can be taken care of in bonding_init() by setting it back to
MAX_BONDS.

Thx,
Rajasekhar Inguva


--- /usr/src/linux/drivers/net/bonding.c	Fri Dec 21 23:11:54 2001
+++ /usr/src/linux/drivers/fixed/bonding.c	Sat Feb 16 17:03:48 2002
@@ -226,7 +226,7 @@
 static struct bonding *these_bonds =  NULL;
 static struct net_device *dev_bonds = NULL;
 
-MODULE_PARM(max_bonds, "1-" __MODULE_STRING(INT_MAX) "i");
+MODULE_PARM(max_bonds,"i");
 MODULE_PARM_DESC(max_bonds, "Max number of bonded devices");
 MODULE_PARM(miimon, "i");
 MODULE_PARM_DESC(miimon, "Link check interval in milliseconds");
@@ -1981,6 +1981,10 @@
 
 	/* Find a name for this unit */
 	static struct net_device *dev_bond = NULL;
+
+	/* If max_bonds <=0, set it to MAX_BONDS */
+	if(max_bonds <=0)
+		max_bonds = MAX_BONDS;
 
 	dev_bond = dev_bonds = kmalloc(max_bonds*sizeof(struct net_device), 
 					GFP_KERNEL);

[-- Attachment #2: bonding.patch --]
[-- Type: text/plain, Size: 780 bytes --]

--- /usr/src/linux/drivers/net/bonding.c	Fri Dec 21 23:11:54 2001
+++ /usr/src/linux/drivers/fixed/bonding.c	Sat Feb 16 17:03:48 2002
@@ -226,7 +226,7 @@
 static struct bonding *these_bonds =  NULL;
 static struct net_device *dev_bonds = NULL;
 
-MODULE_PARM(max_bonds, "1-" __MODULE_STRING(INT_MAX) "i");
+MODULE_PARM(max_bonds,"i");
 MODULE_PARM_DESC(max_bonds, "Max number of bonded devices");
 MODULE_PARM(miimon, "i");
 MODULE_PARM_DESC(miimon, "Link check interval in milliseconds");
@@ -1981,6 +1981,10 @@
 
 	/* Find a name for this unit */
 	static struct net_device *dev_bond = NULL;
+
+	/* If max_bonds <=0, set it to MAX_BONDS */
+	if(max_bonds <=0)
+		max_bonds = MAX_BONDS;
 
 	dev_bond = dev_bonds = kmalloc(max_bonds*sizeof(struct net_device), 
 					GFP_KERNEL);

             reply	other threads:[~2002-02-16 11:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-16 11:44 Rajasekhar Inguva [this message]
2002-02-16 12:28 ` Pozsar Balazs
2002-02-22 10:13   ` Ken Brownfield
2002-02-16 12:41 ` willy tarreau

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=3C6E462D.39039598@in.ibm.com \
    --to=irajasek@in.ibm.com \
    --cc=ctindel@ieee.org \
    --cc=girouard@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=willy@meta-x.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®