[RFC] netpoll: Is it ok to share a single napi from several devs ?
From: Eric Dumazet <hidden>
Date: 2010-08-30 19:59:24
From: Eric Dumazet <hidden>
Date: 2010-08-30 19:59:24
So everybody jumped on GRO, while my concern was more the napi->dev
thing.
I pointed to gro because the commit was about gro, but gro was fine
IMHO.
Are we sure netpoll is ok ?
If a napi is shared by several net_device, should'nt we change
netpoll_poll_lock() ?
static inline void *netpoll_poll_lock(struct napi_struct *napi)
{
struct net_device *dev = napi->dev;
if (dev && dev->npinfo) {
spin_lock(&napi->poll_lock);
napi->poll_owner = smp_processor_id();
return napi;
}
return NULL;
}
---->
static inline void *netpoll_poll_lock(struct napi_struct *napi)
{
if (atomic_read(&napi->poll_count)) {
spin_lock(&napi->poll_lock);
napi->poll_owner = smp_processor_id();
return napi;
}
return NULL;
}