[dpdk-dev,v2] Eth driver optimization: Prefetch variable structure

Message ID 745DB4B8861F8E4B9849C970520ABBF149750763@ORSMSX102.amr.corp.intel.com (mailing list archive)
State Not Applicable, archived
Headers

Commit Message

Mike A. Polehn Nov. 3, 2015, 3 p.m. UTC
  Adds Eth driver prefetch 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>
  

Comments

Thomas Monjalon Nov. 3, 2015, 3:03 p.m. UTC | #1
Hi,
Please use git-send-email and check how titles are formatted in the git tree.
Thanks
  
Mike A. Polehn Nov. 3, 2015, 10:46 p.m. UTC | #2
My email address is my official email address and it can only be used with the official email system, or in other words the corporate MS windows email system. Can I use an oddball junk email address, such as a gmail account or non-returnable IP named Sendmail server (has no registered DNS name), to submit patches into dpdk.org user account, with patches signed with my official email address (which is different than the sending email address which is just junk name)?

Mike

-----Original Message-----
From: Polehn, Mike A 
Sent: Tuesday, November 3, 2015 12:17 PM
To: St Leger, Jim
Subject: RE: [dpdk-dev] [Patch v2] Eth driver optimization: Prefetch variable structure

I don't understand why a development system must also support a user email system and then also a full email server needed to deliver it. I have half a dozen servers I have various projects on...

Seems like same server used to move git updates could also be made to move patch email for the project. 

-----Original Message-----
From: St Leger, Jim 
Sent: Tuesday, November 3, 2015 7:36 AM
To: Polehn, Mike A
Subject: RE: [dpdk-dev] [Patch v2] Eth driver optimization: Prefetch variable structure

Mike:
If you need any help/guidance of navigating the DPDK.org forums and community reach out to some of the crew.  Our Shannon and Shanghai teams have it down to a science, okay, an artful science anyway.  And there are some in the States such as Keith Wiles (and Jeff Shaw up your way) who could also give some BKMs.
Jim


-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon
Sent: Tuesday, November 3, 2015 8:03 AM
To: Polehn, Mike A <mike.a.polehn@intel.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [Patch v2] Eth driver optimization: Prefetch variable structure

Hi,
Please use git-send-email and check how titles are formatted in the git tree.
Thanks
  
Bruce Richardson Nov. 4, 2015, 4:56 p.m. UTC | #3
On Tue, Nov 03, 2015 at 03:00:15PM +0000, Polehn, Mike A wrote:
> Adds Eth driver prefetch 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>

Hi Mike,

what test app would you recommend to see this perf improvement in testing? I
would like to see the perf impact in some tests myself.

Thanks,

/Bruce
  

Patch

diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 8a8c82b..09f1069 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -2357,11 +2357,15 @@  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;
+	void *rxq;
 
 	dev = &rte_eth_devices[port_id];
 
-	int16_t nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id],
-			rx_pkts, nb_pkts);
+	/* rxq is going to be immediately used, prefetch it */
+	rxq = dev->data->rx_queues[queue_id];
+	rte_prefetch0(rxq);
+
+	int16_t 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];
@@ -2499,6 +2503,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];
 
@@ -2514,7 +2519,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