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 E2B2E37B1 for ; Fri, 23 Dec 2016 16:58:43 +0100 (CET) Received: by mail-wm0-f67.google.com with SMTP id m203so42199755wma.3 for ; Fri, 23 Dec 2016 07:58:43 -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=EXcIPYy4iYH2ZEKzfJBIJy7NtHe5+IEr/2TWZkQmjIY=; b=p/aphE9N4LvyVgy4bH3AM7LWyup008FUFky10EJa4dG6nLWwBpsAYYdCQysXFbozcg 71ky6Yoh/EeO9/lFqAhqz6/hUIV0BFm0yoJwQVu7gxYwXV3E5xXeWynFpza7dbpJ91l9 b55kpMGXQD1eqXWf71ZEF4BpZ+cOPi2mv1fdcRPizklN0A89h7g45fmGKN6rsHMa/rIS wEN/SxoNT5XBkcYpX98um+71MgB0Fg1SULDuCzbFGnj5CCTRMK9h7cekOT6din/LB2VC RjpDyj+A/SdCmc5dNtnR5l1tRLsvOXPZH6pVrYMN24gPxCuB9BcbYOlyEboi08JmWSX8 +4pQ== 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=EXcIPYy4iYH2ZEKzfJBIJy7NtHe5+IEr/2TWZkQmjIY=; b=cDpEgGa273i3A3hnb0GS9Ht9YycvqGwYk4AQoHIDmH5DePa8azXxERYVLsoXa58H+6 dzrC/ctfzLwa7zxW7oh1FDoeg7wzQlZMVZw4GX5XOQpURTAypQWSn3dfg8tbOeWuKaJt Mn0MCfn9hKGwFPZZ0KKxgZG4YVBwFuDgSxEixts7bPmfQLlYidnOGfTeXdCX0gggVb29 ao4uIbMKzG19RPc0nHAOToCKSe2UyDAQ7Rh6B+thDZH9xPqt9oBb65AapP9nyCtf4XZ+ zXB8WexrhsUjRFG6/Q0u+Dj93a5v12xxUUQHzuhrl0p4VqzYbahP2dzh2GaQV9KbXdQu 37zA== X-Gm-Message-State: AIkVDXKpSpBB2raU1/sZk8H1iaVA8GsBY1d4wVbj+e/yuID+B44xlmS4BfhSEzVdtdO7YA== X-Received: by 10.28.21.1 with SMTP id 1mr17648001wmv.133.1482508723488; Fri, 23 Dec 2016 07:58:43 -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.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Dec 2016 07:58:42 -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:03 +0100 Message-Id: <1482508691-11408-13-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 12/20] bnx2x: localize mapping from 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:44 -0000 Use device private information to minimize the places that assume eth_dev contains pci_dev. Signed-off-by: Jan Blunck Acked-by: Harish Patil --- drivers/net/bnx2x/bnx2x_ethdev.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c b/drivers/net/bnx2x/bnx2x_ethdev.c index 0f1e4a2..fd95136 100644 --- a/drivers/net/bnx2x/bnx2x_ethdev.c +++ b/drivers/net/bnx2x/bnx2x_ethdev.c @@ -119,12 +119,12 @@ bnx2x_interrupt_action(struct rte_eth_dev *dev) } static __rte_unused void -bnx2x_interrupt_handler(__rte_unused struct rte_intr_handle *handle, void *param) +bnx2x_interrupt_handler(struct rte_intr_handle *handle, void *param) { struct rte_eth_dev *dev = (struct rte_eth_dev *)param; bnx2x_interrupt_action(dev); - rte_intr_enable(&(dev->pci_dev->intr_handle)); + rte_intr_enable(handle); } /* @@ -187,10 +187,10 @@ bnx2x_dev_start(struct rte_eth_dev *dev) } if (IS_PF(sc)) { - rte_intr_callback_register(&(dev->pci_dev->intr_handle), + rte_intr_callback_register(&sc->pci_dev->intr_handle, bnx2x_interrupt_handler, (void *)dev); - if(rte_intr_enable(&(dev->pci_dev->intr_handle))) + if (rte_intr_enable(&sc->pci_dev->intr_handle)) PMD_DRV_LOG(ERR, "rte_intr_enable failed"); } @@ -215,8 +215,8 @@ bnx2x_dev_stop(struct rte_eth_dev *dev) PMD_INIT_FUNC_TRACE(); if (IS_PF(sc)) { - rte_intr_disable(&(dev->pci_dev->intr_handle)); - rte_intr_callback_unregister(&(dev->pci_dev->intr_handle), + rte_intr_disable(&sc->pci_dev->intr_handle); + rte_intr_callback_unregister(&sc->pci_dev->intr_handle, bnx2x_interrupt_handler, (void *)dev); } -- 2.7.4