From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00049.outbound.protection.outlook.com [40.107.0.49]) by dpdk.org (Postfix) with ESMTP id 9BB0B1C45C for ; Fri, 6 Jul 2018 10:12:07 +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=rn2s4tq6mP/jLClExidUmyOZcDz7hKK4UVN2t3E3NR4=; b=cHD4gEPJ1qH83AjG3Yt7XMHV5vXA0lTKuURGCcpEOPtQydVTv5rTYJQf/hcbU0eGn9BwkLiRn+5UhRk4jQV1fmlgNoJAtEpU7wr3OZClLv6Y+WWVPjaJd8nM6dNPlk4qGgQvYsp69wnkOzDSsvJwNj+EzIEIHyCm1xKSfg5mkKw= 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.906.23; Fri, 6 Jul 2018 08:12:05 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: shreyansh.jain@nxp.com, Nipun Gupta Date: Fri, 6 Jul 2018 13:40:05 +0530 Message-Id: <1530864613-11754-8-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530864613-11754-1-git-send-email-hemant.agrawal@nxp.com> References: <1530697431-1244-1-git-send-email-hemant.agrawal@nxp.com> <1530864613-11754-1-git-send-email-hemant.agrawal@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: PN1PR01CA0076.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::16) To AM2PR04MB0755.eurprd04.prod.outlook.com (2a01:111:e400:8411::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 74a0283d-c506-4b1a-a034-08d5e31829d1 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(48565401081)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:AM2PR04MB0755; X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0755; 3:7ac+dez/dOdycOBJ2spa0KYQGahWxxm2H2OSIlcXmrDRBJbQKFE2f0b940tEqCdNaa8Z1haGEj6RCFtZUkxk0wZoveyAyATFmoQtuu1y7IAKqNSbYExUaYW2oVj37EcfOQUaqSb4MjEKhFRWQjgcfcjekXgJHNogVfJW8IxbF1Pn1G5imiQGg8BtLlgpAbIqQEo1iKJ9pr+xCFywOivvYGxR+tvuX5H035FaOtZ3cpzYBGfgvPWd6X/yRIY1ZG4P; 25:7VJpcnCVwS8+WeupwGgZCqZrcki3hnCVbEPZNiDSGgmNualDIV/V+nhR3t77O6Z0a2BkSGIbwU1t439yMwpYtprAcVAhb/qN3LVJ4O/6gxd9wKgo9NXNf9C71iAWTgU2ysS4yxfXcpLyXH/zRv5LtLJGY76Big/1haXIAaun1ksQB8UZ7HYOEbfkTCaSZuStblwp3Z34hytwwYKDGXElKR4Mjk/Cp2TuHOLq/AF2xpfYrsfDFCtGibYygUrzly3jsAjqBlNMURsI79TkH/bm6x39sb5xA+vkXl2j4ycAUxH4t4BC+WjrGs4yPWWcOj5zsybc//P1hyws85ndqiDVKQ==; 31:903Fuam83dY208YkyrIj4ZHinNvOND/9ms11Htns/fh/BLQeaNblyTYjWBG4Eq4tvsJ2t76bmCDOIgow1RsdulhxMfzQB+0w3B8daOMVruJX+Gh/Xg13yk1WSeCpx4YScS7CjxewN9ZCCwJDlpGVKYlMQWAMQxGVAFBcHYBKNmIwMI2R63twegG5JpcyBvuyGiWsZffKvYgH/FVUuy/KUHQ78PkxaZZYbsmzFZC62q0= X-MS-TrafficTypeDiagnostic: AM2PR04MB0755: X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0755; 20:6A91wXbkvLiF0I2eTCouMxvRy7FXUieTJHPjKeGREfJIOTueX53jGRwQQ53RsRZnUwRZAZpGT2DlOEFVVkBz6UATxoQDqT8nLF+6lwNnk11UGSGFvB9jvbexLd9a3tsGlxi9LZVJOtINJpI7KFbiMqwZr0XGvAIhtIlBEIY7HBPExrLMEaIcq7Xh4h9AM6ffHiSpBnE3GORFb1amMGh63jBlc3+Kgj/+TlAMFeJ7WttCr+AbYE+BrTH8KCCNM/Pijw/lZWBJG+HLKEFLaFtJeDHC+BboQ6n1wwztv9jBsRFEXSsiHCbNr5GCDMz+fCQL5vEhOGCjt34wGlfEalp6FGhlpLN0qkIScCFwGAB1YjQoOvPP9QpQSBRRyK0ysgAdLmp+Xq7/M6issqm5LN4lFluP+EP+pTFjCkGXzUMVng0SzSwrmcF5+Npq50OdQKM17nb8LGywjFeANppKQkf+4aiL4AOaijrMB1/eMXcZUgPQKREB6bTGFAlx8K7EFfGy; 4:vkOaDyNSTnI0EWQNRXdu+sttAOPg0a+CHvRJu5ahDSVJU+gy0kNnXMCaUeuRKrJB4KvvEbM4VBQ45rGflNb+VFSLO0ofwu5RszrIyKNk+nCGGbfz4iRspWbdkV2MxDwOjQTkM491CnjOUs6ZBoDbDgBlT6jHqgMMSac1XK1p72L4SsZEn3TY4bOi32j8ZnPTYGxDYmU2VMS2XPnBGlmliS1BD6xMytGn0yFoD2mi1Dn/+u7JM+S+rkPaCrj6CY7343udEcIKAN13O1hhRtj6OrnviXQiQBf3IrOKQT8wgll5QvOMBTpgSI2PcGS/mUmP 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)(3002001)(10201501046)(93006095)(93001095)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:AM2PR04MB0755; BCL:0; PCL:0; RULEID:; SRVR:AM2PR04MB0755; X-Forefront-PRVS: 0725D9E8D0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(396003)(136003)(366004)(346002)(376002)(199004)(189003)(956004)(66066001)(446003)(6116002)(2616005)(476003)(5009440100003)(6916009)(76176011)(186003)(16586007)(14444005)(16526019)(105586002)(478600001)(86362001)(44832011)(106356001)(3846002)(4326008)(486006)(11346002)(6486002)(2906002)(25786009)(305945005)(47776003)(50466002)(2361001)(7736002)(5660300001)(6512007)(48376002)(8936002)(68736007)(36756003)(97736004)(55236004)(6506007)(53936002)(26005)(51416003)(50226002)(8676002)(2351001)(81156014)(81166006)(386003)(52116002)(316002)(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:japVNAMkdEX4+r/vQsACkVJJcNuMRRZb6guQHpoHy?= =?us-ascii?Q?GLdYC1X64redpVVwY9iVkqIWqPmjvzjqQ62gYcjks7+elrvyezb6QAhbAVHA?= =?us-ascii?Q?s7Fxu2JCwdat60vXcQAbXwm8/8BbCwd6HpdE3BtSHVu3HHluPfbX2bvSztqX?= =?us-ascii?Q?MX7TqTuq0dTLfdAfD1IgeKPENZMBdtpEzOnSolF+1yd1y34mN3pDgYDUGsK2?= =?us-ascii?Q?o0+eABc7a+4jGTd4pQ8MXBjdJSdGA99aoUZZAD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FLFcU2PTLTJg6hrgBw4Mzju/oHG0SGiCUbms/HslYnAuZZpSGl3suNsI+JeU8Z2vF287YYg==; 5:CqAb3Nt6ykHFIVxKRWymPZE9iHuZjGX692aAd4WubSXIEDYmmTI0iv1HVvKpXZTbWhrPSwgZK3p5zYmZN9lKuFT83sjTE/xoIaEKPWfdFisAT719tMJ+5M+FqXQCiYsd2Ak7yNtuhUkaqqa8oZLiy+SIoHl+DokuTR7QjdiWqi8=; 24:KvufElIL7QNsciIfjZ1Xt4/mRfoxP3HR+p7g+6qOmRcyy5waUBSFwqssIkYmjNshf76YDq5EnCV3+cMr3uCPzVXuUhJ/Iu8gkf72Km99dps= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0755; 7:WP2R6rMBPp+ejnO4CpkgJT3Iu0g8yxH1eaF4yqzqPCWfxnbYfq3ydiRvEC7Dlw54+0oTf1U6GymrLfYoeVbfSycyKyvdaRlYDBaM27I6HFbwcN3CKmXRpcPQ7USLiQGLAg8ap6YW2zMroiUwsBpGXBEYAcNEfbPyMhxLfWfsoYy4crpncwZfrbyCbUnSGYYEhR6/ZU7dkJP2dCjkz3aug65l5/Cp3Dn10FhKS+fGjXvdIUIJcDza8lkxsAbEAUgF X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2018 08:12:05.4350 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 74a0283d-c506-4b1a-a034-08d5e31829d1 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 v3 08/16] 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: , X-List-Received-Date: Fri, 06 Jul 2018 08:12:08 -0000 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 Acked-by: Shreyansh Jain --- 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(-) 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; -- 2.7.4