From mboxrd@z Thu Jan 1 00:00:00 1970 From: Venumadhav Josyula Subject: Api in dpdk to get total free physical memory Date: Fri, 9 Mar 2018 03:06:41 +0530 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable To: dev@dpdk.org Return-path: Received: from mail-lf0-f44.google.com (mail-lf0-f44.google.com [209.85.215.44]) by dpdk.org (Postfix) with ESMTP id 62A574CC0 for ; Thu, 8 Mar 2018 22:36:43 +0100 (CET) Received: by mail-lf0-f44.google.com with SMTP id y19-v6so10414515lfd.4 for ; Thu, 08 Mar 2018 13:36:43 -0800 (PST) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi All, Like =E2=80=98rte_eal_get_physmem_size=E2=80=99 api to the total size of th= e physical memory. Is there an API to get to get total free memory physical memory available ? We want such API we are planning to implement such API for the same /* get the total size of memory */ uint64_t rte_eal_get_physmem_free(int socket_id) { const struct rte_mem_config *mcfg; unsigned i =3D 0; uint64_t total_len =3D 0; /* get pointer to global configuration */ mcfg =3D rte_eal_get_configuration()->mem_config; for (i=3D0; ifree_memseg[i].addr =3D=3D NULL) break; if (mcfg->free_memseg[i].len =3D=3D 0) continue; /* bad socket ID */ if (socket_id !=3D SOCKET_ID_ANY && mcfg->free_memseg[i].socket_id !=3D SOCKET_ID_ANY && socket_id !=3D mcfg->free_memseg[i].socket_id) continue; total_len +=3D mcfg->free_memseg[i].len; } return total_len; } Thanks, Regards Venu