From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0067.outbound.protection.outlook.com [104.47.2.67]) by dpdk.org (Postfix) with ESMTP id 043791B571; Wed, 4 Jul 2018 11:45:31 +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=pZ2GAnx77W/FRW6xRRiWNQx3G3XSFb3aJGvlEkuvzy8=; b=S4NIEOWoosDmu9krWrkCJn+KnqklvUvD5k3oIgIZxLxDD7LEKSP3Jez7EoE8rh5fEAcZqDo0drZrtqn7O2+CsgPNyK02yFF95UBN1RW1tVQFi/PY0dR337VVBsoaueYMed2DAnR9DQ1F3V0IUxaqjSAKZTGvWCRBhSV43J4vTxg= 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:29 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: stable@dpdk.org Date: Wed, 4 Jul 2018 15:13:40 +0530 Message-Id: <1530697431-1244-5-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: e3d58c76-3066-472a-d480-08d5e192e11b 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:2zBUdRuR+cpa1CGlz7R+HQBuY1G/YPWp8QmHU6WGC4QyRm3f9CTSpp4raLu5iEHxLVaqxzFSGtheh7GQ+DmNla70jsSKy77rG2x21+Dm0rHUvZxscdR/5QrbTqVASFf54mPNyZQB1ldKbGsViPTzqkN2l5o+U49Tmxy6XmsfwqO2Ljoec4XsiRJMGlljxmDS20xQOeoxCR1QElpXDfk+bh+a9af+zfGRDj5aZwPbCL+qrea2MFjQZGGVH/akHIo4; 25:+5BXidEdxRnJbd3TKU45zY+VDFAFKb2YOY995av9pTrAa1k9ehNfbya6XHHMVbDF+b0uvQLdEkp5I6oZNaAFF2DGV9YYrmlDDM6gebp/2HPdJivnVj55J9zYKmG2iqOIzxYNtDPC78IdPV7tDXPZIfQFTqHWTYM+LGUMlg7CXglVL9dRQqHnk+0Scpcsku8WiSxe0Pgafgx2377pNMIIfGrlWuMoZsqcN5V7cgb84/sc2DbElT7YgBJoweNfUKU4g3rSq7QVu4pbfh1KWZZ46MOVhIm8kmWno5XabJ8bQGXCd6EXpqFOB2TnDkeKc/6XQphOhGLmoYMOFDMIA5tanw==; 31:PJYd8wtUEwF9T8ZJva9VBPyPGnKJNAMJkcfPPXbIRv/OtvjdE+JxT9THM2pc5nROdvvtKEm+f5raZarms7pcDEnjbpnUJmYznF1SL+e9LWCQYaXNXVOM58czG7RxLg4KXhdk/yuUt/r6YzKov3XfmD0DLdDrelzAZY8TsNdhIp36elWuZVwqMSzyyWCF2Sc6Gks4sigst5QeCF6MM+qjyCUgQnA1ZiWTscEyDFXP1sQ= X-MS-TrafficTypeDiagnostic: DB4PR04MB0765: X-Microsoft-Exchange-Diagnostics: 1; DB4PR04MB0765; 20:rXGzeRCrI+wtCf/FHgPrfpwXZmYhv2mK0vHBBQ/ecauBLRO/S3G2jMJkEQPaVjtk7uhp8d8FH27ZQBDWcnu8cgDn9TgUL/sUI6Ped3nS8QhBddFtEcomJ8IeOfwf1ZrSH3QeVmsjQTMiVWHhvGb90pULWJUUKrJBr518Dc+Ot+e+Iyp8HA6cqX+CuCyhGSU+r5lgR14eF/hzC9+4h9OOGl+t5uTJgWmaBTOwY7AWDQ1faAhDvJUvdRto29HlBNmcVLMcoGQNsUgAiyfsr8uPl/QtuAm/971/4YDA5uJv+f8NIxee0fvGhLpUg1PUTWnmupEtAUhjD4NJnonxYDg/xb5RBwRqRFXxT20D+gR5qcknLH53/6ckV0Rpip5sOqcSGJ7YGNbDsa1CtpSEqiTuPOaKJXXo1qEvtT4Al3hKPN/2gANxKY9/j7KFwb70zjJtwjGoMp6hrwDj1FZjRuG8NgBYDlm/zBBHaMUtEINHf8Q/Vt2eNg2HoAFVG1dN6QMX; 4:pvuki0N9s1LVzd7Td3ceqAgZu49iJGyIttS7TVAD/O+D7By9k7dVPuyzdgBIhQzPrTYQihmV5fgSeAvEV/Q8M9mWcktW3Ol5+4+fngHUvkDwh2FkRYboGcsjYydfYHXCwtoqQFkoWPkyHHdKZVMns7/HGhab73pFNJp5pLII3HDZ9dH7ErBENA2N07obzrjEegYqCi+muNLwzTpkAfv8YNbCzugSzyTwp4Wf0yFL/nlP8ZB7WXlreVPe5XV7kbnKIGQeWKXHOF7LO/XmsKm/Qs8bqypBOFDvC/1TYQZ9ngyx9G85BNqp5aX7ktfsfvni 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)(450100002)(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:HB7Ew34c0s8w29g4h+Q9LMorKvTYxuDVyQoSnwhh6?= =?us-ascii?Q?oPZC7ywZdEtzAtRyhFhWTX2hXh66ZIH/wqQJNnGFS14zRqMViWKBmDvkzgYK?= =?us-ascii?Q?trJ7PG+yFRfeJvI1OMSxXY6C7Qhg7On/X061ZiK+FQYfm8M0LvCg81ONI+rC?= =?us-ascii?Q?xk+QHrNUCztWHioxwrN9NP/tUARQ8FLYzq59mecTIjvqjg27+3Ml5/RL25jh?= =?us-ascii?Q?gvQb6fP0W2CKPkAxVf7Aav2+qxzl6kdjBg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8mCATOE+6fGS8d1fofS/QhqU1eCaHkRebRBxftaeGi/D40LzA11DeWaElZP9J1xWgaH8xVYO6xh+4OXn9cUULjOitHST0Y0Gm6SKutpF7kxjqUTLsPomUt7w==; 5:3E0vffkJKdwEsRPw1KTgbYV+Z5Su/zou6ia2CmGOoMtAxyKXmF8aIBN1AJ3MdMnYednEnc1QvpjkgCu4562e4gq0M90FmBFffsuypK61uWLi4+l7siNh3DLvDkWDe1JwhEpH6g9gjZz/UMP0TZd1Te+va0aKhrkCAPk4yzIsu2Y=; 24:yEXGhfUEHQu0Y/V6NXZsCXSoyF2uJwemj3iYW7XnLTiu63TGS4pHsI3x2HGpTgfpzlhL/i1DV6+En483hEypND7fafIVA+eklw0MpZQ1yTY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB4PR04MB0765; 7:xfm0yECtPA/7sDMHsh94E9PFRswAtL5i2gK7SS6AvcWSR3ZhdPYbsBLobEZzoIUPvdZXfSCXs9WOMzPuV/XwkNKKrsMwM72aOxA0QBgE3LapVk6ImWlPIGTjnwh9uRipgkW+kHWzKSnCTKW98Pny9p5112ThIKQM9ALKhHqF7xhYmDve/wfRZycCYsifsgwnTtAKhIbOFLVXzZTGDxny1IlYU/tCais+tzGRGz0REvbNj+pDJWxEvUpj2BmVqpi6 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2018 09:45:29.4770 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e3d58c76-3066-472a-d480-08d5e192e11b 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 05/16] net/dpaa2: fix the prefetch Rx to honor nb pkts 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:32 -0000 This patch fix the prefetch rx routine to set the next prefetch request to the size of nb_pkts. This will assume that next request will ideally will be of same size. Fixes: 4bc5ab88dbd6 ("net/dpaa2: fix Tx only mode") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/dpaa2_rxtx.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index dac086d..311861c 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -447,6 +447,12 @@ eth_copy_mbuf_to_fd(struct rte_mbuf *mbuf, return 0; } +/* This function assumes that you will be keeping the same value for nb_pkts + * across calls per queue, if that is not the case, better use non-prefetch + * version of rx call. + * It will return the packets as request in the previous call without honoring + * the current nb_pkts or bufs space. + */ uint16_t dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) { @@ -454,7 +460,7 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) struct dpaa2_queue *dpaa2_q = (struct dpaa2_queue *)queue; struct qbman_result *dq_storage, *dq_storage1 = NULL; uint32_t fqid = dpaa2_q->fqid; - int ret, num_rx = 0; + int ret, num_rx = 0, pull_size; uint8_t pending, status; struct qbman_swp *swp; const struct qbman_fd *fd, *next_fd; @@ -470,12 +476,12 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) } } swp = DPAA2_PER_LCORE_ETHRX_PORTAL; - + pull_size = (nb_pkts > DPAA2_DQRR_RING_SIZE) ? + DPAA2_DQRR_RING_SIZE : nb_pkts; if (unlikely(!q_storage->active_dqs)) { q_storage->toggle = 0; dq_storage = q_storage->dq_storage[q_storage->toggle]; - q_storage->last_num_pkts = (nb_pkts > DPAA2_DQRR_RING_SIZE) ? - DPAA2_DQRR_RING_SIZE : nb_pkts; + q_storage->last_num_pkts = pull_size; qbman_pull_desc_clear(&pulldesc); qbman_pull_desc_set_numframes(&pulldesc, q_storage->last_num_pkts); @@ -514,7 +520,7 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) q_storage->toggle ^= 1; dq_storage1 = q_storage->dq_storage[q_storage->toggle]; qbman_pull_desc_clear(&pulldesc); - qbman_pull_desc_set_numframes(&pulldesc, DPAA2_DQRR_RING_SIZE); + qbman_pull_desc_set_numframes(&pulldesc, pull_size); qbman_pull_desc_set_fq(&pulldesc, fqid); qbman_pull_desc_set_storage(&pulldesc, dq_storage1, (uint64_t)(DPAA2_VADDR_TO_IOVA(dq_storage1)), 1); -- 2.7.4