aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2017-07-13 21:19:27 +0200
committerDave Barach <openvpp@barachs.net>2017-07-14 15:41:57 +0000
commit213b5aae860c2a9d5de8d4d070d0d2091af699f5 (patch)
treecd86f1ed8a60340b477022dc545835e62c14a867 /src/plugins
parent072401e8096c648b91f958bd911f64ce24fecff9 (diff)
vnet_buffer_t flags cleanup
Change-Id: I123eccea98abafeb31f25d2a162501e2eded60d4 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins')
-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
3 files changed, 19 insertions, 18 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;