So, I've got a device that wants (for various reasons) to manage a
fairly large range of minor numbers, in addition to being a GLDv3
device. This causes some serious grief, because GLDv3 is particularly
greedy in its consumption of minor numbers.
GLDv3 currently consumes minor numbers as 0-1000 for physical PPAs (0 is
the style 2 node though), and 1001 to MAXMIN32 for individual streams.
The way GLDv3 uses the 1001-MAXMIN32 is such that minor numbers are not
recycled (so its not a first fit algorithm), and the space is shared
across all network devices in the system.
There are two possible solutions:
The first possibility is to cut this number in *half*, by reserving the
space of minor numbers with the high order bit set for driver-private use.
This means that instead of some 250k possible open network streams,
there will only be some 128k possible open network streams (that is
streams that go all the way to a GLDv3 device) in a single system.
Frankly, I doubt this is much of a limitation given current systems.
(How many plumbed interfaces, and simultaneous copies of snoop/tcpdump,
do we really think we need to support?)
That's the low cost of effort, easy solution.
The second possibility is to change how we manage minor numbers in GLDv3.
A possibly superior solution would be to allow drivers to supply an
entry point that would allow them to supply their own range of numbers.
This is architecturally superior, but it has some bigger changes in the
GLDv3 (and specifically in dld/dld_str.c) that would be required.
To create a stream, we'd have to be able to go back to the MAC driver
and lookup the hash id for that, and the str_hashp modhash would have to
include the major number as well as the minor number to distinguish
which key is being used.
We'd have to go beyond the simple kmem_cache for dld_str initialization,
and dld_str_open() would need to lookup the id using the major number.
(I think this corresponds to a unique id_space_t * for each major number
registered with GLDv3. We could even be clever about this and do it by
passing a pointer to the id_space_t for the driver as part of the PPAs
registration routine (mac_register()) using some special capability.
(MAC_CAPAB_MINOR_ALLOC or somesuch.)
I'm willing to try to prototype the above logic, but I'd like opinions
about the approach before I do. Can anyone see any problems with this?
What else am I missing? Is there some logic (outside of what's in
dld_str.c) that relies on the minor numbers for GLDv3 streams being
unique across all GLDv3 drivers? (I don't see anything...)
- Garrett
_______________________________________________
networking-discuss mailing list
[email protected]