DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: Liang-Min Larry Wang <liang-min.wang@intel.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v14 1/4] ethdev: add apis to support access device info
Date: Tue, 14 Jul 2015 00:26:38 +0200	[thread overview]
Message-ID: <27632259.laExyItStL@xps13> (raw)
In-Reply-To: <1436736155-9748-2-git-send-email-liang-min.wang@intel.com>

2015-07-12 17:22, Liang-Min Larry Wang:
> --- a/lib/librte_ether/rte_ethdev.c
> +++ b/lib/librte_ether/rte_ethdev.c
> @@ -2542,6 +2542,30 @@ rte_eth_dev_mac_addr_remove(uint8_t port_id, struct ether_addr *addr)
>  }
>  
>  int
> +rte_eth_dev_default_mac_addr_set(uint8_t port_id, struct ether_addr *addr)
> +{
> +	struct rte_eth_dev *dev;
> +
> +	if (!rte_eth_dev_is_valid_port(port_id)) {
> +		PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
> +		return -ENODEV;
> +	}
> +
> +	if (!is_valid_assigned_ether_addr(addr))
> +		return -EINVAL;
> +
> +	dev = &rte_eth_devices[port_id];
> +	FUNC_PTR_OR_ERR_RET(*dev->dev_ops->mac_addr_set, -ENOTSUP);
> +
> +	/* Update default address in NIC data structure */
> +	ether_addr_copy(addr, &dev->data->mac_addrs[0]);
> +
> +	(*dev->dev_ops->mac_addr_set)(dev, addr);
> +
> +	return 0;
> +}

It would be cleaner/clearer in a separate patch.
Why not using VALID_PORTID_OR_ERR_RET instead of rte_eth_dev_is_valid_port?

> +int
> +rte_eth_dev_reg_length(uint8_t port_id)
[...]
> +	return (*dev->dev_ops->get_reg_length)(dev);
> +}
[...]
> +int
> +rte_eth_dev_reg_info(uint8_t port_id, struct rte_dev_reg_info *info)
[...]
> +	return (*dev->dev_ops->get_reg)(dev, info);
> +}
[...]
> +int
> +rte_eth_dev_eeprom_length(uint8_t port_id)
[...]
> +	return (*dev->dev_ops->get_eeprom_length)(dev);
> +}

These functions should have the "get" word in their names.

