1. 03 Jul, 2011 1 commit
  2. 18 Oct, 2010 1 commit
    • Neil Horman's avatar
      bonding: Fix bonding drivers improper modification of netpoll structure · c2355e1a
      Neil Horman authored
      The bonding driver currently modifies the netpoll structure in its xmit path
      while sending frames from netpoll.  This is racy, as other cpus can access the
      netpoll structure in parallel. Since the bonding driver points np->dev to a
      slave device, other cpus can inadvertently attempt to send data directly to
      slave devices, leading to improper locking with the bonding master, lost frames,
      and deadlocks.  This patch fixes that up.
      This patch also removes the real_dev pointer from the netpoll structure as that
      data is really only used by bonding in the poll_controller, and we can emulate
      its behavior by check each slave for IS_UP.
      Signed-off-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  3. 17 Sep, 2010 1 commit
  4. 10 Aug, 2010 1 commit
  5. 15 Jun, 2010 4 commits
  6. 06 May, 2010 2 commits
    • David S. Miller's avatar
    • WANG Cong's avatar
      netpoll: add generic support for bridge and bonding devices · 0e34e931
      WANG Cong authored
      This whole patchset is for adding netpoll support to bridge and bonding
      devices. I already tested it for bridge, bonding, bridge over bonding,
      and bonding over bridge. It looks fine now.
      To make bridge and bonding support netpoll, we need to adjust
      some netpoll generic code. This patch does the following things:
      1) introduce two new priv_flags for struct net_device:
         IFF_IN_NETPOLL which identifies we are processing a netpoll;
         IFF_DISABLE_NETPOLL is used to disable netpoll support for a device
         at run-time;
      2) introduce one new method for netdev_ops:
         ->ndo_netpoll_cleanup() is used to clean up netpoll when a device is
      3) introduce netpoll_poll_dev() which takes a struct net_device * parameter;
         export netpoll_send_skb() and netpoll_poll_dev() which will be used later;
      4) hide a pointer to struct netpoll in struct netpoll_info, ditto.
      5) introduce ->real_dev for struct netpoll.
      6) introduce a new status NETDEV_BONDING_DESLAE, which is used to disable
         netconsole before releasing a slave, to avoid deadlocks.
      Cc: David Miller <davem@davemloft.net>
      Cc: Neil Horman <nhorman@tuxdriver.com>
      Signed-off-by: default avatarWANG Cong <amwang@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  7. 13 Jan, 2010 1 commit
  8. 29 Mar, 2009 1 commit
  9. 16 Mar, 2009 1 commit
    • Herbert Xu's avatar
      GRO: Move netpoll checks to correct location · d1c76af9
      Herbert Xu authored
      As my netpoll fix for net doesn't really work for net-next, we
      need this update to move the checks into the right place.  As it
      stands we may pass freed skbs to netpoll_receive_skb.
      This patch also introduces a netpoll_rx_on function to avoid GRO
      completely if we're invoked through netpoll.  This might seem
      paranoid but as netpoll may have an external receive hook it's
      better to be safe than sorry.  I don't think we need this for
      2.6.29 though since there's nothing immediately broken by it.
      This patch also moves the GRO_* return values to netdevice.h since
      VLAN needs them too (I tried to avoid this originally but alas
      this seems to be the easiest way out).  This fixes a bug in VLAN
      where it continued to use the old return value 2 instead of the
      correct GRO_DROP.
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  10. 16 Dec, 2008 1 commit
    • Herbert Xu's avatar
      net: Add Generic Receive Offload infrastructure · d565b0a1
      Herbert Xu authored
      This patch adds the top-level GRO (Generic Receive Offload) infrastructure.
      This is pretty similar to LRO except that this is protocol-independent.
      Instead of holding packets in an lro_mgr structure, they're now held in
      For drivers that intend to use this, they can set the NETIF_F_GRO bit and
      call napi_gro_receive instead of netif_receive_skb or just call netif_rx.
      The latter will call napi_receive_skb automatically.  When napi_gro_receive
      is used, the driver must either call napi_complete/napi_rx_complete, or
      call napi_gro_flush in softirq context if the driver uses the primitives
      Protocols will set the gro_receive and gro_complete function pointers in
      order to participate in this scheme.
      In addition to the packet, gro_receive will get a list of currently held
      packets.  Each packet in the list has a same_flow field which is non-zero
      if it is a potential match for the new packet.  For each packet that may
      match, they also have a flush field which is non-zero if the held packet
      must not be merged with the new packet.
      Once gro_receive has determined that the new skb matches a held packet,
      the held packet may be processed immediately if the new skb cannot be
      merged with it.  In this case gro_receive should return the pointer to
      the existing skb in gro_list.  Otherwise the new skb should be merged into
      the existing packet and NULL should be returned, unless the new skb makes
      it impossible for any further merges to be made (e.g., FIN packet) where
      the merged skb should be returned.
      Whenever the skb is merged into an existing entry, the gro_receive
      function should set NAPI_GRO_CB(skb)->same_flow.  Note that if an skb
      merely matches an existing entry but can't be merged with it, then
      this shouldn't be set.
      If gro_receive finds it pointless to hold the new skb for future merging,
      it should set NAPI_GRO_CB(skb)->flush.
      Held packets will be flushed by napi_gro_flush which is called by
      napi_complete and napi_rx_complete.
      Currently held packets are stored in a singly liked list just like LRO.
      The list is limited to a maximum of 8 entries.  In future, this may be
      expanded to use a hash table to allow more flows to be held for merging.
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  11. 04 Mar, 2008 1 commit
  12. 28 Jan, 2008 2 commits
  13. 10 Oct, 2007 2 commits
    • Satyam Sharma's avatar
      [NET] netconsole: Support dynamic reconfiguration using configfs · 0bcc1816
      Satyam Sharma authored
      Based upon initial work by Keiichi Kii <k-keiichi@bx.jp.nec.com>.
      This patch introduces support for dynamic reconfiguration (adding, removing
      and/or modifying parameters of netconsole targets at runtime) using a
      userspace interface exported via configfs.  Documentation is also updated
      Issues and brief design overview:
      (1) Kernel-initiated creation / destruction of kernel objects is not
          possible with configfs -- the lifetimes of the "config items" is managed
          exclusively from userspace.  But netconsole must support boot/module
          params too, and these are parsed in kernel and hence netpolls must be
          setup from the kernel.  Joel Becker suggested to separately manage the
          lifetimes of the two kinds of netconsole_target objects -- those created
          via configfs mkdir(2) from userspace and those specified from the
          boot/module option string.  This adds complexity and some redundancy here
          and also means that boot/module param-created targets are not exposed
          through the configfs namespace (and hence cannot be updated / destroyed
          dynamically).  However, this saves us from locking / refcounting
          complexities that would need to be introduced in configfs to support
          kernel-initiated item creation / destroy there.
      (2) In configfs, item creation takes place in the call chain of the
          mkdir(2) syscall in the driver subsystem.  If we used an ioctl(2) to
          create / destroy objects from userspace, the special userspace program is
          able to fill out the structure to be passed into the ioctl and hence
          specify attributes such as local interface that are required at the time
          we set up the netpoll.  For configfs, this information is not available at
          the time of mkdir(2).  So, we keep all newly-created targets (via
          configfs) disabled by default.  The user is expected to set various
          attributes appropriately (including the local network interface if
          required) and then write(2) "1" to the "enabled" attribute.  Thus,
          netpoll_setup() is then called on the set parameters in the context of
          _this_ write(2) on the "enabled" attribute itself.  This design enables
          the user to reconfigure existing netconsole targets at runtime to be
          attached to newly-come-up interfaces that may not have existed when
          netconsole was loaded or when the targets were actually created.  All this
          effectively enables us to get rid of custom ioctls.
      (3) Ultra-paranoid configfs attribute show() and store() operations, with
          sanity and input range checking, using only safe string primitives, and
          compliant with the recommendations in Documentation/filesystems/sysfs.txt.
      (4) A new function netpoll_print_options() is created in the netpoll API,
          that just prints out the configured parameters for a netpoll structure.
          netpoll_parse_options() is modified to use that and it is also exported to
          be used from netconsole.
      Signed-off-by: default avatarSatyam Sharma <satyam@infradead.org>
      Acked-by: default avatarKeiichi Kii <k-keiichi@bx.jp.nec.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    • Stephen Hemminger's avatar
      [NET]: Make NAPI polling independent of struct net_device objects. · bea3348e
      Stephen Hemminger authored
      Several devices have multiple independant RX queues per net
      device, and some have a single interrupt doorbell for several
      In either case, it's easier to support layouts like that if the
      structure representing the poll is independant from the net
      device itself.
      The signature of the ->poll() call back goes from:
      	int foo_poll(struct net_device *dev, int *budget)
      	int foo_poll(struct napi_struct *napi, int budget)
      The caller is returned the number of RX packets processed (or
      the number of "NAPI credits" consumed if you want to get
      abstract).  The callee no longer messes around bumping
      dev->quota, *budget, etc. because that is all handled in the
      caller upon return.
      The napi_struct is to be embedded in the device driver private data
      Furthermore, it is the driver's responsibility to disable all NAPI
      instances in it's ->stop() device close handler.  Since the
      napi_struct is privatized into the driver's private data structures,
      only the driver knows how to get at all of the napi_struct instances
      it may have per-device.
      With lots of help and suggestions from Rusty Russell, Roland Dreier,
      Michael Chan, Jeff Garzik, and Jamal Hadi Salim.
      Bug fixes from Thomas Graf, Roland Dreier, Peter Zijlstra,
      Joseph Fannin, Scott Wood, Hans J. Koch, and Michael Chan.
      [ Ported to current tree and all drivers converted.  Integrated
        Stephen's follow-on kerneldoc additions, and restored poll_list
        handling to the old style to fix mutual exclusion issues.  -DaveM ]
      Signed-off-by: default avatarStephen Hemminger <shemminger@linux-foundation.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  14. 05 Dec, 2006 1 commit
  15. 02 Dec, 2006 5 commits
    • Stephen Hemminger's avatar
      netpoll header cleanup · bf6bce71
      Stephen Hemminger authored
      As Steve left netpoll beast, hopefully not to return soon.
      He noticed that the header was messy. He straightened it
      up and polished it a little, then waved goodbye.
      Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
    • Stephen Hemminger's avatar
      netpoll queue cleanup · 5de4a473
      Stephen Hemminger authored
      The beast had a long and not very happy history. At one
      point, a friend (netdump) had asked that he open up a little.
      Well, the friend was long gone now, and the beast had
      this dangling piece hanging (netpoll_queue).
      It wasn't hard to stitch the netpoll_queue back in
      where it belonged and make everything tidy.
      Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
    • Stephen Hemminger's avatar
      netpoll retry cleanup · 2bdfe0ba
      Stephen Hemminger authored
      The netpoll beast was still not happy. If the beast got
      clogged pipes, it tended to stare blankly off in space
      for a long time.
      The problem couldn't be completely fixed because the
      beast talked with irq's disabled. But it could be made
      less painful and shorter.
      Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
    • Stephen Hemminger's avatar
      netpoll per device txq · b6cd27ed
      Stephen Hemminger authored
      When the netpoll beast got really busy, it tended to clog
      things, so it stored them for later. But the beast was putting
      all it's skb's in one basket. This was bad because maybe some
      pipes were clogged and others were not.
      Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
    • Stephen Hemminger's avatar
      netpoll info leak · 93ec2c72
      Stephen Hemminger authored
      After looking harder, Steve noticed that the netpoll
      beast leaked a little every time it shutdown for a nap.
      Not a big leak, but a nuisance kind of thing.
      He took out his refcount duct tape and patched the
      leak. It was overkill since there was already other
      locking in that area, but it looked clean and wouldn't
      attract fleas.
      Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
  16. 26 Jun, 2006 1 commit
  17. 12 Oct, 2005 1 commit
  18. 11 Aug, 2005 2 commits
  19. 22 Jun, 2005 3 commits
    • Jeff Moyer's avatar
      [NETPOLL]: allow multiple netpoll_clients to register against one interface · fbeec2e1
      Jeff Moyer authored
      This patch provides support for registering multiple netpoll clients to the
      same network device.  Only one of these clients may register an rx_hook,
      however.  In practice, this restriction has not been problematic.  It is
      worth mentioning, though, that the current design can be easily extended to
      allow for the registration of multiple rx_hooks.
      The basic idea of the patch is that the rx_np pointer in the netpoll_info
      structure points to the struct netpoll that has rx_hook filled in.  Aside
      from this one case, there is no need for a pointer from the struct
      net_device to an individual struct netpoll.
      A lock is introduced to protect the setting and clearing of the np_rx
      pointer.  The pointer will only be cleared upon netpoll client module
      removal, and the lock should be uncontested.
      Signed-off-by: default avatarJeff Moyer <jmoyer@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    • Jeff Moyer's avatar
      [NETPOLL]: Introduce a netpoll_info struct · 115c1d6e
      Jeff Moyer authored
      This patch introduces a netpoll_info structure, which the struct net_device
      will now point to instead of pointing to a struct netpoll.  The reason for
      this is two-fold: 1) fields such as the rx_flags, poll_owner, and poll_lock
      should be maintained per net_device, not per netpoll;  and 2) this is a first
      step in providing support for multiple netpoll clients to register against the
      same net_device.
      The struct netpoll is now pointed to by the netpoll_info structure.  As
      such, the previous behaviour of the code is preserved.
      Signed-off-by: default avatarJeff Moyer <jmoyer@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    • Jeff Moyer's avatar
      [NETPOLL]: Set poll_owner to -1 before unlocking in netpoll_poll_unlock() · 6ca4f65e
      Jeff Moyer authored
      This trivial patch moves the assignment of poll_owner to -1 inside of
      the lock.  This fixes a potential SMP race in the code.
      Signed-off-by: default avatarJeff Moyer <jmoyer@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  20. 16 Apr, 2005 1 commit
    • Linus Torvalds's avatar
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds authored
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      Let it rip!