From patchwork Mon Mar 2 14:32:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 66167 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 27D65A0568; Mon, 2 Mar 2020 10:01:24 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E633B1C07D; Mon, 2 Mar 2020 10:00:24 +0100 (CET) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 06CE51C029 for ; Mon, 2 Mar 2020 10:00:19 +0100 (CET) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id DF9901A0FAA; Mon, 2 Mar 2020 10:00:18 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 6A2DE1A100E; Mon, 2 Mar 2020 10:00:16 +0100 (CET) Received: from bf-netperf1.ap.com (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 2DC7C40299; Mon, 2 Mar 2020 17:00:13 +0800 (SGT) From: Hemant Agrawal To: ferruh.yigit@intel.com Cc: dev@dpdk.org, g.singh@nxp.com, Alex Marginean Date: Mon, 2 Mar 2020 20:02:05 +0530 Message-Id: <20200302143209.11854-7-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200302143209.11854-1-hemant.agrawal@nxp.com> References: <20200302143209.11854-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 06/10] net/enetc: cache align enetc bdr structure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Alex Marginean Reorder the members of the structure so that the ones used on datapath fit in a single cache line, to slightly reduce pressure on cache and miss rate. Signed-off-by: Alex Marginean --- drivers/net/enetc/enetc.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/enetc/enetc.h b/drivers/net/enetc/enetc.h index 8c830a5c0..14ef3bc18 100644 --- a/drivers/net/enetc/enetc.h +++ b/drivers/net/enetc/enetc.h @@ -53,23 +53,23 @@ struct enetc_swbd { }; struct enetc_bdr { - struct rte_eth_dev *ndev; - struct rte_mempool *mb_pool; /* mbuf pool to populate RX ring. */ void *bd_base; /* points to Rx or Tx BD ring */ + struct enetc_swbd *q_swbd; union { void *tcir; void *rcir; }; - uint16_t index; int bd_count; /* # of BDs */ int next_to_use; int next_to_clean; - struct enetc_swbd *q_swbd; + uint16_t index; + uint8_t crc_len; /* 0 if CRC stripped, 4 otherwise */ union { void *tcisr; /* Tx */ int next_to_alloc; /* Rx */ }; - uint8_t crc_len; /* 0 if CRC stripped, 4 otherwise */ + struct rte_mempool *mb_pool; /* mbuf pool to populate RX ring. */ + struct rte_eth_dev *ndev; }; /*