DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Zijie Pan <zijie.pan@6wind.com>
Cc: dev@dpdk.org, remy.horton@intel.com, john.mcnamara@intel.com,
	marko.kovacevic@intel.com
Subject: Re: [dpdk-dev] [PATCH v3 1/5] ethdev: add access to eeprom
Date: Sun, 22 Apr 2018 23:13:19 +0200	[thread overview]
Message-ID: <1548391.i1eeGyJj9X@xps> (raw)
In-Reply-To: <1521630379-9554-2-git-send-email-zijie.pan@6wind.com>

Hi Zijie,

21/03/2018 12:06, Zijie Pan:
> +/*
> + * Placeholder for accessing plugin module eeprom
> + */

I think you missed a "*" to make it a doxygen comment.

> +struct rte_dev_module_info {
> +	uint32_t type; /**< Type of plugin module eeprom */
> +	uint32_t eeprom_len; /**< Length of plugin module eeprom */
> +};
> +
> +/* EEPROM Standards for plug in modules */
> +#define ETH_MODULE_SFF_8079             0x1
> +#define ETH_MODULE_SFF_8079_LEN         256
> +#define ETH_MODULE_SFF_8472             0x2
> +#define ETH_MODULE_SFF_8472_LEN         512
> +#define ETH_MODULE_SFF_8636             0x3
> +#define ETH_MODULE_SFF_8636_LEN         256
> +#define ETH_MODULE_SFF_8436             0x4
> +#define ETH_MODULE_SFF_8436_LEN         256

Can you add a RTE_ prefix please?

