aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2021-10-14 12:21:16 +0000
committerDamjan Marion <dmarion@me.com>2021-10-28 18:02:28 +0000
commit8f3415dee376d53371b92293d8d10833ea53ca77 (patch)
treee59f501254f7dc822e2e448cee77232bad17733f /src/vnet
parente6709ff37dc0f3a58ed5ad98aace73fe801f1e9d (diff)
interface: refactor interface output node in different processing levels
Type: refactor Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I4f29e6118630146876b7f58f1afe6b6733401047
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/interface_output.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/vnet/interface_output.c b/src/vnet/interface_output.c
index c4a4b0f228d..723a3226251 100644
--- a/src/vnet/interface_output.c
+++ b/src/vnet/interface_output.c
@@ -175,8 +175,7 @@ static_always_inline uword
vnet_interface_output_node_inline (vlib_main_t *vm, u32 sw_if_index,
vlib_combined_counter_main_t *ccm,
vlib_buffer_t **b, u32 config_index, u8 arc,
- u32 n_left, int do_tx_offloads,
- int arc_or_subif)
+ u32 n_left, int processing_level)
{
u32 n_bytes = 0;
u32 n_bytes0, n_bytes1, n_bytes2, n_bytes3;
@@ -192,7 +191,7 @@ vnet_interface_output_node_inline (vlib_main_t *vm, u32 sw_if_index,
vlib_prefetch_buffer_header (b[6], LOAD);
vlib_prefetch_buffer_header (b[7], LOAD);
- if (do_tx_offloads)
+ if (processing_level >= 1)
or_flags = b[0]->flags | b[1]->flags | b[2]->flags | b[3]->flags;
/* Be grumpy about zero length buffers for benefit of
@@ -207,7 +206,7 @@ vnet_interface_output_node_inline (vlib_main_t *vm, u32 sw_if_index,
n_bytes += n_bytes2 = vlib_buffer_length_in_chain (vm, b[2]);
n_bytes += n_bytes3 = vlib_buffer_length_in_chain (vm, b[3]);
- if (arc_or_subif)
+ if (processing_level >= 2)
{
u32 tx_swif0, tx_swif1, tx_swif2, tx_swif3;
tx_swif0 = vnet_buffer (b[0])->sw_if_index[VLIB_TX];
@@ -241,7 +240,7 @@ vnet_interface_output_node_inline (vlib_main_t *vm, u32 sw_if_index,
}
}
- if (do_tx_offloads && (or_flags & VNET_BUFFER_F_OFFLOAD))
+ if (processing_level >= 1 && (or_flags & VNET_BUFFER_F_OFFLOAD))
{
vnet_interface_output_handle_offload (vm, b[0]);
vnet_interface_output_handle_offload (vm, b[1]);
@@ -261,7 +260,7 @@ vnet_interface_output_node_inline (vlib_main_t *vm, u32 sw_if_index,
n_bytes += n_bytes0 = vlib_buffer_length_in_chain (vm, b[0]);
- if (arc_or_subif)
+ if (processing_level >= 2)
{
u32 tx_swif0 = vnet_buffer (b[0])->sw_if_index[VLIB_TX];
@@ -275,7 +274,7 @@ vnet_interface_output_node_inline (vlib_main_t *vm, u32 sw_if_index,
vlib_increment_combined_counter (ccm, ti, tx_swif0, 1, n_bytes0);
}
- if (do_tx_offloads)
+ if (processing_level >= 1)
vnet_interface_output_handle_offload (vm, b[0]);
n_left -= 1;
@@ -483,16 +482,13 @@ VLIB_NODE_FN (vnet_interface_output_node)
if (do_tx_offloads == 0 && arc_or_subif == 0)
n_bytes = vnet_interface_output_node_inline (
- vm, sw_if_index, ccm, bufs, config_index, arc, n_buffers, 0, 0);
- else if (do_tx_offloads == 0 && arc_or_subif == 1)
- n_bytes = vnet_interface_output_node_inline (
- vm, sw_if_index, ccm, bufs, config_index, arc, n_buffers, 0, 1);
+ vm, sw_if_index, ccm, bufs, config_index, arc, n_buffers, 0);
else if (do_tx_offloads == 1 && arc_or_subif == 0)
n_bytes = vnet_interface_output_node_inline (
- vm, sw_if_index, ccm, bufs, config_index, arc, n_buffers, 1, 0);
+ vm, sw_if_index, ccm, bufs, config_index, arc, n_buffers, 1);
else
n_bytes = vnet_interface_output_node_inline (
- vm, sw_if_index, ccm, bufs, config_index, arc, n_buffers, 1, 1);
+ vm, sw_if_index, ccm, bufs, config_index, arc, n_buffers, 2);
from = vlib_frame_vector_args (frame);
if (PREDICT_TRUE (next_index == VNET_INTERFACE_OUTPUT_NEXT_TX))