2000-11-14 22:18:19

by Linus Torvalds

[permalink] [raw]
Subject: test11-pre5


More drivers.

The x86 capabilities cleanup is here.

Linus

----

- pre5:
- Rasmus Andersen: add proper "<linux/init.h>" for sound drivers
- David Miller: sparc64 and networking updates
- David Trcka: MOXA numbering starts from 0, not 1.
- Jeff Garzik: sysctl.h standalone
- Dag Brattli: IrDA finishing touches
- Randy Dunlap: USB fixes
- Gerd Knorr: big bttv update
- Peter Anvin: x86 capabilities cleanup
- Stephen Rothwell: apm initcall fix - smp poweroff should work
- Andrew Morton: setscheduler() spinlock ordering fix
- Stephen Rothwell: directory notification documentation
- Petr Vandrovec: ncpfs capabilities check cleanup
- David Woodhouse: fix jffs to use generic isxxxx() library
- Chris Swiedler: oom_kill selection fix
- Jens Axboe: re-merge after sleeping in ll_rw_block.
- Randy Dunlap: USB updates (pegasus and ftdi_sio)
- Kai Germaschewski: ISDN ppp header compression fixed

- pre4:
- Andrea Arcangeli: SMP scheduler memory barrier fixup
- Richard Henderson: fix alpha semaphores and spinlock bugs.
- Richard Henderson: clean up the file from hell: "xor.c"

- pre3:
- James Simmons: vgacon "printk()" deadlock with global irq lock.
- don't poke blanked console on console output
- Ching-Ling: get channels right on ALI audio driver
- Dag Brattli and Jean Tourrilhes: big IrDA update
- Paul Mackerras: PPC updates
- Randy Dunlap: USB ID table support, LEDs with usbkbd, belkin
serial converter.
- Jeff Garzik: pcnet32 and lance net driver fix/cleanup
- Mikael Pettersson: clean up x86 ELF_PLATFORM
- Bartlomiej Zolnierkiewicz: sound and drm driver init fixes and
cleanups
- Al Viro: Jeff missed some kmap()'s. sysctl cleanup
- Kai Germaschewski: ISDN updates
- Alan Cox: SCSI driver NULL ptr checks
- David Miller: networking updates, exclusive waitqueues nest properly,
SMP i_shared_lock/page_table_lock lock order fix.

- pre2:
- Stephen Rothwell: directory notify could return with the lock held
- Richard Henderson: CLOCKS_PER_SEC on alpha.
- Jeff Garzik: ramfs and highmem: kmap() the page to clear it
- Asit Mallick: enable the APIC in the official order
- Neil Brown: avoid rd deadlock on io_request_lock by using a
private rd-request function. This also avoids unnecessary
request merging at this level.
- Ben LaHaise: vmalloc threadign and overflow fix
- Randy Dunlap: USB updates (plusb driver). PCI cacheline size.
- Neil Brown: fix a raid1 on top of lvm bug that crept in in pre1
- Alan Cox: various (Athlon mmx copy, NULL ptr checks for
scsi_register etc).
- Al Viro: fix /proc permission check security hole.
- Can-Ru Yeou: SiS301 fbcon driver
- Andrew Morton: NMI oopser and kernel page fault punch through
both console_lock and timerlist_lock to make sure it prints out..
- Jeff Garzik: clean up "kmap()" return type (it returns a kernel
virtual address, ie a "void *").
- Jeff Garzik: network driver docs, various one-liners.
- David Miller: add generic "special" flag to page flags, to be
used by architectures as they see fit. Like keeping track of
cache coherency issues.
- David Miller: sparc64 updates, make sparc32 boot again
- Davdi Millner: spel "synchronous" correctly
- David Miller: networking - fix some bridge issues, and correct
IPv6 sysctl entries.
- Dan Aloni: make fork.c use proper macro rather than doing
get_exec_domain() by hand.

