dpdk: prefetch becomes prefetchw 65/34565/3
authorRay Kinsella <mdr@ashroe.eu>
Mon, 22 Nov 2021 12:08:04 +0000 (12:08 +0000)
committerRay Kinsella <mdr@ashroe.eu>
Thu, 25 Nov 2021 09:04:27 +0000 (09:04 +0000)
Changed dpdk-input prefetch of vlib_buffer_t to prefetchw.

vlib_buffer_t was being prefetched without 'ownership', which may
cause a stall when the buffer is subsequently written to. This saves
4 clocks a packet when the buffer is shared a cross cores, and has no
impact when not sharing.

Type: improvement

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I317af2a38ef536022e68552351a8507861f62dad

src/plugins/dpdk/device/node.c

index e9615e5..2357e39 100644 (file)
@@ -97,13 +97,13 @@ dpdk_prefetch_buffer_x4 (struct rte_mbuf *mb[])
 {
   vlib_buffer_t *b;
   b = vlib_buffer_from_rte_mbuf (mb[0]);
-  clib_prefetch_load (b);
+  clib_prefetch_store (b);
   b = vlib_buffer_from_rte_mbuf (mb[1]);
-  clib_prefetch_load (b);
+  clib_prefetch_store (b);
   b = vlib_buffer_from_rte_mbuf (mb[2]);
-  clib_prefetch_load (b);
+  clib_prefetch_store (b);
   b = vlib_buffer_from_rte_mbuf (mb[3]);
-  clib_prefetch_load (b);
+  clib_prefetch_store (b);
 }
 
 /** \brief Main DPDK input node