From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0040.outbound.protection.outlook.com [104.47.41.40]) by dpdk.org (Postfix) with ESMTP id D2295BB50 for ; Thu, 27 Oct 2016 17:18:13 +0200 (CEST) Received: from BY2PR03CA050.namprd03.prod.outlook.com (10.141.249.23) by SN1PR0301MB1632.namprd03.prod.outlook.com (10.162.130.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.679.12; Thu, 27 Oct 2016 15:18:12 +0000 Received: from BY2FFO11OLC009.protection.gbl (2a01:111:f400:7c0c::153) by BY2PR03CA050.outlook.office365.com (2a01:111:e400:2c5d::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.679.12 via Frontend Transport; Thu, 27 Oct 2016 15:18:12 +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 BY2FFO11OLC009.mail.protection.outlook.com (10.1.15.0) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.679.5 via Frontend Transport; Thu, 27 Oct 2016 15:18:12 +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 u9RFGIfn027183; Thu, 27 Oct 2016 08:18:09 -0700 From: Shreyansh Jain To: Date: Thu, 27 Oct 2016 20:47:45 +0530 Message-ID: <1477581467-12588-20-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1477581467-12588-1-git-send-email-shreyansh.jain@nxp.com> References: <1477310380-17944-1-git-send-email-shreyansh.jain@nxp.com> <1477581467-12588-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131220550925223228; (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)(199003)(189002)(2906002)(19580395003)(50466002)(48376002)(11100500001)(97736004)(86362001)(189998001)(5003940100001)(7846002)(6666003)(36756003)(5660300001)(50986999)(104016004)(76176999)(33646002)(626004)(92566002)(356003)(81166006)(110136003)(8666005)(2950100002)(105606002)(586003)(47776003)(68736007)(4326007)(305945005)(81156014)(8936002)(77096005)(50226002)(229853001)(6916009)(87936001)(106466001)(2351001)(85426001)(19580405001)(8676002)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR0301MB1632; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC009; 1:7vRquzsNT1f7L4NvrNKcdIKe/OxiBPPDzXWNqR+Yz4bM+0AnaVaqpTELDMxM+SZ6iW+7/ZAhx6K5uWm/Z+yfr6c1/x9VBESdO5Ic84U/CTdaIfHVbEmR7muj3Or9Ca6QxP4tYPt7yBJ3fRDC6NOZMla3y5a74s6wrKrcNGAASzob0KYecc2D2bR4xvZ8GX41+fLFyFLSxO0V+rDVBJLGwAqPoOpWNzXtHSkoGqlLH6E3AST7vhlbb5dTCvRCnqbElvnNNu6U2EEBJSqWfxAXmz5WzhTJNS/HAorBuWIzKH4zWxTfz2PEzOHY09C0QlULhi/22ngbnH3dGWGzxtgkbIZK/CrHhBLYEBQDpr1ncPo9EDgIBQXjM9tHRXuQ55rFhJatKPSWmcTXk8uV68KIS0RrdDkWSbXihYU332Jtw4tPGtVYZMEWCKoAB/REY5LGZjGLuysUrh+KktHGyuhMeMfyEuyzCI/MC6T7SQuStLXSA0LsBW3bJarhZdK0WI/YG2CgtNTOzHs5mWrBoTPkVy9C21Rp7Ur6d94FzWVKYz9LRiHJtqHxyPyOgf02/1l+j1F4noj7D//gU7L7jIbUYo8QD91fp0e7qysMGcgFXS6fSYiPOMg/H9kehnwhTBul1Wb2hGNk04i1WYEvH7I9vRmNk0FZlw82kZ1Ay+hDqqJdYzJrEDNPi0bAOCBgI0JNg2U9FGbDijUKfbTFNwi7LiJ3b82/8yDf9dRkVQYHYm4= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 4a4a57d6-31e8-40dc-053c-08d3fe7c7798 X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1632; 2:nVnlLNLyzGUXsA9ir+ln0e7LT8Ceo7C1vMZv/dZd1SpjyNXEh+GMeZIV+RDsoWe2JR1UV2bU36c1SoKRjZFsSRlRvFWHMzHJlgNfNR2eBFwCDtmWqHSYgEAZLRbDjZ5HpoLKVFX6+k5DAAlEIkiIoIEXz+EDiPPBNbUbSAvcqegO8NFlh7ZkZ5dYnUDEBl+WMSd+OV4Xwqus4TAFxDBDdQ==; 3:SmxuA3Bi9J+hk572k6f2mBq3m+GEA5ahCeDqextBeS+AyObbfbJd4ejYKEKsjgLWXDxsIkmPJleztwzt+KAEapM8+uxipbAf653olbkzDJjkrMeZEX4XqNO7tbJ4w0hMr1K8X05KE/+hIBIIZSEWf/5q9c9/YWE634yHERVuGZa0miyOKO3mEhoiw8iuf1MyO056O3aMGI3A/5QF8Dn3yLAO7Dthz1MRNeFkOLjtV0IPi+9a9xYY0nNrZ/ytmSr2 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0301MB1632; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0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dg61YvcA4OEYCmuLRSBcyYS4H3pcc7p0V3jviH9QhF8UTStn+C+u/r3Y7Ge7Hlbdw==; 4:skP0Gs1HPHgH+r3VFb0qsmAGkif6ZnOqiuAh2nXANe/osuWNiZ7n9y0Vx6E/2pkCvXO74QIN1jkrwhl46FlDEj74Cv+ofJSq8wq27RLE1aQNacu05karnHjNbySyymcj6WfkAjHsPtiDIZWkUSPAeHziL+lQyoOLz/32dYOQq26b6ZE70JEz+zuasV9YZULxuhyA9XEpy+ubwHQl+e2apAlsUJFVyoijKg+Ta9LISfGj97yHsu00CoHfLHBqvYkiHD9ifTme7zbHCTlIo/JuQU4LN2HqS714dD8yS1FxGfDUSZ9koFfhpHCKB/gV7qwD077xyYucmXqPXmH+/7fSWKiF891sGnaFYTjhzPAB1p7RClN/Iz0xGgA5MUKYh0j7lixzG2KSvhXU+N5Bn0bmzmloTl3W2ReYKLcI++/9ixLBfqipyw/q0E1RMHBrB+nWuwdFUXN63N+kh1qK3hHEfARReGgBtoGXxUnDDrIg8AjB6ENugzuugsDRLMJdleWK1R8/CyV48Vb6ymWgIk9zGFnRAATDWMc/EZZReYFUpQ+YssQF34U0RFviembCQfOE 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)(13024025)(13015025)(13017025)(13018025)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:SN1PR0301MB1632; BCL:0; PCL:0; RULEID:(400006); SRVR:SN1PR0301MB1632; X-Forefront-PRVS: 0108A997B2 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR0301MB1632; 23:hOUuFTmjXqIUY/M+dtkHcfmUvT/ZyEAp6FHUG3F?= =?us-ascii?Q?6TUgyXFUB3iTmUO3VSkM/5bFIw5AW0jMcjCK3iyeAYil+N7ZH1TPz8r3jQpA?= =?us-ascii?Q?cDRbmpKKZ2McuA2x5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C?= =?us-ascii?Q?6FDCzYQrAezzK1RJtlPeRSK8bKJdkqCrJkHUMSGDhV/lXTEK3HiS/xM/R5M7?= =?us-ascii?Q?AMotRnqy75BohTCqMuf4frvedC7GXYmWyuA6v1ZGrjCQOFutq/cZOih48EuL?= =?us-ascii?Q?TFt2yvnmLGQ0tSJrzc9ctSeIRKaHXSGoWpYr2jXeSAySTM6J6oRayp9Qe49k?= =?us-ascii?Q?hn8UN3QsRL2Nv/VgwgK40oMu59hn3+UDROE+Q?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1632; 6:MgBfeksk9CEu4A29Yj+oRtIV/bz+tIWO8OM+8C0qmdeq8vYfrepwR3zsolBnMBD2b4QYPbTxMezIgUh8lyvgwcxZKFHDVAUhKTj7JrBoyj6TyuBX9UtkJQBqC+EQem3wB7gpwB1Oess6KjoI5DLCFyp1k7YMViRSDrhE0553cXgtlLEVxIiT3XEmHBx6psGSYUhy/CLrCAXKUvv3gAwEB7XLRG7Wdl62wiS3nXvFGPfdvcNZvRGux/8YkBsj0iLAVuBqmJMPDiBwOuVhNKmoW8nU6rPB6DZuRf+L3KsI+txVzYiRmugoOI2WExN8L2Zs; 5:IZVopabG0tpMFZ+BbYrMe3fgabGwmnC7h7KqVrZa6m5VD3tO1RkYFwKbiaFKTnTgwNkvlGuE3RxY8GyUPhyeYOHRkio3tXPU6qk/YLlMv2ceNVP9iWGb8OUCRC8lyYqlaiiOoZ033jYTiw0M/wGuQS20huN+n2nhew0JEcJ3foJI8jrYSzw1w+1w5MSEH/FB; 24:Iruo6I+RVSdT+tvx4iObujM9+XWROB2coerghQtYSVHgZhRpJhl8/crr9VQs/3qxTM7kW/qfBeZSuo7T7qIHgDremcoLcloM2gUzyJzyWD8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1632; 7:KKrDUzMAxegnwVPHXps1Vff0UN3gWer4n/o3FAgEE4XzddwkZ8SeawEI3QCSCXIKcg35EgjBkHSK4jA4HAc8vw0LClK8yZVwBgSDNerIHBfxXFjivhZQKrk7nZL6B0gjNyHTYTJmcpUlg4psVJ6eOZI7Lh9SPs34Q1K+h5/Vf3WyLYMcJ6Xo9YA/sJRwlM0qcfrm/+eqNKL8jQzdRTsqc+aKHlBjrd5YzsKl9qJ9f2xxCnaKg40BaTg/ookqW5F3vY5QBlB/YphBHsW9t3rC4Y3S0ttpbhJKz3PEoVeR12bWsfY/Rm754ZeMRVoCS/J9abuM1slW1bxZl0i75RKmFMUUTQTwWf/MPfKM8YQWlF4= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Oct 2016 15:18:12.3039 (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: SN1PR0301MB1632 Cc: Shreyansh Jain , thomas.monjalon@6wind.com, viktorin@rehivetech.com Subject: [dpdk-dev] [PATCH v6 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: Thu, 27 Oct 2016 15:18:14 -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