Re: [RFC PATCH V4 02/13] netback: add module unload function.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

On Thu, 2012-02-02 at 17:08 +0000, Eric Dumazet wrote:
> Le jeudi 02 février 2012 à 16:49 +0000, Wei Liu a écrit :
> > Enables users to unload netback module.
> > 
> > Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
> > Tested-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
> > Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
> > ---
> >  drivers/net/xen-netback/common.h  |    1 +
> >  drivers/net/xen-netback/netback.c |   14 ++++++++++++++
> >  drivers/net/xen-netback/xenbus.c  |    5 +++++
> >  3 files changed, 20 insertions(+), 0 deletions(-)
> > 
> > diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
> > index 288b2f3..372c7f5 100644
> > --- a/drivers/net/xen-netback/common.h
> > +++ b/drivers/net/xen-netback/common.h
> > @@ -126,6 +126,7 @@ void xenvif_get(struct xenvif *vif);
> >  void xenvif_put(struct xenvif *vif);
> >  
> >  int xenvif_xenbus_init(void);
> > +void xenvif_xenbus_exit(void);
> >  
> >  int xenvif_schedulable(struct xenvif *vif);
> >  
> > diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
> > index d11205f..3059684 100644
> > --- a/drivers/net/xen-netback/netback.c
> > +++ b/drivers/net/xen-netback/netback.c
> > @@ -1670,5 +1670,19 @@ failed_init:
> >  
> >  module_init(netback_init);
> >  
> 
> While reviewing this code, I can see current netback_init() is buggy.
> 
> It assumes all online cpus xen_netbk_group_nr are numbered from 0 to
> xen_netbk_group_nr-1
> 
> This is not right.
> 

You're right about this.

But this part is destined to get wiped out (in the very near future?) --
see following patches. So I don't think it is worthy to fix this.


Wei.

> Instead of using :
> 
> xen_netbk = vzalloc(sizeof(struct xen_netbk) * xen_netbk_group_nr);
> 
> You should use a percpu variable to get proper NUMA properties.
> 
> And instead of looping like :
> 
> for (group = 0; group < xen_netbk_group_nr; group++) {
> 
> You must use :
> 
> for_each_online_cpu(cpu) {
> 	...
> }
> 
> [ and also use kthread_create_on_node() instead of kthread_create() ]
> 
> 
> 


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux Kernel Discussion]     [Ethernet Bridging]     [Linux Wireless Networking]     [Linux Bluetooth Networking]     [Linux Networking Users]     [VLAN]     [Git]     [IETF Annouce]     [Linux Assembly]     [Security]     [Bugtraq]     [Photo]     [Singles Social Networking]     [Yosemite Information]     [MIPS Linux]     [ARM Linux Kernel]     [ARM Linux]     [Linux Virtualization]     [Linux Security]     [Linux IDE]     [Linux RAID]     [Linux SCSI]     [Free Dating]

Add to Google Powered by Linux