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 6DF5343A0A; Tue, 30 Jan 2024 11:19:40 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E1F7E402CE; Tue, 30 Jan 2024 11:19:39 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2041.outbound.protection.outlook.com [40.107.237.41]) by mails.dpdk.org (Postfix) with ESMTP id C48D7402AC for ; Tue, 30 Jan 2024 11:19:38 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EczEOljr9RinslRYh/+SzNiQXEynnOd3gt6uRRaB7XEEvENiQhRm2oAIdsUZN1HHIDr6RcQWFZAbd8xcOO9en9d4nNpI7d5KLuW9gMDIGnp624eyZ2fYPRxqPTXQfJVcYrxeRFMKWpOkNsGyZqQ0tUKeE6iu6qaY3LDBk+i4rX+kxvLVYtTE86+++ZJyrtMeRp08ZUXKJG18MTsGbNDKX9f2zJrggMTUxomF+mgKCCN9XV618EZw11u8kSM81z5a/GC2AE6kY3i1ZROhuJ698P02NdvBvwVQtz1/u075EwkxGONSHelPdKh+vsMlXDCdNFu6hkYZ5KM3SvAe413a4w== 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=kdh+JcvsHe+pgO9DPACeRrFcBYlzTs1ynvS3wU92Tw4=; b=k6qyXPBkHOm2XKNBC5SuZ/8TN/Lh+6fCopGjUlPBLoHULHIu07PMzGC0CN+WKkb0yr7D82+ECGuOE23j+WASj0ewDWiIcW7hSWzsmSevvH/XJYe82ExLpjEeitmpj2Gw2HWxU7bYSDBkYfK4iuxsuX/zvIK/117yGZrwNL5O618SC/ErKr7GOwprGN7iipqvLdOTITPOBbO1hTk3Na6FolqA7PhN+tW3muGFaNsLU5UaI/Su4AChsP03pH8tHyO7qOy8Y5yl+m6NyzPXgkFZ1RmnjQevkrUeNq8i7KOiM0/WzcWhvsRFvGpIDyD6K2cRoe1qjYzEFZjxMXGxl/ms6w== 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=kdh+JcvsHe+pgO9DPACeRrFcBYlzTs1ynvS3wU92Tw4=; b=se2sja0VGRov4OLea/ZjttZwuEDzam2Aw8KI3GTeJwEmdCm0yxh+q8Eb/TpSMz/NY8C0Ri6YhTzGdeX2bNawoEr8jWGKMFu5mGiUg4aWmR0Hw57DperYMbP5RrNmm8DoDMnrPZ7ZLvMHM+zpX2tzKUGXIKRs1iaj/uc++FItFrg= 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 CH3PR12MB7594.namprd12.prod.outlook.com (2603:10b6:610:140::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.32; Tue, 30 Jan 2024 10:19:36 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::815a:45e6:cf5e:479f]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::815a:45e6:cf5e:479f%4]) with mapi id 15.20.7228.029; Tue, 30 Jan 2024 10:19:36 +0000 Message-ID: Date: Tue, 30 Jan 2024 10:19:32 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [Patch v2] net/mana: use rte_pktmbuf_alloc_bulk for allocating RX WQEs Content-Language: en-US To: longli@microsoft.com, Andrew Rybchenko Cc: dev@dpdk.org References: <1706150562-23248-1-git-send-email-longli@linuxonhyperv.com> <1706577181-27842-1-git-send-email-longli@linuxonhyperv.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/6BQJkdyEEBQkE3meNAAoJEFRTPt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l3NAdK+DLHqNxKuyO 8Zk= In-Reply-To: <1706577181-27842-1-git-send-email-longli@linuxonhyperv.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR0P281CA0253.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:af::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_|CH3PR12MB7594:EE_ X-MS-Office365-Filtering-Correlation-Id: c0223d62-5ede-497f-9ecc-08dc217cf5e7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nZLGJKaHld+E0ok6A+q7a90VGK+1EDEN+lAzlquKYw9/8NbhZEhwbxFe6+50csArI0heZitULsG365DdnVj24KolY50bHcKMAje+9kkzn12OuYZkd1cbyLZZo2kb0Hr6mt6G2+1zsyGyWyCSMw53SmHAABdMzqGvi0jygNTcBqnjIcSWvROWqdfNfC+d3mu7BucyQrYvmFSV5fV0OgT3EdFttq7IIhUgL9ZhPXBtc+iAIMVDzAjqpjDm3h4aY2sOCuv+JLbnTAUv6MWx8UwXRl1niTQ9PYRZNLqfJwrLtWHA13EuloR5p4AHX3X3rOJBhB9ivk2J0AVXtb+X1/RcutIGLNbb817DzESPndGGaCMfq8KsTWj9XYyA5KtGcW3lvnrY3CoiF0yS/+nbOCS1+R8iSsZwaj/t1bUeMSIsY4ZR/X7UO2T1/DbtCPndmgfUoKqEVJLGQ/RH5p3f/lVCX3oBibbLbTEiddXfLA3M54QxBvW9TQ1xr9WgUCKtcKSORmIsan1rqEWDenfmsITxEl6xCSvRpboB7hWtvZiggM5jF19SzQjHEVXHzvKDAbuZotwwxf1l11Ya1ZSbrnd3tYdiACxegMyLeerazq02qRBi7j1NvjRlULw/RFcSEjWIqIUMSpPugTJ5qxy2ZM3FFg== 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)(136003)(376002)(39860400002)(366004)(396003)(346002)(230922051799003)(1800799012)(186009)(64100799003)(451199024)(316002)(83380400001)(6916009)(31696002)(66556008)(86362001)(66476007)(66946007)(53546011)(6486002)(478600001)(6666004)(31686004)(38100700002)(2616005)(45080400002)(26005)(8676002)(6512007)(8936002)(6506007)(4326008)(44832011)(5660300002)(2906002)(41300700001)(36756003)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RXNJV2ZiOWNJNFI3aExIay9lT1FQM1lWTTBmZFFldkFjUnJaODZZT0dMMVhy?= =?utf-8?B?SUlCQmk1eUhXdjgzeVR1eFhMSTNTUG90L2I5RDNoV0JXdVl5Wmx2dkpaaDBp?= =?utf-8?B?Y2RUMWRIcjBlNWNzQ1dsTFYzOGQ4VWVPU3hQN3NaK1I4RCtxUkozaGZlSzBS?= =?utf-8?B?bjlleTBhOG1mUWd4K3hjOWFLUUNyZzllYVpPY3N3VTJQN0xjclpWK29SRXZn?= =?utf-8?B?ZmE0dFo1b052MUhnNmRiRHRjRWFtYlUwcHBBdDdNNWkrWlJrcENDTVd6c2l5?= =?utf-8?B?a2tpeEJQcVhndDUvMEtReDM5RXpJODFWRWF1QURzMXVSekI0VjlyclZvOVha?= =?utf-8?B?OUV0aHF4TUVSTWhSQVM1VVdzdkVJQWFJaHZ5ckx0NXRyZkhaVFhkTVU3djVS?= =?utf-8?B?aUI5SmZKbGMvbVRvaTlpWGRwYkZFNmc3ZEZZQ2FYVHBlRmE4eTNmUCtDZ3N2?= =?utf-8?B?SU9WUVRxTkY4Tmp6cENwckl2S203MUIyK0JOMCtjT1Z2OVlpeVFqUlpCMXB4?= =?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M2dmbXJMWUtxNDdPNXBu?= =?utf-8?B?bWQybVRtMjUrK3g2V25Kd0d2dUdOQWMvcExJcnptSElOL3k2clRhLzdlRE4r?= =?utf-8?B?L3gvOWhWVldVVEF1dkNscmFFM05iT1F6eklzT1drZERPTnFmYlZTVkc4WFhE?= =?utf-8?B?ckpBQWMvSkRhKzFsVzQ2aXhXMzMzdlRMa09zWDFNQ1RaZEc1RGpYdGtRVWNt?= =?utf-8?B?TEZ0bzY1bG1OZFFkemEyaVFJTWJSZWYwSW9KMkJkZkc1MXFwK01hQndLdnNU?= =?utf-8?B?NVRxUEhkcTV5T1hqZ1k3MmQyVk90ZGk5bldsYis0b0RsN0xVbGIyRFRaYjFP?= =?utf-8?B?RzhUYjlkYVBibTBzZ1ZodDZRU1Nhd0M1WnVBTkhDWXFKL3FNb05FYVFXeWgy?= =?utf-8?B?VUJyeHJhMFprRDYvTFhzNnVkbmx6YlJTY2d4dEdaT2pmdDJFMGt1TTZ0SEpI?= =?utf-8?B?UFFBc21Wem9XYk9kdHRJWVZTRU5CU0lnZ2xVS3hldm9QbGZJUTRkVmpOMmRh?= =?utf-8?B?dHQvK2xUYTZUcm5QMHJQeThnSnNyYVNHTWpqVHArTm55MjJDbCtNemZOUkNn?= =?utf-8?B?eENmVjlNSDUzd0RRbXVwbTFaZGpMOEZkQUNkRm5GSm9IN21aUUpHVzJrK21R?= =?utf-8?B?Q1cxcndmN2NFbzVFT1hZNGhYWXV6NFdTUytzL3pVaEowdk10ZVVwSXZzYW85?= =?utf-8?Q?l58tXhGW0EBzeWmUnC/raFEl9?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: c0223d62-5ede-497f-9ecc-08dc217cf5e7 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2024 10:19:36.7132 (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: NGRf2dRL7tS8ycy/hnhBD4YXReZZbA4PGBifxrQuw20cWAF18D4shamUdJwsJn3I X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7594 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 1/30/2024 1:13 AM, longli@linuxonhyperv.com wrote: > From: Long Li > > Instead of allocating mbufs one by one during RX, use rte_pktmbuf_alloc_bulk() > to allocate them in a batch. > > Signed-off-by: Long Li > Can you please quantify the performance improvement (as percentage), this clarifies the impact of the modification. <...> > @@ -121,19 +115,32 @@ mana_alloc_and_post_rx_wqe(struct mana_rxq *rxq) > * Post work requests for a Rx queue. > */ > static int > -mana_alloc_and_post_rx_wqes(struct mana_rxq *rxq) > +mana_alloc_and_post_rx_wqes(struct mana_rxq *rxq, uint32_t count) > { > int ret; > uint32_t i; > + struct rte_mbuf **mbufs; > + > + mbufs = rte_calloc_socket("mana_rx_mbufs", count, sizeof(struct rte_mbuf *), > + 0, rxq->mp->socket_id); > + if (!mbufs) > + return -ENOMEM; > 'mbufs' is temporarily storage for allocated mbuf pointers, why not allocate if from stack instead, can be faster and easier to manage: "struct rte_mbuf *mbufs[count]" > + > + ret = rte_pktmbuf_alloc_bulk(rxq->mp, mbufs, count); > + if (ret) { > + DP_LOG(ERR, "failed to allocate mbufs for RX"); > + rxq->stats.nombuf += count; > + goto fail; > + } > > #ifdef RTE_ARCH_32 > rxq->wqe_cnt_to_short_db = 0; > #endif > - for (i = 0; i < rxq->num_desc; i++) { > - ret = mana_alloc_and_post_rx_wqe(rxq); > + for (i = 0; i < count; i++) { > + ret = mana_post_rx_wqe(rxq, mbufs[i]); > if (ret) { > DP_LOG(ERR, "failed to post RX ret = %d", ret); > - return ret; > + goto fail; > This may leak memory. There are allocated mbufs, if exit from loop here and free 'mubfs' variable, how remaining mubfs will be freed?