tcp: fix single loop prefetch 08/13308/1
authorFlorin Coras <fcoras@cisco.com>
Sat, 30 Jun 2018 18:27:59 +0000 (11:27 -0700)
committerFlorin Coras <fcoras@cisco.com>
Sat, 30 Jun 2018 18:30:45 +0000 (11:30 -0700)
Also add single loop prefetch in session tx

Change-Id: Ib2725a2552fcc1a65050d7a2eb10491a7b34db62
Signed-off-by: Florin Coras <fcoras@cisco.com>
src/vnet/session/session_node.c
src/vnet/tcp/tcp_output.c

index 0087463..aec353d 100644 (file)
@@ -483,7 +483,13 @@ session_tx_fifo_read_and_snd_i (vlib_main_t * vm, vlib_node_runtime_t * node,
       vlib_buffer_t *b0;
       u32 bi0;
 
-      ASSERT (n_bufs >= 1);
+      if (n_left > 1)
+       {
+         pbi = smm->tx_buffers[thread_index][n_bufs - 2];
+         pb = vlib_get_buffer (vm, pbi);
+         vlib_prefetch_buffer_header (pb, STORE);
+       }
+
       to_next[0] = bi0 = smm->tx_buffers[thread_index][--n_bufs];
       b0 = vlib_get_buffer (vm, bi0);
       session_tx_fill_buffer (vm, ctx, b0, &n_bufs, peek_data);
index 4b79158..7c11345 100644 (file)
@@ -1996,8 +1996,8 @@ tcp46_output_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
 
       if (n_left_from > 1)
        {
-         vlib_prefetch_buffer_header (b[0], STORE);
-         CLIB_PREFETCH (b[0]->data, 2 * CLIB_CACHE_LINE_BYTES, STORE);
+         vlib_prefetch_buffer_header (b[1], STORE);
+         CLIB_PREFETCH (b[1]->data, 2 * CLIB_CACHE_LINE_BYTES, STORE);
        }
 
       next[0] = TCP_OUTPUT_NEXT_IP_LOOKUP;