diff options
author | Dave Barach <dave@barachs.net> | 2018-08-08 17:59:03 -0400 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2018-08-09 16:10:09 +0000 |
commit | 49433adb9145bfd3a9cbaa99b01c6c14aeda71a4 (patch) | |
tree | bcc5ce520b38e180b087fbaaf5559e3988f47404 /src/vnet/ip/ip4_input.c | |
parent | 7fad624b09f8d1256360222dc547519d8b40dd1c (diff) |
Thread-safe ARP / ND throttling
Change-Id: I810d834c407bd404d5f0544cdec0674f0bb92d31
Signed-off-by: Dave Barach <dave@barachs.net>
Signed-off-by: Dave Barach <dbarach@cisco.com>
Diffstat (limited to 'src/vnet/ip/ip4_input.c')
-rw-r--r-- | src/vnet/ip/ip4_input.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/vnet/ip/ip4_input.c b/src/vnet/ip/ip4_input.c index 971445c7cd0..d11d558eb93 100644 --- a/src/vnet/ip/ip4_input.c +++ b/src/vnet/ip/ip4_input.c @@ -383,6 +383,28 @@ ip4_init (vlib_main_t * vm) } VLIB_INIT_FUNCTION (ip4_init); + +static clib_error_t * +ip4_main_loop_enter (vlib_main_t * vm) +{ + ip4_main_t *im = &ip4_main; + vlib_thread_main_t *tm = &vlib_thread_main; + u32 n_vlib_mains = tm->n_vlib_mains; + int i; + + + vec_validate (im->arp_throttle_bitmaps, n_vlib_mains); + vec_validate (im->arp_throttle_seeds, n_vlib_mains); + vec_validate (im->arp_throttle_last_seed_change_time, n_vlib_mains); + + for (i = 0; i < n_vlib_mains; i++) + vec_validate (im->arp_throttle_bitmaps[i], + (ARP_THROTTLE_BITS / BITS (uword)) - 1); + return 0; +} + +VLIB_MAIN_LOOP_ENTER_FUNCTION (ip4_main_loop_enter); + #endif /* |