lkml.org 
[lkml]   [1999]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Maximal eth devices and [NOPATCH :-)] current kernel versions
From
Date
"Nico Schmoigl" <cts@writemail.com> writes:

> somebody in here, told that he uses more than 16 devices and that
> the kernel causes problems. I just made a quick patch, making the
> number of eth devices configurable. Please test it out.

We should rather make it dynamic - some drivers already do that.
Of course, that means disposing the table from Space.c.

OTOH most drivers use separate (kmalloced) stats memory - I think the best
we can do to prevent wasting &fragmenting RAM is to allocate it in one chunk:

struct netdevice {
struct device netdev; /* Must be first item */
struct net_device_stats stats;
char name[IFNAMSIZ];
};


register_network_device_with_stats_and_possibly_other_things (char *name):
{
struct netdevice *dev = kmalloc(sizeof(struct netdevice), GFP_KERNEL);

if (dev==NULL)
return NULL;

memset(dev, 0, sizeof(struct netdevice));
dev->netdev.name=dev->name;
if (dev_alloc_name(&hdlc->netdev, name))
{
kfree(dev);
return NULL;
}

if (register_netdevice(&dev->netdev)!=0)
{
kfree(dev);
return NULL;
}

return dev;
}


Or should we just merge all fields (device, stats, name) into one struct?
--
Krzysztof Halasa
Network Administrator

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:53    [W:1.231 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site