DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v2] ethdev: Prefetch driver variable structure
@ 2015-11-10 14:17 Polehn, Mike A
  2015-11-10 17:03 ` Stephen Hemminger
  0 siblings, 1 reply; 6+ messages in thread
From: Polehn, Mike A @ 2015-11-10 14:17 UTC (permalink / raw)
  To: dev

Adds ethdev driver prefetch of variable structure to CPU cache 0
while calling into tx or rx device driver operation.

RFC 2544 test of NIC task test measurement points show improvement
of lower latency and/or better packet throughput indicating clock
cycles saved.

Signed-off-by: Mike A. Polehn <mike.a.polehn@intel.com>
---
lib/librte_ether/rte_ethdev.h | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 48a540d..f1c35de 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -2458,12 +2458,17 @@ rte_eth_rx_burst(uint8_t port_id, uint16_t queue_id,
              struct rte_mbuf **rx_pkts, const uint16_t nb_pkts)
{
      struct rte_eth_dev *dev;
+      int16_t nb_rx;
       dev = &rte_eth_devices[port_id];
-      int16_t nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id],
-                    rx_pkts, nb_pkts);
+      { /* limit scope of rxq variable */
+             /* rxq is going to be immediately used, prefetch it */
+             void *rxq = dev->data->rx_queues[queue_id];
+             rte_prefetch0(rxq);
+             nb_rx = (*dev->rx_pkt_burst)(rxq, rx_pkts, nb_pkts);
+      }
#ifdef RTE_ETHDEV_RXTX_CALLBACKS
      struct rte_eth_rxtx_callback *cb = dev->post_rx_burst_cbs[queue_id];
@@ -2600,6 +2605,7 @@ rte_eth_tx_burst(uint8_t port_id, uint16_t queue_id,
              struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
{
      struct rte_eth_dev *dev;
+      void *txq;
       dev = &rte_eth_devices[port_id];
@@ -2615,7 +2621,11 @@ rte_eth_tx_burst(uint8_t port_id, uint16_t queue_id,
      }
#endif
-      return (*dev->tx_pkt_burst)(dev->data->tx_queues[queue_id], tx_pkts, nb_pkts);
+      /* txq is going to be immediately used, prefetch it */
+      txq = dev->data->tx_queues[queue_id];
+      rte_prefetch0(txq);
+
+      return (*dev->tx_pkt_burst)(txq, tx_pkts, nb_pkts);
}
#endif
--
2.6.0

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

* Re: [dpdk-dev] [PATCH v2] ethdev: Prefetch driver variable structure
  2015-11-10 14:17 [dpdk-dev] [PATCH v2] ethdev: Prefetch driver variable structure Polehn, Mike A
@ 2015-11-10 17:03 ` Stephen Hemminger
  2015-11-11 13:56   ` Polehn, Mike A
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2015-11-10 17:03 UTC (permalink / raw)
  To: Polehn, Mike A; +Cc: dev

On Tue, 10 Nov 2015 14:17:41 +0000
"Polehn, Mike A" <mike.a.polehn@intel.com> wrote:

> Adds ethdev driver prefetch of variable structure to CPU cache 0
> while calling into tx or rx device driver operation.
> 
> RFC 2544 test of NIC task test measurement points show improvement
> of lower latency and/or better packet throughput indicating clock
> cycles saved.
> 
> Signed-off-by: Mike A. Polehn <mike.a.polehn@intel.com>

Good idea, but lots of whitespace issues.
Please also check your mail client..


ERROR: patch seems to be corrupt (line wrapped?)
#80: FILE: lib/librte_ether/rte_ethdev.h:2457:
,

WARNING: please, no spaces at the start of a line
#84: FILE: lib/librte_ether/rte_ethdev.h:2460:
+      int16_t nb_rx;$

WARNING: please, no spaces at the start of a line
#89: FILE: lib/librte_ether/rte_ethdev.h:2462:
+      { /* limit scope of rxq variable */$

ERROR: code indent should use tabs where possible
#90: FILE: lib/librte_ether/rte_ethdev.h:2463:
+             /* rxq is going to be immediately used, prefetch it */$

ERROR: code indent should use tabs where possible
#91: FILE: lib/librte_ether/rte_ethdev.h:2464:
+             void *rxq =3D dev->data->rx_queues[queue_id];$

WARNING: please, no spaces at the start of a line
#91: FILE: lib/librte_ether/rte_ethdev.h:2464:
+             void *rxq =3D dev->data->rx_queues[queue_id];$

ERROR: spaces required around that '=' (ctx:WxV)
#91: FILE: lib/librte_ether/rte_ethdev.h:2464:
+             void *rxq =3D dev->data->rx_queues[queue_id];
                        ^

ERROR: code indent should use tabs where possible
#92: FILE: lib/librte_ether/rte_ethdev.h:2465:
+             rte_prefetch0(rxq);$

WARNING: Missing a blank line after declarations
#92: FILE: lib/librte_ether/rte_ethdev.h:2465:
+             void *rxq =3D dev->data->rx_queues[queue_id];
+             rte_prefetch0(rxq);

WARNING: please, no spaces at the start of a line
#92: FILE: lib/librte_ether/rte_ethdev.h:2465:
+             rte_prefetch0(rxq);$

ERROR: code indent should use tabs where possible
#93: FILE: lib/librte_ether/rte_ethdev.h:2466:
+             nb_rx =3D (*dev->rx_pkt_burst)(rxq, rx_pkts, nb_pkts);$

WARNING: please, no spaces at the start of a line
#93: FILE: lib/librte_ether/rte_ethdev.h:2466:
+             nb_rx =3D (*dev->rx_pkt_burst)(rxq, rx_pkts, nb_pkts);$

WARNING: space prohibited between function name and open parenthesis '('
#93: FILE: lib/librte_ether/rte_ethdev.h:2466:
+             nb_rx =3D (*dev->rx_pkt_burst)(rxq, rx_pkts, nb_pkts);

ERROR: spaces required around that '=' (ctx:WxV)
#93: FILE: lib/librte_ether/rte_ethdev.h:2466:
+             nb_rx =3D (*dev->rx_pkt_burst)(rxq, rx_pkts, nb_pkts);
                    ^

WARNING: please, no spaces at the start of a line
#94: FILE: lib/librte_ether/rte_ethdev.h:2467:
+      }$

WARNING: please, no spaces at the start of a line
#102: FILE: lib/librte_ether/rte_ethdev.h:2607:
+      void *txq;$

WARNING: please, no spaces at the start of a line
#110: FILE: lib/librte_ether/rte_ethdev.h:2624:
+      txq =3D dev->data->tx_queues[queue_id];$

ERROR: spaces required around that '=' (ctx:WxV)
#110: FILE: lib/librte_ether/rte_ethdev.h:2624:
+      txq =3D dev->data->tx_queues[queue_id];
           ^

WARNING: please, no spaces at the start of a line
#111: FILE: lib/librte_ether/rte_ethdev.h:2625:
+      rte_prefetch0(txq);$

WARNING: please, no spaces at the start of a line
#113: FILE: lib/librte_ether/rte_ethdev.h:2627:
+      return (*dev->tx_pkt_burst)(txq, tx_pkts, nb_pkts);$

total: 8 errors, 12 warnings, 38 lines checked

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

* Re: [dpdk-dev] [PATCH v2] ethdev: Prefetch driver variable structure
  2015-11-10 17:03 ` Stephen Hemminger