- pre1:
- me: make PCMCIA work even in the absense of PCI irq's
- me: add irq mapping capabilities for Cyrix southbridges
- me: make IBMMCA compile right as a module
- me: uhhuh. Major atomic-PTE SMP race boo-boo. Fixed.
- Andrea Arkangeli: don't allow people to set security-conscious
bits in mxcsr through ptrace SETFPXREGS.
- J?rgen Fischer: aha152x update
- Andrew Morton, Trond Myklebust: file locking fixes
- me: TLB invalidate race with highmem
- Paul Fulghum: synclink/n_hdlc driver updates
- David Miller: export sysctl_jiffies, and have the proper no-sysctl
version handy
- Neil Brown: RAID driver deadlock and nsfd read access to
execute-only files fix
- Keith Owens: clean up module information passing, remove
"get_module_symbol()".
- Jeff Garzik: network (and other) driver fixes and cleanups
- Andrea Arkangeli: scheduler cleanup.
- Ching-Ling Li: fix ALi sound driver memory leak
- Anton Altaparmakov: upcase fix for NTFS
- Thomas Woller: CS4281 audio update


2000-11-14 23:16:35

by Dan Aloni

[permalink] [raw]
Subject: [PATCH] Re: test11-pre5


against: test11-pre5
summery: dev_3c501.name shouldn't be NULL, or we get oops
reason: Correct me if I'm wrong, but 3c501.c:init_module() calls
net_init.c:register_netdev(&dev_3c501), which calls strchr(),
{and might also,which might} dereference dev_3c501.name.

--- linux/drivers/net/3c501.c Wed Nov 15 00:30:40 2000
+++ linux/drivers/net/3c501.c Wed Nov 15 00:31:44 2000
@@ -915,6 +915,7 @@
#ifdef MODULE

