All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Durrant <paul@xen.org>
To: xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@citrix.com>,
	Paul Durrant <pdurrant@amazon.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>, Wei Liu <wl@xen.org>
Subject: [PATCH v3 7/8] xl: add 'mtu' option to network configuration
Date: Tue, 11 Aug 2020 09:02:01 +0100	[thread overview]
Message-ID: <20200811080202.31163-8-paul@xen.org> (raw)
In-Reply-To: <20200811080202.31163-1-paul@xen.org>

From: Paul Durrant <pdurrant@amazon.com>

This patch adds code to parse a value for MTU from the network configuration
if it is present. The documentation in xl-network-configuration.5.pod is
also modified accordingly.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
---
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Wei Liu <wl@xen.org>
Cc: Anthony PERARD <anthony.perard@citrix.com>

v3:
 - New in v3
---
 docs/man/xl-network-configuration.5.pod | 6 ++++++
 tools/xl/xl_cmdtable.c                  | 2 +-
 tools/xl/xl_parse.c                     | 2 ++
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/docs/man/xl-network-configuration.5.pod b/docs/man/xl-network-configuration.5.pod
index 0ac24c4a18..af058d4d3c 100644
--- a/docs/man/xl-network-configuration.5.pod
+++ b/docs/man/xl-network-configuration.5.pod
@@ -249,3 +249,9 @@ on the underlying netback implementation.
 Specifies the devid manually instead of letting xl choose the lowest index available.
 
 NOTE: This should not be set unless you have a reason to.
+
+=head2 mtu
+
+Specifies the MTU (i.e. the maximum size of an IP payload, exclusing headers). The
+default value is 1500 but, if the VIF is attached to a bridge, it will be set to match
+unless overridden by this parameter.
diff --git a/tools/xl/xl_cmdtable.c b/tools/xl/xl_cmdtable.c
index 08335394e5..2b8e1b321a 100644
--- a/tools/xl/xl_cmdtable.c
+++ b/tools/xl/xl_cmdtable.c
@@ -338,7 +338,7 @@ struct cmd_spec cmd_table[] = {
       "Create a new virtual network device",
       "<Domain> [type=<type>] [mac=<mac>] [bridge=<bridge>] "
       "[ip=<ip>] [script=<script>] [backend=<BackDomain>] [vifname=<name>] "
-      "[rate=<rate>] [model=<model>] [accel=<accel>]",
+      "[rate=<rate>] [model=<model>] [accel=<accel>] [mtu=<mtu>]",
     },
     { "network-list",
       &main_networklist, 0, 0,
diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c
index 61b4ef7b7e..cae8eb679c 100644
--- a/tools/xl/xl_parse.c
+++ b/tools/xl/xl_parse.c
@@ -563,6 +563,8 @@ int parse_nic_config(libxl_device_nic *nic, XLU_Config **config, char *token)
         fprintf(stderr, "the accel parameter for vifs is currently not supported\n");
     } else if (MATCH_OPTION("devid", token, oparg)) {
         nic->devid = parse_ulong(oparg);
+    } else if (MATCH_OPTION("mtu", token, oparg)) {
+        nic->mtu = parse_ulong(oparg);
     } else {
         fprintf(stderr, "unrecognized argument `%s'\n", token);
         return 1;
-- 
2.20.1



  parent reply	other threads:[~2020-08-11  8:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-11  8:01 [PATCH v3 0/8] tools: propogate MTU to vif frontends Paul Durrant
2020-08-11  8:01 ` [PATCH v3 1/8] public/io/netif: specify MTU override node Paul Durrant
2020-08-14 16:24   ` Wei Liu
2020-08-11  8:01 ` [PATCH v3 2/8] tools/hotplug/Linux: re-factor add_to_bridge() in xen-network-common.sh Paul Durrant
2020-08-11  8:01 ` [PATCH v3 3/8] tools/hotplug/Linux: add remove_from_bridge() Paul Durrant
2020-08-11  8:01 ` [PATCH v3 4/8] tools/hotplug/Linux: remove code duplication in vif-bridge Paul Durrant
2020-08-11  8:01 ` [PATCH v3 5/8] libxl: wire the libxl_device_nic 'mtu' value into xenstore Paul Durrant
2020-08-11  8:02 ` [PATCH v3 6/8] tools/hotplug/Linux: modify set_mtu() to optionally use a configured value Paul Durrant
2020-08-11  8:02 ` Paul Durrant [this message]
2020-08-11  8:02 ` [PATCH v3 8/8] remove netchannel2 hotplug script... ancient history Paul Durrant
2020-08-27  9:58 ` [PATCH v3 0/8] tools: propogate MTU to vif frontends Wei Liu
2020-08-28 11:03   ` Durrant, Paul

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=20200811080202.31163-8-paul@xen.org \
    --to=paul@xen.org \
    --cc=anthony.perard@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=pdurrant@amazon.com \
    --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 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.