From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00088.outbound.protection.outlook.com [40.107.0.88]) by dpdk.org (Postfix) with ESMTP id F27B71C43F; Fri, 6 Jul 2018 10:12:03 +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=MWTxpKvReQoRM5Ph77r1ZW302bvBShlMaY0A1PlFdos=; b=dLcl7MZ8gaXH3fMADSin8FChi+OGTguaAcxnCdP9yfzALcaiSM4bvKym0dHmL0V4cSzlZp06BqxXx2ZdVEw58tFYg8a3J0sJKAZ2muIdPLuEgT+ZXV1dpVUzyLRi91wbG3edzapJak/OaTNBWwDGxEQDf/PRUqHRBLPwblpZpWU= 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:01 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: shreyansh.jain@nxp.com, stable@dpdk.org Date: Fri, 6 Jul 2018 13:40:02 +0530 Message-Id: <1530864613-11754-5-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: e92f36c2-d669-4f71-e3f7-08d5e3182783 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:1mRuNNsGOc5I9wS3U0GJ+hrb14sp1Cbg+3UHlkKN9DFk9ByCyk0Tn1hYNVTpRQmGoubczEhaN0BCndmQfJUowjxsX5JQ03G2Gc/OQk039Bt4iOUKcC3m8XAf4zIFH/aEvyKgGQmttPXuPJiZA4ipBtXV/QWdfQbdGcwK0JJWfD8jqaat7SYSnrlBdWO+5/EmFvBfrezUaVor9v+CbYa0OTPXBbBindfCJzVGZiGI7HwhXXD4YqgHTioeMVKY5n17; 25:L8WyMt0wM66TpwWwj5MwNUMna0PSdkTn0+atLcZTsSk39uuxqCRnHDFMEnxTYRLSEmKJFTmkgbsEOIMwU3bPsZ9szjvKI8LMOIMeOKHS8PlvjtENZMHfV3uggdXKE9hFA4RmQByTid2u6ZgQJPx52foAmt/1kyWHjTSt2Wf6UICMltdm6TOis92jzderdNhmtFoOP3DTc83wOXOfpNipZYw7GYXo6jBe9cpGD8geU761Wm1LQMq+93xHTdU/8by5LxC+LyrJhD+SmRV5RSPcW4wzG0Zmv2Od3YSzwfIqqrjvc8K1Of6sttKyd+owuEwFl6iTItwRbEQNJPSlKKUtyQ==; 31:hVfxLpw1VMre/REfM+z8aqS+sbPLqYkcdAxrTkltMchk6MpWMkFzLB/IeK5PxEll6S43w9njuS5iY4wFpnnih5Dk3nB2L5AEcXm/nu+q1KdOtyybg5ujfcqPLZGH25MEjyckfr1dk1DQgs+/NWZfC3AVWzJ2MWxJPXqGwpUSuKcO3W3XDQyCx6If6KklNkQUvvcxZs3rcJtwlJPMKuKtjFg1IGwW+0So0gQa6mtK1Hw= X-MS-TrafficTypeDiagnostic: AM2PR04MB0755: X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0755; 20:al1glhk+qWkWTrts4ZLkX0t5TWR0KPqoB+CdKX3u/F/Nkzsh9Pg7CsflvC/CjxEV3QMziyQKHaGmYHVTSfcFfKbFARmePGiQvz3f40TUSh/mOiPo7v5+S9RP6r9MvvTmR/PgLoBJdbCHcjt2x6FA5Pp/DZPpVWBe5ncNNzn2tlEFOKjp+IvMBMQrnjoY/mG4AJ6aoHWP/pP1ailDyS0zkZJyAhi2L35qNuBRh306IaEW4hVc2WM6uqOEmj6yD9SKc8MOk+OGvraw5QRRIuQYTfQyqE/JdgYZcaR3xzYmJvCStsbRQ/G3mlk99b6zVYTc7oCBC5NZ5BDgdP+ekUkJjB9qkh36bjPr7DuiEHXIsX1i5oKMW8SfJHWY0RVV1Js50HnLs6YhL8Y1LOQOi0dMUUbGlV71wQeSfVzLErqeDXBHyglg3KEs/ZkSqP+1nxRfyumfxue6hfzGzDwy1EENB4LI1AXfuNU+gf3q1RiEZWCmeA6v6YZUqea7O9BedaUI; 4:O2QyFfPHy2l6pcLompx20vzkTpVFpGbNf0LGqbMguOV1H00PanumeWtBtkf7Yg0XRVSpoC/KY/m2C2I55S2gIhTX0ru/6fBCOjyVCkOJ+ekDpl2VXMNRmgjync3LxzdirLeIQTu/TzKDKFuCeGo+uirDqGwgL2ceF5ec8Bs7MJ62QCt9apOKa8jBMh3RrD8gbxJhKD6SFQ4+EofhCQynsHdmmHFuHGihIQyzP7yLaROhQP8o0kM8Ct9kpDOPqR+85ciC05NdCVvVBnidjqRy2jDmE8ffA+xVFt8RCPHMLBbMYxuPmfERjCGTkVl/jluy 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)(450100002)(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:0eGnOqlGF6miKwEj0GUFwAtxt5jmfngQzllfB+8tC?= =?us-ascii?Q?uVwZop7D9qSNYMjD8X5/PsTZelRq1yLs9JSoWWVChhRkUN2O0ma/vjjnJVqW?= =?us-ascii?Q?azsKbjXi0BphALmi06SPPq9MIp++NcGt+b/HeJWwvQgAFDe+tNmvNehaP43T?= =?us-ascii?Q?dUojbUN1NjALUbxsnUjiEHfoLHSFhevjNWs8BtJOU0FuYhsUvtx9tnjvuYMj?= =?us-ascii?Q?FPSHgNjk3ZgQqYs/qEQztc1Kr6EO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aUDshSFLXn8EXi3qTw9UPQJDEHOf33WUC2S8u554PfH/4a9px8y?= =?us-ascii?Q?zXUj9SyRz0IWG9/HrW9MZnHQK5rMLmmZMRGaWAZEI3ni1s0VEGexznLQd+9o?= =?us-ascii?Q?sIHxdNwzQQ4M7/86e++VeJISrx2v6H7RswKs/JgGE0ygRl0Ygi0P1JaOzPvW?= =?us-ascii?Q?hHl1kpD5EGkUJ30vH8hORdKvRTMycOSOZ2QXJoNa65a?= X-Microsoft-Antispam-Message-Info: BB+q1/mpFca5TrhERcX3YFBV4XR2yOKG2ge7Ai4Gub7IArxlDUCsh3x4YqSdDx8LNgyUsIr5FoIUcRPH/I83RSqhdhVsfz5F1BFJNT1TD5ZflhFHf/m0PQPelHuFlJTC1ocwGDD6teQZprmacBs9HVbRMwguXN42ZZWy9fU+ROWFjkDLpUp5H1N9jVFElYhyy1keuFpCq905RD2GjjVcxJ0KApOEND5YqnrBi3Ho7z6juiEFZRBFFMU1guiivXOxLgkw8ipjeLhpjB+ElA+3dZh3u2irzQWwE169Bqb7dktyjotiEf+gCLZVMMjhK0bToHkPtwyAb0Hb4SqGnIRbpjOQorEuOB6C45GLzLJ2fak= X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0755; 6:x7eBAyPJBLSAJZqx8kqvU+pFd+rx8Kf0hdMfASrPSXWJHL/EvQ86TcJ/gKGEdWqqfNdCE2U7lOz8q3VYWkSY4UV0DU4tqetlhP/Oalz4l3oICBXHHLu666Ih1Ck8xnspKtGcmFij82LHmYs9aaARwkVyg2DsXtgiXl/JKIoDWF2Jmq8U8lIa3Ndc87opBly9074/m7drYeqvW2FaR/uT7zEhcC8VUXYgKtMDfwNLYqCJQX7NddP8jNVHXRqKc7xIbsIwbIc9XShLWV3QhE2aZBKQIgWr18d2XfixNR+we4mlnDsLXLvUQ5talXEExzG/wAS8MTGmvTepeK4+jN4jTcU8ytWFG02jBDTYienufl5cSBozMJUl1G65Tk5NIN7evCetAks7wttZXrvYlx3Llru1SVuk1yJE6HTJgl0Y8uLGg87qlxGFExT/3U3hU2LWABfz/y1AsFcLelD3xu/2XQ==; 5:rgGR82qrz0qzQbUqhmhXWZsf55M3m85vR7X5/lKm0rc0J4t9/R/3pJn5jvpL4OX6Iwp1ymKhGWeA7pcCyP0qAoHKueb0VbFReg8mzljmYJhDmqm/N/ATzaS3jCoUTf5AAsC6eF79J1H5CBzkVqHQdG1QRI7MhOVFmrv2XuHi9hk=; 24:E0487VEZUS8XoF5nRMpD221ftzeM0bdEhzbasktH1DSFd15cm3j+K5Ofg62ojYDxJ0QHzsxwFQRubSppqr2kjENh6WtaBbhdvg9uLXwaj/Q= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0755; 7:bvaSi90BJFqNBjdrcML+DzLUqoQaGTalAC7V0TrBQw6MzYXEG6jPkUPlyQOLtoyJ+6F4/dBX9m46KQyR3g3/2oOccegtxz7Ig5kI4EJ0PtdC/5/dJjw0JGeA36VBR+18Nn/gxUb4iGGlK41M1F+/hYPnUoRwM32OInbwv170bEtzbk/gDDIv5XfCNNKuRJAYC0MWQnpCzGtvSVGRlVGpes1yO4Z1Kde8bB+qBzkdhlnJ439Bfm/if8nSmyzWyHVJ X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2018 08:12:01.5661 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e92f36c2-d669-4f71-e3f7-08d5e3182783 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 v3 05/16] 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: Fri, 06 Jul 2018 08:12:04 -0000 This patch fixes prefetch rx routine to set the next prefetch request to the size of nb_pkts. It assumes that next request would ideally be of same size. Fixes: 4bc5ab88dbd6 ("net/dpaa2: fix Tx only mode") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal Acked-by: Shreyansh Jain --- 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..ef109a6 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 caller will be keep 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 requested in 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