All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools/xl: correctly shows split eventchannel for netfront
@ 2014-01-14 18:33 Annie Li
  2014-01-15 13:13 ` Ian Campbell
  2014-01-15 15:31 ` David Vrabel
  0 siblings, 2 replies; 5+ messages in thread
From: Annie Li @ 2014-01-14 18:33 UTC (permalink / raw)
  To: xen-devel; +Cc: ian.jackson, annie.li, wei.liu2, ian.campbell

From: Annie Li <annie.li@oracle.com>

After split eventchannel feature was supported by netback/netfront,
"xl network-list" does not show eventchannel correctly. Add tx-/rx-evt-ch
to show tx/rx eventchannel correctly.

Signed-off-by: Annie Li <annie.li@oracle.com>
---
 tools/libxl/libxl.c         |   11 ++++++++++-
 tools/libxl/libxl_types.idl |    3 ++-
 tools/libxl/xl_cmdimpl.c    |   12 ++++++------
 3 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 2845ca4..4222687 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -3125,6 +3125,7 @@ int libxl_device_nic_getinfo(libxl_ctx *ctx, uint32_t domid,
     GC_INIT(ctx);
     char *dompath, *nicpath;
     char *val;
+    int  evtch;
 
     dompath = libxl__xs_get_dompath(gc, domid);
     nicinfo->devid = nic->devid;
@@ -3141,7 +3142,15 @@ int libxl_device_nic_getinfo(libxl_ctx *ctx, uint32_t domid,
     val = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/state", nicpath));
     nicinfo->state = val ? strtoul(val, NULL, 10) : -1;
     val = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/event-channel", nicpath));
-    nicinfo->evtch = val ? strtoul(val, NULL, 10) : -1;
+    evtch = val ? strtoul(val, NULL, 10) : -1;
+    if(evtch > 0)
+        nicinfo->evtch_tx = nicinfo->evtch_rx = evtch;
+    else {
+        val = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/event-channel-tx", nicpath));
+        nicinfo->evtch_tx = val ? strtoul(val, NULL, 10) : -1;
+        val = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/event-channel-rx", nicpath));
+        nicinfo->evtch_rx = val ? strtoul(val, NULL, 10) : -1;
+    }
     val = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/tx-ring-ref", nicpath));
     nicinfo->rref_tx = val ? strtoul(val, NULL, 10) : -1;
     val = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/rx-ring-ref", nicpath));
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 649ce50..e6368c7 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -488,7 +488,8 @@ libxl_nicinfo = Struct("nicinfo", [
     ("frontend_id", uint32),
     ("devid", libxl_devid),
     ("state", integer),
-    ("evtch", integer),
+    ("evtch_tx", integer),
+    ("evtch_rx", integer),
     ("rref_tx", integer),
     ("rref_rx", integer),
     ], dir=DIR_OUT)
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index c30f495..7353187 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -5842,9 +5842,9 @@ int main_networklist(int argc, char **argv)
         /* No options */
     }
 
-    /*      Idx  BE   MAC   Hdl  Sta  evch txr/rxr  BE-path */
-    printf("%-3s %-2s %-17s %-6s %-5s %-6s %5s/%-5s %-30s\n",
-           "Idx", "BE", "Mac Addr.", "handle", "state", "evt-ch", "tx-", "rx-ring-ref", "BE-path");
+    /*      Idx  BE   MAC   Hdl  Sta  txev/rxev txr/rxr  BE-path */
+    printf("%-3s %-2s %-17s %-6s %-5s %6s/%-6s %5s/%-5s %-30s\n",
+           "Idx", "BE", "Mac Addr.", "handle", "state", "tx-", "rx-evt-ch", "tx-", "rx-ring-ref", "BE-path");
     for (argv += optind, argc -= optind; argc > 0; --argc, ++argv) {
         uint32_t domid = find_domain(*argv);
         nics = libxl_device_nic_list(ctx, domid, &nb);
@@ -5857,9 +5857,9 @@ int main_networklist(int argc, char **argv)
                 printf("%-3d %-2d ", nicinfo.devid, nicinfo.backend_id);
                 /* MAC */
                 printf(LIBXL_MAC_FMT, LIBXL_MAC_BYTES(nics[i].mac));
-                /* Hdl  Sta  evch txr/rxr  BE-path */
-                printf("%6d %5d %6d %5d/%-11d %-30s\n",
-                       nicinfo.devid, nicinfo.state, nicinfo.evtch,
+                /* Hdl  Sta  txev/rxev txr/rxr  BE-path */
+                printf(" %6d %5d %6d/%-9d %5d/%-11d %-30s\n",
+                       nicinfo.devid, nicinfo.state, nicinfo.evtch_tx, nicinfo.evtch_rx,
                        nicinfo.rref_tx, nicinfo.rref_rx, nicinfo.backend);
                 libxl_nicinfo_dispose(&nicinfo);
             }
-- 
1.7.3.4

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

* Re: [PATCH] tools/xl: correctly shows split eventchannel for netfront
  2014-01-14 18:33 [PATCH] tools/xl: correctly shows split eventchannel for netfront Annie Li
@ 2014-01-15 13:13 ` Ian Campbell
  2014-01-15 15:18   ` annie li
  2014-01-15 15:31 ` David Vrabel
  1 sibling, 1 reply; 5+ messages in thread
From: Ian Campbell @ 2014-01-15 13:13 UTC (permalink / raw)
  To: Annie Li; +Cc: ian.jackson, wei.liu2, xen-devel

On Wed, 2014-01-15 at 02:33 +0800, Annie Li wrote:
> From: Annie Li <annie.li@oracle.com>
> 
> After split eventchannel feature was supported by netback/netfront,
> "xl network-list" does not show eventchannel correctly. Add tx-/rx-evt-ch
> to show tx/rx eventchannel correctly.
> 
> Signed-off-by: Annie Li <annie.li@oracle.com>

How critical is this for 4.4?

Please consider
http://wiki.xen.org/wiki/Xen_Roadmap/4.4#Exception_guidelines_for_after_the_code_freeze and make a case for it if you think it should go in.

> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
> index 649ce50..e6368c7 100644
> --- a/tools/libxl/libxl_types.idl
> +++ b/tools/libxl/libxl_types.idl
> @@ -488,7 +488,8 @@ libxl_nicinfo = Struct("nicinfo", [
>      ("frontend_id", uint32),
>      ("devid", libxl_devid),
>      ("state", integer),
> -    ("evtch", integer),
> +    ("evtch_tx", integer),
> +    ("evtch_rx", integer),

This needs backwards compatibility handling, see the big comment at the
head of libxl.h and the other examples in that file. I'm doubtful that
you will be able to remove the evtch field without breaking the API, so
it probably needs to stay even if it is explicitly invalid under some
circumstances.

It also needs a suitable LIBXL_HAVE_ #define, again see libxl.h.

Ian.

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

* Re: [PATCH] tools/xl: correctly shows split eventchannel for netfront
  2014-01-15 13:13 ` Ian Campbell
@ 2014-01-15 15:18   ` annie li
  0 siblings, 0 replies; 5+ messages in thread
From: annie li @ 2014-01-15 15:18 UTC (permalink / raw)
  To: Ian Campbell; +Cc: ian.jackson, wei.liu2, xen-devel


On 2014-1-15 21:13, Ian Campbell wrote:
> On Wed, 2014-01-15 at 02:33 +0800, Annie Li wrote:
>> From: Annie Li <annie.li@oracle.com>
>>
>> After split eventchannel feature was supported by netback/netfront,
>> "xl network-list" does not show eventchannel correctly. Add tx-/rx-evt-ch
>> to show tx/rx eventchannel correctly.
>>
>> Signed-off-by: Annie Li <annie.li@oracle.com>
> How critical is this for 4.4?

I think it can wait. This issue only happens with split event channel 
feature implemented in latest netback/netfront, "xl network-list" works 
OK for old netback/netfront.

>
> Please consider
> http://wiki.xen.org/wiki/Xen_Roadmap/4.4#Exception_guidelines_for_after_the_code_freeze and make a case for it if you think it should go in.
>
>> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
>> index 649ce50..e6368c7 100644
>> --- a/tools/libxl/libxl_types.idl
>> +++ b/tools/libxl/libxl_types.idl
>> @@ -488,7 +488,8 @@ libxl_nicinfo = Struct("nicinfo", [
>>       ("frontend_id", uint32),
>>       ("devid", libxl_devid),
>>       ("state", integer),
>> -    ("evtch", integer),
>> +    ("evtch_tx", integer),
>> +    ("evtch_rx", integer),
> This needs backwards compatibility handling, see the big comment at the
> head of libxl.h and the other examples in that file. I'm doubtful that
> you will be able to remove the evtch field without breaking the API, so
> it probably needs to stay even if it is explicitly invalid under some
> circumstances.
>
> It also needs a suitable LIBXL_HAVE_ #define, again see libxl.h.

Yes, this patch does not handle backwards compatibility,  and probably 
breaks the API. Let me fix them, thanks!

Thanks
Annie
>
> Ian.
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

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

* Re: [PATCH] tools/xl: correctly shows split eventchannel for netfront
  2014-01-14 18:33 [PATCH] tools/xl: correctly shows split eventchannel for netfront Annie Li
  2014-01-15 13:13 ` Ian Campbell
@ 2014-01-15 15:31 ` David Vrabel
  2014-01-15 15:50   ` Ian Campbell
  1 sibling, 1 reply; 5+ messages in thread
From: David Vrabel @ 2014-01-15 15:31 UTC (permalink / raw)
  To: Annie Li; +Cc: ian.jackson, wei.liu2, ian.campbell, xen-devel

On 14/01/14 18:33, Annie Li wrote:
> From: Annie Li <annie.li@oracle.com>
> 
> After split eventchannel feature was supported by netback/netfront,
> "xl network-list" does not show eventchannel correctly. Add tx-/rx-evt-ch
> to show tx/rx eventchannel correctly.
[...]
> --- a/tools/libxl/libxl_types.idl
> +++ b/tools/libxl/libxl_types.idl
> @@ -488,7 +488,8 @@ libxl_nicinfo = Struct("nicinfo", [
>      ("frontend_id", uint32),
>      ("devid", libxl_devid),
>      ("state", integer),
> -    ("evtch", integer),
> +    ("evtch_tx", integer),
> +    ("evtch_rx", integer),

Does this break libxl's API or ABI?

David

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

* Re: [PATCH] tools/xl: correctly shows split eventchannel for netfront
  2014-01-15 15:31 ` David Vrabel
@ 2014-01-15 15:50   ` Ian Campbell
  0 siblings, 0 replies; 5+ messages in thread
From: Ian Campbell @ 2014-01-15 15:50 UTC (permalink / raw)
  To: David Vrabel; +Cc: ian.jackson, Annie Li, wei.liu2, xen-devel

On Wed, 2014-01-15 at 15:31 +0000, David Vrabel wrote:
> On 14/01/14 18:33, Annie Li wrote:
> > From: Annie Li <annie.li@oracle.com>
> > 
> > After split eventchannel feature was supported by netback/netfront,
> > "xl network-list" does not show eventchannel correctly. Add tx-/rx-evt-ch
> > to show tx/rx eventchannel correctly.
> [...]
> > --- a/tools/libxl/libxl_types.idl
> > +++ b/tools/libxl/libxl_types.idl
> > @@ -488,7 +488,8 @@ libxl_nicinfo = Struct("nicinfo", [
> >      ("frontend_id", uint32),
> >      ("devid", libxl_devid),
> >      ("state", integer),
> > -    ("evtch", integer),
> > +    ("evtch_tx", integer),
> > +    ("evtch_rx", integer),
> 
> Does this break libxl's API or ABI?

Both, but we only guarantee API stability, not ABI stability (IOW we'd
just bump the SONAME).

Ian.

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

end of thread, other threads:[~2014-01-15 15:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-14 18:33 [PATCH] tools/xl: correctly shows split eventchannel for netfront Annie Li
2014-01-15 13:13 ` Ian Campbell
2014-01-15 15:18   ` annie li
2014-01-15 15:31 ` David Vrabel
2014-01-15 15:50   ` Ian Campbell

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.