From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) by dpdk.org (Postfix) with ESMTP id 9D11B9B8D for ; Wed, 2 Aug 2017 19:12:22 +0200 (CEST) Received: by mail-wm0-f54.google.com with SMTP id t138so42250285wmt.1 for ; Wed, 02 Aug 2017 10:12:22 -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:in-reply-to:references; bh=AH9Zs/Fs8w1Dgs+w4CD6t9DSlO377G8SDLwPkQ+0x5U=; b=hnjKJBza3itpkXyx8ECgvVkT4HekCLMZa7AqBV8QF9UIPr91Mo+EhkcmmN0TO0qTpJ owboiW2XaBVER2KLXmtwaH9Txw7v7yjuQGcn+smnkUt7Jnut2deLuBGW58VqbJmEeTdK DriBgANIShH9pG7IdH9tHKHv3XzMf53AbJibF82p3oUsdE1MBpet++7w1y4oLnLYOD+F Tqj6ilg8I6mosCSPFjb2Q+wXPh20c/8ofPaKAHwr2E1AuMoGKODqQL5VsUdCm09DPkVV UTpJ1Ls7JreN4JSakemZEEegTrgdSEu71WsfIH70fCEcQtOYkmquRBnoW9u5QIPs2S0Q fbFg== 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:in-reply-to :references; bh=AH9Zs/Fs8w1Dgs+w4CD6t9DSlO377G8SDLwPkQ+0x5U=; b=ExmJwO3RhARTNrT0sH+TZR7rsD8ufsqpZhTNXMSibQhP8a6QDW4tLj2JXmtz085yaE g6aEPiJTniiNDhpEYcH4P0q3D+r+PWiiN/kjafuSyiZTUbo/L177wD3k/PquzZzLPmxO OhDX2FsiardupH9oEnnOQcVBr+yy+2YZeJl/W0KGuaRsaiozcjh7TOczWApDC/bmR3Eo gRdHNZ5jaxgFqpjro97BNwNjouIjPpPj0EwDMJgZc7RmdX0edCg2S+44LvfNa5D+2tCv CStaTF/cVFi3m/4mtkMHiqfcdukTXWCJOu9SBqSrdFyD58Q1XFPqhddYRv47U0oK3bnP JSlA== X-Gm-Message-State: AIVw111OUmNU+PV5eUeMC8sjcJXOrDTYYK5tsGS8JqulNww+5oibiiaR NATd81BZ6OEKWU+I418= X-Received: by 10.28.212.147 with SMTP id l141mr4435962wmg.13.1501693941823; Wed, 02 Aug 2017 10:12:21 -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 6sm4351929wrn.52.2017.08.02.10.12.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Aug 2017 10:12:21 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Wed, 2 Aug 2017 19:12:07 +0200 Message-Id: <1da8b8d0c80d7af97ca32c35a0215f99ad2f6666.1501693240.git.gaetan.rivet@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2] devargs: fix policy check in rte_eal_devargs_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 17:12:22 -0000 Do not fail upon detecting a set bus configuration when adding an rte_devargs. i.e. adding a blacklisted PCI device while the bus is configured in whitelist mode. This failure condition has been introduced when the bus policies were implemented. This implementation however was meant to strictly follow the existing API. This check was not and should not be performed until the current API has been properly deprecated. Fixes: 02823c1db0bc ("devargs: parse bus policies") Signed-off-by: Gaetan Rivet --- v2: - reword commitlog to better explain my intent. 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