summaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/tap/tapv2_api.c
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2019-06-10 11:20:15 +0200
committerDamjan Marion <dmarion@me.com>2019-06-20 03:39:31 +0000
commit97d54ed43eb69f6ea731c02305ebe0ca0b1a5cc4 (patch)
tree1247bbd99b64313aa7dc9aa9fd51d822a42e31d8 /src/vnet/devices/tap/tapv2_api.c
parent3a9f11e6d93c9839c7bb0aaa62662299165123d8 (diff)
tap: add support to configure tap interface host MTU size
This patch adds support to configure host mtu size using api, cli or startup.conf. Type: feature Change-Id: I8ab087d82dbe7dedc498825c1a3ea3fcb2cce030 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vnet/devices/tap/tapv2_api.c')
-rw-r--r--src/vnet/devices/tap/tapv2_api.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/vnet/devices/tap/tapv2_api.c b/src/vnet/devices/tap/tapv2_api.c
index 40ff22eaeaa..2471d0084e1 100644
--- a/src/vnet/devices/tap/tapv2_api.c
+++ b/src/vnet/devices/tap/tapv2_api.c
@@ -109,6 +109,12 @@ vl_api_tap_create_v2_t_handler (vl_api_tap_create_v2_t * mp)
ap->host_ip6_gw_set = 1;
}
+ if (mp->host_mtu_set)
+ {
+ ap->host_mtu_size = ntohl (mp->host_mtu_size);
+ ap->host_mtu_set = 1;
+ }
+
ap->tap_flags = ntohl (mp->tap_flags);
tap_create_if (vm, ap);
@@ -190,6 +196,7 @@ tap_send_sw_interface_details (vpe_api_main_t * am,
clib_memcpy (mp->host_bridge, tap_if->host_bridge,
MIN (ARRAY_LEN (mp->host_bridge) - 1,
strlen ((const char *) tap_if->host_bridge)));
+ mp->host_mtu_size = htonl (tap_if->host_mtu_size);
if (tap_if->host_ip4_prefix_len)
clib_memcpy (&mp->host_ip4_addr, &tap_if->host_ip4_addr, 4);
mp->host_ip4_prefix_len = tap_if->host_ip4_prefix_len;