ip: add frame queues to punt policer nodes 86/30886/2
authorBrian Russell <brian@graphiant.com>
Tue, 19 Jan 2021 16:48:56 +0000 (16:48 +0000)
committerNeale Ranns <neale@graphiant.com>
Thu, 28 Jan 2021 10:26:00 +0000 (10:26 +0000)
The policer is not thread safe. In order that handoff could be
performed, add a frame queue to each of the punt policer nodes.

Type: improvement
Signed-off-by: Brian Russell <brian@graphiant.com>
Change-Id: Iee50267ee7e36f0e6c95b9b43bf651648198b834

src/vnet/ip/ip_punt_drop.c
src/vnet/ip/ip_punt_drop.h

index f77a0ad..f338800 100644 (file)
@@ -235,6 +235,11 @@ ip_punt_drop_init (vlib_main_t * vm)
   fib_node_register_type (FIB_NODE_TYPE_IP_PUNT_REDIRECT,
                          &ip_punt_redirect_vft);
 
+  ip4_punt_policer_cfg.fq_index =
+    vlib_frame_queue_main_init (ip4_punt_policer_node.index, 0);
+  ip6_punt_policer_cfg.fq_index =
+    vlib_frame_queue_main_init (ip6_punt_policer_node.index, 0);
+
   return (NULL);
 }
 
index 3e2796e..2fc1140 100644 (file)
@@ -27,6 +27,7 @@
 typedef struct ip_punt_policer_t_
 {
   u32 policer_index;
+  u32 fq_index;
 } ip_punt_policer_t;
 
 typedef enum ip_punt_policer_next_t_
@@ -53,6 +54,10 @@ typedef enum
 } ip_punt_policer_error_t;
 
 extern u8 *format_ip_punt_policer_trace (u8 * s, va_list * args);
+extern vlib_node_registration_t ip4_punt_policer_node;
+extern ip_punt_policer_t ip4_punt_policer_cfg;
+extern vlib_node_registration_t ip6_punt_policer_node;
+extern ip_punt_policer_t ip6_punt_policer_cfg;
 
 /**
  * IP punt policing node function