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 23C0C4408F; Wed, 22 May 2024 12:00:47 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E8F1E402C8; Wed, 22 May 2024 12:00:46 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2089.outbound.protection.outlook.com [40.107.220.89]) by mails.dpdk.org (Postfix) with ESMTP id A929A4026B for ; Wed, 22 May 2024 12:00:44 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k2QeaTZ8CNjmNREdg8uPsbv5D8Qe57LFGHYUNt5fx7N94p3BynnEpe7CSWQrblKurAtYuviZ5Nv8NtVxe4mqQICFmLQwA2XFTJ8A3EcC4TE7m6bZ5PAB/9afH6Yr+4svGdjWnNAOdWyoKZuJR2dED0c13StkmM9rEl3D/oGs2L9XsxR4g+6BfKeQZihQOPKnzuVBXdaHboKlItO5q+RzseTgR9Z6QEgWLdhaPcadrScz19aeXwoD9ilj9dH23PDUZ1IdDs8Ohbh9dxHenu94REqMtgXc2u0BgnPwtTdNLaR14azWDYd+7CE1nduGEbW/QBtwRnaG990DacvfJu1GHw== 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=HjCYbL+shM+q9QDs3KMQoc+FT8bCk0kXvoqtc5aQh7U=; b=Zd4Z9XVIQ49+WHZyd5rEvRFJbCv2qhjkh4uKFf1iQa0trE0kxnP1UYhxC5bqao9j2JWA89anuTLl6aobUmv0nCTkrHHvtieRp47zQCNeJhG2TGLF0GS+CFh9Ru8bITV4Jegs9c2wFIfERmTHoApgRoKB6WNRt34BfDl+SEuNlxBhe4pXra38bzs7wR3KGxxnspmNrnx5LLIsy5G/1cklXHrtrj8EF7/GS5stc7ffxXvoSB6vdozrvRy+L5o3EnNQSuObo+0FU4vxm5FdamyRyKwHmGAXuTkBQH1e6uDOdbem3wI2p/9trSfrLHX2blHd9CTnyUWHNyKZ7lZQSVIZSg== 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=HjCYbL+shM+q9QDs3KMQoc+FT8bCk0kXvoqtc5aQh7U=; b=e0iGsVSwab3SrPNnkK27Vd2GV/5FuuPKSB/ZsyGixc6o+tJ67+b2+jnHCXmOAkeKEGpvJEskS78rpA6UqpkNw1/gh9axM9AstLGlTZjRc7ZtTswQP3qaFHaDs4BHz1IwRwIe1KogNsOUU3LgKUX/A+r6QYLftOs0hWec1p0V5co= 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 CH3PR12MB7737.namprd12.prod.outlook.com (2603:10b6:610:14d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.36; Wed, 22 May 2024 10:00:42 +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:00:41 +0000 Message-ID: <36e654fe-078e-4df3-bb2f-de3917da3e17@amd.com> Date: Wed, 22 May 2024 11:00:36 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] net/af_xdp: fix umem map size for zero copy To: "Du, Frank" , "dev@dpdk.org" , Andrew Rybchenko , =?UTF-8?Q?Morten_Br=C3=B8rup?= Cc: "Loftus, Ciara" , "Burakov, Anatoly" References: <20240426005128.148730-1-frank.du@intel.com> <20240511052618.1890677-1-frank.du@intel.com> <0d02e8c6-0ef4-44e3-9dd2-94685b46136a@amd.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 aXQgPGZlcnJ1aC55aWdpdEBhbWQuY29tPsLBlwQTAQgAQQIbAwUL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VrseA8c4VIZewdIjkzAhmmbxl+8rM/LKBH dZUMTzME5PFCXJIZ83qkZQ795MTe2YScp9dIV7fsS5tpDwIs7BZNVM1l3NAdK+DLHqNxKuyO 8Zk= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0142.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:193::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_|CH3PR12MB7737:EE_ X-MS-Office365-Filtering-Correlation-Id: b086b67e-4648-40fd-46bf-08dc7a460a15 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|1800799015|366007; X-Microsoft-Antispam-Message-Info: =?utf-8?B?VlJhUEdySWVRVHExNHVYSDJYaHpabnVra2tPTG5oRGlUVFNVYXpkd3hGSTAz?= =?utf-8?B?THVZRUpmNUJhQzY0UVpGSHhRUU9iVGR3MFIvcVY2VU50d3NZMkl4VEZPcFky?= =?utf-8?B?WDFtdzZDWU9hYmNIblFXeTg3Nis4b0krTTdjK0p5SG82UXM5RWtmdHFIZmt6?= =?utf-8?B?WGVpQ2FKZUZzZmFtN3pWdDVJU2pBSE1kMFBiVW91Z1Q2MTBWTC9hUDZ0WSt0?= =?utf-8?B?bStpbW1QSWtIYnRmR0R5RlduUzEvK2pvYkprSEUxdmxHWTJoc3NVNi9aNVRB?= =?utf-8?B?eUpPRXhDbU9tTVZpTUdGTG5ZT2ZyYWxmZ0h0ZS9TMTk5dmxLME1ySzh4Z1R0?= =?utf-8?B?R3NGcUZaTityMTFtUVZCNW5OS1lWTWJVSXFMeWg1azlNSi9wdm5TYW15eTRi?= =?utf-8?B?NDdmc3puZ1NvcEtOaXpDanIyeEsxWTVTc3hKTVhtc0pRTE9RNEU2R2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cVRPdG9IZUxNSkdsT3FZ?= =?utf-8?B?L09zQ080WWJKNFRob2FYR3RGU2xsSHhWMkpuVzVMZGVOMEtCdGUxdCtyS0Vp?= =?utf-8?B?eHRPb3FKVEZQemtzSEl3bjdab3hBcWZuUUtaeVN5L0IrQkVRbE1Mb2VPQVE5?= =?utf-8?B?WDVSbDBiSWR0eGQ1ZWlIRHphTFhnbi9FWUwvSzVlcG1FLy96c1ZZUnBIeGk0?= =?utf-8?B?cGM3clpTRlR3dmlJdkphdmJ0U2R4bjdmVHhYRGwwWHhJanlGM3F6RzhMQU1C?= =?utf-8?B?aVZISC9Qci9JYzE3YlZ5cEIxZWdsSlFhWWM1bGFwdGhwdmtPQWxudnJKUkxa?= =?utf-8?B?bXE5YUFxbDVuRld5Mm5kZzljRG5VdmVUNis3bDNMVThYTUphSGdkSDhnPT0=?= 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)(376005)(1800799015)(366007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?S1RSSG9pVmdmcVFCdW10WjFlTFFJYmdrdlpIS01haVh4ZWludDdCcFNnZW9F?= =?utf-8?B?NlpQWm9IVnR4bVJUYmZiazZyMk9IRitpT2sxY3hVVXNCYUFVck4yODIwYnM1?= =?utf-8?B?TmZLN1RpMEN0Q0duN2tremF1TUIzM3FPakJMUUdCSERmRkhSNG00WHlzZlJj?= =?utf-8?B?OUZOMUUwNTBwNVBWZUpFWUlYdE9mRUMzRDROaEV6VCt4Yi9wdDM5L0dqR1M0?= =?utf-8?B?NlloQ01pL2ZBTVlGSE9kVWREaEhURmJ1eDJaOEZ5THFZTHZ6c2MwbjhSeVFL?= =?utf-8?B?ZjJVd3NzeHhJS0p4UVhyc0lJYkYxRUF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Z2NEa1lYdDZ1WG9YWG1J?= =?utf-8?Q?H7sVgUEs2hnNlcynCMp32X4oI?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: b086b67e-4648-40fd-46bf-08dc7a460a15 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:00:41.7582 (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: 37GQe+ukRYyJy3fXXIn939YCLga3tFcufTZWAOywjMYhOFLU3VB8sgXcapypZywS X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7737 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 2:25 AM, Du, Frank wrote: >> -----Original Message----- >> From: Ferruh Yigit >> Sent: Wednesday, May 22, 2024 1:58 AM >> To: Du, Frank ; dev@dpdk.org; Andrew Rybchenko >> ; Morten Brørup >> >> Cc: Loftus, Ciara ; Burakov, Anatoly >> >> Subject: Re: [PATCH v2] net/af_xdp: fix umem map size for zero copy >> >> 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. > > 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. > 'RTE_MEMPOOL_F_NO_IOVA_CONTIG' is the flag I was looking for. This flag being *cleared* implies IOVA contiguous but not sure if it is guaranteed, need to check. And I may be wrong here, but as far as I remember in IOVA as VA mode, process virtual address and IOVA address are same, so IOVA contiguous is same as contiguous CPU virtual address. >> >> >>> + /* 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? > > Yes, since the XSK UMEM memory area requires page alignment. However, no need to worry; the memory pointer in the XSK TX/RX descriptor is obtained from the mbuf data area. We don’t have any chance to access the invalid range [0x000a1000: 0x000a1080] here. > Thanks for clarification.