static struct net_device dev_3c501 = {
+ name: "",
init: el1_probe,
base_addr: 0x280,
irq: 5,


--
Dan Aloni
[email protected]

2000-11-14 23:17:35

by Jes Sorensen

[permalink] [raw]
Subject: Re: test11-pre5

>>>>> "Linus" == Linus Torvalds <[email protected]> writes:

Linus> More drivers.

Linus> The x86 capabilities cleanup is here.

Hi Linus

Looks like you missed the acenic bugfix patch. Here is an uptodate
version relative to pre5.

Jes

--- linux-2.4.0-test11-pre5/drivers/net/acenic.c Tue Nov 14 17:45:26 2000
+++ drivers/net/acenic.c Mon Nov 13 19:26:23 2000
@@ -2,7 +2,7 @@
* acenic.c: Linux driver for the Alteon AceNIC Gigabit Ethernet card
* and other Tigon based cards.
*
- * Copyright 1998-2000 by Jes Sorensen, <[email protected]>.
+ * Copyright 1998-2000 by Jes Sorensen, <[email protected]>.
*
* Thanks to Alteon and 3Com for providing hardware and documentation
* enabling me to write this driver.
@@ -39,6 +39,8 @@
* where the driver would disable
* bus master mode if it had to disable
* write and invalidate.
+ * Stephen Hack <[email protected]>: Fixed ace_set_mac_addr for little
+ * endian systems.
*/

#include <linux/config.h>
@@ -55,10 +57,12 @@
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/mm.h>
+#include <linux/sockios.h>

-#undef INDEX_DEBUG
-
+#ifdef SIOCETHTOOL
#include <linux/ethtool.h>
+#endif
+
#include <net/sock.h>
#include <net/ip.h>

@@ -69,6 +73,9 @@
#include <asm/uaccess.h>


+#undef INDEX_DEBUG
+
+
#ifdef CONFIG_ACENIC_OMIT_TIGON_I
#define ACE_IS_TIGON_I(ap) 0
#else
@@ -119,6 +126,15 @@
#define SMP_CACHE_BYTES L1_CACHE_BYTES
#endif

+#ifndef SET_MODULE_OWNER
+#define SET_MODULE_OWNER(dev) {do{} while(0);}
+#define ACE_MOD_INC_USE_COUNT MOD_INC_USE_COUNT
+#define ACE_MOD_DEC_USE_COUNT MOD_DEC_USE_COUNT
+#else
+#define ACE_MOD_INC_USE_COUNT {do{} while(0);}
+#define ACE_MOD_DEC_USE_COUNT {do{} while(0);}
+#endif
+

#if (LINUX_VERSION_CODE < 0x02030d)
#define pci_resource_start(dev, bar) dev->base_address[bar]
@@ -130,10 +146,6 @@
#define net_device device
#endif

-#if (LINUX_VERSION_CODE >= 0x02031b)
-#define NEW_NETINIT
-#endif
-
#if (LINUX_VERSION_CODE < 0x02032a)
typedef u32 dma_addr_t;

@@ -154,10 +166,20 @@
#if (LINUX_VERSION_CODE < 0x02032b)
/*
* SoftNet
+ *
+ * For pre-softnet kernels we need to tell the upper layer not to
+ * re-enter start_xmit() while we are in there. However softnet
+ * guarantees not to enter while we are in there so there is no need
+ * to do the netif_stop_queue() dance unless the transmit queue really
+ * gets stuck. This should also improve performance according to tests
+ * done by Aman Singla.
*/
-#define dev_kfree_skb_irq(a) dev_kfree_skb(a)
-#define netif_wake_queue(dev) clear_bit(0, &dev->tbusy)
-#define netif_stop_queue(dev) set_bit(0, &dev->tbusy)
+#define dev_kfree_skb_irq(a) dev_kfree_skb(a)
+#define netif_wake_queue(dev) clear_bit(0, &dev->tbusy)
+#define netif_stop_queue(dev) set_bit(0, &dev->tbusy)
+#define late_stop_netif_stop_queue(dev) {do{} while(0);}
+#define early_stop_netif_stop_queue(dev) test_and_set_bit(0,&dev->tbusy)
+#define early_stop_netif_wake_queue(dev) netif_wake_queue(dev)

static inline void netif_start_queue(struct net_device *dev)
{
@@ -166,16 +188,22 @@
dev->start = 1;
}

-#define ace_mark_net_bh(foo) mark_bh(foo)
-#define netif_queue_stopped(dev) dev->tbusy
-#define netif_running(dev) dev->start
-#define ace_if_down(dev) {do{dev->start = 0;}while (0);}
+#define ace_mark_net_bh(foo) mark_bh(foo)
+#define netif_queue_stopped(dev) dev->tbusy
+#define netif_running(dev) dev->start
+#define ace_if_down(dev) {do{dev->start = 0;}while (0);}
#else
-#define NET_BH 0
-#define ace_mark_net_bh(foo) {do{} while(0);}
-#define ace_if_down(dev) {do{} while(0);}
+#define NET_BH 0
+#define late_stop_netif_stop_queue(dev) netif_stop_queue(dev)
+#define early_stop_netif_stop_queue(dev) 0
+#define early_stop_netif_wake_queue(dev) {do{} while(0);}
+#define ace_mark_net_bh(foo) {do{} while(0);}
+#define ace_if_down(dev) {do{} while(0);}
#endif

+#if (LINUX_VERSION_CODE >= 0x02031b)
+#define NEW_NETINIT
+#endif

#define ACE_MAX_MOD_PARMS 8
#define BOARD_IDX_STATIC 0
@@ -400,10 +428,10 @@
static int dis_pci_mem_inval[ACE_MAX_MOD_PARMS] = {1, 1, 1, 1, 1, 1, 1, 1};

static char version[] __initdata =
- "acenic.c: v0.47 09/18/2000 Jes Sorensen, [email protected]\n"
+ "acenic.c: v0.48 11/14/2000 Jes Sorensen, [email protected]\n"
" http://home.cern.ch/~jes/gige/acenic.html\n";

-static struct net_device *root_dev;
+static struct net_device *root_dev = NULL;

static int probed __initdata = 0;

@@ -460,6 +488,8 @@
break;
}

