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

Re: [Xen-devel] Allow controlling NAPI weight of virtual network interfaces (vif) with sysfs



Please don't top-post.

On Fri, Mar 13, 2015 at 12:56:53PM +0100, Ronald Pina wrote:
> Actually not, it was removed since the weight parameter was moved from
> the net_device structure to napi_struct.
> An older implementation of sysfs on kernel 2.6.21 was done this way:
> 
> 
> NETDEVICE_SHOW(weight, fmt_dec);
> 
> static int change_weight(struct net_device *net, unsigned long new_weight)
> {
>     net->weight = new_weight;
>     return 0;
> }
> 
> static ssize_t store_weight(struct device *dev, struct device_attribute *attr,
>                 const char *buf, size_t len)
> {
>     return netdev_store(dev, attr, buf, len, change_weight);
> }
> 
> static struct device_attribute net_class_attributes[] = {
> 
> .......... ..........   ....
> 
> __ATTR(weight, S_IRUGO | S_IWUSR, show_weight, store_weight)
> 
> But, now i that the weight is not anymore on net_device struct, I'm

This doesn't really matter. This kind of core driver change can be
easily adapted in individual driver.

> having problems referencing  napi_struct.

Where do you want to reference napi_struct?

> I want to use this kind of mechanism on kernel our updated kernels.

What kernel version are you using?

> The idea of bringing support back to control napi weight with sysfs is
> very attractive.
> 

What about other network drivers in the kernel you're using? What do
they do? I think you can just use one existing driver for reference.

> Do you have any idea what must be changed to achieve this supplementary 
> control?
> 

If the issue you're seeing is a core driver issue, then you need to ask
core network driver what to do. If it's a netback specific problem, I
would say you just need to look at other drivers which expose
napi_weight via sysfs and hook up netback using the same method.

Wei.

> 
> 
> On Fri, Mar 13, 2015 at 12:30 PM, Wei Liu <wei.liu2@xxxxxxxxxx> wrote:
> > On Fri, Mar 13, 2015 at 12:11:51PM +0100, Ronald Pina wrote:
> >> Hello
> >> I am working to allow controlling napi weight of virtual interfaces on
> >> xen using sysfs.
> >> If may i ask, is it achievable since NAPI interface structure in
> >> current kernels is managed by the driver?
> >>
> >
> > I would say yes. Netback is just another kernel driver that uses NAPI as
> > far as kernel concerns.
> >
> > Actually I am wondering what you need to do to enable that. Shouldn't
> > the sysfs knob just show up?
> >
> > Wei.
> >
> >> Please, any help or idea is very appreciated.
> >> Best Regards
> >>
> >> _______________________________________________
> >> Xen-devel mailing list
> >> Xen-devel@xxxxxxxxxxxxx
> >> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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