All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v15 0/7] Remus/Libxl: Remus network buffering and drbd disk
@ 2014-07-07  8:26 Yang Hongyang
  2014-07-07  8:26 ` [PATCH v15 1/7] remus: add libnl3 dependency for network buffering support Yang Hongyang
                   ` (6 more replies)
  0 siblings, 7 replies; 20+ messages in thread
From: Yang Hongyang @ 2014-07-07  8:26 UTC (permalink / raw)
  To: xen-devel
  Cc: ian.campbell, wency, andrew.cooper3, yunhong.jiang, ian.jackson,
	eddie.dong, rshriram, laijs

This patch series adds support for network buffering and drbd disk
in the Remus codebase in libxl.

the code is also hosted on github:

url: https://github.com/laijs/xen
branch: remus-v15

Changes in v15:
  The first patch in v14 has been taken, so remove it from the patchset.
  Add a patch to Update maintained files of REMUS.
  Rebased.

Changes in v14:
  Addressed IanJ's comments.
  Rebased.

Changes in v13:
  Addressed Konrad's comments.
  Rebased.

Changes in v12:
  Add disk buffering cmdline switch.

Changes in v11:
  Addressed comments from Ian J and Shriram.
  Add drbd disk implement into this patch series.

Changes in V10:
  Restructured the whole patch series.
  Introduce the remus device abstract layer.
  Make remus checkpoint asynchronous.

Changes in V9:
  Use async exec script api to exec scripts.

Changes in V8:
  Applied some comments(by IanJ).
  Merge some struct definitions to it's implementation.
  (2/3/5 in V7 => 3 in V8)

Changes in V7:
  Applied missing comments(by IanJ).
  Applied Shriram comments.

  merge netbufering tangled setup/teardown code into one patch.
  (2/6/8 in V6 => 5 in V7. 9/10 in V6 => 7 in V7)

Changes in V6:
  Applied Ian Jackson's comments of V5 series.
  the [PATCH 2/4 V5] is split by small functionalities.

  [PATCH 4/4 V5] --> [PATCH 13/13] netbuffer is default enabled.

Changes in V5:

Merge hotplug script patch (2/5) and hotplug script setup/teardown
patch (3/5) into a single patch.

Changes in V4:

[1/5] Remove check for libnl command line utils in autoconf checks

[2/5] minor nits

[3/5] define LIBXL_HAVE_REMUS_NETBUF in libxl.h

[4/5] clean ups. Make the usleep in checkpoint callback asynchronous

[5/5] minor nits

Changes in V3:
[1/5] Fix redundant checks in configure scripts
      (based on Ian Campbell's suggestions)

[2/5] Introduce locking in the script, during IFB setup.
      Add xenstore paths used by netbuf scripts
      to xenstore-paths.markdown

[3/5] Hotplug scripts setup/teardown invocations are now asynchronous
      following IanJ's feedback.  However, the invocations are still
      sequential. 

[5/5] Allow per-domain specification of netbuffer scripts in xl remus
      commmand.

And minor nits throughout the series based on feedback from
the last version

Changes in V2:
[1/5] Configure script will automatically enable/disable network
      buffer support depending on the availability of the appropriate
      libnl3 version. [If libnl3 is unavailable, a warning message will be
      printed to let the user know that the feature has been disabled.]

      use macros from pkg.m4 instead of pkg-config commands
      removed redundant checks for libnl3 libraries.

[3,4/5] - Minor nits.

Version 1:

[1/5] Changes to autoconf scripts to check for libnl3. Add linker flags
      to libxl Makefile.

[2/5] External script to setup/teardown network buffering using libnl3's
      CLI. This script will be invoked by libxl before starting Remus.
      The script's main job is to bring up an IFB device with plug qdisc
      attached to it.  It then re-routes egress traffic from the guest's
      vif to the IFB device.

[3/5] Libxl code to invoke the external setup script, followed by netlink
      related setup to obtain a handle on the output buffers attached
      to each vif.

[4/5] Libxl interaction with network buffer module in the kernel via
      libnl3 API.

[5/5] xl cmdline switch to explicitly enable network buffering when
      starting remus.


  Few things to note(by shriram): 

    a) Based on previous email discussions, the setup/teardown task has
    been moved to a hotplug style shell script which can be customized as
    desired, instead of implementing it as C code inside libxl.

    b) Libnl3 is not available on NetBSD. Nor is it available on CentOS
   (Linux).  So I have made network buffering support an optional feature
   so that it can be disabled if desired.

   c) NetBSD does not have libnl3. So I have put the setup script under
   tools/hotplug/Linux folder.

thanks

Legend:
  A - acked
  D - previous acked, but new change introduced so acked-by dropped
  M - Modified
  S - the same version as last round
  No marker - new patch

