From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0062.outbound.protection.outlook.com [104.47.37.62]) by dpdk.org (Postfix) with ESMTP id C7BCA4CE7 for ; Wed, 31 Aug 2016 13:02:00 +0200 (CEST) Received: from BLUPR0301CA0023.namprd03.prod.outlook.com (10.162.113.161) by MWHPR03MB2446.namprd03.prod.outlook.com (10.169.200.140) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.587.13; Wed, 31 Aug 2016 11:01:58 +0000 Received: from BN1AFFO11FD053.protection.gbl (2a01:111:f400:7c10::147) by BLUPR0301CA0023.outlook.office365.com (2a01:111:e400:5259::33) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.599.9 via Frontend Transport; Wed, 31 Aug 2016 11:01:58 +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 BN1AFFO11FD053.mail.protection.outlook.com (10.58.53.68) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.587.6 via Frontend Transport; Wed, 31 Aug 2016 11:01:58 +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 u7VB0lad010481; Wed, 31 Aug 2016 04:01:56 -0700 From: Shreyansh Jain To: CC: Shreyansh Jain , Jan Viktorin , Hemant Agrawal Date: Wed, 31 Aug 2016 16:30:33 +0530 Message-ID: <1472641235-23626-13-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1472641235-23626-1-git-send-email-shreyansh.jain@nxp.com> References: <1451682326-5834-1-git-send-email-viktorin@rehivetech.com> <1472641235-23626-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131171149190561632; (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)(2351001)(626004)(106466001)(47776003)(5003940100001)(105606002)(68736007)(97736004)(356003)(7846002)(8936002)(305945005)(229853001)(110136002)(92566002)(36756003)(50226002)(19580405001)(81166006)(2950100001)(2906002)(4326007)(87936001)(8666005)(19580395003)(11100500001)(48376002)(76176999)(50466002)(77096005)(586003)(189998001)(8676002)(33646002)(50986999)(86362001)(5660300001)(85426001)(81156014)(104016004)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2446; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD053; 1:VwjI2nsOo1Pr62quHylxyQNXd8YC1V6iFhG/JEZJhIa8CXxC/ufyGKsfXpoNUBxIkWlw7xI7JIVP4SgHw82bkUx0y6AwhahUTuQPwqstOEIjN2SOkCDhmgMn1IoY6IrPMi3S/O+hdF2BtTEpbPe/7E8PNil+zGgqgYY+GPO9BoymXcbCQzIaNHKs2iMi09xM4R6CwY5BFWhk2Lfat2wR3n2W315jXusYEk9usrTt+PI8oeGSf6JUbczjir1x01o5mGzPYmZyRCBBHVq6AhRB5nE+LkOs/H8KypSTJF7zG1xn0zm55bPjp3YJBtAHASI/6PbHswxCARw2NTAwNjxpJPSmnKiAAzHIdqFsNxjIou/CwWcHuxLVyVBTCsikjDteM7K4UTYqoo6T96KCPJA/zs4aOEPwHfkq/9LvtWnwfUmljFighnBngY+70yH3BEG67CFLALnzoVS4wkkF5pEd8+YwGHgq2AGnaMbeinSIMNxCZJhziALgVjV/wPI3PX4u6hYgbnq9OUSYYRdqBHzpkiLEBNj3g8wAvKgBU1TV7h9Ih0wKGj2Sou2VaQ/CRxuBlxie15JPqNFyOlqWN3F83hwJy5wWcvvwDMvCH3APkzaDLdFj4GblFXT2pPKe7mO5nrc3aKWxUWzq8tyd/S63ZEBAv+DozvWDKIMrnHDKQpzxS6kO8lN2tVqlTjl/yKx+0z/8+sL+kUz7XuraADf5yLnJOKk6eoz9taeFXmoMzqo= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 35e17598-e86e-4b66-7f60-08d3d18e3abf X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2446; 2:5GfcEhfIlpLCQ1NXjMTbDg4wC27LfWCXKOlL2OZG1L7/P6+R7dXFNnTcaFD5mI9f4k1lfWHBspu//t4QWTK8UGYCTF1zYpnd81aUsapMukQyYjrg6iTnqGlLC5bqJh8l0jgnwyvV5CXKQY20xarf//qZhtjcB1+ZxCmR18rIQOuotrULrfjV5e+TauO2O59N; 3:Q+qhnfIob/6y4FH73uMOJUhIkE6XEafxY3OUpol4trvQQChaR9ZMfdIEyHmUndvEa4rIGjO63lLlasP/8l2wd/qtqsfzBVW97Wtx03Gjnq74LiBVv3Hm+ZiX7qOCVyoxUb2ewLwZ7nQNCcSBZ+G0ZEMuifV7/OY8d3Z+5XxCZfKKzn1aaPxyT+DaA8fqOMn/FMvFRtdfSxoSUbXKwHkmhiZIJ6Sq1tSJKTc8Pb7J+e8= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:MWHPR03MB2446; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2446; 25:mtbaq7KlC920oNddoZq544vG0MBSEwGL8j6wa7R5oRxz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iU8ldmM/wLkLQxpQxPn7f/KGrCrQFhuDxtDFncdOAxZQG/p3nSYnuF7FXKxGLarfCQ5lJ8/458CCEZ0qK74H6fP5IEI5AI826GBgtFN4uwbAUreeG4F1WTmydsiFqjFfegwZFiKa55uUvs2dkQnFjIlKC7bEG2dyLnxBqTrOzHtoY3t8j+65Hep/FiBmvUizQdTyEXk2o3uFi4LM3fppvusxyZzNbMlOoRqBhuKl829XVeWorC2yTO/ZY96Xh5yko4NhTk9mdPymg09KxJ4QgbKK+MoWLnaAQzT+9WCd4NoPQV1EbOD05/WhazVA+yw0/qN/IZZdJigeicBSgfsDKVELfbEIG4DFZhC88a3xPmVd5vXMpKm0wU/CrYLuwWNb4A06ftcMQuB/BprvuS8Hr6gElRCToOhoeLhfXjgivrjMUNuLvlC6oDDeYuyvf3vWz3ZJQSHp3nXHxPBhH/NJ7itgUomr77KGTAqO2zsraetO/a685KUT05e1HYy30Lso= 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)(13023025)(13024025)(13018025)(13017025)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:MWHPR03MB2446; BCL:0; PCL:0; RULEID:(400006); SRVR:MWHPR03MB2446; X-Forefront-PRVS: 00514A2FE6 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR03MB2446; 23:B2O5I1bHDnU4paOlJc2wWOyakD4yZjpk+mRYVnqco?= =?us-ascii?Q?p+oGIyq0TVRamglj90op0/JV4ilISb1FsUjwfTc5pjmU7FMSOpa0E3AwRtRt?= =?us-ascii?Q?aHZUg/cUwD56BGwEkHl6cvsPDUYj0EER8H0fDHq7iDTEBy3af/G+/pKZTjxh?= =?us-ascii?Q?/h9lbznaaOAFZKadC+r4b6OkePwYliY8WYhF+Lf91Gjbs03boHM5ghomQCp4?= =?us-ascii?Q?HhHtQUQFVVY6+9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rivalTime: 31 Aug 2016 11:01:58.8689 (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: MWHPR03MB2446 Subject: [dpdk-dev] [PATCH v2 12/14] 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: Wed, 31 Aug 2016 11:02:03 -0000 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 | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index e9f5467..104ea4a 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -2526,6 +2526,17 @@ _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_VERIFY(0); + return NULL; +} + int rte_eth_dev_rx_intr_ctl(uint8_t port_id, int epfd, int op, void *data) { @@ -2538,7 +2549,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; @@ -2598,7 +2609,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