From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by dpdk.org (Postfix) with ESMTP id AD80810CDB for ; Wed, 21 Dec 2016 16:10:21 +0100 (CET) Received: by mail-wm0-f67.google.com with SMTP id u144so31016918wmu.0 for ; Wed, 21 Dec 2016 07:10:21 -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=BHlA2X+9Wpb2JO09LKeOguRim8gKyOIR9w6x81k/8Y0=; b=qVoRFKd5CPaFK3N9w/mfmUmBBvBbueOpfxuQMvk6ggDa+P7t15eJwyPaSGc+72tFR7 gny8ZlnrGtInu3y4KEPMdwdJYOyvKn75daJ5Y/rgV2fg/xxYKgNO4L87gRP+sGIx3hm1 r9nUSq5ZrI8+kh5AWycqfSGJrkBFh+athjSIFZ28VdDmjgg1ihZ1jQWaClzSOoJ7LdfW 5Lx2jDWI6yuLa9sC3O8VrWGRL8zCmXz03P/ezkN2ubxgmzzgcE/SMDnRvBOpJuNSZu4l 1AOvacOerH29No5SleNsPkzdxJjMAeyGSeIHMwlfBvcjxtDbC61y8flRvIYbblzS0LcK t9qA== 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=BHlA2X+9Wpb2JO09LKeOguRim8gKyOIR9w6x81k/8Y0=; b=bYQ+7VjqkuymX35hwy3+2cDRz/Go8Cg+vf4Pfvj+cu97Jjs7IqmDYuK7q7eB/W3rW0 VLOWwmDsyczx+/WnhldVQnH0bvyHsmVLerpq6yhxtCmkwKOn4VLVd8gMUBO7yzz1MJvR 72h4vGcTX1a9bp6yzkj1BCG9BVVZt4ohlc5eQcIHsr0uZfuUquGC9Bj8c5ZHaNFrOE/g paeHaF/cc2mJlQGuS5ARtUECK4PQI5RBj1fJnM2tT67rV/u0euyPFl1JActZmEhDHhkb n/kegTb7akDJNmlfWN+NdoUDR26hrUGxywfxs+fqVuCtrdbhwxTWSSrgQHi1l+rHYZAL +3Rg== X-Gm-Message-State: AIkVDXLYY642BXY+D74nI1k0jvAZgJvX532IKJuFe7oaK3l6KW1mPv+rpOUkwEwaY+Jrqg== X-Received: by 10.28.142.5 with SMTP id q5mr7247027wmd.78.1482333021233; Wed, 21 Dec 2016 07:10:21 -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.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Dec 2016 07:10:20 -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:37 +0100 Message-Id: <1482332986-7599-15-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 14/23] qede: localize mapping of eth_dev to pci 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:22 -0000 This simplifies later changes to ethdev. Signed-off-by: Jan Blunck --- drivers/net/qede/qede_ethdev.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c index d106dd0..a50bd5f 100644 --- a/drivers/net/qede/qede_ethdev.c +++ b/drivers/net/qede/qede_ethdev.c @@ -175,14 +175,14 @@ static void qede_interrupt_action(struct ecore_hwfn *p_hwfn) } static void -qede_interrupt_handler(__rte_unused struct rte_intr_handle *handle, void *param) +qede_interrupt_handler(struct rte_intr_handle *handle, void *param) { struct rte_eth_dev *eth_dev = (struct rte_eth_dev *)param; struct qede_dev *qdev = eth_dev->data->dev_private; struct ecore_dev *edev = &qdev->edev; qede_interrupt_action(ECORE_LEADING_HWFN(edev)); - if (rte_intr_enable(ð_dev->pci_dev->intr_handle)) + if (rte_intr_enable(handle)) DP_ERR(edev, "rte_intr_enable failed\n"); } @@ -809,6 +809,7 @@ static void qede_poll_sp_sb_cb(void *param) static void qede_dev_close(struct rte_eth_dev *eth_dev) { + struct rte_pci_device *pci_dev = eth_dev->pci_dev; struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev); struct ecore_dev *edev = QEDE_INIT_EDEV(qdev); int rc; @@ -835,9 +836,9 @@ static void qede_dev_close(struct rte_eth_dev *eth_dev) qdev->ops->common->remove(edev); - rte_intr_disable(ð_dev->pci_dev->intr_handle); + rte_intr_disable(&pci_dev->intr_handle); - rte_intr_callback_unregister(ð_dev->pci_dev->intr_handle, + rte_intr_callback_unregister(&pci_dev->intr_handle, qede_interrupt_handler, (void *)eth_dev); if (edev->num_hwfns > 1) @@ -1403,7 +1404,8 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf) /* Extract key data structures */ adapter = eth_dev->data->dev_private; edev = &adapter->edev; - pci_addr = eth_dev->pci_dev->addr; + pci_dev = eth_dev->pci_dev; + pci_addr = pci_dev->addr; PMD_INIT_FUNC_TRACE(edev); @@ -1420,8 +1422,6 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf) return 0; } - pci_dev = eth_dev->pci_dev; - rte_eth_copy_pci_info(eth_dev, pci_dev); qed_ops = qed_get_eth_ops(); @@ -1442,10 +1442,10 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf) qede_update_pf_params(edev); - rte_intr_callback_register(ð_dev->pci_dev->intr_handle, + rte_intr_callback_register(&pci_dev->intr_handle, qede_interrupt_handler, (void *)eth_dev); - if (rte_intr_enable(ð_dev->pci_dev->intr_handle)) { + if (rte_intr_enable(&pci_dev->intr_handle)) { DP_ERR(edev, "rte_intr_enable() failed\n"); return -ENODEV; } -- 2.7.4