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

Re: [Xen-devel] [PATCH 3 of 4] xl: add support for vif rate limiting



On Tue, 2012-03-20 at 18:40 +0000, Mathieu Gagnà wrote:
> On 3/20/12 7:26 AM, Ian Campbell wrote:
> > On Tue, 2012-03-20 at 11:16 +0000, Stefano Stabellini wrote:
> >>
> >> wouldn't it make sense to just use a uint64_t for
> >> rate_bytes_per_interval and rate_interval_usecs?
> >
> > It needn't be a barrier to this but FWIW Linux parses these into
> > "unsigned long", but it does at least appear to do proper overflow
> > checking.
> 
> Xend/xm defaults to unlimited when bytes_per_interval or interval_usecs 
> overflows a 32bit unsigned long.
> 
> Internally, xen-netback will parse those values into "unsigned long" 
> which would otherwise overflow/wrap if we used uint64_t:
> 
> http://lxr.linux.no/#linux+v3.3/drivers/net/xen-netback/common.h#L86
> 

Right, the overflow handling of simply_strtoul turns out to leave
something to be desired (it basically returns simple_strtoull without
overflow checking). I guess it does say simple ;-)

I think we should use 64 bit values in xl/libxl and document that the
actual underlying limits are dependent on the underlying netback
implementation. This will allow us to improve the kernel should we even
need to without leaving us with a compatibility issue. Realistically no
one is going to be asking for 40GB/s at the moment (at least not while
expecting it to do anything meaningful...)

Ian.


_______________________________________________
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®.