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 F0F4110C4D for ; Wed, 21 Dec 2016 16:10:15 +0100 (CET) Received: by mail-wm0-f65.google.com with SMTP id g23so31083843wme.1 for ; Wed, 21 Dec 2016 07:10:15 -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=ztvvo+250k32W/PuO2MQkJUJHqGlRuFhZQ3D/PtJJQA=; b=WDt5cdjfvHED35n2GVdQtlp20o8Gp4mQbVJBy032Et1Du08J5Oofv2shLiXqNIyKdC lKZ+S7N14N1DZYBTw4GbdsbNlN3p4VApJehhRegVum5gGtwME8BISUhO3UbMXG5OBntC o8bqYsAeknAz5l0fkQ/gC833O8YJaDyV9kLKCX3mjhDYoNeYto+hdvng7N9R+pPAUfw5 8u6EZ9NIFNheXPzB1XV9MvTjrO3ekYr7ORzVTQ3vSy3FKg6Icetkc0LTRs9dca4IZPLp TVpnmC03ZhEfBzCJYZlFd5ThtTrSMOcFsD0+c1W3EQvSZFjRxQBj8s7eowDYK8Hab/NI GYUA== 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=ztvvo+250k32W/PuO2MQkJUJHqGlRuFhZQ3D/PtJJQA=; b=H8t91LMgW1BoolUKxChW2MFeOjwn5IIfY5ed4r9SO5llRWJ1CG5a+LjVGeBn2xdCRN PK/nnKSIHHO2OJ9FACD7SPS/rUOqCzoxfKvhzFAG3zV3yfm1Ay1CpBXrKNxPeD9vN0Ka e+vIx/VcmEgIhe8Y63d91X9pAEYtXEgWwO35slOaRrZIyk9JGK+lMdAiJeHe6Xlk3+A0 L6RVPfYoXX+jNqBouG/bH1/XTsV54d9enjLLJaFLce6yZtr18fGSWTfvKRTn+rA/v1uO 5HeIXOOGDoN1Mhec0L2sTaOJtDp0lmR2u6vSfYFejGefqNpXpMzjmkbgTzDm3k6SVTVn l6ZQ== X-Gm-Message-State: AIkVDXJe/sgjFQo0l5h4jMDlui3OA/+km27Uf6Dn7FxK956A2r3gFwZcbGGvfne0SjT7qg== X-Received: by 10.28.29.23 with SMTP id d23mr7182097wmd.91.1482333015727; Wed, 21 Dec 2016 07:10:15 -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.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Dec 2016 07:10:14 -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:35 +0100 Message-Id: <1482332986-7599-13-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 12/23] 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: Wed, 21 Dec 2016 15:10:16 -0000 Use device private information to minimize the places that assume eth_dev contains pci_dev. Signed-off-by: Jan Blunck --- 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 0eae433..ef2026a 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