From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0069.outbound.protection.outlook.com [104.47.32.69]) by dpdk.org (Postfix) with ESMTP id C882A9B77 for ; Thu, 25 May 2017 20:10:15 +0200 (CEST) Received: from BN3PR03CA0114.namprd03.prod.outlook.com (10.174.66.32) by CY1PR0301MB0907.namprd03.prod.outlook.com (10.160.165.18) 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:14 +0000 Received: from BL2FFO11FD036.protection.gbl (2a01:111:f400:7c09::187) by BN3PR03CA0114.outlook.office365.com (2603:10b6:400:4::32) 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:13 +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 BL2FFO11FD036.mail.protection.outlook.com (10.173.161.132) 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:13 +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 v4PI84WT022340; Thu, 25 May 2017 11:10:10 -0700 From: Nipun Gupta To: CC: , , , , , , Nipun Gupta Date: Thu, 25 May 2017 23:37:49 +0530 Message-ID: <1495735671-4917-19-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: 131402094135650196; (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)(39410400002)(39450400003)(39400400002)(39840400002)(39850400002)(39380400002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(9170700003)(47776003)(5003940100001)(50466002)(4326008)(551934003)(106466001)(48376002)(36756003)(104016004)(2351001)(50986999)(76176999)(8936002)(33646002)(86362001)(575784001)(105606002)(498600001)(8656002)(6916009)(2950100002)(6666003)(53936002)(305945005)(356003)(5660300001)(54906002)(8676002)(38730400002)(50226002)(110136004)(77096006)(2906002)(189998001)(81166006)(85426001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0301MB0907; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD036; 1:5vI60KUs/2yOD0yCAdu80Tg9nGIq4fJ9ZDUYdM3zziku69CdTxfD9TNV1slS2rJgzCH6IzZKJOf0zX1FDf5lk2PvOZws68VbCACC+RV/XwSiDY9sklArzy8tR+T/+tle5WpQM6pB0y2kvvV3U2rD8IGIuuA8n2JzlwDZBboxd3vIe8r9DkS41MmCUg0Da/f3T3VuuR+Wh2BjUKR7w+qLU4db3Z0iql2gJzhtq4pkDQkQiNrzahJBkjV8E7N1IeAX3pbOCmIGebqX+F8clOzzNHdHfH1PZAWVxZ30epRWNDhoNTQjS/C+UWXCHUb6FimhFQDf+uDYSJbeMMMZmE6E36z0bi+pjZvUjrnpy8Rp+PP/mDu5YTu8UJF2IZcDY/WylxQMLDMKCjv/nJx3T54o9vo7g5E4UBquOZb5vwKnj8nM04QKZwq8ZLF1iR5ms3AT0a4MGm+cy6BAOGqp8BNqXeqUxYXk1pFA7cpd4/iswq1a6p/9pNja3LdcJrE3cU93gMfTw1LTnNzIiIXzEM5nNwItz0/PxQy9tqWzYppEYI64UGzzgWC9lK2+knqqMF+5Je8/Av64o49g8tJhDEHQqcIxLoG1bZ4jmxAaR0/IRlzwhzmtOKeL/919Ojqh8S7/8eI1gTcDssNVAKhA69RoNpCBVLwJKdJX2/nJBon7XMouz6I9gmfmO5tqPj1MOX86H48iCP1Ys1Najh/LH4Jiw4ftycJIs9KRRuuqQIkNrngM+Kbw1fCgGlxpz1sJfi4vbMC+clNvXRGBmz7h+HEBkQ== MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY1PR0301MB0907: X-MS-Office365-Filtering-Correlation-Id: d05d9585-b5ad-45c9-4632-08d4a3994a27 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:CY1PR0301MB0907; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0907; 3:gO3gDnALGMJVtjgibsV7arO2dZ9hPFZX4nCrYp90Krv6wJFT3WdvZujuUxYSZ7364qPx9u6slY1ed1PglUFImx8iRZb23AJezrmUFmmYyAhm37Ji/HcRWTeRxwMZV/p/P1r+ha7gnmJZ2AIVc/I8AWm4dbzLSMWh1mgL0e58QJRgNjQljeb9Hh9qe5HDRFsgaj2JiB2oPE19lut2GV7TtBUR+o+/WlkrGKy0+NuhMuHH+NisxwlL2MQ2DRA6KutXfSvlv+5b/xeFNu4ACiPAc7lRYPi5p0E+znqmAqgDP/0Z1iYWHmEs0u1QFWLJjAaCO+BaISS1ON+9Cbxxr1pdfNACy+Xc+rx1i2gYHzt/Jqw9ejTE864KwXG4vUEEG54XUcz2UAGD7KF92O7qf3T/hKDym2AOYuE9JWxWUzaH2f63kONlBwVyZVoHCdCWR2bA; 25:SjJPgsrbV9mgVcFB9anfJcJecQ6dCHbBjLusF/mqNFqFYD1nZzSPBmbmfxXJQxyHAaBxnBNpAOOiu+dyCRRNcMkxZixCBitpJrNjubWCSC1I0otcyMvzZOsARBuOfu+6gNTz2m3rtqz1odfdmB7d3SiL9iTBhRP8v3P2gyfP4P+NkG7GUZfv8/Vnj7Til1ICfuAXR20ev1QVv7a44iekvghEA7djLxp7ys3WvQlePaUAyvrC9Gz4OIMy0QYP5D0s316BAhYcHdMD9g/ljq7HrEj/i6yyCp6ewyAc499x6kc9CJnn6+DnPDRuO2rp9akE2Q2bock3HuTzcQ5+RQmOcWssDStAyoXFf2Bt4+F8D95lEUJshCjw8PJ3N901GoLgnZUoKZRQsPhO/EmyRbNhGCXQFEdapqqyLhpLxrCmSyFIDGZJNqI18PBGAbHhH5wOvItsUNakH+FBl9Ao7vYLBRELaBFcxydpFXOIKrKeXGI= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0907; 31:Wd7tVOg20M6TtRa+4vzD80cnYq0KzbLK0MYQBvq39xkqmBSxQWzjIAJiMkwdf9Fn2OMl2V6ZtZzr9Ys+GKpHbDWC7mF9+scQWQT6tqxyGPqjyuFN0ypKrqZvMhefSxR2ZjJ2BOeGgZFKoKNvpJ7Qr4L2Uta2PonvFVT875/8Z/KeaNvUa/W1Sklzn+XH9sHwVSk88hIFZ4U/QIJOmVzOnZdpoIVngqVzc4pXBKBzkz0QirApbD1Y81XLfFmV5RrrhMH581ruOgRrAP2RPYbpZA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700054)(100105000095)(100000701054)(100105300095)(100000702054)(100105100095)(6095135)(601004)(2401047)(5005006)(13015025)(13017025)(8121501046)(13023025)(13018025)(13024025)(3002001)(10201501046)(100000703054)(100105400095)(93006095)(93001095)(6055026)(6096035)(20161123563025)(20161123561025)(20161123556025)(20161123565025)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123559100)(100000704054)(100105200095)(100000705054)(100105500095); SRVR:CY1PR0301MB0907; BCL:0; PCL:0; RULEID:(100000800054)(100110000095)(100000801054)(100110300095)(100000802054)(100110100095)(100000803054)(100110400095)(400006)(100000804054)(100110200095); SRVR:CY1PR0301MB0907; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0301MB0907; 4:f/beS/cUSDvr9YHoLaZR40WwwTdY6KojcGJV9Efu?= =?us-ascii?Q?dMjANLgHZGvhbveAoF5TQJliDLl2O3QNld1l9MreJX9X+5chb2yi52TKlPa9?= =?us-ascii?Q?Pm7VfefPRL+TJae+YIlAfQHowdqFC2gaKwRxLn6khFK4Zkq6VHv8u7DcyrIW?= =?us-ascii?Q?3IOkK2Dhax2mo+L1dmbAC9GrAB7Kvw6XjbUKMYMfqPcHRtcUwJRazTmFt0gC?= =?us-ascii?Q?EPrjM1HDCSgm4GPj9JfYTGIeL8B4YuHUZjvghCRZ/6G35nqwx9Q0rN3zhfAk?= =?us-ascii?Q?lzuSuyUHdSL/O20n2BbzUTBtgML8KGE2BSKlIMgoU0r6zYOaDlP8V6OM6RX1?= =?us-ascii?Q?XyciYMFMMQ6pB65Da80mH5USJlN+k5ZjTAEJCODHrWAkiDOVJxfn0U9mJITY?= =?us-ascii?Q?pqUewpWHfdUEbgCgJFz+7+rnEDbMvX99SBOp+YGhky8ZNdUfSVxQEdVTw5kU?= =?us-ascii?Q?ecWGZNoi4v7hJAsCduBzYtDNm3gX0GdyQ5sjkIZAPrOpAij1qQXhvoPkisNt?= =?us-ascii?Q?Et7zzhWs6420YOz8jhlkYVuFOfeHujJMiGeKCUxqIlwNXQEvQ0c3TW1j0io6?= =?us-ascii?Q?Qxy7AoWqzf//m6vzRJXESdM70bfrru09Zl5PzQaFysYjuu6+ffsu5kOML1ZW?= =?us-ascii?Q?6pg8oY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B+4xSHsf4O+SCj5DxqDUafc0vIEwHfBdQoPqTitJ/Cx59gBJ3LkTE0mY2iTNp9J/j/C65JB8YlFdgAPJIVqEBvj6ypbxJROUYAoZWtME4IQntyTtsheY5x9Nv+qL9Q+d99qKKZd67Jp2ryLhh1mTOlADg7vfazBXFGN3xpmv9mEmHBffd0U4qlS6gUouukCD3o/UalJoXCmh5sSTlabJA50nv3z8UCGNDAtKUresoVsDe15SuJhU27gtXzbAuLpIACZNAFj0zmWnUSvcZlmN8iJ42hTLpvf+1QeOtHcOH4ZUpqT/SC4rBdG6ARXDlPBaaATFIZPfKpBrYbP+0EVXCmwUful2w1YyMfTjZ2XMgdG0JlLqWQ2ZBdgkG7sS7rYD/DzPmrgFpyFS1PZNGaShN4Rgp6CEw==; 24:JIexscKSVwkAJ0ix+hlxwXOCdK++7i4M3bHXZ/D2DTaL8o9vdOEnw6p8O22QG3Jnut6nqFMdBXKVkbzm1ktVFsGJ0nM5b3rLZVDZOyYiD/c=; 7:6y970atdfZTEnLF37KE8uIAY4Uq7Rnv8wBrRC1mx5YnEdv3uOZpPzEv9aM/DpPA3evZ9Ev11yE7XZp24H35SLVc2g39T31JDNNIu/yIZ7TDOTpgU++jlQ+ZAvXx2CibUWtSvj5YIoz3rzFIAmbaB99MEvTzyZUfiW8BkGSEd8oN2LaRzfnA0KJGHHmT56IanjoZZ+X583uzHMp6GZ7visOkhXMM0Ie15uq9HoHtnCSopc7iaf0BQW3W+EHAEnZxjLSPl+SM7joYSEfEgrOkUm9LJbv3+Et5ZBVcantYzU/qj67fU1L8jmXbZ6iolQcPSa57MZLP8c/CdNn2wcHYm2g== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 May 2017 18:10:13.3778 (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: CY1PR0301MB0907 Subject: [dpdk-dev] [PATCH 18/20] 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, 25 May 2017 18:10:16 -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