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 8CB6A7CBA for ; Thu, 8 Jun 2017 01:57:32 +0200 (CEST) Received: by mail-wr0-f174.google.com with SMTP id v111so11989567wrc.3 for ; Wed, 07 Jun 2017 16:57:32 -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=y8xYGwk9E3vPVFwGRTFpTzGG2Qs8M2cvfQ0Om40MRnT6zstH0pD6hIJsxPrHgpf38E j9hGSFkmXAcPdfrMsTByuZVrZ+XKzenkqOUQD5UeSmWEIVX2pknLWBqHR2zrRPL/bnrw BYDh1U/ZIWNHTPrCchmjqxuzwH1bYghGqETZK40UyGeCTRVw8B7FxyjuDI+m99D0j2Mk GudvL54u7VrjfXZO5817+b6TXB++Cxn8aTzu3BkTWXsNcUkDGvLS0PNwFqrpEoEktaok oq8hZbWVu9n+HnOl0E/FNwHRqhiVyCp+2xbe6gh/7gOA5bNhj0dC4wHX/9sJDbWrgOSR J0OQ== 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=cBNdxYIq8xRaH3UYmhl2I21QfRheUAMjLKOMCbGw3NZTGLUpTqq9SnKheIODcAopgL vypAKP0Qi8ZHoxjR1YecUHrSPpLxeTbnTi8RMf5jgN/2A0u5glYiMavbIJIy77OM1xo2 1JflLV7d6VrXMevJRVKrrvpuZF3tCPfnKbETZ/nJpx1nj4iF4XAObGqGs0NiSJs9qBj3 WeThgd8FnIgZ74QbMRy7ofp3yXNt4Ln4uvV67GSdTRxXs4wLjEPbSdk2Q1H734n1NI9y A7GID4idT01qua5i40HudBs+dnxh8uzR3/mNr8H4q2VDUGY7ttHcof/gqRD57LSsgUbU 78BQ== X-Gm-Message-State: AODbwcCy+TsgGgHqx3oICOSYa9ZKTak5luPgp6dwPOtYMVNI0roQfWDS c26hbO295bdta4D5+uk= X-Received: by 10.223.166.13 with SMTP id k13mr26538345wrc.197.1496879851726; Wed, 07 Jun 2017 16:57:31 -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 185sm22397056wmp.1.2017.06.07.16.57.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Jun 2017 16:57:30 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Thu, 8 Jun 2017 01:56:57 +0200 Message-Id: <9701add87167b3811eded7383be46889ac17354f.1496876859.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 v4 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: Wed, 07 Jun 2017 23:57:32 -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