From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) by dpdk.org (Postfix) with ESMTP id 110A77D15 for ; Thu, 1 Jun 2017 12:10:51 +0200 (CEST) Received: by mail-wm0-f48.google.com with SMTP id b84so152025469wmh.0 for ; Thu, 01 Jun 2017 03:10:51 -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=VfLtRt8tMU2aXWA5KiBRxEP8S6TwEk13eL3PDFZ0r68Z74cdhdFY2djkafih1vNjuO oxzLKTjnZdU5yulwlRO9zyQ1uwQZMOwymrlSieUy6+iqJa/SmZWTNwBpJenuJIrk8ji9 fCuTWNVBaARA12puhl/buWwBXGG3tUlvd0a4268mdCmYxYgWEfvGt8grppy4MbWv4qo9 8O4lmcomhp6BL7DENl35AR7inQXOyxgw79Q5u9yl8f05Ph5+yX9G2Y5tdIv4Mq1q41Xt sSuW5nQOKneouC7TGZ2o+gJb4r1XEXbUOyrZUajMxWQsvMrRIXD4juuBuZf1ncHfT4tc kN3Q== 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=C37jlTk2Td4EilDlV0lR9qCipbpq6hyeZD/m5DMI4wWEyDYQsGrn0Fkp8l052rOohj rS4/qTW8QabrqMXHebgEfQMGdGWc/kdnHQEw8zj5X2SOPeAUV54zVwQRxGZxUuBIR8yh INzg5cYMz46pc+6916PRnzxclCSGelweejYFj5pHxzYOO4E3uqSV5OPisqvfDuQpL9Gi c4uslnGrmjlPtUSZ+BX6hcxq3iKyUWuSCykhWxqhsSjw57mTQx6PBKqGckaWbxeHWZpE a84ThkfmvVsKaSUFoW9K5l4tg7CF3McbjKiIdmcafQ254F64zfKzGPyg48dPi+5PHp6C IPBw== X-Gm-Message-State: AODbwcDBHSnwOHHuI18UfqqoQoaaXNxpaGoEcqGNXVoEuKvozTkNWvCY QoaikQHpCvI0if/+ijU= X-Received: by 10.28.134.133 with SMTP id i127mr1019619wmd.1.1496311850541; Thu, 01 Jun 2017 03:10:50 -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 y19sm1022569wmh.21.2017.06.01.03.10.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Jun 2017 03:10:49 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Thu, 1 Jun 2017 12:10:25 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v3 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: Thu, 01 Jun 2017 10:10:51 -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