From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0040.outbound.protection.outlook.com [104.47.32.40]) by dpdk.org (Postfix) with ESMTP id AFAEE7D30 for ; Thu, 15 Jun 2017 11:00:57 +0200 (CEST) Received: from CY1PR03CA0036.namprd03.prod.outlook.com (10.174.128.46) by BN3PR0301MB1186.namprd03.prod.outlook.com (10.160.156.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1178.14; Thu, 15 Jun 2017 09:00:55 +0000 Received: from BY2FFO11OLC015.protection.gbl (2a01:111:f400:7c0c::196) by CY1PR03CA0036.outlook.office365.com (2603:10b6:600::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1178.14 via Frontend Transport; Thu, 15 Jun 2017 09:00:55 +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 BY2FFO11OLC015.mail.protection.outlook.com (10.1.15.59) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1157.12 via Frontend Transport; Thu, 15 Jun 2017 09:00:54 +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 v5F8xWSm012830; Thu, 15 Jun 2017 02:00:51 -0700 From: Nipun Gupta To: CC: , , , , , , Nipun Gupta Date: Thu, 15 Jun 2017 14:28:54 +0530 Message-ID: <1497517136-11824-19-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497517136-11824-1-git-send-email-nipun.gupta@nxp.com> References: <1495735361-4840-1-git-send-email-nipun.gupta@nxp.com> <1497517136-11824-1-git-send-email-nipun.gupta@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131419908549549249; (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)(39860400002)(39450400003)(39850400002)(39400400002)(39410400002)(39840400002)(39380400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(9170700003)(551934003)(38730400002)(85426001)(104016004)(6916009)(2906002)(48376002)(5660300001)(33646002)(2950100002)(36756003)(356003)(105606002)(8936002)(4326008)(575784001)(86362001)(189998001)(106466001)(5003940100001)(50226002)(77096006)(110136004)(47776003)(2351001)(54906002)(53936002)(81166006)(50466002)(8656002)(8676002)(498600001)(305945005)(76176999)(50986999); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0301MB1186; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC015; 1:WC/YiNYmpvvV1XgQJQ7rF3FK3jdhZdCXiNPtXf2EZbzsIaqeEDuAvJUYQjdSVWXaVH4D9LMIoIG/+WUfvYodbUbdvgDp/j2jHO7WHi6Tjn1/9URXKkNt+904laPJA+KEd31VObiEn+ANGomgSGAqhqcuMDylSztEFb0k+ciPNOgAtvz/S1i9fq558+k3Q2BDlyZPpMhva9OlqutpV9k+RzEZDSLVaKS+mNsYz4A6T3TFiprdSYCDQn1M50rTKbsBXbA9DhrA9M9RNjq2oPWp8iEQYvpjcmm9/WEtFAZm2BdhMdDCBEoUnI2hBxr6DLyIKbCnLMxXgpX/pRP3ok0+7ELpsa+G/4tgYiblxb5LFqEi1e84Hp+Tb5nD5U0T7oEHJ6vPCLp6BDCkDAq9Z8tGODEJZuLUvnUq4movmfbye4nY0/7NOH6hlk2gkJl2FlcOUVfjLF2itjphcURVWszP9O9O5jOEYiqRxfr6b3Il7V4wnmv7lS7YLRlYE/CDdZtV6pn6udJLVpmj5aDODHfV4JfHuSbjg/klznIB9lDyE+dIa783tj9+k2ZBPaHDBTDD9emUXRTE/+Cj/dxgoivl7aMSbzs5aG6im43vN995PK8Q8DulimJwhodkhfwGHa0+cthzJS8qZOk+gH+aHOV/vou97ai6jokbNTM000V58Zo3bo53gvqbbc8nZQbtSoB5hoQXHRr9WTjmTyd/idtXG/dk2qSMiSaEyhZa4xWflwE= MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4d2f8609-a8e0-4ba1-9cc1-08d4b3cd07f9 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:BN3PR0301MB1186; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0301MB1186; 3:hbse9nPrhgYYECYtlWrI82J96peCHiLC/5gd8LOPuqin06nChGzy5n72Wfs8wIwW8H60v1sJfdlfN/5XMIbUO7WW3/Y/E7gbNzWVVu6ePSuvZnVNAopk6rDfDEl5IHf69kjMKsHEnvHxn6BPjbclVF9xBLkNyImdExMqSBnxKeZgA3hsIMbVUDK0B+ZzgpbvlUtqPAfpPqG/rJ9iKy85+IDeeoryoKCJR8uRtgnHF9jkGuy/BbNTiuk4PlsRlS1olsuGG0/kWDLTExMGad3Y4A5BR7g3xFGBq6zUU4dx8qQg9uQ+AlHrc7W0yySx3Y9Nn1BGSrcNTN82i441nvITyvVGrYbeDoLOLdswOAK18VyKV6lHTubAM/4PpseW7dQvYPDATtRdx46/lQRMlTk/0mlMjww4ehrg08JzfvZBax58ZXxQC/9cTdhjThvrUtOS; 25:usMc4KQPPKihJ/0AbuF01ur1OX/lDgIsIj/7lXW0LJgn0KpwGlLSep4mMgqdwE1jg4XQshfqRqZ7uQmpHgdJpxLj/FXbzy0k67/I/UubUQN9h0Lk4qvHdGU/7QPROLdSXE1v70TyrlaVX9xOoRbGaknLSG4sxHEBx6/2dWY+LuxJ0ozbajUPlyW5D3NmWNF75J81tgHvlSML9kT27yWALIxZaTwco6jrFIbrNY1ecVILKAAisjKAqxY/lQ69w0upHeWUCncjOeA+FAXmo3CmZWN84qhsiWtZ+IcCKXhR56VFrRCnvNo6s1Anm0AodBwlmFM1UinifVuRpviZl74mSiwNp2miLjsYZEO8j2/sFZTvTGZL5z3QP1o2jEEKqyNwscvpgSMVRumj87uKnGzwGCqIkmLhnx/D9pSxHhuVty6OW6OloIl/V25JSuiRtaTfhk5O1sEoM2xt8M788EiEDMfMj2EEZt6FdXa88RQnzTU= X-MS-TrafficTypeDiagnostic: BN3PR0301MB1186: X-Microsoft-Exchange-Diagnostics: 1; BN3PR0301MB1186; 31:BDmOfJEUevmf1OQW1NevNMacIgi7bDDczYMQFZd7Z8Rng58eYBualrIitNqfOYrxrZjVs6Wg7D8pymYGLR3zrwpuHt3/+l9zfg2TjgeWIT1LSxEIz23qjDX7hdhFtlUbIxjv/vPi7YmBvCxs5pEamhbq6PwO3H9YTQB6bqneRKXErI/oi6QejZEd8fpKRHyMHyUJ1JGxZDl5q01FMxOSA5/7PMk0oNJFERa9KTxqAODEfxTy6+hG+4OGRMIoyyN/1LIr/HnxSKKuIsqNseMNgA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(13018025)(5005006)(13016025)(8121501046)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(3002001)(6055026)(6096035)(20161123556025)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123561025)(20161123565025)(20161123563025)(20161123559100)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN3PR0301MB1186; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN3PR0301MB1186; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR0301MB1186; 4:R4+EkJegAaYHAfvLa/KHe73eqPOZlE1trcpMf19u?= =?us-ascii?Q?PWZNPEYBfvvNbeLXjYVFk/1auGFDPAcgjyaBph8nI1bdhS2GcIcKRec3LglY?= =?us-ascii?Q?ukbMWlq3PqfW1/ILHZvSIAPMUL0i9XIb8RMTRSKgYGyOGkR2p0Z87Mx7i52Z?= =?us-ascii?Q?S8UN7956b80oBi1pyFM8vHsAfttT7cY+o2Sv8lcDzZJ4cN7OymDXJr+18NlA?= =?us-ascii?Q?wPPyUmuWPr7wgloWPmsw51uWwwa54ReXDaGTGU0UHWXeP/40NyzoPPibR6N4?= =?us-ascii?Q?YmIXczWceEiCn0K/786fr0jOuI5CzQAA+bSOQdrTiP9+n+qh3V1o3wIGz9Bd?= =?us-ascii?Q?KPKC8t1I8Vo0Jc5i6HpQABmHhMb/Sl9nZ43NfEvID3FU0ffHvHajUueQB0mg?= =?us-ascii?Q?uJ4xa1u1atNqOryZQGrdAbDJpeQCkkhGwKu5Eq7g2cUeS+sUUERYgk2Lq3R3?= =?us-ascii?Q?E2ls4M/8Um/5cDesrq0c2/sU+LIsq9khA8pLMxrIDiOOoOVtNUVGiIwFxmuh?= =?us-ascii?Q?F+r/2dbMNxIjoGJxx0It/QwUMe85pIS/l2N6p5EJ+TWBPn4Ca14TO4VE/N8/?= =?us-ascii?Q?usaa/kPpdCjZJ+bZm3Gt5ms3LAVlLV5ckLJ7MyqCKM4zwehGptz7C0gIBouq?= =?us-ascii?Q?VpPN4Z43UO/PReowdEk0IuNW64q8eS3mtfa+pW08K1ww0VEB4AaenvZfGe0d?= =?us-ascii?Q?QvnNrgmZw222BFIyBG0ThO6zTDpJljPKcydNc6GPx20bwnJpp5rMdgXiBw+o?= =?us-ascii?Q?Z2KPhp0Q/0FkDIZNkDbBg7tAnLrtkP10WE0RYqT9seym3uateIoC4YYnqH4+?= =?us-ascii?Q?SRImif5dcy6RKNvO+RdnBmjpixXwCbi7rw8OTFBDi1SZnmt67zn7WvJMQpr+?= =?us-ascii?Q?fkOvI8lDlb7EEvp4y7xJtLQyKlGxf2gdV4HvEM4149NemGdSbi498cwdoYF7?= =?us-ascii?Q?79JqLanfgH3n4XrQYZuCHVkYLHA56E3Exm6Y5NPUCHiS0+QbMq2pogCgAai/?= =?us-ascii?Q?q1BbEmq50/WR/n3L++WNE2mCq2WFQa28LDUyFxanFnjt2lkvQnCZqxlNvi0f?= =?us-ascii?Q?ErsJK+S8EtrGwh9MNFgzlR6LfHC2eHGpUAnt6V4D/yb93pv+v/PXDWgulrUF?= =?us-ascii?Q?CndzzFV16wzB5ClTSx8UyhlEZIIae0N8Dp3QQYQ46gdBMV9lVv8jpvs3ETeH?= =?us-ascii?Q?adJDKMfeNpBcTZFr2RhAGjR6QBFpGH7Pfb5GZ2DmWWeMiZvaN1MH3lG6XVzG?= =?us-ascii?Q?wZOZSDPQe1ItIrmyvU5pBIDKXIJDw8EciZvN+5yPg6Dh/LZ6ALPiJjBlyT8x?= =?us-ascii?Q?TQ=3D=3D?= X-Forefront-PRVS: 0339F89554 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR0301MB1186; 23:bBZa6lSP58sjLjUGHnthcU+CqgUJxTYfcfyA5EI?= =?us-ascii?Q?Trf70AlLYiaJkETxE3kvEPXIoWQJszbg9h/md3YYuRAHAOVpslnRzdIYep40?= =?us-ascii?Q?pGdQTMEJk8J97nEJvATyv2tQj3SKchXBgKj8qHMp1NaEaBkoaGMjwnZR5UOp?= =?us-ascii?Q?hC16IGa6q0CqRFWvPunHkVttgz2zPjyn8SwkznzZWFMcrvHFZpqaNhZYN05q?= =?us-ascii?Q?X3Cy8GWSEeAlpoqmHT3ivrveUvqsqTReHBgVJWNqdXbS23315wjdUh7yckL9?= =?us-ascii?Q?jBit+DlaQGj4dfzOSqBF63x2DV0Yj7/oW5h7PzZyspXbkQ9Xfh0zhusZWvKn?= =?us-ascii?Q?tlEVVOmn9GWL07fBIkbq6NFpcCQVYHhs6xx8bsRo0H/w464CM4354EgIIv6W?= =?us-ascii?Q?oQTsVEHHnOsPT1wOaoP+3HDPNxe5CJXZkKXxBupBZvj8gHYDemHF/sQVAX2o?= =?us-ascii?Q?mIacn6oVnW1ic1nH+AQeZ6CFhX8/I0zUrhOwocKEH46z+1B68aKEiKXYH8qw?= =?us-ascii?Q?k+caN63mTFhAZ161dQreh7gJHC5s6YCVmzJhZg9o3yAYLDQ7c9wPV97AkOkl?= =?us-ascii?Q?HMsfhD98oztlUkz7Yw6EeVo2GchibHZX+nccvkmfUJ1e32HspExXdtc+YnWX?= =?us-ascii?Q?AAoxhBFnV5mGDJZMlNeyFcL4sSJhfLf658vMIBuHZ8mg2qn5p/tZA4Uk0McV?= =?us-ascii?Q?R246EamOKb/HMgrnzhZLZ6dOpnlmk4M/PBJv7Lnq1OYLMzFrRiyXdQgvT21o?= =?us-ascii?Q?MWn68AwETwMJq/BQn8sGOgmkrBxuOdCiNN+9LwvdYeWGqBG1D4uLQYZ0uNB4?= =?us-ascii?Q?oK9B7WJyos/a1mQmaory/uXh3TS+HzwiB+Z4Xpv5JgMt2xnUYOkh9dBswzey?= =?us-ascii?Q?t5Y1IFGyyDR+xkBkNi0ouaw5y+udA2QTjM2ox/vQzPgDFNQNkuGJgn+75b29?= =?us-ascii?Q?QKq6xMaWRoWhya85U1f7BQvh2SQ7NF+Y5UF2oHlRGDnkHAk4jriiJNRR5T5G?= =?us-ascii?Q?H3kXRzX9f8o7PVnNjHa61cGpGp077fZzR/nEL/uUw+k8fw2k44wzlkbgLGB1?= =?us-ascii?Q?QbX4gN4ODlWgCIHE/DlvKeLalTb6IlNopg9UVJsWJs07SEkxjKaS1+XjTlqQ?= =?us-ascii?Q?ODFtkEK8N6JVhFO5/euK1jQw7zAn7mwbxyz+/P1yJUA/ALsBkE/uIW57a0qc?= =?us-ascii?Q?Ybr1j36/HKbmW7vTvN/OSk5AyaK+woMpQlRmoh9zeIv/cldYWVc6enVho9cT?= =?us-ascii?Q?2Hb5tQcxrgttUKlrubiUXlS7Vb05VX1SDGT83QACg?= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0301MB1186; 6:WYEr5DgY0+HpoTI43gTSjLs1cYtL1YIFmpi3hUOjwynAGokpWYEE++lIdyVg9mA9dfeVaG1601vsMwzLmYQENUZmrZdKyO95dmLA8oTiRFUqU7FE9JVbuTvFFSzet6a3qJhwuK7c+Yr5StSywnTgkaivL1RjMlVIrF6gSoXNQB+JhamXhmcQ0jdpMd591uZz7hLSVBC3iwR4tEIIZpSGGkaVotnCjxlY84dTXuf3BPcUXyNAv7IsgaiejJuOIyO7QuOP1vUwjukkaXFl9uoT83F8QjsKOWIHP9n4MixVac1OQ9CU0NblmOSEnTwIpjokNIcWW+cnF78xlcrhP0wF5UlubuqHcrpw7wlRT0qTPrI+MAlgFBKDUcrWWoWaBNf7so/9xV+6JdA4m+3BcG7fXck8tzx1DEMn7GaikzkqxN+GL9/SZYoW68Vspu3lXCrAqzkAgXJvJCOSTemvD4Mz85XiRBF0Sbdk0iEXSvTVuZNmAXoqLxFYSyrURM236kslhau89rhWqpmZQbqFQYlFZQ== X-Microsoft-Exchange-Diagnostics: 1; BN3PR0301MB1186; 5:w7R5WeR5YcK9NpZMAKs20LAC4piSS1W03mZNy7AumrNgf0TvORyox/EMOEboKkRTJ64KvUxcupNtODUtkzhs8b3/zEUB0a82UdX88LDSG+utEUilKUZ7LbV734e6lRNEv1L/PLhry8P7a6g7eNz9eA88c0pRrmjoiazdnXqY98GIBqe7NdyQF7s6/whsWVOp311r4hLwbi+B9kOAGc0qZtIUddeTQ10gaSt2OIItsfcj4qK4TgHPh1R9O6vwGY/UnbmSDBiBcuWLa1UWYHhDDrY68FEQ16jIgKeodonyraOTwkcLvT9iBQBaLYUawEFRN4fI0PwrZBoU5YiIsZUM4YgHluMnyzg3lS3ZyI+copenOkxv6yuleoSlHZTmGVrzYxSvn34ZjdWQR3TWRc5OhoXBiJi3ZOpF6MYh1gbo4V0b4ViV+FcTOHSbAWBO3VYrOp2ErrSRffIiAUZ6KnuAJzjYqnfP+kLa8B39svdZAzRB8fdW9pkCOTZpTEjO0J3BKcAAAOIFQQtYlzF80nerpg==; 24:YOVD3oBBW2GwWQlumB+LQBv1ghDTMNQApJ1YsSMH1y7AxoMvyBKeanjsQApOldLVlItZ+alQbbIAfr2CMQtLdlqi5TeTcyjC/hsgYstczHk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0301MB1186; 7:Rfqu+z3MCuO4xej4ibgT9UjqZWXwF61pOUsgrMFqdK59SovjjahJP0sy9LZRQakzkWs1OytNng9zj9oKMNQ+H3JUA3WQNycdVHXf/Wgh35Bw2bCzPkoht7bsyJgbLzFEMjLF7amWGazb8/ydKVi1GJl9LyYUaVZkiVUkuyQiy0Sw4ulI9vU4tvUNUb7pqP6GC5PXuvahbkp9DLHp8iRyxbE26Wvi4rzpOsioUtCJquFmdFZdaooZetPLk5K+OuLfpqDGuc8IyMomzc6xoW1NP1hYV/y135HiVzv1c/O7t3rSlk7Fe9hSvr0YviX7y41HcKdfQfrxZLpFNeIlqazRmA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2017 09:00:54.7677 (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: BN3PR0301MB1186 Subject: [dpdk-dev] [PATCH 18/20 v2] bus/fslmc: enable portal interrupt handling 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, 15 Jun 2017 09:00:58 -0000 Eventdev requires portal interrupts to handle timeout in the event dequeue. This patch provides mechanism to enable the portal interrupts. Signed-off-by: Nipun Gupta --- drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 108 ++++++++++++++++++++- drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 3 +- drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h | 30 ++++++ drivers/bus/fslmc/qbman/qbman_portal.c | 22 +++++ drivers/bus/fslmc/rte_bus_fslmc_version.map | 1 + 5 files changed, 158 insertions(+), 6 deletions(-) diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c index f88d490..babc2f9 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c @@ -46,6 +46,8 @@ #include #include #include +#include +#include #include #include @@ -102,6 +104,95 @@ return dpaa2_core_cluster_base + x; } +static void dpaa2_affine_dpio_intr_to_respective_core(int32_t dpio_id) +{ +#define STRING_LEN 28 +#define COMMAND_LEN 50 + uint32_t cpu_mask = 1; + int ret; + size_t len = 0; + char *temp = NULL, *token = NULL; + char string[STRING_LEN], command[COMMAND_LEN]; + FILE *file; + + snprintf(string, STRING_LEN, "dpio.%d", dpio_id); + file = fopen("/proc/interrupts", "r"); + if (!file) { + PMD_DRV_LOG(WARN, "Failed to open /proc/interrupts file\n"); + return; + } + while (getline(&temp, &len, file) != -1) { + if ((strstr(temp, string)) != NULL) { + token = strtok(temp, ":"); + break; + } + } + + if (!token) { + PMD_DRV_LOG(WARN, "Failed to get interrupt id for dpio.%d\n", + dpio_id); + if (temp) + free(temp); + fclose(file); + return; + } + + cpu_mask = cpu_mask << rte_lcore_id(); + snprintf(command, COMMAND_LEN, "echo %X > /proc/irq/%s/smp_affinity", + cpu_mask, token); + ret = system(command); + if (ret < 0) + PMD_DRV_LOG(WARN, + "Failed to affine interrupts on respective core\n"); + else + PMD_DRV_LOG(WARN, " %s command is executed\n", command); + + free(temp); + fclose(file); +} + +static int dpaa2_dpio_intr_init(struct dpaa2_dpio_dev *dpio_dev) +{ + struct epoll_event epoll_ev; + int eventfd, dpio_epoll_fd, ret; + int threshold = 0x3, timeout = 0xFF; + + dpio_epoll_fd = epoll_create(1); + ret = rte_dpaa2_intr_enable(&dpio_dev->intr_handle, 0); + if (ret) { + PMD_DRV_LOG(ERR, "Interrupt registeration failed\n"); + return -1; + } + + if (getenv("DPAA2_PORTAL_INTR_THRESHOLD")) + threshold = atoi(getenv("DPAA2_PORTAL_INTR_THRESHOLD")); + + if (getenv("DPAA2_PORTAL_INTR_TIMEOUT")) + sscanf(getenv("DPAA2_PORTAL_INTR_TIMEOUT"), "%x", &timeout); + + qbman_swp_interrupt_set_trigger(dpio_dev->sw_portal, + QBMAN_SWP_INTERRUPT_DQRI); + qbman_swp_interrupt_clear_status(dpio_dev->sw_portal, 0xffffffff); + qbman_swp_interrupt_set_inhibit(dpio_dev->sw_portal, 0); + qbman_swp_dqrr_thrshld_write(dpio_dev->sw_portal, threshold); + qbman_swp_intr_timeout_write(dpio_dev->sw_portal, timeout); + + eventfd = dpio_dev->intr_handle.fd; + epoll_ev.events = EPOLLIN | EPOLLPRI | EPOLLET; + epoll_ev.data.fd = eventfd; + + ret = epoll_ctl(dpio_epoll_fd, EPOLL_CTL_ADD, eventfd, &epoll_ev); + if (ret < 0) { + PMD_DRV_LOG(ERR, "epoll_ctl failed\n"); + return -1; + } + dpio_dev->epoll_fd = dpio_epoll_fd; + + dpaa2_affine_dpio_intr_to_respective_core(dpio_dev->hw_id); + + return 0; +} + static int configure_dpio_qbman_swp(struct dpaa2_dpio_dev *dpio_dev) { @@ -201,6 +292,11 @@ return -1; } + if (dpaa2_dpio_intr_init(dpio_dev)) { + PMD_DRV_LOG(ERR, "Interrupt registration failed for dpio\n"); + return -1; + } + return 0; } @@ -325,6 +421,7 @@ struct dpaa2_dpio_dev *dpaa2_get_qbman_swp(int cpu_id) { struct dpaa2_dpio_dev *dpio_dev; struct vfio_region_info reg_info = { .argsz = sizeof(reg_info)}; + int vfio_dev_fd; if (obj_info->num_regions < NUM_DPIO_REGIONS) { PMD_INIT_LOG(ERR, "ERROR, Not sufficient number " @@ -352,13 +449,14 @@ struct dpaa2_dpio_dev *dpaa2_get_qbman_swp(int cpu_id) PMD_DRV_LOG(INFO, "\t Aloocated DPIO [%p]", dpio_dev); dpio_dev->dpio = NULL; dpio_dev->hw_id = object_id; - dpio_dev->vfio_fd = vdev->fd; + dpio_dev->intr_handle.vfio_dev_fd = vdev->fd; rte_atomic16_init(&dpio_dev->ref_count); /* Using single portal for all devices */ dpio_dev->mc_portal = rte_mcp_ptr_list[MC_PORTAL_INDEX]; reg_info.index = 0; - if (ioctl(dpio_dev->vfio_fd, VFIO_DEVICE_GET_REGION_INFO, ®_info)) { + vfio_dev_fd = dpio_dev->intr_handle.vfio_dev_fd; + if (ioctl(vfio_dev_fd, VFIO_DEVICE_GET_REGION_INFO, ®_info)) { PMD_INIT_LOG(ERR, "vfio: error getting region info\n"); free(dpio_dev); return -1; @@ -369,7 +467,7 @@ struct dpaa2_dpio_dev *dpaa2_get_qbman_swp(int cpu_id) dpio_dev->ce_size = reg_info.size; dpio_dev->qbman_portal_ce_paddr = (uint64_t)mmap(NULL, reg_info.size, PROT_WRITE | PROT_READ, MAP_SHARED, - dpio_dev->vfio_fd, reg_info.offset); + vfio_dev_fd, reg_info.offset); /* Create Mapping for QBMan Cache Enabled area. This is a fix for * SMMU fault for DQRR statshing transaction. @@ -382,7 +480,7 @@ struct dpaa2_dpio_dev *dpaa2_get_qbman_swp(int cpu_id) } reg_info.index = 1; - if (ioctl(dpio_dev->vfio_fd, VFIO_DEVICE_GET_REGION_INFO, ®_info)) { + if (ioctl(vfio_dev_fd, VFIO_DEVICE_GET_REGION_INFO, ®_info)) { PMD_INIT_LOG(ERR, "vfio: error getting region info\n"); free(dpio_dev); return -1; @@ -393,7 +491,7 @@ struct dpaa2_dpio_dev *dpaa2_get_qbman_swp(int cpu_id) dpio_dev->ci_size = reg_info.size; dpio_dev->qbman_portal_ci_paddr = (uint64_t)mmap(NULL, reg_info.size, PROT_WRITE | PROT_READ, MAP_SHARED, - dpio_dev->vfio_fd, reg_info.offset); + vfio_dev_fd, reg_info.offset); if (configure_dpio_qbman_swp(dpio_dev)) { PMD_INIT_LOG(ERR, diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h index 119cf91..f1d7735 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h @@ -97,7 +97,8 @@ struct dpaa2_dpio_dev { uintptr_t qbman_portal_ci_paddr; /**< Physical address of Cache Inhibit Area */ uintptr_t ci_size; /**< Size of the CI region */ - int32_t vfio_fd; /**< File descriptor received via VFIO */ + struct rte_intr_handle intr_handle; /* Interrupt related info */ + int32_t epoll_fd; /**< File descriptor created for interrupt polling */ int32_t hw_id; /**< An unique ID of this DPIO device instance */ uint64_t dqrr_held; uint8_t dqrr_size; diff --git a/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h b/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h index 06bd063..9e9047e 100644 --- a/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h +++ b/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h @@ -124,6 +124,36 @@ void qbman_swp_interrupt_clear_status(struct qbman_swp *p, uint32_t mask); /** + * qbman_swp_dqrr_thrshld_read_status() - Get the data in software portal + * DQRR interrupt threshold register. + * @p: the given software portal object. + */ +uint32_t qbman_swp_dqrr_thrshld_read_status(struct qbman_swp *p); + +/** + * qbman_swp_dqrr_thrshld_write() - Set the data in software portal + * DQRR interrupt threshold register. + * @p: the given software portal object. + * @mask: The value to set in SWP_DQRR_ITR register. + */ +void qbman_swp_dqrr_thrshld_write(struct qbman_swp *p, uint32_t mask); + +/** + * qbman_swp_intr_timeout_read_status() - Get the data in software portal + * Interrupt Time-Out period register. + * @p: the given software portal object. + */ +uint32_t qbman_swp_intr_timeout_read_status(struct qbman_swp *p); + +/** + * qbman_swp_intr_timeout_write() - Set the data in software portal + * Interrupt Time-Out period register. + * @p: the given software portal object. + * @mask: The value to set in SWP_ITPR register. + */ +void qbman_swp_intr_timeout_write(struct qbman_swp *p, uint32_t mask); + +/** * qbman_swp_interrupt_get_trigger() - Get the data in software portal * interrupt enable register. * @p: the given software portal object. diff --git a/drivers/bus/fslmc/qbman/qbman_portal.c b/drivers/bus/fslmc/qbman/qbman_portal.c index e201a34..244c0cf 100644 --- a/drivers/bus/fslmc/qbman/qbman_portal.c +++ b/drivers/bus/fslmc/qbman/qbman_portal.c @@ -44,6 +44,8 @@ #define QBMAN_CINH_SWP_IER 0xe40 #define QBMAN_CINH_SWP_ISDR 0xe80 #define QBMAN_CINH_SWP_IIR 0xec0 +#define QBMAN_CINH_SWP_DQRR_ITR 0xa80 +#define QBMAN_CINH_SWP_ITPR 0xf40 /* CENA register offsets */ #define QBMAN_CENA_SWP_EQCR(n) (0x000 + ((uint32_t)(n) << 6)) @@ -218,6 +220,26 @@ void qbman_swp_interrupt_clear_status(struct qbman_swp *p, uint32_t mask) qbman_cinh_write(&p->sys, QBMAN_CINH_SWP_ISR, mask); } +uint32_t qbman_swp_dqrr_thrshld_read_status(struct qbman_swp *p) +{ + return qbman_cinh_read(&p->sys, QBMAN_CINH_SWP_DQRR_ITR); +} + +void qbman_swp_dqrr_thrshld_write(struct qbman_swp *p, uint32_t mask) +{ + qbman_cinh_write(&p->sys, QBMAN_CINH_SWP_DQRR_ITR, mask); +} + +uint32_t qbman_swp_intr_timeout_read_status(struct qbman_swp *p) +{ + return qbman_cinh_read(&p->sys, QBMAN_CINH_SWP_ITPR); +} + +void qbman_swp_intr_timeout_write(struct qbman_swp *p, uint32_t mask) +{ + qbman_cinh_write(&p->sys, QBMAN_CINH_SWP_ITPR, mask); +} + uint32_t qbman_swp_interrupt_get_trigger(struct qbman_swp *p) { return qbman_cinh_read(&p->sys, QBMAN_CINH_SWP_IER); diff --git a/drivers/bus/fslmc/rte_bus_fslmc_version.map b/drivers/bus/fslmc/rte_bus_fslmc_version.map index 7dd28da..78671a8 100644 --- a/drivers/bus/fslmc/rte_bus_fslmc_version.map +++ b/drivers/bus/fslmc/rte_bus_fslmc_version.map @@ -67,6 +67,7 @@ DPDK_17.08 { qbman_swp_dqrr_consume; qbman_swp_dqrr_next; qbman_swp_enqueue_multiple_eqdesc; + qbman_swp_interrupt_clear_status; qbman_swp_push_set; rte_dpaa2_alloc_dpci_dev; rte_fslmc_object_register; -- 1.9.1