> -----Original Message-----
> From: lng-odp [mailto:[email protected]] On Behalf Of EXT Maxim
> Uvarov
> Sent: Tuesday, March 29, 2016 5:11 PM
> To: [email protected]
> Subject: Re: [lng-odp] [PATCH] linux-generic: dpdk: check hugepage 
> availability
> before running validation tests
> 
> On 03/29/16 16:22, Matias Elo wrote:
> > Check that the DPDK hugepage directory exists and hugepages
> > are mounted there before running pktio validation tests.
> >
> > Signed-off-by: Matias Elo <[email protected]>
> > ---
> >   platform/linux-generic/test/pktio/pktio_run_dpdk | 19
> ++++++++++++++++++-
> >   1 file changed, 18 insertions(+), 1 deletion(-)
> >
> > diff --git a/platform/linux-generic/test/pktio/pktio_run_dpdk 
> > b/platform/linux-
> generic/test/pktio/pktio_run_dpdk
> > index 50e910a..e006e8e 100755
> > --- a/platform/linux-generic/test/pktio/pktio_run_dpdk
> > +++ b/platform/linux-generic/test/pktio/pktio_run_dpdk
> > @@ -17,6 +17,9 @@ PATH=$(dirname $0):$PATH
> >   PATH=$(dirname $0)/../../../../test/validation/pktio:$PATH
> >   PATH=.:$PATH
> >
> > +# DPDK hugepage directory
> > +DPDK_HUGEPAGE_DIR="/mnt/huge"
> > +
> >   pktio_main_path=$(which pktio_main${EXEEXT})
> >   if [ -x "$pktio_main_path" ] ; then
> >     echo "running with pktio_main: $pktio_run_path"
> > @@ -57,9 +60,23 @@ run_test()
> >
> >   run()
> >   {
> > +   local skip_test=0
> > +
> >     # need to be root to set the interface.
> >     if [ "$(id -u)" != "0" ]; then
> > -           echo "pktio: need to be root to setup DPDK interfaces."
> > +           echo "dpdk pktio: need to be root to setup DPDK interfaces"
> > +           skip_test=1
> > +   # check that hugepages are available
> > +   elif [ ! -d $DPDK_HUGEPAGE_DIR ]; then
> > +           echo "dpdk pktio: hugepage directory
> \"$DPDK_HUGEPAGE_DIR\" not found"
> > +           skip_test=1
> > +   elif !(grep -qs "$DPDK_HUGEPAGE_DIR" /proc/mounts); then
> > +           echo "dpdk pktio: hugepages not mounted to
> \"$DPDK_HUGEPAGE_DIR\""
> > +           skip_test=1
> > +   fi
> > +
> > +   if [ $skip_test -ne 0 ]; then
> > +           echo "test skipped"
> >             return $TEST_SKIPPED
> >     fi
> >
> I think it's not really good check. In my case hugetlbfs was mounted
> somewhere in /mnt/croups/.../hugetlb
> Check can be:
> mount |grep huge
> if ($? = 1 /* only one mount*/ && (mount dir is DPDK_HUGEPAGE_DIR)
> return 0;
> else
> return SKIP;

Thanks, this is definitely better. I checked the DPDK code and it actually 
doesn't care where the hugepages are mapped to, so the ' mount dir is 
DPDK_HUGEPAGE_DIR' check is unnecessary. The number of mounts doesn't matter 
either, DPDK simply uses the first one with matching page size.

-Matias

> 
> 
> Maxim.
> 
> 
> 
> 
> _______________________________________________
> lng-odp mailing list
> [email protected]
> https://lists.linaro.org/mailman/listinfo/lng-odp
_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to