From c92341d5c6ab052d458471e26d6c27f9e303fe31 Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Fri, 31 Aug 2018 02:51:45 -0700 Subject: Use throttle_t for ND throttling (VPP-1480) Change-Id: I93c6b7bccd1a1ab71625ae29c99c974581186c4d Signed-off-by: Neale Ranns --- src/vnet/ip/ip4_forward.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/vnet/ip/ip4_forward.c') diff --git a/src/vnet/ip/ip4_forward.c b/src/vnet/ip/ip4_forward.c index 69a8dbad805..ffb873a9611 100644 --- a/src/vnet/ip/ip4_forward.c +++ b/src/vnet/ip/ip4_forward.c @@ -1750,7 +1750,7 @@ ip4_arp_inline (vlib_main_t * vm, u32 *from, *to_next_drop; uword n_left_from, n_left_to_next_drop, next_index; u32 thread_index = vm->thread_index; - u32 seed; + u64 seed; if (node->flags & VLIB_NODE_FLAG_TRACE) ip4_forward_next_trace (vm, node, frame, VLIB_TX); @@ -1770,10 +1770,11 @@ ip4_arp_inline (vlib_main_t * vm, while (n_left_from > 0 && n_left_to_next_drop > 0) { - u32 pi0, adj_index0, r0, sw_if_index0, drop0; + u32 pi0, adj_index0, sw_if_index0, drop0; ip_adjacency_t *adj0; vlib_buffer_t *p0; ip4_header_t *ip0; + u64 r0; pi0 = from[0]; @@ -1798,6 +1799,9 @@ ip4_arp_inline (vlib_main_t * vm, { r0 = adj0->sub_type.nbr.next_hop.ip4.data_u32; } + /* combine the address and interface for the hash key */ + r0 = r0 << 32; + r0 |= sw_if_index0; drop0 = throttle_check (&im->arp_throttle, thread_index, r0, seed); -- cgit 1.2.3-korg