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 B1D94A0487 for ; Thu, 4 Jul 2019 09:43:49 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AE8DB1B197; Thu, 4 Jul 2019 09:43:48 +0200 (CEST) Received: from mail-vs1-f67.google.com (mail-vs1-f67.google.com [209.85.217.67]) by dpdk.org (Postfix) with ESMTP id 8492A5F11 for ; Thu, 4 Jul 2019 09:43:46 +0200 (CEST) Received: by mail-vs1-f67.google.com with SMTP id 190so1427645vsf.9 for ; Thu, 04 Jul 2019 00:43:46 -0700 (PDT) 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=95758DX2wnWZbGb9OxKNWIK9LNxGvKOxl8OkwabMC7Q=; b=LQqWmU9P4ycUs+Lph9u4QkBkiSdR4eEN8VoAy118YMMhJLOOAzUlay4LkgoQoVmDrM 0COufpuOOoYlLoHxMT6GKDTqEUIPfH+g7OePvRlJ2mt5ovVV4R5od9QRWEnC0prLTbZM 0SgSbyM3l7ZMzHp3ASgtInBN4GXq3bTviONzZes/PkaAH4QT9AqiwpKhRJxBZ4jC1BVK 5by5auCUxEMza9I3schPoB3BlKCSI8Y6+LHTAKhZopjmkvwmES7Rs/krLX6yX9uaifcn Q9stmdTsNTNJUaVHE1EHnraMCTcCrytBzUZDSTSzZB2kn/NrpHBN5yGEq+J50clyxIIe BWmQ== X-Gm-Message-State: APjAAAX/ZSO6/2cQhrTfEcksDmzjmGCnnEkNOxK+ux8pjDJmHtpRJ+JO 0lVqpXmUdtVNDYuf3Vb4Uv8eJAahDfv2XkHB35LSFQ== X-Google-Smtp-Source: APXvYqwE7Gz4qrqbXNoFspdJR4FZhalD0/9FgkNJRQZh9KEQwQqi4S4JHFtWbk1jV+/guXvPRipqrzpgO3qe61wmnBY= X-Received: by 2002:a67:688f:: with SMTP id d137mr21048246vsc.198.1562226225833; Thu, 04 Jul 2019 00:43:45 -0700 (PDT) MIME-Version: 1.0 References: <0e63b2e2abe185b711737a7102f6d6cd03101cab.1561635481.git.anatoly.burakov@intel.com> In-Reply-To: <0e63b2e2abe185b711737a7102f6d6cd03101cab.1561635481.git.anatoly.burakov@intel.com> From: David Marchand Date: Thu, 4 Jul 2019 09:43:34 +0200 Message-ID: To: Anatoly Burakov Cc: dev , Neil Horman , John McNamara , Marko Kovacevic , Konstantin Ananyev , David Hunt , Bruce Richardson , Byron Marohn , Pablo de Lara Guarch , Yipeng Wang , Sameh Gobriel , Vladimir Medvedkin , Olivier Matz , Andrew Rybchenko , Reshma Pattan , Thomas Monjalon , Stephen Hemminger Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v3 09/14] eal: hide shared memory config 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, Jun 27, 2019 at 1:39 PM Anatoly Burakov wrote: > diff --git a/lib/librte_eal/common/include/rte_eal_memconfig.h > b/lib/librte_eal/common/include/rte_eal_memconfig.h > index 58dcbb96d..1b615c892 100644 > --- a/lib/librte_eal/common/include/rte_eal_memconfig.h > +++ b/lib/librte_eal/common/include/rte_eal_memconfig.h > @@ -5,13 +5,12 @@ > #ifndef _RTE_EAL_MEMCONFIG_H_ > #define _RTE_EAL_MEMCONFIG_H_ > > -#include > -#include > -#include > -#include > -#include > -#include > -#include > +/** > + * @file > + * > + * This API allows access to EAL shared memory configuration through an > API. > + */ > + > #include > > #ifdef __cplusplus > @@ -38,68 +37,6 @@ struct rte_memseg_list { > struct rte_fbarray memseg_arr; > }; > > You left the rte_memseg_list definition here and the inclusion of rte_fbarray.h. Is this intentional? I would expect it to be defined in a header like rte_memory.h. If you agree, this could be done in a follow-up patch. -/** > - * the structure for the memory configuration for the RTE. > - * Used by the rte_config structure. It is separated out, as for > multi-process > - * support, the memory details should be shared across instances > - */ > -struct rte_mem_config { > - volatile uint32_t magic; /**< Magic number - Sanity check. */ > - > - /* memory topology */ > - uint32_t nchannel; /**< Number of channels (0 if unknown). */ > - uint32_t nrank; /**< Number of ranks (0 if unknown). */ > - > - /** > - * current lock nest order > - * - qlock->mlock (ring/hash/lpm) > - * - mplock->qlock->mlock (mempool) > - * Notice: > - * *ALWAYS* obtain qlock first if having to obtain both qlock and > mlock > - */ > - rte_rwlock_t mlock; /**< only used by memzone LIB for > thread-safe. */ > - rte_rwlock_t qlock; /**< used for tailq operation for thread > safe. */ > - rte_rwlock_t mplock; /**< only used by mempool LIB for > thread-safe. */ > - > - rte_rwlock_t memory_hotplug_lock; > - /**< indicates whether memory hotplug request is in progress. */ > - > - /* memory segments and zones */ > - struct rte_fbarray memzones; /**< Memzone descriptors. */ > - > - struct rte_memseg_list memsegs[RTE_MAX_MEMSEG_LISTS]; > - /**< list of dynamic arrays holding memsegs */ > - > - struct rte_tailq_head tailq_head[RTE_MAX_TAILQ]; /**< Tailqs for > objects */ > - > - /* Heaps of Malloc */ > - struct malloc_heap malloc_heaps[RTE_MAX_HEAPS]; > - > - /* next socket ID for external malloc heap */ > - int next_socket_id; > - > - /* address of mem_config in primary process. used to map shared > config into > - * exact same address the primary process maps it. > - */ > - uint64_t mem_cfg_addr; > - > - /* legacy mem and single file segments options are shared */ > - uint32_t legacy_mem; > - uint32_t single_file_segments; > - > - /* keeps the more restricted dma mask */ > - uint8_t dma_maskbits; > -} __attribute__((__packed__)); > - > - > -inline static void > -rte_eal_mcfg_wait_complete(struct rte_mem_config* mcfg) > -{ > - /* wait until shared mem_config finish initialising */ > - while(mcfg->magic != RTE_MAGIC) > - rte_pause(); > -} > - > /** > * Lock the internal EAL shared memory configuration for shared access. > */ > -- David Marchand