Yang Hongyang (7):
  A remus: add libnl3 dependency for network buffering support
  S remus: introduce remus device
  S remus netbuffer: implement remus network buffering for nic devices
  S remus drbd: Implement remus drbd replicated disk
  S libxl: network buffering cmdline switch
  S libxl: disk buffering cmdline switch
    MAINTAINERS: Update maintained files of REMUS

 MAINTAINERS                            |   5 +
 README                                 |   4 +
 config/Tools.mk.in                     |   4 +
 docs/README.remus                      |   6 +
 docs/man/xl.conf.pod.5                 |   6 +
 docs/man/xl.pod.1                      |  15 +-
 docs/misc/xenstore-paths.markdown      |   4 +
 tools/configure.ac                     |  16 ++
 tools/hotplug/Linux/Makefile           |   2 +
 tools/hotplug/Linux/block-drbd-probe   |  85 ++++++
 tools/hotplug/Linux/remus-netbuf-setup | 203 +++++++++++++
 tools/libxl/Makefile                   |  15 +
 tools/libxl/libxl.c                    |  58 +++-
 tools/libxl/libxl.h                    |   6 +
 tools/libxl/libxl_dom.c                | 132 ++++++++-
 tools/libxl/libxl_internal.h           | 199 +++++++++++++
 tools/libxl/libxl_netbuffer.c          | 506 +++++++++++++++++++++++++++++++++
 tools/libxl/libxl_nonetbuffer.c        |  58 ++++
 tools/libxl/libxl_remus_device.c       | 411 ++++++++++++++++++++++++++
 tools/libxl/libxl_remus_disk_drbd.c    | 239 ++++++++++++++++
 tools/libxl/libxl_types.idl            |   4 +
 tools/libxl/xl.c                       |   4 +
 tools/libxl/xl.h                       |   1 +
 tools/libxl/xl_cmdimpl.c               |  32 ++-
 tools/libxl/xl_cmdtable.c              |   4 +
 25 files changed, 1993 insertions(+), 26 deletions(-)
 create mode 100755 tools/hotplug/Linux/block-drbd-probe
 create mode 100644 tools/hotplug/Linux/remus-netbuf-setup
 create mode 100644 tools/libxl/libxl_netbuffer.c
 create mode 100644 tools/libxl/libxl_nonetbuffer.c
 create mode 100644 tools/libxl/libxl_remus_device.c
 create mode 100644 tools/libxl/libxl_remus_disk_drbd.c

-- 
1.9.1

^ permalink raw reply	[flat|nested] 20+ messages in thread
* Re: [PATCH v15 3/7] remus netbuffer: implement remus network buffering for nic devices
@ 2014-07-10 17:44 Ian Jackson
  0 siblings, 0 replies; 20+ messages in thread
From: Ian Jackson @ 2014-07-10 17:44 UTC (permalink / raw)
  To: Hongyang Yang
  Cc: ian.campbell, wency, andrew.cooper3, yunhong.jiang, Ian Jackson,
	xen-devel, eddie.dong, rshriram, laijs

