From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id C850BA0096 for ; Fri, 12 Apr 2019 09:46:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 22A585587; Fri, 12 Apr 2019 09:46:32 +0200 (CEST) Received: from mail-vs1-f66.google.com (mail-vs1-f66.google.com [209.85.217.66]) by dpdk.org (Postfix) with ESMTP id 4836D1DBF for ; Fri, 12 Apr 2019 09:46:29 +0200 (CEST) Received: by mail-vs1-f66.google.com with SMTP id w13so5021196vsc.4 for ; Fri, 12 Apr 2019 00:46:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=X/EoCNCJiZlZMYNCIph5sVkUFcEcdom5T5EfsSOj5g0=; b=WZoEC67Z03W6eDyLD3HDT29/xb4j3/BjjFWfI0MzenD9Tj6lOFSrG0MIix68BF9/Jf fAml3nsvudhPvxgAiTTJJI65U9Lj3s6b7cQxkQsrtiREmqsD+2JiwL1d2sxrA6UvK0Yx PeHErE5tqKQ+bCf9FuxZSk1kkdtuyniFBxES6OH19uw4GmT+UDpm4eLxTAu3Ns9VkGKj gneKqmjtk9YwkrdAp06kr2cnJz3YhH6/Mcm2F7OfV4VJFCDVHPsGor7Ct7da1vrtw4AE 1/ImU/+fjMXf5UwguoiCOYrzKWdPupn6nE4jAwmikiiA1iMM3/FtZKvEUqqr3PjCxtos 9fVw== X-Gm-Message-State: APjAAAVS4hPtnAOZr/BUIVLoKTqbiM5t+OvwBz+e3PFkAyN/2ab+laUM CdYlbRUUsYZnNGCLIkkZ9eULcXQtvx+EDM0tWQuK7g== X-Google-Smtp-Source: APXvYqwjroZpFGDSDNdsXVm0ZkETbmMh5LJrE9Ww1qdnYoQAgCQzv7UfCy4oMYERyrg1yZfIIw9409RnSY/RNHdzCcU= X-Received: by 2002:a67:7ac9:: with SMTP id v192mr28262624vsc.100.1555055188596; Fri, 12 Apr 2019 00:46:28 -0700 (PDT) MIME-Version: 1.0 References: <20190411195229.7841-1-aconole@redhat.com> <20190411195229.7841-4-aconole@redhat.com> In-Reply-To: <20190411195229.7841-4-aconole@redhat.com> From: David Marchand Date: Fri, 12 Apr 2019 09:46:17 +0200 Message-ID: To: Aaron Conole Cc: dev , Bruce Richardson , Luca Boccassi , Reshma Pattan , Agalya Babu RadhaKrishnan , David Marchand Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH 3/3] app/test/meson: auto detect number of cores X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190412074617.QZi4Ypm3dOtcTnE_OYsDabiHxcgetpd42DtVFHXlMSA@z> On Thu, Apr 11, 2019 at 9:52 PM Aaron Conole wrote: > The arguments being passed will cause failures on laptops that have, > for instance, 2 cores only. Most of the tests don't require more > than a single core. Some require multiple cores (but those tests > should be modified to 'SKIP' when the correct number of cores > aren't available). > > The unit test results shouldn't be impacted by this change, but it > allows for a future enhancement to pass flags such as '--no-huge'. > > Also include a fix to a reported issue with running on FreeBSD. > > Signed-off-by: Aaron Conole > --- > Conflicts with http://patches.dpdk.org/patch/50850/ > > app/test/meson.build | 24 +++++++++++++++++++++--- > 1 file changed, 21 insertions(+), 3 deletions(-) > > diff --git a/app/test/meson.build b/app/test/meson.build > index 867cc5863..1010bfbc8 100644 > --- a/app/test/meson.build > +++ b/app/test/meson.build > @@ -344,17 +344,32 @@ if get_option('tests') > timeout_seconds = 600 > timeout_seconds_fast = 10 > > + # Retreive the number of CPU cores > nit: Retrieve Little concern here on the approach of getting the max available cpu index. If we have non contiguous cpus (let's say hyper threading is disabled), this won't work. But we can just assume this won't happen for non regression setups (vms). + num_cores = run_command('lscpu', > '-p=cpu').stdout().strip().split('\n')[-1] > lscpu is a linux command afaik. Maybe for FreeBSD: root@freebsd-10:~ # sysctl dev.cpu |cut -d . -f 3 |sort |tail -1 3 Not sure if FreeBSD ensures that the keys names/objects won't change accross the versions. + num_cores_arg = '-l 0-' + num_cores > + > + test_args = [num_cores_arg, '-n 4'] > foreach arg : fast_parallel_test_names > - test(arg, dpdk_test, > - env : ['DPDK_TEST=' + arg], > - args : ['-c f','-n 4', '--file-prefix=@0@ > '.format(arg)], > + if host_machine.system() == 'linux' > + test(arg, dpdk_test, > + env : ['DPDK_TEST=' + arg], > + args : test_args + > + ['--file-prefix=@0@ > '.format(arg)], > + timeout : timeout_seconds_fast, > + suite : 'fast-tests') > + else > + test(arg, dpdk_test, > + env : ['DPDK_TEST=' + arg], > + args : test_args, > timeout : timeout_seconds_fast, > suite : 'fast-tests') > + endif > endforeach > > foreach arg : fast_non_parallel_test_names > test(arg, dpdk_test, > env : ['DPDK_TEST=' + arg], > + args : test_args, > timeout : timeout_seconds_fast, > is_parallel : false, > suite : 'fast-tests') > @@ -363,6 +378,7 @@ if get_option('tests') > foreach arg : perf_test_names > test(arg, dpdk_test, > env : ['DPDK_TEST=' + arg], > + args : test_args, > timeout : timeout_seconds, > is_parallel : false, > suite : 'perf-tests') > @@ -371,6 +387,7 @@ if get_option('tests') > foreach arg : driver_test_names > test(arg, dpdk_test, > env : ['DPDK_TEST=' + arg], > + args : test_args, > timeout : timeout_seconds, > is_parallel : false, > suite : 'driver-tests') > @@ -379,6 +396,7 @@ if get_option('tests') > foreach arg : dump_test_names > test(arg, dpdk_test, > env : ['DPDK_TEST=' + arg], > + args : test_args, > timeout : timeout_seconds, > is_parallel : false, > suite : 'debug-tests') > -- > 2.19.1 > The rest looks good to me. Reviewed-by: David Marchand -- David Marchand