From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f180.google.com (mail-wr0-f180.google.com [209.85.128.180]) by dpdk.org (Postfix) with ESMTP id 182287D0A for ; Wed, 24 May 2017 17:15:21 +0200 (CEST) Received: by mail-wr0-f180.google.com with SMTP id l50so56884821wrc.3 for ; Wed, 24 May 2017 08:15:21 -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=R67aTvh/dW2KwHGE5fb1nwR/xNSpzmayK6XnLAWtioUXBgRxj9ghkwWFQNEMxL4fhQ 4/zR2hn4IHODrvYakpHPlVTgSVAumDWPnsdg2bdmSnCa8dtTQCQOhmmuOTk3vyrM0uRH VMa+5BeXN1AijzbS7I/tg+7RQBl1XZQKatIJVFfame8ypGHvfQZZfZrUr2sEJ/2jm18+ ldKOKyzBKcYTGz+OdJm25ulNNy/xMDw91MZpqhMlwOnuJXNn8GZ+1ysf8w66RSVztxR8 lrQd+AjtpDdab5AkMSwyR3OltTuKJz0EEzW/HGIoOyIGI+3Hgy8w+0oPMOtpfUZzQ4gW loDw== 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=d0K2dCdXkOauLWIoEV5Wdf7phsDmCFxClWuRJxuim+B1R61GUlRRq4S8L9vy0EfKZW 2+q0JUxM/fcllFjEVOlR98eXsGWVROhXrQd071Ep82IATsSwj3zRR1cIRM+7vCbZlB4P 6tx/OZ6P5Nfj8mCGsSHjWtqgAycf/NW2l+W7yoayqkWeIJVnuaZxuzpSyfOTIGeVw4Zo YaoIXglhEcIREaYfyqNKdIAy2ikxeyyTLTE1zITWs0iiF2sK8QZm6eUrJA3uI0y7kFQz 3Q5PJHGhUA/Q0xylhX3hSkG4OTngUOQAnvg7PRMVyT7OuT10V6RQ1ix/hz8ANApNOeR9 0lPg== X-Gm-Message-State: AODbwcB6zScU17qwFL4YTBXBSqWGOpc3O4tz9RUwbfNDwNBih1jjUkDX cdLWxw7dkDUM6WSuhCU= X-Received: by 10.223.135.42 with SMTP id a39mr18637177wra.113.1495638920556; Wed, 24 May 2017 08:15:20 -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 a136sm4466145wme.26.2017.05.24.08.15.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 May 2017 08:15:19 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet , Jan Blunck , Stephen Hemminger , Maxime Coquelin , Jerin Jacob , David Marchand Date: Wed, 24 May 2017 17:14:54 +0200 Message-Id: <2d6020282a40730655275def9d3760690648615c.1495629181.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 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 15:15:21 -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