summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNeale Ranns <neale@graphiant.com>2021-06-03 14:59:47 +0000
committerNeale Ranns <neale@graphiant.com>2021-06-07 07:19:00 +0000
commit68d48d94a84f6499a16cd362d0a225b1720baf67 (patch)
tree804f88db5d8f4f78ccf4523a065f7ec8ab82b6a2 /src
parent2645f68985df4955fd8a161224595dad9f4ab488 (diff)
pg: Reduce the inclusion of pg.h
Type: style reduce the number of files recompiled after changing pg.h from 1110 to 102. Signed-off-by: Neale Ranns <neale@graphiant.com> Change-Id: I50611eba818eeb3a2dffd437a3c72c77766bed80
Diffstat (limited to 'src')
-rw-r--r--src/vnet/arp/arp.c1
-rw-r--r--src/vnet/devices/virtio/vhost_user_input.c3
-rw-r--r--src/vnet/ethernet/ethernet.h12
-rw-r--r--src/vnet/ethernet/node.c11
-rw-r--r--src/vnet/hdlc/hdlc.h12
-rw-r--r--src/vnet/hdlc/node.c11
-rw-r--r--src/vnet/ip/ip4_forward.c1
-rw-r--r--src/vnet/ip/ip4_input.c1
-rw-r--r--src/vnet/ip/ip6_forward.c1
-rw-r--r--src/vnet/ip/ip6_input.c1
-rw-r--r--src/vnet/ipfix-export/flow_report.h1
-rw-r--r--src/vnet/llc/llc.h12
-rw-r--r--src/vnet/llc/node.c12
-rw-r--r--src/vnet/osi/node.c11
-rw-r--r--src/vnet/osi/osi.h12
-rw-r--r--src/vnet/ppp/node.c11
-rw-r--r--src/vnet/ppp/ppp.h12
-rw-r--r--src/vnet/snap/node.c11
-rw-r--r--src/vnet/snap/snap.h12
-rw-r--r--src/vnet/srp/node.c11
-rw-r--r--src/vnet/srp/srp.h11
21 files changed, 87 insertions, 83 deletions
diff --git a/src/vnet/arp/arp.c b/src/vnet/arp/arp.c
index 299ed97f6e4..ced3c1cb7a7 100644
--- a/src/vnet/arp/arp.c
+++ b/src/vnet/arp/arp.c
@@ -22,6 +22,7 @@
#include <vnet/fib/fib_entry_src.h>
#include <vnet/adj/adj_nbr.h>
#include <vnet/adj/adj_mcast.h>
+#include <vnet/pg/pg.h>
#include <vnet/ip-neighbor/ip_neighbor.h>
#include <vnet/ip-neighbor/ip_neighbor_dp.h>
diff --git a/src/vnet/devices/virtio/vhost_user_input.c b/src/vnet/devices/virtio/vhost_user_input.c
index 69fba411f1c..6abc1fc6e94 100644
--- a/src/vnet/devices/virtio/vhost_user_input.c
+++ b/src/vnet/devices/virtio/vhost_user_input.c
@@ -42,6 +42,9 @@
#include <vnet/devices/virtio/vhost_user.h>
#include <vnet/devices/virtio/vhost_user_inline.h>
+#include <vnet/ip/ip4_packet.h>
+#include <vnet/ip/ip6_packet.h>
+
/*
* When an RX queue is down but active, received packets
* must be discarded. This value controls up to how many
diff --git a/src/vnet/ethernet/ethernet.h b/src/vnet/ethernet/ethernet.h
index a83b0f39295..f3dd1a24a4f 100644
--- a/src/vnet/ethernet/ethernet.h
+++ b/src/vnet/ethernet/ethernet.h
@@ -43,7 +43,6 @@
#include <vnet/vnet.h>
#include <vnet/ethernet/packet.h>
#include <vnet/ethernet/mac_address.h>
-#include <vnet/pg/pg.h>
#include <vnet/feature/feature.h>
/* ethernet-input frame flags and scalar data */
@@ -404,16 +403,7 @@ uword unformat_ethernet_interface (unformat_input_t * input, va_list * args);
uword unformat_pg_ethernet_header (unformat_input_t * input, va_list * args);
-always_inline void
-ethernet_setup_node (vlib_main_t * vm, u32 node_index)
-{
- vlib_node_t *n = vlib_get_node (vm, node_index);
- pg_node_t *pn = pg_get_node (node_index);
-
- n->format_buffer = format_ethernet_header_with_length;
- n->unformat_buffer = unformat_ethernet_header;
- pn->unformat_edit = unformat_pg_ethernet_header;
-}
+void ethernet_setup_node (vlib_main_t *vm, u32 node_index);
always_inline ethernet_header_t *
ethernet_buffer_get_header (vlib_buffer_t * b)
diff --git a/src/vnet/ethernet/node.c b/src/vnet/ethernet/node.c
index 88b4a70a28a..f470c1c7b46 100644
--- a/src/vnet/ethernet/node.c
+++ b/src/vnet/ethernet/node.c
@@ -2237,6 +2237,17 @@ next_by_ethertype_register (next_by_ethertype_t * l3_next,
}
void
+ethernet_setup_node (vlib_main_t *vm, u32 node_index)
+{
+ vlib_node_t *n = vlib_get_node (vm, node_index);
+ pg_node_t *pn = pg_get_node (node_index);
+
+ n->format_buffer = format_ethernet_header_with_length;
+ n->unformat_buffer = unformat_ethernet_header;
+ pn->unformat_edit = unformat_pg_ethernet_header;
+}
+
+void
ethernet_input_init (vlib_main_t * vm, ethernet_main_t * em)
{
__attribute__ ((unused)) vlan_table_t *invalid_vlan_table;
diff --git a/src/vnet/hdlc/hdlc.h b/src/vnet/hdlc/hdlc.h
index a2bd6e928b2..490ea949dae 100644
--- a/src/vnet/hdlc/hdlc.h
+++ b/src/vnet/hdlc/hdlc.h
@@ -42,7 +42,6 @@
#include <vnet/vnet.h>
#include <vnet/hdlc/packet.h>
-#include <vnet/pg/pg.h>
extern vnet_hw_interface_class_t hdlc_hw_interface_class;
@@ -106,17 +105,6 @@ unformat_function_t unformat_hdlc_protocol_net_byte_order;
unformat_function_t unformat_hdlc_header;
unformat_function_t unformat_pg_hdlc_header;
-always_inline void
-hdlc_setup_node (vlib_main_t * vm, u32 node_index)
-{
- vlib_node_t *n = vlib_get_node (vm, node_index);
- pg_node_t *pn = pg_get_node (node_index);
-
- n->format_buffer = format_hdlc_header_with_length;
- n->unformat_buffer = unformat_hdlc_header;
- pn->unformat_edit = unformat_pg_hdlc_header;
-}
-
void
hdlc_register_input_protocol (vlib_main_t * vm,
hdlc_protocol_t protocol, u32 node_index);
diff --git a/src/vnet/hdlc/node.c b/src/vnet/hdlc/node.c
index d36b09d4dcd..8bb621231c7 100644
--- a/src/vnet/hdlc/node.c
+++ b/src/vnet/hdlc/node.c
@@ -324,6 +324,17 @@ hdlc_input_runtime_init (vlib_main_t * vm)
return 0;
}
+static void
+hdlc_setup_node (vlib_main_t *vm, u32 node_index)
+{
+ vlib_node_t *n = vlib_get_node (vm, node_index);
+ pg_node_t *pn = pg_get_node (node_index);
+
+ n->format_buffer = format_hdlc_header_with_length;
+ n->unformat_buffer = unformat_hdlc_header;
+ pn->unformat_edit = unformat_pg_hdlc_header;
+}
+
static clib_error_t *
hdlc_input_init (vlib_main_t * vm)
{
diff --git a/src/vnet/ip/ip4_forward.c b/src/vnet/ip/ip4_forward.c
index da8522de775..36f05a27820 100644
--- a/src/vnet/ip/ip4_forward.c
+++ b/src/vnet/ip/ip4_forward.c
@@ -55,6 +55,7 @@
#include <vnet/dpo/classify_dpo.h>
#include <vnet/mfib/mfib_table.h> /* for mFIB table and entry creation */
#include <vnet/adj/adj_dp.h>
+#include <vnet/pg/pg.h>
#include <vnet/ip/ip4_forward.h>
#include <vnet/interface_output.h>
diff --git a/src/vnet/ip/ip4_input.c b/src/vnet/ip/ip4_input.c
index bf8e05c1bab..3b3edf9fca7 100644
--- a/src/vnet/ip/ip4_input.c
+++ b/src/vnet/ip/ip4_input.c
@@ -39,6 +39,7 @@
#include <vnet/ip/ip4_input.h>
#include <vnet/ethernet/ethernet.h>
+#include <vnet/pg/pg.h>
#include <vnet/ppp/ppp.h>
#include <vnet/hdlc/hdlc.h>
#include <vnet/util/throttle.h>
diff --git a/src/vnet/ip/ip6_forward.c b/src/vnet/ip/ip6_forward.c
index 5d7014070bd..fd742d6b3e2 100644
--- a/src/vnet/ip/ip6_forward.c
+++ b/src/vnet/ip/ip6_forward.c
@@ -50,6 +50,7 @@
#include <vnet/dpo/load_balance_map.h>
#include <vnet/dpo/classify_dpo.h>
#include <vnet/classify/vnet_classify.h>
+#include <vnet/pg/pg.h>
#ifndef CLIB_MARCH_VARIANT
#include <vppinfra/bihash_template.c>
diff --git a/src/vnet/ip/ip6_input.c b/src/vnet/ip/ip6_input.c
index 65d39ebc54d..01b8f46b4d8 100644
--- a/src/vnet/ip/ip6_input.c
+++ b/src/vnet/ip/ip6_input.c
@@ -41,6 +41,7 @@
#include <vnet/ethernet/ethernet.h>
#include <vnet/ppp/ppp.h>
#include <vnet/hdlc/hdlc.h>
+#include <vnet/pg/pg.h>
typedef struct
{
diff --git a/src/vnet/ipfix-export/flow_report.h b/src/vnet/ipfix-export/flow_report.h
index 30c11760c92..98da146427a 100644
--- a/src/vnet/ipfix-export/flow_report.h
+++ b/src/vnet/ipfix-export/flow_report.h
@@ -17,7 +17,6 @@
#include <vlib/vlib.h>
#include <vnet/vnet.h>
-#include <vnet/pg/pg.h>
#include <vnet/ethernet/ethernet.h>
#include <vnet/ethernet/packet.h>
#include <vnet/ip/ip_packet.h>
diff --git a/src/vnet/llc/llc.h b/src/vnet/llc/llc.h
index 990a581db7b..2496cfd510d 100644
--- a/src/vnet/llc/llc.h
+++ b/src/vnet/llc/llc.h
@@ -41,7 +41,6 @@
#define included_llc_h
#include <vnet/vnet.h>
-#include <vnet/pg/pg.h>
/* Protocol (SSAP/DSAP) types. */
#define foreach_llc_protocol \
@@ -169,17 +168,6 @@ unformat_function_t unformat_llc_protocol;
unformat_function_t unformat_llc_header;
unformat_function_t unformat_pg_llc_header;
-always_inline void
-llc_setup_node (vlib_main_t * vm, u32 node_index)
-{
- vlib_node_t *n = vlib_get_node (vm, node_index);
- pg_node_t *pn = pg_get_node (node_index);
-
- n->format_buffer = format_llc_header_with_length;
- n->unformat_buffer = unformat_llc_header;
- pn->unformat_edit = unformat_pg_llc_header;
-}
-
#endif /* included_llc_h */
/*
diff --git a/src/vnet/llc/node.c b/src/vnet/llc/node.c
index 79d15418af2..086925bd305 100644
--- a/src/vnet/llc/node.c
+++ b/src/vnet/llc/node.c
@@ -38,6 +38,7 @@
*/
#include <vlib/vlib.h>
+#include <vnet/pg/pg.h>
#include <vnet/llc/llc.h>
#define foreach_llc_input_next \
@@ -268,6 +269,17 @@ VLIB_REGISTER_NODE (llc_input_node) = {
};
/* *INDENT-ON* */
+static void
+llc_setup_node (vlib_main_t *vm, u32 node_index)
+{
+ vlib_node_t *n = vlib_get_node (vm, node_index);
+ pg_node_t *pn = pg_get_node (node_index);
+
+ n->format_buffer = format_llc_header_with_length;
+ n->unformat_buffer = unformat_llc_header;
+ pn->unformat_edit = unformat_pg_llc_header;
+}
+
static clib_error_t *
llc_input_init (vlib_main_t * vm)
{
diff --git a/src/vnet/osi/node.c b/src/vnet/osi/node.c
index bdeab2df074..4eb3e461139 100644
--- a/src/vnet/osi/node.c
+++ b/src/vnet/osi/node.c
@@ -262,6 +262,17 @@ VLIB_REGISTER_NODE (osi_input_node) = {
};
/* *INDENT-ON* */
+static void
+osi_setup_node (vlib_main_t *vm, u32 node_index)
+{
+ vlib_node_t *n = vlib_get_node (vm, node_index);
+ pg_node_t *pn = pg_get_node (node_index);
+
+ n->format_buffer = format_osi_header_with_length;
+ n->unformat_buffer = unformat_osi_header;
+ pn->unformat_edit = unformat_pg_osi_header;
+}
+
static clib_error_t *
osi_input_init (vlib_main_t * vm)
{
diff --git a/src/vnet/osi/osi.h b/src/vnet/osi/osi.h
index 0ff267a330b..fb248ed9cc5 100644
--- a/src/vnet/osi/osi.h
+++ b/src/vnet/osi/osi.h
@@ -41,7 +41,6 @@
#define included_osi_h
#include <vnet/vnet.h>
-#include <vnet/pg/pg.h>
#define foreach_osi_protocol \
_ (null, 0x0) \
@@ -142,17 +141,6 @@ unformat_function_t unformat_osi_protocol;
unformat_function_t unformat_osi_header;
unformat_function_t unformat_pg_osi_header;
-always_inline void
-osi_setup_node (vlib_main_t * vm, u32 node_index)
-{
- vlib_node_t *n = vlib_get_node (vm, node_index);
- pg_node_t *pn = pg_get_node (node_index);
-
- n->format_buffer = format_osi_header_with_length;
- n->unformat_buffer = unformat_osi_header;
- pn->unformat_edit = unformat_pg_osi_header;
-}
-
void osi_register_input_protocol (osi_protocol_t protocol, u32 node_index);
format_function_t format_osi_header;
diff --git a/src/vnet/ppp/node.c b/src/vnet/ppp/node.c
index fd0105e4305..eead2b2f0c1 100644
--- a/src/vnet/ppp/node.c
+++ b/src/vnet/ppp/node.c
@@ -311,6 +311,17 @@ ppp_input_runtime_init (vlib_main_t * vm)
return 0;
}
+static void
+ppp_setup_node (vlib_main_t *vm, u32 node_index)
+{
+ vlib_node_t *n = vlib_get_node (vm, node_index);
+ pg_node_t *pn = pg_get_node (node_index);
+
+ n->format_buffer = format_ppp_header_with_length;
+ n->unformat_buffer = unformat_ppp_header;
+ pn->unformat_edit = unformat_pg_ppp_header;
+}
+
static clib_error_t *
ppp_input_init (vlib_main_t * vm)
{
diff --git a/src/vnet/ppp/ppp.h b/src/vnet/ppp/ppp.h
index 726eca66835..77da8c19bba 100644
--- a/src/vnet/ppp/ppp.h
+++ b/src/vnet/ppp/ppp.h
@@ -42,7 +42,6 @@
#include <vnet/vnet.h>
#include <vnet/ppp/packet.h>
-#include <vnet/pg/pg.h>
extern vnet_hw_interface_class_t ppp_hw_interface_class;
@@ -106,17 +105,6 @@ unformat_function_t unformat_ppp_protocol_net_byte_order;
unformat_function_t unformat_ppp_header;
unformat_function_t unformat_pg_ppp_header;
-always_inline void
-ppp_setup_node (vlib_main_t * vm, u32 node_index)
-{
- vlib_node_t *n = vlib_get_node (vm, node_index);
- pg_node_t *pn = pg_get_node (node_index);
-
- n->format_buffer = format_ppp_header_with_length;
- n->unformat_buffer = unformat_ppp_header;
- pn->unformat_edit = unformat_pg_ppp_header;
-}
-
void
ppp_register_input_protocol (vlib_main_t * vm,
ppp_protocol_t protocol, u32 node_index);
diff --git a/src/vnet/snap/node.c b/src/vnet/snap/node.c
index 9baa75002cb..2a42907321c 100644
--- a/src/vnet/snap/node.c
+++ b/src/vnet/snap/node.c
@@ -284,6 +284,17 @@ VLIB_REGISTER_NODE (snap_input_node) = {
};
/* *INDENT-ON* */
+static void
+snap_setup_node (vlib_main_t *vm, u32 node_index)
+{
+ vlib_node_t *n = vlib_get_node (vm, node_index);
+ pg_node_t *pn = pg_get_node (node_index);
+
+ n->format_buffer = format_snap_header_with_length;
+ n->unformat_buffer = unformat_snap_header;
+ pn->unformat_edit = unformat_pg_snap_header;
+}
+
static clib_error_t *
snap_input_init (vlib_main_t * vm)
{
diff --git a/src/vnet/snap/snap.h b/src/vnet/snap/snap.h
index 08c3a8b9c18..f6b3be1847f 100644
--- a/src/vnet/snap/snap.h
+++ b/src/vnet/snap/snap.h
@@ -41,7 +41,6 @@
#define included_snap_h
#include <vnet/vnet.h>
-#include <vnet/pg/pg.h>
#define foreach_ieee_oui \
_ (0x000000, ethernet) \
@@ -184,17 +183,6 @@ unformat_function_t unformat_snap_protocol;
unformat_function_t unformat_snap_header;
unformat_function_t unformat_pg_snap_header;
-always_inline void
-snap_setup_node (vlib_main_t * vm, u32 node_index)
-{
- vlib_node_t *n = vlib_get_node (vm, node_index);
- pg_node_t *pn = pg_get_node (node_index);
-
- n->format_buffer = format_snap_header_with_length;
- n->unformat_buffer = unformat_snap_header;
- pn->unformat_edit = unformat_pg_snap_header;
-}
-
#endif /* included_snap_h */
/*
diff --git a/src/vnet/srp/node.c b/src/vnet/srp/node.c
index 926cb7cb45c..12c14012b61 100644
--- a/src/vnet/srp/node.c
+++ b/src/vnet/srp/node.c
@@ -40,6 +40,7 @@
#include <vlib/vlib.h>
#include <vnet/ip/ip_packet.h> /* for ip_csum_fold */
#include <vnet/srp/srp.h>
+#include <vnet/pg/pg.h>
srp_main_t srp_main;
@@ -861,6 +862,16 @@ vlib_node_registration_t srp_ips_process_node = {
.state = VLIB_NODE_STATE_DISABLED,
};
+static void
+srp_setup_node (vlib_main_t *vm, u32 node_index)
+{
+ vlib_node_t *n = vlib_get_node (vm, node_index);
+ pg_node_t *pn = pg_get_node (node_index);
+ n->format_buffer = format_srp_header_with_length;
+ n->unformat_buffer = unformat_srp_header;
+ pn->unformat_edit = unformat_pg_srp_header;
+}
+
static clib_error_t * srp_init (vlib_main_t * vm)
{
srp_main_t * sm = &srp_main;
diff --git a/src/vnet/srp/srp.h b/src/vnet/srp/srp.h
index 8f59e064c8b..2873d5a2184 100644
--- a/src/vnet/srp/srp.h
+++ b/src/vnet/srp/srp.h
@@ -43,7 +43,6 @@
#include <vnet/vnet.h>
#include <vnet/srp/packet.h>
#include <vnet/ethernet/ethernet.h>
-#include <vnet/pg/pg.h>
extern vnet_hw_interface_class_t srp_hw_interface_class;
@@ -189,16 +188,6 @@ unformat_srp_header (unformat_input_t * input, va_list * args);
uword unformat_pg_srp_header (unformat_input_t * input, va_list * args);
-always_inline void
-srp_setup_node (vlib_main_t * vm, u32 node_index)
-{
- vlib_node_t * n = vlib_get_node (vm, node_index);
- pg_node_t * pn = pg_get_node (node_index);
- n->format_buffer = format_srp_header_with_length;
- n->unformat_buffer = unformat_srp_header;
- pn->unformat_edit = unformat_pg_srp_header;
-}
-
#define foreach_srp_error \
_ (NONE, "no error") \
_ (UNKNOWN_MODE, "unknown mode in SRP header") \