From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0067.outbound.protection.outlook.com [104.47.32.67]) by dpdk.org (Postfix) with ESMTP id 95EA28D9C for ; Sat, 15 Oct 2016 15:44:58 +0200 (CEST) Received: from BN3PR0301CA0029.namprd03.prod.outlook.com (10.160.180.167) by BN3PR03MB1416.namprd03.prod.outlook.com (10.163.34.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.659.11; Sat, 15 Oct 2016 13:44:57 +0000 Received: from BN1BFFO11FD002.protection.gbl (2a01:111:f400:7c10::1:139) by BN3PR0301CA0029.outlook.office365.com (2a01:111:e400:4000::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.16 via Frontend Transport; Sat, 15 Oct 2016 13:44:57 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com;nxp.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD002.mail.protection.outlook.com (10.58.144.65) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.669.7 via Frontend Transport; Sat, 15 Oct 2016 13:44:57 +0000 Received: from Tophie.ap.freescale.net ([10.232.14.87]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u9FDhhgV021870; Sat, 15 Oct 2016 06:44:54 -0700 From: Shreyansh Jain To: CC: , , , Shreyansh Jain , Hemant Agrawal Date: Sat, 15 Oct 2016 19:15:06 +0530 Message-ID: <1476539108-13170-16-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1476539108-13170-1-git-send-email-shreyansh.jain@nxp.com> References: <1473410639-10367-1-git-send-email-shreyansh.jain@nxp.com> <1476539108-13170-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131210126976092164; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(626004)(8936002)(5660300001)(110136003)(33646002)(48376002)(6666003)(68736007)(87936001)(97736004)(50226002)(189998001)(8666005)(85426001)(586003)(7846002)(356003)(6916009)(86362001)(305945005)(2950100002)(2351001)(36756003)(5003940100001)(8676002)(92566002)(106466001)(105606002)(76176999)(50986999)(229853001)(77096005)(2906002)(4326007)(81166006)(81156014)(11100500001)(19580395003)(104016004)(50466002)(19580405001)(47776003)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR03MB1416; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD002; 1:S+LtSZK1niiRv+LXeL9mnalVvUjDKib/Ua4uuZiM3/faTG7IB5hiT1yR8KplKytVIBU/RVF1t4Tom4sI5qTroWTXgEtliDk+wlmKiavp6OHaalnTNBhWdKXEflsq65Oc7OkyYt4cPyRyo7AfTlwe+NYI9MPUwJWJnEtRmqGq5XNl1lN3R15GJPDlr0OG65x7kpubkBLl3Ax7d+4S1MTRPfKC2xVu7Faba/enJs6Au9OcIq+xGMQpWnW7vQ3QPg9H4mpPR9sBBMA7G6kUdfUQrHJpmGsNvKsrL5kuvhSkzAwnBjYkgOjtert+FZ/iT1WZJE199N892HQeg4zuSrxdM2AuYv12Es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nmzDzlXzF9NabXX1AtjVWqPUT75PTYsYW3oynfQVNOoD5y3whErVOi0Gj0LSSO0ksv8Fp+L8Xs+siBL7vYRKtfACDX968UJVkQQO+7LuI69+NvbRuMAZhoPYxtSs1oemrjhtt2/0JDT14bnj5gEPrHuOQ55c/dZH0xpVg0uScH55UNdQRiy9LNa0bOupNJy5lxxUVKVRmNCqvKnfA0RXI8S4HpGXYeOXnjc7GkOpZnzo/c4EdTsioQ4WbCIUBgCMmcpxJ24zxFiNAbJnoP4w1u4ivPvB3y2vSQ6WT X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(13015025)(5005006)(8121501046)(13023025)(13024025)(13018025)(13017025)(3002001)(10201501046)(6055026); SRVR:BN3PR03MB1416; BCL:0; PCL:0; RULEID:(400006); SRVR:BN3PR03MB1416; X-Forefront-PRVS: 00963989E5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR03MB1416; 23:5lj8FCyTFUqpCoawEWFC6HjLu9J55f5+xg3p++YWz?= =?us-ascii?Q?Vof6yi+zXvywuqT6vh7MocAqyDn74J2SBF+Qd5J2P+yfl2a3QfE81+SRlVJa?= =?us-ascii?Q?IavuoXiiG72kcvBsd5FKhw4/xHhRLLVCMA9yc+55+Jngf/i3SHPwliQnvqJt?= =?us-ascii?Q?PPknzSibM1A7Eg0A9DbKwlKZ7xUjvPR62omCLiGtF/K0A/r6P4dZ94bBVyl7?= =?us-ascii?Q?TGcxgznthrzAhIIaE25p+T4Tugfu5ofrojvZSLVAKBFJGQc+HQYar414qj5E?= =?us-ascii?Q?WeJ8+bTsqBsbr5b7ijVyYu+xdj0yJ+vYQqpgFmY1fHEVmXJRBVigcLZnxJW+?= =?us-ascii?Q?Zw2v4cVoxBPMTN4EgoJiTYiCMshGVjyi5LqhkOcQVFhhidJLY3uD1u6aGHqa?= =?us-ascii?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vhKVVuwqEu+wCJ6/D0+3XT8rYzp0QG9IHF6aV0FkG9+RggLBMxszH1JamZ32UkLULfAJaJ3iQ/sxF08rAmuymzK3BaMLuc+t+4LEfSZ7cCsCeOZQ3ZQ+P1WqT8cruJdc2nZsL6pI5v6iE+xfWGCvLC0Ak9GNOBI1h/goSmKiloJPPASodsSQdNLRhQygnBYFiXTVf3tuF2BypUu5xupMptQbBndsSnMpKS49pzkDlZZnyGZ2z1i8x1SzxtOK3hudt5bRL3QA+jTBtGNKYCLrf+; 5:vRErTmtIQNjjjoCT1C3eOg/tZ4cgiF4tfdbGgswmDdKGAAuUHey8bWGuyU6Xhblq0/8W/RBfl5JVcwRw1xUmp1yBfD8TgHuqJKgSZB+/fdTWXFxNBf5oufjnPJ3Y1aCHD1QyU1FGtmW8+HRTNHP8f9VUWr33NOkIZ548GjejtNXm3kvUVeZlWpCn2WfWGXoZ; 24:YqMaVQoHupzQFmdIIbouBozHuOGjv+46SDO1jy5g+I1RnyHzSs8o+2b28Nw6+5zDN6ut8KSkVZM7VBaMsCMcSS5+k9Cj+idTl2fnNrtCVKE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB1416; 7:qGFXiRQn6dDi5GDoamn8AAsW3sFIjrgkXszPuSQpn+i27efyAGUxczuAcfGJOKybmnlBNTWUgoS9chZJEodg9wd7+vDxv0CISDscQZCGvXTNZ1vAk2AMKybW/KeNuBRl98pWdzqfr86si8gS/L7kbhWEro7FPd9Ta6MjIVUFgffdEKFHfUECupmUzL3Oy30GrMJWkIWUsK5EN491wa5DdYzx7mnZy2d8zSit5f74myMEXuIuoce7bMLDMCxKktMFPm//LxiXW+XdE7wyWXLldMnmi/iMpiYkKsY5HSVtcxeDbD0d2GwmB8VsKnpjfDQQcW4vCFTzELgYc5RbgsPJVk3XJxeoS0Kk11Y+LX4dn4I= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2016 13:44:57.3128 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR03MB1416 Subject: [dpdk-dev] [PATCH v4 15/17] ether: extract function eth_dev_get_intr_handle X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2016 13:44:59 -0000 From: Jan Viktorin We abstract access to the intr_handle here as we want to get it either from the pci_dev or soc_dev. Signed-off-by: Jan Viktorin Signed-off-by: Shreyansh Jain Signed-off-by: Hemant Agrawal --- lib/librte_ether/rte_ethdev.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index daa1285..ba9ae1e 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -2531,6 +2531,16 @@ _rte_eth_dev_callback_process(struct rte_eth_dev *dev, rte_spinlock_unlock(&rte_eth_dev_cb_lock); } +static inline +struct rte_intr_handle *eth_dev_get_intr_handle(struct rte_eth_dev *dev) +{ + if (dev->pci_dev) + return &dev->pci_dev->intr_handle; + + RTE_ASSERT(0); + return NULL; +} + int rte_eth_dev_rx_intr_ctl(uint8_t port_id, int epfd, int op, void *data) { @@ -2543,7 +2553,7 @@ rte_eth_dev_rx_intr_ctl(uint8_t port_id, int epfd, int op, void *data) RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; - intr_handle = &dev->pci_dev->intr_handle; + intr_handle = eth_dev_get_intr_handle(dev); if (!intr_handle->intr_vec) { RTE_PMD_DEBUG_TRACE("RX Intr vector unset\n"); return -EPERM; @@ -2603,7 +2613,7 @@ rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id, return -EINVAL; } - intr_handle = &dev->pci_dev->intr_handle; + intr_handle = eth_dev_get_intr_handle(dev); if (!intr_handle->intr_vec) { RTE_PMD_DEBUG_TRACE("RX Intr vector unset\n"); return -EPERM; -- 2.7.4