aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/rewrite.h
diff options
context:
space:
mode:
authorNeale Ranns <nranns@wasa-ucs-11.cisco.com>2017-03-15 12:34:25 -0400
committerDamjan Marion <dmarion.lists@gmail.com>2017-03-17 11:35:39 +0000
commitb069a6910aa2b95316ccdb5d9e5b95143b9dc7c0 (patch)
tree0fb3292c39de54a2d66778272fe197b319286f96 /src/vnet/rewrite.h
parentb85e43965ec9e23c4ae14b62f4bbfe839f75c427 (diff)
Cache a 'has-features' flag on the adjacency for faster access. Reclaim the node_index memeber from the rewrite for space - this is only used for formtting
before: ip4-rewrite * * * * 2.66e1 256.00 after: ip4-rewrite * * * * 2.40e1 256.00 Change-Id: Ic397150727cad38811564777419ad6bd26b8a3a6 Signed-off-by: Neale Ranns <nranns@wasa-ucs-11.cisco.com>
Diffstat (limited to 'src/vnet/rewrite.h')
-rw-r--r--src/vnet/rewrite.h30
1 files changed, 23 insertions, 7 deletions
diff --git a/src/vnet/rewrite.h b/src/vnet/rewrite.h
index ce2bce3a3c8..8435a726553 100644
--- a/src/vnet/rewrite.h
+++ b/src/vnet/rewrite.h
@@ -46,14 +46,22 @@
/* Consider using vector types for speed? */
typedef uword vnet_rewrite_data_t;
+/**
+ * Flags associated with the rewrite/adjacency
+ */
+typedef enum vnet_rewrite_flags_t_
+{
+ /**
+ * This adjacency/interface has output features configured
+ */
+ VNET_REWRITE_HAS_FEATURES = (1 << 0),
+} __attribute__ ((packed)) vnet_rewrite_flags_t;
+
/* *INDENT-OFF* */
typedef CLIB_PACKED (struct {
/* Interface to mark re-written packets with. */
u32 sw_if_index;
- /* Packet processing node where rewrite happens. */
- u32 node_index;
-
/* Next node to feed after packet rewrite is done. */
u16 next_index;
@@ -64,6 +72,11 @@ typedef CLIB_PACKED (struct {
Used for MTU check after packet rewrite. */
u16 max_l3_packet_bytes;
+ u16 unused1;
+ u8 unused2;
+
+ vnet_rewrite_flags_t flags;
+
/* When dynamically writing a multicast destination L2 addresss
* this is the offset within the address to start writing n
* bytes of the IP mcast address */
@@ -79,6 +92,13 @@ typedef CLIB_PACKED (struct {
}) vnet_rewrite_header_t;
/* *INDENT-ON* */
+/**
+ * At 16 bytes of rewrite herader we have enought space left for a IPv6
+ * (40 bytes) + LISP-GPE (8 bytes) in the cache line
+ */
+STATIC_ASSERT (sizeof (vnet_rewrite_header_t) <= 16,
+ "Rewrite header too big");
+
/*
Helper macro for declaring rewrite string w/ given max-size.
@@ -317,11 +337,7 @@ u8 *vnet_build_rewrite_for_sw_interface (struct vnet_main_t *vnm,
void vnet_update_adjacency_for_sw_interface (struct vnet_main_t *vnm,
u32 sw_if_index, u32 ai);
-/* Parser for unformat header & rewrite string. */
-unformat_function_t unformat_vnet_rewrite;
-
format_function_t format_vnet_rewrite;
-format_function_t format_vnet_rewrite_header;
serialize_function_t serialize_vnet_rewrite, unserialize_vnet_rewrite;