summaryrefslogtreecommitdiffstats
path: root/src/vnet/adj/adj.c
diff options
context:
space:
mode:
authorNeale Ranns <neale@graphiant.com>2020-12-21 08:29:34 +0000
committerOle Tr�an <otroan@employees.org>2021-02-15 17:27:48 +0000
commit8f5fef2c78b95de1a636ce27111722b71702212a (patch)
treea0ebd0189969ccae1f0bdd7c1a9c18dd7a066f2e /src/vnet/adj/adj.c
parent54be0cc044f445853fae7b8995c477605250af16 (diff)
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 <neale@graphiant.com> Change-Id: I8b9ea6a07868b50e97e2561f18d9335407dea7ae
Diffstat (limited to 'src/vnet/adj/adj.c')
-rw-r--r--src/vnet/adj/adj.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/vnet/adj/adj.c b/src/vnet/adj/adj.c
index d3890223dc1..8808294f7a6 100644
--- a/src/vnet/adj/adj.c
+++ b/src/vnet/adj/adj.c
@@ -20,6 +20,7 @@
#include <vnet/adj/adj_mcast.h>
#include <vnet/adj/adj_delegate.h>
#include <vnet/fib/fib_node_list.h>
+#include <vnet/fib/fib_walk.h>
/* Adjacency packet/byte counters indexed by adjacency index. */
vlib_combined_counter_main_t adjacency_counters = {
@@ -326,6 +327,16 @@ adj_dpo_get_urpf (const dpo_id_t *dpo)
return (adj->rewrite_header.sw_if_index);
}
+u16
+adj_dpo_get_mtu (const dpo_id_t *dpo)
+{
+ ip_adjacency_t *adj;
+
+ adj = adj_get(dpo->dpoi_index);
+
+ return (adj->rewrite_header.max_l3_packet_bytes);
+}
+
void
adj_lock (adj_index_t adj_index)
{
@@ -465,6 +476,19 @@ adj_mtu_update_walk_cb (adj_index_t ai,
vnet_rewrite_update_mtu (vnet_get_main(), adj->ia_link,
&adj->rewrite_header);
+ adj_delegate_adj_modified(adj);
+
+ /**
+ * Backwalk to all Path MTU trackers, casual like ..
+ */
+ {
+ fib_node_back_walk_ctx_t bw_ctx = {
+ .fnbw_reason = FIB_NODE_BW_REASON_FLAG_ADJ_MTU,
+ };
+
+ fib_walk_async(FIB_NODE_TYPE_ADJ, ai,
+ FIB_WALK_PRIORITY_LOW, &bw_ctx);
+ }
return (ADJ_WALK_RC_CONTINUE);
}