xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* dynamically set bandwidth limits of a virtual interface
@ 2012-12-27  8:46 Rohit Damkondwar
  2012-12-27 12:33 ` Wei Liu
  0 siblings, 1 reply; 8+ messages in thread
From: Rohit Damkondwar @ 2012-12-27  8:46 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 565 bytes --]

Hi all. I want to set bandwidth limits to a virtual interface
dynamically(without restarting virtual machine). I have been browsing xen
source code 4.1.3. I looked into libxen folder(xen_vif.c) and
hotplug(linux) folder. Earlier in xen 3.0 , xenvif struture
(driver/net/xen-netback/
interface.c + common.h) and tx_add_credit function could be used to modify
rate limits. I want to change bandwidth limits dynamically of a virtual
interface in xen 4.1.3. Where should I look for in xen 4.1.3?
Please help.




-- 
Rohit S Damkondwar
B.Tech Computer Engineering
CoEP

[-- Attachment #1.2: Type: text/html, Size: 673 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: dynamically set bandwidth limits of a virtual interface
  2012-12-27  8:46 dynamically set bandwidth limits of a virtual interface Rohit Damkondwar
@ 2012-12-27 12:33 ` Wei Liu
  2012-12-27 12:38   ` Pasi Kärkkäinen
  2012-12-28  7:46   ` Rohit Damkondwar
  0 siblings, 2 replies; 8+ messages in thread
From: Wei Liu @ 2012-12-27 12:33 UTC (permalink / raw)
  To: Rohit Damkondwar; +Cc: wei.liu2, xen-devel@lists.xen.org

On Thu, 2012-12-27 at 08:46 +0000, Rohit Damkondwar wrote:
> Hi all. I want to set bandwidth limits to a virtual interface
> dynamically(without restarting virtual machine). I have been browsing
> xen source code 4.1.3. I looked into libxen folder(xen_vif.c) and
> hotplug(linux) folder. Earlier in xen 3.0 , xenvif struture
> (driver/net/xen-netback/
> interface.c + common.h) and tx_add_credit function could be used to
> modify rate limits. I want to change bandwidth limits dynamically of a
> virtual interface in xen 4.1.3. Where should I look for in xen 4.1.3? 
> 
> Please help.
> 

Xen vif has a parameter called 'rate', I don't know whether it suits
you.

Also, you can have a look at external tool like tc(8). My vague thought
is that Vif is just another interface in Dom0, tc(8) should be able to
traffic-shape Vif.

Last but not least, patches are always welcomed. ;-)


Wei.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: dynamically set bandwidth limits of a virtual interface
  2012-12-27 12:33 ` Wei Liu
@ 2012-12-27 12:38   ` Pasi Kärkkäinen
  2012-12-31 14:14     ` Alex Bligh
  2012-12-28  7:46   ` Rohit Damkondwar
  1 sibling, 1 reply; 8+ messages in thread
From: Pasi Kärkkäinen @ 2012-12-27 12:38 UTC (permalink / raw)
  To: Wei Liu; +Cc: Rohit Damkondwar, xen-devel@lists.xen.org

On Thu, Dec 27, 2012 at 12:33:19PM +0000, Wei Liu wrote:
> On Thu, 2012-12-27 at 08:46 +0000, Rohit Damkondwar wrote:
> > Hi all. I want to set bandwidth limits to a virtual interface
> > dynamically(without restarting virtual machine). I have been browsing
> > xen source code 4.1.3. I looked into libxen folder(xen_vif.c) and
> > hotplug(linux) folder. Earlier in xen 3.0 , xenvif struture
> > (driver/net/xen-netback/
> > interface.c + common.h) and tx_add_credit function could be used to
> > modify rate limits. I want to change bandwidth limits dynamically of a
> > virtual interface in xen 4.1.3. Where should I look for in xen 4.1.3? 
> > 
> > Please help.
> > 
> 
> Xen vif has a parameter called 'rate', I don't know whether it suits
> you.
> 
> Also, you can have a look at external tool like tc(8). My vague thought
> is that Vif is just another interface in Dom0, tc(8) should be able to
> traffic-shape Vif.
> 

Yes, You can use the generic Linux QoS tools in dom0 to shape the vifs. 


