netdev
[Top] [All Lists]

Re: [RFT][PATCH] cleanup net/atm/br2684.c

To: Stephen Hemminger <shemminger@xxxxxxxx>
Subject: Re: [RFT][PATCH] cleanup net/atm/br2684.c
From: chas williams <chas@xxxxxxxxxxxxxxxx>
Date: Tue, 12 Aug 2003 12:44:32 -0400
Cc: "David S. Miller" <davem@xxxxxxxxxx>, netdev@xxxxxxxxxxx
In-reply-to: Your message of "Mon, 11 Aug 2003 11:48:23 PDT." <20030811114823.5b81474c.shemminger@xxxxxxxx>
Reply-to: chas3@xxxxxxxxxxxxxxxxxxxxx
Sender: netdev-bounce@xxxxxxxxxxx
>       - Get rid of all the MOD_INC stuff. MOD_INC is not a spinlock or semaph
>ore
>         and don't use it like that!  Have driver clean itself up properly on
>         unload.

i actually have a patch for that already.  pppoatm has the same problem.
since both are now holding semaphores during ioctl most of the MOD_* stuff
can go away.  however, one pair needs to kept around in br2684 to keep the
module from being removed while the user space process is keeping the
vcc's in place.  this will go away when everything is converted to netlink.

>+      netdev = alloc_netdev(sizeof(struct br2684_dev),
>+                            ni.ifname[0] ? ni.ifname : "nas%d",
>+                            br2684_setup);
>+      if (!netdev)
>+              return -ENOMEM;
>...
>+
>+      write_lock_irq(&devs_lock);
>+      brdev->number = list_empty(&br2684_devs) ? 1 :
>+          list_entry_brdev(br2684_devs.prev)->number + 1;
>+      list_add_tail(&brdev->br2684_devs, &br2684_devs);
>+      write_unlock_irq(&devs_lock);
>       return 0;

this is a little different than the old code.  if the user didnt
provide an ifname, then brdev->number is used to determine the
name of the interface instead of letting the network stack choose
the next available interface name.  not sure if this really matters
to anyone.

<Prev in Thread] Current Thread [Next in Thread>