From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by dpdk.org (Postfix) with ESMTP id AD3BC7CBE for ; Wed, 5 Jul 2017 01:57:16 +0200 (CEST) Received: by mail-wm0-f52.google.com with SMTP id f67so96870851wmh.1 for ; Tue, 04 Jul 2017 16:57:16 -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 :in-reply-to:references; bh=rpJwtjOlMeHgPYu+Sp6Kz+5DN1kqum+PDkAdaKOdtI0=; b=TENjcInnnheCOewFdsqoz85TZGkmRv/nm6jYh5N1WTb69IP44/TSmzF39CYXrx0fDy Y5qSSBw+duyXAvZpNLjZdOmn81KzVU0+JfvVFoYQNbVuiUpilb0egRleylxCn9oGiEV2 /fdqPrNtKfFiQhGeBg6hF3T8E08WpyslfR/vfWhTZa/IvSQY+rtFNAVCh4emYNkr+Sp+ XMqBX7Xz3P2n7q+IcYc1XEHA3u02BCy3c9/VtsFCoE8N5TdEQNCOzN1AaEqmPVXz9P3F nBcOBfDlVKCJrxGjPPiatr3Cpm/bVhKYP89EuR88ABR6dH3rv8Z6jXG7kNMzU9RcMrdj BG+g== 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:in-reply-to:references; bh=rpJwtjOlMeHgPYu+Sp6Kz+5DN1kqum+PDkAdaKOdtI0=; b=JkUJ1kGKVbGb1aKroN5kD1y8CHSsS1/1lOWuoOvIFgatC5vewiYEb1tYWU4iGqD52z hNfTLccPXiFs69daREXNx85X2jEO9H2xmH6HLWXsC5Vw7koM7pJnQJRhazxqFbwSRQUX /BlgNfE+HteIx9QP2b50RxrAoOBeUYSzveHxoVn/KcHREVpPozE/vIiKoXDBRU0UE/YV tf9IVjZBgWESaCp3xnu8FewIdGz8YXmfD/bitd+h+p/7tTgcglb+1jgh4qD9emURWpNF lM/TmL2na0UDRGtNgGbnRVBDf+0USEFPybgItMHzEYZBhQnIETrO2+f9PpS8wEKFxY4d Ow7g== X-Gm-Message-State: AKS2vOwoK+x3shQfE/w+7MHgvDdGYDtWKDkzkeEj09lGIIEhzCHw+9A4 f+FZVVcjHY0EzrfpgpQ= X-Received: by 10.28.4.131 with SMTP id 125mr25729944wme.69.1499212636175; Tue, 04 Jul 2017 16:57:16 -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 w197sm27273899wme.20.2017.07.04.16.57.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Jul 2017 16:57:15 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Wed, 5 Jul 2017 01:56:41 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v6 11/19] devargs: parse bus policies 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: Tue, 04 Jul 2017 23:57:17 -0000 Signed-off-by: Gaetan Rivet --- lib/librte_eal/common/eal_common_devargs.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/librte_eal/common/eal_common_devargs.c b/lib/librte_eal/common/eal_common_devargs.c index 102bd8d..16052a3 100644 --- a/lib/librte_eal/common/eal_common_devargs.c +++ b/lib/librte_eal/common/eal_common_devargs.c @@ -143,6 +143,21 @@ rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str) break; } + if (devargs->type == RTE_DEVTYPE_WHITELISTED_PCI) { + if (bus->conf.scan_mode == RTE_BUS_SCAN_UNDEFINED) { + bus->conf.scan_mode = RTE_BUS_SCAN_WHITELIST; + } else if (bus->conf.scan_mode == RTE_BUS_SCAN_BLACKLIST) { + fprintf(stderr, "ERROR: incompatible device type and bus scan mode\n"); + goto fail; + } + } else if (devargs->type == RTE_DEVTYPE_BLACKLISTED_PCI) { + if (bus->conf.scan_mode == RTE_BUS_SCAN_UNDEFINED) { + bus->conf.scan_mode = RTE_BUS_SCAN_BLACKLIST; + } else if (bus->conf.scan_mode == RTE_BUS_SCAN_WHITELIST) { + fprintf(stderr, "ERROR: incompatible device type and bus scan mode\n"); + goto fail; + } + } free(dev); TAILQ_INSERT_TAIL(&devargs_list, devargs, next); -- 2.1.4