From 47a3d9975fa3af7a7537b565d6511dadc0df61fb Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Tue, 29 Sep 2020 15:38:51 +0000 Subject: l2: input performance Type: improvement - cache the values form the BD on the input config to avoid loading - avoid the short write long read on the sequence number - use vlib_buffer_enqueue_to_next Signed-off-by: Neale Ranns Change-Id: I33442b9104b457e4c638d26e9ad3bc965687a0bc --- src/vnet/l2/l2_fwd.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/vnet/l2/l2_fwd.c') diff --git a/src/vnet/l2/l2_fwd.c b/src/vnet/l2/l2_fwd.c index a1674e09b77..e7accc29878 100644 --- a/src/vnet/l2/l2_fwd.c +++ b/src/vnet/l2/l2_fwd.c @@ -156,13 +156,12 @@ l2fwd_process (vlib_main_t * vm, /* check l2fib seq num for stale entries */ if (!l2fib_entry_result_is_set_AGE_NOT (result0)) { - l2fib_seq_num_t in_sn = {.as_u16 = vnet_buffer (b0)->l2.l2fib_sn }; - l2fib_seq_num_t expected_sn = { - .bd = in_sn.bd, - .swif = *l2fib_swif_seq_num (result0->fields.sw_if_index), - }; - l2fib_seq_num_valid = - expected_sn.as_u16 == result0->fields.sn.as_u16; + l2fib_seq_num_t in_sn = vnet_buffer (b0)->l2.l2fib_sn; + l2fib_seq_num_t expected_sn = l2_fib_update_seq_num (in_sn, + l2_input_seq_num + (result0->fields.sw_if_index)); + + l2fib_seq_num_valid = expected_sn == result0->fields.sn; } if (PREDICT_FALSE (!l2fib_seq_num_valid)) @@ -505,7 +504,7 @@ int_fwd (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) } /* set the interface flag */ - if (l2input_intf_config (sw_if_index)->xconnect) + if (l2input_intf_config (sw_if_index)) { l2input_intf_bitmap_enable (sw_if_index, L2INPUT_FEAT_XCONNECT, enable); } -- cgit 1.2.3-korg