From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by dpdk.org (Postfix) with ESMTP id 78E8310CC0 for ; Wed, 21 Dec 2016 16:10:24 +0100 (CET) Received: by mail-wm0-f65.google.com with SMTP id l2so5472496wml.2 for ; Wed, 21 Dec 2016 07:10:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=cU5naR8JW3/SBJb6lrKM4iQixI82Kb/9jmKVLGC781o=; b=Q8QfYEtgzeLx+XW5ucy97LE7/87BMKPEQamFQdTz9xvqdNnRwyXKEXF2LTgLhu8nJs mnN/9Yr7StXGHeD/ElmBEL2TMxkJ44xLYP/PBofCMOpkInNHFJt8ojf0xvYN3FNUrTYy jgdNfLD02zxkppRXg4SzJTSKVnv/+bglH+u4sWy++tpu+eK01TvQl9/1jY2AtAzOXoI6 kO8xuLUamkJVXxLGKOyB6lWPh+u1IKs11ZyzAupeGdVdwqLMiKhY21R3TkR8MpaBs/rU IuCIWP3PWfFjL8IbyRQ0Whj07Ep47W6D/PrLtLLSd6Liv1UTGk4L4pth8EnAA2Acm2N4 6NHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=cU5naR8JW3/SBJb6lrKM4iQixI82Kb/9jmKVLGC781o=; b=FSTYJlDRF1M0vGyMSzK+JyIZ0xlxhw8FlcwEwJyrSyT5Ty+YOVfYKlSHgkkM7wgCYh mCTNdlAT3wlCpBPu1scfOBGtbWXExpmj9FHiunCRMjN1GlQMscD4fGeR9XL4WoQPtk9h dsQ09Ft0mat1Qs0cR1u6B5fkNstR43GRwXNKVBtNnNJEVN0PatTe3EbYSDnxmh06xReT XrgO/tYRrJgiW+81+SzfWEHBeKBCaosFx6GSq5DSmshjTb3zobaQTMROZ+Xpa1eNCv4U CVKygBj2ho5v3zHQSWu79hs3bO+tM5KgviBWknuB13xI+k5QFb1B2mz6w4qcj3z+cHUU dJaA== X-Gm-Message-State: AIkVDXJ5phoA4uTrr4HZUbxnXDCRPBLLdtP9GEdLE3W9UMm1Semth+TLEyxx4ujITRvkVw== X-Received: by 10.28.17.20 with SMTP id 20mr5070106wmr.99.1482333024177; Wed, 21 Dec 2016 07:10:24 -0800 (PST) Received: from weierstrass.local.net ([91.200.109.169]) by smtp.gmail.com with ESMTPSA id 135sm27627375wmh.14.2016.12.21.07.10.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Dec 2016 07:10:22 -0800 (PST) Sender: Jan Blunck From: Jan Blunck To: dev@dpdk.org Cc: shreyansh.jain@nxp.com, david.marchand@6wind.com, stephen@networkplumber.org Date: Wed, 21 Dec 2016 16:09:39 +0100 Message-Id: <1482332986-7599-17-git-send-email-jblunck@infradead.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1482332986-7599-1-git-send-email-jblunck@infradead.org> References: <1482332986-7599-1-git-send-email-jblunck@infradead.org> Subject: [dpdk-dev] [PATCH v4 16/23] nfp: localize rte_pci_device handling 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: , X-List-Received-Date: Wed, 21 Dec 2016 15:10:24 -0000 This simplifies later changes to ethdev. Signed-off-by: Jan Blunck --- drivers/net/nfp/nfp_net.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index de80b46..2609f97 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -718,10 +718,12 @@ static void nfp_net_close(struct rte_eth_dev *dev) { struct nfp_net_hw *hw; + struct rte_pci_device *pci_dev; PMD_INIT_LOG(DEBUG, "Close\n"); hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); + pci_dev = dev->pci_dev; /* * We assume that the DPDK application is stopping all the @@ -730,11 +732,11 @@ nfp_net_close(struct rte_eth_dev *dev) nfp_net_stop(dev); - rte_intr_disable(&dev->pci_dev->intr_handle); + rte_intr_disable(&pci_dev->intr_handle); nn_cfg_writeb(hw, NFP_NET_CFG_LSC, 0xff); /* unregister callback func from eal lib */ - rte_intr_callback_unregister(&dev->pci_dev->intr_handle, + rte_intr_callback_unregister(&pci_dev->intr_handle, nfp_net_dev_interrupt_handler, (void *)dev); @@ -1122,6 +1124,7 @@ nfp_net_rx_queue_count(struct rte_eth_dev *dev, uint16_t queue_idx) static void nfp_net_dev_link_status_print(struct rte_eth_dev *dev) { + struct rte_pci_device *pci_dev = dev->pci_dev; struct rte_eth_link link; memset(&link, 0, sizeof(link)); @@ -1136,8 +1139,8 @@ nfp_net_dev_link_status_print(struct rte_eth_dev *dev) (int)(dev->data->port_id)); RTE_LOG(INFO, PMD, "PCI Address: %04d:%02d:%02d:%d\n", - dev->pci_dev->addr.domain, dev->pci_dev->addr.bus, - dev->pci_dev->addr.devid, dev->pci_dev->addr.function); + pci_dev->addr.domain, pci_dev->addr.bus, + pci_dev->addr.devid, pci_dev->addr.function); } /* Interrupt configuration and handling */ @@ -1152,13 +1155,15 @@ static void nfp_net_irq_unmask(struct rte_eth_dev *dev) { struct nfp_net_hw *hw; + struct rte_pci_device *pci_dev; hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); + pci_dev = dev->pci_dev; if (hw->ctrl & NFP_NET_CFG_CTRL_MSIXAUTO) { /* If MSI-X auto-masking is used, clear the entry */ rte_wmb(); - rte_intr_enable(&dev->pci_dev->intr_handle); + rte_intr_enable(&pci_dev->intr_handle); } else { /* Make sure all updates are written before un-masking */ rte_wmb(); @@ -2400,7 +2405,6 @@ nfp_net_init(struct rte_eth_dev *eth_dev) hw->cap & NFP_NET_CFG_CTRL_LSO ? "TSO " : "", hw->cap & NFP_NET_CFG_CTRL_RSS ? "RSS " : ""); - pci_dev = eth_dev->pci_dev; hw->ctrl = 0; hw->stride_rx = stride; -- 2.7.4