Re: [NET-NEXT PATCH 17/18] net: add netif_napi_del function to allow for removal of napistructs
From: Jeff Garzik <hidden>
Date: 2008-07-04 12:42:42
Also in:
lkml
Jeff Kirsher wrote:
quoted hunk ↗ jump to hunk
From: Alexander Duyck <redacted> 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 <redacted> Signed-off-by: Jeff Kirsher <redacted> --- 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 1304ad2..42fc98e 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h@@ -826,6 +826,19 @@ static inline void netif_napi_add(struct net_device *dev, set_bit(NAPI_STATE_SCHED, &napi->state); } +/** + * netif_napi_del - remove a napi context + * @napi: napi context + * + * netif_napi_del() removes a napi context from the network device napi list + */ +static inline void netif_napi_del(struct napi_struct *napi) +{ +#ifdef CONFIG_NETPOLL + list_del(&napi->dev_list); +#endif +} +
David - ACK? I would prefer to throw this in with the 18-patch igb pile, if that's OK with you. ------------------------------------------------------------------------- Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08