summaryrefslogtreecommitdiffstats
path: root/src/vnet/l2/l2_learn.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2020-09-29 15:38:51 +0000
committerDamjan Marion <dmarion@me.com>2020-10-08 08:51:59 +0000
commit47a3d9975fa3af7a7537b565d6511dadc0df61fb (patch)
treefa33e3360af84239615f48b164b239ee3b660ee6 /src/vnet/l2/l2_learn.c
parent83143710e80c8df703fe1ebc0e513aa37971d295 (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_learn.c')
-rw-r--r--src/vnet/l2/l2_learn.c4
1 files changed, 2 insertions, 2 deletions
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;