[PATCH v2 3/3] memif: : remove fallbacks for old Linux versions

David Marchand david.marchand at redhat.com
Tue Aug 19 10:16:34 CEST 2025


On Mon, Jul 28, 2025 at 5:19 PM Bruce Richardson
<bruce.richardson at intel.com> wrote:
>
> All supported linux versions support F_ADD_SEALS (Linux 3.17+) and
> MFD_HUGETLB (Linux 4.14+), so no need to have #ifdefs and fallbacks to
> support systems which do not support those features.
>
> Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
> Acked-by: Stephen Hemminger <stephen at networkplumber.org>
> ---
>  drivers/net/memif/rte_eth_memif.h | 41 -------------------------------
>  1 file changed, 41 deletions(-)
>
> diff --git a/drivers/net/memif/rte_eth_memif.h b/drivers/net/memif/rte_eth_memif.h
> index 8e45a3ab78..d4e625ab51 100644
> --- a/drivers/net/memif/rte_eth_memif.h
> +++ b/drivers/net/memif/rte_eth_memif.h
> @@ -169,37 +169,6 @@ int memif_init_regions_and_queues(struct rte_eth_dev *dev);
>   */
>  const char *memif_version(void);
>
> -#ifndef MFD_HUGETLB
> -#ifndef __NR_memfd_create
> -
> -#if defined __x86_64__
> -#define __NR_memfd_create 319
> -#elif defined __x86_32__
> -#define __NR_memfd_create 1073742143
> -#elif defined __arm__
> -#define __NR_memfd_create 385
> -#elif defined __aarch64__
> -#define __NR_memfd_create 279
> -#elif defined __powerpc__
> -#define __NR_memfd_create 360
> -#elif defined __i386__
> -#define __NR_memfd_create 356
> -#elif defined __riscv
> -#define __NR_memfd_create 279
> -#elif defined __loongarch__
> -#define __NR_memfd_create 279
> -#else
> -#error "__NR_memfd_create unknown for this architecture"
> -#endif
> -
> -#endif                         /* __NR_memfd_create */
> -
> -static inline int memfd_create(const char *name, unsigned int flags)
> -{
> -       return syscall(__NR_memfd_create, name, flags);
> -}
> -#endif                         /* MFD_HUGETLB */
> -
>  #ifndef F_LINUX_SPECIFIC_BASE
>  #define F_LINUX_SPECIFIC_BASE 1024
>  #endif
> @@ -208,14 +177,4 @@ static inline int memfd_create(const char *name, unsigned int flags)
>  #define MFD_ALLOW_SEALING       0x0002U
>  #endif

I suspect more stuff could be removed in this header.. but this is a
different topic than what the series deals with.
Thanks for the cleanup.


-- 
David Marchand



More information about the dev mailing list