summaryrefslogtreecommitdiffstats
path: root/src/vnet/adj/rewrite.c
diff options
context:
space:
mode:
authorNeale Ranns <neale.ranns@cisco.com>2018-02-09 06:05:16 -0800
committerDamjan Marion <dmarion.lists@gmail.com>2018-02-12 11:23:33 +0000
commitffd78d1ef8fe80d1b756a71d42d5eadda60ae996 (patch)
tree99770e8773a7c3dd27c8b9b116edb6a39ace09ea /src/vnet/adj/rewrite.c
parent2d6f66e1748be190664cbd72c826db32616d759a (diff)
Improve MTU handling
- setting MTU on an interface updates the L3 max bytes too - value cached in the adjacency is also updated - MTU exceeded generates ICMP to sender Change-Id: I343ec71d8e903b529594c4bd0543f04bc7f370b3 Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
Diffstat (limited to 'src/vnet/adj/rewrite.c')
-rw-r--r--src/vnet/adj/rewrite.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/vnet/adj/rewrite.c b/src/vnet/adj/rewrite.c
index 9150f2c6c37..c21495a9644 100644
--- a/src/vnet/adj/rewrite.c
+++ b/src/vnet/adj/rewrite.c
@@ -77,15 +77,14 @@ format_vnet_rewrite (u8 * s, va_list * args)
vnet_sw_interface_t *si;
si = vnet_get_sw_interface_safe (vnm, rw->sw_if_index);
if (NULL != si)
- s = format (s, "%U: ", format_vnet_sw_interface_name, vnm, si);
+ s = format (s, "%U:", format_vnet_sw_interface_name, vnm, si);
else
s = format (s, "DELETED:%d", rw->sw_if_index);
}
/* Format rewrite string. */
if (rw->data_bytes > 0)
-
- s = format (s, "%U",
+ s = format (s, " %U",
format_hex_bytes,
rw->data + max_data_bytes - rw->data_bytes, rw->data_bytes);
@@ -111,6 +110,13 @@ vnet_rewrite_init (vnet_main_t * vnm,
}
void
+vnet_rewrite_update_mtu (vnet_main_t * vnm, vnet_rewrite_header_t * rw)
+{
+ rw->max_l3_packet_bytes =
+ vnet_sw_interface_get_mtu (vnm, rw->sw_if_index, VLIB_TX);
+}
+
+void
vnet_rewrite_for_sw_interface (vnet_main_t * vnm,
vnet_link_t link_type,
u32 sw_if_index,