[dpdk-dev] [PATCH 1/4] mem: add --single-file to create single mem-backed file
Xie, Huawei
huawei.xie at intel.com
Thu Jan 21 02:57:45 CET 2016
On 1/11/2016 2:43 AM, Tan, Jianfeng wrote:
[snip]
> +#include <mntent.h>
> +#include <sys/mman.h>
> +#include <sys/file.h>
> +#include <sys/vfs.h>
Please remove unreferenced header files.
>
> #include <rte_log.h>
> #include <rte_memory.h>
> @@ -92,6 +96,9 @@
> #include <rte_common.h>
> #include <rte_string_fns.h>
>
> +#define _GNU_SOURCE
> +#include <sys/syscall.h>
> +
> #include "eal_private.h"
[snip]
> + char filepath[MAX_HUGEPAGE_PATH];
> +
> + syscall(SYS_getcpu, NULL, &socket_id, NULL);
> +
[snip]
> mcfg->memseg[0].addr = addr;
> - mcfg->memseg[0].hugepage_sz = RTE_PGSIZE_4K;
> + mcfg->memseg[0].hugepage_sz = pagesize;
> mcfg->memseg[0].len = internal_config.memory;
> - mcfg->memseg[0].socket_id = 0;
> + mcfg->memseg[0].socket_id = socket_id;
Anyway the socket_id here doesn't make sense. We could remove the
syscall which relies on _GNU_SOURCE.
More information about the dev
mailing list