> Last but not least, patches are always welcomed. ;-)
> 

-- Pasi

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: dynamically set bandwidth limits of a virtual interface
  2012-12-27 12:33 ` Wei Liu
  2012-12-27 12:38   ` Pasi Kärkkäinen
@ 2012-12-28  7:46   ` Rohit Damkondwar
  2012-12-28 10:35     ` Wei Liu
  1 sibling, 1 reply; 8+ messages in thread
From: Rohit Damkondwar @ 2012-12-28  7:46 UTC (permalink / raw)
  To: Wei Liu; +Cc: xen-devel@lists.xen.org


[-- Attachment #1.1: Type: text/plain, Size: 1806 bytes --]

On Thu, Dec 27, 2012 at 6:03 PM, Wei Liu <Wei.Liu2@citrix.com> wrote:

> On Thu, 2012-12-27 at 08:46 +0000, Rohit Damkondwar wrote:
> > Hi all. I want to set bandwidth limits to a virtual interface
> > dynamically(without restarting virtual machine). I have been browsing
> > xen source code 4.1.3. I looked into libxen folder(xen_vif.c) and
> > hotplug(linux) folder. Earlier in xen 3.0 , xenvif struture
> > (driver/net/xen-netback/
> > interface.c + common.h) and tx_add_credit function could be used to
> > modify rate limits. I want to change bandwidth limits dynamically of a
> > virtual interface in xen 4.1.3. Where should I look for in xen 4.1.3?
> >
> > Please help.
> >
>
> Xen vif has a parameter called 'rate', I don't know whether it suits
> you.
>
> The rate parameter only restricts one way traffic(probably only outgoing).


> Also, you can have a look at external tool like tc(8). My vague thought
> is that Vif is just another interface in Dom0, tc(8) should be able to
> traffic-shape Vif.
>

Don't you think using external tool may decrease the eifficiency ?. If xen
itself has capabailities ( provided by tc tool ), wouldn't it be more
efficient ?
I have used this tool. It is good. It serves my purpose. But wudn't it be
better to include the bandwidth limiting capabilities in xen itself? I am
not sure about this. Currently I am just browsing through the source code.
What do u think ?

I have seen  function "set_qos_algorithm_type" and paramaters
(qos/algorithm type,qos/algorithm params, qos/supported algorithms) in vif
class. Would they be useful ? Are they available only for XEN Enterprise ?



> Last but not least, patches are always welcomed. ;-)
>
>
> Wei.
>
>


-- 
Rohit S Damkondwar
B.Tech Computer Engineering
CoEP
MyBlog <http://www.rohitsdamkondwar.wordpress.com>