+ SET_MODULE_OWNER(dev);
+
if (!dev->priv)
dev->priv = kmalloc(sizeof(*ap), GFP_KERNEL);
if (!dev->priv) {
@@ -615,7 +645,7 @@


#ifdef MODULE
-MODULE_AUTHOR("Jes Sorensen <[email protected]>");
+MODULE_AUTHOR("Jes Sorensen <[email protected]>");
MODULE_DESCRIPTION("AceNIC/3C985/GA620 Gigabit Ethernet driver");
MODULE_PARM(link, "1-" __MODULE_STRING(8) "i");
MODULE_PARM(trace, "1-" __MODULE_STRING(8) "i");
@@ -634,8 +664,8 @@
short i;

while (root_dev) {
- next = ((struct ace_private *)root_dev->priv)->next;
ap = root_dev->priv;
+ next = ap->next;

regs = ap->regs;

@@ -730,8 +760,8 @@
}


-#ifdef MODULE
#if (LINUX_VERSION_CODE < 0x02032a)
+#ifdef MODULE
int init_module(void)
{
return ace_module_init();
@@ -742,11 +772,11 @@
{
ace_module_cleanup();
}
+#endif
#else
module_init(ace_module_init);
module_exit(ace_module_cleanup);
#endif
-#endif


static void ace_free_descriptors(struct net_device *dev)
@@ -2211,7 +2241,7 @@

netif_start_queue(dev);

- MOD_INC_USE_COUNT;
+ ACE_MOD_INC_USE_COUNT;

/*
* Setup the timer
@@ -2294,7 +2324,7 @@

restore_flags(flags);

- MOD_DEC_USE_COUNT;
+ ACE_MOD_DEC_USE_COUNT;
return 0;
}

@@ -2307,14 +2337,10 @@
u32 idx, flagsize;

/*
- * ARGH, there is just no pretty way to do this
+ * This only happens with pre-softnet, ie. 2.2.x kernels.
*/
-#if (LINUX_VERSION_CODE < 0x02032b)
- if (test_and_set_bit(0, &dev->tbusy))
+ if (early_stop_netif_stop_queue(dev))
return 1;
-#else
- netif_stop_queue(dev);
-#endif

idx = ap->tx_prd;

@@ -2358,7 +2384,8 @@
*/
mod_timer(&ap->timer, jiffies + (3 * HZ));

- /* The following check will fix a race between the interrupt
+ /*
+ * The following check will fix a race between the interrupt
* handler increasing the tx_ret_csm and testing for tx_full
* and this tx routine's testing the tx_ret_csm and setting
* the tx_full; note that this fix makes assumptions on the
@@ -2369,13 +2396,17 @@
if (((idx + 2) % TX_RING_ENTRIES != ap->tx_ret_csm)
&& xchg(&ap->tx_full, 0)) {
del_timer(&ap->timer);
+ /*
+ * We may not need this one in the post softnet era
+ * in this case this can be changed to a
+ * early_stop_netif_wake_queue(dev);
+ */
netif_wake_queue(dev);
+ } else {
+ late_stop_netif_stop_queue(dev);
}
} else {
- /*
- * No need for it to be atomic - seems it needs to be
- */
- netif_wake_queue(dev);
+ early_stop_netif_wake_queue(dev);
}

dev->trans_start = jiffies;
@@ -2424,6 +2455,7 @@

static int ace_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
+#ifdef SIOCETHTOOL
struct ace_private *ap = dev->priv;
struct ace_regs *regs = ap->regs;
struct ethtool_cmd ecmd;
@@ -2483,7 +2515,11 @@
ecmd.autoneg = AUTONEG_DISABLE;

