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

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



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() ]
> 
> 
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.