All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aaron Conole <aconole@redhat.com>
To: Gaetan Rivet <gaetan.rivet@6wind.com>
Cc: dev@dpdk.org
Subject: Re: [PATCH v2 02/18] eal: remove generic devtype
Date: Tue, 17 Oct 2017 14:16:59 -0400	[thread overview]
Message-ID: <f7t4lqxskpw.fsf@dhcp-25-97.bos.redhat.com> (raw)
In-Reply-To: <fe75f2880b9ba207fec41bdd7be89751b97f4e17.1507796100.git.gaetan.rivet@6wind.com> (Gaetan Rivet's message of "Thu, 12 Oct 2017 10:21:09 +0200")

Gaetan Rivet <gaetan.rivet@6wind.com> writes:

> The devtype is now entirely defined by the device bus. As such, it is
> already characterized by the bus identifier within an rte_devargs.
>
> The rte_devtype enum can disappear, along with crutches added during
> this transition.
>
> rte_eal_devargs_type_count becomes useless and is removed.
>
> Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
> ---
>  drivers/bus/pci/pci_common.c                    | 16 ++------------
>  lib/librte_eal/bsdapp/eal/rte_eal_version.map   |  1 -
>  lib/librte_eal/common/eal_common_devargs.c      | 20 +----------------
>  lib/librte_eal/common/eal_common_options.c      | 19 +++++-----------
>  lib/librte_eal/common/include/rte_dev.h         |  8 -------
>  lib/librte_eal/common/include/rte_devargs.h     | 29 +------------------------
>  lib/librte_eal/linuxapp/eal/rte_eal_version.map |  1 -
>  7 files changed, 9 insertions(+), 85 deletions(-)
>
> diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c
> index bbe862b..5fbcf11 100644
> --- a/drivers/bus/pci/pci_common.c
> +++ b/drivers/bus/pci/pci_common.c
> @@ -172,15 +172,6 @@ rte_pci_probe_one_driver(struct rte_pci_driver *dr,
>  			loc->domain, loc->bus, loc->devid, loc->function,
>  			dev->device.numa_node);
>  
> -	/* no initialization when blacklisted, return without error */
> -	if (dev->device.devargs != NULL &&
> -		dev->device.devargs->policy ==
> -			RTE_DEV_BLACKLISTED) {
> -		RTE_LOG(INFO, EAL, "  Device is blacklisted, not"
> -			" initializing\n");
> -		return 1;
> -	}
> -
>  	if (dev->device.numa_node < 0) {
>  		RTE_LOG(WARNING, EAL, "  Invalid NUMA socket, default to 0\n");
>  		dev->device.numa_node = 0;
> @@ -380,11 +371,8 @@ rte_pci_probe(void)
>  		probed++;
>  
>  		devargs = dev->device.devargs;
> -		/* probe all or only whitelisted devices */
> -		if (probe_all)
> -			ret = pci_probe_all_drivers(dev);
> -		else if (devargs != NULL &&
> -			devargs->policy == RTE_DEV_WHITELISTED)
> +		/* probe all or only declared devices */
> +		if (probe_all ^ (devargs != NULL))

What is the intent of this?  If probe_all is true, and devargs != null,
I think this branch isn't taken.

Shouldn't this be ||?  Maybe I missed something?

>  			ret = pci_probe_all_drivers(dev);
>  		if (ret < 0) {
>  			RTE_LOG(ERR, EAL, "Requested device " PCI_PRI_FMT
> diff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map
> index 573869a..47416a5 100644
> --- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map
> +++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map
> @@ -22,7 +22,6 @@ DPDK_2.0 {
>  	rte_eal_alarm_set;
>  	rte_eal_devargs_add;
>  	rte_eal_devargs_dump;
> -	rte_eal_devargs_type_count;
>  	rte_eal_get_configuration;
>  	rte_eal_get_lcore_state;
>  	rte_eal_get_physmem_layout;
> diff --git a/lib/librte_eal/common/eal_common_devargs.c b/lib/librte_eal/common/eal_common_devargs.c
> index e371456..2fddbfa 100644
> --- a/lib/librte_eal/common/eal_common_devargs.c
> +++ b/lib/librte_eal/common/eal_common_devargs.c
> @@ -153,7 +153,7 @@ rte_eal_devargs_insert(struct rte_devargs *da)
>  
>  /* store a whitelist parameter for later parsing */
>  int
> -rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str)
> +rte_eal_devargs_add(const char *devargs_str)
>  {
>  	struct rte_devargs *devargs = NULL;
>  	const char *dev = devargs_str;
> @@ -165,9 +165,6 @@ rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str)
>  
>  	if (rte_eal_devargs_parse(dev, devargs))
>  		goto fail;
> -	devargs->type = devtype;
> -	if (devargs->type == RTE_DEVTYPE_BLACKLISTED_PCI)
> -		devargs->policy = RTE_DEV_BLACKLISTED;
>  	TAILQ_INSERT_TAIL(&devargs_list, devargs, next);
>  	return 0;
>  
> @@ -198,21 +195,6 @@ rte_eal_devargs_remove(const char *busname, const char *devname)
>  	return 1;
>  }
>  
> -/* count the number of devices of a specified type */
> -unsigned int
> -rte_eal_devargs_type_count(enum rte_devtype devtype)
> -{
> -	struct rte_devargs *devargs;
> -	unsigned int count = 0;
> -
> -	TAILQ_FOREACH(devargs, &devargs_list, next) {
> -		if (devargs->type != devtype)
> -			continue;
> -		count++;
> -	}
> -	return count;
> -}
> -
>  /* dump the user devices on the console */
>  void
>  rte_eal_devargs_dump(FILE *f)
> diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
> index d57cb5d..603df27 100644
> --- a/lib/librte_eal/common/eal_common_options.c
> +++ b/lib/librte_eal/common/eal_common_options.c
> @@ -131,7 +131,6 @@ TAILQ_HEAD(device_option_list, device_option);
>  struct device_option {
>  	TAILQ_ENTRY(device_option) next;
>  
> -	enum rte_devtype type;
>  	char arg[];
>  };
>  
> @@ -143,8 +142,7 @@ static int mem_parsed;
>  static int core_parsed;
>  
>  static int
> -eal_option_device_add(enum rte_devtype type,
> -		      const char *busname, const char *optarg)
> +eal_option_device_add(const char *busname, const char *optarg)
>  {
>  	struct device_option *devopt;
>  	size_t optlen;
> @@ -159,7 +157,6 @@ eal_option_device_add(enum rte_devtype type,
>  		return -ENOMEM;
>  	}
>  
> -	devopt->type = type;
>  	if (busname != NULL)
>  		ret = snprintf(devopt->arg, optlen, "%s:%s",
>  			       busname, optarg);
> @@ -183,7 +180,7 @@ eal_option_device_parse(void)
>  
>  	TAILQ_FOREACH_SAFE(devopt, &devopt_list, next, tmp) {
>  		if (ret == 0) {
> -			ret = rte_eal_devargs_add(devopt->type, devopt->arg);
> +			ret = rte_eal_devargs_add(devopt->arg);
>  			if (ret)
>  				RTE_LOG(ERR, EAL, "Unable to parse device '%s'\n",
>  					devopt->arg);
> @@ -1009,19 +1006,15 @@ eal_parse_common_option(int opt, const char *optarg,
>  	case 'b':
>  		if (rte_bus_probe_mode_set("pci", RTE_BUS_PROBE_BLACKLIST) < 0)
>  			return -1;
> -		if (eal_option_device_add(RTE_DEVTYPE_BLACKLISTED_PCI,
> -				"pci", optarg) < 0) {
> +		if (eal_option_device_add("pci", optarg) < 0)
>  			return -1;
> -		}
>  		break;
>  	/* whitelist */
>  	case 'w':
>  		if (rte_bus_probe_mode_set("pci", RTE_BUS_PROBE_WHITELIST) < 0)
>  			return -1;
> -		if (eal_option_device_add(RTE_DEVTYPE_WHITELISTED_PCI,
> -				"pci", optarg) < 0) {
> +		if (eal_option_device_add("pci", optarg) < 0)
>  			return -1;
> -		}
>  		break;
>  	/* coremask */
>  	case 'c':
> @@ -1128,10 +1121,8 @@ eal_parse_common_option(int opt, const char *optarg,
>  		break;
>  
>  	case OPT_VDEV_NUM:
> -		if (eal_option_device_add(RTE_DEVTYPE_VIRTUAL,
> -				"vdev", optarg) < 0) {
> +		if (eal_option_device_add("vdev", optarg) < 0)
>  			return -1;
> -		}
>  		break;
>  
>  	case OPT_SYSLOG_NUM:
> diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h
> index 4c4ac7e..5f090ed 100644
> --- a/lib/librte_eal/common/include/rte_dev.h
> +++ b/lib/librte_eal/common/include/rte_dev.h
> @@ -127,14 +127,6 @@ enum rte_kernel_driver {
>  };
>  
>  /**
> - * Device policies.
> - */
> -enum rte_dev_policy {
> -	RTE_DEV_WHITELISTED,
> -	RTE_DEV_BLACKLISTED,
> -};
> -
> -/**
>   * A generic memory resource representation.
>   */
>  struct rte_mem_resource {
> diff --git a/lib/librte_eal/common/include/rte_devargs.h b/lib/librte_eal/common/include/rte_devargs.h
> index 58d585d..e50c166 100644
> --- a/lib/librte_eal/common/include/rte_devargs.h
> +++ b/lib/librte_eal/common/include/rte_devargs.h
> @@ -53,15 +53,6 @@ extern "C" {
>  #include <rte_bus.h>
>  
>  /**
> - * Type of generic device
> - */
> -enum rte_devtype {
> -	RTE_DEVTYPE_WHITELISTED_PCI,
> -	RTE_DEVTYPE_BLACKLISTED_PCI,
> -	RTE_DEVTYPE_VIRTUAL,
> -};
> -
> -/**
>   * Structure that stores a device given by the user with its arguments
>   *
>   * A user device is a physical or a virtual device given by the user to
> @@ -74,10 +65,6 @@ enum rte_devtype {
>  struct rte_devargs {
>  	/** Next in list. */
>  	TAILQ_ENTRY(rte_devargs) next;
> -	/** Type of device. */
> -	enum rte_devtype type;
> -	/** Device policy. */
> -	enum rte_dev_policy policy;
>  	/** Bus handle for the device. */
>  	struct rte_bus *bus;
>  	/** Name of the device. */
> @@ -166,8 +153,6 @@ rte_eal_devargs_insert(struct rte_devargs *da);
>   * driver name is not checked by this function, it is done when probing
>   * the drivers.
>   *
> - * @param devtype
> - *   The type of the device.
>   * @param devargs_str
>   *   The arguments as given by the user.
>   *
> @@ -175,7 +160,7 @@ rte_eal_devargs_insert(struct rte_devargs *da);
>   *   - 0 on success
>   *   - A negative value on error
>   */
> -int rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str);
> +int rte_eal_devargs_add(const char *devargs_str);
>  
>  /**
>   * Remove a device from the user device list.
> @@ -196,18 +181,6 @@ int rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str);
>  int rte_eal_devargs_remove(const char *busname, const char *devname);
>  
>  /**
> - * Count the number of user devices of a specified type
> - *
> - * @param devtype
> - *   The type of the devices to counted.
> - *
> - * @return
> - *   The number of devices.
> - */
> -unsigned int
> -rte_eal_devargs_type_count(enum rte_devtype devtype);
> -
> -/**
>   * This function dumps the list of user device and their arguments.
>   *
>   * @param f
> diff --git a/lib/librte_eal/linuxapp/eal/rte_eal_version.map b/lib/librte_eal/linuxapp/eal/rte_eal_version.map
> index a2709e3..e1e2a50 100644
> --- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map
> +++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map
> @@ -22,7 +22,6 @@ DPDK_2.0 {
>  	rte_eal_alarm_set;
>  	rte_eal_devargs_add;
>  	rte_eal_devargs_dump;
> -	rte_eal_devargs_type_count;
>  	rte_eal_get_configuration;
>  	rte_eal_get_lcore_state;
>  	rte_eal_get_physmem_layout;

  reply	other threads:[~2017-10-17 18:17 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-25 16:07 [PATCH 0/6] devargs cleanup Gaetan Rivet
2017-08-25 16:07 ` [PATCH 1/6] devargs: introduce iterator Gaetan Rivet
2017-08-25 16:07 ` [PATCH 2/6] devargs: introduce foreach macro Gaetan Rivet
2017-08-25 16:07 ` [PATCH 3/6] vdev: do not reference devargs_list Gaetan Rivet
2017-08-25 16:07 ` [PATCH 4/6] bus/pci: " Gaetan Rivet
2017-08-25 16:07 ` [PATCH 5/6] test: remove rte_devargs unit tests Gaetan Rivet
2017-08-25 16:07 ` [PATCH 6/6] devargs: make devargs_list private Gaetan Rivet
2017-10-12  8:21 ` [PATCH v2 00/18] devargs cleanup Gaetan Rivet
2017-10-12  8:21   ` [PATCH v2 01/18] eal: prepend busname on legacy device declaration Gaetan Rivet
2017-12-11 13:57     ` Shreyansh Jain
2017-10-12  8:21   ` [PATCH v2 02/18] eal: remove generic devtype Gaetan Rivet
2017-10-17 18:16     ` Aaron Conole [this message]
2017-10-18  8:20       ` Gaëtan Rivet
2017-10-12  8:21   ` [PATCH v2 03/18] devargs: introduce iterator Gaetan Rivet
2017-10-12  8:21   ` [PATCH v2 04/18] devargs: introduce foreach macro Gaetan Rivet
2017-10-12  8:21   ` [PATCH v2 05/18] vdev: do not reference devargs list Gaetan Rivet
2017-10-12  8:21   ` [PATCH v2 06/18] bus/pci: " Gaetan Rivet
2017-10-12  8:21   ` [PATCH v2 07/18] test: remove devargs unit tests Gaetan Rivet
2017-10-12  8:21   ` [PATCH v2 08/18] devargs: make devargs list private Gaetan Rivet
2017-10-12  8:21   ` [PATCH v2 09/18] devargs: make parsing variadic Gaetan Rivet
2017-10-12  8:21   ` [PATCH v2 10/18] devargs: require bus name prefix Gaetan Rivet
2017-10-12  8:21   ` [PATCH v2 11/18] devargs: simplify implementation Gaetan Rivet
2017-10-16 11:39     ` Shreyansh Jain
2017-10-16 11:42       ` Shreyansh Jain
2017-10-16 13:42         ` Gaëtan Rivet
2017-10-17  5:58           ` Shreyansh Jain
2017-10-12  8:21   ` [PATCH v2 12/18] eal: add generic device declaration parameter Gaetan Rivet
2017-12-13 14:26     ` Shreyansh Jain
2017-12-13 14:47       ` Gaëtan Rivet
2017-12-13 15:24         ` Shreyansh Jain
2017-10-12  8:21   ` [PATCH v2 13/18] bus: make device recognition function public Gaetan Rivet
2017-10-12  8:21   ` [PATCH v2 14/18] net/failsafe: keep legacy sub-device declaration Gaetan Rivet
2017-10-12  8:21   ` [PATCH v2 15/18] ether: use new devargs parsing function Gaetan Rivet
2017-10-12  8:21   ` [PATCH v2 16/18] devargs: remove old " Gaetan Rivet
2017-10-12  8:21   ` [PATCH v2 17/18] devargs: use proper prefix Gaetan Rivet
2017-10-12  8:21   ` [PATCH v2 18/18] doc: remove devargs deprecation notices Gaetan Rivet
2017-10-12 11:28     ` Mcnamara, John
2017-12-13 10:17     ` Shreyansh Jain
2017-12-13 10:25       ` Gaëtan Rivet
2017-12-13 10:54         ` Shreyansh Jain
2017-12-22  4:59           ` Shreyansh Jain
2017-12-22  8:33             ` Gaëtan Rivet
2017-10-17 18:18   ` [PATCH v2 00/18] devargs cleanup Aaron Conole
2017-10-18  8:36     ` Gaëtan Rivet
2018-03-20 23:20   ` [PATCH v3 00/10] " Gaetan Rivet
2018-03-20 23:20     ` [PATCH v3 01/10] devargs: introduce iterator Gaetan Rivet
2018-03-21  5:43       ` Tan, Jianfeng
2018-03-21  8:50         ` Gaëtan Rivet
2018-03-20 23:20     ` [PATCH v3 02/10] devargs: introduce foreach macro Gaetan Rivet
2018-04-22 21:42       ` Thomas Monjalon
2018-03-20 23:20     ` [PATCH v3 03/10] bus/vdev: do not reference devargs list Gaetan Rivet
2018-03-21  5:41       ` Tan, Jianfeng
2018-03-20 23:20     ` [PATCH v3 04/10] bus/pci: " Gaetan Rivet
2018-03-20 23:20     ` [PATCH v3 05/10] net/vdev_netvsc: " Gaetan Rivet
2018-03-20 23:20     ` [PATCH v3 06/10] test: remove devargs unit tests Gaetan Rivet
2018-03-20 23:20     ` [PATCH v3 07/10] devargs: make devargs list private Gaetan Rivet
2018-04-22 21:46       ` Thomas Monjalon
2018-03-20 23:20     ` [PATCH v3 08/10] devargs: make parsing variadic Gaetan Rivet
2018-04-22 21:52       ` Thomas Monjalon
2018-03-20 23:20     ` [PATCH v3 09/10] devargs: use proper namespace prefix Gaetan Rivet
2018-03-20 23:20     ` [PATCH v3 10/10] devargs: rename legacy API Gaetan Rivet
2018-04-22 22:00     ` [PATCH v3 00/10] devargs cleanup Thomas Monjalon
2018-04-23 22:41 ` [PATCH v4 " Gaetan Rivet
2018-04-23 22:41   ` [PATCH v4 01/10] devargs: introduce iterator Gaetan Rivet
2018-04-23 23:54     ` Stephen Hemminger
2018-04-24 10:22       ` Gaëtan Rivet
2018-04-23 22:41   ` [PATCH v4 02/10] devargs: introduce foreach macro Gaetan Rivet
2018-04-23 23:56     ` Stephen Hemminger
2018-04-24 10:26       ` Gaëtan Rivet
2018-04-23 22:41   ` [PATCH v4 03/10] bus/vdev: do not reference devargs list Gaetan Rivet
2018-04-23 22:41   ` [PATCH v4 04/10] bus/pci: " Gaetan Rivet
2018-04-23 22:41   ` [PATCH v4 05/10] net/vdev_netvsc: " Gaetan Rivet
2018-04-23 22:41   ` [PATCH v4 06/10] test: remove devargs unit tests Gaetan Rivet
2018-04-23 22:41   ` [PATCH v4 07/10] devargs: make devargs list private Gaetan Rivet
2018-04-23 22:41   ` [PATCH v4 08/10] devargs: make parsing variadic Gaetan Rivet
2018-04-23 22:41   ` [PATCH v4 09/10] devargs: use proper namespace prefix Gaetan Rivet
2018-04-23 22:41   ` [PATCH v4 10/10] devargs: rename legacy API Gaetan Rivet
2018-04-23 23:54 ` [PATCH v5 00/10] devargs cleanup Gaetan Rivet
2018-04-23 23:54   ` [PATCH v5 01/10] devargs: introduce iterator Gaetan Rivet
2018-04-23 23:54   ` [PATCH v5 02/10] bus/vdev: do not reference devargs list Gaetan Rivet
2018-04-23 23:54   ` [PATCH v5 03/10] bus/pci: " Gaetan Rivet
2018-04-23 23:54   ` [PATCH v5 04/10] net/vdev_netvsc: " Gaetan Rivet
2018-04-23 23:54   ` [PATCH v5 05/10] test: remove devargs unit tests Gaetan Rivet
2018-04-25  0:45     ` Thomas Monjalon
2018-04-23 23:54   ` [PATCH v5 06/10] devargs: make devargs list private Gaetan Rivet
2018-04-23 23:54   ` [PATCH v5 07/10] devargs: make parsing variadic Gaetan Rivet
2018-04-23 23:54   ` [PATCH v5 08/10] devargs: update devargs add documentation Gaetan Rivet
2018-04-23 23:54   ` [PATCH v5 09/10] devargs: use proper namespace prefix Gaetan Rivet
2018-04-23 23:54   ` [PATCH v5 10/10] devargs: rename legacy API Gaetan Rivet
2018-04-25  1:51     ` Thomas Monjalon
2018-04-25  1:57   ` [PATCH v5 00/10] devargs cleanup Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f7t4lqxskpw.fsf@dhcp-25-97.bos.redhat.com \
    --to=aconole@redhat.com \
    --cc=dev@dpdk.org \
    --cc=gaetan.rivet@6wind.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.