From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CE0E4A0A0E for ; Mon, 10 May 2021 18:11:32 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C2E6F40140; Mon, 10 May 2021 18:11:32 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2041.outbound.protection.outlook.com [40.107.94.41]) by mails.dpdk.org (Postfix) with ESMTP id 7AF8D410FE for ; Mon, 10 May 2021 18:11:30 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=APBWVf8kQQdGkeiAmSOZQr4XusIubkokxo5p572uqLgdu/5JU3TT8ENULfB6JyXLd6QJPefUqNpJRyHcmIaJd4TnS6M/aBjzp/PpHtXiDcyL2TEiSlit/3UIsZA3ezDPr6ur3CXrmIxh2pJutv9rOtz3MO/0Fs3DOLn4HqEybhQOf+w5/hNlTCDNgOL+EohUXbw4atXpD3Yu1Yf+NeSnO+jywXTzt8ur9m39/gHaxw9hMDiG1LDaIs5V+mY/ot6JhsaHHi20DJbSpyzFpIhqV9uvwH0lkU3YRyC1JRSKuduhk0xECnExJHL7O5qmnmFRNweVVR8WZdojmjE1M5qdVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SqZKWbZBthCldtKKRPoF+ccrpIYnWFh5AKQ3liil42g=; b=E+gzwMyVlYsufrc/fyKbALStVKAYBUFYPYpdzFJOykzCTf0LNxAQgU0MCnuNLMEK1jyuCMzo6XJc1YtvEuOwi+uC2TkimTdnpar9nlkd5fVHGNiMT2vCMvpSVq3gDh6L9AQH0UFhN0sxXQutLFP3Bgf0KQzlaeJudxshaapiV3pdI70vo0GFHpEZciqR2EXUEg0Cb7N4j8wl102DOm8qI5PYt8FFQZPbJ50aI4u2kCploFpzVjjlBb170IKSIgNc70e/LP0l7PrqsMkAOyUKDYLe6KgMiq5AoNOB5a2eanQu4OzXBpApsFZoDm2JFrg38gY+LMPVCG/BEu9vHnCCuQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SqZKWbZBthCldtKKRPoF+ccrpIYnWFh5AKQ3liil42g=; b=C7zSfGpO2q7XZbDi3fcEdzjGgvl9K/lX9tWQjpQ6Jvj8yWP/IGk29zmk9xX1+ULcqpvu7sfs8ya/0x7e78gdGF+lrKYbewEJLgwym73aUxxmAsJPiEbb6jkCNO/ebwWPMdAjnByND3rbndDfqDKIq14EVOSURL4znutXB9UB5P8FxWGF++pEzpSvmbXIP/Wmov+vqawjPyi7CHJsyJfFnqbeeQozze0j29jvsGV3NoUlrY0BkK/m0un4OYFnCQ+th3Oc3A3u8Bw+9GiyYGVIgM1Zc9DnALQpH9WTAwT0McCMgr6E0x9KZ0UDKLIWO6yCUJxhDaGKPeOD6vvHO7bI0w== Received: from MW4PR03CA0054.namprd03.prod.outlook.com (2603:10b6:303:8e::29) by MN2PR12MB2974.namprd12.prod.outlook.com (2603:10b6:208:c1::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.29; Mon, 10 May 2021 16:11:28 +0000 Received: from CO1NAM11FT059.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8e:cafe::70) by MW4PR03CA0054.outlook.office365.com (2603:10b6:303:8e::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 16:11:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by CO1NAM11FT059.mail.protection.outlook.com (10.13.174.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 16:11:28 +0000 Received: from nvidia.com (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 10 May 2021 16:11:26 +0000 From: Xueming Li To: Ed Czeck CC: Luca Boccassi , dpdk stable Date: Tue, 11 May 2021 00:00:33 +0800 Message-ID: <20210510160258.30982-84-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210510160258.30982-1-xuemingl@nvidia.com> References: <20210510160258.30982-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bd7f6596-bda4-4d9a-95b0-08d913ce4476 X-MS-TrafficTypeDiagnostic: MN2PR12MB2974: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wDf6KjINV12DNLS46EDJFlezeBEVFrxNobz8TudiFSN2j1idx1SS0YfFkHJT8Nabcy/JaBOxpa/QhPFWCJhisQYft9hDAxN99lMkDEmhWZ35thmoa1Q31tqasE0reFvp0/XuXcV/ztHs0iAFWGct2wRMk2ImXdHdrqy5DMjG1vc4ugh2knxuYH/26jL7wu+4RFA5LviszEpjeHJYxH9TpfJAx0/mNcV7AsPZrdbXcoKJ8ZOeKNXOmACSJwCrcbqaSukut4yPL8h+xYU/8xuVyj4NmYDs7UQLgIerGQ4U0T91VMB/ZoGjxt9R9M3S7GfceYLQHBShuB3uvCCagL1v+55kXuV+S9xcVzpNQ/+snTpvaViomPVCFaVkNOWKFff4W+3g/WgLjwPHfKaAv+LsYR8mUjia/Lfr98sD2YNPYTUHApSdbBTuPy/wZglKWcuRseiDCk4UysHsFVcQT8vq97FZ3XUUfy74WM8sjBSG1ATAOCGt7gQlT4o+P81tVjCacpGJRyKwjvHcOPHMT9n7LBJjZgNL1e4t6Jew6en0Rqgtt0SFwK5iJxRK/T042kjU4VQ9U4YL1e/3HWk0gaTB3nbKLZrXKCxVOgcIpj6QMsUDfiSKsnc1YJ1sNw6fCynq/2FCkLuqEBnKfKx5AH6pLARheRzl+bOTIUbYU5xsOUfF9pSwUtat9oGBxDgRputQLzKq0Fg3gq/aw368sz0daH+gCQzpWpVKJD18rUvC3EOIBZ98ltFb/VCzJ1EVUl3APrNlvtrbbg2jRR8yJOov6Q== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(396003)(39860400002)(376002)(346002)(136003)(36840700001)(46966006)(16526019)(186003)(70586007)(70206006)(26005)(82310400003)(2906002)(53546011)(966005)(316002)(6666004)(6286002)(336012)(2616005)(6916009)(86362001)(36906005)(426003)(5660300002)(8676002)(47076005)(8936002)(83380400001)(478600001)(54906003)(82740400003)(7636003)(55016002)(7696005)(36756003)(36860700001)(356005)(1076003)(4326008); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 16:11:28.1409 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bd7f6596-bda4-4d9a-95b0-08d913ce4476 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT059.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB2974 Subject: [dpdk-stable] patch 'net/ark: refactor Rx buffer recovery' has been queued to stable release 20.11.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/12/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/b22415b70a6c93f459ec48c25f7384da71e380fd Thanks. Xueming Li --- >From b22415b70a6c93f459ec48c25f7384da71e380fd Mon Sep 17 00:00:00 2001 From: Ed Czeck Date: Thu, 18 Mar 2021 13:36:56 -0400 Subject: [PATCH] net/ark: refactor Rx buffer recovery Cc: Luca Boccassi [ upstream commit 31d7dded033fc061950312253919237dde07ac63 ] Allocate mbufs for Rx path in bulk of at least 64 buffers to improve performance. Allow recovery even without a Rx operation to support lack of buffers in pool. Fixes: be410a861598 ("net/ark: add recovery for lack of mbufs") Signed-off-by: Ed Czeck --- drivers/net/ark/ark_ethdev_rx.c | 49 ++++++++------------------------- 1 file changed, 11 insertions(+), 38 deletions(-) diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c index d29d3db783..8e55b851a2 100644 --- a/drivers/net/ark/ark_ethdev_rx.c +++ b/drivers/net/ark/ark_ethdev_rx.c @@ -26,9 +26,6 @@ static uint32_t eth_ark_rx_jumbo(struct ark_rx_queue *queue, struct rte_mbuf *mbuf0, uint32_t cons_index); static inline int eth_ark_rx_seed_mbufs(struct ark_rx_queue *queue); -static int eth_ark_rx_seed_recovery(struct ark_rx_queue *queue, - uint32_t *pnb, - struct rte_mbuf **mbufs); /* ************************************************************************* */ struct ark_rx_queue { @@ -54,7 +51,7 @@ struct ark_rx_queue { /* The queue Index is used within the dpdk device structures */ uint16_t queue_index; - uint32_t last_cons; + uint32_t unused; /* separate cache line */ /* second cache line - fields only used in slow path */ @@ -105,9 +102,8 @@ static inline void eth_ark_rx_update_cons_index(struct ark_rx_queue *queue, uint32_t cons_index) { queue->cons_index = cons_index; - eth_ark_rx_seed_mbufs(queue); - if (((cons_index - queue->last_cons) >= 64U)) { - queue->last_cons = cons_index; + if ((cons_index + queue->queue_size - queue->seed_index) >= 64U) { + eth_ark_rx_seed_mbufs(queue); ark_mpu_set_producer(queue->mpu, queue->seed_index); } } @@ -321,9 +317,7 @@ eth_ark_recv_pkts(void *rx_queue, break; } - if (unlikely(nb != 0)) - /* report next free to FPGA */ - eth_ark_rx_update_cons_index(queue, cons_index); + eth_ark_rx_update_cons_index(queue, cons_index); return nb; } @@ -458,11 +452,13 @@ eth_ark_rx_seed_mbufs(struct ark_rx_queue *queue) int status = rte_pktmbuf_alloc_bulk(queue->mb_pool, mbufs, nb); if (unlikely(status != 0)) { - /* Try to recover from lack of mbufs in pool */ - status = eth_ark_rx_seed_recovery(queue, &nb, mbufs); - if (unlikely(status != 0)) { - return -1; - } + ARK_PMD_LOG(NOTICE, + "Could not allocate %u mbufs from pool" + " for RX queue %u;" + " %u free buffers remaining in queue\n", + nb, queue->queue_index, + queue->seed_index - queue->cons_index); + return -1; } if (ARK_DEBUG_CORE) { /* DEBUG */ @@ -511,29 +507,6 @@ eth_ark_rx_seed_mbufs(struct ark_rx_queue *queue) return 0; } -int -eth_ark_rx_seed_recovery(struct ark_rx_queue *queue, - uint32_t *pnb, - struct rte_mbuf **mbufs) -{ - int status = -1; - - /* Ignore small allocation failures */ - if (*pnb <= 64) - return -1; - - *pnb = 64U; - status = rte_pktmbuf_alloc_bulk(queue->mb_pool, mbufs, *pnb); - if (status != 0) { - ARK_PMD_LOG(NOTICE, - "ARK: Could not allocate %u mbufs from pool for RX queue %u;" - " %u free buffers remaining in queue\n", - *pnb, queue->queue_index, - queue->seed_index - queue->cons_index); - } - return status; -} - void eth_ark_rx_dump_queue(struct rte_eth_dev *dev, uint16_t queue_id, const char *msg) -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-05-10 23:59:28.800876700 +0800 +++ 0085-net-ark-refactor-Rx-buffer-recovery.patch 2021-05-10 23:59:26.440000000 +0800 @@ -1 +1 @@ -From 31d7dded033fc061950312253919237dde07ac63 Mon Sep 17 00:00:00 2001 +From b22415b70a6c93f459ec48c25f7384da71e380fd Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Luca Boccassi + +[ upstream commit 31d7dded033fc061950312253919237dde07ac63 ] @@ -11 +13,0 @@ -Cc: stable@dpdk.org