All of lore.kernel.org
 help / color / mirror / Atom feed
* vif rate dynamically change
@ 2010-08-27  8:45 ahmed amamou
  2010-08-27 14:21 ` ahmed amamou
  0 siblings, 1 reply; 3+ messages in thread
From: ahmed amamou @ 2010-08-27  8:45 UTC (permalink / raw)
  To: xen-devel


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


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.
   
 		 	   		  

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

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

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

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

* vif rate dynamically change
  2010-08-27  8:45 vif rate dynamically change ahmed amamou
@ 2010-08-27 14:21 ` ahmed amamou
  2010-08-30  8:19   ` vif rate dynamically change proposal ahmed amamou
  0 siblings, 1 reply; 3+ messages in thread
From: ahmed amamou @ 2010-08-27 14:21 UTC (permalink / raw)
  To: xen-devel


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







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.
 		 	   		  

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

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

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

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

* vif rate dynamically change proposal
  2010-08-27 14:21 ` ahmed amamou
@ 2010-08-30  8:19   ` ahmed amamou
  0 siblings, 0 replies; 3+ messages in thread
From: ahmed amamou @ 2010-08-30  8:19 UTC (permalink / raw)
  To: xen-devel


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












Good morning every one,

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 or a least to xen_netif one
so i can change in the netback.c file in function 

static bool tx_credit_exceeded(struct xen_netif *netif, unsigned size)
and 
static void tx_add_credit(struct xen_netif *netif)
to impose readinh the value of crdit bye ans credit_usec from proc 



so my questions are :
1- is it a good way to send new rate values from proc file ?
2-how to get pointer to correct xen_netif from vif name 

thanks in advance for an respoonse concerning any question.
 		 	   		  

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

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

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

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

end of thread, other threads:[~2010-08-30  8:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-27  8:45 vif rate dynamically change ahmed amamou
2010-08-27 14:21 ` ahmed amamou
2010-08-30  8:19   ` vif rate dynamically change proposal ahmed amamou

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.