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 824354408F; Wed, 22 May 2024 12:20:12 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0A8D84026B; Wed, 22 May 2024 12:20:12 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2086.outbound.protection.outlook.com [40.107.243.86]) by mails.dpdk.org (Postfix) with ESMTP id 74DC9400D6 for ; Wed, 22 May 2024 12:20:10 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dtxfIA/UCnz0/Zfhv+ixpYgrV/co0F/AdnHB0XhqYjw10Sc67v1dq7vY8A/acCJVFyfi4Lvk+eXFzwy0JDAlsgnNuId/DmPz4Bdstbg1zKanp2aIZ09cWotPbBhHTLgtDqEXjEWP1yWAMXuxH8T3jqQDEqhWAXQbnITTJqtm4wYJOcKZLIJ2V8L/e0899XocsFZGoHKuFoqoPUU4mJjamFy212K24tG8623IqSOLjlfL7JriyFa1NsJYYjKhX4t6nBxPFc9vMuq2cYrMCFqI55EoySIi/T+0UbXbqDC+n/Vrnqo96WzgXtN2m1eIkeId/tOySgtvNnDiSZUYBTGuZw== 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=btDbJV2lG618+8M2ALGeqcSGW3Fho3uo0JhnmWzRs9I=; b=AJKk6Cg3YGuXro3PaLGl/yci+drRtoVU9JohDCirBXe3wIIUExhj6MrB0nvM1DrBkZ14cNUEyJQbXVbaRtu7fqdnTTowJgkQ0beK1X3T2R4Sotzf1RSVlrFgazIKNnALgDzVG5Zh+Hwvg4rFa2VY+hcoqgHMhzaRmetD3nsFTM5x2UqxyZSVevUxM6AmAS/6D44x5dau1c2jP93v9isewFdMgfXwFqm/Tj5Jmaq9T1yq8niCjQJPMyGxpcdj63zZeNUpyZMvaJLtY/9Phicysq2frP7XnqwzKqGnv/UYt2oqUSnBOM1XSWDKSL4mtMKyscwVfzyUj2CBZ5gfj+DCEw== 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=btDbJV2lG618+8M2ALGeqcSGW3Fho3uo0JhnmWzRs9I=; b=ruc5wOctYG3VCe07YJMtdJ9SJp+rGxOrnPFgzFxeD1fVqwH6F4Ps0Zxl2golhBYNTgYUe6aGHsqpkVmCZKzlppPpNHWaQdoecPqxq1/vQlC8IP5HOpLkgTzK19ybzEhdpwXUQMhHLBZbhpRyS6UVundm7leJ2Mdbb54McptlM6I= 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 DS0PR12MB8217.namprd12.prod.outlook.com (2603:10b6:8:f1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.35; Wed, 22 May 2024 10:20:08 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::ebfb:2f9f:f9ca:82cd]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::ebfb:2f9f:f9ca:82cd%5]) with mapi id 15.20.7611.016; Wed, 22 May 2024 10:20:08 +0000 Message-ID: Date: Wed, 22 May 2024 11:20:03 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] net/af_xdp: fix umem map size for zero copy To: =?UTF-8?Q?Morten_Br=C3=B8rup?= , "Du, Frank" , dev@dpdk.org, Andrew Rybchenko , "Burakov, Anatoly" Cc: "Loftus, Ciara" References: <20240426005128.148730-1-frank.du@intel.com> <20240511052618.1890677-1-frank.du@intel.com> <0d02e8c6-0ef4-44e3-9dd2-94685b46136a@amd.com> <98CBD80474FA8B44BF855DF32C47DC35E9F487@smartserver.smartshare.dk> Content-Language: en-US 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 aXQgPGZlcnJ1aC55aWdpdEBhbWQuY29tPsLBlwQTAQ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5g3qwV7i9VrseA8c4VIZewdIjkzAhmmbxl+8rM/LKBH dZUMTzME5PFCXJIZ83qkZQ795MTe2YScp9dIV7fsS5tpDwIs7BZNVM1l3NAdK+DLHqNxKuyO 8Zk= In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F487@smartserver.smartshare.dk> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: DU2PR04CA0016.eurprd04.prod.outlook.com (2603:10a6:10:3b::21) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|DS0PR12MB8217:EE_ X-MS-Office365-Filtering-Correlation-Id: 634e629e-eb86-4722-20e9-08dc7a48c165 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|1800799015|376005; X-Microsoft-Antispam-Message-Info: =?utf-8?B?emtld3BFdzBGZVk5WkN3Zi9jOGFTR0JVeGd5N1R3YjIwMzRWTkRsS25MUU8x?= =?utf-8?B?N3dFb05pUTJNcy8rbHprL1IxTzdaWTlnT0VDN2dDblBYMysxbWNMUk1WYU9n?= =?utf-8?B?QWZ2aUliczR1WGNJQ1h3a0lSRHVEcndaNmROY0l3dFFYbVQ0emZQd0c2dGd5?= =?utf-8?B?WGt3cFNGRVV5WkNGOTRVdk55Mk11dFVULzdZZVdaVitHQ012cDFPK0laRDFI?= =?utf-8?B?ZThkUkJTU0lJeWFnd2JPRk9vY2lFV2ZuMkNueEZrZG9MRUNkTWdUWTZMUnY0?= =?utf-8?B?Q2JZL1d0bHlpb2Z1SCt0cFFFZVBDYUlDQ3JYWWVhU2Q1RlNpaWlXOU5mN3JV?= =?utf-8?B?R01yV01GQmlFMnJUTUtOSVVxa0dmVVJ3WTdWYUw0ZmRsY3RKWml2S09OUUR6?= =?utf-8?B?K1FXWDdF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= =?utf-8?B?eU5TdDFwcTFaYi9YOHRJRzJnZmpFMTR0MGxMQm1oaHk0SlVVZmtaUGlTVjhX?= =?utf-8?B?YmFKZHA2ZzB0OGFvWFdQZlNqcGRWaW9HUU9GZmI2UENxZWxOM3Y0SGFTZGhs?= =?utf-8?B?aXdIT0hnTkx2UGhUd2dzZUV5WFJFRkdhVlY0MjdpdmpyR2Fwc2F2Vlg4SmpG?= =?utf-8?B?ZHptTnpsaGgzNUIwL2p2KzRraVJWRnA0R1d5VGF0Nm5GWVZGRGx0YXBzZ1ZZ?= =?utf-8?B?MWtaNlZqVVZTQWdCRTJoUktoLzVCeHdTczJkWGtDOFBTSndFS0czRVhORGth?= =?utf-8?Q?dZIvhSqn0s+4LjC6pR8qv8rnPugXmmXOm45roYKblE6g=3D?= 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)(366007)(1800799015)(376005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?QnZaRUpYdVVJajRrL3JtdVRmTU1lVTFaOEluMDQ1SUxEVVBBaHpMQzhVMXdo?= =?utf-8?B?NXlDUWRiL0VVNER6RXZiQllnTG4xdzU1T0xyRnE5WVMvc0Y0MllZSFlIQmRl?= =?utf-8?B?UFFGK01sU1RzRDJkUzdDb0w1UzVVZE5zbGNsZkQ4azZaaVowQkVJT3cvazJK?= =?utf-8?B?R0RPUnMwbGZhSUhXaVNuTVE3Wkx4RjRFNEtiZ3paQmc0d2I3SXdiZ2poRVZv?= =?utf-8?B?ZDVZVTlxQk1mUHJqa1N1dHRxeXBYUmNadHFjeXlDcDNDemJvTHFoYi9rcmZ0?= =?utf-8?B?MlVSS0dZeEJscTNjUTR2aHhrUkNHY1ZMYkxDam1qOFhqUXR6UTFwUH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t01hxB9oO?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 634e629e-eb86-4722-20e9-08dc7a48c165 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2024 10:20:08.2463 (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: D9ONlNAxZZQPlfjEpjoRnvFp0gMlvzqWAKfL5F4LhL02d/l4LuGjV7YbLWWg2eYS X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8217 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 5/22/2024 8:26 AM, Morten Brørup wrote: >> From: Du, Frank [mailto:frank.du@intel.com] >> Sent: Wednesday, 22 May 2024 03.25 >> >>> From: Ferruh Yigit >>> Sent: Wednesday, May 22, 2024 1:58 AM >>> >>> On 5/11/2024 6:26 AM, Frank Du wrote: >>>> The current calculation assumes that the mbufs are contiguous. >>>> However, this assumption is incorrect when the memory spans across a huge >>> page. >>>> Correct to directly read the size from the mempool memory chunks. >>>> >>>> Signed-off-by: Frank Du >>>> >>>> --- >>>> v2: >>>> * Add virtual contiguous detect for for multiple memhdrs. >>>> --- >>>> drivers/net/af_xdp/rte_eth_af_xdp.c | 34 >>>> ++++++++++++++++++++++++----- >>>> 1 file changed, 28 insertions(+), 6 deletions(-) >>>> >>>> diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c >>>> b/drivers/net/af_xdp/rte_eth_af_xdp.c >>>> index 268a130c49..7456108d6d 100644 >>>> --- a/drivers/net/af_xdp/rte_eth_af_xdp.c >>>> +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c >>>> @@ -1039,16 +1039,35 @@ eth_link_update(struct rte_eth_dev *dev >>>> __rte_unused, } >>>> >>>> #if defined(XDP_UMEM_UNALIGNED_CHUNK_FLAG) >>>> -static inline uintptr_t get_base_addr(struct rte_mempool *mp, >>>> uint64_t *align) >>>> +static inline uintptr_t get_memhdr_info(struct rte_mempool *mp, >>>> +uint64_t *align, size_t *len) >>>> { >>>> - struct rte_mempool_memhdr *memhdr; >>>> + struct rte_mempool_memhdr *memhdr, *next; >>>> uintptr_t memhdr_addr, aligned_addr; >>>> + size_t memhdr_len = 0; >>>> >>>> + /* get the mempool base addr and align */ >>>> memhdr = STAILQ_FIRST(&mp->mem_list); >>>> memhdr_addr = (uintptr_t)memhdr->addr; > > This is not a new bug; but if the mempool is not populated, memhdr is NULL here. > >>>> aligned_addr = memhdr_addr & ~(getpagesize() - 1); >>>> *align = memhdr_addr - aligned_addr; >>>> >>> >>> I am aware this is not part of this patch, but as note, can't we use >>> 'RTE_ALIGN_FLOOR' to calculate aligned address. >> >> Sure, will use RTE_ALIGN_FLOOR in next version. >> >>> >>> >>>> + memhdr_len += memhdr->len; >>>> + >>>> + /* check if virtual contiguous memory for multiple memhdrs */ >>>> + next = STAILQ_NEXT(memhdr, next); >>>> + while (next != NULL) { >>>> + if ((uintptr_t)next->addr != (uintptr_t)memhdr->addr + memhdr- >>>> len) { >>>> + AF_XDP_LOG(ERR, "memory chunks not virtual >>> contiguous, " >>>> + "next: %p, cur: %p(len: %" PRId64 >>> " )\n", >>>> + next->addr, memhdr->addr, memhdr- >>>> len); >>>> + return 0; >>>> + } >>>> >>> >>> Isn't there a mempool flag that can help us figure out mempool is not IOVA >>> contiguous? Isn't it sufficient on its own? >> >> Indeed, what we need to ascertain is whether it's contiguous in CPU virtual >> space, not IOVA. I haven't come across a flag specifically for CPU virtual >> contiguity. The major limitation in XDP is XSK UMEM only supports registering >> a single contiguous virtual memory area. > > I would assume that the EAL memory manager merges free memory into contiguous chunks whenever possible. > @Anatoly, please confirm? > > If my assumption is correct, it means that if mp->nb_mem_chunks != 1, then the mempool is not virtual contiguous. And if mp->nb_mem_chunks == 1, then it is; there is no need to iterate through the memhdr list. > >> >>> >>> >>>> + /* virtual contiguous */ >>>> + memhdr = next; >>>> + memhdr_len += memhdr->len; >>>> + next = STAILQ_NEXT(memhdr, next); >>>> + } >>>> >>>> + *len = memhdr_len; >>>> return aligned_addr; >>>> } >>>> >>> >>> This function goes too much details of the mempool object, and any change in >>> mempool details has potential to break this code. >>> >>> @Andrew, @Morten, do you think does it make sense to have >>> 'rte_mempool_info_get()' kind of function, that provides at least address >> and >>> length of the mempool, and used here? >>> >>> This helps to hide internal details and complexity of the mempool for users. > > I think all the relevant information is available as (public) fields directly in the rte_mempool. > I agree about hiding internal details. For discriminating between private and public information, I would prefer marking the "private" fields in the rte_mempool structure as such. > Marking fields 'private' may break some user code, so I don't know about this, although I agree better thing to do programmatically. But even required fields are public, having an _info() API may help abstracting the implementation details and kept it withing the library (instead of leaking to drivers like this). But not sure if there are other potential users of such an API. > Optimally we need an rte_mempool_create() flag, specifying that the mempool objects must be allocated as one chunk of memory with contiguous virtual addresses when populating the mempool. As discussed in another thread [1], the proposed pointer compression library would also benefit from such a mempool flag. > Ack, this also can be useful for this usecase. > [1] https://inbox.dpdk.org/dev/98CBD80474FA8B44BF855DF32C47DC35E9F45C@smartserver.smartshare.dk/ > >>> >>> >>>> >>>> @@ -1125,6 +1144,7 @@ xsk_umem_info *xdp_umem_configure(struct >>> pmd_internals *internals, >>>> void *base_addr = NULL; >>>> struct rte_mempool *mb_pool = rxq->mb_pool; >>>> uint64_t umem_size, align = 0; >>>> + size_t len = 0; >>>> >>>> if (internals->shared_umem) { >>>> if (get_shared_umem(rxq, internals->if_name, &umem) < 0) @@ >>>> -1156,10 +1176,12 @@ xsk_umem_info *xdp_umem_configure(struct >>> pmd_internals *internals, >>>> } >>>> >>>> umem->mb_pool = mb_pool; >>>> - base_addr = (void *)get_base_addr(mb_pool, &align); >>>> - umem_size = (uint64_t)mb_pool->populated_size * >>>> - (uint64_t)usr_config.frame_size + >>>> - align; >>>> + base_addr = (void *)get_memhdr_info(mb_pool, &align, &len); >>>> >>> >>> Is this calculation correct if mempool is not already aligned to page size? > > Please note: The mempool uses one memzone for the mempool structure itself. The objects in the mempool are stored in another memzone (or multiple other memzones, if necessary). I think you are talking about the alignment of the mempool object chunk, not of the mempool structure itself. > Yes, about the mempool object chunk.