diff options
author | Neale Ranns <nranns@cisco.com> | 2020-09-29 15:38:51 +0000 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2020-10-08 08:51:59 +0000 |
commit | 47a3d9975fa3af7a7537b565d6511dadc0df61fb (patch) | |
tree | fa33e3360af84239615f48b164b239ee3b660ee6 /src/vnet/l2/l2_fwd.c | |
parent | 83143710e80c8df703fe1ebc0e513aa37971d295 (diff) |
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 <nranns@cisco.com>
Change-Id: I33442b9104b457e4c638d26e9ad3bc965687a0bc
Diffstat (limited to 'src/vnet/l2/l2_fwd.c')
-rw-r--r-- | src/vnet/l2/l2_fwd.c | 15 |
1 files changed, 7 insertions, 8 deletions
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); } |