1. 23 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>
      fbeec2e1
    • 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>
      115c1d6e
    • 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>
      6ca4f65e
  2. 22 Jun, 2005 37 commits