From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 7F68B8DA3 for ; Tue, 27 Oct 2015 21:56:55 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP; 27 Oct 2015 13:56:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,206,1444719600"; d="scan'208";a="804750969" Received: from orsmsx105.amr.corp.intel.com ([10.22.225.132]) by orsmga001.jf.intel.com with ESMTP; 27 Oct 2015 13:56:33 -0700 Received: from orsmsx159.amr.corp.intel.com (10.22.240.24) by ORSMSX105.amr.corp.intel.com (10.22.225.132) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 27 Oct 2015 13:56:32 -0700 Received: from orsmsx102.amr.corp.intel.com ([169.254.1.29]) by ORSMSX159.amr.corp.intel.com ([169.254.11.120]) with mapi id 14.03.0248.002; Tue, 27 Oct 2015 13:56:32 -0700 From: "Polehn, Mike A" To: "dev@dpdk.org" Thread-Topic: [Patch] Eth Driver: Optimization for improved NIC processing rates Thread-Index: AdEQ+AadyfEp6lhBStyWaXD0d3T1sg== Date: Tue, 27 Oct 2015 20:56:31 +0000 Message-ID: <745DB4B8861F8E4B9849C970520ABBF14974C1DF@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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsIiwiaWQiOiIwMTBmYTRiZC04M2I3LTQyYzUtOWVmOS04Yjc1MmY2MmVmMzciLCJwcm9wcyI6W3sibiI6IkludGVsRGF0YUNsYXNzaWZpY2F0aW9uIiwidmFscyI6W3sidmFsdWUiOiJDVFBfSUMifV19XX0sIlN1YmplY3RMYWJlbHMiOltdLCJUTUNWZXJzaW9uIjoiMTUuNC4xMC4xOSIsIlRydXN0ZWRMYWJlbEhhc2giOiJNVkdwcXB5cnQ2bnB0cUdsVnF1amhuTGpBYXVXSHdDYmpGRWpJYlNNWG53PSJ9 x-inteldataclassification: CTP_IC x-originating-ip: [10.22.254.139] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: [dpdk-dev] [Patch] Eth Driver: Optimization for improved NIC processing rates X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Oct 2015 20:56:55 -0000 Prefetch of interface access variables while calling into driver RX and TX = subroutines. For converging zero loss packet task tests, a small drop in latency for zer= o loss measurements=20 and small drop in lost packet counts for the lossy measurement points was o= bserved,=20 indicating some savings of execution clock cycles. Signed-off-by: Mike A. Polehn 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; =20 dev =3D &rte_eth_devices[port_id]; =20 - int16_t nb_rx =3D (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id], - rx_pkts, nb_pkts); + /* rxq is going to be immediately used, prefetch it */ + rxq =3D dev->data->rx_queues[queue_id]; + rte_prefetch0(rxq); + + int16_t nb_rx =3D (*dev->rx_pkt_burst)(rxq, rx_pkts, nb_pkts); =20 #ifdef RTE_ETHDEV_RXTX_CALLBACKS struct rte_eth_rxtx_callback *cb =3D 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; =20 dev =3D &rte_eth_devices[port_id]; =20 @@ -2514,7 +2519,11 @@ rte_eth_tx_burst(uint8_t port_id, uint16_t queue_id, } #endif =20 - return (*dev->tx_pkt_burst)(dev->data->tx_queues[queue_id], tx_pkts, nb_p= kts); + /* txq is going to be immediately used, prefetch it */ + txq =3D dev->data->tx_queues[queue_id]; + rte_prefetch0(txq); + + return (*dev->tx_pkt_burst)(txq, tx_pkts, nb_pkts); } #endif