summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/ip4_input.c
diff options
context:
space:
mode:
authorNeale Ranns <neale.ranns@cisco.com>2018-08-29 10:23:58 -0700
committerDamjan Marion <dmarion@me.com>2018-08-30 17:43:48 +0000
commitc8352bc43dfa02707e8806e1ae5b310bbdb4d302 (patch)
tree2db2f1a8772869ad350f53fbb04a124d8f71fe70 /src/vnet/ip/ip4_input.c
parent2ce8bd9621902b8078fdcd9a95fd366f24d56ab3 (diff)
Refactor the ARP throttle into a common type so it can be reused
Change-Id: Ic7f7af983d5b6d756748023aa0c650f53e9285cf Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
Diffstat (limited to 'src/vnet/ip/ip4_input.c')
-rw-r--r--src/vnet/ip/ip4_input.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/vnet/ip/ip4_input.c b/src/vnet/ip/ip4_input.c
index 1425786a4b1..5a2ae17391f 100644
--- a/src/vnet/ip/ip4_input.c
+++ b/src/vnet/ip/ip4_input.c
@@ -41,6 +41,7 @@
#include <vnet/ethernet/ethernet.h>
#include <vnet/ppp/ppp.h>
#include <vnet/hdlc/hdlc.h>
+#include <vnet/util/throttle.h>
typedef struct
{
@@ -390,17 +391,10 @@ 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;
+ throttle_init (&im->arp_throttle, n_vlib_mains, 1e-3);
- 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;
+ return (NULL);
}
VLIB_MAIN_LOOP_ENTER_FUNCTION (ip4_main_loop_enter);