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 2D94BA0544; Fri, 23 Sep 2022 15:11:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0554A4003F; Fri, 23 Sep 2022 15:11:02 +0200 (CEST) Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) by mails.dpdk.org (Postfix) with ESMTP id 7E83A4003C for ; Fri, 23 Sep 2022 15:11:00 +0200 (CEST) Received: by mail-lf1-f42.google.com with SMTP id a2so201708lfb.6 for ; Fri, 23 Sep 2022 06:11:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date; bh=W3c66gcUPXhbFoaDOzMA+FvZrN0gEBjPGdAjrExvSWQ=; b=ElMki02IUVDeRsZDAnymuFvjHh38uX789+wAQSocoC4aacZxDZi2IkET+xorCAH/mv e4/GeNdeToG/AM6YKhproC6+084biPHu5td+peaYXZ/S9b2eWzfBUceXkKoitYPQ0yp+ BPf1wIRM6fRx9ZDQTLaZj3T3NR3v3bPv/mxrUXsPhOBJXfthymLxX1BzyxFU4cGSqklL /aSrLr2p8/VhxGTCT5AQwZuDpdfRa5UgwFRkkYcEA7bL7cRU40HyPvQ2RGi7Zim71m/g iIDRW655BDZgmflSwbg+sLiKZ3wdOhNYXs0/UnHbtR7eqD0eRZ6E03KwpyNQpnPZmEMK 6u9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date; bh=W3c66gcUPXhbFoaDOzMA+FvZrN0gEBjPGdAjrExvSWQ=; b=cHgE+tLHc7I5V57GkB2EaOOwFx7aGsJiR5Z0X2+NB+Df754DpA3fRxxrluagWpOAcU iplkUGqijH1vWm6IP1n6l+hAxZB/W/voROBSCHIrJbgATbO+59dWmBtukVIVh+EF6KUL V3pbR1VwYKLgs8l0mLNRY0lnsBE30uBz0wYMGNhOTgj3bbJJrcL8nv5EyumKdlaKhTFL I2rItnLRlsA5G0MXqGJfjwqsf9od1j7S7/Kf3qzYDVr2zXh/kSFK6BeBDTTW99BZ6FkF 2AEgNJ2/GmHG4wtRF/bp50dBxNato2ch8W+Xqv2W4+huLlHMrmBEhd4xQXH6smrVt72p Bzrw== X-Gm-Message-State: ACrzQf3iYB1/vmE9gBs0cU3W3aBIYMYWn8tUX+1Nu2KqTS57jlENizZ3 parmfZX6Nr9FZE+yXibUUhc= X-Google-Smtp-Source: AMsMyM4LOTEtY+ly2aBuWLDSggT9FHJJuPvnMtCz6Y+Be3O93ebbqFNKYyLt7hM43El8VVa89tLIzg== X-Received: by 2002:a05:6512:b9a:b0:499:b537:fe60 with SMTP id b26-20020a0565120b9a00b00499b537fe60mr3529584lfv.319.1663938659783; Fri, 23 Sep 2022 06:10:59 -0700 (PDT) Received: from sovereign (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id by40-20020a05651c1a2800b0026c446918acsm1369919ljb.134.2022.09.23.06.10.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Sep 2022 06:10:58 -0700 (PDT) Date: Fri, 23 Sep 2022 16:10:57 +0300 From: Dmitry Kozlyuk To: "Umakiran Godavarthi (ugodavar)" Cc: "anatoly.burakov@intel.com" , "dev@dpdk.org" , "stephen@networkplumber.org" Subject: Re: DPDK 19.11.5 Legacy Memory Design Query Message-ID: <20220923161057.0205e703@sovereign> In-Reply-To: References: <20220922120052.710c2cd1@sovereign> <20220923144727.155be566@sovereign> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 2022-09-23 12:12 (UTC+0000), Umakiran Godavarthi (ugodavar):=20 > [Uma] : Yes I agree if free_hp =3D 400, nr_hp =3D 252, we are expecting = DPDK takes only 252 and keep the remaining pages free in its heap. > As you have mentioned just boot DPDK with 1 page, and add = pages we want later, is this the steps >=20 > 1. NR_HP =3D1 , FREE_HP =3D 1 > 2. EAL INIT (DPDK boots up with 1 2 MB page) > 3. What is the API for adding later on pages ? (rte_extmem_*, can you = please give the full API details and how to call it with arguments ) Guide: https://doc.dpdk.org/guides-19.11/prog_guide/env_abstraction_layer.html= #support-for-externally-allocated-memory I recommend reading the entire section about DPDK memory management since you're going to use an uncommon API and should understand what's going on. API (the linked function and those following it): http://doc.dpdk.org/api-19.11/rte__malloc_8h.html#a2295623c85ba41fe5bf7= dce6bf0393d6 http://doc.dpdk.org/api-19.11/rte__memory_8h.html#a653510fb0c58bf63f547= 08677e3a2eba > We can do 1,2,3 there is a problem once we reduce pages to 1 , kernel wil= l free the huge pages totally >=20 > So is there a way not to touch NR_HP, FREE_HP, and just pass arguments to= boot DPDK with just 1 page ? Please let us know and later add pages we nee= d to DPDK !! See --socket-mem EAL option: http://doc.dpdk.org/guides-19.11/linux_gsg/linux_eal_parameters.html#id3 > Why do you need legacy mode in the first place? > Looks like you're painfully trying to achieve the same result > that dynamic mode would give you automatically. >=20 > [Uma] : Yes , we can=E2=80=99t avoid legacy memory design as secondary pr= ocess mapped page by page to primary process , and physical addr space is s= ame for both processes. We have to stick to legacy memory design only for = now !! Sorry, I still don't understand. Virtual and physical addresses of DPDK memory are the same across processes in both legacy and dynamic memory mode.