From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by dpdk.org (Postfix) with ESMTP id B1F8C9171 for ; Wed, 24 May 2017 18:17:10 +0200 (CEST) Received: by mail-wm0-f53.google.com with SMTP id e127so79936487wmg.1 for ; Wed, 24 May 2017 09:17:10 -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=aVjmS0NySYJA79lEiGFZ84ui/6N89bU2QCcKQtdV6Q0=; b=d2pPLta8WPvmw7vyLmMer+n4bu21V809V2kQi7Zqa69jZQDPn6uuj1QTEJzKXjPBqz SJS2wX0m/5MsshpckDx90XiRm8EZ/Wr47oN02e+oc2Sxyargwmnc/5AZQp4+996ChCab PGfh2+nHujHQ/VGijITLtHIZOBAi4o/0FOVYSqq5/LoGrdRiAFyBwUAZ/EwukVZRDEac zOQ60YBhO31yCPuPBm+GFMVNhjpyHRdAXTQlfX/UKOr5IoaFIr5X6qDDsXVr8+e0jElZ 9M47lWIzdK6/Gs1+aVG7nTtaUy20sVcK0T8yG+Io8pNu1grZzcLraobCV2wCgGnQKVmK OSrw== 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=aVjmS0NySYJA79lEiGFZ84ui/6N89bU2QCcKQtdV6Q0=; b=OIY0H+Yhbjuuif/30wkoO7plbH0HKqWPQGtpI0v9I6UxQ01/3qSSLN7Azeuoio2aSP LC5a7co+exgTcC588mX8lNaItAoFuUUHfXt23B2tBMkO0paFkPZuM8YJCRWkF4M4PgIq 3fN26TM8BBv5VjrjhXeg0ceLZf+WztwWBg2Uu4ZdCoNfzG3+le+JygY2jdCalROaM75a mVnfTRQ25VW2zF6Ng4xStUxxTGZRsAKSdUyjnUdX+lz5DkCj0zLb4V/AKXhbopeFcZTa Namj+d2QKWWY/+OJ+Dtjd8Q6AT1KJzkXy2aEMp8EHllp7csmiEIals9hwLQyDfc53xD2 begg== X-Gm-Message-State: AODbwcAOragqhk985DUiMJYu07CvHLNz2mp2t5Ot5c7qgw96XLq8PNGf /Sfb0ULG8jlbqSVd1uU= X-Received: by 10.28.154.133 with SMTP id c127mr6537197wme.42.1495642630168; Wed, 24 May 2017 09:17:10 -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 17sm5816909wml.32.2017.05.24.09.17.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 May 2017 09:17:09 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Wed, 24 May 2017 18:16:45 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 10/14] 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: Wed, 24 May 2017 16:17:11 -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 8bb72a2..a5014bf 100644 --- a/lib/librte_eal/common/eal_common_devargs.c +++ b/lib/librte_eal/common/eal_common_devargs.c @@ -130,6 +130,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