From 8f5fef2c78b95de1a636ce27111722b71702212a Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Mon, 21 Dec 2020 08:29:34 +0000 Subject: ip: Path MTU Type: feature Support setting the MTU for a peer on an interface. The minimum value of the path and interface MTU is used at forwarding time. the path MTU is specified for a given peer, by address and table-ID. In the forwarding plane the MTU is enfored either: 1 - if the peer is attached, then the MTU is set on the peer's adjacency 2 - if the peer is not attached, it is remote, then a DPO is added to the peer's FIB entry to perform the necessary fragmentation. Signed-off-by: Neale Ranns Change-Id: I8b9ea6a07868b50e97e2561f18d9335407dea7ae --- src/vnet/dpo/dpo.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/vnet/dpo/dpo.c') diff --git a/src/vnet/dpo/dpo.c b/src/vnet/dpo/dpo.c index 1331b5501bc..d8342ff17ae 100644 --- a/src/vnet/dpo/dpo.c +++ b/src/vnet/dpo/dpo.c @@ -23,6 +23,8 @@ * The VLIB graph nodes are graph of types, the DPO graph is a graph of instances. */ +// clang-format off + #include #include #include @@ -395,6 +397,18 @@ dpo_get_urpf(const dpo_id_t *dpo) return (~0); } +u16 +dpo_get_mtu(const dpo_id_t *dpo) +{ + if (dpo_id_is_valid(dpo) && + (NULL != dpo_vfts[dpo->dpoi_type].dv_get_mtu)) + { + return (dpo_vfts[dpo->dpoi_type].dv_get_mtu(dpo)); + } + + return (0xffff); +} + static u32 dpo_get_next_node (dpo_type_t child_type, dpo_proto_t child_proto, @@ -649,3 +663,5 @@ VLIB_CLI_COMMAND (show_fib_memory, static) = { .short_help = "show dpo memory", }; /* *INDENT-ON* */ + +// clang-format on -- cgit 1.2.3-korg