l2: resolve l2 rewrite entry 'hit_count' always being 0 bug 43/39943/8
authoryanlong <dyl_wlc@163.com>
Sun, 19 Nov 2023 14:19:42 +0000 (06:19 -0800)
committerDamjan Marion <dmarion@0xa5.net>
Tue, 5 Dec 2023 10:09:46 +0000 (10:09 +0000)
The hit_count does not implement the corresponding processing logic, and here the missing is fixed

Type: fix
Fixes: missing

Change-Id: I04a8e11d6b48c2a15c371cbeb2467fa89a9d82bb
Signed-off-by: yanlong <dyl_wlc@163.com>
src/vnet/l2/l2_rw.c

index 2fb0e55..7921d0e 100644 (file)
@@ -109,6 +109,7 @@ l2_rw_rewrite (l2_rw_entry_t * rwe, u8 * h)
       /* FALLTHROUGH */
     case 1:
       d[0] = (d[0] & ~rwe->mask[0]) | rwe->value[0];
+      rwe->hit_count++;
       break;
     default:
       abort ();
@@ -332,6 +333,7 @@ l2_rw_mod_entry (u32 * index,
       return 0;
     }
 
+  e->hit_count = 0;
   e->skip_n_vectors = skip / sizeof (u32x4);
   skip -= e->skip_n_vectors * sizeof (u32x4);
   e->rewrite_n_vectors = (skip + len - 1) / sizeof (u32x4) + 1;