summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-03-16 08:48:31 -0700
committerDave Barach <openvpp@barachs.net>2018-03-23 14:30:06 +0000
commit81a13db67f6e3cca2a974e4c32d8e9db940645dc (patch)
tree5ef6438d2298ad1e5dec13f8d3f842b182c68068 /src/vnet/tcp
parent0bee9ce4af04322c56f7511f24bda4874e78a4b4 (diff)
tcp/session: sprinkle prefetches
Change-Id: Idef3c665580c13d72e99f43d16b8b13cc6ab746f Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/tcp')
-rw-r--r--src/vnet/tcp/tcp_input.c8
-rw-r--r--src/vnet/tcp/tcp_output.c8
2 files changed, 16 insertions, 0 deletions
diff --git a/src/vnet/tcp/tcp_input.c b/src/vnet/tcp/tcp_input.c
index 86bce4895b6..07f183891ea 100644
--- a/src/vnet/tcp/tcp_input.c
+++ b/src/vnet/tcp/tcp_input.c
@@ -1713,6 +1713,14 @@ tcp46_established_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
tcp_connection_t *tc0;
u32 next0 = tcp_next_drop (is_ip4), error0 = TCP_ERROR_ENQUEUED;
+ if (n_left_from > 1)
+ {
+ vlib_buffer_t *pb;
+ pb = vlib_get_buffer (vm, from[1]);
+ vlib_prefetch_buffer_header (pb, LOAD);
+ CLIB_PREFETCH (pb->data, 2 * CLIB_CACHE_LINE_BYTES, LOAD);
+ }
+
bi0 = from[0];
to_next[0] = bi0;
from += 1;
diff --git a/src/vnet/tcp/tcp_output.c b/src/vnet/tcp/tcp_output.c
index bbcbc912175..2b5a5cd73fe 100644
--- a/src/vnet/tcp/tcp_output.c
+++ b/src/vnet/tcp/tcp_output.c
@@ -1771,6 +1771,14 @@ tcp46_output_inline (vlib_main_t * vm,
tcp_header_t *th0 = 0;
u32 error0 = TCP_ERROR_PKTS_SENT, next0 = TCP_OUTPUT_NEXT_IP_LOOKUP;
+ if (n_left_from > 1)
+ {
+ vlib_buffer_t *pb;
+ pb = vlib_get_buffer (vm, from[1]);
+ vlib_prefetch_buffer_header (pb, STORE);
+ CLIB_PREFETCH (pb->data, 2 * CLIB_CACHE_LINE_BYTES, STORE);
+ }
+
bi0 = from[0];
to_next[0] = bi0;
from += 1;