From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f171.google.com (mail-wr0-f171.google.com [209.85.128.171]) by dpdk.org (Postfix) with ESMTP id 4EC047CB3 for ; Wed, 24 May 2017 18:17:14 +0200 (CEST) Received: by mail-wr0-f171.google.com with SMTP id j27so4272463wre.1 for ; Wed, 24 May 2017 09:17:14 -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=/Y2mlEwtEuvF2GfsZr/uyGlX/1xgAwuTJHW9GCIgE2c=; b=zIFGfVcr5wZ8EwTO6GUpwEB7o5egtdYf7IWTU1jGg7rl7qgnb315J1PJpbD6eMX6uV R1EhsfwImWdKDhLVsD5CDRLAWRAIfR0UpkpdJ238QWFwUBq5zbAQVki0Q0V+MChNgRtc 9QIynz/6owo6fIdEqsZ3E9vMTdhSl8ntFHlBEu4JADcv5mgIusPKJ8GeWnLgYFKdB+v6 E+V5lmvhuTVIp5B6Curmbt8lFTmsTAxWHBy7wetlQS8mTMemCoBvEkJB4MMTW110KZ7m 4QWEdbUnaI/WXm5YOCIT32HnaeRNaN34XKsr1pM7lEQ2q1xYA/a/KzwsDjTMJkHkJEYe 3bhw== 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=/Y2mlEwtEuvF2GfsZr/uyGlX/1xgAwuTJHW9GCIgE2c=; b=XJDcMXKiE1VvOnsRX9WhIlCPyIXKz5WLqyRvBISo4aF8yx/URSMGQULO4KlnL1+nj0 SuskMCeabY29Nl50YVn807xkk55ND/3ntjb7Gc+0ZDR2h+Wv8y9gkRm+YVzU7zJGtoYb oUNeXiuj7NEZp7ElaZ44RVEvxrqvUdCELPAnLlKynIg4ILyc1Mqnffk7dzW+OXxiswPb CN/Lj/3BIzfcjaIhwHHjh7rd1B18vcilP7Q9DaN4fvVzuEEf07rrhQ1eLvUbGtCIUBmw oAq6abBLo+03fdE4fBDNdTGJAlSqvppjxPlMuslaRTevtoC8zXIElwKSpyHE7JrySLIo E69Q== X-Gm-Message-State: AODbwcDx1uKNklCQ6aTfjEGaSSFFeKujZ7kz13DiNLHO4/++XzRTizEP VDunROscRl84l0wBb9Q= X-Received: by 10.223.165.138 with SMTP id g10mr4914454wrc.192.1495642633513; Wed, 24 May 2017 09:17:13 -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.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 May 2017 09:17:12 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Wed, 24 May 2017 18:16:48 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 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 16:17:15 -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 b26ebf0..7c385f4 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