diff options
author | Artem Glazychev <artem.glazychev@xored.com> | 2022-02-18 12:23:20 +0700 |
---|---|---|
committer | Andrew Yourtchenko <ayourtch@gmail.com> | 2022-02-22 16:50:14 +0000 |
commit | 83945776cbee381e8eb7ab733348a4878520a9b0 (patch) | |
tree | fece333551495d3f102f8d5482b5df7be69c5715 | |
parent | 201830e1b986063d0a346e1ae8ddfd4a8192f44b (diff) |
vnet: add set_max_frame_size callbacks for several interfaces
This is required after distinguishing between max_frame_size and MTU
Type: fix
Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Change-Id: Ie642bee4e30ca76903bb8be5eeb6914c2c09bf35
(cherry picked from commit 66593a6a63fe30ed4b8bed96844244d78274e8f2)
-rw-r--r-- | src/plugins/memif/memif.c | 9 | ||||
-rw-r--r-- | src/vnet/devices/tap/tap.c | 9 | ||||
-rw-r--r-- | src/vnet/vxlan/vxlan.c | 9 |
3 files changed, 27 insertions, 0 deletions
diff --git a/src/plugins/memif/memif.c b/src/plugins/memif/memif.c index 5da73621536..5df8709b55e 100644 --- a/src/plugins/memif/memif.c +++ b/src/plugins/memif/memif.c @@ -50,6 +50,14 @@ memif_eth_flag_change (vnet_main_t * vnm, vnet_hw_interface_t * hi, u32 flags) return 0; } +static clib_error_t * +memif_eth_set_max_frame_size (vnet_main_t *vnm, vnet_hw_interface_t *hi, + u32 flags) +{ + /* nothing for now */ + return 0; +} + static void memif_queue_intfd_close (memif_queue_t * mq) { @@ -1017,6 +1025,7 @@ memif_create_if (vlib_main_t * vm, memif_create_if_args_t * args) eir.dev_instance = mif->dev_instance; eir.address = args->hw_addr; eir.cb.flag_change = memif_eth_flag_change; + eir.cb.set_max_frame_size = memif_eth_set_max_frame_size; mif->hw_if_index = vnet_eth_register_interface (vnm, &eir); } else if (mif->mode == MEMIF_INTERFACE_MODE_IP) diff --git a/src/vnet/devices/tap/tap.c b/src/vnet/devices/tap/tap.c index 370e738bcf1..0fa2e5d95af 100644 --- a/src/vnet/devices/tap/tap.c +++ b/src/vnet/devices/tap/tap.c @@ -77,6 +77,14 @@ virtio_eth_flag_change (vnet_main_t * vnm, vnet_hw_interface_t * hi, return 0; } +static clib_error_t * +virtio_eth_set_max_frame_size (vnet_main_t *vnm, vnet_hw_interface_t *hi, + u32 frame_size) +{ + /* nothing for now */ + return 0; +} + #define TAP_MAX_INSTANCE 1024 static void @@ -650,6 +658,7 @@ tap_create_if (vlib_main_t * vm, tap_create_if_args_t * args) eir.dev_instance = vif->dev_instance; eir.address = vif->mac_addr; eir.cb.flag_change = virtio_eth_flag_change; + eir.cb.set_max_frame_size = virtio_eth_set_max_frame_size; vif->hw_if_index = vnet_eth_register_interface (vnm, &eir); } else diff --git a/src/vnet/vxlan/vxlan.c b/src/vnet/vxlan/vxlan.c index 854498455e4..f670ee9c764 100644 --- a/src/vnet/vxlan/vxlan.c +++ b/src/vnet/vxlan/vxlan.c @@ -52,6 +52,14 @@ vxlan_eth_flag_change (vnet_main_t *vnm, vnet_hw_interface_t *hi, u32 flags) return 0; } +static clib_error_t * +vxlan_eth_set_max_frame_size (vnet_main_t *vnm, vnet_hw_interface_t *hw, + u32 frame_size) +{ + /* nothing for now */ + return 0; +} + static u8 * format_decap_next (u8 * s, va_list * args) { @@ -467,6 +475,7 @@ int vnet_vxlan_add_del_tunnel eir.dev_instance = dev_instance; eir.address = hw_addr; eir.cb.flag_change = vxlan_eth_flag_change; + eir.cb.set_max_frame_size = vxlan_eth_set_max_frame_size; t->hw_if_index = vnet_eth_register_interface (vnm, &eir); } |