diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2008-07-08 18:13:05 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-07-11 01:20:33 -0400 |
commit | d8156534040996f6a93a24d3592d5d587f2587e5 (patch) | |
tree | 3b9528f1551560502af9d8686b4615551fe38795 /include/linux/netdevice.h | |
parent | d3352520273426e4c16e91d189aa8aa7ee5e96c5 (diff) |
net: add netif_napi_del function to allow for removal of napistructs
Adds netif_napi_del function which is used to remove the napi struct from
the netdev napi_list in cases where CONFIG_NETPOLL was enabled.
The motivation for adding this is to handle the case in which the number of
queues on a device changes due to a configuration change. Previously the
napi structs for each queue would be left in the list until the netdev was
freed.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 203c5504fe43..b54ec16dfbda 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -828,6 +828,19 @@ static inline void netif_napi_add(struct net_device *dev, | |||
828 | set_bit(NAPI_STATE_SCHED, &napi->state); | 828 | set_bit(NAPI_STATE_SCHED, &napi->state); |
829 | } | 829 | } |
830 | 830 | ||
831 | /** | ||
832 | * netif_napi_del - remove a napi context | ||
833 | * @napi: napi context | ||
834 | * | ||
835 | * netif_napi_del() removes a napi context from the network device napi list | ||
836 | */ | ||
837 | static inline void netif_napi_del(struct napi_struct *napi) | ||
838 | { | ||
839 | #ifdef CONFIG_NETPOLL | ||
840 | list_del(&napi->dev_list); | ||
841 | #endif | ||
842 | } | ||
843 | |||
831 | struct packet_type { | 844 | struct packet_type { |
832 | __be16 type; /* This is really htons(ether_type). */ | 845 | __be16 type; /* This is really htons(ether_type). */ |
833 | struct net_device *dev; /* NULL is wildcarded here */ | 846 | struct net_device *dev; /* NULL is wildcarded here */ |