From patchwork Wed Jan 10 10:46:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 124057 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5162858qgn; Wed, 10 Jan 2018 03:38:01 -0800 (PST) X-Google-Smtp-Source: ACJfBothuJ2QwePlDYwQ/+lThMnkucAb+r2uBosbl46hE3WnjZMpnvgUdQPQ/dpmQR+hBaQnoW8A X-Received: by 10.28.100.215 with SMTP id y206mr3822822wmb.130.1515584281414; Wed, 10 Jan 2018 03:38:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515584281; cv=none; d=google.com; s=arc-20160816; b=TGo9Lj9if7xzvgIXeR0Gg1w8piT6SuHEVKr8UiqP1XW2ishvdQbKC8S1cXSvJvyYos DJW9durbPK4HL1bmNdNFGUNyq5n22IOptpKU6TADvdAcl4d3ZynyKCc2nOc9awk9FhM/ L3EcWAxAsjjiIggDo+qJvddfp93fGkx4QYKVk60KXYzpiw+t34VFjOmPN16LUnPuhLr9 QCr6tXXaDABFCN4DhayX/ZCFBRYWHfwOLjuWll77UtKGBBrs+o3W1du2nB3pSjMh0Gbx t0kxfSNg1V6F+q44jfJZ0mwnKhOaH57Qmw8Un0CapgikJS0F1ACcuTdmS5Sg/PiawGO3 xXHw== 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=JPDMiFYMS3+CS13EfAD1Ilo8TapOEYzLKb08ZNhmghQ=; b=SX04Xf2ZjRe4gFp6qP347ex6uw3bI1JLv4k9ZMqlTDwcKrOC2uIbWPtkU0QLDlrw15 cWjuWS4iVjRtPbysVB/Xi8zvyFPIg0eVKXPy3ojovR4qNv7+f9bjCTzW4cHj4Q3B38Ho m51/77F8xqM6T8e9tj+r56OBLy+4+Da/16kJ0DWuEYzvz3MG8ErTZx2XxVC4o/gNQJEE T1QsVpffel1iSdgzD4ERHd1q7cNoVgODvuc+JAvMuVqEt5QtGE6rPHnGS/e+ued/CXjN hN3xZBqgDvvPrezlJ0A7jZeoKh+s20y/1rLjXI1BiDg7X2OqFXm+CDaYJ1jl+KRPQuyT tDtQ== 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 p26si6942756wra.313.2018.01.10.03.38.01; Wed, 10 Jan 2018 03:38:01 -0800 (PST) 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 BB0131B22D; Wed, 10 Jan 2018 12:36:19 +0100 (CET) Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0064.outbound.protection.outlook.com [104.47.34.64]) by dpdk.org (Postfix) with ESMTP id 4AB4D1B1A3 for ; Wed, 10 Jan 2018 11:48:35 +0100 (CET) Received: from BN6PR03CA0006.namprd03.prod.outlook.com (10.168.230.144) by CY4PR03MB2696.namprd03.prod.outlook.com (10.173.43.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Wed, 10 Jan 2018 10:48:33 +0000 Received: from BN1BFFO11FD020.protection.gbl (2a01:111:f400:7c10::1:117) by BN6PR03CA0006.outlook.office365.com (2603:10b6:404:23::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.386.5 via Frontend Transport; Wed, 10 Jan 2018 10:48:33 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.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 BN1BFFO11FD020.mail.protection.outlook.com (10.58.144.83) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Wed, 10 Jan 2018 10:48:02 +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 w0AAljSb007124; Wed, 10 Jan 2018 03:48:30 -0700 From: Hemant Agrawal To: CC: , , Akhil Goyal , Nipun Gupta Date: Wed, 10 Jan 2018 16:16:41 +0530 Message-ID: <1515581201-29784-20-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515581201-29784-1-git-send-email-hemant.agrawal@nxp.com> References: <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> <1515581201-29784-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131600548823663525; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39860400002)(376002)(346002)(39380400002)(396003)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(4326008)(53936002)(305945005)(498600001)(8936002)(68736007)(48376002)(50226002)(77096006)(106466001)(76176011)(2906002)(2351001)(5660300001)(105606002)(104016004)(356003)(6916009)(2950100002)(51416003)(59450400001)(50466002)(6666003)(47776003)(316002)(36756003)(16586007)(86362001)(81156014)(85426001)(296002)(8656006)(54906003)(81166006)(8676002)(97736004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2696; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD020; 1:6eL7mriD6YBm9QpXIgkcYEao2hlg9pargltYIUE6wiRdQU4WUJPmE8OPJNLZ888FkMrh9PWp4vDmuKg39MBJj3D0D2XGQn46dsEUDyDRKH2MckXrYiVYUSZChibVKzoP MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 323e18f3-26e4-44ed-83a5-08d558179f58 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:CY4PR03MB2696; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2696; 3:+JYsfmp1J7RnffCVN63QP9uOcwnI9k4Rb/KHx1av4LQb5+G202GJXYF6eo22hcl/6P3XdHeydCTGGeOZJ9KV+s4P2Zpd2BNc6HLaNKkyulhxOuFk9S79ak9L04lLyPT/L0KpJjNLGGHwToHLp/92pEr1vhjggzyYc6gH4xAq2jtzpkhPP1/4WVOivm07kVKXKxdP+IjE8F7kOfjQnR0Rh77iDHP5g3E01D0TEMnqbluwqiB9oEeMjEONnDqBZ8bhubtOgzYIXPOXTpTlWPqghBOL066sDrUvf9QMMY8N0DERP/z3CWMTGeSdRKW2b4qQl8aEVLE0lSyosC8cq22OAhC+mPv/r8MwRwdHTuBlT6k=; 25:F4FTgFHDZ1dA2ps12d+4F+NdGiTXOt864qdfPq9pFvPLzcYNW7blX4Y9hnqPpKwQ4I1HnW4m6/JgAzE1PfN9uyCjw0Zqo6nqdiLAZbVPbWeuFTEn+rdOwgkQcthwYFOstZkOso+ddXo8or7bc0y8bNOXIPijYElIJhnYXanjl1JeGTlPXy1n/szne5I0D/o6IoEZEcPLYJcqFY6pEyVVm1zsm+qh8AgN7g2UFyqaVDOHnnxoLaCNquVIx1LaPTZmfSt8WvffPHxtkdiovv9+VNZOW/FWYG4DJMQtfvPjV3Dt7k81WByAu/2EEdeKM6kvyBINgeAtg/OOMew897nm/Q== X-MS-TrafficTypeDiagnostic: CY4PR03MB2696: X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2696; 31:l3UFY/BAfwlfxpM0V7UwGLTKOXr2PcCYqmicE0InoBbDL0c8zLOagVuvvgU07w14mwYvqdJApTZtsHTClmwZfn73frFfucs5EbxHF1UwtCVCAy3MK7N56wKDh1PYfUHV11PhnZh+rK6FGNESQlmfpitcqPQDA1BUnWTK2TLAuv0hhONvUEJ/X0pKg7FJAqjwQnQwUltGKj3Y8KUth0+RdTll97ZVoFTB87XQpPAhRQU=; 4:NPvZpUC/hQJmpzM89OW2SdJSYFUK2QEBZIaoAfQie7gvuEpf8cm1g4qtKzrYWJTAKiHbOlgC4cAEUKq1xFBJP67HI4Copq1ggTsEPSA06jP8eE3abk37RplYpMBAcQ1Bzv2e3KseNqUi+w5xM8rj1il7IjRqfGjMyWu3lZ4uNW5+aQS3+y57DEynMgLZoKoNOjPwLLa9gFzyH0aV2IWCRWDevrWpof5pYm+TMzeOa+1az0o4/PlybqgOgQOtpbG6PHoBY2zlEL1mMi+2QdmEeU160JazovYQDboZKlsvYt6exE4WL3STx3zzzznRI4qT X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(3231023)(944510075)(944921075)(946801075)(946901075)(10201501046)(93006095)(93001095)(3002001)(6055026)(6096035)(20161123561025)(20161123565025)(20161123559100)(201703131430075)(201703131520075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123556025)(20161123563025)(201708071742011); SRVR:CY4PR03MB2696; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:CY4PR03MB2696; X-Forefront-PRVS: 0548586081 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR03MB2696; 23:gEDRAnqOZ0RWR0QBACvRgTivVgjsSX0gpRc8QsHka?= wg2EqlkBa5EkDr1unaI7o/hnXeyEWs3ouaRNEyvtZvcgChJyC3bI2ALVmhhfVbraz1K+RWSW3Jdg4EUuy9xoo9P4xwc75sAepX3M5AqYrCkuphlbdV6p/8Y79+7QP74qz2VPlz5VRD9/Q1XAaUy8xciwagI7BrYzU5AtWUZ9eytanGTRdIW0FmqZKKbPE5drj5/vsYHL3pN5q3u1Ya3op7ZJl/WEWVFyALKvCYLPBtOLjet61FpqNcxjMW6mXs4viu4w7+O1t2lSUc3MHlqL5PbUMxUSD9VA3ekXAfCHL4T2+koAl7JqwuTir9xjY9i6WM9SUXmM15JbPpkL2Bf7PggbJub+bFMVEWeKHOa0yigThj7HpkzLdxHSimJ6nkdjUXRC9jc6Ru7dDRW9X/KA9UrIOSGwmuTJQecYOZtNrGJAXLJWqLLE2oK3dNEQEPAsB5V7AMXR5moLG+AwuRt4tfjloX+QlrBhUpoYJzKfY5lY3NkYxNEQCJReOMYn5hlSS2BjokngAfTp93BtX9oSZ+WnQL1cA9JJt/T6WA3g8aE2mlgk18oTomf/x3KftGvMyVxXwILlknM+U8bzHHPXxxmGj6FPqMda8l4b/ZF6rcacw6MfiQtfT1VxY9RZRlkgIwYcrRjQO7oFEkewfHkmFhBMHH3yEz4jMtzH850j7abn002OpA7kPL1TpxdmU4RFKMdbYFO06XNgH9MkXQQpKj1IODhVFv1t0Jx+/78+ZzyJ8MCNHxxMG1qo8g3mA3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wNvXA54y2QO5LBrUcSZ++5/LuBD/TfyQaSJPrjNPb2Q6x+pQVWOrD7qiA5HxjsqWEzpBfbnZsWz/FZX23xJgaBg9BhpBrojwim0chcWpYtoo+X45SJEnXxvha2rb8HIRThciBSgnLsln7V2Ohp7yURcCRs3XPtQFJV125Lv2z4D57abCe9ZVv7QDD SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2018 10:48:02.1947 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 323e18f3-26e4-44ed-83a5-08d558179f58 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: CY4PR03MB2696 Subject: [dpdk-dev] [PATCH v3 19/19] bus/dpaa: support for enqueue frames of multiple queues 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: Akhil Goyal Signed-off-by: Akhil Goyal Signed-off-by: Nipun Gupta Acked-by: Hemant Agrawal --- drivers/bus/dpaa/base/qbman/qman.c | 66 +++++++++++++++++++++++++++++++ drivers/bus/dpaa/include/fsl_qman.h | 14 +++++++ drivers/bus/dpaa/rte_bus_dpaa_version.map | 1 + 3 files changed, 81 insertions(+) -- 2.7.4 diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c index 7e285a5..e171356 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -2158,6 +2158,72 @@ int qman_enqueue_multi(struct qman_fq *fq, return sent; } +int +qman_enqueue_multi_fq(struct qman_fq *fq[], const struct qm_fd *fd, + int frames_to_send) +{ + struct qman_portal *p = get_affine_portal(); + struct qm_portal *portal = &p->p; + + register struct qm_eqcr *eqcr = &portal->eqcr; + struct qm_eqcr_entry *eq = eqcr->cursor, *prev_eq; + + u8 i, diff, old_ci, sent = 0; + + /* Update the available entries if no entry is free */ + if (!eqcr->available) { + old_ci = eqcr->ci; + eqcr->ci = qm_cl_in(EQCR_CI) & (QM_EQCR_SIZE - 1); + diff = qm_cyc_diff(QM_EQCR_SIZE, old_ci, eqcr->ci); + eqcr->available += diff; + if (!diff) + return 0; + } + + /* try to send as many frames as possible */ + while (eqcr->available && frames_to_send--) { + eq->fqid = fq[sent]->fqid_le; + eq->fd.opaque_addr = fd->opaque_addr; + eq->fd.addr = cpu_to_be40(fd->addr); + eq->fd.status = cpu_to_be32(fd->status); + eq->fd.opaque = cpu_to_be32(fd->opaque); + + eq = (void *)((unsigned long)(eq + 1) & + (~(unsigned long)(QM_EQCR_SIZE << 6))); + eqcr->available--; + sent++; + fd++; + } + lwsync(); + + /* In order for flushes to complete faster, all lines are recorded in + * 32 bit word. + */ + eq = eqcr->cursor; + for (i = 0; i < sent; i++) { + eq->__dont_write_directly__verb = + QM_EQCR_VERB_CMD_ENQUEUE | eqcr->vbit; + prev_eq = eq; + eq = (void *)((unsigned long)(eq + 1) & + (~(unsigned long)(QM_EQCR_SIZE << 6))); + if (unlikely((prev_eq + 1) != eq)) + eqcr->vbit ^= QM_EQCR_VERB_VBIT; + } + + /* We need to flush all the lines but without load/store operations + * between them + */ + eq = eqcr->cursor; + for (i = 0; i < sent; i++) { + dcbf(eq); + eq = (void *)((unsigned long)(eq + 1) & + (~(unsigned long)(QM_EQCR_SIZE << 6))); + } + /* Update cursor for the next call */ + eqcr->cursor = eq; + return sent; +} + int qman_enqueue_orp(struct qman_fq *fq, const struct qm_fd *fd, u32 flags, struct qman_fq *orp, u16 orp_seqnum) { diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h index ad40d80..0e3e4fe 100644 --- a/drivers/bus/dpaa/include/fsl_qman.h +++ b/drivers/bus/dpaa/include/fsl_qman.h @@ -1703,6 +1703,20 @@ int qman_enqueue_multi(struct qman_fq *fq, const struct qm_fd *fd, int frames_to_send); +/** + * qman_enqueue_multi_fq - Enqueue multiple frames to their respective frame + * queues. + * @fq[]: Array of frame queue objects to enqueue to + * @fd: pointer to first descriptor of frame to be enqueued + * @frames_to_send: number of frames to be sent. + * + * This API is similar to qman_enqueue_multi(), but it takes fd which needs + * to be processed by different frame queues. + */ +int +qman_enqueue_multi_fq(struct qman_fq *fq[], const struct qm_fd *fd, + int frames_to_send); + typedef int (*qman_cb_precommit) (void *arg); /** diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index ac455cd..64068de 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -73,6 +73,7 @@ DPDK_18.02 { qman_alloc_pool_range; qman_create_cgr; qman_delete_cgr; + qman_enqueue_multi_fq; qman_modify_cgr; qman_oos_fq; qman_portal_poll_rx;