From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30066.outbound.protection.outlook.com [40.107.3.66]) by dpdk.org (Postfix) with ESMTP id 516741BA42 for ; Wed, 4 Jul 2018 11:45:36 +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=mKwOt5lEiS72Ye4AAKBbgoTNb0g86+e97vZ8hXLW9R80sfAm6lX90q6gKO72iDAvWfheg9YJrsLj0v8Hui3VdJ0D1dKqTHml992GsN1kM3TbazU1mkly1NFoFMrRCIO7nU6pQIACfPRvtg9Slxor6splVv2ExIvUblpuZF+V3Mg= 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 DB4PR04MB0765.eurprd04.prod.outlook.com (2a01:111:e400:984d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.906.25; Wed, 4 Jul 2018 09:45:32 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: Nipun Gupta Date: Wed, 4 Jul 2018 15:13:43 +0530 Message-Id: <1530697431-1244-8-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530697431-1244-1-git-send-email-hemant.agrawal@nxp.com> References: <1529574244-18997-1-git-send-email-hemant.agrawal@nxp.com> <1530697431-1244-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: BM1PR0101CA0008.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::18) To DB4PR04MB0765.eurprd04.prod.outlook.com (2a01:111:e400:984d::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 789ee3dc-e1eb-4b60-57fc-08d5e192e419 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:DB4PR04MB0765; X-Microsoft-Exchange-Diagnostics: 1; DB4PR04MB0765; 3:eG9l45Z+YGVf+kFYTvqPOVXXu3xX6XH1mRH9eFqh72U8EgMKe9yIvoqAnmdQWgqqrC35C5RFpAdDgypvvKTl3GrXZwzHZirwF4NkLgsVJU2cz68N8E2uoydFIGGIEittRbQAprSr/9khukmW0gRR+wOtcexSlQQWmCUQJauR4ZvSCQEHdfnKZfBs0yGyeXWEP0RnZmv8kIUyVFmjXtx1GZt+p/RCEqC2jkX4HSiGqqqUSMKmeiX+tLnAh+puj5jB; 25:7oVxKnjK7oEPjdpqYhTA/AkSK0KW5DaBvJspbMEalQCF9fL91ypx9rwJFIPvt8uZazolslwwH1YDWFXKPXM/shjd4JPrQs9naHEZiOQZmxAE5afErtavSqC0yYxkCK+z2FNOwIvCGvEmbRKC5ntVA4EkFWdbutKE7aCvljnAfQJD8xLkUUdgAoPp30IqRftyCtKOVxqktq7GooX2H1FWYxOCz1ZxjM0oxEj/LChaDXeI0xWsGqorhgXZLgusFspSLCL87d0sPsu3eNUrEir0tHNijkXPy22Ej4o2DK52QhDdekXCqBZe2tfEfcsoQ1IOiPY6xw8xmbQkXFpWLwF93g==; 31:TOdToQ5G8hIaf4L0ncgEG46nODiukWB+i+/1IGMPqUkQEjsjOc29pI41j3dPWQqaTAB7ycZ2dP/mGi+KXgEVc2bV3DXE5++Koh6d5jNLJ6SpHDqWdiyWMkJZHS+DD8DglJhi66uWmkpDo80+hukmYUEXHdEcE++fVIRHFQ/tTa/urhAA29bj06QmyvjKnsTvX0dse3LNGw1Qgqrkp2SnrlxliYJlruHRWGM5HCDd1CQ= X-MS-TrafficTypeDiagnostic: DB4PR04MB0765: X-Microsoft-Exchange-Diagnostics: 1; DB4PR04MB0765; 20:IADc9Ss67vh72mU0rjMw9EkrUfGj9e6FmZwWfGTRawAvkfl4Zwr6pdyT0yziQYYU5QJYb+2EkG9HL8to0Co0nXXsW5n0VLWvvfZJlTBu6mNFuVuQFlUVC9Dsq/Y/hfWGGjOfNi3R6VGf9GEwBDAeH39bODVmXdO31f6KjjdqzUr4lUO7tcdK+as6i70/YFSWm31V/anb6tXc8t77gPS+Fw88xGV7Ji6ED4N2BadOAy/qAQM7+cQY/4wyRpXOQplUAg6WbPEgxUh4zl7iCtkaLEN+dyXz96Z9+KLh+rI09cWMvCTkireNVu8OQSL3Kq9+qD19gkAjCZoCO+MnMZ6aWqVk7QHY5KvHpfy6dIbLYAtm/e3itXD/E5qNTANLuY1ATUB+1GebfmT35CtkMQCoQP9EVzowYBWxcgRmcJnU7L3DVDwM6KlDRPtgJHsOAkoYCFqBK3SZuNLL0I2gIfhGZcXAIv1t6gNBoiy6xj91bIA/G7HxmU8yrziMCwPFZ1bv; 4:/77fBHayj2kiyxl+GI3jEYDbeNpRS9b4RJNH0j9tG+ncWjyNKHGvCoB97KhLkDTrZGz4I3gXAU5KSrnvCkaxIDedBD5ATma+0RmGDhuKCyA2u17Dge0SAx78di3s5SyFgLchdoA4Ps0cm/UAa/O4jwHTW9gBtqpT3lvG4vmgq2pDBI8NkVuYbwEfE8XrMV6Hub/yBhKbiUcR+FENWtlcUQRvIKloHiBRNoimKIw+M5rx1KrI07IPfBfJ0pTOks+QyqFREHSvb/vBY2WOUDRpbhUqHC6ML/sEwwwSEHAwWglKP/csTHdyq5NUD51rKP6B 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)(93006095)(93001095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:DB4PR04MB0765; BCL:0; PCL:0; RULEID:; SRVR:DB4PR04MB0765; X-Forefront-PRVS: 0723A02764 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(39860400002)(376002)(136003)(346002)(366004)(199004)(189003)(6512007)(11346002)(476003)(386003)(6506007)(4326008)(55236004)(956004)(2616005)(5660300001)(44832011)(105586002)(68736007)(16526019)(53936002)(446003)(50226002)(316002)(6666003)(5009440100003)(36756003)(16586007)(2351001)(6916009)(106356001)(14444005)(186003)(86362001)(26005)(6486002)(97736004)(305945005)(81166006)(7736002)(8936002)(66066001)(8676002)(478600001)(25786009)(51416003)(486006)(76176011)(3846002)(6116002)(81156014)(48376002)(50466002)(52116002)(2906002)(47776003)(2361001)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:DB4PR04MB0765; 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; DB4PR04MB0765; 23:JOT/UcrgJhn2s/8EOYlBN6eHv+YZNQSGtbAjfwGvp?= =?us-ascii?Q?mEeaCJcLvcAdkrICDEG3RA/jhf0uHfdBgCPxJoSoykEkCF2ABcr9gLj++zhh?= =?us-ascii?Q?/edfKqOitnI56hPcaLl9o31jpsL7bwkAla+ld7VOnTJ5tuRLHHC4lquK+lnB?= =?us-ascii?Q?yS36WTvFfwqbD6Gd781D+RMkReDcZFJFD6K6KLpIXmST7A4I79BUj7BsLX65?= =?us-ascii?Q?han0F6L/9ElDHukyfuUhoMF+vp9WX7SVVLoXBrQGOZbSl7h9qaQjfHLXylEZ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zETMH8EphQFuc/jb+i6iurOyl28SB2h4y2ESmVIn00bMwZ9HZtSQcs9jboxY+mO9A==; 5:kpIec8fKVQqA7MvF6ubXEyoOMugebaCanXzkr0Q+//17IXcz6PfejtfjIi0/af4LjH0ecxcp6PlLAhqRyYvDey4NNCETDTL8+R4TNw2/zPkpEHVIvXQ+IVIsSCMP49se6SfCqYytzwtn01+6PFL5JO7RwEGxOjzdwiOjeIrFCPE=; 24:KszUMsn0KOfXNZUHpr/rpY7RcfoUo7JZQpFcUuQSSAEVbPkR9ZJch+M/nNRQKwaOSAdQEBHc89wQF2UujN/kDcxPBkffV0alodu9OFDbja8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB4PR04MB0765; 7:A/Y+5gRd7d2Gv7HjeHsYFGg+VqOrdbY/uraiOpwtuV3gSsSbOzNLx91wfOA/YJ9RT/NSn4tXCKTsc98Br/TSkZsrE5Tpmfa9QrV3cI8LH299lnHrRrvH00g1EvBmUPo908wl8bew8wlWvl6sP8GqaSJgl37jupZJo/l3DGB9lmqEDac1NyOQ0QQD+Xv7vbktfjo32vKrg77FMlfWyzU4SiDWYYos5jO1vhbGDL58WUbg7ikS1lguypTQkuBHmER1 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2018 09:45:32.4853 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 789ee3dc-e1eb-4b60-57fc-08d5e192e419 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR04MB0765 Subject: [dpdk-dev] [PATCH v2 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: Wed, 04 Jul 2018 09:45:36 -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 --- 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