Netdev List
 help / color / mirror / Atom feed
* [patch 0/3] netpoll: support multiple netpoll clients per net_device
@ 2005-06-23  1:26 Jeff Moyer
  2005-06-23  1:27 ` [patch 1/3] netpoll: set poll_owner to -1 before unlocking in netpoll_poll_unlock Jeff Moyer
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Jeff Moyer @ 2005-06-23  1:26 UTC (permalink / raw)
  To: mpm; +Cc: netdev, linux-kernel, akpm

Hi,

This patch series restores the ability to register multiple netpoll clients
against the same network interface.  To this end, I created a new structure:

struct netpoll_info {
	spinlock_t poll_lock;
	int poll_owner;
	int rx_flags;
	spinlock_t rx_lock;
	struct netpoll *rx_np; /* netpoll that registered an rx_hook */
};

This is the structure which gets pointed to by the net_device.  All of the
flags and locks which are specific to the INTERFACE go here.  Any variables
which must be kept per struct netpoll were left in the struct netpoll.  So
now, we have a cleaner separation of data and its scope.

Since we never really supported having more than one struct netpoll
register an rx_hook, I did not re-implement the rx_list.  Instead, there is
a single pointer in the netpoll_info structure (np_rx).  Note that if we
decide that we would like to register multiple rx_hooks per net_device,
this architecture does not preclude such extension.

We need to protect setting and clearing of the rx_np pointer, so I added a
lock (rx_lock) to the netpoll_info struct. [1]  There is one lock per
struct net_device, and I am certain that it will be low contention, as rx_np
will only be changed during an insmod or rmmod.

In the process of making these changes, I fixed a bug in netpoll_poll_unlock.
The function released the lock before setting the poll_owner to -1.


I have tested this by registering two netpoll clients, and verifying that
they both function properly.  The clients were netconsole, and a quick
module I hacked together to send console messages to syslog.  I issued
sysrq-h, sysrq-m, and sysrq-t's both by echo'ing to /proc/sysrq-trigger and
by hitting the key combination on the keyboard.  This verifies that the
modules work both inside and out of interrupt context.

Cheers,

Jeff

[1] Matt notes that we may be able to merge this lock with the poll_lock in
    the future.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-06-23  5:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-23  1:26 [patch 0/3] netpoll: support multiple netpoll clients per net_device Jeff Moyer
2005-06-23  1:27 ` [patch 1/3] netpoll: set poll_owner to -1 before unlocking in netpoll_poll_unlock Jeff Moyer
2005-06-23  1:30 ` [patch 2/3] netpoll: Introduce a netpoll_info struct Jeff Moyer
2005-06-23  1:30 ` [patch 3/3] netpoll: allow multiple netpoll_clients to register against one interface Jeff Moyer
2005-06-23  5:06 ` [patch 0/3] netpoll: support multiple netpoll clients per net_device David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox