From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0048.outbound.protection.outlook.com [104.47.38.48]) by dpdk.org (Postfix) with ESMTP id 54454298F for ; Mon, 24 Oct 2016 14:00:01 +0200 (CEST) Received: from BN6PR03CA0012.namprd03.prod.outlook.com (10.168.230.150) by BY2PR0301MB1621.namprd03.prod.outlook.com (10.163.28.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.16; Mon, 24 Oct 2016 12:00:00 +0000 Received: from BY2FFO11FD021.protection.gbl (2a01:111:f400:7c0c::185) by BN6PR03CA0012.outlook.office365.com (2603:10b6:404:23::22) 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; Mon, 24 Oct 2016 11:59:59 +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 BY2FFO11FD021.mail.protection.outlook.com (10.1.15.210) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.669.7 via Frontend Transport; Mon, 24 Oct 2016 11:59:59 +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 u9OBwEMd008267; Mon, 24 Oct 2016 04:59:56 -0700 From: Shreyansh Jain To: CC: , , , Shreyansh Jain , Hemant Agrawal Date: Mon, 24 Oct 2016 17:29:38 +0530 Message-ID: <1477310380-17944-20-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1477310380-17944-1-git-send-email-shreyansh.jain@nxp.com> References: <1476539108-13170-1-git-send-email-shreyansh.jain@nxp.com> <1477310380-17944-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131217839993687554; (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)(5660300001)(626004)(36756003)(305945005)(50226002)(11100500001)(50466002)(8666005)(81156014)(81166006)(110136003)(2950100002)(48376002)(7846002)(356003)(87936001)(8676002)(6666003)(6916009)(19580395003)(19580405001)(85426001)(47776003)(33646002)(189998001)(586003)(50986999)(76176999)(86362001)(2906002)(105606002)(4326007)(5003940100001)(77096005)(8936002)(68736007)(106466001)(104016004)(97736004)(92566002)(2351001)(229853001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB1621; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD021; 1:IqGqU5UF5q+MjCOdZ7vMxIg25vur14axIQcazS4HZ4U9aLgqAVXnKVKcvDDqjkl0+oIcdlhHI6ye7oFAbmUkaqurKNHaHBEXZlNPjjDBqOoIDK/RusBQO1Fvj9Iyl6R5/PLtQjPS18fe3arofFBBVCuh+IHaCbHCZBnE+vZYKqgI/ujFB3aiRSiAQTePOSuubdBXxzNAMG2CZ6z13FgnKe8Y1CC0VbsX1AwKzaUjRdcy8e6wvbZx5U6lKyGPKErmIhhJUSqNZlxrPl8Cusm8+pmJevKXuTcm+XlR8wQXpHBuXYRqicgJK6uDCJzAnx4lscK36n6VyygQ7YHyJDVQmJ/0A+CnOIkVcyizYjEqca9sOw8zlrW5L1Xo08o7LWNtfeeya+K/bZTKLHF3wWYRVEHzEMiYci4Q1vOlVRg0BzcYeSj1+OesmdcGXTqeVwOhOjkB6h5uNAcRtit7T/bzVrNABAF5/W390VsthYUR5ppMxnFrBz/+6kD4vQ4qeABbiN7GxNjxL+vtB/XL6sFl5ZGFHNRGK1O8QQZhqtIEaO8gGKO+qOgEJqFebP4Lk2rUF5+Z2T/kcYK6ohlmhFCdwkrNzHHp9VGIQh2PbAI96MVOE+G8vp6zWR9Wu4CGczkRqPJ70CN6/WwI1aYI9uYOCLD7XcJNOLWCSHjxcZMl3xnB5fxtHPhTHwwMUIuudywqcN/X4mrIzSspoUIt3L9uCtMhdgPAN/8loJ5mmOjjuz4= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 155d87e4-0a03-4c70-8302-08d3fc054768 X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB1621; 2:tOiD3vaRhG5mlM6OebOLndJOmlccQgk9vxHQgUtXLcQ4yr64rKpAvmjYilLVYQIz4O0sUEApAKZSMcTidDor7uDiaWJjCtthvC49263rB/uut7A3qlC4282jgIBJxoNuP8J6135W7ZnTlN51RdKQ36jNd40UJhD2DpxLhA9c7Oo1dWsTFLzIMpFJzfqsPRu3Jz2VvAgANuPbO6MrC+YSJQ==; 3:GP1l9/TBfo1S+pK/kAvReeN4/z2xSJ1J2AAOOxYajuWh73T5wLLRqnhnNGbXm2sVGS4+CeNliA5rjQw5HwvVMJ7cWQ8Zj3PF7GgXOK119wlrwow8wYcwWTP+hlghfKDmfSWFj38g2AyEEH8e0clvyqQO0rMZrRe0Q2p4w4FhLQPHxpoEHNaBCqIUJdKcCFIV5SI4SdCpS3lcyJJ3S9Q2ai5fvI2IQy2wPO7FmP6Q1W/T7uSZyMG1M+NHCDHaW8/5; 25:jDp4JPems/jJ1LDYh59RYgtdEMWYqRkUOqwZNa8Q6xgR6SEASXEXB2Fma3ba9AiCYy70Ov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spBKOayPbC/rLSBkeS1gqWwkpGvEkG0aTkWhIOmKzoMB3f99d2IKk83qcAckDp4yyyV3bocA1A5ijOIWD5ACTJC60lctJmWet+8NIJ+EAVhBRlwBwbYN363xKYHa5P3B/+5Cloo3Q8Oupbqe+He5ioP7sd0oFK8CNHWf6WEdcEZ2RASiaipmN07dRs1RHH6xM+wSh+SdTxxXn/KFkGbsv9rDG+vh1M4TF9gD8j55GFaBOc44357HMr1+KTPRbSqWMqpFqXlg/0ifTzV4FLZqU0HYGz9UV9e5dvml8b6WuJ6lRwjMXTWhmK7AB 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)(13023025)(13018025)(13024025)(13015025)(13017025)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:BY2PR0301MB1621; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR0301MB1621; X-Forefront-PRVS: 0105DAA385 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB1621; 23:2BM7x3KEJBuA3GNLoO4KOhk6WVjTA4ho3ekZ2mS?= =?us-ascii?Q?fHu/TCPBbqdU+pkI88e1p1j4I2RuxPdZFHBDXb97h+2jucW5MnHJqao9pJG3?= =?us-ascii?Q?4WR9f4k8Ng4/9+SOp3OcwEply7aguBwZ9dhQ1n27QLoUd49S/BkIGIS9s3cK?= =?us-ascii?Q?nZKxJyBNgPN4KVhdGqZxjwIdeZzYywfpOGQQMS6UUiPDybRO3QiteYKSKx66?= =?us-ascii?Q?Sx7CWBZmsAqbdyu1Wm8WDMdTWBfG6eTi4bzDxSuj8vWODEmszIVqqK8Za+5r?= =?us-ascii?Q?pIBNAdbvPov4QCdo6yH4AUgNet3z4JZ4oZpULdRnBlHV2Bl2nvuxEWRiuQbE?= =?us-ascii?Q?Zau8HNp4+OL8+1OwEcPfPNn4izEQgQ0lEbSsGb6LfgPh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exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2016 11:59:59.0411 (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: BY2PR0301MB1621 Subject: [dpdk-dev] [PATCH v5 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: Mon, 24 Oct 2016 12:00:01 -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