From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0049.outbound.protection.outlook.com [104.47.33.49]) by dpdk.org (Postfix) with ESMTP id E31BE6CCA for ; Fri, 9 Sep 2016 10:45:09 +0200 (CEST) Received: from BLUPR0301CA0013.namprd03.prod.outlook.com (10.162.113.151) by SN1PR0301MB2014.namprd03.prod.outlook.com (10.163.225.157) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.609.9; Fri, 9 Sep 2016 08:45:08 +0000 Received: from BY2FFO11FD012.protection.gbl (2a01:111:f400:7c0c::161) by BLUPR0301CA0013.outlook.office365.com (2a01:111:e400:5259::23) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.609.9 via Frontend Transport; Fri, 9 Sep 2016 08:45:08 +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 BY2FFO11FD012.mail.protection.outlook.com (10.1.14.130) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.587.6 via Frontend Transport; Fri, 9 Sep 2016 08:45:08 +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 u898hoZ6018305; Fri, 9 Sep 2016 01:45:06 -0700 From: Shreyansh Jain To: CC: , , Shreyansh Jain Date: Fri, 9 Sep 2016 14:13:56 +0530 Message-ID: <1473410639-10367-13-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1473410639-10367-1-git-send-email-shreyansh.jain@nxp.com> References: <1451682326-5834-1-git-send-email-viktorin@rehivetech.com> <1473410639-10367-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131178843083428218; (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)(97736004)(189998001)(229853001)(2950100001)(85426001)(2906002)(47776003)(5660300001)(50986999)(33646002)(626004)(81166006)(8676002)(81156014)(7846002)(11100500001)(19580405001)(19580395003)(36756003)(2351001)(68736007)(76176999)(86362001)(8936002)(50226002)(50466002)(48376002)(77096005)(104016004)(87936001)(4326007)(586003)(92566002)(105606002)(110136002)(106466001)(356003)(5003940100001)(305945005)(8666005)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR0301MB2014; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD012; 1:4sqwwB2czpGCp5o8Vy5B1usl6ksnM4MjJL+P0Wmh5NSKO9QDjTqEIa1dmGt2319MwPD5Hu32X7+xYxFd9Cgmg64eEUBj5DkSivc2JtP89OB3ZrhQdQphXIaRb3pDEpWLNloCYednVxibjUvCPvCsjMY7OWOZtjqiwy8hgNTCS4YaAfOtyIHl0FXo7PWREqlqkz0e2xMf1NP6Ail+iWgn113Q1+8UAgSMTOW4fDsAind3RoTwhDAhbCcqfkEJnaTieOIoa7NF2JfWIdkzb8oDkU9OFYs4S3y4Qt8g/IXwtKmchLau+VWygp4EU8ZszHJhQJO7701zSeK98sf+FzojHWsWsG93wkpanxqKjMVSyWSNt2j0wY32qJ7QJu8n1Cp7rPZlTz/6UBLw7PL6TG0tFUBuCQj3H/H1wQMTuFs2jMtBSDCwtqxAViEIq+fCAhlYe0aOOHgQGr+xzpIH6XsgrKOkLpd84/SGkyOxJ1vMBrfQscOumZDs4aJkYDTU82LI+OUc1Xnf7LEel4eyVGfLEwgAbFa8rK3NOlOrYGSW1GL5nWQ/yIrKWccum79cMpjkdJJ6VUMe151V/wmeGjyA9fzeDLKv9xT05vZWtMDbg5KQBbbqF/a3mkvlBEu3FQDeg/G9IaCcL2GWw2AbCCA0aBlR93hD+3HMMTfhGuD68LobTbzrruDSok0JWmmueOYHYu/b5r/DFpJT1PTyWT2e3fwUksG/oD5kIw7A7UrExEw= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: c78fcebc-0547-4a6a-d17a-08d3d88d9a7f X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB2014; 2:kWqRzmsbGujflG+8uDbmRd9+Sv8oNLkamOHkY5jnmF4ysky2c0SmHS9THr82S2Qp3f0RP6CGKwJbTT/5qZZKlWvgis+gtwRF00Wm5+IPD6BkEvJDk+mQ1tPLyRw050pxdk4B3mOgDPX+ImHgN6wn5k2HapzjSI6vhkm2H7nlOss5LMpiKaiSMSq6z0Rdbmhb; 3:phNd7yOQJw3DGMvDwmoFjDSpqiHabat4mADZa2dsNI0RUFZ4MyxQHaXSWfcOgAiomXG8XqE3BjjKYfQmz5j7bGXvBWXxuKzk79VpYj1tIAd1xIPOFRnY/cECQA3Z/fz2grar6Q761QEx6iufmKfKvRg9NtP0+SbfB8eXk1yQG1ru+dwWx3M6CPsfw4MXTmor/NMkWHyWcbforRejpKzP1iFjAlxqAvUPJZOGCnYyYzw= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0301MB2014; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB2014; 25:8AEXM2GkNIVpt+g3TeG+95oULgFRj9TYu834zI5mGpiHLTEfvoGp+4w/I92k60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vvvLxvmoE7ZWhTFBsXoF+r+hOmopCnI3Jnm2Q65FGupBMPYjGDDLeCHae5SkKa8xC6neQQVN/kA+OchQHpQlEyeT8lCh3t7fG5aAiWoHQq7rGOgQ/jlmOrpVuweZhQOVZtyWAHtWzz6sCMupEUCQSSg9q4BSaBEpXqnsMFLmMTY1qDWEF0roQJjWzugWm0lXplwLVf4oaaaE3e2y5zVdbUDUeQXl/GOb76/qPaivmnVoU4teQ7YfeCzz4vH+4L/jHgEpKXgqP+oVJ4S1xYHcAmQLfJrSqwD9hVwgfVQ6Zs5oDrFS7I7ZXpW2y/16ors+XRKDChZYMtnxTyvlkcsmKJJeCxUWFTBj2U+1YDshzsX/dG+i8ImbyKEjsh84ZTYOpUgi7C1QBEzPFWJ1+R7Gv+RcN2De5CTMJHnykIMY12Udcnk3/MPDhiDR6gZS1QSa6X9UCTu2xOGiJ1lsNvYZA= 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)(13017025)(13024025)(13018025)(13023025)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:SN1PR0301MB2014; BCL:0; PCL:0; RULEID:(400006); SRVR:SN1PR0301MB2014; X-Forefront-PRVS: 00603B7EEF X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR0301MB2014; 23:GQbCobFPRl+OlX4RjCusc0Qh43CrXNQafjGFX+v?= =?us-ascii?Q?Nzc8QDCo/otkd5FTl7wz1zmktV+bcK6W9K3No3uRu1pQM/V4U2tEd9gn3iWR?= =?us-ascii?Q?0w8vwGKAaqWYW6PSdNFG6S49wxbo+V7ke1pV9e+SKlEgmF1ITGrT/HsNIvCQ?= =?us-ascii?Q?l5Leo/pz8W0YzQZuVcoIlB80Cz6SqaMQf0wVoA/VI9WB1EcM4+bkAKUv5uUI?= =?us-ascii?Q?yowrjupdNdPtziu9hmJuGR8j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ii?Q?eXuGRBkmvpdBVDbgi+PEfVlbjhE4Ec6zkKrI2fjELeCW/ADuaiEN74jUvoyF?= =?us-ascii?Q?RkDExowDMoIsRbQ4=3D?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB2014; 6:OVSCePRosqnO7pS1JXNCI9Jh3YZYnVpC3sWP19Mf7MftW+Qm2hW1GlFAjMExjSaEAQrJ8M9br+7rFf9EqwXC0uVQ96CzuyWK29nhQDcQzZ37A8hiHNs6PGkFuAkmY9vw//Wt1daJu0hKf93TXxpOVXm4cVgOXjMDOVoi5Q/Py7ToYKcQmvo8PmxmNVEKMZhIBvsMv+tH0kBWmD9rsewcUq6uvkt2yTn2hQaGYOX5v5UgYpp/PshjBeWj80TlhhFhPk16i1IiolyT80CcSE7Q8U9bobaEpvEoOy+FOGt+Bao=; 5:iGZyKt4S2VmKqlEYDPZepNHeZ+d/fenweCwmtE6GsM6McVnW435n/EXuiKuqnV2TJBepen5tVJCwzE4tI5vDoGIMjBiLIP9LLdijL0j7PJeoIy5h5oc7HU5TG/MeJYrG4nGYZiqV6564bnT+BQdr4U1w5h9aGhM/XliUYKs8j1s=; 24:YdZ2PSD4gVUidn8AlHPdrRPe6sP/OgdwmFCjLxenp3hg4CGFKMzSOVi6+IQIfVtpn7+sXKAastNliE2JLjanYjmVikmgWoB6HPW/eBp2S/Y=; 7:zv9PyJoSQRl4jWYSEIGgaFr3jJBqpVlE6fdH26owKt/DRrJSXhQQXxVPRzDJoBMeMuARIebDmKmMFBPVRQxYgZVXP3N3G/0twhbhHA8cvAdbXdbYaFMfwO6x6MWmZYz7uCoTvLY84HUBfTwJQAWFZTbx7oxZa3Fb1KuIv6/KBfG6Mxl4Q771bIguhX1+/atchK8+WbTqO4h9vsg3yDyWEmHxLDHC4JijRebULdFVikgLXq73PFaMKvwBREd4R0Ic SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Sep 2016 08:45:08.1556 (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: SN1PR0301MB2014 Subject: [dpdk-dev] [PATCH v3 12/15] 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, 09 Sep 2016 08:45:10 -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