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 BAA1D37A0 for ; Wed, 21 Jun 2017 01:36:18 +0200 (CEST) Received: by mail-wr0-f174.google.com with SMTP id 77so111603066wrb.1 for ; Tue, 20 Jun 2017 16:36:18 -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=zEGsdp7q5SmTQjhQHk0oOBHsCHhRjOnZZGJbXu+QdyU=; b=pXH+TDf7Z7dZy9eBxJIin4eo5SGuez4e7ROp7pk+RfB2AeLL22Lf75oNNjPmcIAU2H rrTikS5DL2Xd66VrJbTApHct4bJqeWpS0nW+mEHAs1eKQFWQKLC4ceevI4DYkEOKRKCx nCxXd5FtZx1sYOuDDUfDN31i7jySX28n/pSy1DyYrNFjOlgqBsy0XKaTGBkNzyNni99k QzSVgNYtCWsKbVezxUFgmVD7BCQUwwSoNkC+51aBc8MEvW9tQqWHDKUzboRoWaA5c94B hPpoFT/3oXFlCxMScy/Yxa7gbZERWCCwDLrmfe7jQWPqxX8QXB0DAWbJ+r+2y4pDbKMu Me1g== 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=zEGsdp7q5SmTQjhQHk0oOBHsCHhRjOnZZGJbXu+QdyU=; b=mMbVqwbaDTmCV12BQN98wEazED2WyQ+wnVr6qbzZ7J7gVK1oSNUR/5/1KLtYMwsnRD T/5BF0uvE4c229SqUAk7pbtwq45B9TDORt5iNmH0HLpnN9EmO2hlUCd6GGwcWq6/yEr4 HvHsvuGlzebl09FbQ20K9l2ENNiT7P9gqzkBk/pOGDGNfLPmQifRn11Xps819t8/3i+z MRIlWNg5CstlqewrdgdA0PvFLxK+R4Nt5sDCa11bPZ/rqsstw1n/qDDvOosKcBIAtwJe tybcOfZT9VpkLCAbB/5Er730w+uhTzXSDG74x8qaw9IRx105hgTqw/0G4gnxEdHNeyqn K1qA== X-Gm-Message-State: AKS2vOzEbCd0dF2uo0jnjRJVPuDKLJM3VaVkIHy5c5TPk+ZenIHfJaMr Q1iSvRxALJsQPkGbss8= X-Received: by 10.28.91.198 with SMTP id p189mr4315085wmb.97.1498001778234; Tue, 20 Jun 2017 16:36:18 -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 f45sm6463684wrf.2.2017.06.20.16.36.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 16:36:17 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Wed, 21 Jun 2017 01:35:45 +0200 Message-Id: <276d14641eca426648a5a92da8b618377c6f0ee9.1498001626.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 v5 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, 20 Jun 2017 23:36:19 -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 d5f297d..ac51b19 100644 --- a/lib/librte_eal/common/eal_common_devargs.c +++ b/lib/librte_eal/common/eal_common_devargs.c @@ -128,6 +128,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(buf); TAILQ_INSERT_TAIL(&devargs_list, devargs, next); -- 2.1.4