Message ID | 745DB4B8861F8E4B9849C970520ABBF14975BCC7@ORSMSX102.amr.corp.intel.com (mailing list archive) |
---|---|
State | Changes Requested, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id ACFC68DA6; Tue, 10 Nov 2015 15:18:10 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 23D4A58C3 for <dev@dpdk.org>; Tue, 10 Nov 2015 15:18:08 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP; 10 Nov 2015 06:17:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,270,1444719600"; d="scan'208,217";a="682168665" Received: from orsmsx103.amr.corp.intel.com ([10.22.225.130]) by orsmga003.jf.intel.com with ESMTP; 10 Nov 2015 06:17:42 -0800 Received: from orsmsx102.amr.corp.intel.com ([169.254.1.190]) by ORSMSX103.amr.corp.intel.com ([169.254.2.103]) with mapi id 14.03.0248.002; Tue, 10 Nov 2015 06:17:41 -0800 From: "Polehn, Mike A" <mike.a.polehn@intel.com> To: "dev@dpdk.org" <dev@dpdk.org> Thread-Topic: [PATCH v2] ethdev: Prefetch driver variable structure Thread-Index: AdEbwoCqRm8AWwtpTaSp5FTdLRCnIg== Date: Tue, 10 Nov 2015 14:17:41 +0000 Message-ID: <745DB4B8861F8E4B9849C970520ABBF14975BCC7@ORSMSX102.amr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsIiwiaWQiOiJmMjllZjgzMi0xMjFhLTQ4YTctYTJjYy00NGFhMDA5YTQ3ZjgiLCJwcm9wcyI6W3sibiI6IkludGVsRGF0YUNsYXNzaWZpY2F0aW9uIiwidmFscyI6W3sidmFsdWUiOiJDVFBfSUMifV19XX0sIlN1YmplY3RMYWJlbHMiOltdLCJUTUNWZXJzaW9uIjoiMTUuNC4xMC4xOSIsIlRydXN0ZWRMYWJlbEhhc2giOiJVNW5Famx4cEVURWlrSlVTM0RkSDhIYnVNdjdSQm8rc0hLTWI2dzZ1eWtnPSJ9 x-inteldataclassification: CTP_IC x-originating-ip: [10.22.254.138] MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] [PATCH v2] ethdev: Prefetch driver variable structure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Mike A. Polehn
Nov. 10, 2015, 2:17 p.m. UTC
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(-)
+ 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
Comments
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
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
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;