summaryrefslogtreecommitdiffstats
path: root/src/vnet/interface_output.c
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2021-02-10 11:26:24 +0100
committerDamjan Marion <dmarion@me.com>2021-02-15 20:32:56 +0000
commit6809538e646bf86c000dc1faba60b0a4157ad898 (patch)
tree18a228b96226932381f15e44b4972636de1c7fe1 /src/vnet/interface_output.c
parent99c6dc6a7a36c0be95da9afb3ad8830b24754d4e (diff)
vlib: refactor checksum offload support
Type: refactor This patch refactors the offload flags in vlib_buffer_t. There are two main reasons behind this refactoring. First, offload flags are insufficient to represent outer and inner headers offloads. Second, room for these flags in first cacheline of vlib_buffer_t is also limited. This patch introduces a generic offload flag in first cacheline. And detailed offload flags in 2nd cacheline of the structure for performance optimization. Change-Id: Icc363a142fb9208ec7113ab5bbfc8230181f6004 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vnet/interface_output.c')
-rw-r--r--src/vnet/interface_output.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/vnet/interface_output.c b/src/vnet/interface_output.c
index 3363f76b722..ff315f6abe0 100644
--- a/src/vnet/interface_output.c
+++ b/src/vnet/interface_output.c
@@ -337,28 +337,24 @@ vnet_interface_output_node_inline (vlib_main_t * vm,
if (do_tx_offloads)
{
- u32 vnet_buffer_offload_flags =
- (VNET_BUFFER_F_OFFLOAD_TCP_CKSUM |
- VNET_BUFFER_F_OFFLOAD_UDP_CKSUM |
- VNET_BUFFER_F_OFFLOAD_IP_CKSUM);
- if (or_flags & vnet_buffer_offload_flags)
+ if (or_flags & VNET_BUFFER_F_OFFLOAD)
{
- if (b[0]->flags & vnet_buffer_offload_flags)
+ if (b[0]->flags & VNET_BUFFER_F_OFFLOAD)
vnet_calc_checksums_inline
(vm, b[0],
b[0]->flags & VNET_BUFFER_F_IS_IP4,
b[0]->flags & VNET_BUFFER_F_IS_IP6);
- if (b[1]->flags & vnet_buffer_offload_flags)
+ if (b[1]->flags & VNET_BUFFER_F_OFFLOAD)
vnet_calc_checksums_inline
(vm, b[1],
b[1]->flags & VNET_BUFFER_F_IS_IP4,
b[1]->flags & VNET_BUFFER_F_IS_IP6);
- if (b[2]->flags & vnet_buffer_offload_flags)
+ if (b[2]->flags & VNET_BUFFER_F_OFFLOAD)
vnet_calc_checksums_inline
(vm, b[2],
b[2]->flags & VNET_BUFFER_F_IS_IP4,
b[2]->flags & VNET_BUFFER_F_IS_IP6);
- if (b[3]->flags & vnet_buffer_offload_flags)
+ if (b[3]->flags & VNET_BUFFER_F_OFFLOAD)
vnet_calc_checksums_inline
(vm, b[3],
b[3]->flags & VNET_BUFFER_F_IS_IP4,
@@ -406,10 +402,7 @@ vnet_interface_output_node_inline (vlib_main_t * vm,
if (do_tx_offloads)
{
- if (b[0]->flags &
- (VNET_BUFFER_F_OFFLOAD_TCP_CKSUM |
- VNET_BUFFER_F_OFFLOAD_UDP_CKSUM |
- VNET_BUFFER_F_OFFLOAD_IP_CKSUM))
+ if (b[0]->flags & VNET_BUFFER_F_OFFLOAD)
vnet_calc_checksums_inline
(vm, b[0],
b[0]->flags & VNET_BUFFER_F_IS_IP4,