#if 0
+ /*
+ * Current struct ethtool_cmd is insufficient
+ */
ecmd.trace = readl(&regs->TuneTrace);
+
ecmd.txcoal = readl(&regs->TuneTxCoalTicks);
ecmd.rxcoal = readl(&regs->TuneRxCoalTicks);
#endif
@@ -2551,6 +2587,7 @@
}
return 0;
}
+#endif

return -EOPNOTSUPP;
}
@@ -2563,7 +2600,7 @@
{
struct sockaddr *addr=p;
struct ace_regs *regs;
- u16 *da;
+ u8 *da;
struct cmd cmd;

if(netif_running(dev))
@@ -2571,11 +2608,11 @@

memcpy(dev->dev_addr, addr->sa_data,dev->addr_len);

- da = (u16 *)dev->dev_addr;
+ da = (u8 *)dev->dev_addr;

regs = ((struct ace_private *)dev->priv)->regs;
- writel(da[0], &regs->MacAddrHi);
- writel((da[1] << 16) | da[2], &regs->MacAddrLo);
+ writel(da[0] << 8 | da[1], &regs->MacAddrHi);
+ writel((da[2] << 24) | (da[3] << 16) | (da[4] << 8) | da[5] , &regs->MacAddrLo);

cmd.evt = C_SET_MAC_ADDR;
cmd.code = 0;
@@ -3000,6 +3037,6 @@

/*
* Local variables:
- * compile-command: "gcc -D__KERNEL__ -DMODULE -I../../include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -pipe -fno-strength-reduce -DMODVERSIONS -include ../../include/linux/modversions.h -c -o acenic.o acenic.c"
+ * compile-command: "gcc -D__SMP__ -D__KERNEL__ -DMODULE -I../../include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -pipe -fno-strength-reduce -DMODVERSIONS -include ../../include/linux/modversions.h -c -o acenic.o acenic.c"
* End:
*/
--- linux-2.4.0-test11-pre4/drivers/net/acenic_firmware.h Mon Sep 18 18:16:48 2000
+++ drivers/net/acenic_firmware.h Mon Nov 13 17:22:40 2000
@@ -17,10 +17,11 @@
#define tigonFwSbssLen 0x38
#define tigonFwBssAddr 0x00015dd0
#define tigonFwBssLen 0x2080
-u32 tigonFwText[];
-u32 tigonFwData[];
-u32 tigonFwRodata[];
#ifndef CONFIG_ACENIC_OMIT_TIGON_I
+#define tigonFwText 0
+#define tigonFwData 0
+#define tigonFwRodata 0
+#else
/* Generated by genfw.c */
u32 tigonFwText[(MAX_TEXT_LEN/4) + 1] __initdata = {
0x10000003,

2000-11-14 23:21:45

by Jeff Garzik

[permalink] [raw]
Subject: Re: [PATCH] Re: test11-pre5

Dan Aloni wrote:
>
> against: test11-pre5
> summery: dev_3c501.name shouldn't be NULL, or we get oops
> reason: Correct me if I'm wrong, but 3c501.c:init_module() calls
> net_init.c:register_netdev(&dev_3c501), which calls strchr(),
> {and might also,which might} dereference dev_3c501.name.

There is no dereferencing involved, and therefore no problem.

> struct net_device
> {
>
> /*
> * This is the first field of the "visible" part of this structure
> * (i.e. as seen by users in the "Space.c" file). It is the name
> * the interface.
> */
> char name[IFNAMSIZ];

--
Jeff Garzik |
Building 1024 | The chief enemy of creativity is "good" sense
MandrakeSoft | -- Picasso

Subject: [uPATCH] Re: test11-pre5

On Tue, 14 Nov 2000, Linus Torvalds wrote:
> - pre5:
> - Rasmus Andersen: add proper "<linux/init.h>" for sound drivers

Rasmus spotted gus_midi.c not 100% correctly... (anyway thanks Rasmus)

--- linux-240t10p5/drivers/sound/gus_midi.c Wed Nov 15 00:06:14 2000
+++ linux/drivers/sound/gus_midi.c Wed Nov 15 00:06:24 2000
@@ -15,7 +15,7 @@
* Added __init to gus_midi_init()
*/

-#include "linux/init.h"
+#include <linux/init.h>
#include "sound_config.h"

#include "gus.h"

2000-11-14 23:42:45

by Dan Aloni

[permalink] [raw]
Subject: Re: [PATCH] Re: test11-pre5

On Tue, 14 Nov 2000, Jeff Garzik wrote:

> Dan Aloni wrote:
> >
> > reason: Correct me if I'm wrong, but 3c501.c:init_module() calls
> > net_init.c:register_netdev(&dev_3c501), which calls strchr(),
> > {and might also,which might} dereference dev_3c501.name.
>
> There is no dereferencing involved, and therefore no problem.

Well, at least I was alertive. Almost a bug fix ;-)
Is there a special reason why dev->name is not a pointer?

--
Dan Aloni
[email protected]

2000-11-14 23:45:45

by Jeff Garzik

[permalink] [raw]
Subject: Re: [PATCH] Re: test11-pre5

Dan Aloni wrote:
>
> On Tue, 14 Nov 2000, Jeff Garzik wrote:
>
> > Dan Aloni wrote:
> > >
> > > reason: Correct me if I'm wrong, but 3c501.c:init_module() calls
> > > net_init.c:register_netdev(&dev_3c501), which calls strchr(),
> > > {and might also,which might} dereference dev_3c501.name.
> >
> > There is no dereferencing involved, and therefore no problem.
>
> Well, at least I was alertive. Almost a bug fix ;-)
> Is there a special reason why dev->name is not a pointer?

IIRC, it made things easier when Alan (or others?) updated the ether=xxx
command line support..

--
Jeff Garzik |
Building 1024 | The chief enemy of creativity is "good" sense
MandrakeSoft | -- Picasso

2000-11-15 00:17:58

by Linus Torvalds

[permalink] [raw]
Subject: Re: [PATCH] Re: test11-pre5



On Wed, 15 Nov 2000, Dan Aloni wrote:
>
> summery: dev_3c501.name shouldn't be NULL, or we get oops

Note that these days "name" is not a pointer at all, but an array, and as
such cannot be NULL any more. Not initializing it will just cause it to be
empty (ie is the same as initializing it to "").

Linus

2000-11-15 00:23:00

by Linus Torvalds

[permalink] [raw]
Subject: Re: [PATCH] Re: test11-pre5

In article <[email protected]>,
Dan Aloni <[email protected]> wrote:
>On Tue, 14 Nov 2000, Jeff Garzik wrote:
>
>> Dan Aloni wrote:
>> >
>> > reason: Correct me if I'm wrong, but 3c501.c:init_module() calls
>> > net_init.c:register_netdev(&dev_3c501), which calls strchr(),
>> > {and might also,which might} dereference dev_3c501.name.
>>
>> There is no dereferencing involved, and therefore no problem.
>
>Well, at least I was alertive. Almost a bug fix ;-)
>Is there a special reason why dev->name is not a pointer?

