WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] vif rate dynamically change

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] vif rate dynamically change
From: ahmed amamou <ahmed.amamou@xxxxxxxxxxx>
Date: Fri, 27 Aug 2010 10:45:28 +0200
Delivery-date: Tue, 31 Aug 2010 12:32:01 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
Importance: Normal
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Good morning every one,

I'm a new XEN developer I've seen that changing vif rate is not possible dynamically.

I decided to change the code so it would be possible the change it dynamically
the code change will affect this file "DOM0/drivers/xen/netback/xenbus.c"
for the moment the rate is fixed inside the connect function

static void connect(struct backend_info *be)

{
...
    if (err) {
        xenbus_dev_fatal(dev, err, "parsing %s/mac", dev->nodename);
        return;
    }

    xen_net_read_rate(dev, &be->netif->credit_bytes,
              &be->netif->credit_usec);
    be->netif->remaining_credit = be->netif->credit_bytes;
...

I want to add a function that read the rate dynamically from a /proc file
but to change rate i need to have a pointer to the backend_info struct
i found in xen XEN/tools/blktap/lib/xenbus.c a function that return backend_info struct pointer from backendpath
static struct backend_info *be_lookup_be(const char *bepath)
{
struct backend_info *be;

list_for_each_entry(be, &belist, list)
if (strcmp(bepath, be->backpath) == 0)
return be;
return (struct backend_info *)NULL;
}
but don't reallt know how to use it.

so my questions are :
1- is it a good way to send new rate values from proc file ?
2- is it possible to use the function be_lookup_be(implimented in xen tool code) in dom0 code to find backend_info from backendpath ?
3- if the ansower of 2 is yes witch format the backendpath is exemple form vif1.3, is the backedpath like this "backend/vif/0/3" ?


thanks in advance for an respoonse concerning any question.
  
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>