From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 04426A0C43; Tue, 19 Oct 2021 12:04:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9784740683; Tue, 19 Oct 2021 12:04:38 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 136D74003E for ; Tue, 19 Oct 2021 12:04:35 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10141"; a="291938812" X-IronPort-AV: E=Sophos;i="5.85,384,1624345200"; d="scan'208";a="291938812" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Oct 2021 03:04:34 -0700 X-IronPort-AV: E=Sophos;i="5.85,384,1624345200"; d="scan'208";a="526596602" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.14.183]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 19 Oct 2021 03:04:33 -0700 Date: Tue, 19 Oct 2021 11:04:30 +0100 From: Bruce Richardson To: David Marchand Cc: dev , Aaron Conole , Brandon Lo Message-ID: References: <20211018170136.5189-1-david.marchand@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [dpdk-dev] [PATCH] test: rely on EAL detection for core list X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" On Tue, Oct 19, 2021 at 11:52:32AM +0200, David Marchand wrote: > On Mon, Oct 18, 2021 at 7:53 PM Bruce Richardson > wrote: > > > > On Mon, Oct 18, 2021 at 07:01:36PM +0200, David Marchand wrote: > > > Cores count has a direct impact on the time needed to complete unit > > > tests. > > > > > > Currently, the core list used for unit test is enforced to "all cores on > > > the system" with no way for (CI) users to adapt it. > > > On the other hand, EAL default behavior (when no -c/-l option gets passed) > > > is to start threads on as many cores available in the process cpu > > > affinity. > > > > > > Remove logic from meson: users can then select where to run the tests by > > > either running meson with a custom cpu affinity (using taskset/cpuset > > > depending on OS) or by passing a --test-args option to meson. > > > > > > Example: > > > $ sudo meson test -C build --suite fast-tests -t 3 --test-args "-l 0-3" > > > > > > Signed-off-by: David Marchand > > > --- > > > I wanted to post this as a RFC, but now, I wonder if all CI test RFC > > > patches, so sending as a normal patch. > > > > > > --- > > I really like this idea! Patch looks good other than it needs some doc > > changes. > > Wdyt of: > > diff --git a/doc/guides/prog_guide/meson_ut.rst > b/doc/guides/prog_guide/meson_ut.rst > index fff88655dd..d35e0577c8 100644 > --- a/doc/guides/prog_guide/meson_ut.rst > +++ b/doc/guides/prog_guide/meson_ut.rst > @@ -47,9 +47,15 @@ Arguments of ``test()`` that can be provided in > meson.build are as below: > > * ``is_parallel`` is used to run test case either in parallel or > non-parallel mode. > * ``timeout`` is used to specify the timeout of test case. > -* ``args`` is used to specify test specific parameters. > +* ``args`` is used to specify test specific parameters (see note below). > * ``env`` is used to specify test specific environment parameters. > > +Note: the content of meson ``--test-args`` option and the content of ``args`` > +are appended when invoking the DPDK test binary. > +Because of this, it is recommended not to set any default coremask or memory > +configuration in per test ``args`` and rather let users select what best fits > +their environment. If a test can't run, then it should be skipped, as described > +below. > > Dealing with skipped test cases > ------------------------------- That text is good. However, I also think we need an example above of using test-args to limit core masks. How about also adding something like: diff --git a/doc/guides/prog_guide/meson_ut.rst b/doc/guides/prog_guide/meson_ut.rst index fff88655dd..4924066556 100644 --- a/doc/guides/prog_guide/meson_ut.rst +++ b/doc/guides/prog_guide/meson_ut.rst @@ -37,6 +37,13 @@ command:: $ meson test --suite fast-tests +If desired, additional arguments can be passed to the test run via the meson ``--test-args`` option. +For example, tests will by default run on as many available cores as is needed for the test, +starting with the lowest number core - generally core 0. +To run the fast-tests suite using only cores 8 through 16, one can use:: + + $ meson test --suite fast-tests --test-args="-l 8-16" + The meson command to list all available tests:: $ meson test --list