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 877EB4408E; Tue, 21 May 2024 19:57:42 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 50C4C4028B; Tue, 21 May 2024 19:57:42 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2068.outbound.protection.outlook.com [40.107.243.68]) by mails.dpdk.org (Postfix) with ESMTP id 559274025C for ; Tue, 21 May 2024 19:57:41 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KMcT/bDTZsj7iCWuEf3ZXHmEdp6QD0n05u31gZFENdFwqszonraAWF+Qjo/R0dzAJMBrYfemc/Yw06ZzSwSoPDCBnzy7BG5ENyVq57MGszzfFV8/5yOCzoFW0lF/TJVAEKvzA46pCoIhxzs9oRMxVN5lNNwSoYXDg57miEC90CapFVXAnk8SJ1CeBL7EsN/5ZUF8pdNw5Z3zP9PnggtGGy+WKafKwx7PlZkdY9q3dkYIIQi5srzmw2MRhAfUlpukhqkwUh4NrkjxKUM4y52beS6ZN/QF/uvdtHvsyf2oQ0gFWL3AiWQRVBMMt9fk/nJX6b5Xk5vzfzzGDRkO6HrZqQ== 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=XxTuUNmhCP2q1JANBTqfl8pMSYK5791ae7Nx3IvoFrM=; b=cEvy7MrsA7Wd/NLJ14OR/gFEAU7hEK7V+xoHfknN6G6VzstP65IrrARPOXZKykhDwOLJmYU7JvAHtU4iTMvT9PnMKdIXf9jFbfMS8BcLJw4UBVX5ZT8d33T8DywZcclVGTB1rNkQrdaLCZ+pLQCG6lFfolCYr1+kkFqMW4BLOVt+7jvHVhkNzxBCWVlJq68Wchaae+2zjcEd6kmXvVX5gT1f9ECxudidz4zom152MzMUYJ9Bf5hwxp1O6tb42DIkKyGSnFaZ42DnzzRQdiIeRob+0UJ3BpfE7erNiGqpJjpFbv0HnhdFJRuh3123rR5qJJ3WRbcesc3KrWWQzEfo3Q== 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=XxTuUNmhCP2q1JANBTqfl8pMSYK5791ae7Nx3IvoFrM=; b=wj0bKwmKIVVPSOjmtCPjGbrz0F5gN3fVSZhU5BiPggaBNqxZEF1PhYk+rTgT6O/ciDiNFQrHRTQlZ1bpQ7cP1Eyti9vpZXUjnkJa7rATefKmle3Ul1ZlhySLkv85bRDQTredZYhDMymYgxLLl23w6zvXQiQ6Bts1JWvBZDA1lHI= 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 DM4PR12MB6134.namprd12.prod.outlook.com (2603:10b6:8:ad::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.35; Tue, 21 May 2024 17:57:39 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::282f:29d3:cac1:cde3]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::282f:29d3:cac1:cde3%7]) with mapi id 15.20.7587.035; Tue, 21 May 2024 17:57:38 +0000 Message-ID: <0d02e8c6-0ef4-44e3-9dd2-94685b46136a@amd.com> Date: Tue, 21 May 2024 18:57:34 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] net/af_xdp: fix umem map size for zero copy To: Frank Du , dev@dpdk.org, Andrew Rybchenko , =?UTF-8?Q?Morten_Br=C3=B8rup?= Cc: ciara.loftus@intel.com, "Burakov, Anatoly" References: <20240426005128.148730-1-frank.du@intel.com> <20240511052618.1890677-1-frank.du@intel.com> 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 AQIeAQIXgAI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KBH dZUMTzME5PFCXJIZ83qkZQ795MTe2YScp9dIV7fsS5tpDwIs7BZNVM1l3NAdK+DLHqNxKuyO 8Zk= In-Reply-To: <20240511052618.1890677-1-frank.du@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P265CA0048.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2ac::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_|DM4PR12MB6134:EE_ X-MS-Office365-Filtering-Correlation-Id: 9278b9b3-051e-4e6e-91d2-08dc79bf80ae 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?MndBTGM4TlpjdjBPUGd2YUlCdzdQMkxseFZSQnM0TmFJV1RnbWZFeTYzZzc4?= =?utf-8?B?cVhkbFZvSGlFTFBvTURyNTR1b3Z6aDdjNjNrTjEyWTRYRzFJVEtMNVBVeVdV?= =?utf-8?B?eWVFNXRicHhyQWJDTG80Q1I5ejNzdlBkazduR3FpOTFCMmwzU2pOcmppM2JD?= =?utf-8?B?SXBFc1VFNVJvMnhiNHJ5cE5CRmo1SXZhWU9zVXlrZ1FFYTFhM1VuUDJhdmhG?= =?utf-8?B?c1l4VWNsYjFPL2hnVTFEZ3h3a2haZ1ZnZms1Um4va2lZZ1VMazNBa1c5dUF1?= =?utf-8?B?UmxZZGNmOE9GalFzaEdIVG4wa1ltTGM5SmRVdkpZeGhRZ1I2NXhWeW9FalpO?= =?utf-8?B?dnI0NEF2bWF5SFA1NEIrT1Q5cVB6VTZhOEVjc0l1b1llTWxGbjc5S0UrOEFU?= =?utf-8?B?dXoyMnhydWNiV1RrVEZnNm5nc291dUl0czZLZHlBYWxyR3c4STllN2l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NQVHdHcnlKbGFzV0hDS3Bt?= =?utf-8?B?ckRjMVJyS3ZIdmtqaVljOTBtWnp0L3VvczdPN2ovRjNzbDdDa0E1Q0Y4Sm5I?= =?utf-8?B?UFN6U2FJblR5QWhXMmRlcjJKcUs4SHJTR3ROUkdEalBoT2VpSFA5MzlybU5Z?= =?utf-8?B?a1RMdXlvak1WUDM2YXlFUlJPN1lkZ3U4Z3pSNVBwR0NSNmp3S25IcytsME1k?= =?utf-8?B?QkZydThEUjZPS05wQ0tIY0pTM2d3cjdoWXhxcU1TZUJPS2Y2T2Z5czA1ZUgw?= =?utf-8?B?a3lNUXhMMWt1cWl2aEQyaHl1aEd2bTM0dlZjb09iS1d6bXVORWM2V2dnYTRz?= =?utf-8?B?QXNPL25KNVFET3lvSXJxeXdGeFBaSEF3T0w1dWwySTlyRTdZSjZTa0pRPT0=?= 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?U29YQXE5SGY3OGtwUElwSm1DMmdZVUdGQVp4Y1M4Z25nRW03MDdJOWVPRU9H?= =?utf-8?B?d3dBRENDbmV3UWlab0IwZXVsRjFlK1VXN0ZSRk5FYmd6Zm9UMWpGT29YaW81?= =?utf-8?B?TXlpa3pXOW12RkpZSS9HSXNHVTZIdzM2RUczZG9YcnNDV0VWTjM5VmRtREhC?= =?utf-8?B?QkRwa1NyeXF2NDNUSW9pNHBSTm92Q056WHRHbDFjSFJzUjVEMHFGL0dQNlJF?= =?utf-8?B?YVBTQmtJSHZGUzdvRlkzSzRIMXVVTE8wVmpBM1VQdjgzWitibFVDb1VDUkhh?= =?utf-8?B?MUpYOEhmYzZ1TXJvSnZpUGFYS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?= =?utf-8?Q?wYKxJlQKcEkFA6CmlNveswQVo?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9278b9b3-051e-4e6e-91d2-08dc79bf80ae X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2024 17:57:38.7304 (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: Ytb/LsBIPE1xgnRd62+9m/MRX9/2r9xuqkq2w6sYFKU06PXXbUW9duQ6MVhNW4db X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6134 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/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; > 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. > + 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? > + /* 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. > > @@ -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? Like in an example page size is '0x1000', and "memhdr_addr = 0x000a1080" returned aligned address is '0x000a1000', "base_addr = 0x000a1000" Any access between '0x000a1000' & '0x000a1080' is invalid. Is this expected? > + if (!base_addr) { > + AF_XDP_LOG(ERR, "Failed to parse memhdr info from pool\n"); > Log message is not accurate, it is not parsing memhdr info failed, but mempool was not satisfying expectation. > + goto err; > + } > + umem_size = (uint64_t)len + align; > > ret = xsk_umem__create(&umem->umem, base_addr, umem_size, > &rxq->fq, &rxq->cq, &usr_config);