Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/37035/?format=api
https://patches.dpdk.org/api/patches/37035/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/bc43adcfcc1bd0a596d73abee119e8029524b1bf.1522797505.git.anatoly.burakov@intel.com/", "project": { "id": 1, "url": "https://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<bc43adcfcc1bd0a596d73abee119e8029524b1bf.1522797505.git.anatoly.burakov@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/bc43adcfcc1bd0a596d73abee119e8029524b1bf.1522797505.git.anatoly.burakov@intel.com", "date": "2018-04-03T23:21:59", "name": "[dpdk-dev,v3,47/68] eal: add \"legacy memory\" option", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "1c0dcead95a90df29811328ceabb7aa16c205006", "submitter": { "id": 4, "url": "https://patches.dpdk.org/api/people/4/?format=api", "name": "Burakov, Anatoly", "email": "anatoly.burakov@intel.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/bc43adcfcc1bd0a596d73abee119e8029524b1bf.1522797505.git.anatoly.burakov@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/37035/comments/", "check": "fail", "checks": "https://patches.dpdk.org/api/patches/37035/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 0F7551BA82;\n\tWed, 4 Apr 2018 01:23:45 +0200 (CEST)", "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n\tby dpdk.org (Postfix) with ESMTP id C79241B89B\n\tfor <dev@dpdk.org>; Wed, 4 Apr 2018 01:22:33 +0200 (CEST)", "from orsmga006.jf.intel.com ([10.7.209.51])\n\tby fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t03 Apr 2018 16:22:33 -0700", "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga006.jf.intel.com with ESMTP; 03 Apr 2018 16:22:29 -0700", "from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com\n\t[10.237.217.45])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\tw33NMSar013179; Wed, 4 Apr 2018 00:22:28 +0100", "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id w33NMSX9014925;\n\tWed, 4 Apr 2018 00:22:28 +0100", "(from aburakov@localhost)\n\tby sivswdev01.ir.intel.com with LOCAL id w33NMS25014917;\n\tWed, 4 Apr 2018 00:22:28 +0100" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.48,403,1517904000\"; d=\"scan'208\";a=\"31303398\"", "From": "Anatoly Burakov <anatoly.burakov@intel.com>", "To": "dev@dpdk.org", "Cc": "Bruce Richardson <bruce.richardson@intel.com>, keith.wiles@intel.com,\n\tjianfeng.tan@intel.com, andras.kovacs@ericsson.com,\n\tlaszlo.vadkeri@ericsson.com, benjamin.walker@intel.com,\n\tthomas@monjalon.net, konstantin.ananyev@intel.com,\n\tkuralamudhan.ramakrishnan@intel.com, louise.m.daly@intel.com,\n\tnelio.laranjeiro@6wind.com, yskoh@mellanox.com, pepperjo@japf.ch,\n\tjerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com,\n\tolivier.matz@6wind.com, shreyansh.jain@nxp.com,\n\tgowrishankar.m@linux.vnet.ibm.com", "Date": "Wed, 4 Apr 2018 00:21:59 +0100", "Message-Id": "<bc43adcfcc1bd0a596d73abee119e8029524b1bf.1522797505.git.anatoly.burakov@intel.com>", "X-Mailer": "git-send-email 1.7.0.7", "In-Reply-To": [ "<cover.1522797505.git.anatoly.burakov@intel.com>", "<cover.1522797505.git.anatoly.burakov@intel.com>" ], "References": [ "<cover.1522797505.git.anatoly.burakov@intel.com>", "<cover.1520428025.git.anatoly.burakov@intel.com>\n\t<cover.1522797505.git.anatoly.burakov@intel.com>" ], "Subject": "[dpdk-dev] [PATCH v3 47/68] eal: add \"legacy memory\" option", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "This adds a \"--legacy-mem\" command-line switch. It will be used to\ngo back to the old memory behavior, one where we can't dynamically\nallocate/free memory (the downside), but one where the user can\nget physically contiguous memory, like before (the upside).\n\nFor now, nothing but the legacy behavior exists, non-legacy\nmemory init sequence will be added later. For FreeBSD, non-legacy\nmemory init will never be enabled, while for Linux, it is\ndisabled in this patch to avoid breaking bisect, but will be\nenabled once non-legacy mode will be fully operational.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n\nNotes:\n v3:\n - Move to earlier in the patchset\n - Make Linuxapp always load in legacy mode\n\n lib/librte_eal/bsdapp/eal/eal.c | 3 +++\n lib/librte_eal/common/eal_common_options.c | 4 ++++\n lib/librte_eal/common/eal_internal_cfg.h | 4 ++++\n lib/librte_eal/common/eal_options.h | 2 ++\n lib/librte_eal/linuxapp/eal/eal.c | 3 +++\n lib/librte_eal/linuxapp/eal/eal_memory.c | 24 ++++++++++++++++++++----\n 6 files changed, 36 insertions(+), 4 deletions(-)", "diff": "diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c\nindex 032a5ea..f44b904 100644\n--- a/lib/librte_eal/bsdapp/eal/eal.c\n+++ b/lib/librte_eal/bsdapp/eal/eal.c\n@@ -534,6 +534,9 @@ rte_eal_init(int argc, char **argv)\n \t\treturn -1;\n \t}\n \n+\t/* FreeBSD always uses legacy memory model */\n+\tinternal_config.legacy_mem = true;\n+\n \tif (eal_plugins_init() < 0) {\n \t\trte_eal_init_alert(\"Cannot init plugins\\n\");\n \t\trte_errno = EINVAL;\ndiff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c\nindex 8a51ade..fb5ea03 100644\n--- a/lib/librte_eal/common/eal_common_options.c\n+++ b/lib/librte_eal/common/eal_common_options.c\n@@ -73,6 +73,7 @@ eal_long_options[] = {\n \t{OPT_VDEV, 1, NULL, OPT_VDEV_NUM },\n \t{OPT_VFIO_INTR, 1, NULL, OPT_VFIO_INTR_NUM },\n \t{OPT_VMWARE_TSC_MAP, 0, NULL, OPT_VMWARE_TSC_MAP_NUM },\n+\t{OPT_LEGACY_MEM, 0, NULL, OPT_LEGACY_MEM_NUM },\n \t{0, 0, NULL, 0 }\n };\n \n@@ -1184,6 +1185,9 @@ eal_parse_common_option(int opt, const char *optarg,\n \n \t\tcore_parsed = LCORE_OPT_MAP;\n \t\tbreak;\n+\tcase OPT_LEGACY_MEM_NUM:\n+\t\tconf->legacy_mem = 1;\n+\t\tbreak;\n \n \t/* don't know what to do, leave this to caller */\n \tdefault:\ndiff --git a/lib/librte_eal/common/eal_internal_cfg.h b/lib/librte_eal/common/eal_internal_cfg.h\nindex a0082d1..fda087b 100644\n--- a/lib/librte_eal/common/eal_internal_cfg.h\n+++ b/lib/librte_eal/common/eal_internal_cfg.h\n@@ -47,6 +47,10 @@ struct internal_config {\n \tvolatile unsigned force_sockets;\n \tvolatile uint64_t socket_mem[RTE_MAX_NUMA_NODES]; /**< amount of memory per socket */\n \tuintptr_t base_virtaddr; /**< base address to try and reserve memory from */\n+\tvolatile unsigned legacy_mem;\n+\t/**< true to enable legacy memory behavior (no dynamic allocation,\n+\t * IOVA-contiguous segments).\n+\t */\n \tvolatile int syslog_facility;\t /**< facility passed to openlog() */\n \t/** default interrupt mode for VFIO */\n \tvolatile enum rte_intr_mode vfio_intr_mode;\ndiff --git a/lib/librte_eal/common/eal_options.h b/lib/librte_eal/common/eal_options.h\nindex e86c711..d301d0b 100644\n--- a/lib/librte_eal/common/eal_options.h\n+++ b/lib/librte_eal/common/eal_options.h\n@@ -55,6 +55,8 @@ enum {\n \tOPT_VFIO_INTR_NUM,\n #define OPT_VMWARE_TSC_MAP \"vmware-tsc-map\"\n \tOPT_VMWARE_TSC_MAP_NUM,\n+#define OPT_LEGACY_MEM \"legacy-mem\"\n+\tOPT_LEGACY_MEM_NUM,\n \tOPT_LONG_MAX_NUM\n };\n \ndiff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c\nindex 77f6cb7..b34e57a 100644\n--- a/lib/librte_eal/linuxapp/eal/eal.c\n+++ b/lib/librte_eal/linuxapp/eal/eal.c\n@@ -348,6 +348,7 @@ eal_usage(const char *prgname)\n \t \" --\"OPT_BASE_VIRTADDR\" Base virtual address\\n\"\n \t \" --\"OPT_CREATE_UIO_DEV\" Create /dev/uioX (usually done by hotplug)\\n\"\n \t \" --\"OPT_VFIO_INTR\" Interrupt mode for VFIO (legacy|msi|msix)\\n\"\n+\t \" --\"OPT_LEGACY_MEM\" Legacy memory mode (no dynamic allocation, contiguous segments)\\n\"\n \t \"\\n\");\n \t/* Allow the application to print its usage message too if hook is set */\n \tif ( rte_application_usage_hook ) {\n@@ -767,6 +768,8 @@ rte_eal_init(int argc, char **argv)\n \t\trte_atomic32_clear(&run_once);\n \t\treturn -1;\n \t}\n+\t/* for now, always set legacy mem */\n+\tinternal_config.legacy_mem = 1;\n \n \tif (eal_plugins_init() < 0) {\n \t\trte_eal_init_alert(\"Cannot init plugins\\n\");\ndiff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c\nindex 5642cc8..1d3defe 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_memory.c\n+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c\n@@ -922,8 +922,8 @@ huge_recover_sigbus(void)\n * 6. unmap the first mapping\n * 7. fill memsegs in configuration with contiguous zones\n */\n-int\n-rte_eal_hugepage_init(void)\n+static int\n+eal_legacy_hugepage_init(void)\n {\n \tstruct rte_mem_config *mcfg;\n \tstruct hugepage_file *hugepage = NULL, *tmp_hp = NULL;\n@@ -1266,8 +1266,8 @@ getFileSize(int fd)\n * configuration and finds the hugepages which form that segment, mapping them\n * in order to form a contiguous block in the virtual memory space\n */\n-int\n-rte_eal_hugepage_attach(void)\n+static int\n+eal_legacy_hugepage_attach(void)\n {\n \tconst struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n \tstruct hugepage_file *hp = NULL;\n@@ -1403,6 +1403,22 @@ rte_eal_hugepage_attach(void)\n }\n \n int\n+rte_eal_hugepage_init(void)\n+{\n+\tif (internal_config.legacy_mem)\n+\t\treturn eal_legacy_hugepage_init();\n+\treturn -1;\n+}\n+\n+int\n+rte_eal_hugepage_attach(void)\n+{\n+\tif (internal_config.legacy_mem)\n+\t\treturn eal_legacy_hugepage_attach();\n+\treturn -1;\n+}\n+\n+int\n rte_eal_using_phys_addrs(void)\n {\n \treturn phys_addrs_available;\n", "prefixes": [ "dpdk-dev", "v3", "47/68" ] }{ "id": 37035, "url": "