> --- a/lib/librte_ether/rte_ether_version.map
> +++ b/lib/librte_ether/rte_ether_version.map
> @@ -102,6 +102,12 @@ DPDK_2.0 {
>  	rte_eth_tx_queue_setup;
>  	rte_eth_xstats_get;
>  	rte_eth_xstats_reset;
> +	rte_eth_dev_default_mac_addr_set;
> +	rte_eth_dev_reg_length;
> +	rte_eth_dev_reg_info;
> +	rte_eth_dev_eeprom_length;
> +	rte_eth_dev_get_eeprom;
> +	rte_eth_dev_set_eeprom;

The new symbols should be in a new node for DPDK 2.1.

  reply	other threads:[~2015-07-13 22:27 UTC|newest]

Thread overview: 148+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-30  0:37 [dpdk-dev] [PATCH 0/2] User-space Ethtool Liang-Min Larry Wang
2015-05-30  0:37 ` [dpdk-dev] [PATCH 1/2] ethdev: add api to set default mac address Liang-Min Larry Wang
2015-05-30  1:57   ` Andrew Harvey (agh)
2015-05-30  0:37 ` [dpdk-dev] [PATCH 2/2] ethtool: add new library to provide ethtool-alike APIs Liang-Min Larry Wang
2015-05-30 15:48   ` Stephen Hemminger
2015-05-30 16:16     ` Wang, Liang-min
2015-05-30 19:26       ` Stephen Hemminger
2015-05-30 19:40         ` Wang, Liang-min
2015-05-31 16:48           ` Stephen Hemminger
2015-05-31 17:30             ` Wang, Liang-min
2015-05-31 18:31             ` Wang, Liang-min
2015-06-01 12:42   ` David Harton (dharton)
2015-06-10 15:09 ` [dpdk-dev] [PATCH v4 0/4] User-space Ethtool Liang-Min Larry Wang
2015-06-10 15:09   ` [dpdk-dev] [PATCH v4 1/4] ethdev: add apis to support access device info Liang-Min Larry Wang
2015-06-10 15:21     ` David Harton (dharton)
2015-06-11 12:26     ` Ananyev, Konstantin
2015-06-11 12:57       ` Wang, Liang-min
2015-06-11 13:07         ` Ananyev, Konstantin
2015-06-11 21:51           ` Wang, Liang-min
2015-06-12 12:30             ` Ananyev, Konstantin
2015-06-15 13:26               ` Wang, Liang-min
2015-06-15 13:45                 ` Ananyev, Konstantin
2015-06-15 14:47                   ` Wang, Liang-min
2015-06-15 18:10                     ` Ananyev, Konstantin
2015-06-17 17:25                       ` Ananyev, Konstantin
2015-06-15 16:05                   ` David Harton (dharton)
2015-06-15 18:23                     ` Ananyev, Konstantin
2015-06-16 18:15                       ` Ananyev, Konstantin
2015-06-11 13:14         ` Ananyev, Konstantin
2015-06-11 13:25           ` Wang, Liang-min
2015-06-10 15:09   ` [dpdk-dev] [PATCH v4 2/4] ixgbe: add ops to support ethtool ops Liang-Min Larry Wang
2015-06-10 15:09   ` [dpdk-dev] [PATCH v4 3/4] igb: " Liang-Min Larry Wang
2015-06-10 15:09   ` [dpdk-dev] [PATCH v4 4/4] examples: new example: l2fwd-ethtool Liang-Min Larry Wang
2015-06-11 21:43 ` [dpdk-dev] [PATCH v5 0/4] User-space Ethtool Liang-Min Larry Wang
2015-06-11 21:43   ` [dpdk-dev] [PATCH v5 1/4] ethdev: add apis to support access device info Liang-Min Larry Wang
2015-06-11 21:43   ` [dpdk-dev] [PATCH v5 2/4] ixgbe: add ops to support ethtool ops Liang-Min Larry Wang
2015-06-11 21:43   ` [dpdk-dev] [PATCH v5 3/4] igb: " Liang-Min Larry Wang
2015-06-11 21:43   ` [dpdk-dev] [PATCH v5 4/4] examples: new example: l2fwd-ethtool Liang-Min Larry Wang
2015-06-12 22:03 ` [dpdk-dev] [PATCH v6 0/4] User-space Ethtool Liang-Min Larry Wang
2015-06-12 22:03   ` [dpdk-dev] [PATCH v6 1/4] ethdev: add apis to support access device info Liang-Min Larry Wang
2015-06-13 23:25     ` David Harton (dharton)
2015-06-12 22:03   ` [dpdk-dev] [PATCH v6 2/4] ixgbe: add ops to support ethtool ops Liang-Min Larry Wang
2015-06-12 22:03   ` [dpdk-dev] [PATCH v6 3/4] igb: " Liang-Min Larry Wang
2015-06-12 22:03   ` [dpdk-dev] [PATCH v6 4/4] examples: new example: l2fwd-ethtool Liang-Min Larry Wang
2015-06-13  0:21   ` [dpdk-dev] [PATCH v6 0/4] User-space Ethtool Andrew Harvey (agh)
2015-06-17 22:22 ` [dpdk-dev] [PATCH v7 " Liang-Min Larry Wang
2015-06-17 22:22   ` [dpdk-dev] [PATCH v7 1/4] ethdev: add apis to support access device info Liang-Min Larry Wang
2015-06-25 13:39     ` Stephen Hemminger
2015-06-25 20:58       ` Wang, Liang-min
2015-06-25 13:44     ` Stephen Hemminger
2015-06-25 21:05       ` Wang, Liang-min
2015-06-17 22:22   ` [dpdk-dev] [PATCH v7 2/4] ixgbe: add ops to support ethtool ops Liang-Min Larry Wang
2015-06-25 13:45     ` Stephen Hemminger
2015-06-26  6:26       ` Andrew Harvey (agh)
2015-06-17 22:22   ` [dpdk-dev] [PATCH v7 3/4] igb: " Liang-Min Larry Wang
2015-06-17 22:22   ` [dpdk-dev] [PATCH v7 4/4] examples: new example: l2fwd-ethtool Liang-Min Larry Wang
2015-06-18  2:04   ` [dpdk-dev] [PATCH v7 0/4] User-space Ethtool Stephen Hemminger
2015-06-18 12:47     ` Wang, Liang-min
2015-06-23 15:19       ` Wang, Liang-min
2015-06-24 13:55   ` Andrew Harvey (agh)
2015-06-24 17:16   ` David Harton (dharton)
2015-06-26 14:26 ` [dpdk-dev] [PATCH v8 0/5] " Liang-Min Larry Wang
2015-06-26 14:26   ` [dpdk-dev] [PATCH v8 1/5] ethdev: add apis to support access device info Liang-Min Larry Wang
2015-06-26 16:51     ` Stephen Hemminger
2015-06-26 17:05       ` Wang, Liang-min
2015-06-27  1:21       ` Wang, Liang-min
2015-06-26 14:26   ` [dpdk-dev] [PATCH v8 2/5] ixgbe: add ops to support ethtool ops Liang-Min Larry Wang
2015-06-26 14:26   ` [dpdk-dev] [PATCH v8 3/5] igb: " Liang-Min Larry Wang
2015-06-26 14:26   ` [dpdk-dev] [PATCH v8 4/5] examples: new example: l2fwd-ethtool Liang-Min Larry Wang
2015-06-26 14:26   ` [dpdk-dev] [PATCH v8 5/5] Changed register tables to const Liang-Min Larry Wang
2015-06-26 19:15   ` [dpdk-dev] [PATCH v8 0/5] User-space Ethtool Ananyev, Konstantin
2015-06-27  1:19 ` [dpdk-dev] [PATCH v9 " Liang-Min Larry Wang
2015-06-27  1:19   ` [dpdk-dev] [PATCH v9 1/5] ethdev: add apis to support access device info Liang-Min Larry Wang
2015-06-27  1:19   ` [dpdk-dev] [PATCH v9 2/5] ixgbe: add ops to support ethtool ops Liang-Min Larry Wang
2015-06-27  1:32     ` Stephen Hemminger
2015-06-27  2:37       ` Wang, Liang-min
2015-06-27  1:34     ` Stephen Hemminger
2015-06-27  2:39       ` Wang, Liang-min
2015-06-27  1:34     ` Stephen Hemminger
2015-06-27  1:19   ` [dpdk-dev] [PATCH v9 3/5] igb: " Liang-Min Larry Wang
2015-06-27  1:35     ` Stephen Hemminger
2015-06-27  1:19   ` [dpdk-dev] [PATCH v9 4/5] examples: new example: l2fwd-ethtool Liang-Min Larry Wang
2015-06-27  1:19   ` [dpdk-dev] [PATCH v9 5/5] ixgbe/igb: changed register tables to const Liang-Min Larry Wang
2015-06-27  1:36     ` Stephen Hemminger
2015-06-27  1:50       ` Wang, Liang-min
2015-06-27  2:40       ` Wang, Liang-min
2015-07-10 12:55       ` Wang, Liang-min
2015-06-27  2:36 ` [dpdk-dev] [PATCH v10 0/4] User-space Ethtool Liang-Min Larry Wang
2015-06-27  2:36   ` [dpdk-dev] [PATCH v10 1/4] ethdev: add apis to support access device info Liang-Min Larry Wang
2015-06-27  2:36   ` [dpdk-dev] [PATCH v10 2/4] ixgbe: add ops to support ethtool ops Liang-Min Larry Wang
2015-06-27  2:36   ` [dpdk-dev] [PATCH v10 3/4] igb: " Liang-Min Larry Wang
2015-06-27  2:36   ` [dpdk-dev] [PATCH v10 4/4] examples: new example: l2fwd-ethtool Liang-Min Larry Wang
2015-06-27 12:25 ` [dpdk-dev] [PATCH v11 0/4] User-space Ethtool Liang-Min Larry Wang
2015-06-27 12:25   ` [dpdk-dev] [PATCH v11 1/4] ethdev: add apis to support access device info Liang-Min Larry Wang
2015-06-27 12:25   ` [dpdk-dev] [PATCH v11 2/4] ixgbe: add ops to support ethtool ops Liang-Min Larry Wang
2015-06-27 12:25   ` [dpdk-dev] [PATCH v11 3/4] igb: " Liang-Min Larry Wang
2015-06-27 12:25   ` [dpdk-dev] [PATCH v11 4/4] examples: new example: l2fwd-ethtool Liang-Min Larry Wang
2015-07-07 17:39 ` [dpdk-dev] [PATCH v12 0/4] User-space Ethtool Liang-Min Larry Wang
2015-07-07 17:39   ` [dpdk-dev] [PATCH v12 1/4] ethdev: add apis to support access device info Liang-Min Larry Wang
2015-07-07 17:39   ` [dpdk-dev] [PATCH v12 2/4] ixgbe: add ops to support ethtool ops Liang-Min Larry Wang
2015-07-07 17:39   ` [dpdk-dev] [PATCH v12 3/4] igb: " Liang-Min Larry Wang
2015-07-07 17:39   ` [dpdk-dev] [PATCH v12 4/4] examples: new example: l2fwd-ethtool Liang-Min Larry Wang
2015-07-10 12:48 ` [dpdk-dev] [PATCH v13 0/4] User-space Ethtool Liang-Min Larry Wang
2015-07-10 12:48   ` [dpdk-dev] [PATCH v13 1/4] ethdev: add apis to support access device info Liang-Min Larry Wang
2015-07-10 12:48   ` [dpdk-dev] [PATCH v13 2/4] ixgbe: add ops to support ethtool ops Liang-Min Larry Wang
2015-07-10 12:48   ` [dpdk-dev] [PATCH v13 3/4] igb: " Liang-Min Larry Wang
2015-07-10 12:48   ` [dpdk-dev] [PATCH v13 4/4] examples: new example: l2fwd-ethtool Liang-Min Larry Wang
2015-07-12 21:22 ` [dpdk-dev] [PATCH v14 0/4] User-space Ethtool Liang-Min Larry Wang
2015-07-12 21:22   ` [dpdk-dev] [PATCH v14 1/4] ethdev: add apis to support access device info Liang-Min Larry Wang
2015-07-13 22:26     ` Thomas Monjalon [this message]
2015-07-12 21:22   ` [dpdk-dev] [PATCH v14 2/4] ixgbe: add ops to support ethtool ops Liang-Min Larry Wang
2015-07-12 21:22   ` [dpdk-dev] [PATCH v14 3/4] igb: " Liang-Min Larry Wang
2015-07-12 21:22   ` [dpdk-dev] [PATCH v14 4/4] examples: new example: l2fwd-ethtool Liang-Min Larry Wang
2015-07-14  2:18 ` [dpdk-dev] [PATCH v15 0/4] User-space Ethtool Liang-Min Larry Wang
2015-07-14  2:18   ` [dpdk-dev] [PATCH v15 1/4] ethdev: add apis to support access device info Liang-Min Larry Wang
2015-07-15  6:16     ` Thomas Monjalon
2015-07-15 10:07       ` Wang, Liang-min
2015-07-15 10:27         ` Thomas Monjalon
2015-07-15 10:48           ` Wang, Liang-min
2015-07-15 11:20             ` Thomas Monjalon
2015-07-15 11:36               ` Wang, Liang-min
2015-07-15 12:06                 ` Thomas Monjalon
2015-07-14  2:18   ` [dpdk-dev] [PATCH v15 2/4] ixgbe: add ops to support ethtool ops Liang-Min Larry Wang
2015-07-14  2:18   ` [dpdk-dev] [PATCH v15 3/4] igb: " Liang-Min Larry Wang
2015-07-14  2:18   ` [dpdk-dev] [PATCH v15 4/4] examples: new example: l2fwd-ethtool Liang-Min Larry Wang
2015-07-14 13:11 ` [dpdk-dev] [PATCH v16 0/6] User-space Ethtool Liang-Min Larry Wang
2015-07-14 13:11   ` [dpdk-dev] [PATCH v16 1/6] ethdev: add apis to support access device info Liang-Min Larry Wang
2015-07-14 13:11   ` [dpdk-dev] [PATCH v16 2/6] ixgbe: add ops to support ethtool ops Liang-Min Larry Wang
2015-07-14 13:11   ` [dpdk-dev] [PATCH v16 3/6] igb: " Liang-Min Larry Wang
2015-07-14 13:11   ` [dpdk-dev] [PATCH v16 4/6] examples: new example: l2fwd-ethtool Liang-Min Larry Wang
2015-07-14 13:11   ` [dpdk-dev] [PATCH v16 5/6] ethdev: change api name, version information and fix macro Liang-Min Larry Wang
2015-07-14 13:11   ` [dpdk-dev] [PATCH v16 6/6] examples/l2fwd-ethtool: replace lib with new API name Liang-Min Larry Wang
2015-07-14 20:13   ` [dpdk-dev] [PATCH v16 0/6] User-space Ethtool Thomas Monjalon
2015-07-14 20:56     ` Wang, Liang-min
2015-07-15  5:53       ` Thomas Monjalon
2015-07-15 10:15         ` Wang, Liang-min
2015-07-15 10:30           ` Thomas Monjalon
2015-07-16 13:25 ` [dpdk-dev] [PATCH v17 0/5] " Liang-Min Larry Wang
2015-07-16 13:25   ` [dpdk-dev] [PATCH v17 1/5] ethdev: add api to support setting default mac addr Liang-Min Larry Wang
2015-07-16 13:25   ` [dpdk-dev] [PATCH v17 2/5] ethdev: add apis to support access device info Liang-Min Larry Wang
2015-07-16 13:25   ` [dpdk-dev] [PATCH v17 3/5] ixgbe: add ops to support ethtool ops Liang-Min Larry Wang
2015-07-16 13:25   ` [dpdk-dev] [PATCH v17 4/5] igb: " Liang-Min Larry Wang
2015-07-16 13:25   ` [dpdk-dev] [PATCH v17 5/5] examples: new example: l2fwd-ethtool Liang-Min Larry Wang
2015-07-16 21:25     ` Thomas Monjalon
2015-07-16 21:48   ` [dpdk-dev] [PATCH v17 0/5] User-space Ethtool Thomas Monjalon
2015-07-16 21:55     ` Wang, Liang-min
2015-07-16 22:09       ` Thomas Monjalon
2015-07-16 22:15         ` Wang, Liang-min

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=27632259.laExyItStL@xps13 \
    --to=thomas.monjalon@6wind.com \
    --cc=dev@dpdk.org \
    --cc=liang-min.wang@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).