From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f174.google.com (mail-wr0-f174.google.com [209.85.128.174]) by dpdk.org (Postfix) with ESMTP id 3A67C376C for ; Fri, 7 Jul 2017 02:05:00 +0200 (CEST) Received: by mail-wr0-f174.google.com with SMTP id k67so24117068wrc.2 for ; Thu, 06 Jul 2017 17:05:00 -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=zc3bOrUIric0+xueqLrpkiEKI/96Y90gUUV/0Fod5w6AYmRjiekCvhYYE1DlNqsP9I OX4CuGjxoIRMm5nhWC7t3/TyDnvykMKCLATSXs7pyYe5EXv+ZOY69we+IFGt0UO2W4kk Py/z16w6oZhLnIJdqBGEiv6S1MBXlQh5dGXTMhjAoe6VFdCldFb5zACQwqHP1Ym95OAO nl1UVe7a08EFO4nfaMkB0Wp0pSTTbTFjdANQTlhpFhJ2TIirGQPo9WNV8o595Eamm80K MymHH3DL4zBLADFDmY9jIQ0fyWydUr2U4szeKpvelZdUaM2ja3T51flbuhBqj+gEPIyi X9TQ== 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=E5z9B2ahchxYX0Vjm2l2xvScJe8LQ1h5BS0l3UF5e2Zve5bihhLZO6itLZsPzdVZ0x jgSeMEkHJ1Ui3DRzIFjHWPGlsgYblBA9IM7smoEwFKgwgCTp6h2SEeks3J1GdH51tZai g7887lQtiMCjUPTsWrItWzynUYugJmbkqVZtKz7lPmdJglWULwzpkpDl5P2YNro5h27B HPv5jIvI3pCsiD7NySvj/awH6TWzhr75dyn2wDe4JNWgtHwvgud5C8cogwAey0ErYh8v yio7VR0odqeWlR4LTREhfzhUxDIjDWPxTivLr5brhdKuVHFXc0Ks6d69t1axmZj4Hy9W LtiA== X-Gm-Message-State: AIVw110+BMKvlWuGM3pfsN+75Zt0D/rHMbVUmMJ1cNqHr8QUp59NrTD2 OS3/4b0RzdNC+lJ36JE= X-Received: by 10.28.166.132 with SMTP id p126mr265387wme.104.1499385899724; Thu, 06 Jul 2017 17:04:59 -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 b197sm1111520wmb.4.2017.07.06.17.04.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 06 Jul 2017 17:04:58 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Fri, 7 Jul 2017 02:04:29 +0200 Message-Id: <8816dcfaf7d7554cf1a105cf941b43dc8a9e7423.1499384590.git.gaetan.rivet@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v7 12/17] 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: Fri, 07 Jul 2017 00:05:00 -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