From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) by dpdk.org (Postfix) with ESMTP id 041C7A0BA for ; Wed, 2 Aug 2017 10:56:06 +0200 (CEST) Received: by mail-wm0-f48.google.com with SMTP id t201so35421686wmt.1 for ; Wed, 02 Aug 2017 01:56:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=l82g2oW9hCtvaF+bniqf+G+al6CR8byOBPds0jYg8v8=; b=bWmJnshtR+p0n84mDrHVryKXeTYLWLi4Us4X1v5d8bgpxxiyab/UE9Wev9W5hH0soT QDS8qOojfVz0j5tWYCZDSffNW5NUHMeLYsHNwZujWqSQjhlAT8XU0ow/vojNgrBTytqJ UTD9a9+FPlX7xUT9k+IXpUYaDNq3yco+x3meNpnnx5bWRNnkhhcKg85iJy92Q/5SgjgF qoTHGKup//FvhyjkxMkM8HxhqtZSYtmuquYsRQuRYvVYH+rqsgb84koyMB9eSwAAVxRU 47yE/b0AFdMCYPT0/r6V9sdiMv3yHOOQgauIiiQNVsFZ9Yqf6EytTB6yZQixZqy10nPQ +TjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=l82g2oW9hCtvaF+bniqf+G+al6CR8byOBPds0jYg8v8=; b=uEBMizR5PuLrN2rhpcBri67m4gPut7wqp0Px6rRZXnGAiRfuVX8qwCRGIW2oKQu9tj RfW2vsGAGzTYqkh6oqn7NAsJYf+fHg/96iwYObaXP2ztNmfwDjyvjhFFcTY+DCGzsowC gaJS1e7vAbMipaJx8TKpN1yrrE6EPs06LWNm3eEml6SWtRyYp6IJMEGHn//1PYguLWpb 1H00VDAYeHLG5GwSXrkGJZZpZiN1/Fp6hLkpNkA1suijshVriAnqZXPJ6jz8ioSDwxgh p4I6k34JhooOW+8uQU2w8mkb9LZv4om7Svn/dh5C0xLjisUSFCFgPuA7qE0WV23wBqoo PuKg== X-Gm-Message-State: AIVw113Qz/LIk1IbvEt0nX1cHPFOcDk7/rVmEHWOMvPkbSGBEsT3sAie hW6dns9ZejVSnYmqpyE= X-Received: by 10.28.63.18 with SMTP id m18mr3563919wma.79.1501664166168; Wed, 02 Aug 2017 01:56:06 -0700 (PDT) Received: from bidouze.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id i5sm3469273wmd.47.2017.08.02.01.56.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Aug 2017 01:56:05 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Wed, 2 Aug 2017 10:55:52 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 Subject: [dpdk-dev] [PATCH] devargs: fix scan mode configuration in add 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: Wed, 02 Aug 2017 08:56:07 -0000 When adding rte_devargs to the list, a check is performed on the intended bus that should use this rte_devargs. This bus configuration is for the time being only set once when the first rte_devargs is added to it. If the bus configuration has previously been set, then the rte_devargs insertion fails. Failure occuring upon detection of the set configuration is an API change. While rules will certainly be enforced in the next rte_devargs API, none were previously enforced and this should be respected until this API is deprecated. The bus configuration is meant to evolve soon, but in the meantime it should strictly follow the current rte_eal_devargs_add API. The rte_devargs unit tests are failing due to this API change. Revert this evolution, it will be reintroduced properly in the next release if necessary. Signed-off-by: Gaetan Rivet --- lib/librte_eal/common/eal_common_devargs.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/lib/librte_eal/common/eal_common_devargs.c b/lib/librte_eal/common/eal_common_devargs.c index 33e9f0a..6ac88d6 100644 --- a/lib/librte_eal/common/eal_common_devargs.c +++ b/lib/librte_eal/common/eal_common_devargs.c @@ -170,22 +170,12 @@ rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str) bus = devargs->bus; if (devargs->type == RTE_DEVTYPE_BLACKLISTED_PCI) devargs->policy = RTE_DEV_BLACKLISTED; - if (devargs->policy == RTE_DEV_WHITELISTED) { - if (bus->conf.scan_mode == RTE_BUS_SCAN_UNDEFINED) { + if (bus->conf.scan_mode == RTE_BUS_SCAN_UNDEFINED) { + if (devargs->policy == RTE_DEV_WHITELISTED) bus->conf.scan_mode = RTE_BUS_SCAN_WHITELIST; - } else if (bus->conf.scan_mode == RTE_BUS_SCAN_BLACKLIST) { - fprintf(stderr, "ERROR: incompatible device policy and bus scan mode\n"); - goto fail; - } - } else if (devargs->policy == RTE_DEV_BLACKLISTED) { - if (bus->conf.scan_mode == RTE_BUS_SCAN_UNDEFINED) { + else if (devargs->policy == RTE_DEV_BLACKLISTED) bus->conf.scan_mode = RTE_BUS_SCAN_BLACKLIST; - } else if (bus->conf.scan_mode == RTE_BUS_SCAN_WHITELIST) { - fprintf(stderr, "ERROR: incompatible device policy and bus scan mode\n"); - goto fail; - } } - TAILQ_INSERT_TAIL(&devargs_list, devargs, next); return 0; -- 2.1.4