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 36AD343A12; Tue, 30 Jan 2024 23:34:14 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0EE15402CE; Tue, 30 Jan 2024 23:34:14 +0100 (CET) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2054.outbound.protection.outlook.com [40.107.95.54]) by mails.dpdk.org (Postfix) with ESMTP id BAC68402CD for ; Tue, 30 Jan 2024 23:34:12 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T2n4byTXhImLVWth4jN35RUTzXjQ8Y4bMv7QiCLnmz5UuJsWXyUIG3zcnP5xPcqNVXHonauYhLy43UWZyuYfLXGvVoRkkx9REzAi5yGt5ABw8Fq9mYCcWxCNtNFVHtt8bPBcRNbLRWfFeH7+TvpbrG4RjZLefzj+ACiaVculWIm51adLo+BOqiRMeMR5toCKqV3DTUSY7LJCO7BeRxOna3qGm9/OiJ0fYuFifDG3TI9oo6dz6enCZuUA6sx0cEhGwOoOIYri3hZ9jLEcn3V7VLKe+3YiBBtMCtA6BP8Kr+nveaMUI6x3x9Nzeydq20W4Xz7nrqoMho9RTP8R4kmojQ== 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=WsHgUfdhH6a4xExsPJSEYqLup4VJGHvmVnbuQlnEym0=; b=Yby4e+/pLs7WXQqzNgKRkxTpIPrF1dEWoMUc+jU9UEckLNy+0vwWz6ltbvs3HYffF7cYkJG6tnOmeNBQ+0ldxWbxZ2gaNS4RU+YJwWzQTuHOnIO/2+782KGT46sWgSCroHCrmvLfXtO7/hIMJQbMun9spWyCNemaatS4vl5Sod567jX/jHahazp1/ZX420GCSeL2nEnqgY1BGw6TShbVsviLT4TeKCphzeEfnmugKWJdOSd088v5ftNUuOEe9HwGIJ9jrxqkA7hDTpQ7WQHGoS5cszsZzKhWo3em4VHRHKkF/yVGkY1hJAzAfEdR8lcJTQb3uhnqolLFRjLTs/7MWA== 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=WsHgUfdhH6a4xExsPJSEYqLup4VJGHvmVnbuQlnEym0=; b=xWiJ/fMMdmLNzSuhGShPNFN3wZZZz1LTjV1fWLYlSFOZMeaP4rWMmYo5utJcqBT0w/vFeWoc0LafKXE3GzkH1BpbxMstteTFMwY9lNdXtl14U74q5CaH5mZkLXwsf05FphLOF79Y5/Yx2jmiNEjn5xmFMDUK7Z/cEur9+omaEmU= 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 BN9PR12MB5307.namprd12.prod.outlook.com (2603:10b6:408:104::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.34; Tue, 30 Jan 2024 22:34:10 +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 22:34:10 +0000 Message-ID: Date: Tue, 30 Jan 2024 22:34:06 +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: Long Li , 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/6BQJkdyEEBQkE3meNAAoJEFRTPtCK Km/6Ud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LHqNxKuyO 8Zk= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0046.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:152::15) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|BN9PR12MB5307:EE_ X-MS-Office365-Filtering-Correlation-Id: 49001b45-93ca-4c4e-a4fb-08dc21e393e3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RbIX26PY5z13F8TGc5l+a1waQ9omtbPbJYHsVwVx6PdxCphgFWpHN3wfVVVWle63fa/niDLf0VahwuunQSk80Su5TeTJZmWyLRHdzGuGSwBWGLCAFKuMzz15O76UfcsJek5QMGOS2ALbHmikKJ+LvwFPjWjNcSCV8p0HgaDcJ4QoRQBrI1/H3XwHiJHRG0anYdMrtrbjQdqUmuRzxrjeRunGKfTwMNHo+vD9CY4fUOD323b/O/BsOLqJ8tYBTPEBl5+89g+bjR1JtXLMyaLipe/J7z0GNM7rEGakbnxMOhnnff5aII76JNTkimosCllnIdzvuf8NIQ4S+dy4mW/LmdMKg2pUyOo5gkgeRaqkWg80WBcGhMTOCFW4W0YqsDNx7yql5Ns1DcjTTEfugFE7PkD1VUlB2IWXOcsQ8TZQ0PvESuOFoAjoQLDU2N1WFFPvsFevpjnJQIB7/OSHIW3Oq6Ft4eCiCN5nojQw4fP5kCo2mQe4r5Tqp8cxB+GHeknjJao92dI0y6Wh1/A9FTj1rwFZcjczQppVcvJQMOCnK6Ezg3Rta+OC6k2anFYQjOER4p/AQlca3kMV+Z94/MdzbV7AEBQVOyY31LGwW5JjZVjSLZUqaL8hTCFTD1cP5XtA08PhNWLxbXBs10BcXRNhMg== 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)(376002)(346002)(39860400002)(136003)(396003)(366004)(230922051799003)(64100799003)(186009)(451199024)(1800799012)(41300700001)(31686004)(38100700002)(316002)(6506007)(53546011)(66556008)(8676002)(66476007)(44832011)(66946007)(8936002)(6486002)(2616005)(478600001)(110136005)(6512007)(5660300002)(86362001)(4326008)(2906002)(6666004)(26005)(36756003)(83380400001)(31696002)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MVA1VUZwT3pkN1phWWFZOVQ2Zk9sU1VZdGQvQ1BGVkpDbUdXOWFmSTJSMHFj?= =?utf-8?B?MW5JOWdZbnpIckpubXFROWZKanVUMy9ubStDeTVka3lCeXc1dWlmR1dqVlll?= =?utf-8?B?SmR1KzhtS2Q0bFlYZElKZXhLVmVJSVlsMCtKeGRQZytuU2dnTEJNZFJENmxk?= =?utf-8?B?Z3daeHc1WklaUEdUMWhJakg2ZjhneC9PTTNMWHlZTk1tUGc4R3RxdndZVE1k?= =?utf-8?B?dlZOVzVKSnBmeTJCYXp5WjQ5Y3dQemp1YlZoOVRiVWc5SUpidWl6WmVlUnZE?= =?utf-8?B?YVR6dVRTTlc1NWovdUppL0EwTEI1TnlTVjJtRHUyY1o3djJCVTdXWnd1K1JV?= =?utf-8?B?ZFdZQWxBU3ZRaEp0ZEpydk9ObXNrZlZQUDJ2YWJtaXprTnY5bW02SmxhM01m?= =?utf-8?B?Y2FYc2Z3ZUpUVWdnTm15OEFiK3BvWTNmREFtUC9OUWdRbmdBS3BLSGY3WVFI?= =?utf-8?B?SmtUWmRiVFFvcWFPOG0xU0I4NWxIb0lXVURIaXBxNG9mRlN2aHU3bnFjNlhm?= =?utf-8?B?eGg2R2pZNlRXRmZyNlhjYi9IeXFtUG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k91ZE9OaEZRRXNWRWIzVkp5Z3doRTZNcjNoU1hNWTFrczNjemZ5?= =?utf-8?B?ZFJqaW9TY1ozZ3NVVWg2NW9KZ2oxU0pEUktrNG11RmEya2xYYTVsNDZKamNu?= =?utf-8?B?MEJ4MG5NTEJCaVJteVMzdkFPTGNuMjBOVUFDRjNKdm9vZXYxdGtoQXRUMUJP?= =?utf-8?B?SzVmMFBZVC9xSk40UWx3WnE4UmdSd1N3bm14ZmNUL2l6Szd2RlE0VENjZnA0?= =?utf-8?B?S3M4ZGhXOEJjcnZmcEVnK0twUCtwbjQzTk1nT2sxbzZPY3VPWUdCVWE5TEdl?= =?utf-8?B?ZEVCazF4eHRzbXBldHJrYTAzZFgwMEc4NVROTHI2Z3ZHazBmb2E5YzhtMVpZ?= =?utf-8?B?bUhSRzBjaW1lNlN0ZlE3QW1QeW5FbXU2NW0ySlVtajJJWFlNWE5tSnhFcWhL?= =?utf-8?B?TkZzalUvTkJYbnM2YTRpR0lFZ1lrOFRlR3Z5eWRCclJKVnp2aERLTW1DTFhU?= =?utf-8?B?TDhKQ0dRSWlVbU85ZHB4ZDMxdzZNczRpQnZPZTF3UWpsSThSSmpCUHpmS1Ry?= =?utf-8?B?S090VWpGQWhYN3hDT1V0TXZ6UHFTMzEvc0dPY2pnN2VTQVNESTJMQTllWEFD?= =?utf-8?B?Vk9qbTJDcW5ZWVNqY3M3K3lOMDlDTUJTRGdNQithS0FJanQ2VUJGU2ZLS3Z4?= =?utf-8?Q?1Wgql5MPmZfPuRdx2EZO2OLKs?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 49001b45-93ca-4c4e-a4fb-08dc21e393e3 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2024 22:34:10.6841 (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: dj/MUGmSEEpHJL/vg3vFMXxLEvPWEaVpl6DX3vjoo9OXH+knIROUB0WsOnqA65wA X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5307 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 9:30 PM, Long Li wrote: >> Can you please quantify the performance improvement (as percentage), this >> clarifies the impact of the modification. > > I didn't see any meaningful performance improvements in benchmarks. However, this should improve CPU cycles and reduce potential locking conflicts in real-world applications. > > Using batch allocation was one of the review comments during initial driver submission, suggested by Stephen Hemminger. I promised to fix it at that time. Sorry it took a while to submit this patch. > That is OK, using bulk alloc is reasonable approach, only can you please document the impact (performance increase) in the commit log. >> >> <...> >> >>> @@ -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? > > Mbufs are always freed after fail: > > fail: > rte_free(mbufs); > Nope, I am not talking about the 'mbufs' variable, I am talking about mbuf pointers stored in the 'mbufs' array which are allocated by 'rte_pktmbuf_alloc_bulk()'.