aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsrc/plugins/dpdk/device/init.c7
-rw-r--r--src/plugins/gtpu/gtpu_decap.c18
-rw-r--r--src/plugins/ixge/ixge.c12
-rw-r--r--src/vnet/bfd/bfd_udp.c4
-rw-r--r--src/vnet/buffer.h49
-rw-r--r--src/vnet/ethernet/ethernet.h14
-rw-r--r--src/vnet/handoff.c2
-rw-r--r--src/vnet/ip/icmp4.c6
-rwxr-xr-xsrc/vnet/ip/ip4_forward.c38
-rw-r--r--src/vnet/ip/ip6_forward.c44
-rw-r--r--src/vnet/ip/ip6_neighbor.c4
-rw-r--r--src/vnet/session/node.c2
-rw-r--r--src/vnet/span/node.c4
-rw-r--r--src/vnet/tcp/tcp_output.c8
-rw-r--r--src/vnet/vxlan-gpe/decap.c18
-rw-r--r--src/vnet/vxlan/decap.c18
16 files changed, 127 insertions, 121 deletions
diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c
index 2ec1664b18d..7ca3d358403 100755
--- a/src/plugins/dpdk/device/init.c
+++ b/src/plugins/dpdk/device/init.c
@@ -196,8 +196,8 @@ dpdk_lib_init (dpdk_main_t * dm)
"dpdk rx");
if (dm->conf->enable_tcp_udp_checksum)
- dm->buffer_flags_template &= ~(IP_BUFFER_L4_CHECKSUM_CORRECT
- | IP_BUFFER_L4_CHECKSUM_COMPUTED);
+ dm->buffer_flags_template &= ~(VNET_BUFFER_F_L4_CHECKSUM_CORRECT
+ | VNET_BUFFER_F_L4_CHECKSUM_COMPUTED);
/* vlib_buffer_t template */
vec_validate_aligned (dm->buffer_templates, tm->n_vlib_mains - 1,
@@ -1544,7 +1544,8 @@ dpdk_init (vlib_main_t * vm)
/* Default vlib_buffer_t flags, DISABLES tcp/udp checksumming... */
dm->buffer_flags_template =
(VLIB_BUFFER_TOTAL_LENGTH_VALID | VLIB_BUFFER_EXT_HDR_VALID
- | IP_BUFFER_L4_CHECKSUM_COMPUTED | IP_BUFFER_L4_CHECKSUM_CORRECT);
+ | VNET_BUFFER_F_L4_CHECKSUM_COMPUTED |
+ VNET_BUFFER_F_L4_CHECKSUM_CORRECT);
dm->stat_poll_interval = DPDK_STATS_POLL_INTERVAL;
dm->link_state_poll_interval = DPDK_LINK_POLL_INTERVAL;
diff --git a/src/plugins/gtpu/gtpu_decap.c b/src/plugins/gtpu/gtpu_decap.c
index fc74e7cba91..de235889073 100644
--- a/src/plugins/gtpu/gtpu_decap.c
+++ b/src/plugins/gtpu/gtpu_decap.c
@@ -982,7 +982,7 @@ ip_gtpu_bypass_inline (vlib_main_t * vm,
}
flags0 = b0->flags;
- good_udp0 = (flags0 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0;
+ good_udp0 = (flags0 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
/* Don't verify UDP checksum for packets with explicit zero checksum. */
good_udp0 |= udp0->checksum == 0;
@@ -998,14 +998,14 @@ ip_gtpu_bypass_inline (vlib_main_t * vm,
/* Verify UDP checksum */
if (PREDICT_FALSE (!good_udp0))
{
- if ((flags0 & IP_BUFFER_L4_CHECKSUM_COMPUTED) == 0)
+ if ((flags0 & VNET_BUFFER_F_L4_CHECKSUM_COMPUTED) == 0)
{
if (is_ip4)
flags0 = ip4_tcp_udp_validate_checksum (vm, b0);
else
flags0 = ip6_tcp_udp_icmp_validate_checksum (vm, b0);
good_udp0 =
- (flags0 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0;
+ (flags0 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
}
}
@@ -1064,7 +1064,7 @@ ip_gtpu_bypass_inline (vlib_main_t * vm,
}
flags1 = b1->flags;
- good_udp1 = (flags1 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0;
+ good_udp1 = (flags1 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
/* Don't verify UDP checksum for packets with explicit zero checksum. */
good_udp1 |= udp1->checksum == 0;
@@ -1080,14 +1080,14 @@ ip_gtpu_bypass_inline (vlib_main_t * vm,
/* Verify UDP checksum */
if (PREDICT_FALSE (!good_udp1))
{
- if ((flags1 & IP_BUFFER_L4_CHECKSUM_COMPUTED) == 0)
+ if ((flags1 & VNET_BUFFER_F_L4_CHECKSUM_COMPUTED) == 0)
{
if (is_ip4)
flags1 = ip4_tcp_udp_validate_checksum (vm, b1);
else
flags1 = ip6_tcp_udp_icmp_validate_checksum (vm, b1);
good_udp1 =
- (flags1 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0;
+ (flags1 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
}
}
@@ -1182,7 +1182,7 @@ ip_gtpu_bypass_inline (vlib_main_t * vm,
}
flags0 = b0->flags;
- good_udp0 = (flags0 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0;
+ good_udp0 = (flags0 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
/* Don't verify UDP checksum for packets with explicit zero checksum. */
good_udp0 |= udp0->checksum == 0;
@@ -1198,14 +1198,14 @@ ip_gtpu_bypass_inline (vlib_main_t * vm,
/* Verify UDP checksum */
if (PREDICT_FALSE (!good_udp0))
{
- if ((flags0 & IP_BUFFER_L4_CHECKSUM_COMPUTED) == 0)
+ if ((flags0 & VNET_BUFFER_F_L4_CHECKSUM_COMPUTED) == 0)
{
if (is_ip4)
flags0 = ip4_tcp_udp_validate_checksum (vm, b0);
else
flags0 = ip6_tcp_udp_icmp_validate_checksum (vm, b0);
good_udp0 =
- (flags0 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0;
+ (flags0 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
}
}
diff --git a/src/plugins/ixge/ixge.c b/src/plugins/ixge/ixge.c
index 628d6d71bd7..e0150f41a70 100644
--- a/src/plugins/ixge/ixge.c
+++ b/src/plugins/ixge/ixge.c
@@ -656,11 +656,11 @@ ixge_rx_next_and_error_from_status_x1 (ixge_device_t * xd,
f0 = ((s02 & (IXGE_RX_DESCRIPTOR_STATUS2_IS_TCP_CHECKSUMMED
| IXGE_RX_DESCRIPTOR_STATUS2_IS_UDP_CHECKSUMMED))
- ? IP_BUFFER_L4_CHECKSUM_COMPUTED : 0);
+ ? VNET_BUFFER_F_L4_CHECKSUM_COMPUTED : 0);
f0 |= ((s02 & (IXGE_RX_DESCRIPTOR_STATUS2_TCP_CHECKSUM_ERROR
| IXGE_RX_DESCRIPTOR_STATUS2_UDP_CHECKSUM_ERROR))
- ? 0 : IP_BUFFER_L4_CHECKSUM_CORRECT);
+ ? 0 : VNET_BUFFER_F_L4_CHECKSUM_CORRECT);
*error0 = e0;
*next0 = n0;
@@ -715,17 +715,17 @@ ixge_rx_next_and_error_from_status_x2 (ixge_device_t * xd,
f0 = ((s02 & (IXGE_RX_DESCRIPTOR_STATUS2_IS_TCP_CHECKSUMMED
| IXGE_RX_DESCRIPTOR_STATUS2_IS_UDP_CHECKSUMMED))
- ? IP_BUFFER_L4_CHECKSUM_COMPUTED : 0);
+ ? VNET_BUFFER_F_L4_CHECKSUM_COMPUTED : 0);
f1 = ((s12 & (IXGE_RX_DESCRIPTOR_STATUS2_IS_TCP_CHECKSUMMED
| IXGE_RX_DESCRIPTOR_STATUS2_IS_UDP_CHECKSUMMED))
- ? IP_BUFFER_L4_CHECKSUM_COMPUTED : 0);
+ ? VNET_BUFFER_F_L4_CHECKSUM_COMPUTED : 0);
f0 |= ((s02 & (IXGE_RX_DESCRIPTOR_STATUS2_TCP_CHECKSUM_ERROR
| IXGE_RX_DESCRIPTOR_STATUS2_UDP_CHECKSUM_ERROR))
- ? 0 : IP_BUFFER_L4_CHECKSUM_CORRECT);
+ ? 0 : VNET_BUFFER_F_L4_CHECKSUM_CORRECT);
f1 |= ((s12 & (IXGE_RX_DESCRIPTOR_STATUS2_TCP_CHECKSUM_ERROR
| IXGE_RX_DESCRIPTOR_STATUS2_UDP_CHECKSUM_ERROR))
- ? 0 : IP_BUFFER_L4_CHECKSUM_CORRECT);
+ ? 0 : VNET_BUFFER_F_L4_CHECKSUM_CORRECT);
*flags0 = f0;
*flags1 = f1;
diff --git a/src/vnet/bfd/bfd_udp.c b/src/vnet/bfd/bfd_udp.c
index 06b843c6e95..533d98d6865 100644
--- a/src/vnet/bfd/bfd_udp.c
+++ b/src/vnet/bfd/bfd_udp.c
@@ -246,7 +246,7 @@ bfd_add_udp4_transport (vlib_main_t * vm, u32 bi, const bfd_session_t * bs,
const bfd_udp_key_t *key = &bus->key;
vlib_buffer_t *b = vlib_get_buffer (vm, bi);
- b->flags |= VNET_BUFFER_LOCALLY_ORIGINATED;
+ b->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
vnet_buffer (b)->ip.adj_index[VLIB_RX] = bus->adj_index;
vnet_buffer (b)->ip.adj_index[VLIB_TX] = bus->adj_index;
vnet_buffer (b)->sw_if_index[VLIB_RX] = 0;
@@ -301,7 +301,7 @@ bfd_add_udp6_transport (vlib_main_t * vm, u32 bi, const bfd_session_t * bs,
const bfd_udp_key_t *key = &bus->key;
vlib_buffer_t *b = vlib_get_buffer (vm, bi);
- b->flags |= VNET_BUFFER_LOCALLY_ORIGINATED;
+ b->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
vnet_buffer (b)->ip.adj_index[VLIB_RX] = bus->adj_index;
vnet_buffer (b)->ip.adj_index[VLIB_TX] = bus->adj_index;
vnet_buffer (b)->sw_if_index[VLIB_RX] = 0;
diff --git a/src/vnet/buffer.h b/src/vnet/buffer.h
index 8647db005f4..52dada30ba8 100644
--- a/src/vnet/buffer.h
+++ b/src/vnet/buffer.h
@@ -42,33 +42,32 @@
#include <vlib/vlib.h>
-/* VLIB buffer flags for ip4/ip6 packets. Set by input interfaces for ip4/ip6
- tcp/udp packets with hardware computed checksums. */
-#define LOG2_IP_BUFFER_L4_CHECKSUM_COMPUTED LOG2_VLIB_BUFFER_FLAG_USER(1)
-#define LOG2_IP_BUFFER_L4_CHECKSUM_CORRECT LOG2_VLIB_BUFFER_FLAG_USER(2)
-#define IP_BUFFER_L4_CHECKSUM_COMPUTED (1 << LOG2_IP_BUFFER_L4_CHECKSUM_COMPUTED)
-#define IP_BUFFER_L4_CHECKSUM_CORRECT (1 << LOG2_IP_BUFFER_L4_CHECKSUM_CORRECT)
-
-/* VLAN header flags.
- * These bits are zeroed in vlib_buffer_init_for_free_list()
- * meaning wherever the buffer comes from they have a reasonable
- * value (eg, if ip4/ip6 generates the packet.)
- */
-#define LOG2_ETH_BUFFER_VLAN_2_DEEP LOG2_VLIB_BUFFER_FLAG_USER(3)
-#define LOG2_ETH_BUFFER_VLAN_1_DEEP LOG2_VLIB_BUFFER_FLAG_USER(4)
-#define ETH_BUFFER_VLAN_2_DEEP (1 << LOG2_ETH_BUFFER_VLAN_2_DEEP)
-#define ETH_BUFFER_VLAN_1_DEEP (1 << LOG2_ETH_BUFFER_VLAN_1_DEEP)
-#define ETH_BUFFER_VLAN_BITS (ETH_BUFFER_VLAN_1_DEEP | \
- ETH_BUFFER_VLAN_2_DEEP)
-
-#define LOG2_BUFFER_HANDOFF_NEXT_VALID LOG2_VLIB_BUFFER_FLAG_USER(6)
-#define BUFFER_HANDOFF_NEXT_VALID (1 << LOG2_BUFFER_HANDOFF_NEXT_VALID)
+#define foreach_vnet_buffer_field \
+ _( 1, L4_CHECKSUM_COMPUTED) \
+ _( 2, L4_CHECKSUM_CORRECT) \
+ _( 3, VLAN_2_DEEP) \
+ _( 4, VLAN_1_DEEP) \
+ _( 6, HANDOFF_NEXT_VALID) \
+ _( 7, LOCALLY_ORIGINATED) \
+ _( 8, SPAN_CLONE)
+
+#define VNET_BUFFER_FLAGS_VLAN_BITS \
+ (VNET_BUFFER_F_VLAN_1_DEEP | VNET_BUFFER_F_VLAN_2_DEEP)
+
+enum
+{
+#define _(bit, name) VNET_BUFFER_F_##name = (1 << LOG2_VLIB_BUFFER_FLAG_USER(bit)),
+ foreach_vnet_buffer_field
+#undef _
+};
-#define LOG2_VNET_BUFFER_LOCALLY_ORIGINATED LOG2_VLIB_BUFFER_FLAG_USER(7)
-#define VNET_BUFFER_LOCALLY_ORIGINATED (1 << LOG2_VNET_BUFFER_LOCALLY_ORIGINATED)
+enum
+{
+#define _(bit, name) VNET_BUFFER_F_LOG2_##name = LOG2_VLIB_BUFFER_FLAG_USER(bit),
+ foreach_vnet_buffer_field
+#undef _
+};
-#define LOG2_VNET_BUFFER_SPAN_CLONE LOG2_VLIB_BUFFER_FLAG_USER(8)
-#define VNET_BUFFER_SPAN_CLONE (1 << LOG2_VNET_BUFFER_SPAN_CLONE)
#define foreach_buffer_opaque_union_subtype \
_(ip) \
diff --git a/src/vnet/ethernet/ethernet.h b/src/vnet/ethernet/ethernet.h
index 2fc5b804dc3..d9ab8c10508 100644
--- a/src/vnet/ethernet/ethernet.h
+++ b/src/vnet/ethernet/ethernet.h
@@ -352,7 +352,7 @@ ethernet_buffer_get_header (vlib_buffer_t * b)
* the number of headers is not known.
*/
#define ethernet_buffer_get_vlan_count(b) ( \
- ((b)->flags & ETH_BUFFER_VLAN_BITS) >> LOG2_ETH_BUFFER_VLAN_1_DEEP \
+ ((b)->flags & VNET_BUFFER_FLAGS_VLAN_BITS) >> VNET_BUFFER_F_LOG2_VLAN_1_DEEP \
)
/** Sets the number of VLAN headers in the current Ethernet frame in the
@@ -360,8 +360,8 @@ ethernet_buffer_get_header (vlib_buffer_t * b)
* the number of headers is not known.
*/
#define ethernet_buffer_set_vlan_count(b, v) ( \
- (b)->flags = ((b)->flags & ~ETH_BUFFER_VLAN_BITS) | \
- (((v) << LOG2_ETH_BUFFER_VLAN_1_DEEP) & ETH_BUFFER_VLAN_BITS) \
+ (b)->flags = ((b)->flags & ~VNET_BUFFER_FLAGS_VLAN_BITS) | \
+ (((v) << VNET_BUFFER_F_LOG2_VLAN_1_DEEP) & VNET_BUFFER_FLAGS_VLAN_BITS) \
)
/** Adjusts the vlan count by the delta in 'v' */
@@ -372,10 +372,10 @@ ethernet_buffer_get_header (vlib_buffer_t * b)
/** Adjusts the vlan count by the header size byte delta in 'v' */
#define ethernet_buffer_adjust_vlan_count_by_bytes(b, v) ( \
- (b)->flags = ((b)->flags & ~ETH_BUFFER_VLAN_BITS) | (( \
- ((b)->flags & ETH_BUFFER_VLAN_BITS) + \
- ((v) << (LOG2_ETH_BUFFER_VLAN_1_DEEP - 2)) \
- ) & ETH_BUFFER_VLAN_BITS) \
+ (b)->flags = ((b)->flags & ~VNET_BUFFER_FLAGS_VLAN_BITS) | (( \
+ ((b)->flags & VNET_BUFFER_FLAGS_VLAN_BITS) + \
+ ((v) << (VNET_BUFFER_F_LOG2_VLAN_1_DEEP - 2)) \
+ ) & VNET_BUFFER_FLAGS_VLAN_BITS) \
)
/**
diff --git a/src/vnet/handoff.c b/src/vnet/handoff.c
index 9f3c93b4b70..81cb9f55fba 100644
--- a/src/vnet/handoff.c
+++ b/src/vnet/handoff.c
@@ -130,7 +130,7 @@ worker_handoff_node_fn (vlib_main_t * vm,
/* if input node did not specify next index, then packet
should go to eternet-input */
- if (PREDICT_FALSE ((b0->flags & BUFFER_HANDOFF_NEXT_VALID) == 0))
+ if (PREDICT_FALSE ((b0->flags & VNET_BUFFER_F_HANDOFF_NEXT_VALID) == 0))
vnet_buffer (b0)->handoff.next_index =
HANDOFF_DISPATCH_NEXT_ETHERNET_INPUT;
else if (vnet_buffer (b0)->handoff.next_index ==
diff --git a/src/vnet/ip/icmp4.c b/src/vnet/ip/icmp4.c
index c3afff72f26..bbeab32b6a5 100644
--- a/src/vnet/ip/icmp4.c
+++ b/src/vnet/ip/icmp4.c
@@ -336,8 +336,8 @@ ip4_icmp_echo_request (vlib_main_t * vm,
ASSERT (ip0->checksum == ip4_header_checksum (ip0));
ASSERT (ip1->checksum == ip4_header_checksum (ip1));
- p0->flags |= VNET_BUFFER_LOCALLY_ORIGINATED;
- p1->flags |= VNET_BUFFER_LOCALLY_ORIGINATED;
+ p0->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
+ p1->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
}
while (n_left_from > 0 && n_left_to_next > 0)
@@ -392,7 +392,7 @@ ip4_icmp_echo_request (vlib_main_t * vm,
ASSERT (ip0->checksum == ip4_header_checksum (ip0));
- p0->flags |= VNET_BUFFER_LOCALLY_ORIGINATED;
+ p0->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
}
vlib_put_next_frame (vm, node, next, n_left_to_next);
diff --git a/src/vnet/ip/ip4_forward.c b/src/vnet/ip/ip4_forward.c
index b8dfa8474eb..8dd927d4afd 100755
--- a/src/vnet/ip/ip4_forward.c
+++ b/src/vnet/ip/ip4_forward.c
@@ -1509,15 +1509,15 @@ ip4_tcp_udp_validate_checksum (vlib_main_t * vm, vlib_buffer_t * p0)
udp0 = (void *) (ip0 + 1);
if (ip0->protocol == IP_PROTOCOL_UDP && udp0->checksum == 0)
{
- p0->flags |= (IP_BUFFER_L4_CHECKSUM_COMPUTED
- | IP_BUFFER_L4_CHECKSUM_CORRECT);
+ p0->flags |= (VNET_BUFFER_F_L4_CHECKSUM_COMPUTED
+ | VNET_BUFFER_F_L4_CHECKSUM_CORRECT);
return p0->flags;
}
sum16 = ip4_tcp_udp_compute_checksum (vm, p0, ip0);
- p0->flags |= (IP_BUFFER_L4_CHECKSUM_COMPUTED
- | ((sum16 == 0) << LOG2_IP_BUFFER_L4_CHECKSUM_CORRECT));
+ p0->flags |= (VNET_BUFFER_F_L4_CHECKSUM_COMPUTED
+ | ((sum16 == 0) << VNET_BUFFER_F_LOG2_L4_CHECKSUM_CORRECT));
return p0->flags;
}
@@ -1629,8 +1629,8 @@ ip4_local_inline (vlib_main_t * vm,
flags0 = p0->flags;
flags1 = p1->flags;
- good_tcp_udp0 = (flags0 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0;
- good_tcp_udp1 = (flags1 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0;
+ good_tcp_udp0 = (flags0 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
+ good_tcp_udp1 = (flags1 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
udp0 = ip4_next_header (ip0);
udp1 = ip4_next_header (ip1);
@@ -1657,19 +1657,19 @@ ip4_local_inline (vlib_main_t * vm,
if (is_tcp_udp0)
{
if (is_tcp_udp0
- && !(flags0 & IP_BUFFER_L4_CHECKSUM_COMPUTED))
+ && !(flags0 & VNET_BUFFER_F_L4_CHECKSUM_COMPUTED))
flags0 = ip4_tcp_udp_validate_checksum (vm, p0);
good_tcp_udp0 =
- (flags0 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0;
+ (flags0 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
good_tcp_udp0 |= is_udp0 && udp0->checksum == 0;
}
if (is_tcp_udp1)
{
if (is_tcp_udp1
- && !(flags1 & IP_BUFFER_L4_CHECKSUM_COMPUTED))
+ && !(flags1 & VNET_BUFFER_F_L4_CHECKSUM_COMPUTED))
flags1 = ip4_tcp_udp_validate_checksum (vm, p1);
good_tcp_udp1 =
- (flags1 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0;
+ (flags1 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
good_tcp_udp1 |= is_udp1 && udp1->checksum == 0;
}
}
@@ -1817,7 +1817,7 @@ ip4_local_inline (vlib_main_t * vm,
flags0 = p0->flags;
- good_tcp_udp0 = (flags0 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0;
+ good_tcp_udp0 = (flags0 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
udp0 = ip4_next_header (ip0);
@@ -1837,10 +1837,10 @@ ip4_local_inline (vlib_main_t * vm,
if (is_tcp_udp0)
{
if (is_tcp_udp0
- && !(flags0 & IP_BUFFER_L4_CHECKSUM_COMPUTED))
+ && !(flags0 & VNET_BUFFER_F_L4_CHECKSUM_COMPUTED))
flags0 = ip4_tcp_udp_validate_checksum (vm, p0);
good_tcp_udp0 =
- (flags0 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0;
+ (flags0 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
good_tcp_udp0 |= is_udp0 && udp0->checksum == 0;
}
}
@@ -2428,7 +2428,7 @@ ip4_rewrite_inline (vlib_main_t * vm,
/* Decrement TTL & update checksum.
Works either endian, so no need for byte swap. */
- if (PREDICT_TRUE (!(p0->flags & VNET_BUFFER_LOCALLY_ORIGINATED)))
+ if (PREDICT_TRUE (!(p0->flags & VNET_BUFFER_F_LOCALLY_ORIGINATED)))
{
i32 ttl0 = ip0->ttl;
@@ -2461,9 +2461,9 @@ ip4_rewrite_inline (vlib_main_t * vm,
}
else
{
- p0->flags &= ~VNET_BUFFER_LOCALLY_ORIGINATED;
+ p0->flags &= ~VNET_BUFFER_F_LOCALLY_ORIGINATED;
}
- if (PREDICT_TRUE (!(p1->flags & VNET_BUFFER_LOCALLY_ORIGINATED)))
+ if (PREDICT_TRUE (!(p1->flags & VNET_BUFFER_F_LOCALLY_ORIGINATED)))
{
i32 ttl1 = ip1->ttl;
@@ -2496,7 +2496,7 @@ ip4_rewrite_inline (vlib_main_t * vm,
}
else
{
- p1->flags &= ~VNET_BUFFER_LOCALLY_ORIGINATED;
+ p1->flags &= ~VNET_BUFFER_F_LOCALLY_ORIGINATED;
}
/* Rewrite packet header and updates lengths. */
@@ -2614,7 +2614,7 @@ ip4_rewrite_inline (vlib_main_t * vm,
next0 = IP4_REWRITE_NEXT_DROP; /* drop on error */
/* Decrement TTL & update checksum. */
- if (PREDICT_TRUE (!(p0->flags & VNET_BUFFER_LOCALLY_ORIGINATED)))
+ if (PREDICT_TRUE (!(p0->flags & VNET_BUFFER_F_LOCALLY_ORIGINATED)))
{
i32 ttl0 = ip0->ttl;
@@ -2648,7 +2648,7 @@ ip4_rewrite_inline (vlib_main_t * vm,
}
else
{
- p0->flags &= ~VNET_BUFFER_LOCALLY_ORIGINATED;
+ p0->flags &= ~VNET_BUFFER_F_LOCALLY_ORIGINATED;
}
if (do_counters)
diff --git a/src/vnet/ip/ip6_forward.c b/src/vnet/ip/ip6_forward.c
index 2b8c2bd2f7c..604e14924f9 100644
--- a/src/vnet/ip/ip6_forward.c
+++ b/src/vnet/ip/ip6_forward.c
@@ -1284,15 +1284,15 @@ ip6_tcp_udp_icmp_validate_checksum (vlib_main_t * vm, vlib_buffer_t * p0)
udp0 = (void *) (ip0 + 1);
if (ip0->protocol == IP_PROTOCOL_UDP && udp0->checksum == 0)
{
- p0->flags |= (IP_BUFFER_L4_CHECKSUM_COMPUTED
- | IP_BUFFER_L4_CHECKSUM_CORRECT);
+ p0->flags |= (VNET_BUFFER_F_L4_CHECKSUM_COMPUTED
+ | VNET_BUFFER_F_L4_CHECKSUM_CORRECT);
return p0->flags;
}
sum16 = ip6_tcp_udp_icmp_compute_checksum (vm, p0, ip0, &bogus_length);
- p0->flags |= (IP_BUFFER_L4_CHECKSUM_COMPUTED
- | ((sum16 == 0) << LOG2_IP_BUFFER_L4_CHECKSUM_CORRECT));
+ p0->flags |= (VNET_BUFFER_F_L4_CHECKSUM_COMPUTED
+ | ((sum16 == 0) << VNET_BUFFER_F_LOG2_L4_CHECKSUM_CORRECT));
return p0->flags;
}
@@ -1374,8 +1374,10 @@ ip6_local (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
flags0 = p0->flags;
flags1 = p1->flags;
- good_l4_checksum0 = (flags0 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0;
- good_l4_checksum1 = (flags1 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0;
+ good_l4_checksum0 =
+ (flags0 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
+ good_l4_checksum1 =
+ (flags1 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
len_diff0 = 0;
len_diff1 = 0;
@@ -1414,19 +1416,21 @@ ip6_local (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
if (PREDICT_FALSE (type0 != IP_BUILTIN_PROTOCOL_UNKNOWN
&& !good_l4_checksum0
- && !(flags0 & IP_BUFFER_L4_CHECKSUM_COMPUTED)))
+ && !(flags0 &
+ VNET_BUFFER_F_L4_CHECKSUM_COMPUTED)))
{
flags0 = ip6_tcp_udp_icmp_validate_checksum (vm, p0);
good_l4_checksum0 =
- (flags0 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0;
+ (flags0 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
}
if (PREDICT_FALSE (type1 != IP_BUILTIN_PROTOCOL_UNKNOWN
&& !good_l4_checksum1
- && !(flags1 & IP_BUFFER_L4_CHECKSUM_COMPUTED)))
+ && !(flags1 &
+ VNET_BUFFER_F_L4_CHECKSUM_COMPUTED)))
{
flags1 = ip6_tcp_udp_icmp_validate_checksum (vm, p1);
good_l4_checksum1 =
- (flags1 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0;
+ (flags1 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
}
error0 = error1 = IP6_ERROR_UNKNOWN_PROTOCOL;
@@ -1500,7 +1504,8 @@ ip6_local (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
flags0 = p0->flags;
- good_l4_checksum0 = (flags0 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0;
+ good_l4_checksum0 =
+ (flags0 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
len_diff0 = 0;
if (PREDICT_TRUE (IP_PROTOCOL_UDP == ip6_locate_header (p0, ip0,
@@ -1522,11 +1527,12 @@ ip6_local (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
if (PREDICT_FALSE (type0 != IP_BUILTIN_PROTOCOL_UNKNOWN
&& !good_l4_checksum0
- && !(flags0 & IP_BUFFER_L4_CHECKSUM_COMPUTED)))
+ && !(flags0 &
+ VNET_BUFFER_F_L4_CHECKSUM_COMPUTED)))
{
flags0 = ip6_tcp_udp_icmp_validate_checksum (vm, p0);
good_l4_checksum0 =
- (flags0 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0;
+ (flags0 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
}
error0 = IP6_ERROR_UNKNOWN_PROTOCOL;
@@ -2019,7 +2025,7 @@ ip6_rewrite_inline (vlib_main_t * vm,
error0 = error1 = IP6_ERROR_NONE;
next0 = next1 = IP6_REWRITE_NEXT_DROP;
- if (PREDICT_TRUE (!(p0->flags & VNET_BUFFER_LOCALLY_ORIGINATED)))
+ if (PREDICT_TRUE (!(p0->flags & VNET_BUFFER_F_LOCALLY_ORIGINATED)))
{
i32 hop_limit0 = ip0->hop_limit;
@@ -2046,9 +2052,9 @@ ip6_rewrite_inline (vlib_main_t * vm,
}
else
{
- p0->flags &= ~VNET_BUFFER_LOCALLY_ORIGINATED;
+ p0->flags &= ~VNET_BUFFER_F_LOCALLY_ORIGINATED;
}
- if (PREDICT_TRUE (!(p1->flags & VNET_BUFFER_LOCALLY_ORIGINATED)))
+ if (PREDICT_TRUE (!(p1->flags & VNET_BUFFER_F_LOCALLY_ORIGINATED)))
{
i32 hop_limit1 = ip1->hop_limit;
@@ -2075,7 +2081,7 @@ ip6_rewrite_inline (vlib_main_t * vm,
}
else
{
- p1->flags &= ~VNET_BUFFER_LOCALLY_ORIGINATED;
+ p1->flags &= ~VNET_BUFFER_F_LOCALLY_ORIGINATED;
}
adj0 = adj_get (adj_index0);
adj1 = adj_get (adj_index1);
@@ -2186,7 +2192,7 @@ ip6_rewrite_inline (vlib_main_t * vm,
next0 = IP6_REWRITE_NEXT_DROP;
/* Check hop limit */
- if (PREDICT_TRUE (!(p0->flags & VNET_BUFFER_LOCALLY_ORIGINATED)))
+ if (PREDICT_TRUE (!(p0->flags & VNET_BUFFER_F_LOCALLY_ORIGINATED)))
{
i32 hop_limit0 = ip0->hop_limit;
@@ -2212,7 +2218,7 @@ ip6_rewrite_inline (vlib_main_t * vm,
}
else
{
- p0->flags &= ~VNET_BUFFER_LOCALLY_ORIGINATED;
+ p0->flags &= ~VNET_BUFFER_F_LOCALLY_ORIGINATED;
}
/* Guess we are only writing on simple Ethernet header. */
diff --git a/src/vnet/ip/ip6_neighbor.c b/src/vnet/ip/ip6_neighbor.c
index 68a8cbbc8d0..e8eebd4e869 100644
--- a/src/vnet/ip/ip6_neighbor.c
+++ b/src/vnet/ip/ip6_neighbor.c
@@ -1649,7 +1649,7 @@ icmp6_router_solicitation (vlib_main_t * vm,
adj_index0;
}
}
- p0->flags |= VNET_BUFFER_LOCALLY_ORIGINATED;
+ p0->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
radv_info->n_solicitations_dropped += is_dropped;
radv_info->n_solicitations_rcvd += is_solicitation;
@@ -2348,7 +2348,7 @@ ip6_neighbor_send_mldpv2_report (u32 sw_if_index)
vnet_main.local_interface_sw_if_index;
vnet_buffer (b0)->ip.adj_index[VLIB_TX] = radv_info->mcast_adj_index;
- b0->flags |= VNET_BUFFER_LOCALLY_ORIGINATED;
+ b0->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
vlib_node_t *node = vlib_get_node_by_name (vm, (u8 *) "ip6-rewrite-mcast");
diff --git a/src/vnet/session/node.c b/src/vnet/session/node.c
index 56e626379a5..983b78b86f7 100644
--- a/src/vnet/session/node.c
+++ b/src/vnet/session/node.c
@@ -256,7 +256,7 @@ session_tx_fifo_read_and_snd_i (vlib_main_t * vm, vlib_node_runtime_t * node,
b0 = vlib_get_buffer (vm, bi0);
b0->error = 0;
b0->flags = VLIB_BUFFER_TOTAL_LENGTH_VALID
- | VNET_BUFFER_LOCALLY_ORIGINATED;
+ | VNET_BUFFER_F_LOCALLY_ORIGINATED;
b0->current_data = 0;
b0->total_length_not_including_first_buffer = 0;
diff --git a/src/vnet/span/node.c b/src/vnet/span/node.c
index 2a43b6e3f1a..3a461b0a3d3 100644
--- a/src/vnet/span/node.c
+++ b/src/vnet/span/node.c
@@ -77,7 +77,7 @@ span_mirror (vlib_main_t * vm, vlib_node_runtime_t * node, u32 sw_if_index0,
return;
/* Don't do it again */
- if (PREDICT_FALSE (b0->flags & VNET_BUFFER_SPAN_CLONE))
+ if (PREDICT_FALSE (b0->flags & VNET_BUFFER_F_SPAN_CLONE))
return;
/* *INDENT-OFF* */
@@ -92,7 +92,7 @@ span_mirror (vlib_main_t * vm, vlib_node_runtime_t * node, u32 sw_if_index0,
if (PREDICT_TRUE(c0 != 0))
{
vnet_buffer (c0)->sw_if_index[VLIB_TX] = i;
- c0->flags |= VNET_BUFFER_SPAN_CLONE;
+ c0->flags |= VNET_BUFFER_F_SPAN_CLONE;
to_mirror_next[0] = vlib_get_buffer_index (vm, c0);
mirror_frames[i]->n_vectors++;
if (PREDICT_FALSE (b0->flags & VLIB_BUFFER_IS_TRACED))
diff --git a/src/vnet/tcp/tcp_output.c b/src/vnet/tcp/tcp_output.c
index b418e8baa54..f34eb797c77 100644
--- a/src/vnet/tcp/tcp_output.c
+++ b/src/vnet/tcp/tcp_output.c
@@ -585,7 +585,7 @@ tcp_enqueue_to_ip_lookup (vlib_main_t * vm, vlib_buffer_t * b, u32 bi,
u32 *to_next, next_index;
vlib_frame_t *f;
- b->flags |= VNET_BUFFER_LOCALLY_ORIGINATED;
+ b->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
b->error = 0;
/* Default FIB for now */
@@ -847,7 +847,7 @@ tcp_enqueue_to_output (vlib_main_t * vm, vlib_buffer_t * b, u32 bi, u8 is_ip4)
u32 *to_next, next_index;
vlib_frame_t *f;
- b->flags |= VNET_BUFFER_LOCALLY_ORIGINATED;
+ b->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
b->error = 0;
/* Decide where to send the packet */
@@ -1563,7 +1563,7 @@ tcp46_output_inline (vlib_main_t * vm,
vnet_buffer (b0)->sw_if_index[VLIB_RX] = 0;
vnet_buffer (b0)->sw_if_index[VLIB_TX] = ~0;
- b0->flags |= VNET_BUFFER_LOCALLY_ORIGINATED;
+ b0->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
done:
b0->error = node->errors[error0];
if (PREDICT_FALSE (b0->flags & VLIB_BUFFER_IS_TRACED))
@@ -1728,7 +1728,7 @@ tcp46_send_reset_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
done:
b0->error = node->errors[error0];
- b0->flags |= VNET_BUFFER_LOCALLY_ORIGINATED;
+ b0->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
if (PREDICT_FALSE (b0->flags & VLIB_BUFFER_IS_TRACED))
{
th0 = vlib_buffer_get_current (b0);
diff --git a/src/vnet/vxlan-gpe/decap.c b/src/vnet/vxlan-gpe/decap.c
index 075b0f51c99..1b3a8b00fc7 100644
--- a/src/vnet/vxlan-gpe/decap.c
+++ b/src/vnet/vxlan-gpe/decap.c
@@ -857,7 +857,7 @@ ip_vxlan_gpe_bypass_inline (vlib_main_t * vm,
}
flags0 = b0->flags;
- good_udp0 = (flags0 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0;
+ good_udp0 = (flags0 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
/* Don't verify UDP checksum for packets with explicit zero checksum. */
good_udp0 |= udp0->checksum == 0;
@@ -873,14 +873,14 @@ ip_vxlan_gpe_bypass_inline (vlib_main_t * vm,
/* Verify UDP checksum */
if (PREDICT_FALSE (!good_udp0))
{
- if ((flags0 & IP_BUFFER_L4_CHECKSUM_COMPUTED) == 0)
+ if ((flags0 & VNET_BUFFER_F_L4_CHECKSUM_COMPUTED) == 0)
{
if (is_ip4)
flags0 = ip4_tcp_udp_validate_checksum (vm, b0);
else
flags0 = ip6_tcp_udp_icmp_validate_checksum (vm, b0);
good_udp0 =
- (flags0 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0;
+ (flags0 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
}
}
@@ -939,7 +939,7 @@ ip_vxlan_gpe_bypass_inline (vlib_main_t * vm,
}
flags1 = b1->flags;
- good_udp1 = (flags1 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0;
+ good_udp1 = (flags1 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
/* Don't verify UDP checksum for packets with explicit zero checksum. */
good_udp1 |= udp1->checksum == 0;
@@ -955,14 +955,14 @@ ip_vxlan_gpe_bypass_inline (vlib_main_t * vm,
/* Verify UDP checksum */
if (PREDICT_FALSE (!good_udp1))
{
- if ((flags1 & IP_BUFFER_L4_CHECKSUM_COMPUTED) == 0)
+ if ((flags1 & VNET_BUFFER_F_L4_CHECKSUM_COMPUTED) == 0)
{
if (is_ip4)
flags1 = ip4_tcp_udp_validate_checksum (vm, b1);
else
flags1 = ip6_tcp_udp_icmp_validate_checksum (vm, b1);
good_udp1 =
- (flags1 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0;
+ (flags1 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
}
}
@@ -1055,7 +1055,7 @@ ip_vxlan_gpe_bypass_inline (vlib_main_t * vm,
}
flags0 = b0->flags;
- good_udp0 = (flags0 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0;
+ good_udp0 = (flags0 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
/* Don't verify UDP checksum for packets with explicit zero checksum. */
good_udp0 |= udp0->checksum == 0;
@@ -1071,14 +1071,14 @@ ip_vxlan_gpe_bypass_inline (vlib_main_t * vm,
/* Verify UDP checksum */
if (PREDICT_FALSE (!good_udp0))
{
- if ((flags0 & IP_BUFFER_L4_CHECKSUM_COMPUTED) == 0)
+ if ((flags0 & VNET_BUFFER_F_L4_CHECKSUM_COMPUTED) == 0)
{
if (is_ip4)
flags0 = ip4_tcp_udp_validate_checksum (vm, b0);
else
flags0 = ip6_tcp_udp_icmp_validate_checksum (vm, b0);
good_udp0 =
- (flags0 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0;
+ (flags0 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
}
}
diff --git a/src/vnet/vxlan/decap.c b/src/vnet/vxlan/decap.c
index 2acb1f6f20b..0dc89d3fe7e 100644
--- a/src/vnet/vxlan/decap.c
+++ b/src/vnet/vxlan/decap.c
@@ -916,7 +916,7 @@ ip_vxlan_bypass_inline (vlib_main_t * vm,
}
flags0 = b0->flags;
- good_udp0 = (flags0 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0;
+ good_udp0 = (flags0 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
/* Don't verify UDP checksum for packets with explicit zero checksum. */
good_udp0 |= udp0->checksum == 0;
@@ -932,14 +932,14 @@ ip_vxlan_bypass_inline (vlib_main_t * vm,
/* Verify UDP checksum */
if (PREDICT_FALSE (!good_udp0))
{
- if ((flags0 & IP_BUFFER_L4_CHECKSUM_COMPUTED) == 0)
+ if ((flags0 & VNET_BUFFER_F_L4_CHECKSUM_COMPUTED) == 0)
{
if (is_ip4)
flags0 = ip4_tcp_udp_validate_checksum (vm, b0);
else
flags0 = ip6_tcp_udp_icmp_validate_checksum (vm, b0);
good_udp0 =
- (flags0 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0;
+ (flags0 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
}
}
@@ -998,7 +998,7 @@ ip_vxlan_bypass_inline (vlib_main_t * vm,
}
flags1 = b1->flags;
- good_udp1 = (flags1 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0;
+ good_udp1 = (flags1 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
/* Don't verify UDP checksum for packets with explicit zero checksum. */
good_udp1 |= udp1->checksum == 0;
@@ -1014,14 +1014,14 @@ ip_vxlan_bypass_inline (vlib_main_t * vm,
/* Verify UDP checksum */
if (PREDICT_FALSE (!good_udp1))
{
- if ((flags1 & IP_BUFFER_L4_CHECKSUM_COMPUTED) == 0)
+ if ((flags1 & VNET_BUFFER_F_L4_CHECKSUM_COMPUTED) == 0)
{
if (is_ip4)
flags1 = ip4_tcp_udp_validate_checksum (vm, b1);
else
flags1 = ip6_tcp_udp_icmp_validate_checksum (vm, b1);
good_udp1 =
- (flags1 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0;
+ (flags1 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
}
}
@@ -1116,7 +1116,7 @@ ip_vxlan_bypass_inline (vlib_main_t * vm,
}
flags0 = b0->flags;
- good_udp0 = (flags0 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0;
+ good_udp0 = (flags0 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
/* Don't verify UDP checksum for packets with explicit zero checksum. */
good_udp0 |= udp0->checksum == 0;
@@ -1132,14 +1132,14 @@ ip_vxlan_bypass_inline (vlib_main_t * vm,
/* Verify UDP checksum */
if (PREDICT_FALSE (!good_udp0))
{
- if ((flags0 & IP_BUFFER_L4_CHECKSUM_COMPUTED) == 0)
+ if ((flags0 & VNET_BUFFER_F_L4_CHECKSUM_COMPUTED) == 0)
{
if (is_ip4)
flags0 = ip4_tcp_udp_validate_checksum (vm, b0);
else
flags0 = ip6_tcp_udp_icmp_validate_checksum (vm, b0);
good_udp0 =
- (flags0 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0;
+ (flags0 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
}
}