From patchwork Sat Sep 16 10:52:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112785 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp1614642qgf; Sat, 16 Sep 2017 03:53:47 -0700 (PDT) X-Google-Smtp-Source: ADKCNb65Bd4+Ph0P19AZ1Ye7Ywm0eFDBiGm+aBLkVDdGRLQaSsyD0JdkIHUFVp6XIXRFUqYmJVML X-Received: by 10.223.165.29 with SMTP id i29mr23163546wrb.163.1505559227147; Sat, 16 Sep 2017 03:53:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505559227; cv=none; d=google.com; s=arc-20160816; b=S4eb2sbDdcuUok+DeL+rBeF0yH7pLaNdcKo4o5w74ssBcBwatszl2Gy8OgXGaSl01m uEJG9ExqkW2/bo7EFLhdyiDf9eFCc00YOxrgo98nDpt+H427cibr/vLHtaUmfqIc6uxS 1w/fJssgoHPekxIHSpqqvectriwmCuKaaaKeqw4jBcZrAmSlHQZlBKmKDPZTmsRSuKU1 5psrbh+SfLQWK0KDJi662Dwwl29m8HXAISzs12aeVnpv+gkxH2K2yp/nRoWKbEmKUTYu PMiyM9UVyMw66s9YKy0SgqyNruXivoDKpkoUhU0WNcPyxEFTKgpB3UPswRAdx8HbOdzG 62DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=T+AeHQS+nzkgRGzh2aSeyds13Sq4qKUkHzK3UHQlfUs=; b=C+Zp5apLNEiNbOeT499yYqQ8EtID02ixqKAmJq6TI7niTuBSC9n73Yw2ykzJJRb5+r CyfNGs6df+n0LtV6S0PJEZMd86zyy85L0fBlNrD1fbxGOp3ajX+HSquTkzazCCOw4A23 dVsiORJmEmnvawnvSRfdM+xGuT06nGhfkdpHYMSixYFtPHthbfPWNspr7YjMGWGY295p /21aRol6f1zOQobXWA87p1G5QCa7wtQXLEiz0zagnleQ1cOOm8bye0jkHIoS1OezNXsL QiZZvHfePNw7XOKRn5E2yNymFgvtIBUFsvBntcA8A2vEHS5fMj5u4XEV27Rl14iE3nw4 Hmgw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id p5si2590177wmb.195.2017.09.16.03.53.46; Sat, 16 Sep 2017 03:53:47 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E85C37D26; Sat, 16 Sep 2017 12:53:24 +0200 (CEST) Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0046.outbound.protection.outlook.com [104.47.41.46]) by dpdk.org (Postfix) with ESMTP id BB3A01AEF0 for ; Sat, 16 Sep 2017 12:53:16 +0200 (CEST) Received: from BN6PR03CA0014.namprd03.prod.outlook.com (10.168.230.152) by CY4PR03MB2694.namprd03.prod.outlook.com (10.173.43.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.11; Sat, 16 Sep 2017 10:53:15 +0000 Received: from BL2FFO11FD016.protection.gbl (2a01:111:f400:7c09::130) by BN6PR03CA0014.outlook.office365.com (2603:10b6:404:23::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.9 via Frontend Transport; Sat, 16 Sep 2017 10:53:14 +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 BL2FFO11FD016.mail.protection.outlook.com (10.173.160.224) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.13.11 via Frontend Transport; Sat, 16 Sep 2017 10:53:14 +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 v8GAr6uo028328; Sat, 16 Sep 2017 03:53:12 -0700 From: Hemant Agrawal To: CC: , Date: Sat, 16 Sep 2017 16:22:17 +0530 Message-ID: <1505559161-29222-4-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505559161-29222-1-git-send-email-hemant.agrawal@nxp.com> References: <1504860327-18451-1-git-send-email-hemant.agrawal@nxp.com> <1505559161-29222-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131500327944718444; (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)(376002)(346002)(39860400002)(39380400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(85426001)(76176999)(316002)(50986999)(54906002)(6916009)(110136004)(97736004)(48376002)(105606002)(50466002)(53936002)(36756003)(4326008)(2351001)(104016004)(16586007)(106466001)(33646002)(47776003)(77096006)(2906002)(8656003)(8676002)(5003940100001)(86362001)(81156014)(81166006)(305945005)(189998001)(5660300001)(356003)(8936002)(498600001)(68736007)(2950100002)(50226002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2694; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD016; 1:dH3RO7789J2VZy4lKKG3YtAtg4LamBDkI3g/xlfjwHtscxUAXK1V0P0eWCWbANtdWJu4AlpcU51/KKFMlT1xgfQAzPecrQISsSbhXF7T8jrXKIQpE8BtsAr3qE0eLLAL MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a414cbb1-aa32-4a53-a70b-08d4fcf12172 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:CY4PR03MB2694; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2694; 3:PaqPNtiT3RvfN7imfYmMi9DkL4tHJukHmHdaJ/mvnJ3quX4iWOS5zSvyapEeFrgQMiwzOCAGol8PypcaNQDJgl1eZ6+EyiINRGRYK87xpDte6XCM4n7C9YuET41fT/5vTE+0SDTP2ocs2FFxGLaUbpBziPsJO/ubphJb0KdZjLgjJCWeX1xCmpZl+uRhjBDkn50pUBvO0TFhQhC9o/v1VP2gFIR6D9Z/mTBi4DIjV/4wR5MwgSFU6nc0H/9JBrNZb+MMWW9X8+6Ej+Vo7jz4YFRfjhztgkbRXicbnT/DPSjQN/WV5wu/2sCxh88Q6iCnz4gdf/8VjxQmYI4HlL8Elo5j605wATd3phVLLtaDygI=; 25:vqOmKVsAsUub0Xy4HWVVFfIQVFUceKgk0BFDXyz7YCNZTlf32k4IOLD2SSpkNNlqMnGz+xjIjx+f1GO+OSAn3X40vQ2JVmGcuUxswCncp/RZGn/hqEGV0Qsdcs2xpsIxdBchyAmUf1ApwJsa3DxQCu21y4dWbS30HDckRlNtvxp92XPYOBhWNABqqQfsXE8Cxr//6R0Qd4mg1mu4qJ9SMrayT8UqiZH466JRXxiepq+wINJapVO7njAZECUEikQAKPO4umcQhCAxOtDX9Z1KLmniiPRhlzfx6iPBKKkiHtRqlmtq07t7Zb2y8o2x01aCf8cDlWqaCg1hgLw9wyqohQ== X-MS-TrafficTypeDiagnostic: CY4PR03MB2694: X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2694; 31:pAGoHKImd8r+Xwmo2fRWKsmO4o6H6yIksnlBW0s7JG3lbddccOw2ARv/cXD56LXjA0JAjOPMkHgtnNIdDarFXbr/Ict8/gGWaiDNNO1C/nZm3/jEgeLH3qRpMWCNnfKMhX8ByaUwqpyAtJlHdt293tGqgWlatLK0pyX8hmDrDXzmeDnTOCsOXwdS8shmIgQPXCgWuMlQf/qVvaGD8LwWKCPdo741EwL8OBoi815DARs=; 4:XOkQzyssbO/y6628E/hC7r1dtRmCpY4cjSJRh/kiw/XOH9vd7jqUEDusxb9XZmQkpk72Nn6pz+p+Y15XZ+EPT+wG74RnQVDj4W5ozJ9A1Y1gUHfddtUVL3F5dBPyFEzLUywKC851DybpkJ8kE7z+Stewq5Zli1ibBxas+aMK4y4pdvFsoS6RlSZYLO3+DLttXOKI7ShzqScXkBQZYLNs6V7EjqpXSntVQR/Rfbo9z2SHW2vRWp/bVxh5Iayj3ASH3/lbpcGWTG4svKMDo7OO/ari4n6yjgxEk3TqE+uEITsQ5XlinHnKgH2Yb+K3ro13pSP/Kd3NMtnNsfEJsl35Fg== 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)(2401047)(8121501046)(5005006)(3002001)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(6055026)(6096035)(20161123563025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123556025)(20161123561025)(20161123559100)(20161123565025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR03MB2694; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR03MB2694; X-Forefront-PRVS: 0432A04947 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR03MB2694; 23:ktNuno3KtgLaklvtu7CkxgBI7YACTSZn/X0GPojZ+?= tKAiZf3u6SLytsKqQ/6mrfM5Pv5lTqWdXVPrp6LgqbyZIU0eGYNaX0Fs+OFBooqiGg//9CQBj13eNR78RNs7D3R/vln4NAKiJK4+WTooY2QIlV8Y/f/UliIbzMXP3sGQ0iH+8cBhXu16SU7FrWoYpf/G6pm8iDkq4hTz1uLe0OZXdHm6ItcfZPm+ka2Adm4WJMWUy9JRtjSQeEa05culv1/q9l04KmDhltVnFVxHwEnr20lpXeQN9zIAdCEcHwQ8RkASTtGxArpIZt3Wx+HwdO4HHVuLclijrL803MTR91z0RA+u2MyzmYm9jH7ZwhF3jjQCCkppFEgLrcG8uOvdOS0aM5PiXtwxrPPYvyWXTIio9n4JO3vquJBajx7HbP7+7v8xyXJsTS+4xCjGbE2JMkeS++xZdjLep6PWQol67wEeSynJ95RKWg7kLY4wBNSi5Majc/NyiduemmFEXNtWboQt5ojalDPWlvnGl+hmO5UbBGHjKjnsqFAxeTlISTeAzT/yfby0jqJhWS1fIIaqawLDnoR85S360bokvPu3woJLUtLfJ95Z5Vc3y6fH2G0x/2G0cLE10aosOEm5DaU6z/z6LqNNRrUZsC3qZ9HeQeGyPyvex3e9jWdQAPr7MzLVxQFw+d14Lh8CNxOB/4QRHmCRsLMxD++dTU9P7SnR34bcdDwI1S+V7ykGiHE8Ds3HVx1xB3iTRoeSl6E3XpBjiecUirqGgWeVCCw34oVqG92iRtGtYnT5qAJe9tz7Des7703veYysTkvuUokQEl8Db3GW35JCLaPWlZBuex2HDEhOkpovrw1UvVLMPPBDliZ9zYhV4xQfaohVayXnBjZWhIjFD22tYJe7dMeaAcaZG9Vruf38g1PY6MzP59YkYW9Oi+ItqEYjcpwl+RTeXIdALS+ZbtcPwh7p2mLGwpySjxR0EZp1rZ2cCOR30wYAJvAv8LTZPDOB1DLuJWnnbwcu6kZLaDZUad3h147AVt5fx9AwqaSPrLcyvsY2Zu0eQGUJDvBjllPL2AFME2ET72VY8PzcQ2jPkQj8B6gBAmTGDpWYCIuQIBcWJYj7hHZTSkqWUChY3JAJ+12GAz2QibyA6Wa2tASZr9eS/+fCdHNWuWcKw== X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2694; 6:M+TNwwsm8monBzlv6LXlrJu1hZeIHu7XoOvub7pZCEZjAzcx+aLsqxsuRK59+HF2EpCeBu30sSSkXuA/fiK6npQpbv+uwxDeHBOoHiWYMxh27vH7sEtiZwJcml9TzsN0ePRVD/AAt1vImVOFctuKE096N/wn1MK/a7hAOsremEX6GfRI7csGleS2/ux3y3GdbfBcNCDLO2fAHty/TejCJ8/+ZG/fpqcVtj/nvnxeN78tTcTkRQZJ/NuSxNP5cEWub3ldF5KuEM4AoNDdqCfzGguCE5t2fNEAZfyexbJlzigF4zv+t2xPpnDle4ZLsNaje4fiuxJHwbhBeG1t8R/u+Q==; 5:XFyZQrYl2IAHkx5tiGuKxmrrNhe7PlVI0O1QmvG/D/ieaFwCr2GAXXbAKIM1H5RsW6D+eOx0uoscTuADqYzN7QrW4lzj1Tu9bYDBO110mFqli2KrKpKt+iMkfVPoz+2yyQzoKyg4Rp/Kn9NFMW3EvHse+Oy4oVRpcxIY7eJp6is=; 24:Ul4LZDhRgcMXjd00JLb2pL5T7GOzxvEvyCVKswJyI+2v4r3W4ZgUgcZZqnpTMc3E8AUBzQaoOS9ck8Rys1sgaa9ZvCnZopWFWgc6Yxsh3eg=; 7:g1UEpYI/RNMsrHDSH1n4cnsRd9CL+ZrZ+gUnb/hy2MjiDdNmqP1d0oTuABk9aI2B8xd084tky9ZcGKFuJuaYaRctUhrhHprn23jUCqcPd0WlOmI+zJ7JSinao3K+LTqAtHCRNoS/gNYIAlApNjjCoZCC7/U5hBE3EaEx7v/IpYN0PztHUUT0c/TqwloNQiJrVMJSVyfmpToDPnn52hEbZhfbDiSD9Ul+Sq7IWiEyzpI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2017 10:53:14.3002 (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: CY4PR03MB2694 Subject: [dpdk-dev] [PATCH v3 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(-) -- 2.7.4 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 95c3951..094cf30 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -634,7 +634,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); }