From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1DC35A3168 for ; Thu, 17 Oct 2019 09:13:58 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6617A1E558; Thu, 17 Oct 2019 09:13:56 +0200 (CEST) Received: from mail-il1-f194.google.com (mail-il1-f194.google.com [209.85.166.194]) by dpdk.org (Postfix) with ESMTP id 078731E550 for ; Thu, 17 Oct 2019 09:13:53 +0200 (CEST) Received: by mail-il1-f194.google.com with SMTP id z10so1013816ilo.8 for ; Thu, 17 Oct 2019 00:13:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=iNYriYP7Re5w/YvNS+8R8QiDHHDypxCpvxh6n52jdjg=; b=WHpMXhBWe9firZ3JCzSnyOXTLK8yWVrE0eR1rtthWkyv7dV+W4D4hRf1FxfsfKRZGw UbDO7rxKmFQ/v4M2NQsNf8y0NtWEH1MuWZd/EZMpXvq9GQa8Di/nyOZ22KF8x51di+EK mMgZ2JTsGISkS2dRFRPQ0UEHGOa6yFm8DLi4ba5VThE0YO3fcS8tBu/ZMihhdFfWDTvi c4l8k37YnTc1B9GOLaUTbjRYkkNClQXLE+Sd4wyn1gtuo6uLB3XkKXXr6cfROYglS8Kw KbEB3tFqfY1xMQ2XwJO5dFhR38vlkXRIn7+2V5tWkBIK5TADbj7xhpBYZSxKFMQsD4k9 4BCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iNYriYP7Re5w/YvNS+8R8QiDHHDypxCpvxh6n52jdjg=; b=EJ1HRuc9cKPR4NqJFcYjiUxKTmi3y71lLM0DSTZCkOVEIsu6PwyOqO+PguE8mzV9XA rtGURc5/fM0n6juuA1Eq1z2bV8tcQAOdXAnGQXWgovMcns6kXaCarENza9Ox37gusEZ8 5MnjOzWCWA0UdTIcDvWGYqdOcYOsu3oGuFoYIV4sPOheG0Zr6HqmiI2W1wr2P4d6SG5M dhqF7shSAHB4MzC8dv6z9UEi4QDlWxEPKLQxMuoRMYEm+cbHQYvYl9tp9Zt5qCuFqXed vpK0pK3TjvYWRqqoEgOv18AGa9lomE4HY+gKr6S6Q00xKUxYBIqA8KrC9EpGiid0k38U JUOg== X-Gm-Message-State: APjAAAVlbJPjZBanbY/2+b03v3Nd/zsaNpHrHndplWya+aTQCmkpvbq3 jsmu8aQwsLTvTCcTjSFXC7IOC2PS/ALkWnH4QYI= X-Google-Smtp-Source: APXvYqw7MBAzCC6D8eeievEM0DsiQMIRMWgB0bOah/d73J7H9S6Y8IvyhTfsKc5yIH+8fj7x6EhYa3/M5tB+LPQabXE= X-Received: by 2002:a92:2c03:: with SMTP id t3mr2102908ile.271.1571296433088; Thu, 17 Oct 2019 00:13:53 -0700 (PDT) MIME-Version: 1.0 References: <1571295301-25911-1-git-send-email-xuemingl@mellanox.com> In-Reply-To: <1571295301-25911-1-git-send-email-xuemingl@mellanox.com> From: Jerin Jacob Date: Thu, 17 Oct 2019 12:43:41 +0530 Message-ID: To: Xueming Li Cc: Olivier Matz , Andrew Rybchenko , dpdk-dev , Asaf Penso , Ori Kam Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [RFC] mempool: introduce indexed memory pool X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Oct 17, 2019 at 12:25 PM Xueming Li wrote: > > Indexed memory pool manages memory entries by index, allocation from > pool returns both memory pointer and index(ID). users save ID as u32 > or less(u16) instead of traditional 8 bytes pointer. Memory could be > retrieved from pool or returned to pool later by index. > > Pool allocates backend memory in chunk on demand, pool size grows > dynamically. Bitmap is used to track entry usage in chunk, thus > management overhead is one bit per entry. > > Standard rte_malloc demands malloc overhead(64B) and minimal data > size(64B). This pool aims to such cost saving also pointer size. > For scenario like creating millions of rte_flows each consists > of small pieces of memories, the difference is huge. > > Like standard memory pool, this lightweight pool only support fixed > size memory allocation. Pools should be created for each different > size. > > To facilitate memory allocated by index, a set of ILIST_XXX macro > defined to operate entries as regular LIST. > > By setting entry size to zero, pool can be used as ID generator. > > Signed-off-by: Xueming Li > --- > lib/librte_mempool/Makefile | 3 +- > lib/librte_mempool/rte_indexed_pool.c | 289 +++++++++++++++++++++ > lib/librte_mempool/rte_indexed_pool.h | 224 ++++++++++++++++ Can this be abstracted over the driver interface instead of creating a new APIS? ie using drivers/mempool/