summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/avf/avf.h11
-rw-r--r--src/plugins/avf/input.c2
-rw-r--r--src/plugins/avf/output.c2
3 files changed, 13 insertions, 2 deletions
diff --git a/src/plugins/avf/avf.h b/src/plugins/avf/avf.h
index b3fcc259206..23cc36c4882 100644
--- a/src/plugins/avf/avf.h
+++ b/src/plugins/avf/avf.h
@@ -373,6 +373,17 @@ avf_reg_flush (avf_device_t * ad)
asm volatile ("":::"memory");
}
+static inline void
+avf_tail_write (volatile u32 *addr, u32 val)
+{
+#ifdef __MOVDIRI__
+ _mm_sfence ();
+ _directstoreu_u32 ((void *) addr, val);
+#else
+ clib_atomic_store_rel_n (addr, val);
+#endif
+}
+
static_always_inline int
avf_rxd_is_not_eop (avf_rx_desc_t * d)
{
diff --git a/src/plugins/avf/input.c b/src/plugins/avf/input.c
index 5041f6ef4e7..221b54b19a9 100644
--- a/src/plugins/avf/input.c
+++ b/src/plugins/avf/input.c
@@ -125,7 +125,7 @@ avf_rxq_refill (vlib_main_t * vm, vlib_node_runtime_t * node, avf_rxq_t * rxq,
n_alloc -= 8;
}
- clib_atomic_store_rel_n (rxq->qrx_tail, slot);
+ avf_tail_write (rxq->qrx_tail, slot);
}
diff --git a/src/plugins/avf/output.c b/src/plugins/avf/output.c
index 952d151117c..c53fc42a850 100644
--- a/src/plugins/avf/output.c
+++ b/src/plugins/avf/output.c
@@ -441,7 +441,7 @@ avf_tx_enqueue (vlib_main_t * vm, vlib_node_runtime_t * node, avf_txq_t * txq,
}
txq->next = next & mask;
- clib_atomic_store_rel_n (txq->qtx_tail, txq->next);
+ avf_tail_write (txq->qtx_tail, txq->next);
txq->n_enqueued += n_desc;
return n_packets - n_packets_left;
}