@ 2015-11-11 13:56   ` Polehn, Mike A
  0 siblings, 0 replies; 6+ messages in thread
From: Polehn, Mike A @ 2015-11-11 13:56 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev

It is probably the usual MS operation issues, I'll resubmit.

-----Original Message-----
From: Stephen Hemminger [mailto:stephen@networkplumber.org] 
Sent: Tuesday, November 10, 2015 9:03 AM
To: Polehn, Mike A
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v2] ethdev: Prefetch driver variable structure

On Tue, 10 Nov 2015 14:17:41 +0000
"Polehn, Mike A" <mike.a.polehn@intel.com> wrote:

> Adds ethdev driver prefetch of variable structure to CPU cache 0 while 
> calling into tx or rx device driver operation.
> 
> RFC 2544 test of NIC task test measurement points show improvement of 
> lower latency and/or better packet throughput indicating clock cycles 
> saved.
> 
> Signed-off-by: Mike A. Polehn <mike.a.polehn@intel.com>

Good idea, but lots of whitespace issues.
Please also check your mail client..


ERROR: patch seems to be corrupt (line wrapped?)
#80: FILE: lib/librte_ether/rte_ethdev.h:2457:
,

WARNING: please, no spaces at the start of a line
#84: FILE: lib/librte_ether/rte_ethdev.h:2460:
+      int16_t nb_rx;$

WARNING: please, no spaces at the start of a line
#89: FILE: lib/librte_ether/rte_ethdev.h:2462:
+      { /* limit scope of rxq variable */$

ERROR: code indent should use tabs where possible
#90: FILE: lib/librte_ether/rte_ethdev.h:2463:
+             /* rxq is going to be immediately used, prefetch it */$

ERROR: code indent should use tabs where possible
#91: FILE: lib/librte_ether/rte_ethdev.h:2464:
+             void *rxq =3D dev->data->rx_queues[queue_id];$

WARNING: please, no spaces at the start of a line
#91: FILE: lib/librte_ether/rte_ethdev.h:2464:
+             void *rxq =3D dev->data->rx_queues[queue_id];$

ERROR: spaces required around that '=' (ctx:WxV)
#91: FILE: lib/librte_ether/rte_ethdev.h:2464:
+             void *rxq =3D dev->data->rx_queues[queue_id];
                        ^

ERROR: code indent should use tabs where possible
#92: FILE: lib/librte_ether/rte_ethdev.h:2465:
+             rte_prefetch0(rxq);$

WARNING: Missing a blank line after declarations
#92: FILE: lib/librte_ether/rte_ethdev.h:2465:
+             void *rxq =3D dev->data->rx_queues[queue_id];
+             rte_prefetch0(rxq);

WARNING: please, no spaces at the start of a line
#92: FILE: lib/librte_ether/rte_ethdev.h:2465:
+             rte_prefetch0(rxq);$

ERROR: code indent should use tabs where possible
#93: FILE: lib/librte_ether/rte_ethdev.h:2466:
+             nb_rx =3D (*dev->rx_pkt_burst)(rxq, rx_pkts, nb_pkts);$

WARNING: please, no spaces at the start of a line
#93: FILE: lib/librte_ether/rte_ethdev.h:2466:
+             nb_rx =3D (*dev->rx_pkt_burst)(rxq, rx_pkts, nb_pkts);$

WARNING: space prohibited between function name and open parenthesis '('
#93: FILE: lib/librte_ether/rte_ethdev.h:2466:
+             nb_rx =3D (*dev->rx_pkt_burst)(rxq, rx_pkts, nb_pkts);

ERROR: spaces required around that '=' (ctx:WxV)
#93: FILE: lib/librte_ether/rte_ethdev.h:2466:
+             nb_rx =3D (*dev->rx_pkt_burst)(rxq, rx_pkts, nb_pkts);
                    ^

WARNING: please, no spaces at the start of a line
#94: FILE: lib/librte_ether/rte_ethdev.h:2467:
+      }$

WARNING: please, no spaces at the start of a line
#102: FILE: lib/librte_ether/rte_ethdev.h:2607:
+      void *txq;$

WARNING: please, no spaces at the start of a line
#110: FILE: lib/librte_ether/rte_ethdev.h:2624:
+      txq =3D dev->data->tx_queues[queue_id];$

ERROR: spaces required around that '=' (ctx:WxV)
#110: FILE: lib/librte_ether/rte_ethdev.h:2624:
+      txq =3D dev->data->tx_queues[queue_id];
           ^

WARNING: please, no spaces at the start of a line
#111: FILE: lib/librte_ether/rte_ethdev.h:2625:
+      rte_prefetch0(txq);$

WARNING: please, no spaces at the start of a line
#113: FILE: lib/librte_ether/rte_ethdev.h:2627:
+      return (*dev->tx_pkt_burst)(txq, tx_pkts, nb_pkts);$

total: 8 errors, 12 warnings, 38 lines checked

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

* Re: [dpdk-dev] [PATCH v2] ethdev: Prefetch driver variable structure
  2015-11-11 13:59 Polehn, Mike A
  2015-11-24 21:26 ` Thomas Monjalon