It used to be.

And we used to have an incredible number of bugs with initialization and
with creating these things dynamically. A lot of Space.c was due to
horrible hackery with getting the static allocation right for these
things. Turning it into a plain array got rid of all the hackery, and
saved memory anyway.

Linus

2000-11-15 00:57:17

by Dan Aloni

[permalink] [raw]
Subject: Re: [PATCH] Re: test11-pre5

On Tue, 14 Nov 2000, Linus Torvalds wrote:

> On Wed, 15 Nov 2000, Dan Aloni wrote:
> >
> > summery: dev_3c501.name shouldn't be NULL, or we get oops
>
> Note that these days "name" is not a pointer at all, but an array, and as
> such cannot be NULL any more. Not initializing it will just cause it to be
> empty (ie is the same as initializing it to "").

Agreed. BTW, after grepping for IFNAMSIZ references I've noticed some
architectures (sparc64, mips64) define IFNAMSIZ for themsleves, for
example, arch/sparc64/kernel/ioctl32.c, which defines it to 16, the
same include/linux/if.h does. But if they are not the same?

--
Dan Aloni
[email protected]

2000-11-15 01:11:14

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] Re: test11-pre5

Date: Wed, 15 Nov 2000 02:25:38 +0200 (IST)
From: Dan Aloni <[email protected]>

