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 E2061440A6; Thu, 23 May 2024 15:31:41 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 70B68402B3; Thu, 23 May 2024 15:31:41 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2089.outbound.protection.outlook.com [40.107.94.89]) by mails.dpdk.org (Postfix) with ESMTP id 8BAAE4026C for ; Thu, 23 May 2024 15:31:39 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YhiWILIbp2h9of8Dw53Z9NXutrk11EbTNoaV/B3ztKhExdF2f09yKjZ1D1UFnePi43V8BHS+pAZirluq9GpEZbgTBbG40+d6PvX4f7yWUdHarVS2pNPMKRnQPWwz0uudsesxZeRdxzg5GezbxRQTzMHIpAsPGESCeLog8XygoAe3Zb1UihvsjN9vV0EI3TIzDkLzAGRBp8Mj5rQ3/6mHd5Of/mC21S7MOoucgZoX3sw5/KnYEMHz7vQ9p/bN4jZ470M7SeJs+E0/oHM34DyWIMhEIYgcUgdlp152kP69Qmodl/tnUPVfLQEYhW+ctz05Cf/qoah0S18Ne8LdWYknAg== 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=Uq4QC39XUR924uZOs5GZG/knuV9bPWw2QmrIDbePpoU=; b=iUlDOiNt2HjQismVLaJC1QVm9Zxx5BG/d1bo/MleyvNi3tpDoYTDeQ2XC4TYgfgLNe8JjLCKulVeWmz0P0dtOToUl/TT4FM1l44BKxX8h3NBpiK4/9bgOY+pYOQrYDYfWmOkvLCY7SZIuKaM/NzuoS9+tNHnZtVEbrRQkI+qls2+cNw+Aqcf3c+UxVajItqcniInQGlTuftFvU4yBCz1Rbc06rAzOLHHyZDkjcRiVi8mBzTcgw+gtV0cxuU7q+MrfsDdfJ9Rka22ICw2bTLfa/tge4LzWuv5siYo7FidvHeTyHjEPgjJT67Pr3gYW4fnUg4zr/d/vWCYWU/EZi+s4A== 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=Uq4QC39XUR924uZOs5GZG/knuV9bPWw2QmrIDbePpoU=; b=GHdfljfx5rOU+/Q/sBa4LP9PoE2/gIA/Zmxautulw+TJx3vBjqluFXeouuFRL0KCXx7JjUOv0LFA/GZF8TdhvZOhXOw0UZdE63Pwgb3B9wdDZcGJrbcG9LxOZTOU8cSajpQOg2KengT2ICRqZ6YYO8vSTztmVeNWbyPC2IliTdc= 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 LV2PR12MB5917.namprd12.prod.outlook.com (2603:10b6:408:175::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.21; Thu, 23 May 2024 13:31:36 +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; Thu, 23 May 2024 13:31:36 +0000 Message-ID: Date: Thu, 23 May 2024 14:31:31 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4] net/af_xdp: fix umem map size for zero copy To: =?UTF-8?Q?Morten_Br=C3=B8rup?= , Frank Du , dev@dpdk.org Cc: ciara.loftus@intel.com References: <20240426005128.148730-1-frank.du@intel.com> <20240523080751.2347970-1-frank.du@intel.com> <98CBD80474FA8B44BF855DF32C47DC35E9F492@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 aXQgPGZlcnJ1aC55aWdpdEBhbWQuY29tPsLBlwQTAQgAQQIbAwULCQgHAgYVCgkICwIEFgID AQIeAQIXgAIZARYhBEm7aYjps5XGsPHCElRTPtCK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MTe2YScp9dIV7fsS5tpDwIs7BZNVM1l3NAdK+DLHqNxKuyO 8Zk= In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F492@smartserver.smartshare.dk> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0363.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18e::8) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|LV2PR12MB5917:EE_ X-MS-Office365-Filtering-Correlation-Id: 418388e4-6961-4bf3-7ec7-08dc7b2cab1b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|366007|376005; X-Microsoft-Antispam-Message-Info: =?utf-8?B?T2RueitVa1A2RkVxcG1VU2huazBGTUZqanNET0RTOEk5N00rbzNKOWlZMlRU?= =?utf-8?B?YnBHWHRWdk00OUY1K0g4RjJoYmdRczJRYVlBSkZmUmVOUWZpSmJtZHVRYjNY?= =?utf-8?B?MmZDZ2pkZS9BTVdPQkVXUGN5dC8wdFprOHNHUW5YanlycHNPOTBXaHJLcE5T?= =?utf-8?B?VFJNVTVmMlhIWXNQSW1LSjFmemFaVTZybURzbWdEeFlaQ3Fkam5SS01yeXY3?= =?utf-8?B?eThycGZ1cVNWY09DY3BZdmxUNXhMVnhhVXpmajJOV09UbGhPYWRyZitDenBJ?= =?utf-8?B?REJDZG0wMmNYWlZ0eUh6S3g4UmlqWXpsOFF4V20yTVowd2NpbS81bDFRa2Nt?= =?utf-8?B?L3k1Y1FiZ1BzamdTaTlnblN2c3lwSkh2Ynk4am9oblJRNXRNdnlNQVZXc05V?= =?utf-8?B?RXRPRlRpNmh5MUc3OGJpbXg5cDA4ZTRHZHI4RktBdmNrTWh2RHkvYUZKWTBX?= =?utf-8?B?RjhDV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= =?utf-8?B?QnNGbkpCbmR1ZTZXK0FKbzh3V2IzamtORU92Z2FpN2tBVkRmZmVtd2o3bXYy?= =?utf-8?B?cDZ2dmFBZVRsVHlwSU5SNEl2c1lYQ1BRVWs4QjdpSUF5Zlh5TVQ0c2pYejBD?= =?utf-8?B?bGRQaG5vL3hlVmMwUndVT21McHBFK25xdXRKM1lEVlYwUkw5citCYkQ5ODhp?= =?utf-8?B?NnNXSjBpSENyNWxiTkZERVIxZlFMdmcyeGhlb3ZjdDJnT1N0dnVzek1iRDRZ?= =?utf-8?B?Q1BuRVpod2RJMlBHMUFZVmxGaEZ4b3AxL09iSkRJQ2ZFSU55N1FDQjZPalZI?= =?utf-8?B?WEJ5bzNId1NKZHEvN2xXZmxxK0srMUlxQkQ5SUVOMHBqajkxa1pucllRPT0=?= 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)(1800799015)(366007)(376005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?bXc1SlZpeS85UW4ra0w3L3d3T3Q1U0VDdHNYZlpqb0x6OElGSlpyZ2UrZU81?= =?utf-8?B?L1pyamN1Y3U5UzVzWEsyTmhHVEhzU1JYM0NFQk1RR2NpNGorNzNHSk03MzFD?= =?utf-8?B?KzVQMUV6QzhBSnlXOUp5dzk5cllzeWRRbVhZY1N0RmF5QmxOdjlUcUlrQ1JD?= =?utf-8?B?VWU0Ymh5Yk12REJocVhRMUUwL0tMOHVXZXlVSkpPa0R0ZGNYQi8vQ1hHQ29V?= =?utf-8?B?a20wQWN3aHN3alBoYWxSQkIvL2FFUjVyZEtYSUlOTHZKbTBHMWw2WjNBOHBK?= =?utf-8?B?c0dDaGMyRVUrZVkxNllieXlEZFF4a3d6UUJQZGFnNmVyc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tEeBUrmCocuFsAdfiPS8?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 418388e4-6961-4bf3-7ec7-08dc7b2cab1b X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2024 13:31:36.0368 (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: q4pZZ0rmPfDF8vI4byN1sf+ypK4yhsf2Bw2UlyBXKpr7SidwwYOpE45+LsyHzuEx X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5917 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/23/2024 10:22 AM, Morten Brørup wrote: >> From: Frank Du [mailto:frank.du@intel.com] >> Sent: Thursday, 23 May 2024 10.08 >> >> The current calculation assumes that the mbufs are contiguous. However, >> this assumption is incorrect when the mbuf memory spans across huge page. >> To ensure that each mbuf resides exclusively within a single page, there >> are deliberate spacing gaps when allocating mbufs across the boundaries. > > A agree that this patch is an improvement of what existed previously. > But I still don't understand the patch description. To me, it looks like the patch adds a missing check for contiguous memory, and the patch itself has nothing to do with huge pages. Anyway, if the maintainer agrees with the description, I don't mind not grasping it. ;-) > > However, while trying to understand what is happening, I think I found one more (already existing) bug. > I will show through an example inline below. > >> >> Correct to directly read the size from the mempool memory chunk. >> >> Fixes: d8a210774e1d ("net/af_xdp: support unaligned umem chunks") >> Cc: stable@dpdk.org >> >> Signed-off-by: Frank Du >> >> --- >> v2: >> * Add virtual contiguous detect for for multiple memhdrs >> v3: >> * Use RTE_ALIGN_FLOOR to get the aligned addr >> * Add check on the first memhdr of memory chunks >> v4: >> * Replace the iterating with simple nb_mem_chunks check >> --- >> drivers/net/af_xdp/rte_eth_af_xdp.c | 33 +++++++++++++++++++++++------ >> 1 file changed, 26 insertions(+), 7 deletions(-) >> >> diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c >> b/drivers/net/af_xdp/rte_eth_af_xdp.c >> index 6ba455bb9b..d0431ec089 100644 >> --- a/drivers/net/af_xdp/rte_eth_af_xdp.c >> +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c >> @@ -1040,16 +1040,32 @@ 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(const struct rte_mempool *mp, uint64_t *align, size_t *len) >> { >> struct rte_mempool_memhdr *memhdr; >> uintptr_t memhdr_addr, aligned_addr; >> >> + if (mp->nb_mem_chunks != 1) { >> + /* >> + * The mempool with multiple chunks is not virtual contiguous but >> + * xsk umem only support single virtual region mapping. >> + */ >> + AF_XDP_LOG(ERR, "The mempool contain multiple %u memory >> chunks\n", >> + mp->nb_mem_chunks); >> + return 0; >> + } >> + >> + /* Get the mempool base addr and align from the header now */ >> memhdr = STAILQ_FIRST(&mp->mem_list); >> + if (!memhdr) { >> + AF_XDP_LOG(ERR, "The mempool is not populated\n"); >> + return 0; >> + } >> memhdr_addr = (uintptr_t)memhdr->addr; >> - aligned_addr = memhdr_addr & ~(getpagesize() - 1); >> + aligned_addr = RTE_ALIGN_FLOOR(memhdr_addr, getpagesize()); >> *align = memhdr_addr - aligned_addr; >> - >> + *len = memhdr->len; >> return aligned_addr; > > On x86_64, the page size is 4 KB = 0x1000. > > Let's look at an example where memhdr->addr is not aligned to the page size: > > In the example, > memhdr->addr is 0x700100, and > memhdr->len is 0x20000. > > Then > aligned_addr becomes 0x700000, > *align becomes 0x100, and > *len becomes 0x20000. > >> } >> >> @@ -1126,6 +1142,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) >> @@ -1157,10 +1174,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); >> + if (!base_addr) { >> + AF_XDP_LOG(ERR, "The memory pool can't be mapped as >> umem\n"); >> + goto err; >> + } >> + umem_size = (uint64_t)len + align; > > Here, umem_size becomes 0x20100. > >> >> ret = xsk_umem__create(&umem->umem, base_addr, umem_size, >> &rxq->fq, &rxq->cq, &usr_config); > > Here, xsk_umem__create() is called with the base_address (0x700000) preceding the address of the memory chunk (0x700100). > It looks like a bug, causing a buffer underrun. I.e. will it access memory starting at base_address? > I already asked for this on v2, Frank mentioned that area is not accessed and having gap is safe. > If I'm correct, the code should probably do this for alignment instead: > > aligned_addr = RTE_ALIGN_CEIL(memhdr_addr, getpagesize()); > *align = aligned_addr - memhdr_addr; > umem_size = (uint64_t)len - align; > > > Disclaimer: I don't know much about the AF_XDP implementation, so maybe I just don't understand what is going on. > >> -- >> 2.34.1 >