DPDK patches and discussions
 help / color / mirror / Atom feed
* Re: [dpdk-dev] [PATCH v1 2/2] net/i40e: use movdiri to update queue tail registers
@ 2024-03-16  4:02 Mikaela Springer
  0 siblings, 0 replies; 2+ messages in thread
From: Mikaela Springer @ 2024-03-16  4:02 UTC (permalink / raw)
  To: radu.nicolau
  Cc: beilei.xing, bruce.richardson, dev, jia.guo, konstantin.ananyev

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: Type: text/html, Size: 1 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread
* [dpdk-dev] [PATCH v1 1/2] eal/x86: add WC store function
@ 2020-06-11 10:11 Radu Nicolau
  2020-06-11 10:11 ` [dpdk-dev] [PATCH v1 2/2] net/i40e: use movdiri to update queue tail registers Radu Nicolau
  0 siblings, 1 reply; 2+ messages in thread
From: Radu Nicolau @ 2020-06-11 10:11 UTC (permalink / raw)
  To: dev
  Cc: beilei.xing, jia.guo, bruce.richardson, konstantin.ananyev, Radu Nicolau

Add rte_write32_wc function that implements a WC store
using movdiri instruction.

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
---
 lib/librte_eal/x86/include/rte_io.h | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/lib/librte_eal/x86/include/rte_io.h b/lib/librte_eal/x86/include/rte_io.h
index 2db71b1..3d74bec 100644
--- a/lib/librte_eal/x86/include/rte_io.h
+++ b/lib/librte_eal/x86/include/rte_io.h
@@ -11,6 +11,26 @@ extern "C" {
 
 #include "generic/rte_io.h"
 
+/**
+ * Write a 32-bit value to I/O device memory address *addr*.
+ * Uses MOVDIRI instruction to perform a direct-store operation using WC
+ * memory write protocol.
+ *
+ * @param value
+ *  Value to write
+ * @param addr
+ *  I/O memory address to write the value to
+ */
+static __rte_always_inline void
+rte_write32_wc(uint32_t value, volatile void *addr)
+{
+	asm volatile("sfence\n\t"
+		/* MOVDIRI */
+		".byte 0x40, 0x0f, 0x38, 0xf9, 0x02"
+		:
+		: "a" (value), "d" (addr));
+}
+
 #ifdef __cplusplus
 }
 #endif
-- 
2.7.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-18  7:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-16  4:02 [dpdk-dev] [PATCH v1 2/2] net/i40e: use movdiri to update queue tail registers Mikaela Springer
  -- strict thread matches above, loose matches on Subject: below --
2020-06-11 10:11 [dpdk-dev] [PATCH v1 1/2] eal/x86: add WC store function Radu Nicolau
2020-06-11 10:11 ` [dpdk-dev] [PATCH v1 2/2] net/i40e: use movdiri to update queue tail registers Radu Nicolau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).