From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by dpdk.org (Postfix) with ESMTP id A487E7D6F for ; Wed, 24 May 2017 17:15:24 +0200 (CEST) Received: by mail-wm0-f51.google.com with SMTP id b84so68024798wmh.0 for ; Wed, 24 May 2017 08:15:24 -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=/R7HIi827B9w4GjbF9Qngfe0ZlN8RVUVmoyJQDC9mHA=; b=jlulKTf/6tj7oeDBtPJAHJY8ObNheQ1Fpe4IWQMxrvBAFJhNh3Q3ktQfLQOxJpN5ZI M8tDBlTAVlUTwj9s63uknMzMYIzBh2YZFeiQ5utBcHyqLsdIsmzgkb6RXjvHg/cl35uQ DdpiaGnMSosCfhp+CwO5d6D+NxlRPktnE+VSDOltDYUDgicNaYvuiURwv6bC13Zjj5kG RjPHFC87LoA4/DyLjQjHxqVi7qj4nRuJTLxMvTAsuHCzqeXp/jXw9Kq1dH3Q3hp6VGC1 bBi890KZN5BVBYTwSaku9kBBcoodHrsrHG0AkQPaCubH8O6tpeMKUQvyDSKo+HiC44e4 YN9w== 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=/R7HIi827B9w4GjbF9Qngfe0ZlN8RVUVmoyJQDC9mHA=; b=aV/E6QHcnVdtrVlOK+/n3J0vTjVmKsnfMgAIKzqfKxPVwTfDVo4Vxr8jRPmkFmXlzZ 6Z8JMjOwEOdIpOXjUf6va2Q1XgPskfN1cjl44u25w4pAIsjn0i6Mr7aKp5VZFJegJMxP SsTWkTAp2hQl54RzG2XRHXTTdL8aFsyqMsxjRyVJXFpPaNdHl+WWmnvx5DM+T7KegwP9 dcPYfx0tAAOZSp0eWNo6SlFBum7Q0SEKBbBb2zVEWK9OXC8JF4RHDnOPk1nVPvKzTiHL KnbkMGMvqLMg1FjxWYBtrwGfyu9gxi43HA5GOH0a2GXNp5dTv5ZCEITeonpeVYlkYLZP KMzw== X-Gm-Message-State: AODbwcDvMCLbtLKD0K2iknj81+uGHjrvBINgzyB8tF62uBNX7jbnVHZo H4gp7kh2R3zE3R2nd5U= X-Received: by 10.28.209.141 with SMTP id i135mr6194243wmg.123.1495638923726; Wed, 24 May 2017 08:15:23 -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.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 May 2017 08:15:23 -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:57 +0200 Message-Id: <2ba4a42a4dd0efa4e4ea375e275589caba2e553f.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 13/14] devargs: generic device types 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:25 -0000 Signed-off-by: Gaetan Rivet --- lib/librte_eal/common/eal_common_devargs.c | 4 ++-- lib/librte_eal/common/eal_common_options.c | 13 +++---------- lib/librte_eal/common/eal_common_pci.c | 6 +++--- lib/librte_eal/common/eal_common_vdev.c | 1 - lib/librte_eal/common/include/rte_devargs.h | 6 +++--- 5 files changed, 11 insertions(+), 19 deletions(-) diff --git a/lib/librte_eal/common/eal_common_devargs.c b/lib/librte_eal/common/eal_common_devargs.c index 51ffb45..d423125 100644 --- a/lib/librte_eal/common/eal_common_devargs.c +++ b/lib/librte_eal/common/eal_common_devargs.c @@ -115,14 +115,14 @@ rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str) ret = snprintf(devargs->name, sizeof(devargs->name), "%s", buf); if (ret < 0 || ret >= (int)sizeof(devargs->name)) goto fail; - if (devargs->type == RTE_DEVTYPE_WHITELISTED_PCI) { + if (devargs->type == RTE_DEVTYPE_WHITELISTED) { 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) { + } else if (devargs->type == RTE_DEVTYPE_BLACKLISTED) { 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) { diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c index f470195..075b0ea 100644 --- a/lib/librte_eal/common/eal_common_options.c +++ b/lib/librte_eal/common/eal_common_options.c @@ -798,14 +798,14 @@ eal_parse_common_option(int opt, const char *optarg, switch (opt) { /* blacklist */ case 'b': - if (rte_eal_devargs_add(RTE_DEVTYPE_BLACKLISTED_PCI, + if (rte_eal_devargs_add(RTE_DEVTYPE_BLACKLISTED, optarg) < 0) { return -1; } break; /* whitelist */ case 'w': - if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI, + if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED, optarg) < 0) { return -1; } @@ -901,7 +901,7 @@ eal_parse_common_option(int opt, const char *optarg, break; case OPT_VDEV_NUM: - if (rte_eal_devargs_add(RTE_DEVTYPE_VIRTUAL, + if (rte_eal_devargs_add(RTE_DEVTYPE_UNDEFINED, optarg) < 0) { return -1; } @@ -1025,13 +1025,6 @@ eal_check_common_options(struct internal_config *internal_cfg) return -1; } - if (rte_eal_devargs_type_count(RTE_DEVTYPE_WHITELISTED_PCI) != 0 && - rte_eal_devargs_type_count(RTE_DEVTYPE_BLACKLISTED_PCI) != 0) { - RTE_LOG(ERR, EAL, "Options blacklist (-b) and whitelist (-w) " - "cannot be used at the same time\n"); - return -1; - } - return 0; } diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c index 17d272a..6d9fdda 100644 --- a/lib/librte_eal/common/eal_common_pci.c +++ b/lib/librte_eal/common/eal_common_pci.c @@ -229,7 +229,7 @@ rte_pci_probe_one_driver(struct rte_pci_driver *dr, /* no initialization when blacklisted, return without error */ if (dev->device.devargs != NULL && dev->device.devargs->type == - RTE_DEVTYPE_BLACKLISTED_PCI) { + RTE_DEVTYPE_BLACKLISTED) { RTE_LOG(INFO, EAL, " Device is blacklisted, not" " initializing\n"); return 1; @@ -416,7 +416,7 @@ rte_pci_probe(void) int probe_all = 0; int ret = 0; - if (rte_eal_devargs_type_count(RTE_DEVTYPE_WHITELISTED_PCI) == 0) + if (rte_pci_bus.bus.conf.scan_mode == RTE_BUS_SCAN_WHITELIST) probe_all = 1; FOREACH_DEVICE_ON_PCIBUS(dev) { @@ -431,7 +431,7 @@ rte_pci_probe(void) if (probe_all) ret = pci_probe_all_drivers(dev); else if (devargs != NULL && - devargs->type == RTE_DEVTYPE_WHITELISTED_PCI) + devargs->type == RTE_DEVTYPE_WHITELISTED) ret = pci_probe_all_drivers(dev); if (ret < 0) { RTE_LOG(ERR, EAL, "Requested device " PCI_PRI_FMT diff --git a/lib/librte_eal/common/eal_common_vdev.c b/lib/librte_eal/common/eal_common_vdev.c index eab5f9d..fc5e2d2 100644 --- a/lib/librte_eal/common/eal_common_vdev.c +++ b/lib/librte_eal/common/eal_common_vdev.c @@ -181,7 +181,6 @@ alloc_devargs(const char *name, const char *args) if (!devargs) return NULL; - devargs->type = RTE_DEVTYPE_VIRTUAL; devargs->bus = rte_bus_from_name(VIRTUAL_BUS_NAME); if (args) devargs->args = strdup(args); diff --git a/lib/librte_eal/common/include/rte_devargs.h b/lib/librte_eal/common/include/rte_devargs.h index 6a26d3d..6e9e134 100644 --- a/lib/librte_eal/common/include/rte_devargs.h +++ b/lib/librte_eal/common/include/rte_devargs.h @@ -56,9 +56,9 @@ extern "C" { * Type of generic device */ enum rte_devtype { - RTE_DEVTYPE_WHITELISTED_PCI, - RTE_DEVTYPE_BLACKLISTED_PCI, - RTE_DEVTYPE_VIRTUAL, + RTE_DEVTYPE_UNDEFINED, + RTE_DEVTYPE_WHITELISTED, + RTE_DEVTYPE_BLACKLISTED, }; /** -- 2.1.4