From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wj0-f193.google.com (mail-wj0-f193.google.com [209.85.210.193]) by dpdk.org (Postfix) with ESMTP id AD3BD2C5E for ; Fri, 23 Dec 2016 16:58:48 +0100 (CET) Received: by mail-wj0-f193.google.com with SMTP id kp2so40789155wjc.0 for ; Fri, 23 Dec 2016 07:58:48 -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 :in-reply-to:references; bh=JVb/1+ClNGEi1sQwAoDT0cEc6kjxRdpmmfq9Dsts+O0=; b=DDmDI3DY5uCaTuLrVh6iJ7mhFsb0wqoSPdyCwvZDivgJsxt5BfA/oZ7b1gxph3Ui5+ qQP1njp7Q01VuoT8rs2CiQFejF+dTc2LMv+jSABJypACwPpjJjviws3iRTf3UmE9by+y ZneAZ7Gqgm7F/VlRyejM7S5fOT3BZO5uJUhSiQjaSGhZVQG2egsvAdFpiV5CttiQQ+0U 0YDGPC2ShIf7jSZsjgckdKHdJtWk7RGivTZBbmnPz2SBuvY/niefGUsRT8jrzDuequLs rGrXURGy5xQ9iUswIHm86kS7diP7uIyqCpU4Bfmaj9BCIQW9V4re8w1RVkYp5cVk5PwT 4PBw== 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:in-reply-to:references; bh=JVb/1+ClNGEi1sQwAoDT0cEc6kjxRdpmmfq9Dsts+O0=; b=ZoGCyftrEQq+D7dqLjYz9H7yZ5saKavlYHnw+UfVGK0rw0ZeRgfwdIVbveLOQSjySO tt32NDqzxthp3BmP86Br9sFyrIsZGnAFHlj4rusJuyOqzVIqhg/Dz4wE87wEvfHLSFHJ TSPYYPcpBhdr5GabD6SiIJSgChuDyXf17aJCLwjfLnu50LSbzpF6vmtrxxjqn4iSi7uS /gE33Uev9KdnqLHwwzV1Vr7nhiDV0I2XTRTfNDbqyHpvseHBtaXH5Lk5gq0aFUapeFV2 9/cTziCqogOreEoXveCl3105r/SQnyXEJPuDWq76e0QjhGx6PE8sqv0XdggjWl3DUXVL lRsQ== X-Gm-Message-State: AIkVDXKSx2GBL1TaWZlVOrSV6XocsXTx7lSXn4xkYgX8jlNbp1mcYvnNB+B3nVw++ctZPQ== X-Received: by 10.194.187.103 with SMTP id fr7mr13583096wjc.99.1482508728439; Fri, 23 Dec 2016 07:58:48 -0800 (PST) Received: from weierstrass.local.net ([91.200.109.169]) by smtp.gmail.com with ESMTPSA id jm6sm41027072wjb.27.2016.12.23.07.58.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Dec 2016 07:58:47 -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: Fri, 23 Dec 2016 16:58:07 +0100 Message-Id: <1482508691-11408-17-git-send-email-jblunck@infradead.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1482508691-11408-1-git-send-email-jblunck@infradead.org> References: <1482508691-11408-1-git-send-email-jblunck@infradead.org> 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 v5 16/20] 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: Fri, 23 Dec 2016 15:58:48 -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 e315dd8..c9b3ef9 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