From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wj0-f194.google.com (mail-wj0-f194.google.com [209.85.210.194]) by dpdk.org (Postfix) with ESMTP id 5F36B6932 for ; Fri, 23 Dec 2016 16:58:46 +0100 (CET) Received: by mail-wj0-f194.google.com with SMTP id kp2so40789042wjc.0 for ; Fri, 23 Dec 2016 07:58:46 -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=E6XBOB3OsXf5yn1dYi0nhcS70dOWFARHuiXGD1iIVR4=; b=jqctAoplPDs5dC/VJRrbiZW64CMMzXfZ1ShO0J+HhYRvQKIlbopBMxf2w0DDEIrLlz I9YwI/W6O74CIWgMhH13DQJWAvKp372plksFKSfcmCG1eCxQdnJ1xKQ88KUeDAYAIlfc e8LwbJzPxU+llzuQTduVOTgaZE5djl6T5mct8Dnia9+udWSix6l0PbcJn+qrQoY0KZ2R tEq9ookP6CNQWPFrU7c2CtkYsLyeX5eeKITMsPZ5Aty46e64KGYbZAcI37cI1IEUGYUS cjb0AYV9CZhFHVepT0pIIAieErL7UeB/1CpNVs1ebpHHUEwnwmyWlCjMR0/cqsY5ssd0 myuw== 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=E6XBOB3OsXf5yn1dYi0nhcS70dOWFARHuiXGD1iIVR4=; b=Na0fGJng4Bl9wIBREzjaO8sCCJBWa+gG681iiRFSV7SD5qxXknuQjUYvE8lfRkfKEg jMsfhEzlB4vD1KJsrJ6daDKGZd29q2LhHiedQHzbAcFlBoBZPpcOYtTz7e5FZLacAyrQ +i6oa/yE0kQyL14Ab6K4I3YE3VttEV9mytgqxnj9fIKr8Y5Z8fGNXj0Mm8bb0XjeSaOz Z3ZRPmIO6zpeLpJsVhwed/Au1BRVHhvBvWzEhvc35km0qgOt9AJLaeitxL69MjTKJ8eA dsOhQjeUPeI6ADtYrnU+FdIESixsBleBmIbSAyDqH5ZFo3B2jlC62zJVrV1yclcG4K0Z qXPA== X-Gm-Message-State: AIkVDXLGAUKVKhLmylwWM+ZhMy6/HgCfT0Ax5PT7c87PU6iyb0SKPS5ZTWVYrcfXG9VamA== X-Received: by 10.194.205.34 with SMTP id ld2mr13814168wjc.211.1482508725953; Fri, 23 Dec 2016 07:58:45 -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.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Dec 2016 07:58:44 -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:05 +0100 Message-Id: <1482508691-11408-15-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 14/20] 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: Fri, 23 Dec 2016 15:58:46 -0000 This simplifies later changes to ethdev. Signed-off-by: Jan Blunck Acked-by: Harish Patil --- 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 001166a..aefc6f1 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