[dpdk-dev] [PATCH v4] test: remove meson dependency on /proc file

Thomas Monjalon thomas at monjalon.net
Wed Apr 15 15:40:09 CEST 2020


15/04/2020 15:36, David Marchand:
> On Wed, Apr 15, 2020 at 3:20 PM Thomas Monjalon <thomas at monjalon.net> wrote:
> > --- /dev/null
> > +++ b/app/test/has-hugepage.sh
> > @@ -0,0 +1,9 @@
> > +#! /bin/sh
> > +# SPDX-License-Identifier: BSD-3-Clause
> > +# Copyright 2020 Mellanox Technologies, Ltd
> > +
> > +if [ "$(uname)" = "Linux" ] ; then
> > +       cat /proc/sys/vm/nr_hugepages || echo 0
> > +else
> > +       echo 0
> > +fi
> > diff --git a/app/test/meson.build b/app/test/meson.build
> > index 777c536ae0..04b59cffa4 100644
> > --- a/app/test/meson.build
> > +++ b/app/test/meson.build
> > @@ -396,15 +396,7 @@ dpdk_test = executable('dpdk-test',
> >         install_rpath: driver_install_path,
> >         install: true)
> >
> > -has_hugepage = true
> > -if is_linux
> > -       check_hugepage = run_command('cat',
> > -                                    '/proc/sys/vm/nr_hugepages')
> > -       if (check_hugepage.returncode() != 0 or
> > -           check_hugepage.stdout().strip() == '0')
> > -               has_hugepage = false
> > -       endif
> > -endif
> > +has_hugepage = run_command('has-hugepage.sh').stdout().strip() != '0'
> 
> This change will force no-huge mode on FreeBSD while before we were
> running with hugepages.

Indeed

I propose to squash this change to maintain the old behaviour:

+elif [ "$(uname)" = "FreeBSD" ] ; then
+       echo 1 # assume FreeBSD always has hugepages





More information about the dev mailing list