From patchwork Thu Jun 21 09:43:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 139516 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1846509lji; Thu, 21 Jun 2018 02:46:26 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIhPMzXjL2GHhzVlb4niSlbNOzcCpF4TtKZmlZA2+1kqS3+2D+VTRz6vocU5zpkUtwkAOfS X-Received: by 2002:a1c:9514:: with SMTP id x20-v6mr4806370wmd.76.1529574386020; Thu, 21 Jun 2018 02:46:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529574386; cv=none; d=google.com; s=arc-20160816; b=SAKY8WiFFOy8riVWcEXYxinUDl0xxW1L+IozFsYuyV0U/HWY2RpeUBVi06qoKlbQQL vbV5UXRrUKMOyLAny2peB3bnDHS1ntrYSXhrvLNikmhPRd7mA6yaCw9Hmw2BZsOG+qCl weHouE440qoiUKjCgE2MBhVlINx+50hwbWswvoE8O7+zVd1s0+bCy0KSJHhhmPxkuOGq OlHV9HRKdRO1ASoMK9pONkV/fM6b90YbVBxSnEcuqd9aVt5PmRn4XELtPVJUPScpqcuB 0EfyswTyYtT7uZwjpeJkkZBM7Cn7sxTtcRJgNRkJqguHuFV2EHgNPzBbpXDNdA8nb+Eq MqiA== 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:dkim-signature:arc-authentication-results; bh=osO80at3KwZiplIAhS0bQYzWNJz+a0hkztBldgU2HIY=; b=g2GkeXAjgnM4QSgL9NImr3LrltkpSTGGYVjgPbcGIufdWKCVMdwYZ9HvITJaM4ZcBY 25gH7+pzkeBayHLdFNOSakWV0YozXjDZD5mkPC3FQMzwmimzkHDD5itBkiBVtzcTzIZI rRZ/PBK7bnIwF20mSK9lkNV6ncWbMX5DL4tWBwPjKNvw38kF0maqTQ/XQuynXLoXimuk xU8aC2EKDi8MidMmHS4msrEG/6OOz4Q0Y0/NWq6EOmZ8/2v/1brVyFcgskuDMtXiZBxr VOz2D8flgOIZaeCsE0QkrfWxSnnGovXBnIjcEeq8l7TTFdVxzluIGYCGA0il6QmZ8Zd7 taQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=tyD0A4Zw; 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 v18-v6si1555500wrd.421.2018.06.21.02.46.25; Thu, 21 Jun 2018 02:46:26 -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; dkim=fail header.i=@nxp.com header.s=selector1 header.b=tyD0A4Zw; 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 7BD0C1BDE5; Thu, 21 Jun 2018 11:45:53 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20077.outbound.protection.outlook.com [40.107.2.77]) by dpdk.org (Postfix) with ESMTP id E43361BDD7 for ; Thu, 21 Jun 2018 11:45:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=osO80at3KwZiplIAhS0bQYzWNJz+a0hkztBldgU2HIY=; b=tyD0A4ZwdcZvOkvT1W1xHZ+rC0IAfjlcevmsyJTNigvYJaHxIMwbZREMThDGdRTGLcForKtrSeMC1xWflNV9hu7jwWb8Z0e3RNRceif58dHkrODThEDy2cW3sw19YyYLSZSewdwZrLlbws02WfPf50/OtggQQOVunPtNTvyQjzM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; Received: from bf-netperf1.ap.freescale.net (14.142.187.166) by AM2PR04MB0755.eurprd04.prod.outlook.com (2a01:111:e400:8411::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.16; Thu, 21 Jun 2018 09:45:45 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Nipun Gupta Date: Thu, 21 Jun 2018 15:13:59 +0530 Message-Id: <1529574244-18997-5-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1529574244-18997-1-git-send-email-hemant.agrawal@nxp.com> References: <1529574244-18997-1-git-send-email-hemant.agrawal@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BM1PR0101CA0035.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1a::21) To AM2PR04MB0755.eurprd04.prod.outlook.com (2a01:111:e400:8411::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ed949c94-641e-4098-c41e-08d5d75bc398 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(5600026)(711020)(48565401081)(2017052603328)(7153060)(7193020); SRVR:AM2PR04MB0755; X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0755; 3:vb/h0vIKxpC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LevELkzT2rhfMdEr5KkRBYORaYmoOHC1Ta5hs30VXruI1o9JOWziTxC7xITfL7yHv5EHsyemWErLcC7GFtTUfJ2qaJM7+pNNXHpZz19N5vl5zqH9Bq0RDBm0NaOLSZctZIFZEEXV9/7bwNa9hnwF9CUPlkclAWJH5nFa57QkCdDCQT/x0wnNu1k1HpiAK5yh1m8h1O7qSygGN23r6zs4pcvTiws2n7sGcnRKInCW2uiKwRfv24/mOwCwviCVVYiS+u6Jf3+UyuBYwHKFS6cEN0Aiy7wcyhTX7qgdOuozYL3JSrv9ltQIQvJ5Yh+0mdfKf3oSg1A6oOV; 4:lXuxOraKFr/9xnGXjZO6yeRRxVYU3JqqF+KxpyLbT+bNfJ657akaIiE/9absBL9rJE/bGVocXUWI/yH9/skeHWO1wMGY2y6b6Ssqc7tCske1h6xDIZ+A+xjpecUb35+DoyVHEcNN2QrDMn8Jr4uR0uZ1tnsj/5moJ2JIquXPfAMKN6+QP3RnF8ZKP0TZvMP/75GQxqZRnUGnvtQOk4fxTfqgRr1u8kuUHEJT6MOTIgYW21Gxspqg3uDCIuzeDJ+QVaVsa9IrDAmzRQi6m1X2nkmU3G0ZJ/jZsBFR0RVRVSqzVLx4HERVKwwXsLZHPEtG X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231254)(944501410)(52105095)(10201501046)(93006095)(93001095)(3002001)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:AM2PR04MB0755; BCL:0; PCL:0; RULEID:; SRVR:AM2PR04MB0755; X-Forefront-PRVS: 07106EF9B9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(376002)(366004)(39860400002)(346002)(39380400002)(199004)(189003)(50466002)(6116002)(6506007)(55236004)(76176011)(59450400001)(2906002)(6512007)(478600001)(51416003)(48376002)(52116002)(3846002)(2361001)(186003)(26005)(16526019)(956004)(11346002)(97736004)(2351001)(5009440100003)(386003)(446003)(4326008)(8936002)(8676002)(476003)(486006)(7736002)(81156014)(81166006)(305945005)(16586007)(6916009)(6486002)(105586002)(106356001)(2616005)(47776003)(53936002)(36756003)(50226002)(44832011)(86362001)(68736007)(25786009)(5660300001)(316002)(6666003)(66066001)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM2PR04MB0755; H:bf-netperf1.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM2PR04MB0755; 23:lbOHOBS2oiLlNowlb/Bt12YZaNJURpgIIxVeyuarC?= /hvj2qcsRuOANHmXuHExHhkTPeEy9EbccT0Qqlg1NWiFqBVKkJcG1r0AA/sHKlwYOAdDrdKGFckr2IqoDr6DODSjfxZCTeT1YAd2BqrZ2fcybCBmY72xEcwmcKvQdLIhr9P8z3utlMAyFR2jfyogL52N2NFVjF/kknYS0IiuSzTAc/Hgtun2ycGbDxiiS1gnh891efFiIOk51lwvAQJXKUlfdL4q6PTlhKhOdcuoQKYO8OikkwkfhEqOfztj8Jco+8AXV4LSzFY/qcKA1zc+VWfltHlbm1AuDRMfNOWPwFdFwbrepPuverAVn96b6uGKKJ+ITQN6/GaN5hU6Ogtve9iJbt97tQCXz5zMcKu1iGuREvvI1rJJNh1oKHK6AGudHKQ7vO8rDce9cifzF0Tp5/fJ8eic/AJOjOq+ngn0SV2xUp25dPM57t2l8MpPm0AHG4iqJqy8Q6ifw5mL+UA6QCFMZJlKvLh8wRA7+WmqYj/Aw0FRRnqmhaNhthLr+5aoC7ve6JoTXoODRqfKmMWQHuCZUC7sl+CpXUFoc9/iyr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YzRIpG1ci6FOwl0XCKwvUkdpPYwYZTNz5VSFRtOCag5A== X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0755; 6:RA8kyu/toPVztVYxLjwhLFVOPPROwCXrTgWDpHs5QqpyXGhRnOjh+wN5OAS4acIUILtwXY55l5pUZjKb7dkteE9k66C5kh5To2HP0Lbq07sCpIzRFxEEahy1cKgqq8Gh7/AR7p21JRhatS+1103gIjrsvYHe/eCK00fCxFy2jnAOPrYsK4eFdY+yAIv6AzXivM43DtU7KVDi8NuQsVfM0kzzVTydpXOLyEniYwpXaJMT2bfwslhDvGQRRWwmdfTbiYbTLEAkU+wk7/eWorVDSfeqN8t77VQISPZnoyDH0EK4SlhpHbQ154Az/p+wYXV7rXLRGiBDvofPILAnznRdLLHFENpt2KfP0TXCgCGbTXI1e474ClT34QYLdWDH5XsJzZnWFNT3kb6BzlDch7seflyFytAz0kP89U9J0kmmlMqbOpKJdvhEa5G/E+AKC2FJwsSWHbiZQ6064V9AfRfmfQ==; 5:WSXBQ8UFuaoIJK8zQz3uaHm/kSGIwA3BKpeCqV4vVZnJAGvVyrfYeAQC/Iq23bJwcYSYSqRv0rSLEzsoMS8F/wlhao+gcCiVbLaGsroyVylptCsIjC5TzXMCM2LEy0G62EWMcujpVqXzvnP6il8Mel401hetZkGRT3agJcMXByk=; 24:mqmZXm8hcbKny+/uHoleK49CytDiBiNSXOIMNB8bTfJ8YAgG4u0tuTSx1lay12Sel0ssyXjxZzbuyB/a5LmAdQrUb5Dkq7CSJnX0uRif0bw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0755; 7:vRR9gUngEoR2tsTpqQPqzjSeayzFaaJsHOagDvk1RRQKchUTXhb5wU+b8eTWn9RCgJ/+CqDpIg0V/4t/0+R82GW9iHPLASoJxVY/wfEQWNI04yAxdMC4ghc1SGcLXCxi46W+kC0xIXVJ2gS1B9/OkynSrhiVuJvesU6NZsdLgNLStt+4R7X2I0pFnNUYT0VJdh6/WGzk3q1rgQAQddRzEPYO8U+HfOk/hl8Qb1oOx2jQIYuURc1rIUIbzzI2uOfA X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2018 09:45:45.7590 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ed949c94-641e-4098-c41e-08d5d75bc398 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM2PR04MB0755 Subject: [dpdk-dev] [PATCH 05/10] bus/dpaa: make vdqcr configurable 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: Nipun Gupta This patch add support for configurable vdqcr exact flag. This boost the performance, however this can give side effects for some extra packet fetch. Which has been taken care in the patch as well. Signed-off-by: Nipun Gupta --- drivers/bus/dpaa/base/qbman/qman.c | 4 ++-- drivers/bus/dpaa/include/fsl_qman.h | 3 ++- drivers/crypto/dpaa_sec/dpaa_sec.c | 19 ++++++++++++++++--- drivers/net/dpaa/dpaa_rxtx.c | 18 +++++++++++++++--- 4 files changed, 35 insertions(+), 9 deletions(-) -- 2.7.4 diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c index 13c4315..f5fe5ef 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -2002,13 +2002,13 @@ int qman_query_congestion(struct qm_mcr_querycongestion *congestion) return 0; } -int qman_set_vdq(struct qman_fq *fq, u16 num) +int qman_set_vdq(struct qman_fq *fq, u16 num, uint32_t vdqcr_flags) { struct qman_portal *p = get_affine_portal(); uint32_t vdqcr; int ret = -EBUSY; - vdqcr = QM_VDQCR_EXACT; + vdqcr = vdqcr_flags; vdqcr |= QM_VDQCR_NUMFRAMES_SET(num); if ((fq->state != qman_fq_state_parked) && diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h index e4ad7ae..b18cf03 100644 --- a/drivers/bus/dpaa/include/fsl_qman.h +++ b/drivers/bus/dpaa/include/fsl_qman.h @@ -1332,10 +1332,11 @@ unsigned int qman_portal_poll_rx(unsigned int poll_limit, * qman_set_vdq - Issue a volatile dequeue command * @fq: Frame Queue on which the volatile dequeue command is issued * @num: Number of Frames requested for volatile dequeue + * @vdqcr_flags: QM_VDQCR_EXACT flag to for VDQCR command * * This function will issue a volatile dequeue command to the QMAN. */ -int qman_set_vdq(struct qman_fq *fq, u16 num); +int qman_set_vdq(struct qman_fq *fq, u16 num, uint32_t vdqcr_flags); /** * qman_dequeue - Get the DQRR entry after volatile dequeue command diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 06f7e43..a07869f 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -526,12 +526,25 @@ dpaa_sec_deq(struct dpaa_sec_qp *qp, struct rte_crypto_op **ops, int nb_ops) { struct qman_fq *fq; unsigned int pkts = 0; - int ret; + int num_rx_bufs, ret; struct qm_dqrr_entry *dq; + uint32_t vdqcr_flags = 0; fq = &qp->outq; - ret = qman_set_vdq(fq, (nb_ops > DPAA_MAX_DEQUEUE_NUM_FRAMES) ? - DPAA_MAX_DEQUEUE_NUM_FRAMES : nb_ops); + /* + * Until request for four buffers, we provide exact number of buffers. + * Otherwise we do not set the QM_VDQCR_EXACT flag. + * Not setting QM_VDQCR_EXACT flag can provide two more buffers than + * requested, so we request two less in this case. + */ + if (nb_ops < 4) { + vdqcr_flags = QM_VDQCR_EXACT; + num_rx_bufs = nb_ops; + } else { + num_rx_bufs = nb_ops > DPAA_MAX_DEQUEUE_NUM_FRAMES ? + (DPAA_MAX_DEQUEUE_NUM_FRAMES - 2) : (nb_ops - 2); + } + ret = qman_set_vdq(fq, num_rx_bufs, vdqcr_flags); if (ret) return 0; diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 805bc30..168b77e 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -560,7 +560,8 @@ uint16_t dpaa_eth_queue_rx(void *q, struct qman_fq *fq = q; struct qm_dqrr_entry *dq; uint32_t num_rx = 0, ifid = ((struct dpaa_if *)fq->dpaa_intf)->ifid; - int ret; + int num_rx_bufs, ret; + uint32_t vdqcr_flags = 0; if (likely(fq->is_static)) return dpaa_eth_queue_portal_rx(fq, bufs, nb_bufs); @@ -573,8 +574,19 @@ uint16_t dpaa_eth_queue_rx(void *q, } } - ret = qman_set_vdq(fq, (nb_bufs > DPAA_MAX_DEQUEUE_NUM_FRAMES) ? - DPAA_MAX_DEQUEUE_NUM_FRAMES : nb_bufs); + /* Until request for four buffers, we provide exact number of buffers. + * Otherwise we do not set the QM_VDQCR_EXACT flag. + * Not setting QM_VDQCR_EXACT flag can provide two more buffers than + * requested, so we request two less in this case. + */ + if (nb_bufs < 4) { + vdqcr_flags = QM_VDQCR_EXACT; + num_rx_bufs = nb_bufs; + } else { + num_rx_bufs = nb_bufs > DPAA_MAX_DEQUEUE_NUM_FRAMES ? + (DPAA_MAX_DEQUEUE_NUM_FRAMES - 2) : (nb_bufs - 2); + } + ret = qman_set_vdq(fq, num_rx_bufs, vdqcr_flags); if (ret) return 0;