> On Apr 11, 2018, at 5:30 AM, Anatoly Burakov
> wrote:
>
> Nothing uses this code yet. The bulk of it is copied from old
> memory allocation code (linuxapp eal_memory.c). We provide an
> EAL-internal API to allocate either one page or multiple pages,
> guaranteeing that we'll get contiguous VA for all of the pages
> that we requested.
>
> Not supported on FreeBSD.
>
> Locking is done via fcntl() because that way, when it comes to
> taking out write locks or unlocking on deallocation, we don't
> have to keep original fd's around. Plus, using fcntl() gives us
> ability to lock parts of a file, which is useful for single-file
> segments, which are coming down the line.
>
> Signed-off-by: Anatoly Burakov
> Tested-by: Santosh Shukla
> Tested-by: Hemant Agrawal
> Tested-by: Gowrishankar Muthukrishnan
> ---
[...]
> diff --git a/lib/librte_eal/linuxapp/eal/eal_memalloc.c
> b/lib/librte_eal/linuxapp/eal/eal_memalloc.c
> new file mode 100644
> index 000..45ea0ad
> --- /dev/null
> +++ b/lib/librte_eal/linuxapp/eal/eal_memalloc.c
> @@ -0,0 +1,429 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + * Copyright(c) 2017-2018 Intel Corporation
> + */
> +
> +#define _FILE_OFFSET_BITS 64
> +#include
> +#include
> +#include
> +#include
> +#include
> +#include
> +#include
> +#include
> +#include
> +#include
> +#include
> +#include
> +#include
> +#include
> +#include
> +#include
There's a bug in the old RedHat release:
Bug 1476120 - glibc headers don't include linux/falloc.h, and therefore doesn't
include fallocate() flags [1]
How about adding "#include " ahead of fcntl.h? I'm quite lazy
to update my host and using CentOS 7.2.1511, then it failed to compile due to
this bug.
[1] https://bugzilla.redhat.com/show_bug.cgi?id=1476120
Thanks,
Yongseok