From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 4D4427D62 for ; Mon, 4 Sep 2017 18:05:35 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP; 04 Sep 2017 09:05:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,475,1498546800"; d="scan'208";a="125446648" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.57]) ([10.237.220.57]) by orsmga004.jf.intel.com with ESMTP; 04 Sep 2017 09:05:33 -0700 To: Jan Blunck , dev@dpdk.org References: <20170711232512.54641-1-jblunck@infradead.org> <20170714211213.34436-1-jblunck@infradead.org> <20170714211213.34436-3-jblunck@infradead.org> From: Ferruh Yigit Message-ID: Date: Mon, 4 Sep 2017 17:05:32 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20170714211213.34436-3-jblunck@infradead.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v2 02/15] devargs: fix unittest 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: , X-List-Received-Date: Mon, 04 Sep 2017 16:05:35 -0000 On 7/14/2017 10:12 PM, Jan Blunck wrote: > Since the scan-mode of the bus is now based on the bus configuration it > isn't possible to have blacklisted and whitelisted devices existing for > the same bus. This fixes the unittest to reflect that. > > Signed-off-by: Jan Blunck > --- > test/test/test_devargs.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/test/test/test_devargs.c b/test/test/test_devargs.c > index 18f54edc1..02fec8b1f 100644 > --- a/test/test/test_devargs.c > +++ b/test/test/test_devargs.c > @@ -68,13 +68,15 @@ test_devargs(void) > goto fail; > if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI, "0000:5:00.0") < 0) [1] see below. > goto fail; > - if (rte_eal_devargs_add(RTE_DEVTYPE_BLACKLISTED_PCI, "04:00.0,arg=val") < 0) > + if (rte_eal_devargs_add(RTE_DEVTYPE_BLACKLISTED_PCI, "04:00.0,arg=val") > + == 0) Although as comment said, bus scan policy only can be whitelist or blacklist, and previous call sets it to whitelist [1], this API call doesn't return error. So changing its return type will fail the unittest. Fix can be changing type to whitelist, and update count to 4 in below check [2]. And keep blacklist count 0 [3]. > goto fail; > - if (rte_eal_devargs_add(RTE_DEVTYPE_BLACKLISTED_PCI, "0000:01:00.1") < 0) > + if (rte_eal_devargs_add(RTE_DEVTYPE_BLACKLISTED_PCI, "0000:01:00.1") > + == 0) > goto fail; > if (rte_eal_devargs_type_count(RTE_DEVTYPE_WHITELISTED_PCI) != 2) > goto fail; [2] > - if (rte_eal_devargs_type_count(RTE_DEVTYPE_BLACKLISTED_PCI) != 2) > + if (rte_eal_devargs_type_count(RTE_DEVTYPE_BLACKLISTED_PCI) != 0) > goto fail; [3] > if (rte_eal_devargs_type_count(RTE_DEVTYPE_VIRTUAL) != 0) > goto fail; >