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 408AE42653; Wed, 27 Sep 2023 19:24:23 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 144AB40271; Wed, 27 Sep 2023 19:24:23 +0200 (CEST) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2049.outbound.protection.outlook.com [40.107.212.49]) by mails.dpdk.org (Postfix) with ESMTP id 35CFE4026B for ; Wed, 27 Sep 2023 19:24:21 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fTlDh9JPWiXW53FXcm/dpk8crifNZhBBWn/v1WGh3EWKA2fX9wEZzgKblMk+mLSbNfdT7OvXfYj062WdRH+FxtPUXkbqRpkCy4MRJAIlFiODaAR/X84/uknm1bFAkJHI7RcH+t/w2ic5ed0sCnsXRi0jLHewhu3yOd3zxWv3zaXdPt+9zI3UuZwdu6qzVEodaZXrZoO7WRoecFpgWbmVF4bYxjqIHwMoIEkqIxt8EoCur2Nl9jbeMebt5XdHtEIZ33hDMCM869ho/NoYNKoTQJv+WoyzGtGzTMnuEVCqKDTm2XVnCF5yZG+jQdMS9PJuoZAR6P003WtFYjZA9tdAsw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=u8cRLQcO9Qi+HCEAZuixS7ctJD56mmc+eHQY5xxi2mI=; b=bYU3/AlNZq1ezrpJ42scAZmZ43knGyLm/H+RS4d+Iy++iqvTha5ZN1NNKvHop8Gup30MRDOhUBMw6oskw8hAtAEMc/IgWbrbMmP41bT1AvgBZq0fL+hnENaJA5AfDnzYuU1cON6nxyOVvrWbHrSMZR/01Khw7LSfFFuWsDOqvFow2McMDwA0tlFOr+3e+HdqxtQbOZvUOuWbz4BlxVUxdF9+P3Aba/CS5N9oW7BV0roS9MxOySkBj5Igr0Thaj9D3NrKW8ltTC2eC6rCnGDHUjMzzL16lU0vRp+JkQRyMS8+8NWbPZSDsNB8XLrrvZVxAw89lucnliD+ewkkLBIeyw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=u8cRLQcO9Qi+HCEAZuixS7ctJD56mmc+eHQY5xxi2mI=; b=hn9mpvk4hJeVVK40G+8NldqLJWPfqj6rlA2HGDeVz65f0UACW8R14E/f+eEKvMagPscyUfUVrqQcn6z9C67Xia8Dn2jadLQnTkOxn0vKfNIQearMboDtLPdELt5JM2olpZbG/nh0kFdsfrHGiXwkmA1QfZqk0iUXMt9pubpVX54= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by SN7PR12MB7854.namprd12.prod.outlook.com (2603:10b6:806:32b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Wed, 27 Sep 2023 17:24:19 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::102f:c69b:d3e5:7fe8]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::102f:c69b:d3e5:7fe8%4]) with mapi id 15.20.6838.016; Wed, 27 Sep 2023 17:24:19 +0000 Message-ID: Date: Wed, 27 Sep 2023 18:24:13 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v13 0/4] Recycle mbufs from Tx queue into Rx queue Content-Language: en-US To: Feifei Wang Cc: dev@dpdk.org, nd@arm.com References: <20220420081650.2043183-1-feifei.wang2@arm.com> <20230925031917.420178-1-feifei.wang2@arm.com> From: Ferruh Yigit Autocrypt: addr=ferruh.yigit@amd.com; keydata= xsFNBGJDD3EBEAC/M7Tk/DfQSmP1K96vyzdhfSBzlCaGtcxNXorq4fALruqVsD3oi0yfyEz9 4YN8x7py0o9EL8ZdpOX0skc0AMCDAaw033uWhCn0GLMeGRKUbfOAPvL6ecSDvGD7CJIO9j0J eZUvasBgPdM/435PEr9DmC6Ggzdzt8IuG4PoLi5jpFSfcqxZFCCxLUDEo/w0nuguk2FTuYJg B2zEZ4JTBZrw7hIHiFh8D8hr6YA6a5uTofq1tr+l048lbtdFUl8TR0aIExVzE4Z8qKZlcE+9 RQaewjK5Al1jLE4sHdmd3GN+IvgDF3D/fLsi25SKJDeGSdeHkOmaX0qGeM4WKIfU6iARRCiQ N3AmBIxZ/A7UXBKLaOyZ+/i3sE6Wb53nrO4i8+0K2Qwyh6LjTeiJAIjYKN43ppxz3DaI+QwQ vI+uyHr4Gg0Da9EPPz/YyKauSeOZCfCB5gIfICO0j6x0SCl8uQ2nLpjxcZkf0gjcwUzP3h+S 3x6NfDji9YEij0zczW/dcSpGgZ6vsFpPrtnP9ZXy6J53yp0kJtOJoOlkEFFdU2yCZnCDseum CoudmGLZVvS0/DzHDJejq+3kK3FDGktZBOxZIIpal+nFqS7lVgOZc4+huVv3jyhzoAUOEyXA XK5j6o7g8STUY+z33QNnHpdLvecMwuzmvqy0jR54yAbZ64mB9QARAQABzSNGZXJydWggWWln aXQgPGZlcnJ1aC55aWdpdEBhbWQuY29tPsLBlwQTAQgAQQIbAwULCQgHAgYVCgkICwIEFgID AQIeAQIXgAIZARYhBEm7aYjps5XGsPHCElRTPtCKKm/6BQJjb9DJBQkC+3/YAAoJEFRTPtCK Km/6d94P/irGq3mPa7LamXMIioQ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= In-Reply-To: <20230925031917.420178-1-feifei.wang2@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0436.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a9::9) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|SN7PR12MB7854:EE_ X-MS-Office365-Filtering-Correlation-Id: 70f4a636-c046-4c25-5358-08dbbf7e94f3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JzxI1wPZAkWOynImwk+QDX+iax5ncPxAOE4C80b2j/JyWUDpygMLQiSAS4nL5cTMtfovvkpIk16ozXvfK2RrIQ6jhlDhYfUQwmUTNF0b3t0tvIL5dSwFY073y+wYps4huvLo6E+2UDz243JTtsp3Oj5CGpLb1QwvSbGsuQYea4UeEq8gW82PlCOkr0M7r9UrsuZb8F5pmPKNZZvJGErat8i8+r4OlbTgfjY/4F813KauxbPteSlyKNvwwVbE2CpPapsc6rhBwOORfgTMaweCSUBtCC5P24LTQC7spq3Il+ey6ssYZD8aHiTB8PfHSniUqR3u5AUTCGGSXk3MJd7PXAz3GzKL5PwMlseQ/8r/PHUsTEGlJ5JcwZz3Tobq2ZLE0XC1vtAQhKxay9nwDzpJ0XaefoK5IEwT/Hq7c4xZcZpHkQOzV++TKsUhUGLGls95VAzQmXQx4+nsld8ti0cTG5u0Tm+1E/pT4Kz/3kFCvuKqpa1hDc6PoYfTItsGC1RSytuMlrnjO6QomU/UWFP8MCXi0iV6+zt7mx9prwnpSNGPdkhKoZdWBm1EB9NfWKuE/2gVc+EFqiTtyyxd0DmUOrc7bGCGfTNlP9V0uzGgddiwZ+yCThSuRcaP/O+Cr/6Z9G1hIfK9ZOhV7SfoE34+257b2aSLQPGbWP3fedHJc7AQPlHIobDWboPU0OJvQPJz X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(396003)(136003)(39860400002)(346002)(376002)(230922051799003)(1800799009)(186009)(451199024)(6506007)(66946007)(2906002)(6486002)(83380400001)(38100700002)(6512007)(66476007)(66556008)(5660300002)(6666004)(53546011)(26005)(966005)(44832011)(4326008)(8936002)(41300700001)(6916009)(8676002)(316002)(478600001)(2616005)(31696002)(36756003)(86362001)(31686004)(43740500002)(45980500001)(414714003)(473944003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SGRDczdEU25jdjdyNXNnT3VZa3BPOFppWDlpL1FkMG1JTnVBYlBtYkhrQWJj?= =?utf-8?B?Zkt0MmlqeGFENHF6RVo2YXZsV1JaNXJ2YmZhRU4xdE9MVnJjVjNIWFZ6bFBu?= =?utf-8?B?MUlqQUR5R2llVEFEbnFhYkQxazlSN0FHYkNBTzVXMWwxV2R0eGlVZElZZ0Rz?= =?utf-8?B?R0pGMzV2QjRzWkc1amFEMW5IeDM4ZTlPSzdld1RFTTdDbzlzbXd3Y3EraU1B?= =?utf-8?B?b1ljUVhsbit5Z1FtK2NESWsxT1RrZ2xHcjNrekRzVXZoUzFWbzlpT3RSQmE1?= =?utf-8?B?a2Z2MnZ6Z2dJNERUZHhqZmFLY3dRd29TTTRJRzc4Mkp3cEcvTzQzV2tIcktL?= =?utf-8?B?OC9QaWpxTVBZcjRjOGlZc0o5VW1JQTVDbUNJOXNQNXdITjM0QmxyMnVEa0Zm?= =?utf-8?B?L01HZWw1Zk8xMmJWRnBlVytSUCtXZ003SForTE1mN1c4QVUrQjM0S2RRd0NZ?= =?utf-8?B?dWo1dHF2S0VYbXRsTVRUMUIvRmp3WlcxU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mFoaHpFMFZ1YksvdjlqeHk5SHUyRG9iNlorb2U3?= =?utf-8?B?aFRYd0FZWHJOakc2Vy9mcjN6SEVEMjNGNi9sYUJtNGdyNmw1elQ2K3RvYlJx?= =?utf-8?B?emJRMW5JNlpscXV2ZGs2b0Z1MUZxbmNyWnFhSVBaUzJGQUFPajFpTHRWdnRY?= =?utf-8?B?bVdGQTF6ZG5FMTRjNU9VSnU0dEtUWFc5d1JvYkMxbXMxdXNOaDlJSUxyTFNB?= =?utf-8?B?WGUweUVSb2RqZlRoamdRMGgvT00yNEhJcUcxQzhIK2kxKzI5Zk50OGJ3WXFz?= =?utf-8?B?eFIwQWFKTERtMTBSdDhLcjFWTVFzZEtyNlRRWUZteXRMVW0xS21DVmRXRkFD?= =?utf-8?B?UlkwTUZRcWxORDlHbjczOVJlNnhkTkhLQWR5UE9md1RWV1dQek54T00rVjFV?= =?utf-8?B?VWMvY0VTTmZMMlpIZVEreDJUZEU4c1JNRGZQUlBDK3lyaE5kY0NXbEIwb3Jr?= =?utf-8?B?ckxQdzdWc1N1OW8xb2F0SjJkaEQwT3RzR21rLzA4d0QxN1kzTzV4cm5LTDVq?= =?utf-8?B?aUFyMFJSLzYzdDhIOVN0a2RYYXh0NGh2Sm5UUlRaRnhHN0ZsWTBKZ3ZDOEhT?= =?utf-8?B?Ym1GbjMzaXd2dHRXQ1Y1Sit1YVFRSE9YdDFaQmFOa2l2WmJucUNNNi9vd1Ax?= =?utf-8?B?Qy9zaDlkR1pGYTJDWFQ2RWZvblhvamRWQjRRNXprenN1eDJpN24rZFNpaUtm?= =?utf-8?Q?mBDTQPwx6qVlixv+Yh1sTx0tL?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 70f4a636-c046-4c25-5358-08dbbf7e94f3 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 17:24:18.9910 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: sW0cbg51iA/hUG6ffhLGxmFlhsJ0lBYbZCbUMgm/WFzEYPRMejcAv3dpfU8Pfgur X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7854 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 9/25/2023 4:19 AM, Feifei Wang wrote: > Currently, the transmit side frees the buffers into the lcore cache and > the receive side allocates buffers from the lcore cache. The transmit > side typically frees 32 buffers resulting in 32*8=256B of stores to > lcore cache. The receive side allocates 32 buffers and stores them in > the receive side software ring, resulting in 32*8=256B of stores and > 256B of load from the lcore cache. > > This patch proposes a mechanism to avoid freeing to/allocating from > the lcore cache. i.e. the receive side will free the buffers from > transmit side directly into its software ring. This will avoid the 256B > of loads and stores introduced by the lcore cache. It also frees up the > cache lines used by the lcore cache. And we can call this mode as mbufs > recycle mode. > > In the latest version, mbufs recycle mode is packaged as a separate API. > This allows for the users to change rxq/txq pairing in real time in data plane, > according to the analysis of the packet flow by the application, for example: > ----------------------------------------------------------------------- > Step 1: upper application analyse the flow direction > Step 2: recycle_rxq_info = rte_eth_recycle_rx_queue_info_get(rx_portid, rx_queueid) > Step 3: rte_eth_recycle_mbufs(rx_portid, rx_queueid, tx_portid, tx_queueid, recycle_rxq_info); > Step 4: rte_eth_rx_burst(rx_portid,rx_queueid); > Step 5: rte_eth_tx_burst(tx_portid,tx_queueid); > ----------------------------------------------------------------------- > Above can support user to change rxq/txq pairing at run-time and user does not need to > know the direction of flow in advance. This can effectively expand mbufs recycle mode's > use scenarios. > > Furthermore, mbufs recycle mode is no longer limited to the same pmd, > it can support moving mbufs between different vendor pmds, even can put the mbufs > anywhere into your Rx mbuf ring as long as the address of the mbuf ring can be provided. > In the latest version, we enable mbufs recycle mode in i40e pmd and ixgbe pmd, and also try to > use i40e driver in Rx, ixgbe driver in Tx, and then achieve 7-9% performance improvement > by mbufs recycle mode. > > Difference between mbuf recycle, ZC API used in mempool and general path > For general path: > Rx: 32 pkts memcpy from mempool cache to rx_sw_ring > Tx: 32 pkts memcpy from tx_sw_ring to temporary variable + 32 pkts memcpy from temporary variable to mempool cache > For ZC API used in mempool: > Rx: 32 pkts memcpy from mempool cache to rx_sw_ring > Tx: 32 pkts memcpy from tx_sw_ring to zero-copy mempool cache > Refer link: http://patches.dpdk.org/project/dpdk/patch/20230221055205.22984-2-kamalakshitha.aligeri@arm.com/ > For mbufs recycle: > Rx/Tx: 32 pkts memcpy from tx_sw_ring to rx_sw_ring > Thus we can see in the one loop, compared to general path, mbufs recycle mode reduces 32+32=64 pkts memcpy; > Compared to ZC API used in mempool, we can see mbufs recycle mode reduce 32 pkts memcpy in each loop. > So, mbufs recycle has its own benefits. > > Testing status: > (1) dpdk l3fwd test with multiple drivers: > port 0: 82599 NIC port 1: XL710 NIC > ------------------------------------------------------------- > Without fast free With fast free > Thunderx2: +7.53% +13.54% > ------------------------------------------------------------- > > (2) dpdk l3fwd test with same driver: > port 0 && 1: XL710 NIC > ------------------------------------------------------------- > Without fast free With fast free > Ampere altra: +12.61% +11.42% > n1sdp: +8.30% +3.85% > x86-sse: +8.43% +3.72% > ------------------------------------------------------------- > > (3) Performance comparison with ZC_mempool used > port 0 && 1: XL710 NIC > with fast free > ------------------------------------------------------------- > With recycle buffer With zc_mempool > Ampere altra: 11.42% 3.54% > ------------------------------------------------------------- > > Furthermore, we add recycle_mbuf engine in testpmd. Due to XL710 NIC has > I/O bottleneck in testpmd in ampere altra, we can not see throughput change > compared with I/O fwd engine. However, using record cmd in testpmd: > '$set record-burst-stats on' > we can see the ratio of 'Rx/Tx burst size of 32' is reduced. This > indicate mbufs recycle can save CPU cycles. > > V2: > 1. Use data-plane API to enable direct-rearm (Konstantin, Honnappa) > 2. Add 'txq_data_get' API to get txq info for Rx (Konstantin) > 3. Use input parameter to enable direct rearm in l3fwd (Konstantin) > 4. Add condition detection for direct rearm API (Morten, Andrew Rybchenko) > > V3: > 1. Seperate Rx and Tx operation with two APIs in direct-rearm (Konstantin) > 2. Delete L3fwd change for direct rearm (Jerin) > 3. enable direct rearm in ixgbe driver in Arm > > v4: > 1. Rename direct-rearm as buffer recycle. Based on this, function name > and variable name are changed to let this mode more general for all > drivers. (Konstantin, Morten) > 2. Add ring wrapping check (Konstantin) > > v5: > 1. some change for ethdev API (Morten) > 2. add support for avx2, sse, altivec path > > v6: > 1. fix ixgbe build issue in ppc > 2. remove 'recycle_tx_mbufs_reuse' and 'recycle_rx_descriptors_refill' > API wrapper (Tech Board meeting) > 3. add recycle_mbufs engine in testpmd (Tech Board meeting) > 4. add namespace in the functions related to mbufs recycle(Ferruh) > > v7: > 1. move 'rxq/txq data' pointers to the beginning of eth_dev structure, > in order to keep them in the same cache line as rx/tx_burst function > pointers (Morten) > 2. add the extra description for 'rte_eth_recycle_mbufs' to show it can > support feeding 1 Rx queue from 2 Tx queues in the same thread > (Konstantin) > 3. For i40e/ixgbe driver, make the previous copied buffers as invalid if > there are Tx buffers refcnt > 1 or from unexpected mempool (Konstantin) > 4. add check for the return value of 'rte_eth_recycle_rx_queue_info_get' > in testpmd fwd engine (Morten) > > v8: > 1. add arm/x86 build option to fix ixgbe build issue in ppc > > v9: > 1. delete duplicate file name for ixgbe > > v10: > 1. fix compile issue on windows > > v11: > 1. fix doc warning > > v12: > 1. replace rx queue check code with eth_dev_validate_rx_queue > function (Stephen) > 2. put port and queue check before function call (Konstantin) > > v13: > 1. for i40e and ixgbe drivers, reset nb_recycle_mbufs to zero > when rxep[i] == NULL, no matter what value refill_requirement > is (Konstantin) > > Feifei Wang (4): > ethdev: add API for mbufs recycle mode > net/i40e: implement mbufs recycle mode > net/ixgbe: implement mbufs recycle mode > app/testpmd: add recycle mbufs engine > Series applied to dpdk-next-net/main, thanks.