From patchwork Fri May 15 09:47:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 186824 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp266595ilb; Fri, 15 May 2020 02:52:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTbbkTXkU3liGIlRWbEjaVNNNu+e2VTpj0MnPkV52Uw2owqjy6bFMY7gDlMEiZWeU978po X-Received: by 2002:a1c:b354:: with SMTP id c81mr3119201wmf.136.1589536329788; Fri, 15 May 2020 02:52:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589536329; cv=none; d=google.com; s=arc-20160816; b=sE72NqlQbSAWqpRAh/2yyM5bMeWbQaCfmfENAJ4WJUjzdXkrvTFGd5laI3cXG19GvB vagW4wt2hT+B2hcZczD3CbtX4rGLYhuTK1e0jFkM+9Pafj7Wf/aw0KGZ98MUZozOkQ3r YH/ZZvf+wP3EYAjh/SU2WWaegPwb4E7GhCuFeAjxqk6dV87g56N3ZKyBDD7vRykSWD9J aA1Uei3TX2JsnDdAE/zlLrSEQQFoZGXcQDU3FkFNGIaMdukhBhncPRoiPbO7woprdfv7 yEuiEFsfBWnr9/fCcKXKAP6C0aZ1qhp4aOr8Maenqm/WNB3zsNyq2N1D3Iod4zIPMQua Z80g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=Wzo0xw9qFLKysmuQ1tL+TccBfgAJhQaxXmogKr+6CYs=; b=GDP+xi+qs7YNMnn3ErgLgnA0GVVgVtG5CzNno6VcOS3hLvJTWtME1ga1pz43fTUJAl 4T3sIC5dC+D4rH6P1DQKlfD2hPbVA6TQVAlf1hwQRXBj18GxHKYmxH/25vvmJaAd3cET KZbzh2chtFutS6lnS5iazdbsnCqzaYY5mAo/I6jmLAfty61xd/+66aXZcwJB5yHX72Wc 14pZ+LVW9O/8itpcquZ65e3mP2PjNSNmsTaKwj3ad/LZO56A3lOiopsR7v93v9vUl7Zv muHr1CJjLU9W5E3Gy0wAyxbUjavECSXqW9vMS3x2+kQcYeCUOwxNNlK41ygsdKEE9/7j XnCA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id p23si1649375wma.99.2020.05.15.02.52.09; Fri, 15 May 2020 02:52:09 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E25451DB11; Fri, 15 May 2020 11:50:47 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 24B021DACC for ; Fri, 15 May 2020 11:50:29 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 09110200740; Fri, 15 May 2020 11:50:29 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 04A7B20073A; Fri, 15 May 2020 11:50:27 +0200 (CEST) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 56936402E3; Fri, 15 May 2020 17:50:24 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org, david.marchand@redhat.com, mdr@ashroe.eu Cc: Hemant Agrawal Date: Fri, 15 May 2020 15:17:50 +0530 Message-Id: <20200515094752.28490-12-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200515094752.28490-1-hemant.agrawal@nxp.com> References: <20200514132533.13752-1-hemant.agrawal@nxp.com> <20200515094752.28490-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v8 11/13] bus/dpaa: change netcfg access as function 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" This patch changes the export of fman port config as function call instead of direct variable access. This is in control path, so it will not impact perf. Signed-off-by: Hemant Agrawal --- drivers/bus/dpaa/dpaa_bus.c | 6 ++++++ drivers/bus/dpaa/rte_bus_dpaa_version.map | 1 + drivers/bus/dpaa/rte_dpaa_bus.h | 6 +++--- drivers/net/dpaa/dpaa_ethdev.c | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) -- 2.17.1 Acked-by: Ray Kinsella diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index 41d42b0c30..d53fe6083a 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -57,6 +57,12 @@ unsigned int dpaa_svr_family; RTE_DEFINE_PER_LCORE(bool, dpaa_io); RTE_DEFINE_PER_LCORE(struct dpaa_portal_dqrr, held_bufs); +struct fm_eth_port_cfg * +dpaa_get_eth_port_cfg(int dev_id) +{ + return &dpaa_netcfg->port_cfg[dev_id]; +} + static int compare_dpaa_devices(struct rte_dpaa_device *dev1, struct rte_dpaa_device *dev2) diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index e53e8fa222..46d42f7d64 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -12,6 +12,7 @@ INTERNAL { bman_query_free_buffers; bman_release; bman_thread_irq; + dpaa_get_eth_port_cfg; dpaa_get_qm_channel_caam; dpaa_get_qm_channel_pool; dpaa_svr_family; diff --git a/drivers/bus/dpaa/rte_dpaa_bus.h b/drivers/bus/dpaa/rte_dpaa_bus.h index d4aee132ef..2a186d83fb 100644 --- a/drivers/bus/dpaa/rte_dpaa_bus.h +++ b/drivers/bus/dpaa/rte_dpaa_bus.h @@ -44,9 +44,6 @@ struct rte_dpaa_driver; TAILQ_HEAD(rte_dpaa_device_list, rte_dpaa_device); TAILQ_HEAD(rte_dpaa_driver_list, rte_dpaa_driver); -/* Configuration variables exported from DPAA bus */ -extern struct netcfg_info *dpaa_netcfg; - enum rte_dpaa_type { FSL_DPAA_ETH = 1, FSL_DPAA_CRYPTO, @@ -217,6 +214,9 @@ RTE_DECLARE_PER_LCORE(struct dpaa_portal_dqrr, held_bufs); #define DPAA_PER_LCORE_DQRR_HELD RTE_PER_LCORE(held_bufs).dqrr_held #define DPAA_PER_LCORE_DQRR_MBUF(i) RTE_PER_LCORE(held_bufs).mbuf[i] +__rte_internal +struct fm_eth_port_cfg *dpaa_get_eth_port_cfg(int dev_id); + #ifdef __cplusplus } #endif diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index c97f3042be..13d1c6a1fc 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -1332,7 +1332,7 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) dpaa_device = DEV_TO_DPAA_DEVICE(eth_dev->device); dev_id = dpaa_device->id.dev_id; dpaa_intf = eth_dev->data->dev_private; - cfg = &dpaa_netcfg->port_cfg[dev_id]; + cfg = dpaa_get_eth_port_cfg(dev_id); fman_intf = cfg->fman_if; dpaa_intf->name = dpaa_device->name;