xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Durrant, Paul" <pdurrant@amazon.co.uk>
To: Ian Jackson <ian.jackson@citrix.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	'Wei Liu' <wl@xen.org>, "paul@xen.org" <paul@xen.org>
Subject: RE: [PATCH v2 4/4] tools/hotplug: modify set_mtu() to inform the frontend via xenstore
Date: Wed, 5 Aug 2020 10:42:53 +0000	[thread overview]
Message-ID: <8fc31fce45d54e8a92bf3755fa829a84@EX13D32EUC003.ant.amazon.com> (raw)
In-Reply-To: <24362.34372.501505.911622@mariner.uk.xensource.com>

> -----Original Message-----
> From: Ian Jackson <ian.jackson@citrix.com>
> Sent: 05 August 2020 11:13
> To: Durrant, Paul <pdurrant@amazon.co.uk>
> Cc: paul@xen.org; xen-devel@lists.xenproject.org; 'Wei Liu' <wl@xen.org>
> Subject: RE: [EXTERNAL] [PATCH v2 4/4] tools/hotplug: modify set_mtu() to inform the frontend via
> xenstore
> 
> CAUTION: This email originated from outside of the organization. Do not click links or open
> attachments unless you can confirm the sender and know the content is safe.
> 
> 
> 
> Durrant, Paul writes ("RE: [PATCH v2 4/4] tools/hotplug: modify set_mtu() to inform the frontend via
> xenstore"):
> > > -----Original Message-----
> > > From: Ian Jackson <ian.jackson@citrix.com>
> ...
> > Well, I guess we address the driver domain issue in this way
> > too... I will add a patch to libxl to write the libxl_device_nic mtu
> > value into xenstore,
> 
> Do you mean libxl in dom0 or libxl in the driver domain ?
> 
> libxl contains code that runs in both contexts.
> 
> See device_hotplug in libxl_device.c, in particular notice
>     if (aodev->dev->backend_domid != domid) {
> 
> If you want the mtu to be read from the bridge, it can only be
> determined by the driver domain, because the bridge is in the driver
> domain.
> 
> In v2 of this series you arrange for the hotplug script to copy the
> mtu from the bridge into the frontend path.  That won't work because
> the hotplug script can't write to that xenstore node because (unlike a
> domo0 backend) a driver domain backend doesn't have write access to
> the frontend so can't create a new node there.
> 
> ISTM that it is correct that it is the hotplug script that does this
> interface setup.  If it weren't for this erroneous use of the frontend
> path I think the right design would be:
>   * toolstack libxl reads the config file to find whether there is an MTU
>   * toolstack libxl writes mtu node in backend iff one was in config
>     (and leaves the node absent otherwise)

This is where the 'subsequent patch' comes in (see the end of the email)...

>   * driver domain libxl runs hotplug script
>   * driver domain hotplug script looks for mtu in backend; if there
>     isn't one, it gets the value from the bridge and writes it to
>     the backend in xenstore
>   * driver domain backend driver reads mtu value from backend path
>   * guest domain frontend driver reads mtu value from backend path
>   * on domain save/migrate, toolstack libxl will record the mtu
>     value as the actual configuration so that the migrated domain
>     will get the same mtu
> 

That sounds right.

> I don't think I understand what (in these kind of terms) you are
> proposing, in order to support the frontends that want to read the mtu
> from the frontend.

We need some way for creating the frontend node such that the driver domain has write access. Presumably there is a suitable place in the toolstack instance of libxl to do this. This would mean we either need to write a sentinel 'invalid' value or write the default value. In the default case we could still leave the backend node absent so the hotplug script will still know whether or not a value was set in the cfg.

> 
> >  I think the current setting of 1492 can be changed to 1500 safely
> > (since nothing appears to currently use that value).
> 
> Right, that seems correct to me.
> 
> > The hotplug script should then have sufficient access to update, and
> > a subsequent patch can add a mechanism to set the value from the
> > config.
> 
> I think what I am missing is how this "subsequent patch" would work ?
> Ie what design are we aiming for, that we are now implementing part
> of ?

The subsequent patch would be one that actually acquires the mtu value from the vif config, and adds documentation to xl-network-configuration.5.pod, since this is currently missing.

  Paul

> 
> Ian.


      reply	other threads:[~2020-08-05 10:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-03 12:49 [PATCH v2 0/4] tools: propagate bridge MTU to vif frontends Paul Durrant
2020-08-03 12:49 ` [PATCH v2 1/4] tools/hotplug: add remove_from_bridge() and improve debug output Paul Durrant
2020-08-04 11:06   ` Ian Jackson
2020-08-03 12:49 ` [PATCH v2 2/4] tools/hotplug: combine add/online and remove/offline in vif-bridge Paul Durrant
2020-08-04 11:08   ` Ian Jackson
2020-08-03 12:49 ` [PATCH v2 3/4] public/io/netif: specify MTU override node Paul Durrant
2020-08-04 11:10   ` Ian Jackson
2020-08-03 12:49 ` [PATCH v2 4/4] tools/hotplug: modify set_mtu() to inform the frontend via xenstore Paul Durrant
2020-08-04 11:13   ` Ian Jackson
2020-08-04 11:20     ` Paul Durrant
2020-08-04 11:35       ` Ian Jackson
2020-08-04 13:31         ` Paul Durrant
2020-08-05  9:30           ` Ian Jackson
2020-08-05  9:44             ` Durrant, Paul
2020-08-05 10:13               ` Ian Jackson
2020-08-05 10:42                 ` Durrant, Paul [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8fc31fce45d54e8a92bf3755fa829a84@EX13D32EUC003.ant.amazon.com \
    --to=pdurrant@amazon.co.uk \
    --cc=ian.jackson@citrix.com \
    --cc=paul@xen.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).