[-- Attachment #1.2: Type: text/html, Size: 2759 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: dynamically set bandwidth limits of a virtual interface
  2012-12-28  7:46   ` Rohit Damkondwar
@ 2012-12-28 10:35     ` Wei Liu
  2012-12-30 12:08       ` Rohit Damkondwar
  0 siblings, 1 reply; 8+ messages in thread
From: Wei Liu @ 2012-12-28 10:35 UTC (permalink / raw)
  To: Rohit Damkondwar; +Cc: wei.liu2, xen-devel@lists.xen.org

On Fri, 2012-12-28 at 07:46 +0000, Rohit Damkondwar wrote:
> On Thu, Dec 27, 2012 at 6:03 PM, Wei Liu <Wei.Liu2@citrix.com> wrote:
>         On Thu, 2012-12-27 at 08:46 +0000, Rohit Damkondwar wrote:
>         > Hi all. I want to set bandwidth limits to a virtual
>         interface
>         > dynamically(without restarting virtual machine). I have been
>         browsing
>         > xen source code 4.1.3. I looked into libxen
>         folder(xen_vif.c) and
>         > hotplug(linux) folder. Earlier in xen 3.0 , xenvif struture
>         > (driver/net/xen-netback/
>         > interface.c + common.h) and tx_add_credit function could be
>         used to
>         > modify rate limits. I want to change bandwidth limits
>         dynamically of a
>         > virtual interface in xen 4.1.3. Where should I look for in
>         xen 4.1.3?
>         >
>         > Please help.
>         >
>         
>         
>         Xen vif has a parameter called 'rate', I don't know whether it
>         suits
>         you.
>         
> The rate parameter only restricts one way traffic(probably only
> outgoing). 
>  

Yes, you're right. So you need two way shaping.

> 
>         Also, you can have a look at external tool like tc(8). My
>         vague thought
>         is that Vif is just another interface in Dom0, tc(8) should be
>         able to
>         traffic-shape Vif. 
> 
> 
> Don't you think using external tool may decrease the eifficiency ?. If
> xen itself has capabailities ( provided by tc tool ), wouldn't it be
> more efficient ? 
> 

Do you see significant performance degradation when using tc(8) or any
other tools alike? If so, do report with figures, it can help us
improve.

> I have used this tool. It is good. It serves my purpose. But wudn't it
> be better to include the bandwidth limiting capabilities in xen
> itself? I am not sure about this. Currently I am just browsing through
> the source code. What do u think ?
> 

TBH I'm not sure about this either. Again, comparisons and analysis of
bottleneck would be helpful.

> 
> I have seen  function "set_qos_algorithm_type" and paramaters
> (qos/algorithm type,qos/algorithm params, qos/supported algorithms) in
> vif class. Would they be useful ? Are they available only for XEN
> Enterprise ?
> 

Do you see those in libxen source code? I don't think they are in use
now.


Wei.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: dynamically set bandwidth limits of a virtual interface
  2012-12-28 10:35     ` Wei Liu
@ 2012-12-30 12:08       ` Rohit Damkondwar
  2012-12-31 11:30         ` Wei Liu
  0 siblings, 1 reply; 8+ messages in thread
From: Rohit Damkondwar @ 2012-12-30 12:08 UTC (permalink / raw)
  To: Wei Liu; +Cc: xen-devel@lists.xen.org


[-- Attachment #1.1: Type: text/plain, Size: 2995 bytes --]

On Fri, Dec 28, 2012 at 4:05 PM, Wei Liu <Wei.Liu2@citrix.com> wrote:

> On Fri, 2012-12-28 at 07:46 +0000, Rohit Damkondwar wrote:
> > On Thu, Dec 27, 2012 at 6:03 PM, Wei Liu <Wei.Liu2@citrix.com> wrote:
> >         On Thu, 2012-12-27 at 08:46 +0000, Rohit Damkondwar wrote:
> >         > Hi all. I want to set bandwidth limits to a virtual
> >         interface
> >         > dynamically(without restarting virtual machine). I have been
> >         browsing
> >         > xen source code 4.1.3. I looked into libxen
> >         folder(xen_vif.c) and
> >         > hotplug(linux) folder. Earlier in xen 3.0 , xenvif struture
> >         > (driver/net/xen-netback/
> >         > interface.c + common.h) and tx_add_credit function could be
> >         used to
> >         > modify rate limits. I want to change bandwidth limits
> >         dynamically of a
> >         > virtual interface in xen 4.1.3. Where should I look for in
> >         xen 4.1.3?
> >         >
> >         > Please help.
> >         >
> >
> >
> >         Xen vif has a parameter called 'rate', I don't know whether it
> >         suits
> >         you.
> >
> > The rate parameter only restricts one way traffic(probably only
> > outgoing).
> >
>
> Yes, you're right. So you need two way shaping.
>
> >
> >         Also, you can have a look at external tool like tc(8). My
> >         vague thought
> >         is that Vif is just another interface in Dom0, tc(8) should be
> >         able to
> >         traffic-shape Vif.
> >
> >
> > Don't you think using external tool may decrease the eifficiency ?. If
> > xen itself has capabailities ( provided by tc tool ), wouldn't it be
> > more efficient ?
> >
>
> Do you see significant performance degradation when using tc(8) or any
> other tools alike? If so, do report with figures, it can help us
> improve.
>

It doesn't seem like tc gives bad performance. But I cannot say until
statistics prove that tc is better.

>
> > I have used this tool. It is good. It serves my purpose. But wudn't it
> > be better to include the bandwidth limiting capabilities in xen
> > itself? I am not sure about this. Currently I am just browsing through
> > the source code. What do u think ?
> >
>
> TBH I'm not sure about this either. Again, comparisons and analysis of
> bottleneck would be helpful.
>
> >
> > I have seen  function "set_qos_algorithm_type" and paramaters
> > (qos/algorithm type,qos/algorithm params, qos/supported algorithms) in
> > vif class. Would they be useful ? Are they available only for XEN
> > Enterprise ?
> >
>
> Do you see those in libxen source code? I don't think they are in use
> now.
>
I didn't know that. The when which library should I look into? I could find
vif class in libxen folder. So I thought it should be used. I read that xl
is not matured enough in xen 4.1.3. So which library should I look into?
Please help.

>
>
> Wei.
>
>
>


-- 
Rohit S Damkondwar
B.Tech Computer Engineering
CoEP
MyBlog <http://www.rohitsdamkondwar.wordpress.com>

[-- Attachment #1.2: Type: text/html, Size: 4279 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: dynamically set bandwidth limits of a virtual interface
  2012-12-30 12:08       ` Rohit Damkondwar
@ 2012-12-31 11:30         ` Wei Liu
  0 siblings, 0 replies; 8+ messages in thread
From: Wei Liu @ 2012-12-31 11:30 UTC (permalink / raw)
  To: Rohit Damkondwar; +Cc: wei.liu2, xen-devel@lists.xen.org

On Sun, 2012-12-30 at 12:08 +0000, Rohit Damkondwar wrote:


>         TBH I'm not sure about this either. Again, comparisons and
>         analysis of
>         bottleneck would be helpful.
>         
>         >
>         > I have seen  function "set_qos_algorithm_type" and
>         paramaters
>         > (qos/algorithm type,qos/algorithm params, qos/supported
>         algorithms) in
>         > vif class. Would they be useful ? Are they available only
>         for XEN
>         > Enterprise ?
>         >
>         
>         
>         Do you see those in libxen source code? I don't think they are
>         in use
>         now.
> I didn't know that. The when which library should I look into? I could
> find vif class in libxen folder. So I thought it should be used. I
> read that xl is not matured enough in xen 4.1.3. So which library
> should I look into? Please help. 

There is considerable amount of work to be done.

Tool stack is relatively easy. You can try adding config options to
whatever tool stack you're using. You need to parse the config option
(which is easy, because every tool stack has parser), then write the
option to xenstore so that guest can pick it up.

To modify the kernel is a bit harder. Download kernel package, look for
netback.c and friends, whose location varies depending the kernel you're
using. Grep for 'rate' so that you can have a look at how tx rate limit
is implemented.

The last bit is to upsteam your changes. Please post your changes to
Xen-devel to see if it is suitable for upstreaming. Of course this is
not mandatory. By upstreaming your changes you can 1) relieve your
maintenance burden, 2) benefit others.


Wei.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: dynamically set bandwidth limits of a virtual interface
  2012-12-27 12:38   ` Pasi Kärkkäinen
@ 2012-12-31 14:14     ` Alex Bligh
  0 siblings, 0 replies; 8+ messages in thread
From: Alex Bligh @ 2012-12-31 14:14 UTC (permalink / raw)
  To: Pasi Kärkkäinen, Wei Liu
  Cc: Rohit Damkondwar, Alex Bligh, xen-devel



--On 27 December 2012 14:38:39 +0200 Pasi Kärkkäinen <pasik@iki.fi> wrote:

> Yes, You can use the generic Linux QoS tools in dom0 to shape the vifs.

Using tc for true shaping is slightly non-trivial as it shapes only on
egress (which confusingly is towards the VM), and will only police on
ingress. Using ifb is a way around this.

If tc alone won't do the job, I would have thought that rather than
reinvent the wheel and implement rate shaping in netback, it would be
better to hook into the kernel's existing qdisc infrastructure so tc like
tools can be used. This would give much more functionality than a simple
rate.

-- 
Alex Bligh

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-12-31 14:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-27  8:46 dynamically set bandwidth limits of a virtual interface Rohit Damkondwar
2012-12-27 12:33 ` Wei Liu
2012-12-27 12:38   ` Pasi Kärkkäinen
2012-12-31 14:14     ` Alex Bligh
2012-12-28  7:46   ` Rohit Damkondwar
2012-12-28 10:35     ` Wei Liu
2012-12-30 12:08       ` Rohit Damkondwar
2012-12-31 11:30         ` Wei Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).