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 2725746118; Fri, 24 Jan 2025 07:35:16 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AD4C840E1B; Fri, 24 Jan 2025 07:35:15 +0100 (CET) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by mails.dpdk.org (Postfix) with ESMTP id 67E1040E15 for ; Fri, 24 Jan 2025 07:35:13 +0100 (CET) Received: from mail.maildlp.com (unknown [172.19.88.105]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4YfSfY28PRzRlv4; Fri, 24 Jan 2025 14:32:37 +0800 (CST) Received: from kwepemk500009.china.huawei.com (unknown [7.202.194.94]) by mail.maildlp.com (Postfix) with ESMTPS id 9F3FE140159; Fri, 24 Jan 2025 14:35:09 +0800 (CST) Received: from [10.67.121.161] (10.67.121.161) by kwepemk500009.china.huawei.com (7.202.194.94) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Fri, 24 Jan 2025 14:35:09 +0800 Message-ID: Date: Fri, 24 Jan 2025 14:35:08 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] mbuf: add fast free bulk and raw alloc bulk functions To: =?UTF-8?Q?Morten_Br=C3=B8rup?= , Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko , Slava Ovsiienko , Shahaf Shuler , Olivier Matz CC: , Dengdui Huang References: <20250114162544.125448-1-mb@smartsharesystems.com> <20250121134028.20733-1-mb@smartsharesystems.com> Content-Language: en-US From: fengchengwen In-Reply-To: <20250121134028.20733-1-mb@smartsharesystems.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.121.161] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemk500009.china.huawei.com (7.202.194.94) 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 LGTM Acked-by: Chengwen Feng On 2025/1/21 21:40, Morten Brørup wrote: > When putting an mbuf back into its mempool, there are certain requirements > to the mbuf. Specifically, some of its fields must be initialized. > > These requirements are in fact invariants about free mbufs, held in > mempools, and thus also apply when allocating an mbuf from a mempool. > With this in mind, the additional assertions in rte_mbuf_raw_free() were > moved to __rte_mbuf_raw_sanity_check(). > Furthermore, the assertion regarding pinned external buffer was enhanced; > it now also asserts that the referenced pinned external buffer has > refcnt == 1. > > The description of RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE was updated to > include the remaining requirements, which were missing here. > > And finally: > A new rte_mbuf_fast_free_bulk() inline function was added for the benefit > of ethdev drivers supporting fast release of mbufs. > It asserts these requirements and that the mbufs belong to the specified > mempool, and then calls rte_mempool_put_bulk(). > > For symmetry, a new rte_mbuf_raw_alloc_bulk() inline function was also > added. > > Signed-off-by: Morten Brørup > Acked-by: Dengdui Huang