[tulip] Changing MAX_UNITS to a configurable value?

Donald Becker becker@scyld.com
Mon Dec 24 01:47:00 2001


On Sun, 23 Dec 2001, Ben Greear wrote:

> I find myself wanting to run gobs of 4-port NICs in my
> machines

This is a very unusual requirement.  It's reasonable to expect someone
with such a configuration to modify documented constants at the top of
the source file.

> and the tulip driver (in 2.4.17), by default, will
> handle only 8.  There is a #define (MAX_UNITS) that looks
> like it will raise this number to, say, 32.....

Check carefully: this is a limit only on the number of interfaces that
you can pass module options to, not the number of supported interfaces.

#define MAX_UNITS 8		/* More are supported, limit only on options */

> To keep from having to change source code, I'd like to either
> make the max-units a module parameter, or a compile time
> option in 'make xconfig'.

The reason for the limit is that each module option needs a initialized
array element.

> I'm thinking that the receive queue and transmit queue length
> might be other good options for a similar change...

It's much less import today than a few years ago, but these were
constants because it makes the compiled code more efficient.

See the comment:

/* Keep the descriptor ring sizes a power of two for efficiency.


Donald Becker				becker@scyld.com
Scyld Computing Corporation		http://www.scyld.com
410 Severn Ave. Suite 210		Second Generation Beowulf Clusters
Annapolis MD 21403			410-990-9993