]> git.droids-corp.org - dpdk.git/commitdiff
mem: store memory mode flags in shared config
authorAnatoly Burakov <anatoly.burakov@intel.com>
Thu, 20 Sep 2018 15:41:26 +0000 (16:41 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 3 Oct 2018 22:09:47 +0000 (00:09 +0200)
Currently, command-line switches for legacy mem mode or single-file
segments mode are only stored in internal config. This leads to a
situation where these flags have to always match between primary
and secondary, which is bad for usability.

Fix this by storing these flags in the shared config as well, so
that secondary process can know if the primary was launched in
single-file segments or legacy mem mode.

This bumps the EAL ABI, however there's an EAL deprecation notice
already in place[1] for a different feature, so that's OK.

[1] http://patches.dpdk.org/patch/43502/

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
doc/guides/rel_notes/release_18_11.rst
lib/librte_eal/common/include/rte_eal_memconfig.h
lib/librte_eal/linuxapp/eal/Makefile
lib/librte_eal/linuxapp/eal/eal.c
lib/librte_eal/meson.build

index a8327ea772d5bb7da8186956bcd3d4b5ba7d1035..2133a5b9bb2e0372c47362c974ede2f3e5de60bf 100644 (file)
@@ -152,6 +152,10 @@ ABI Changes
    Also, make sure to start the actual text at the margin.
    =========================================================
 
+* eal: added ``legacy_mem`` and ``single_file_segments`` values to
+       ``rte_config`` structure on account of improving DPDK usability when
+       using either ``--legacy-mem`` or ``--single-file-segments`` flags.
+
 
 Removed Items
 -------------
@@ -198,7 +202,7 @@ The libraries prepended with a plus sign were incremented in this version.
      librte_compressdev.so.1
      librte_cryptodev.so.5
      librte_distributor.so.1
-     librte_eal.so.8
+   + librte_eal.so.9
      librte_ethdev.so.10
    + librte_eventdev.so.6
      librte_flow_classify.so.1
index aff0688dded38512e48dec5dc485f060df5b7453..62a21c2dca7d3a63130fbf2840caaa9817eb334f 100644 (file)
@@ -77,6 +77,10 @@ struct rte_mem_config {
         * 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;
 } __attribute__((__packed__));
 
 
index fd92c75c21f3b432e9b88e048c319a33005caeef..5c16bc40fe4b0aad0342618ba876e64018779423 100644 (file)
@@ -10,7 +10,7 @@ ARCH_DIR ?= $(RTE_ARCH)
 EXPORT_MAP := ../../rte_eal_version.map
 VPATH += $(RTE_SDK)/lib/librte_eal/common/arch/$(ARCH_DIR)
 
-LIBABIVER := 8
+LIBABIVER := 9
 
 VPATH += $(RTE_SDK)/lib/librte_eal/common
 
index e59ac65772932033b1b69928f601afaf7b3aa75f..4a55d3b696870cc5442f42ebe9eb4d83d207fc71 100644 (file)
@@ -352,6 +352,24 @@ eal_proc_type_detect(void)
        return ptype;
 }
 
+/* copies data from internal config to shared config */
+static void
+eal_update_mem_config(void)
+{
+       struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
+       mcfg->legacy_mem = internal_config.legacy_mem;
+       mcfg->single_file_segments = internal_config.single_file_segments;
+}
+
+/* copies data from shared config to internal config */
+static void
+eal_update_internal_config(void)
+{
+       struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
+       internal_config.legacy_mem = mcfg->legacy_mem;
+       internal_config.single_file_segments = mcfg->single_file_segments;
+}
+
 /* Sets up rte_config structure with the pointer to shared memory config.*/
 static void
 rte_config_init(void)
@@ -361,11 +379,13 @@ rte_config_init(void)
        switch (rte_config.process_type){
        case RTE_PROC_PRIMARY:
                rte_eal_config_create();
+               eal_update_mem_config();
                break;
        case RTE_PROC_SECONDARY:
                rte_eal_config_attach();
                rte_eal_mcfg_wait_complete(rte_config.mem_config);
                rte_eal_config_reattach();
+               eal_update_internal_config();
                break;
        case RTE_PROC_AUTO:
        case RTE_PROC_INVALID:
index e1fde15d1bf1a3905993d81ef575722d99f3f46f..62ef985b990d9f304db55d1764f596785515b786 100644 (file)
@@ -21,7 +21,7 @@ else
        error('unsupported system type "@0@"'.format(host_machine.system()))
 endif
 
-version = 8  # the version of the EAL API
+version = 9  # the version of the EAL API
 allow_experimental_apis = true
 deps += 'compat'
 deps += 'kvargs'