DPDK patches and discussions
 help / color / mirror / Atom feed
From: Marvin Liu <yong.liu@intel.com>
To: thomas@monjalon.net, Honnappa.Nagarahalli@arm.com
Cc: bruce.richardson@intel.com, stephen@networkplumber.org,
	david.marchand@redhat.com, ferruh.yigit@intel.com,
	maxime.coquelin@redhat.com, drc@linux.vnet.ibm.com,
	Ruifeng.Wang@arm.com, dev@dpdk.org,
	Marvin Liu <yong.liu@intel.com>
Subject: [dpdk-dev] [PATCH v3] drivers/net: enable packet data prefetch on x86
Date: Tue,  3 Nov 2020 09:57:30 +0800
Message-ID: <20201103015730.6952-1-yong.liu@intel.com> (raw)
In-Reply-To: <20200923015131.101203-1-yong.liu@intel.com>

Data prefetch instruction can preload data into cpu’s hierarchical
cache before data access. Data paths like e1000 and virtio utilized
this feature for packet data access acceleration. Enabled packet data
prefetch on x86 architecture, as prefetch instruction has been
supported from very early generation.

Signed-off-by: Marvin Liu <yong.liu@intel.com>
---
v3: replace build config with pre-defined architecture macro
v2: move define from meson.build to rte_config.h
---
diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c
index 19e3bffd46..5a9cd04c9c 100644
--- a/drivers/net/e1000/em_rxtx.c
+++ b/drivers/net/e1000/em_rxtx.c
@@ -185,7 +185,7 @@ struct em_tx_queue {
 #define rte_em_prefetch(p)	do {} while(0)
 #endif
 
-#ifdef RTE_PMD_PACKET_PREFETCH
+#if defined(RTE_ARCH_X86)
 #define rte_packet_prefetch(p) rte_prefetch1(p)
 #else
 #define rte_packet_prefetch(p)	do {} while(0)
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index dd520cd82c..45d4ee0b92 100644
--- a/drivers/net/e1000/igb_rxtx.c
+++ b/drivers/net/e1000/igb_rxtx.c
@@ -198,7 +198,7 @@ struct igb_tx_queue {
 #define rte_igb_prefetch(p)	do {} while(0)
 #endif
 
-#ifdef RTE_PMD_PACKET_PREFETCH
+#if defined(RTE_ARCH_X86)
 #define rte_packet_prefetch(p) rte_prefetch1(p)
 #else
 #define rte_packet_prefetch(p)	do {} while(0)
diff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c
index 6a8718c086..671c32038b 100644
--- a/drivers/net/enic/enic_rxtx.c
+++ b/drivers/net/enic/enic_rxtx.c
@@ -25,7 +25,7 @@
 #define rte_enic_prefetch(p) do {} while (0)
 #endif
 
-#ifdef RTE_PMD_PACKET_PREFETCH
+#if defined(RTE_ARCH_X86)
 #define rte_packet_prefetch(p) rte_prefetch1(p)
 #else
 #define rte_packet_prefetch(p) do {} while (0)
diff --git a/drivers/net/fm10k/fm10k_rxtx.c b/drivers/net/fm10k/fm10k_rxtx.c
index 4accaa2cd6..4bc3afadd1 100644
--- a/drivers/net/fm10k/fm10k_rxtx.c
+++ b/drivers/net/fm10k/fm10k_rxtx.c
@@ -10,7 +10,7 @@
 #include "fm10k.h"
 #include "base/fm10k_type.h"
 
-#ifdef RTE_PMD_PACKET_PREFETCH
+#if defined(RTE_ARCH_X86)
 #define rte_packet_prefetch(p)  rte_prefetch1(p)
 #else
 #define rte_packet_prefetch(p)  do {} while (0)
diff --git a/drivers/net/igc/igc_txrx.c b/drivers/net/igc/igc_txrx.c
index 4654ec41f0..b8b504738e 100644
--- a/drivers/net/igc/igc_txrx.c
+++ b/drivers/net/igc/igc_txrx.c
@@ -16,7 +16,7 @@
 #define rte_igc_prefetch(p)		do {} while (0)
 #endif
 
-#ifdef RTE_PMD_PACKET_PREFETCH
+#if defined(RTE_ARCH_X86)
 #define rte_packet_prefetch(p)		rte_prefetch1(p)
 #else
 #define rte_packet_prefetch(p)		do {} while (0)
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.h b/drivers/net/ixgbe/ixgbe_rxtx.h
index 6d2f7c9da3..4d39de9531 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.h
+++ b/drivers/net/ixgbe/ixgbe_rxtx.h
@@ -41,7 +41,7 @@
 #define RX_RING_SZ ((IXGBE_MAX_RING_DESC + RTE_PMD_IXGBE_RX_MAX_BURST) * \
 		    sizeof(union ixgbe_adv_rx_desc))
 
-#ifdef RTE_PMD_PACKET_PREFETCH
+#if defined(RTE_ARCH_X86)
 #define rte_packet_prefetch(p)  rte_prefetch1(p)
 #else
 #define rte_packet_prefetch(p)  do {} while(0)
diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h
index 42c4c9882f..0196290a5d 100644
--- a/drivers/net/virtio/virtqueue.h
+++ b/drivers/net/virtio/virtqueue.h
@@ -106,7 +106,7 @@ virtqueue_store_flags_packed(struct vring_packed_desc *dp,
 		dp->flags = flags;
 	}
 }
-#ifdef RTE_PMD_PACKET_PREFETCH
+#if defined(RTE_ARCH_X86)
 #define rte_packet_prefetch(p)  rte_prefetch1(p)
 #else
 #define rte_packet_prefetch(p)  do {} while(0)
-- 
2.17.1


      parent reply	other threads:[~2020-11-03  1:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-22  8:21 [dpdk-dev] [PATCH] build: enable packet data prefetch Marvin Liu
2020-09-22 14:11 ` Stephen Hemminger
2020-09-23  2:00   ` Liu, Yong
2020-09-23  1:51 ` [dpdk-dev] [PATCH v2] config: " Marvin Liu
2020-10-14 22:02   ` Thomas Monjalon
2020-10-15  1:21     ` Liu, Yong
2020-10-15  4:09       ` Honnappa Nagarahalli
2020-10-15  8:23         ` Liu, Yong
2020-10-15  9:21           ` Thomas Monjalon
2020-10-15 14:38             ` Honnappa Nagarahalli
2020-11-03  1:57   ` Marvin Liu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201103015730.6952-1-yong.liu@intel.com \
    --to=yong.liu@intel.com \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=Ruifeng.Wang@arm.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=drc@linux.vnet.ibm.com \
    --cc=ferruh.yigit@intel.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git