From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0058.outbound.protection.outlook.com [104.47.40.58]) by dpdk.org (Postfix) with ESMTP id 8BD4A47D2 for ; Tue, 22 Nov 2016 13:55:33 +0100 (CET) Received: from CY1PR03CA0012.namprd03.prod.outlook.com (10.174.128.22) by CY4PR03MB2469.namprd03.prod.outlook.com (10.168.163.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.734.8; Tue, 22 Nov 2016 12:55:32 +0000 Received: from BL2FFO11FD026.protection.gbl (2a01:111:f400:7c09::144) by CY1PR03CA0012.outlook.office365.com (2603:10b6:600::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.734.8 via Frontend Transport; Tue, 22 Nov 2016 12:55:31 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; infradead.org; dkim=none (message not signed) header.d=none;infradead.org; dmarc=fail action=none header.from=nxp.com; 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 BL2FFO11FD026.mail.protection.outlook.com (10.173.161.105) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.721.5 via Frontend Transport; Tue, 22 Nov 2016 12:55:31 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:; UpperCasedChecksum:; SizeAsReceived:880; Count:13 Received: from [10.232.14.87] ([10.232.14.87]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id uAMCtSPp014666; Tue, 22 Nov 2016 05:55:29 -0700 To: Jan Blunck References: <1479747322-5774-1-git-send-email-jblunck@infradead.org> <1479747322-5774-8-git-send-email-jblunck@infradead.org> CC: , From: Shreyansh Jain Message-ID: <84460a6f-3574-8da2-3ccc-6f1e23fb50e7@nxp.com> Date: Tue, 22 Nov 2016 18:27:43 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 MIME-Version: 1.0 In-Reply-To: <1479747322-5774-8-git-send-email-jblunck@infradead.org> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-IncomingHeaderCount: 13 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131242929314995666; (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)(336004)(24454002)(199003)(377454003)(189002)(50466002)(68736007)(106466001)(105606002)(31686004)(64126003)(23746002)(36756003)(6666003)(229853002)(110136003)(5660300001)(2906002)(6916009)(83506001)(2950100002)(86362001)(87936001)(189998001)(85426001)(65826007)(38730400001)(8676002)(31696002)(4326007)(4001350100001)(626004)(50986999)(92566002)(76176999)(54356999)(230700001)(33646002)(356003)(65956001)(47776003)(65806001)(8936002)(81156014)(81166006)(305945005)(7846002)(77096005)(104016004)(97736004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2469; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD026; 1:5HUAqJ4hdsYXrLLptTeBGkR5yR2todcv8b9pyHpxKdwNzeTpvm3WsLQnpn4eRo+suq6zAfstJfx3gHgI0adS1UjUAfsU6DVl3zI02lxzoo+bXhYj3I9ACYd7oLOilH6p10L4t44hn82VxFqMRsMcHxZvxjKBMEn4EF2QV9Pqr15Chuo1EwCk9A+ojTe7Wm8C1rWH934WoXAC8JB4gQ+IM8WiWTDVW1d4NrmOsYLjfOvHT8M8XZkl+ENxdauVyWbQh0b4FZFkZf1YsSAZboql+90KhYdGn7iPWPhb2w60B3TXr9lVZ3R1fZM5EV96MVCTH5JaQub1m2HdHFwxgNpplXqa3p85Y6wDXCy+zgauG7EzX1Uul8zqMAGTMhQBz+chIK0JkwS9l504bXwZ76KUHMjVqDnNRWuVHN5CGkkWMuK3IicjkX55WYdUXYvBbqiFzRZ6CUT1TX+hS+0Oo0IC23KSCSWzYQBZ3J5o3e86YLpn3dS4m6Wk0T9VuiRiAUlkJoPj+mkHb9aM6/udd9yTyoR57jh3Krg1SAoEhr1U+HuPRZPnhBaUykqYrsBUfgn4slDSap+8iRqH7JjHiOYzRC91inmZh8VIiYmHMlNLaI4= X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2469; 2:gSu00Z8g+dEILyTmzTjQ9xaheuw9vRztryW/TDpUy9XclCVRU3DXJKIb26rC6Mna9+PpclDTBSPnQj7KAvkJwYc93pm6QOBVzPorI/NXg2xaeATzQzd+b1VW0vCC9YFX9gfjqJu6Q6nHDC5f+fDd0ZNRh+2qNiNri92kIFmAoT8=; 3:4f0Lfu5vYGUTsARsuvXMFIvUDI2yidDxfKgUhfEcwePFilpcvNMMawZtxnWbSo1ZktO6D6K0C8pGerWbTwHMC6v2KF1zH/lZMFDuqMfEkNWs2fTtb6129nSq/JjfonN3Wn4NQXxTy++q+2plu6Fk3mmJNw6CbnETGU7hzWqCUrNDZ6/mvPB6WVC1pyWjUvQ02suJ0s4m8MwD0SjrrmqR38YQZx6gNT+D80wqiOZahiVlzj7dnRxwMrqSjLx2+7VD3OXXGAcqPT81C9GCAhJ31A== X-MS-Office365-Filtering-Correlation-Id: dde333f3-31b5-443f-bc71-08d412d6d78e X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY4PR03MB2469; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2469; 25:IVeng1p7B5M4SaMv1138HnrG4wR9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q7scVs1zRn2qjYZW31rQe+0oW10iGUw==; 4:pCscq1a7PFD75Pz8zdfQh0shAqru2vKPjHgEQMaHn/qK8Nte61IdPeYkvqp/OZeEtV8FEOIFGx+zonYHJ4yfUD0rjv7RBfPIoW7fkLO26oh/cbXcPOQpAd+WN/l8gWDbn0cPcDtlFbB1woIrijCNUa/9EMoIaj3KcZSnWcF/9WfRUiZ6Kk1jA3BCWGcSjvbypPc1NQgf7tJ8HRLXKUgWBV4sXfR4jUrIb7e4IoeaeKr3QLektWFrGrsDRGnhs3A61TClJYAA6yjJb+J/G3BWBmIUwtxBFWvgbZCjEavhCqUmgS0tGAP1H919nauPAyJR8UiFUrnlQRJTK/B7+jcsOZ8FZaJPVIu+7mhoCDxgCTqCD+9rX5vMqQu5NI0CxmJZpZZHjardQ6KLF8O1ynJ0xNa8subtmadfylUTWMKDHtdagHmTegIKYMRUKd6xJbRU7unt6iYl11ih4ygHr/MmjxR2j9UYnTfIlfkBU7X2nM194VXvW/df5hnoavqeaV+issO1aTfb8Q8xwOYiKcqhxQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095035)(601004)(2401047)(13017025)(13024025)(13023025)(13015025)(13018025)(8121501046)(5005006)(10201501046)(3002001)(6055026)(6096035); SRVR:CY4PR03MB2469; BCL:0; PCL:0; RULEID:(400006); SRVR:CY4PR03MB2469; X-Forefront-PRVS: 0134AD334F X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; CY4PR03MB2469; 23:rrIGVG/5vvm39yjLSCoHXkdNJmy939cuiLyfI?= =?Windows-1252?Q?ww09I2mUMGzP2O0sI606jhFRLpyaiL2WVhlQZG8hXRkLJSyUuu0Zueia?= =?Windows-1252?Q?1G4slZz9Zjttt+0kOHtAgWBxlJZ0Pe84QD0UYF36067lEdY5R/o5vogr?= =?Windows-1252?Q?8t4NQnOo/eJRrdOEdeEh8OxfeS2H4Tpefcjx7Sqdl21DHr5B0bYO01EP?= =?Windows-1252?Q?AfLZ0TPxEE79Wpv1KbudQkzNMGXzkJ46sHpk5wWuvyKR1wAgQcmdu+16?= =?Windows-1252?Q?wi3aZLCQo7lvw9wAgRsrHAMBBj74/RNrGp2NlY3IG9R3TDJnYycQu5G9?= =?Windows-1252?Q?MNvNKjQy+MGEFLVU/TBNmf85QpIGEV98X+UlEL8JPXjkyszdVAmZZnYC?= =?Windows-1252?Q?tt/ohuznk95sFjv80o4fLjiUPz7HIhNLbkoZyLXS0bJfztMkpnmozCde?= =?Windows-1252?Q?JyLd7JN7EPSm3JMYqO4wSupatI7qwCVbUmjq8oLgLq//i6Aj7Nrn9eua?= =?Windows-1252?Q?rMhV1G/tJH5W874B2YIYe7/qzEKmoFoJVqPYAOOtb7Y5mWXCWDWbiIRk?= =?Windows-1252?Q?Es89TgRZ/gKi4ULHPNhYYLJ0Q/5qyLg64XwMIj7qNd7TCZZvNtB19fwY?= =?Windows-1252?Q?sA0VYXBFr2TgIzuAtYnU9ZzNpOoDMwnrIbj0s9Aihfj9Vp8ztRRJgg1u?= =?Windows-1252?Q?6XzCjOEzh6rIfnrydKh7kaP2Id5QFKetKfP7vLYu0oMlhFPQzwTAxcQU?= =?Windows-1252?Q?7HlnNe06trr/58Df+p8sWvLOryqHfMm0Oq+wXrA7J1WlHApkQcY90mx6?= =?Windows-1252?Q?ysbfmH2V4W18FUBOBh/3c1w16HvWxq0908WGu4zhXaH+QbdX0HIllanN?= =?Windows-1252?Q?y6NhvFc6vCk0t3JY5P00psrfPkqSVfAmY/Lx2EJlEAV/OBoZR7TAp5IF?= =?Windows-1252?Q?V/km27peBHqUv1+0cEabjWrJiMkD2mjb5I67xy6+1EiLVHoB1WjGK0GI?= =?Windows-1252?Q?XVAcrIwALVTuj45hDGs6ao7FamI5d32XmwKYEhRHqmqwhR6wJfwZRQ0e?= =?Windows-1252?Q?kWsDO3MJsjot8HDM0+sr58oxwlln7x+aenCvqcO/ty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1tI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2469; 7:ykF4FkipluhLZUqZXlDV1BeLOAvcy7cZtam0neG6nh6+OenzJjDsUvk08kVusAcW+FGBsTD6DwjTP7xBf3qPFeE21zw4FhvNOqbtUAC5wgMCrK9FeD3JkHitLYW66XCMfTi6DnogA4EFbKE3Trc+aUL8+c1Q9GfSPAZCHfhFAqkpa+bB9c7nhgKRSSn06F4iBPgbO8FukpNxkEgdb8UTPtIPGhrRdAoUOcDnjea15ulOFkZLI+A9/1RH91kN2BEqtSrNrvHy5P4N/jeNyUczEvQsNfBIpjtC3A4By1YS8evgqLMi3TfUZlN8r1/0u2xQLex4F6fFsOpi+Drlgc9NFCmy665zpXDlBZle7QrZ3WA= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2016 12:55:31.2967 (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: CY4PR03MB2469 Subject: Re: [dpdk-dev] [PATCH v2 8/8] ethdev: Decouple interrupt handling from PCI device 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: Tue, 22 Nov 2016 12:55:34 -0000 On Monday 21 November 2016 10:25 PM, Jan Blunck wrote: > The struct rte_intr_handle is an abstraction layer for different types of > interrupt mechanisms. It is embedded in the low-level device (e.g. PCI). > On allocation of a struct rte_eth_dev a reference to the intr_handle > should be stored for devices supporting interrupts. > > Signed-off-by: Jan Blunck > --- > lib/librte_ether/rte_ethdev.c | 18 ++++++++++++++++-- > lib/librte_ether/rte_ethdev.h | 1 + > 2 files changed, 17 insertions(+), 2 deletions(-) > > diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c > index 4288577..4ecea50 100644 > --- a/lib/librte_ether/rte_ethdev.c > +++ b/lib/librte_ether/rte_ethdev.c > @@ -258,6 +258,7 @@ rte_eth_dev_pci_probe(struct rte_pci_driver *pci_drv, > rte_panic("Cannot allocate memzone for private port data\n"); > } > eth_dev->pci_dev = pci_dev; > + eth_dev->intr_handle = &pci_dev->intr_handle; > eth_dev->driver = eth_drv; > eth_dev->data->rx_mbuf_alloc_failed = 0; > > @@ -2543,7 +2544,13 @@ 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; > + > + if (!dev->intr_handle) { > + RTE_PMD_DEBUG_TRACE("RX Intr handle unset\n"); > + return -ENOTSUP; > + } > + > + intr_handle = dev->intr_handle; > if (!intr_handle->intr_vec) { > RTE_PMD_DEBUG_TRACE("RX Intr vector unset\n"); > return -EPERM; > @@ -2603,7 +2610,12 @@ rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id, > return -EINVAL; > } > > - intr_handle = &dev->pci_dev->intr_handle; > + if (!dev->intr_handle) { > + RTE_PMD_DEBUG_TRACE("RX Intr handle unset\n"); > + return -ENOTSUP; > + } > + > + intr_handle = dev->intr_handle; > if (!intr_handle->intr_vec) { > RTE_PMD_DEBUG_TRACE("RX Intr vector unset\n"); > return -EPERM; > @@ -3205,6 +3217,8 @@ rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev, struct rte_pci_device *pci_de > return; > } > > + eth_dev->intr_handle = &pci_dev->intr_handle; > + > eth_dev->data->dev_flags = 0; > if (pci_dev->driver->drv_flags & RTE_PCI_DRV_INTR_LSC) > eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC; > diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h > index 3adbb2b..f1f656a 100644 > --- a/lib/librte_ether/rte_ethdev.h > +++ b/lib/librte_ether/rte_ethdev.h > @@ -1629,6 +1629,7 @@ struct rte_eth_dev { > const struct eth_driver *driver;/**< Driver for this device */ > const struct eth_dev_ops *dev_ops; /**< Functions exported by PMD */ > struct rte_pci_device *pci_dev; /**< PCI info. supplied by probing */ > + struct rte_intr_handle *intr_handle; /**< Device interrupt handle */ > /** User application callbacks for NIC interrupts */ > struct rte_eth_dev_cb_list link_intr_cbs; > /** > Is there another patch which replaces all uses of eth_dev->pci_dev->intr_handle with that of eth_dev->intr_handle? Now that eth_dev has a reference which is initialized as early as probe, we should use that rather than pci_dev->intr_handle for PCI PMDs. OR maybe, ETH_DEV_INTR_HANDLE() like macro which you have introduced in i40e_ethdev.h. - Shreyansh