From patchwork Fri Aug 25 10:49:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 27958 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id D1CB890F5; Fri, 25 Aug 2017 12:50:11 +0200 (CEST) Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0062.outbound.protection.outlook.com [104.47.37.62]) by dpdk.org (Postfix) with ESMTP id CB2337D9F for ; Fri, 25 Aug 2017 12:50:09 +0200 (CEST) Received: from CY1PR03CA0007.namprd03.prod.outlook.com (2603:10b6:600::17) by BL2PR03MB547.namprd03.prod.outlook.com (2a01:111:e400:c23::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.9; Fri, 25 Aug 2017 10:50:07 +0000 Received: from BL2FFO11FD033.protection.gbl (2a01:111:f400:7c09::189) by CY1PR03CA0007.outlook.office365.com (2603:10b6:600::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.9 via Frontend Transport; Fri, 25 Aug 2017 10:50:07 +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 BL2FFO11FD033.mail.protection.outlook.com (10.173.161.129) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Fri, 25 Aug 2017 10:50:06 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v7PAnw67032070; Fri, 25 Aug 2017 03:50:05 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 25 Aug 2017 16:19:19 +0530 Message-ID: <1503658183-4078-4-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131481318069176703; (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)(39380400002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(626005)(110136004)(53936002)(4326008)(2351001)(5660300001)(54906002)(106466001)(85426001)(498600001)(77096006)(33646002)(68736007)(97736004)(50466002)(105606002)(81156014)(47776003)(356003)(81166006)(76176999)(48376002)(305945005)(8936002)(8676002)(50986999)(2950100002)(86362001)(104016004)(36756003)(575784001)(5003940100001)(6916009)(6666003)(2906002)(189998001)(8656003)(50226002); DIR:OUT; SFP:1101; SCL:1; SRVR:BL2PR03MB547; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD033; 1:h2DM8BejEZtNIqUBmw54k4yH14vSmW2gW16w6dCBpwJPWMK85bQesy96elkQhTGZuV9o0jqGu4HF8QdKZ3KubnmkwB3CMdT2SGHFwyUp9g1rGZ0IY48Gp1W6r/hVW30C MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ec59961f-9593-4e00-a81f-08d4eba70c91 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:BL2PR03MB547; X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB547; 3:u92hcp7x+4sNrK1YA4hq3gEycJvO890zq4WkOXUB0z+fKNQVFBRaW644ICa0vrV31P/li5tn2ZDn7oyo98FMqMXRw8+MNf+iCb898aLM6cd9l1Wpc1RpbnEH9Jy8uG8Fave2QSwv53+nLNd5lWBBKnbaZZ6nMEC51dV/0nKIdjNq2dVOGWt4ggOGl8yJo+RDCSbLm609DJOnc+bxazHe0nnA3t/RZ+Heh0EZnH6zpowmwt52yPBcYQWHx2sG6HsTpnarEfN3e1DdwdYU3KNQ0/J5ZuvOcf/22+EcTdT6p+QguRxS0cYR4Cka9q8GmOlbASfY5SF3lYJ0nLa9rjZpUqkhRAie0SUaMkfDiaVALr4=; 25:rOs7l1ebd34ChIpMWKXhL3iPl5ft629rAXN20+zVHXeobHKlH/5iFvMR9c9yfCX8qlxUUxIOw0GAnrzfqEtTi7nkuss6KNw01GQvagUKVvCXo4cW8IR8/MPTxLzSs/tlSxggggOFARMl4Zl6wjp4vELCsX9zM928Dof4AHzHwDg24IL8QFoGSHQMBKalzjWnrnjm3kzZQuFYbo6I6DksMrvpF2eb2mGitF9Px34VVsjyj5fIIONpJmaqO5MUgUNzQLMf1DrX4i/oApMGJdDCc9/wsURNjL88LFb1EQNYXqdwmlkHFXKMtl1VMUakoIPfLUDG8ieo9rwhpOX/MCJUznt2c9bVqvhJ0s3JjMuYy7I= X-MS-TrafficTypeDiagnostic: BL2PR03MB547: X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB547; 31:k9OpR8hVaLaQJSt6StYWNdJyEqlgD5yut3A0iOnzq16zcSGfZjmCuKPa8R1XUWD4N2Ez1iHHXgPMsDkn85fG81JwrRrrfIq93w6WiwZrEKMPHiRL0ftLB9ThM342PrCcwJI27f2Uipu7949qqT/eADEBEgxYOjzlpGPlDA3HRuGyBWP/w9RdKX5Aef1pOOhRPKzloQmzRlWUdHxtT+vl1fro/j4VSd47ir+Hfug76Aw=; 4:V+blnHC+cTOzhsPIuWNVgbySnno6/VGWB9bv89BKzNXcyXdkIca1ANDcMUPaCu37q2B/Y0RV3U4yIIzAfZzEDq/tmfc7UjSpaxg5EGkdT4XmzBkz3+SiZ/ZV75fJQE+f7x/tZMSCFx2pyuaa343ojIreTFpC19+wsdPejDMNSUXUFz2iEaW5c9Pd08Arg99wQGwC5TbwiFRpMbMOEdC0dLq4R5KHsXJhrHf7u+Y7FMunuJwe1E1Om7WvuCz2Qd0blIynq7qITllNJ+5inn7SQk/kcvF2bqsWfpX04QxnxUs7N0JaN/09gvC0+/tQOB2+XBgoKPW/GK9+zAuAynUizQ== X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(8121501046)(5005006)(13016025)(13018025)(3002001)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(6055026)(6096035)(20161123563025)(20161123565025)(20161123561025)(20161123556025)(20161123559100)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BL2PR03MB547; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BL2PR03MB547; X-Forefront-PRVS: 041032FF37 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BL2PR03MB547; 23:E5fNaRIh4B/SwS7PcNJI6Cuqau/GcGZWeWHy+B+q9k?= v8id6Dj4eXvELSb3+R3YWFVhanWVLZoUotQu+3GJtRvSvxb4QPdqvw7px0lluEjz51sCM9dpMeIaIn9xSSI/lPRA1PBKJUuzynUuEJPCes1knssw6kpmjSEDJ05lFW9ZoX8gbXoErZi/xg1BzhcpIU/1rTaDVSOKZszzHehf3zNwat3Y4LTycLF+aKIn5Bn3ve/uPFQzPgvcaOvzxlQEpDalJz6RuDHe/kRREHrTWvQKSvpSGjtLPUscyH9AlwafTAeqPrkDge40jUSZFQTvVD815rwPQZEOfTYvqzPNBa1BJlGzNyWMRbceWjiVuOKc/OWRqhYLxheALYKdEYdUncb8k9T0WGRugqKWQavoVQNs1mn2t+4TadXHANRglhsV8mabygylo9iFM0+L0GX7Y9Finm6HmqSkL9Mg9xWsuIbmZkTrYtowsIB7UAuJGehU3yVOJyJsMYFf/kIGWAF13H+Edv4owe5TvrFSk3lIGSdZgXrS+M7tF+J4dNYBzUODAC9bdYbCU3E0U5Fnh4SHgymvvy4brk/2PEgDKzKURzMmyuEHLFWARP7a3UkkTwbkn+EHYuQg0PGs0TZDHKbhHsM/aWsI/MG2Xd54PfZYAqABASJFWBXAaGbHPHHD2sznp4lwmw3E6m6u7LcQ63csS4P0cClfNrYzjvGNfF4AgvTdgGPyUlPKtKi7vjlbHonwkl6WlpNMmKROA22SMG/45KwT61/0TUHU3dlWk5I9RVm3+aR+Fghg5FUhj41TwXrbQVcxZidRPG8ImxUobAqMXl6uavZ+WQyKFKCjgd9SDbEW/HNF8/tQcKcrBf7uHt3sNd7021DiwOzZr90Dg6xLk5S6qJCRn17GF5H8riAoBgmv1JvtFbfF235qwWbD6lwfxQvhAozWTqx01RMqdZnz/K4Pc1gQ2+CZIv7eTR1caFKQOfAwxmEgvZlMP5bTPf5EMpc+BrcyDzeAZcyDHqUt7IyT5H+YVy4z0COQWj9uyvADl5k38B3daayCJu1/rWI0TBghwHiRxtBX+46xoDGZcMYV+GE/wKZPPNjVre6OGIrBtYmLMP5ygoQkmshyRQ2gDnOA38rG548LB9CN8V0BCFdyMemssTFawHkbSpLOXYsQ== X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB547; 6:T6NGNrdrE7PfCQEcApCig8HhGj1HdcuHkLh3UUp8IuTdVhwBQKQgfjslp8+tTD3sdgkooH/yjNZYIh+gbwF2p6Wl3KMlN04argGqhjDvZ341P+t5XbuE0Ie5M5+dchtH/LAPrhs6dUtLzQQbXzPNcu/BgwdvheB8IqhcDsxtHdwc+d8BbXM06gzGVlDvfDsN5VH9XuAioV0US4CWHiwiphNj3VTxGH5tr84l3AFstWTvindTWYsP/GC0l/pnLO0ui2Y2NWsKgK4cU52dlo59PLTt3lIJvu4z+heMludQ5lskHFez87Wz4/Ce6n87web/OQSvBXuSJv1+qjNresFxtA==; 5:GkFVQEqdNv9cEGiMHPanvTMtc0UM6Qk2BXa38x/GIUQEfIfjNdtxKyhRhb1k2vEmnSY5JHVPMxhddKBP2yqIwSDCgIe3/V2l4U2GoQonSOWxXVtgrn1Trn4DNN2z9+mp4BHOXlEl4ayFmy1KtM0jSQ==; 24:J1se95+Olm470J/8Mv+5c8sxbEqMrWZR6Gj9Zfoe3Kcl6XrUG4uCBN/8FH4xEhgOefQI9aiH4a0u5qp4rlSILMQnDvADv67pEunG/a80u8Q=; 7:qXZJd2EMxM4UhWMlm28MgpVfF+mtfxjoHD+AZTsbHMm2dJX18l7uRwjgD5NFUUIKT24a5BwNhrdI4BvUR/G1cO1gGCNNn1QME9Vn8PyuYhRtIWSBkiO7AX4iRU0WtzY/xQjdJX5WqFL99DwOPmv4C3FphybgNmq6FkKeDj2zWBKHrPll2+jt2FkS3aYT7bgpZFIvarM0YQBW/DFlvJ1r+mAOo7Bofd2P/7TidjMOCAE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 10:50:06.7460 (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: BL2PR03MB547 Subject: [dpdk-dev] [PATCH 03/27] bus/fslmc: add qbman API to do enqueue with multiple frames 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Haiying Wang Clean it up and update the prototype. Signed-off-by: Haiying Wang Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h | 32 ++-- drivers/bus/fslmc/qbman/qbman_portal.c | 200 +++++++-------------- drivers/bus/fslmc/rte_bus_fslmc_version.map | 3 +- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 2 +- drivers/event/dpaa2/dpaa2_eventdev.c | 2 +- drivers/net/dpaa2/dpaa2_rxtx.c | 2 +- 6 files changed, 83 insertions(+), 158 deletions(-) diff --git a/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h b/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h index 23c3d13..fe1cc94 100644 --- a/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h +++ b/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h @@ -914,19 +914,33 @@ void qbman_eq_desc_set_dca(struct qbman_eq_desc *d, int enable, int qbman_swp_enqueue(struct qbman_swp *s, const struct qbman_eq_desc *d, const struct qbman_fd *fd); /** - * qbman_swp_enqueue_multiple_eqdesc() - Enqueue multiple frames with separte - * enqueue descriptors. + * qbman_swp_enqueue_multiple() - Enqueue multiple frames with same + eq descriptor * @s: the software portal used for enqueue. - * @d: the enqueue descriptors + * @d: the enqueue descriptor. * @fd: the frame descriptor to be enqueued. * @num_frames: the number of the frames to be enqueued. * * Return the number of enqueued frames, -EBUSY if the EQCR is not ready. */ -int qbman_swp_enqueue_multiple_eqdesc(struct qbman_swp *s, +int qbman_swp_enqueue_multiple(struct qbman_swp *s, const struct qbman_eq_desc *d, const struct qbman_fd *fd, int num_frames); +/** + * qbman_swp_enqueue_multiple_desc() - Enqueue multiple frames with + * individual eq descriptor. + * @s: the software portal used for enqueue. + * @d: the enqueue descriptor. + * @fd: the frame descriptor to be enqueued. + * @num_frames: the number of the frames to be enqueued. + * + * Return the number of enqueued frames, -EBUSY if the EQCR is not ready. + */ +int qbman_swp_enqueue_multiple_desc(struct qbman_swp *s, + const struct qbman_eq_desc *d, + const struct qbman_fd *fd, + int num_frames); /* TODO: * qbman_swp_enqueue_thresh() - Set threshold for EQRI interrupt. @@ -1119,16 +1133,6 @@ int qbman_swp_CDAN_disable(struct qbman_swp *s, uint16_t channelid); */ int qbman_swp_CDAN_set_context_enable(struct qbman_swp *s, uint16_t channelid, uint64_t ctx); -int qbman_swp_fill_ring(struct qbman_swp *s, - const struct qbman_eq_desc *d, - const struct qbman_fd *fd, - uint8_t burst_index); -int qbman_swp_flush_ring(struct qbman_swp *s); -void qbman_sync(void); -int qbman_swp_send_multiple(struct qbman_swp *s, - const struct qbman_eq_desc *d, - const struct qbman_fd *fd, - int frames_to_send); int qbman_check_command_complete(struct qbman_swp *s, const struct qbman_result *dq); diff --git a/drivers/bus/fslmc/qbman/qbman_portal.c b/drivers/bus/fslmc/qbman/qbman_portal.c index 97df703..f212829 100644 --- a/drivers/bus/fslmc/qbman/qbman_portal.c +++ b/drivers/bus/fslmc/qbman/qbman_portal.c @@ -525,15 +525,26 @@ static int qbman_swp_enqueue_ring_mode(struct qbman_swp *s, return 0; } -int qbman_swp_fill_ring(struct qbman_swp *s, - const struct qbman_eq_desc *d, - const struct qbman_fd *fd, - __attribute__((unused)) uint8_t burst_index) +int qbman_swp_enqueue(struct qbman_swp *s, const struct qbman_eq_desc *d, + const struct qbman_fd *fd) +{ + if (s->sys.eqcr_mode == qman_eqcr_vb_array) + return qbman_swp_enqueue_array_mode(s, d, fd); + else /* Use ring mode by default */ + return qbman_swp_enqueue_ring_mode(s, d, fd); +} + +int qbman_swp_enqueue_multiple(struct qbman_swp *s, + const struct qbman_eq_desc *d, + const struct qbman_fd *fd, + int num_frames) { uint32_t *p; const uint32_t *cl = qb_cl(d); - uint32_t eqcr_ci; + uint32_t eqcr_ci, eqcr_pi; uint8_t diff; + int i, num_enqueued = 0; + uint64_t addr_cena; if (!s->eqcr.available) { eqcr_ci = s->eqcr.ci; @@ -543,62 +554,58 @@ int qbman_swp_fill_ring(struct qbman_swp *s, eqcr_ci, s->eqcr.ci); s->eqcr.available += diff; if (!diff) - return -EBUSY; + return 0; } - p = qbman_cena_write_start_wo_shadow(&s->sys, - QBMAN_CENA_SWP_EQCR((s->eqcr.pi/* +burst_index */) & 7)); - memcpy(&p[1], &cl[1], 7 * 4); - memcpy(&p[8], fd, sizeof(struct qbman_fd)); - - /* lwsync(); */ - p[0] = cl[0] | s->eqcr.pi_vb; - - s->eqcr.pi++; - s->eqcr.pi &= 0xF; - s->eqcr.available--; - if (!(s->eqcr.pi & 7)) - s->eqcr.pi_vb ^= QB_VALID_BIT; - - return 0; -} -int qbman_swp_flush_ring(struct qbman_swp *s) -{ - void *ptr = s->sys.addr_cena; + eqcr_pi = s->eqcr.pi; + num_enqueued = (s->eqcr.available < num_frames) ? + s->eqcr.available : num_frames; + s->eqcr.available -= num_enqueued; + /* Fill in the EQCR ring */ + for (i = 0; i < num_enqueued; i++) { + p = qbman_cena_write_start_wo_shadow(&s->sys, + QBMAN_CENA_SWP_EQCR(eqcr_pi & 7)); + memcpy(&p[1], &cl[1], 28); + memcpy(&p[8], &fd[i], sizeof(*fd)); + eqcr_pi++; + eqcr_pi &= 0xF; + } - dcbf((uint64_t)ptr); - dcbf((uint64_t)ptr + 0x40); - dcbf((uint64_t)ptr + 0x80); - dcbf((uint64_t)ptr + 0xc0); - dcbf((uint64_t)ptr + 0x100); - dcbf((uint64_t)ptr + 0x140); - dcbf((uint64_t)ptr + 0x180); - dcbf((uint64_t)ptr + 0x1c0); + lwsync(); - return 0; -} + /* Set the verb byte, have to substitute in the valid-bit */ + eqcr_pi = s->eqcr.pi; + for (i = 0; i < num_enqueued; i++) { + p = qbman_cena_write_start_wo_shadow(&s->sys, + QBMAN_CENA_SWP_EQCR(eqcr_pi & 7)); + p[0] = cl[0] | s->eqcr.pi_vb; + eqcr_pi++; + eqcr_pi &= 0xF; + if (!(eqcr_pi & 7)) + s->eqcr.pi_vb ^= QB_VALID_BIT; + } -void qbman_sync(void) -{ - lwsync(); -} + /* Flush all the cacheline without load/store in between */ + eqcr_pi = s->eqcr.pi; + addr_cena = (uint64_t)s->sys.addr_cena; + for (i = 0; i < num_enqueued; i++) { + dcbf((uint64_t *)(addr_cena + + QBMAN_CENA_SWP_EQCR(eqcr_pi & 7))); + eqcr_pi++; + eqcr_pi &= 0xF; + } + s->eqcr.pi = eqcr_pi; -int qbman_swp_enqueue(struct qbman_swp *s, const struct qbman_eq_desc *d, - const struct qbman_fd *fd) -{ - if (s->sys.eqcr_mode == qman_eqcr_vb_array) - return qbman_swp_enqueue_array_mode(s, d, fd); - else /* Use ring mode by default */ - return qbman_swp_enqueue_ring_mode(s, d, fd); + return num_enqueued; } -int qbman_swp_enqueue_multiple_eqdesc(struct qbman_swp *s, - const struct qbman_eq_desc *d, - const struct qbman_fd *fd, - int num_frames) +int qbman_swp_enqueue_multiple_desc(struct qbman_swp *s, + const struct qbman_eq_desc *d, + const struct qbman_fd *fd, + int num_frames) { uint32_t *p; - const uint32_t *cl = qb_cl(d); + const uint32_t *cl; uint32_t eqcr_ci, eqcr_pi; uint8_t diff; int i, num_enqueued = 0; @@ -623,29 +630,26 @@ int qbman_swp_enqueue_multiple_eqdesc(struct qbman_swp *s, for (i = 0; i < num_enqueued; i++) { p = qbman_cena_write_start_wo_shadow(&s->sys, QBMAN_CENA_SWP_EQCR(eqcr_pi & 7)); + cl = qb_cl(&d[i]); memcpy(&p[1], &cl[1], 28); memcpy(&p[8], &fd[i], sizeof(*fd)); eqcr_pi++; eqcr_pi &= 0xF; - /*Pointing to the next enqueue descriptor*/ - cl += (sizeof(struct qbman_eq_desc) / sizeof(uint32_t)); } lwsync(); /* Set the verb byte, have to substitute in the valid-bit */ eqcr_pi = s->eqcr.pi; - cl = qb_cl(d); for (i = 0; i < num_enqueued; i++) { p = qbman_cena_write_start_wo_shadow(&s->sys, QBMAN_CENA_SWP_EQCR(eqcr_pi & 7)); + cl = qb_cl(&d[i]); p[0] = cl[0] | s->eqcr.pi_vb; eqcr_pi++; eqcr_pi &= 0xF; if (!(eqcr_pi & 7)) s->eqcr.pi_vb ^= QB_VALID_BIT; - /*Pointing to the next enqueue descriptor*/ - cl += (sizeof(struct qbman_eq_desc) / sizeof(uint32_t)); } /* Flush all the cacheline without load/store in between */ @@ -1493,87 +1497,3 @@ struct qbman_result *qbman_get_dqrr_from_idx(struct qbman_swp *s, uint8_t idx) dq = qbman_cena_read(&s->sys, QBMAN_CENA_SWP_DQRR(idx)); return dq; } - -int qbman_swp_send_multiple(struct qbman_swp *s, - const struct qbman_eq_desc *d, - const struct qbman_fd *fd, - int frames_to_send) -{ - uint32_t *p; - const uint32_t *cl = qb_cl(d); - uint32_t eqcr_ci; - uint8_t diff; - int sent = 0; - int i; - int initial_pi = s->eqcr.pi; - uint64_t start_pointer; - - if (!s->eqcr.available) { - eqcr_ci = s->eqcr.ci; - s->eqcr.ci = qbman_cena_read_reg(&s->sys, - QBMAN_CENA_SWP_EQCR_CI) & 0xF; - diff = qm_cyc_diff(QBMAN_EQCR_SIZE, - eqcr_ci, s->eqcr.ci); - if (!diff) - goto done; - s->eqcr.available += diff; - } - - /* we are trying to send frames_to_send, - * if we have enough space in the ring - */ - while (s->eqcr.available && frames_to_send--) { - p = qbman_cena_write_start_wo_shadow_fast(&s->sys, - QBMAN_CENA_SWP_EQCR((initial_pi) & 7)); - /* Write command (except of first byte) and FD */ - memcpy(&p[1], &cl[1], 7 * 4); - memcpy(&p[8], &fd[sent], sizeof(struct qbman_fd)); - - initial_pi++; - initial_pi &= 0xF; - s->eqcr.available--; - sent++; - } - -done: - initial_pi = s->eqcr.pi; - lwsync(); - - /* in order for flushes to complete faster: - * we use a following trick: we record all lines in 32 bit word - */ - - initial_pi = s->eqcr.pi; - for (i = 0; i < sent; i++) { - p = qbman_cena_write_start_wo_shadow_fast(&s->sys, - QBMAN_CENA_SWP_EQCR((initial_pi) & 7)); - - p[0] = cl[0] | s->eqcr.pi_vb; - initial_pi++; - initial_pi &= 0xF; - - if (!(initial_pi & 7)) - s->eqcr.pi_vb ^= QB_VALID_BIT; - } - - initial_pi = s->eqcr.pi; - - /* We need to flush all the lines but without - * load/store operations between them. - * We assign start_pointer before we start loop so that - * in loop we do not read it from memory - */ - start_pointer = (uint64_t)s->sys.addr_cena; - for (i = 0; i < sent; i++) { - p = (uint32_t *)(start_pointer - + QBMAN_CENA_SWP_EQCR(initial_pi & 7)); - dcbf((uint64_t)p); - initial_pi++; - initial_pi &= 0xF; - } - - /* Update producer index for the next call */ - s->eqcr.pi = initial_pi; - - return sent; -} diff --git a/drivers/bus/fslmc/rte_bus_fslmc_version.map b/drivers/bus/fslmc/rte_bus_fslmc_version.map index 6ac256d..13fb46a 100644 --- a/drivers/bus/fslmc/rte_bus_fslmc_version.map +++ b/drivers/bus/fslmc/rte_bus_fslmc_version.map @@ -69,7 +69,8 @@ DPDK_17.08 { qbman_result_SCN_state_in_mem; qbman_swp_dqrr_consume; qbman_swp_dqrr_next; - qbman_swp_enqueue_multiple_eqdesc; + qbman_swp_enqueue_multiple; + qbman_swp_enqueue_multiple_desc; qbman_swp_interrupt_clear_status; qbman_swp_push_set; rte_dpaa2_alloc_dpci_dev; diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index bae0a96..8052d36 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -671,7 +671,7 @@ dpaa2_sec_enqueue_burst(void *qp, struct rte_crypto_op **ops, } loop = 0; while (loop < frames_to_send) { - loop += qbman_swp_send_multiple(swp, &eqdesc, + loop += qbman_swp_enqueue_multiple(swp, &eqdesc, &fd_arr[loop], frames_to_send - loop); } diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c index cf2d274..81286a8 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.c +++ b/drivers/event/dpaa2/dpaa2_eventdev.c @@ -144,7 +144,7 @@ dpaa2_eventdev_enqueue_burst(void *port, const struct rte_event ev[], } loop = 0; while (loop < frames_to_send) { - loop += qbman_swp_enqueue_multiple_eqdesc(swp, + loop += qbman_swp_enqueue_multiple_desc(swp, &eqdesc[loop], &fd_arr[loop], frames_to_send - loop); } diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index 3c057a3..4342c73 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -622,7 +622,7 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) } loop = 0; while (loop < frames_to_send) { - loop += qbman_swp_send_multiple(swp, &eqdesc, + loop += qbman_swp_enqueue_multiple(swp, &eqdesc, &fd_arr[loop], frames_to_send - loop); }