xl: add 'mtu' option to network configuration
authorPaul Durrant <pdurrant@amazon.com>
Tue, 11 Aug 2020 08:02:01 +0000 (09:02 +0100)
committerWei Liu <wl@xen.org>
Thu, 27 Aug 2020 10:04:25 +0000 (10:04 +0000)
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>
Acked-by: Wei Liu <wl@xen.org>
docs/man/xl-network-configuration.5.pod
tools/xl/xl_cmdtable.c
tools/xl/xl_parse.c

index 0ac24c4a18617e089b2641835690fc1962e45adf..af058d4d3cd5c3e8f2fd2f36d8be782d9e9f7021 100644 (file)
@@ -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.
index 08335394e53f7c54e5bbac391c0f101cbd04fcc1..2b8e1b321ad112c58874c83284a953b74558abc8 100644 (file)
@@ -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,
index 61b4ef7b7e363e418b44c5f639f4f40fba62b2bd..cae8eb679c5a0448a9337b8d346b6536074cddd8 100644 (file)
@@ -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;