[-- Attachment #1: Type: text/plain, Size: 287 bytes --]

Sender: xen-devel-bounces@lists.xen.org
On-Behalf-Of: Ian.Jackson@eu.citrix.com
Subject: Re: [Xen-devel] [PATCH v15 3/7] remus netbuffer: implement remus network buffering for nic devices
Message-Id: <21438.53426.579003.941392@mariner.uk.xensource.com>
Recipient: ibudiman@overstock.com

[-- Attachment #2: Type: message/rfc822, Size: 10988 bytes --]

From: Ian Jackson <Ian.Jackson@eu.citrix.com>
To: Hongyang Yang <yanghy@cn.fujitsu.com>
Cc: <ian.campbell@citrix.com>, <wency@cn.fujitsu.com>, <andrew.cooper3@citrix.com>, <yunhong.jiang@intel.com>, Ian Jackson <Ian.Jackson@eu.citrix.com>, <xen-devel@lists.xen.org>, <eddie.dong@intel.com>, <rshriram@cs.ubc.ca>, <laijs@cn.fujitsu.com>
Subject: Re: [Xen-devel] [PATCH v15 3/7] remus netbuffer: implement remus network buffering for nic devices
Date: Thu, 10 Jul 2014 18:43:14 +0100
Message-ID: <21438.53426.579003.941392@mariner.uk.xensource.com>

Hongyang Yang writes ("Re: [PATCH v15 3/7] remus netbuffer: implement remus network buffering for nic devices"):
> On 07/10/2014 07:15 AM, Ian Jackson wrote:
> > It occurs to me to ask: Is it wise to use such a bare name for the
> > variable IFB ?  I would suggest that it might be better to use a
> > variable with XEN or REMUS or something in it.  Otherwise perhaps
> > someone somewhere might think IFB stood for something else and would
> > set it to something irrelevant (or your setting of it might break
> > their usage...)
> 
> Maybe REMUS_IFB?

Sounds good to me.

> >> +struct libxl__remus_netbuf_state {
> >> +    libxl__ao *ao;
> >> +    uint32_t domid;
> >> +    const char *netbufscript;
> >
> > Why is there a copy of netbufscript here ?
> 
> We use netbuf state in device concrete layer, so we made a copy
> of this.

What I mean is, why does the concrete layer not have access to the
remus_state ?  Is there something wrong with passing it the
remus_state ?

> >> +/*----- init() and destroy() -----*/
> >> +
> >> +static int nic_init(const libxl__remus_device_ops *self,
> >> +                    libxl__remus_state *rs)
> >> +{
> >
> > This function seems to leak the things it allocates, on error.
> > The `out' section should probably call destroy.
> 
> If this failed, we will call teardown, and in teardown, the
> nic_destroy will be called.

OIC.  I think this needs to be documented in a comment in
libxl__remus_device_ops.  Normally one wouldn't expect to have to call
destroy() if init() fails.

> > Last time I commented on the error handling in this patch.  I see that
> > you have added an nl_geterror in some places.
> >
> > When I make a comment like that, you need to apply it whereever
> > relevant in the code, and to the whole patch series.
> 
> Yes, actually I've checked the whole patch about this and
> corrected them. for this special case, nl_socket_alloc() doesn't
> return an error number, so we can't use nl_geterror, it returns
> NULL if alloc failed, so I think this error message should be ok.

Err, OK.

> >> +static void nic_destroy(const libxl__remus_device_ops *self,
> >> +                        libxl__remus_state *rs)
> > ...
> >> +    /* free qdisc cache */
> >> +    if (ns->qdisc_cache) {
> >> +        nl_cache_clear(ns->qdisc_cache);
> >> +        nl_cache_free(ns->qdisc_cache);
> >
> > Can these functions fail ?  If so, what does it mean and what should
> > the program do ?
> 
> No, they both return void.

Oh, good.

> >> +static int remus_netbuf_op(libxl__remus_device_nic *remus_nic,
> >> +                           libxl__remus_netbuf_state *netbuf_state,
> >> +                           int buffer_op)
> >> +{
> >> +    int rc;
> >> +
> >> +    STATE_AO_GC(netbuf_state->ao);
> >> +
> >> +    if (buffer_op == tc_buffer_start)
> >> +        rc = rtnl_qdisc_plug_buffer(remus_nic->qdisc);
> >> +    else
> >> +        rc = rtnl_qdisc_plug_release_one(remus_nic->qdisc);
> >
> > Error handling again.
> 
> I can't quite follow you, what's wrong with the error handling in this
> function except the name of the "rc"?

In fact reading it again I was confused by the fact that this function
doesn't actually return rc.  Sorry about that - but I guess this shows
why using the conventional names etc. is important.

> > How does rtnl_link_get_ifindex report its error code ?  Or can it fail
> > only one way ?
> 
> It Returns Interface index or 0 if not set. No error code will be returned.

Oh.  The error handling in this rtnl facility you're using does seem
rather poor - but of course this isn't your fault.  Thanks for
clarifying.

Thanks for your comprehensive reply.

Ian.

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


[-- Attachment #3: 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] 20+ messages in thread

end of thread, other threads:[~2014-07-11  8:18 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-07  8:26 [PATCH v15 0/7] Remus/Libxl: Remus network buffering and drbd disk Yang Hongyang
2014-07-07  8:26 ` [PATCH v15 1/7] remus: add libnl3 dependency for network buffering support Yang Hongyang
2014-07-07  8:26 ` [PATCH v15 2/7] remus: introduce remus device Yang Hongyang
2014-07-09 17:26   ` Ian Jackson
2014-07-10  2:18     ` Hongyang Yang
2014-07-10 17:34       ` Ian Jackson
2014-07-11  2:12         ` Hongyang Yang
2014-07-11  6:16           ` Hongyang Yang
2014-07-11  8:18     ` Hongyang Yang
2014-07-07  8:26 ` [PATCH v15 3/7] remus netbuffer: implement remus network buffering for nic devices Yang Hongyang
2014-07-09 23:15   ` Ian Jackson
2014-07-10  3:03     ` Hongyang Yang
2014-07-10 17:43       ` Ian Jackson
2014-07-11  2:18         ` Hongyang Yang
2014-07-10 12:53     ` Ian Campbell
2014-07-07  8:26 ` [PATCH v15 4/7] remus drbd: Implement remus drbd replicated disk Yang Hongyang
2014-07-07  8:26 ` [PATCH v15 5/7] libxl: network buffering cmdline switch Yang Hongyang
2014-07-07  8:26 ` [PATCH v15 6/7] libxl: disk " Yang Hongyang
2014-07-07  8:26 ` [PATCH v15 7/7] MAINTAINERS: Update maintained files of REMUS Yang Hongyang
  -- strict thread matches above, loose matches on Subject: below --
2014-07-10 17:44 [PATCH v15 3/7] remus netbuffer: implement remus network buffering for nic devices Ian Jackson

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.