Agreed. BTW, after grepping for IFNAMSIZ references I've noticed
some architectures (sparc64, mips64) define IFNAMSIZ for
themsleves, for example, arch/sparc64/kernel/ioctl32.c, which
defines it to 16, the same include/linux/if.h does. But if they are
not the same?

Then the compiler will start warning us :-)

#define FOO 6
#define FOO 6
int main(void)
{
return FOO;
}
? gcc -Wall -o test test.c
?
#define FOO 6
#define FOO 7
int main(void)
{
return FOO;
}
? gcc -Wall -o test test.c
test.c:2: warning: `FOO' redefined
test.c:1: warning: this is the location of the previous definition
?

Later,
David S. Miller
[email protected]

2000-11-15 01:31:30

by Dan Aloni

[permalink] [raw]
Subject: Re: [PATCH] Re: test11-pre5

On Tue, 14 Nov 2000, David S. Miller wrote:

> Date: Wed, 15 Nov 2000 02:25:38 +0200 (IST)
> From: Dan Aloni <[email protected]>
>
> Agreed. BTW, after grepping for IFNAMSIZ references I've noticed
> some architectures (sparc64, mips64) define IFNAMSIZ for
> themsleves, for example, arch/sparc64/kernel/ioctl32.c, which
> defines it to 16, the same include/linux/if.h does. But if they are
> not the same?
>
> Then the compiler will start warning us :-)

I've also noticed that routing_ioctl() in arch/mips64/kernel/ioctl32.c
assumes the 16. Are those two platforms depend on having IFNAMSIZ == 16,
or this code just needs cleaning up?

--
Dan Aloni
[email protected]

2000-11-15 01:34:30

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] Re: test11-pre5

Date: Wed, 15 Nov 2000 02:59:36 +0200 (IST)
From: Dan Aloni <[email protected]>

On Tue, 14 Nov 2000, David S. Miller wrote:

> Then the compiler will start warning us :-)

I've also noticed that routing_ioctl() in arch/mips64/kernel/ioctl32.c
assumes the 16. Are those two platforms depend on having IFNAMSIZ == 16,
or this code just needs cleaning up?

No, it means the code "may need changing" if IFNAMSIZ is ever
changed. The compiler will warn us when this happens instead
of silently compiling the code.

Later,
David S. Miller
[email protected]

2000-11-16 09:24:02

by Nick Holloway

[permalink] [raw]
Subject: Re: [PATCH] Re: test11-pre5

[email protected] (Dan Aloni) writes:
> Is there a special reason why dev->name is not a pointer?

One of the changes in 2.3 was to change dev->name from a pointer to the
char array. A little bit painful (in terms of the number of changes,
rather than the complexity).

The reason for this is that dev->name needs to be writeable, each instance
of dev->name must not be shared, and there needs to be at least IFNAMSIZ
bytes allocated.

The problem that first triggered the change was that gcc was sharing
all instances of "eth%d", so there was a problem with multiple adaptors
referenced from the same source file.

It just happens that the kernel does not implement read-only strings
(as userspace does), but it could do in the future. This would cause
problem if dev->name is a pointer.

Finally, looking through the many net drivers, many failed to reserve
IFNAMSIZ (currently 16) bytes. Some allocated 8, some 9, some 17.

--
`O O' | [email protected]
// ^ \\ | http://www.pyrites.org.uk/