summaryrefslogtreecommitdiffstats
path: root/src/vnet/ipsec/ipsec_output.c
diff options
context:
space:
mode:
authorVratko Polak <vrpolak@cisco.com>2019-04-23 15:52:28 +0200
committerDamjan Marion <dmarion@me.com>2019-04-24 11:29:56 +0000
commitea6a34c70fb7dd0da040b6be724d1ed38437eae4 (patch)
treeb46325f1a1c9f4e3a80c9ee6a6bee3f0aa2a17f1 /src/vnet/ipsec/ipsec_output.c
parent52ef4c584e68c9fd31269b0eb47c778fd4762e57 (diff)
Rearrange prefetching in ipsec_output_inline
Change-Id: I6151e57643ebed42f51b795980db2c52084295ab Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Diffstat (limited to 'src/vnet/ipsec/ipsec_output.c')
-rw-r--r--src/vnet/ipsec/ipsec_output.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/vnet/ipsec/ipsec_output.c b/src/vnet/ipsec/ipsec_output.c
index 47eeb46d659..a37e8c2d777 100644
--- a/src/vnet/ipsec/ipsec_output.c
+++ b/src/vnet/ipsec/ipsec_output.c
@@ -205,18 +205,18 @@ ipsec_output_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
u64 bytes0;
bi0 = from[0];
- bi1 = from[1];
b0 = vlib_get_buffer (vm, bi0);
- b1 = vlib_get_buffer (vm, bi1);
- sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_TX];
- iph_offset = vnet_buffer (b0)->ip.save_rewrite_length;
- ip0 = (ip4_header_t *) ((u8 *) vlib_buffer_get_current (b0)
- + iph_offset);
if (n_left_from > 1)
{
+ bi1 = from[1];
+ b1 = vlib_get_buffer (vm, bi1);
CLIB_PREFETCH (b1, CLIB_CACHE_LINE_BYTES * 2, STORE);
vlib_prefetch_buffer_data (b1, LOAD);
}
+ sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_TX];
+ iph_offset = vnet_buffer (b0)->ip.save_rewrite_length;
+ ip0 = (ip4_header_t *) ((u8 *) vlib_buffer_get_current (b0)
+ + iph_offset);
/* lookup for SPD only if sw_if_index is changed */
if (PREDICT_FALSE (last_sw_if_index != sw_if_index0))