> --- a/lib/librte_ether/rte_ethdev.c
> +++ b/lib/librte_ether/rte_ethdev.c
> @@ -4044,6 +4044,32 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,
>  }
>  
>  int
> +rte_eth_dev_get_module_info(uint16_t port_id,
> +			    struct rte_dev_module_info *modinfo)
> +{
> +	struct rte_eth_dev *dev;
> +
> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> +
> +	dev = &rte_eth_devices[port_id];
> +	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->get_module_info, -ENOTSUP);
> +	return (*dev->dev_ops->get_module_info)(dev, modinfo);
> +}
> +
> +	int
> +rte_eth_dev_get_module_eeprom(uint16_t port_id,
> +		struct rte_dev_eeprom_info *info)
> +{
> +	struct rte_eth_dev *dev;
> +
> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> +
> +	dev = &rte_eth_devices[port_id];
> +	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->get_module_eeprom, -ENOTSUP);
> +	return (*dev->dev_ops->get_module_eeprom)(dev, info);
> +}
> +
> +int
>  rte_eth_dev_get_dcb_info(uint16_t port_id,

Please move these new functions after other eeprom functions.

> --- a/lib/librte_ether/rte_ethdev.h
> +++ b/lib/librte_ether/rte_ethdev.h
>  /**
> + * Retrieve the type and size of plugin module EEPROM
> + *
> + * @param port_id
> + *   The port identifier of the Ethernet device.
> + * @param modinfo
> + *   The type and size of plugin module EEPROM.
> + * @return
> + *   - (0) if successful.
> + *   - (-ENOTSUP) if hardware doesn't support.
> + *   - (-ENODEV) if *port_id* invalid.
> + *   - (-EIO) if device is removed.
> + *   - others depends on the specific operations implementation.
> + */
> +int rte_eth_dev_get_module_info(uint16_t port_id,
> +				struct rte_dev_module_info *modinfo);
> +
> +/**
> + * Retrieve the data of plugin module EEPROM
> + *
> + * @param port_id
> + *   The port identifier of the Ethernet device.
> + * @param info
> + *   The template includes the plugin module EEPROM attributes, and the
> + *   buffer for return plugin module EEPROM data.
> + * @return
> + *   - (0) if successful.
> + *   - (-ENOTSUP) if hardware doesn't support.
> + *   - (-ENODEV) if *port_id* invalid.
> + *   - (-EIO) if device is removed.
> + *   - others depends on the specific operations implementation.
> + */
> +int rte_eth_dev_get_module_eeprom(uint16_t port_id,
> +				  struct rte_dev_eeprom_info *info);

Please add the usual EXPERIMENTAL warnings for the new functions.

> --- a/lib/librte_ether/rte_ethdev_version.map
> +++ b/lib/librte_ether/rte_ethdev_version.map
> @@ -201,6 +201,8 @@ DPDK_18.02 {
>  	global:
>  
>  	rte_eth_dev_filter_ctrl;
> +	rte_eth_dev_get_module_info;
> +	rte_eth_dev_get_module_eeprom;

As noticed by Ferruh, they should be experimental.

  parent reply	other threads:[~2018-04-22 21:13 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-12  4:17 [dpdk-dev] [PATCH 0/5] Patches to get the information and data of EEPROM Zijie Pan
2018-03-12  4:17 ` [dpdk-dev] [PATCH 1/5] ethdev: add access to eeprom Zijie Pan
2018-03-13 14:51   ` Remy Horton
2018-03-16  9:38   ` [dpdk-dev] [PATCH v2 " Zijie Pan
2018-03-16  9:59     ` Remy Horton
2018-03-12  4:17 ` [dpdk-dev] [PATCH 2/5] examples/ethtool: add a new command module-eeprom Zijie Pan
2018-03-13 14:46   ` Remy Horton
2018-03-16  9:41   ` [dpdk-dev] [PATCH v2 " Zijie Pan
2018-03-16  9:59     ` Remy Horton
2018-03-12  4:17 ` [dpdk-dev] [PATCH 3/5] net/ixgbe: add module EEPROM callbacks for ixgbe Zijie Pan
2018-03-13 14:46   ` Remy Horton
2018-03-16  9:42   ` [dpdk-dev] [PATCH v2 " Zijie Pan
2018-03-16 10:08     ` Remy Horton
2018-03-12  4:17 ` [dpdk-dev] [PATCH 4/5] net/e1000: add module EEPROM callbacks for e1000 Zijie Pan
2018-03-16  9:42   ` [dpdk-dev] [PATCH v2 " Zijie Pan
2018-03-12  4:17 ` [dpdk-dev] [PATCH 5/5] net/i40e: add module EEPROM callbacks for i40e Zijie Pan
2018-03-16  9:42   ` [dpdk-dev] [PATCH v2 " Zijie Pan
2018-03-13 15:19 ` [dpdk-dev] [PATCH 0/5] Patches to get the information and data of EEPROM Remy Horton
2018-03-16  9:36 ` [dpdk-dev] [PATCH v2 0/5] " Zijie Pan
2018-03-21 11:06   ` [dpdk-dev] [PATCH v3 " Zijie Pan
2018-03-21 11:06     ` [dpdk-dev] [PATCH v3 1/5] ethdev: add access to eeprom Zijie Pan
2018-04-19 13:34       ` Ferruh Yigit
2018-04-22 21:13       ` Thomas Monjalon [this message]
2018-03-21 11:06     ` [dpdk-dev] [PATCH v3 2/5] examples/ethtool: add a new command module-eeprom Zijie Pan
2018-03-21 11:06     ` [dpdk-dev] [PATCH v3 3/5] net/ixgbe: add module EEPROM callbacks for ixgbe Zijie Pan
2018-03-21 11:06     ` [dpdk-dev] [PATCH v3 4/5] net/e1000: add module EEPROM callbacks for e1000 Zijie Pan
2018-03-21 11:06     ` [dpdk-dev] [PATCH v3 5/5] net/i40e: add module EEPROM callbacks for i40e Zijie Pan
2018-04-19 13:36     ` [dpdk-dev] [PATCH v3 0/5] get the information and data of EEPROM Ferruh Yigit
2018-04-19 14:17       ` Remy Horton
2018-04-24 10:17     ` [dpdk-dev] [PATCH v4 " Zijie Pan
2018-04-24 10:17       ` [dpdk-dev] [PATCH v4 1/5] ethdev: add access to eeprom Zijie Pan
2018-04-24 10:25         ` Thomas Monjalon
2018-04-25  8:21           ` Zijie Pan
2018-04-25  8:31             ` Thomas Monjalon
2018-04-24 10:17       ` [dpdk-dev] [PATCH v4 2/5] examples/ethtool: add a new command module-eeprom Zijie Pan
2018-04-24 10:17       ` [dpdk-dev] [PATCH v4 3/5] net/ixgbe: add module EEPROM callbacks for ixgbe Zijie Pan
2018-04-24 10:17       ` [dpdk-dev] [PATCH v4 4/5] net/e1000: add module EEPROM callbacks for e1000 Zijie Pan
2018-04-24 10:17       ` [dpdk-dev] [PATCH v4 5/5] net/i40e: add module EEPROM callbacks for i40e Zijie Pan
2018-04-20  9:06 [dpdk-dev] [PATCH v3 1/5] ethdev: add access to eeprom Zijie Pan

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=1548391.i1eeGyJj9X@xps \
    --to=thomas@monjalon.net \
    --cc=dev@dpdk.org \
    --cc=john.mcnamara@intel.com \
    --cc=marko.kovacevic@intel.com \
    --cc=remy.horton@intel.com \
    --cc=zijie.pan@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 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).