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_learn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/vnet/l2/l2_learn.c') diff --git a/src/vnet/l2/l2_learn.c b/src/vnet/l2/l2_learn.c index 3f5b48bfa99..6f2201b3ade 100644 --- a/src/vnet/l2/l2_learn.c +++ b/src/vnet/l2/l2_learn.c @@ -128,7 +128,7 @@ l2learn_process (vlib_node_runtime_t * node, { /* Entry in L2FIB with matching sw_if_index matched - normal fast path */ u32 dtime = timestamp - result0->fields.timestamp; - u32 dsn = result0->fields.sn.as_u16 - vnet_buffer (b0)->l2.l2fib_sn; + u32 dsn = (result0->fields.sn - vnet_buffer (b0)->l2.l2fib_sn); u32 check = (dtime && vnet_buffer (b0)->l2.bd_age) || dsn; if (PREDICT_TRUE (check == 0)) @@ -224,7 +224,7 @@ l2learn_process (vlib_node_runtime_t * node, /* Update the entry */ result0->fields.timestamp = timestamp; - result0->fields.sn.as_u16 = vnet_buffer (b0)->l2.l2fib_sn; + result0->fields.sn = vnet_buffer (b0)->l2.l2fib_sn; BVT (clib_bihash_kv) kv; kv.key = key0->raw; -- cgit 1.2.3-korg