From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0074.outbound.protection.outlook.com [104.47.41.74]) by dpdk.org (Postfix) with ESMTP id D3078BB38 for ; Fri, 28 Oct 2016 14:31:17 +0200 (CEST) Received: from BY2PR03CA040.namprd03.prod.outlook.com (10.141.249.13) by CY1PR03MB2378.namprd03.prod.outlook.com (10.166.207.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.679.12; Fri, 28 Oct 2016 12:31:16 +0000 Received: from BY2FFO11FD046.protection.gbl (2a01:111:f400:7c0c::166) by BY2PR03CA040.outlook.office365.com (2a01:111:e400:2c5d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.693.12 via Frontend Transport; Fri, 28 Oct 2016 12:31:16 +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 BY2FFO11FD046.mail.protection.outlook.com (10.1.15.170) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.679.5 via Frontend Transport; Fri, 28 Oct 2016 12:31:15 +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 u9SCPEMV019399; Fri, 28 Oct 2016 05:31:12 -0700 From: Shreyansh Jain To: Date: Fri, 28 Oct 2016 17:56:36 +0530 Message-ID: <1477657598-826-20-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1477657598-826-1-git-send-email-shreyansh.jain@nxp.com> References: <1477581467-12588-1-git-send-email-shreyansh.jain@nxp.com> <1477657598-826-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131221314762751150; (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)(1110001)(1109001)(339900001)(189002)(199003)(97736004)(92566002)(8936002)(2906002)(50226002)(77096005)(626004)(5660300001)(4326007)(19580395003)(586003)(19580405001)(87936001)(6666003)(85426001)(68736007)(47776003)(104016004)(106466001)(50466002)(105606002)(5003940100001)(48376002)(8666005)(86362001)(7846002)(356003)(36756003)(189998001)(81156014)(81166006)(8676002)(2950100002)(76176999)(11100500001)(50986999)(229853001)(33646002)(305945005)(2351001)(110136003)(6916009)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2378; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD046; 1:DwbSVrDqGgdjqRtfSTSVsIDrmOB12dBbWZrxSdX/lJMIvA8EDj9NRTaP1dS7DFCyGB1gkkOUHM4vGsqjqLAB4pO/m96BZ9Y87AT9BElzpPKjuAO+3Hlt+mLd9dFroh7vDQJVIrl3jU3F5im+MCLnAbPwiEdXgpvolvbwEfpnnRdkDw5UIMR5cImguK9Mr1wuKZGuDUAqAtwDxmd8TiNCUW7bO10NuFvjFmhJR/PTWKMSF48YNt51hptQwWreQaQNqz+KmE4dN1dgUaiUDtaYR9VyPwDSvhzvruK8J5I5ZroV2HgASjZqlf4gO7Erq4ZcQ1HPbbBYt1xY1yx8hASUPEs9ASI7w6coBKFzql/o10v9MWyKKhCSi4SPRLJlwVXr+7q8CXpw1rF+xjx6POhrK4imjb4wMi6ZiaApWDBQhGz6cM5bwkO4bHWFC4Ae7soZI+GQ8jJEek5pyYIC+9LHOLvItFlFafNB0Q8EUvCzMHTR0Jn8eixtmBdUdt41vudEGF+1Qi/eG/IRz0RenSNbS5z/HjY+1BuqT2ixC3ExLXdxrviyO6zfS8KgGj1WpCDS8IV1YxqT1NMXow3NbQihLZnxQ8ch92Ocvzw7ltLJ2CLPWxIceUSzeqOYe8Pjp/g1DIDiMPQzwcGkuYHkm3WJSzaT29cu/f/tW18ZieQBIFt5H7R1eqJI0SKfVoJxsc2rJ/Fsp/34LorWBFQiRyJfgs/Y/oo27WIIbLlqUbsd/uk= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 4febacf5-2f3d-46d3-5057-08d3ff2e4fc6 X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2378; 2:lrzT0+4QHZtw+MxZWufHqdCFklWEIThzP0KVd2xNrzsr9NXovEyFsNLLT3snz8whGmPcPl3Do2X+2hrxhWBEIKU/AqZU+gDHKIeOFPMPYY74Xsxl/z/VJCjJ9y6HpZS6AepOQkuhtpEvPdnIqSVoh4PV7Mr5hlo9rNt0mcAmx2pps17f+G+Bl9BtzTNGJ7RTlZFHKPtHOY8ydpd198e3PQ==; 3:bGaJJ3q6eENoKsvwlLLBr9XOAgfJ1f6YFWM+D/URkNazOIJCidXPgNi72cW0Qxnq9XEVulBKrijJ8xjzxE85H5woJEK4KdvfgOh4tdDv6rz8o+gcYmscp3RUuklFazqDegGNzmhlj6ZHarAcnz7vPUOKyYHo49Fxvz8eWI8TaoA/89vdxiZcSaQxBhkLOs301zTHTLT98ZpzuJQKlsCb2YCceZWJ9uO6SZr4sh6BRHmX0tjunFcsZzUd570I7LWf X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR03MB2378; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2378; 25:IFq3k0DE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19+OmuLy7NrZXQTqLKCNJqJd0NbJ7rlkXnub16nBBFMNd6ltYgmTtf0E=; 4:I/qklymWlntB3+tUQJ1wb1WD9UDgFKPquRCaIZtMjO2DJj3hv6pBK8+DHXWyPWodxNAB3YPsqeZc1JILCyOvax8xo8v3ehQ3CSXpEmzfXw63O8rmGAA2qAeyh/jPR7ABt2hBo8Gmk+TrHkcO7qiC1ocCVY0tXAO4QegC337O1irktEgr8qWedu6tqB8ML09TjZzRxYJ5q6I23JfzSBlsu6Dl7hI3SLUjKTVxlzQ1JxTxke4L0ZwXRQMb3hpY9GoJB0lvNoSbPmAMrD78PDM+rG1N0/B3QzULBtvHoCgjRTOu2SEcgsTEzH2q+CJ6wLlKhzF6DYesGuujYUX4CfDi57apz75t1zZTKuBah/uzmXDb7xzxn3IkOdbfRfwMeG3Fr/dby0kq9yr9N/GaE/B5sgHyMuyp6AFodjVTj6/05tmxyVyyWGLgPHEiByqdSLwGsY/VLB37Ry+3+ABTkH2r6k+J3ldOgixi1ecd/HfVRT2wO2fLPKWSORqdYr51i5P7CU0rNwz1ReRkzWOn63hzVBVMkav2qfw6sUeJO+aVGJtEk8lVBFF3NVK3WsVC3uP6 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)(8121501046)(5005006)(13017025)(13018025)(13024025)(13023025)(13015025)(3002001)(10201501046)(6055026); SRVR:CY1PR03MB2378; BCL:0; PCL:0; RULEID:(400006); SRVR:CY1PR03MB2378; X-Forefront-PRVS: 0109D382B0 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB2378; 23:jtYuyRDjgh0HoxHiB6n20feMyPCM/8jG+31cizlwm?= =?us-ascii?Q?2o21e0qcf1vG1LkJKGsa7Y2Ct0Z+253YcYQiUw3WDlIDxZzwJypV5KfAFeVb?= =?us-ascii?Q?wUxaI4mw6EoBJRwhS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yaEHuljkjMwpw5JvvtQb8l9UKH9IoA5nKGqQDiEEYQuvNpu7aF0xRr5FjDNEYFkbrX5B9H/Vv7lfEdVHi8qJVEsJRQ3bkwDRtVUx9O/W2DeViqBusqv3SdIyPe+QV6zgzmEm2gUQr3zYr7isTUNzDPcEFRtabs8R2sB0ygLfZWfH/P9u4emSeigm5qDeqP6UIlENAk8Mecxc+MJT4hdvRFqAaXXS74W9PJmelQOp7R/lny4XUNDDwx8+EC5p7jbIO9Eos8wM0fkoy95dqGbBJvFAagaL0BH2nLhqEbkwMQiHEmQY= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2016 12:31:15.9475 (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: CY1PR03MB2378 Cc: Shreyansh Jain , thomas.monjalon@6wind.com, viktorin@rehivetech.com Subject: [dpdk-dev] [PATCH v7 19/21] 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: Fri, 28 Oct 2016 12:31:18 -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 a1e3aaf..4c61246 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -2532,6 +2532,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) { @@ -2544,7 +2554,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; @@ -2604,7 +2614,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