@ 2018-12-19 21:14 ` Ferruh Yigit
  1 sibling, 0 replies; 6+ messages in thread
From: Ferruh Yigit @ 2018-12-19 21:14 UTC (permalink / raw)
  To: Polehn, Mike A; +Cc: dpdk-dev, Thomas Monjalon

On 11/11/2015 1:59 PM, mike.a.polehn at intel.com (Polehn, Mike A) wrote:
> Adds ethdev driver prefetch of variable structure to CPU cache 0
> while calling into tx or rx device driver operation.
> 
> RFC 2544 test of NIC task test measurement points show improvement
> of lower latency and/or better packet throughput indicating clock
> cycles saved.
> 
> Signed-off-by: Mike A. Polehn <mike.a.polehn at intel.com>

Hi Mike,

This patch is sitting on patchwork since 2015 without review, I am updating it
as rejected, if it is still relevant please let us know.

Sorry for any inconvenience caused.

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

* Re: [dpdk-dev] [PATCH v2] ethdev: Prefetch driver variable structure
  2015-11-11 13:59 Polehn, Mike A
@ 2015-11-24 21:26 ` Thomas Monjalon
  2018-12-19 21:14 ` Ferruh Yigit
  1 sibling, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2015-11-24 21:26 UTC (permalink / raw)
  To: Polehn, Mike A, bruce.richardson; +Cc: dev

2015-11-11 13:59, Polehn, Mike A:
> Adds ethdev driver prefetch of variable structure to CPU cache 0
> while calling into tx or rx device driver operation.
> 
> RFC 2544 test of NIC task test measurement points show improvement
> of lower latency and/or better packet throughput indicating clock
> cycles saved.
> 
> Signed-off-by: Mike A. Polehn <mike.a.polehn@intel.com>

There are still some spacing issues with this patch.

Bruce, what is your opinion about this prefetch?

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

* [dpdk-dev] [PATCH v2] ethdev: Prefetch driver variable structure
@ 2015-11-11 13:59 Polehn, Mike A
  2015-11-24 21:26 ` Thomas Monjalon
  2018-12-19 21:14 ` Ferruh Yigit
  0 siblings, 2 replies; 6+ messages in thread
From: Polehn, Mike A @ 2015-11-11 13:59 UTC (permalink / raw)
  To: dev

Adds ethdev driver prefetch of variable structure to CPU cache 0
while calling into tx or rx device driver operation.

RFC 2544 test of NIC task test measurement points show improvement
of lower latency and/or better packet throughput indicating clock
cycles saved.

Signed-off-by: Mike A. Polehn <mike.a.polehn@intel.com>
---
 lib/librte_ether/rte_ethdev.h | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 48a540d..f1c35de 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -2458,12 +2458,17 @@ rte_eth_rx_burst(uint8_t port_id, uint16_t queue_id,
 		 struct rte_mbuf **rx_pkts, const uint16_t nb_pkts)
 {
 	struct rte_eth_dev *dev;
+	int16_t nb_rx;
 
 	dev = &rte_eth_devices[port_id];
 
-	int16_t nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id],
-			rx_pkts, nb_pkts);
+	{ /* limit scope of rxq variable */
+		/* rxq is going to be immediately used, prefetch it */
+		void *rxq = dev->data->rx_queues[queue_id];
+		rte_prefetch0(rxq);
 
+		nb_rx = (*dev->rx_pkt_burst)(rxq, rx_pkts, nb_pkts);
+	}
 #ifdef RTE_ETHDEV_RXTX_CALLBACKS
 	struct rte_eth_rxtx_callback *cb = dev->post_rx_burst_cbs[queue_id];
 
@@ -2600,6 +2605,7 @@ rte_eth_tx_burst(uint8_t port_id, uint16_t queue_id,
 		 struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 {
 	struct rte_eth_dev *dev;
+	void *txq;
 
 	dev = &rte_eth_devices[port_id];
 
@@ -2615,7 +2621,11 @@ rte_eth_tx_burst(uint8_t port_id, uint16_t queue_id,
 	}
 #endif
 
-	return (*dev->tx_pkt_burst)(dev->data->tx_queues[queue_id], tx_pkts, nb_pkts);
+	/* txq is going to be immediately used, prefetch it */
+	txq = dev->data->tx_queues[queue_id];
+	rte_prefetch0(txq);
+
+	return (*dev->tx_pkt_burst)(txq, tx_pkts, nb_pkts);
 }
 #endif
 
-- 
2.6.0

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

end of thread, other threads:[~2018-12-19 21:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-10 14:17 [dpdk-dev] [PATCH v2] ethdev: Prefetch driver variable structure Polehn, Mike A
2015-11-10 17:03 ` Stephen Hemminger
2015-11-11 13:56   ` Polehn, Mike A
2015-11-11 13:59 Polehn, Mike A
2015-11-24 21:26 ` Thomas Monjalon
2018-12-19 21:14 ` Ferruh Yigit

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).