From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20080.outbound.protection.outlook.com [40.107.2.80]) by dpdk.org (Postfix) with ESMTP id 059F61BDDE; Thu, 21 Jun 2018 11:45:52 +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=HI6u9Rpjm1TSGA4Df6lVugfdKAtl7AJfkqdU0D3ocsY+b7rXUg0Ou1O0eKVAV/g4ChaxFME2EFe0p0EvHe5cST9543NC/5SjCFfIJkzsi5Lm2FOugWxnIcvJ3lnvlqVIB9CahDNPXpa+SE5qTax0MetA+vRPCkam5ghoPasXlNw= 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:49 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: ferruh.yigit@intel.com, stable@dpdk.org Date: Thu, 21 Jun 2018 15:14:02 +0530 Message-Id: <1529574244-18997-8-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 Content-Type: text/plain 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: 4c6333d1-758d-4812-d854-08d5d75bc5a6 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:jmbyigMTUUiiGfZi0bHkmPasoCLK290DfsrGs4dxLiT8ncTiGhD8OrhD5WgkhHJ9fRfgpbur3Shf64MFPJR7nSGORPM2ZRGMzKhoLK8nD0WjpoCEGsAjbQgSNCm+XdHzP+6sBt84l2pk9E/ZGiIQ3OhU1rKZQKy4uNIctvFX1RVwwwrzCFFcNYaXAaIsvp+ZiwvGIvuUB/XII/AUD29WGoJfpFYQJI0h4Y53MLaKmtuOjvOqcf2ou7Gqpns6/Vnh; 25:vtZPn8o1CkQF3blsa2JskEcUjbQv7gFONxAAtP1Q+Ix5PnmD6dJtXiCdBPsAn/5lOZ2YodhTFgjtR/WgshFCojNCHKyuT1XaKuMXGibBE+t8PIP1GNHhk0jL9dc6K7mjFLgGGdOpCtQ5QsFUS5dkGySIog1FVb39upA2lj1QsyoHZK0sJhqoNYdFoxMmM9MYr9BLKCvlVbD6i7kx0EbSiasklFWWZLivnInJ177KVaO419rB3vDB9A1jJhEYx004L4htnli2fZl3XyOFHPHiOHS0rZnCVqej2AdPoBsVX5p0s+hrrcQEFinoDgxozY4tqRFIKt4iqE62hWicaFKj4w==; 31:2Iz10DrfdGSPQAmhFIxzJ1s36LZfLgVRD02Xa/NENj7LUhWPSz/5POSTX3ilkXiZo81j9ngZWi9i0cauC4VjH+hh+ehreWEYGgvHqk4jp4kVz4OddGKMI9PUtBPCRK+h820aq300QhQ+ypoZytP/iw1Ghy0s1xLZyqWObD3IUb8xJdQi2V9EseED/12LJMQRF66IocHdXeucvcKCYsTi9z7p+YgcoyMh2plX/AKruWU= X-MS-TrafficTypeDiagnostic: AM2PR04MB0755: X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0755; 20:F9/idkCAGbwtVjWLxOXOv1tkHAGG1VSG7CnUvhuskg3MEMvGK+EwzWJ1KNHJVj+kSXFwVcnHn9WGC284PmrIYJGHD6MP7cZhPISogxj/oZfwkVwsRg606x1Z0LYqezh5VW3wz/2n178FbazIkuGj+FchExE6mKimujd8MuErweeiuCzFGORqdQ/tEOdx74GlRnQmmkNQGkCV6ZNkZaKKz7op8Ciq1+J3izCrxTS86H+f7YkALfKrbL+wLG+CDTfsvraQmJHsBRxfn2FmdSFRfijPr4hqn7SSp4rx/jx0dz8XwmjXOlaupuCrKvADgKSdjXvOc/XmpTYQ37/DLsfJM5j0oJxQe/oCFLGpr+4cOHXrUHLFgvq2R9CI4JQjkKZqy45+HUtGf5pFAk7Vgv+upVVwhIpthL+ML2WbONQzvIveH98sH7Ai6uuDZti3RLoma6YD2qg/CuV7CVrWawvj6c1ywelbiaPbe8MynNgn+0h8y0WFpIVXT/PsnhmjWC5R; 4:fU3B6O1hmzdQeuRtSgzCrA0RGUIrh0dLt/z7aLz/aOeSpxFgBai8XfnMPC7QLkjZP+3nivr4VpxNnorhI38Y1074MRq0GpOAhyMkryWHfOE4qB8tM0CMbSl8qoNYvTmdLDPARW854NLFhjPRCF55Y1YBpNWwVilHH7ea/neCUbtF4inzSLCAXLVZmNX9+c3OYH0HUA0tvR/twpUaji+GPB4zALNImOwlybZFywA605UaFbQY/sFkHQlk12SCAEH0BssH+TCVVSA+Q+SQ39e0QH+DV0zZDTPFGTMDe2NmVfLVfTI6lGzleAA64pOUZqFd 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:g0XHz50EW2P1barwIIYHzsE5qmEKlG+hFOd1fpBQS?= =?us-ascii?Q?dhgKNauPWiAGZGtVMaGiyMEEq7WsQ1763ywbuOHtMAlZ8oWh4o+OxKcjne/W?= =?us-ascii?Q?i+BxxxRHHBxZFdxxcW1l2/jlDYZ1tmCdzfV/gK31v0nWBs4aNHCKxUiyzJuw?= =?us-ascii?Q?wqeU/EmfSCQNbG/fN1jZWhvrK6LDPiZUa6+OuDbxg/nBa0tMDy/WYR0ExfJS?= =?us-ascii?Q?g/bxnJvbY5hPSZ4bBqN2DKXjQ10zNZBhBaFkOEGgyzVn/97S9iy02kcVhr7B?= =?us-ascii?Q?H85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LKMXxOg==; 5:48357RT+bld76LH9HzaqMprswImj1bF/jazveEnYc7BPzZXhqsGjR4wOKECGBQqfEjcO+PzRFD3zaWH3iPhe44s9nVuFO4fck1tXpnfyUk9aUaTTWlJ8XR2kyGMDYOcs/O1ngOBjXNQczq0sfYQdA+YJOuhN4geXcKSMHEq6UL0=; 24:FBvZcR/W+SwRRrUhcYsyWt+oncGM71H1U/EvmsrfwlSWqZa4TGmDfL0okO21jsqvfHn3nnkEE8PXPSwUaLMaLuQJg1idOsDZ8VlZd3aof6E= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0755; 7:NKaYXqO5/19pIWa13z/JjFA7pwVFCL9Y7R4V9Y42Rv82luOjF9aS0/dNAoSRBFrdyQ4JCyWg9YJxtRaTZ93sXutOtBoO1WC8d87KL5Ll6FU1mLESXJHPhGohyUPpRNwOXnQiOY00VlHcygy1jxW+/PM/Ltprr4FSjul3Y8HBEQDEVK/xG9m1jYcxX/Z1iN5fKAMl8Q+d9pQv0iO4DD0Sa8GdOxcXH10RuSpyOFRkd4Kpm9c/BET3n7uKNL18bEXy X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2018 09:45:49.2118 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4c6333d1-758d-4812-d854-08d5d75bc5a6 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM2PR04MB0755 Subject: [dpdk-stable] [PATCH 08/10] net/dpaa2: fix the prefetch Rx to honor nb pkts X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2018 09:45:52 -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