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 D76F2A0C49; Wed, 16 Jun 2021 11:42:36 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F23F640683; Wed, 16 Jun 2021 11:42:35 +0200 (CEST) Received: from mail-il1-f181.google.com (mail-il1-f181.google.com [209.85.166.181]) by mails.dpdk.org (Postfix) with ESMTP id A875440140 for ; Wed, 16 Jun 2021 11:42:34 +0200 (CEST) Received: by mail-il1-f181.google.com with SMTP id b9so1813378ilr.2 for ; Wed, 16 Jun 2021 02:42:34 -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:content-transfer-encoding; bh=B0COtfECm8yvVfBayhncUjVC+kPuNocCJhAqhdCd6xA=; b=XBv7osFgdEjBb+PqBPngYMIfrN0MqWkJaZtefRVjDedYddnwgwvg7IrIZnzrUYBU1C qlRPlQWhiwi/kemzF6n73uyehOMKd94mWz8GbW4AMo4BlHvdwyPWuScvR/Zt/K3W4zhX Xt0xGJ01Fneu+VwVCu2DPpEWrEOOAxbF8enJGLxNQo2Fzd4HoLYz+GB0TFdmWfkjh6g7 8NOe7UrFTpZ30mzSwJBfUBP8Q7sv9QCrPZKop+9zvlGGoF3HD/xPFtKQjb7uG1VCwD7p a4rJGhovg+mP15HJh9TFYnIyhzRWmoN8fFly+bfmo+/75ac+QnSM1p73FWAZjBo5kQeN fYJg== 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:content-transfer-encoding; bh=B0COtfECm8yvVfBayhncUjVC+kPuNocCJhAqhdCd6xA=; b=OXyHyXWEM0v3ly8KumAFcEPzxCFojzjhdgMFiSsRBNCsXcM3QL7SaJqSEfGG53T6G7 Vvw8UJvQjAxvjwMLRwoUkg63kgV7f4EHaZgbf0o7YBzi+kg1LT+inUCEFhPSfknoq5E1 abTYusj2Pgi4AkUanYpmOuFcZO0KA2fam3t2AjLrKTOQuCgraJqnuUjilL8Br948SOes dUr6J4alZuDGQU1EI038HnXoaIrjFHbm9GxJpxZ3lnb4HEpn/gV7PJI1nTTt6PQN7QKk Qbr+iwYjwik/EcUGWJgeSuOi7qMM1vyCHAwjVWnsclO7D+Co3MbqefkZgUjpKM70ZWsi GaaA== X-Gm-Message-State: AOAM530IbagSlgCQr0HcZkeOie6qbyii4tE0fNIeTQK5e1NQrY+EHj82 aEsgnTZQ29y/9vLJrYnh2RtOvWDjKs1DxdcOB/c= X-Google-Smtp-Source: ABdhPJx5Byy2h81+Aq0cuUQTJmobWuyu7RRlpxS+JrDK0c9GARLReSMlFjgZkFAbULoYFfaoyCTu/7WgQ+QEUyOsQsE= X-Received: by 2002:a05:6e02:1b87:: with SMTP id h7mr2827112ili.271.1623836554022; Wed, 16 Jun 2021 02:42:34 -0700 (PDT) MIME-Version: 1.0 References: <20210614105839.3379790-1-thomas@monjalon.net> <2004320.XGyPsaEoyj@thomas> <98CBD80474FA8B44BF855DF32C47DC35C61851@smartserver.smartshare.dk> <1857954.7Ex43hCf9S@thomas> In-Reply-To: <1857954.7Ex43hCf9S@thomas> From: Jerin Jacob Date: Wed, 16 Jun 2021 15:12:18 +0530 Message-ID: To: Thomas Monjalon Cc: =?UTF-8?Q?Morten_Br=C3=B8rup?= , Bruce Richardson , dpdk-dev , Olivier Matz , Andrew Rybchenko , Honnappa Nagarahalli , "Ananyev, Konstantin" , Ferruh Yigit , Jerin Jacob , Akhil Goyal Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [PATCH] parray: introduce internal API for dynamic arrays 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 Sender: "dev" On Tue, Jun 15, 2021 at 12:18 PM Thomas Monjalon wrot= e: > > 14/06/2021 17:48, Morten Br=C3=B8rup: > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon > > It would be much simpler to just increase RTE_MAX_ETHPORTS to something= big enough to hold a sufficiently large array. And possibly add an rte_max= _ethports variable to indicate the number of populated entries in the array= , for use when iterating over the array. > > > > Can we come up with another example than RTE_MAX_ETHPORTS where this li= brary provides a better benefit? > > What is big enough? > Is 640KB enough for RAM? ;) If I understand it correctly, Linux process allocates 640KB due to that fact currently struct rte_eth_dev rte_eth_devices[RTE_MAX_ETHPORTS] is global and it is from BSS. If we make this from heap i.e use malloc() to allocate this memory then in my understanding Linux really won't allocate the real page for backend memory until unless, someone write/read to this memory. i.e it will be free virtual memory using Linux memory management help. If so, we can keep large values for RTE_MAX_ETHPORTS without wasting any "real" memory even though the system has a few ports. Thoughts? > > When dealing with microservices switching, the numbers can increase very = fast. > >