From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0086.outbound.protection.outlook.com [104.47.32.86]) by dpdk.org (Postfix) with ESMTP id D8B8F9B81 for ; Thu, 25 May 2017 20:10:20 +0200 (CEST) Received: from BLUPR0301CA0030.namprd03.prod.outlook.com (10.162.113.168) by BN1PR03MB171.namprd03.prod.outlook.com (10.255.200.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1101.14; Thu, 25 May 2017 18:10:18 +0000 Received: from BL2FFO11FD025.protection.gbl (2a01:111:f400:7c09::159) by BLUPR0301CA0030.outlook.office365.com (2a01:111:e400:5259::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9 via Frontend Transport; Thu, 25 May 2017 18:10:18 +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; 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 BL2FFO11FD025.mail.protection.outlook.com (10.173.161.104) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1075.5 via Frontend Transport; Thu, 25 May 2017 18:10:18 +0000 Received: from b27504-OptiPlex-790.ap.freescale.net (b27504-OptiPlex-790.ap.freescale.net [10.232.132.60]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v4PI84WU022340; Thu, 25 May 2017 11:10:15 -0700 From: Nipun Gupta To: CC: , , , , , , Nipun Gupta Date: Thu, 25 May 2017 23:37:50 +0530 Message-ID: <1495735671-4917-20-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1495735671-4917-1-git-send-email-nipun.gupta@nxp.com> References: <1495735671-4917-1-git-send-email-nipun.gupta@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131402094190127583; (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)(336005)(39850400002)(39380400002)(39450400003)(39860400002)(39400400002)(39840400002)(39410400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(9170700003)(8656002)(33646002)(110136004)(106466001)(105606002)(305945005)(8676002)(77096006)(53936002)(47776003)(2950100002)(85426001)(81166006)(8936002)(356003)(6916009)(6666003)(2351001)(54906002)(38730400002)(104016004)(50226002)(5660300001)(189998001)(76176999)(5003940100001)(4326008)(50986999)(36756003)(86362001)(50466002)(2906002)(498600001)(48376002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR03MB171; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD025; 1:jjPtise54VAWLV0WtYQ4ndoAjtU1I09IRDXBwhzLL7PTa3ous20ERjMZtdx0vXrlk7SRTedVoGSXYk60NbDHy+9k0VjKUuuSxOLo2EWjkL8VfH/R17xcc7RgtYV36lBwtciXPj2HVjH/e/Ov6SaMQh4uiApVl0SgwUVM4eekJ26CwVytHJZgYLJRTiwv5IySIqjx/ZdzobaILDz2eMpHbnZxVy3byYsxXGDBtD3Uqno8Qc8+VIu3OMynl2qYoU3GGCWDEOxaoXPOBrVQUGklYVpqSWhjqpZk/p45HbtQ5GU9Fo8fTsd9uD7gUGYc7K+imZbZqiKLV/+TpK6GFymNlPrfD0Rh6HNIF0EAY9C/ETXZ+MlOoPUZ4kbXbEJ9jsbRnXogIEFoUANvKXdW/ik4xprqctKF3JxABjpCt0fChqdQqcd/O9yXgAD4w0tntIh4gM6ApUyIocuiMfi6xRNPzNSnn3nRbZX6+qDc7XQROjdGG0PIczQbMNX9U7eBSYVJkE/7mSkYZ1UFQOTwgDpydtBelDSc1tHgPNBtCfa9Qwmm8PQL8ivrb+abB0sM74dAVyd1Fi9MkFiMUnmoXAKSXUxAN2A+QiWl53wtZ4MisYArP2j9xQalDHWrH0ePFCZS93A8GU+7iNDmoeXbzB8KR7G6HhQTahtArtXLY3lf1uhwq/g7l0eC85sjsBjnAXwsm5CQpF+fCi1gwCN45Rl65A== MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PR03MB171: X-MS-Office365-Filtering-Correlation-Id: 3a31e58d-8966-4b60-887e-08d4a3994d66 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:BN1PR03MB171; X-Microsoft-Exchange-Diagnostics: 1; BN1PR03MB171; 3:0yRvclmCtHgG4W/hT2GEoyqJVn5NV4FiCbJRT6hLOcWZfg/O5uN0CX6TOjpVMm16lOGiy8I7jUex+zFRN21b52TbuewP9Df/W1Mze2LrXKQ2QMVpAQG1ZOKJ+RKjxc+pgIYCUiTKC7xhYcWhsybSMkjf6I2RE/OMePJkYFCSGkIAvBqWBvdWsRgUfx9B/LK0DjX4H8GuhowMGj0XtvjA7/Yokjd9+aZXevbo+k6W1OpfnPb9uWXIWgPtS52LqXJlmad/o3Th7t7r1LYOXlvHc04T3yD4CytqADJgl/qG3iKrYNhs/qD1OkRZ92NhwZ7qqd8yK+4ew3VzXbKnopYF8bXiWbp0Js27nTjtG4mzArH1/jqhDsuanUsUA53stIZI+qiKAeoiboOc1HR1bVr0nxawzmLwRgJ58oDVEu7uKxIXIdv/2jc1zPOQ8B5MtFOc; 25:WpDdKFH2noKFIKum3WX5tr/CylJMMWfPY2RRpOAlijiB5XbF0cnh2vizdMNirJrylck80Y/a6ziw32Q/84vG1sOWTN9NEGy/V+E3dJ0IwZEbpPi/2u85OtoIVySvo9Nge/w/r275D4rhQqWf2dSAvuqiAcuQRRpV/uhPO25F6WeieJ8cE2GJm3s1yPZrEKnlHwZm//jti8LLJPCXFAk4QyReXoov39XNed2hdQfxlRslo310ZT7medhO7hGmQXE/WFqB2VRvMlRMXd9cygXoxhAthi6ZiwoYLGA7tQLozwGHEVr0+eRnlQcHrGZa6tu9jpiRdcJ2uD94OJGxj4NbqdRUIS9+IBWea0ex5gmnQiFDlatYrXXehqb8uvgefgxDCSrz+Qqc7tMFoIR6b2wN0l2ZW9WxwJgxHT/x3OI5Y1x9pW1hIUcWZ4wjdOiXcSW0PjYhS1ZI89HhrT7QknwBoBv97VA3RK5Aj90ELrO+zoc= X-Microsoft-Exchange-Diagnostics: 1; BN1PR03MB171; 31:txCNdt1SfZG7wukJJk+iUJgvQ8JNcalKe4A5Ar6bi8ehJxk05gtz/ztzAWi/AJjjKqOYEcA/FwMie4r1PO4mvfcZc0TahwS8cCeRFhYPilJEBVD2ZqRKg4GqT1wg27OuaAUPbVwYCCA5bG9QI6BtSVQrBlSP1TpqEejADMhYasKoYLHUNGWyNwGxqatPQC0cLZUIRW2iDoMOMAWWb1wUJla5Enp6ajbIdS6B9ZvNxnSFyxKrsUwEIJ8CQr2tOQx9 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(601004)(2401047)(5005006)(13016025)(8121501046)(13018025)(3002001)(93006095)(93001095)(10201501046)(6055026)(6096035)(20161123561025)(20161123563025)(20161123559100)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123565025)(20161123556025); SRVR:BN1PR03MB171; BCL:0; PCL:0; RULEID:(400006); SRVR:BN1PR03MB171; X-Microsoft-Exchange-Diagnostics: 1; BN1PR03MB171; 4:NPCMLSn0g3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MZISeBYPnf05oau2ZnAuVITbeGQPxfCUVgoRY1ix74PuCRI4wa02D5UxBsPhnPmOyVWqtWXcgSLI7i7C/9; 24:xDcHirO1bVMEj1cLHT4HI1ac3aGG89XCOPdgGCx0sntDuwWyz7H3dmXBrDFaXIXJ5ecpFLUwZtS5tdHlr7PBCax4hkevi2gbm12hE5fAgFo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN1PR03MB171; 7:NBQi43DUtw677YdsuSxySogsqxY74/yb6qA2p+YNl4QokRWgRjQy2TTRfoBjdBbiuVivc/W9MmHMvG4gTt8PST7SNeRXrLtRomi6P62r23SKIrzFHQtVulynkrumyvPFZgktdWUw2BGeDH7u/PNPwhgoRSgct7OYB4HOPta0poTQiWQ4YshwX7A8LUApHGMPMuy8oMKpNF7Fiyh334CD+6cX7+GAaRqw0jsNGGPIhWmioQLXc03Gbb48u7ltWdIyEFF9paJtF4iArnd2oZUkNeoXRPCOF+liWBr3CJYvbFGRD8IjqItbkve2RjOeTwSocWsV0YrOpoo8TkdxxUIkKQ== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 May 2017 18:10:18.8411 (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: BN1PR03MB171 Subject: [dpdk-dev] [PATCH 19/20] event/dpaa2: handle timeout using interrupts in dequeue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 May 2017 18:10:21 -0000 This patch adds support for interrupt handling on the event port. These interrupts facilitates managing of timeout ticks in the event dequeue functions. Signed-off-by: Nipun Gupta --- drivers/event/dpaa2/dpaa2_eventdev.c | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c index 3f3e4a6..a24b751 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.c +++ b/drivers/event/dpaa2/dpaa2_eventdev.c @@ -162,6 +162,31 @@ return dpaa2_eventdev_enqueue_burst(port, ev, 1); } +static void dpaa2_eventdev_dequeue_wait(uint64_t timeout_ticks) +{ + struct epoll_event epoll_ev; + int ret, i = 0; + + qbman_swp_interrupt_clear_status(DPAA2_PER_LCORE_PORTAL, + QBMAN_SWP_INTERRUPT_DQRI); + +RETRY: + ret = epoll_wait(DPAA2_PER_LCORE_DPIO->epoll_fd, + &epoll_ev, 1, timeout_ticks); + if (ret < 1) { + /* sometimes due to some spurious interrupts epoll_wait fails + with errno EINTR. so here we are retrying epoll_wait in such + case to avoid the problem.*/ + if (errno == EINTR) { + PMD_DRV_LOG(DEBUG, PMD, "epoll_wait fails\n"); + if (i++ > 10) + PMD_DRV_LOG(DEBUG, PMD, + "Dequeue burst Failed\n"); + goto RETRY; + } + } +} + static void dpaa2_eventdev_process_parallel(struct qbman_swp *swp, const struct qbman_fd *fd, const struct qbman_result *dq, @@ -204,7 +229,6 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, int num_pkts = 0, ret, i = 0; RTE_SET_USED(port); - RTE_SET_USED(timeout_ticks); if (unlikely(!DPAA2_PER_LCORE_DPIO)) { ret = dpaa2_affine_qbman_swp(); @@ -229,8 +253,14 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, do { dq = qbman_swp_dqrr_next(swp); - if (!dq) - return 0; + if (!dq) { + if (!num_pkts && timeout_ticks) { + dpaa2_eventdev_dequeue_wait(timeout_ticks); + timeout_ticks = 0; + continue; + } + return num_pkts; + } fd = qbman_result_DQ_fd(dq); -- 1.9.1