All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Rybchenko <arybchenko@solarflare.com>
To: Qiming Yang <qiming.yang@intel.com>, <dev@dpdk.org>
Cc: <ferruh.yigit@intel.com>, <helin.zhang@intel.com>,
	<remy.horton@intel.com>
Subject: Re: [PATCH v5 1/5] ethdev: add firmware version get
Date: Sun, 8 Jan 2017 09:38:54 +0300	[thread overview]
Message-ID: <9a37d50f-8f14-b1a7-c960-6e0b8baf0b87@solarflare.com> (raw)
In-Reply-To: <1483848695-44643-2-git-send-email-qiming.yang@intel.com>

On 01/08/2017 07:11 AM, Qiming Yang wrote:
> This patch adds a new API 'rte_eth_dev_fw_version_get' for
> fetching firmware version by a given device.
>
> Signed-off-by: Qiming Yang <qiming.yang@intel.com>
> Acked-by: Remy Horton <remy.horton@intel.com>
> ---
> v2 changes:
> * modified some comment statements.
> v3 changes:
> * change API, use rte_eth_dev_fw_info_get(uint8_t port_id,
>    uint32_t *fw_major, uint32_t *fw_minor, uint32_t *fw_patch,
>    uint32_t *etrack_id) instead of rte_eth_dev_fwver_get(uint8_t port_id,
>    char *fw_version, int fw_length).
>    Add statusment in /doc/guides/nics/features/default.ini and
>    release_17_02.rst.
> v4 changes:
> * remove deprecation notice, rename API as rte_eth_dev_fw_version_get.
> v5 changes:
> * change API, use rte_eth_dev_fw_version_get(uint8_t port_id,
>    char *fw_version, int fw_length).
> ---
> ---
>   doc/guides/nics/features/default.ini   |  1 +
>   doc/guides/rel_notes/deprecation.rst   |  4 ----
>   doc/guides/rel_notes/release_17_02.rst |  3 +++
>   lib/librte_ether/rte_ethdev.c          | 12 ++++++++++++
>   lib/librte_ether/rte_ethdev.h          | 20 ++++++++++++++++++++
>   lib/librte_ether/rte_ether_version.map |  1 +
>   6 files changed, 37 insertions(+), 4 deletions(-)
>
> diff --git a/doc/guides/nics/features/default.ini b/doc/guides/nics/features/default.ini
> index f1bf9bf..ae40d57 100644
> --- a/doc/guides/nics/features/default.ini
> +++ b/doc/guides/nics/features/default.ini
> @@ -50,6 +50,7 @@ Timesync             =
>   Basic stats          =
>   Extended stats       =
>   Stats per queue      =
> +FW version           =
>   EEPROM dump          =
>   Registers dump       =
>   Multiprocess aware   =
> diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
> index 1438c77..291e03d 100644
> --- a/doc/guides/rel_notes/deprecation.rst
> +++ b/doc/guides/rel_notes/deprecation.rst
> @@ -30,10 +30,6 @@ Deprecation Notices
>     ``nb_seg_max`` and ``nb_mtu_seg_max`` providing information about number of
>     segments limit to be transmitted by device for TSO/non-TSO packets.
>   
> -* In 17.02 ABI change is planned: the ``rte_eth_dev_info`` structure
> -  will be extended with a new member ``fw_version`` in order to store
> -  the NIC firmware version.
> -
>   * ethdev: an API change is planned for 17.02 for the function
>     ``_rte_eth_dev_callback_process``. In 17.02 the function will return an ``int``
>     instead of ``void`` and a fourth parameter ``void *ret_param`` will be added.
> diff --git a/doc/guides/rel_notes/release_17_02.rst b/doc/guides/rel_notes/release_17_02.rst
> index 180af82..260033d 100644
> --- a/doc/guides/rel_notes/release_17_02.rst
> +++ b/doc/guides/rel_notes/release_17_02.rst
> @@ -52,6 +52,9 @@ New Features
>     See the :ref:`Generic flow API <Generic_flow_API>` documentation for more
>     information.
>   
> +* **Added firmware version get API.**
> + Added a new function ``rte_eth_dev_fw_version_get()`` to fetch firmware
> + version by a given device.
>   
>   Resolved Issues
>   ---------------
> diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
> index 280f0db..cb80476 100644
> --- a/lib/librte_ether/rte_ethdev.c
> +++ b/lib/librte_ether/rte_ethdev.c
> @@ -1586,6 +1586,18 @@ rte_eth_dev_set_rx_queue_stats_mapping(uint8_t port_id, uint16_t rx_queue_id,
>   }
>   
>   void
> +rte_eth_dev_fw_version_get(uint8_t port_id, char *fw_version, int fw_length)

May be size_t should be used for fw_length? Corresponding argument of 
the snprintf()
has size_t type, sizeof(drvinfo.fw_version) is used as value of the 
parameter.

Also the prototype does not provide a way to communicate that fw_length 
is insufficient
to store firmware version. I'd suggest snprintf()-like return value. It 
is pretty easy for PMD
to provide and convenient for the API function caller to handle.

> +{
> +	struct rte_eth_dev *dev;
> +
> +	RTE_ETH_VALID_PORTID_OR_RET(port_id);
> +	dev = &rte_eth_devices[port_id];
> +
> +	RTE_FUNC_PTR_OR_RET(*dev->dev_ops->fw_version_get);
> +	(*dev->dev_ops->fw_version_get)(dev, fw_version, fw_length);
> +}
> +
> +void
>   rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info)
>   {
>   	struct rte_eth_dev *dev;
> diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
> index fb51754..2be31d2 100644
> --- a/lib/librte_ether/rte_ethdev.h
> +++ b/lib/librte_ether/rte_ethdev.h
> @@ -1150,6 +1150,10 @@ typedef uint32_t (*eth_rx_queue_count_t)(struct rte_eth_dev *dev,
>   typedef int (*eth_rx_descriptor_done_t)(void *rxq, uint16_t offset);
>   /**< @internal Check DD bit of specific RX descriptor */
>   
> +typedef void (*eth_fw_version_get_t)(struct rte_eth_dev *dev,
> +				     char *fw_version, int fw_length);
> +/**< @internal Get firmware information of an Ethernet device. */
> +
>   typedef void (*eth_rxq_info_get_t)(struct rte_eth_dev *dev,
>   	uint16_t rx_queue_id, struct rte_eth_rxq_info *qinfo);
>   
> @@ -1455,6 +1459,7 @@ struct eth_dev_ops {
>   	eth_dev_infos_get_t        dev_infos_get; /**< Get device info. */
>   	eth_rxq_info_get_t         rxq_info_get; /**< retrieve RX queue information. */
>   	eth_txq_info_get_t         txq_info_get; /**< retrieve TX queue information. */
> +	eth_fw_version_get_t       fw_version_get; /**< Get firmware version. */
>   	eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
>   	/**< Get packet types supported and identified by device. */
>   
> @@ -2395,6 +2400,21 @@ void rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr);
>   void rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info);
>   
>   /**
> + * Retrieve the firmware version of a device.
> + *
> + * @param port_id
> + *   The port identifier of the device.
> + * @param fw_version
> + *   A array pointer to store the firmware version of a device,
> + *   allocated by caller.
> + * @param fw_length
> + *   The size of the array pointed by fw_version, which should be
> + *   large enough to store firmware version of the device.
> + */
> +void rte_eth_dev_fw_version_get(uint8_t port_id,
> +				char *fw_version, int fw_length);
> +
> +/**
>    * Retrieve the supported packet types of an Ethernet device.
>    *
>    * When a packet type is announced as supported, it *must* be recognized by
> diff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map
> index a021781..0cf94ed 100644
> --- a/lib/librte_ether/rte_ether_version.map
> +++ b/lib/librte_ether/rte_ether_version.map
> @@ -151,6 +151,7 @@ DPDK_17.02 {
>   	global:
>   
>   	_rte_eth_dev_reset;
> +	rte_eth_dev_fw_version_get;
>   	rte_flow_create;
>   	rte_flow_destroy;
>   	rte_flow_flush;

  reply	other threads:[~2017-01-08  6:39 UTC|newest]

Thread overview: 128+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-17  9:42 [PATCH] e1000: add firmware version get Qiming Yang
2016-11-17  9:42 ` [PATCH 1/5] ethdev: " Qiming Yang
2016-11-17 13:36   ` Thomas Monjalon
2016-11-18  2:10     ` Yang, Qiming
2016-11-18  1:09   ` Remy Horton
2016-11-18  2:18     ` Yang, Qiming
2016-12-06  7:16   ` [PATCH v2 0/5] example/ethtool: add bus info and fw " Qiming Yang
2016-12-06  7:16     ` [PATCH v2 1/5] ethdev: add firmware " Qiming Yang
2016-12-08 11:07       ` Ferruh Yigit
2016-12-12  1:28         ` Yang, Qiming
2016-12-06  7:16     ` [PATCH v2 2/5] net/e1000: " Qiming Yang
2016-12-07  1:16       ` Lu, Wenzhuo
2016-12-06  7:16     ` [PATCH v2 3/5] net/ixgbe: " Qiming Yang
2016-12-06  7:16     ` [PATCH v2 4/5] net/i40e: " Qiming Yang
2016-12-06  7:16     ` [PATCH v2 5/5] ethtool: dispaly bus info and firmware version Qiming Yang
2016-12-23 12:50       ` Ferruh Yigit
2016-12-27 13:06       ` [PATCH v3] " Qiming Yang
2017-01-04  7:51         ` Wu, Jingjing
2017-01-04 12:18         ` [PATCH v4] ethtool: dispaly bus information Qiming Yang
2017-01-04 14:49           ` Mcnamara, John
2017-01-05  1:51             ` Yang, Qiming
2017-02-09 21:32           ` Thomas Monjalon
2016-12-08  8:34     ` [PATCH v2 0/5] example/ethtool: add bus info and fw version get Remy Horton
2016-12-12  1:43       ` Yang, Qiming
2016-12-22 11:07       ` Thomas Monjalon
2016-12-22 14:36         ` Ferruh Yigit
2016-12-22 14:47           ` Thomas Monjalon
2016-12-22 15:05             ` Ferruh Yigit
2016-12-22 15:31               ` Thomas Monjalon
2016-12-23 12:48                 ` Ferruh Yigit
2017-01-05  3:04                 ` Zhang, Helin
2016-12-27 12:30     ` [PATCH v3 0/4] new API 'rte_eth_dev_fw_info_get' Qiming Yang
2016-12-27 12:30       ` [PATCH v3 1/4] ethdev: add firmware information get Qiming Yang
2017-01-02 15:38         ` Thomas Monjalon
     [not found]           ` <F5DF4F0E3AFEF648ADC1C3C33AD4DBF16EDC9515@SHSMSX101.ccr.corp.intel.com>
     [not found]             ` <10603884.vrshqR2O82@xps13>
2017-01-03  9:05               ` Yang, Qiming
2017-01-03 14:49                 ` Ferruh Yigit
2017-01-04  3:33                   ` Yang, Qiming
2017-01-04  7:48                     ` Wu, Jingjing
2017-01-04  8:43                       ` Ferruh Yigit
2017-01-05  1:04                         ` Wu, Jingjing
2017-01-03 14:58         ` Ferruh Yigit
2016-12-27 12:30       ` [PATCH v3 2/4] net/e1000: add firmware version get Qiming Yang
2017-01-03 15:02         ` Ferruh Yigit
2017-01-04  3:14           ` Yang, Qiming
2017-01-04  8:47             ` Ferruh Yigit
2016-12-27 12:30       ` [PATCH v3 3/4] net/ixgbe: " Qiming Yang
2017-01-03 15:04         ` Ferruh Yigit
2017-01-04  2:44           ` Yang, Qiming
2017-01-04  9:06             ` Ferruh Yigit
2017-01-04  9:48               ` Yang, Qiming
2017-01-04 12:01                 ` Ferruh Yigit
2016-12-27 12:30       ` [PATCH v3 4/4] net/i40e: " Qiming Yang
2017-01-04 12:03       ` [PATCH v4 0/5] new API 'rte_eth_dev_fw_version_get' Qiming Yang
2017-01-04 12:03         ` [PATCH v4 1/5] ethdev: add firmware version get Qiming Yang
2017-01-05 13:44           ` Thomas Monjalon
2017-01-08  3:09             ` Yang, Qiming
2017-01-04 12:03         ` [PATCH v4 2/5] net/e1000: " Qiming Yang
2017-01-04 13:59           ` Ferruh Yigit
2017-01-05  1:50             ` Yang, Qiming
2017-01-04 12:03         ` [PATCH v4 3/5] net/ixgbe: " Qiming Yang
2017-01-04 12:03         ` [PATCH v4 4/5] net/i40e: " Qiming Yang
2017-01-04 14:00           ` Ferruh Yigit
2017-01-04 12:03         ` [PATCH v4 5/5] ethtool: dispaly firmware version Qiming Yang
2017-01-04 14:00           ` Ferruh Yigit
2017-01-05  1:31             ` Yang, Qiming
2017-01-06 15:55               ` Remy Horton
2017-01-08  4:11         ` [PATCH v5 0/5] new API 'rte_eth_dev_fw_version_get' Qiming Yang
2017-01-08  4:11           ` [PATCH v5 1/5] ethdev: add firmware version get Qiming Yang
2017-01-08  6:38             ` Andrew Rybchenko [this message]
2017-01-08 23:05             ` Stephen Hemminger
2017-01-09  7:16               ` Yang, Qiming
2017-01-09 10:01                 ` Remy Horton
2017-01-09 17:23                   ` Stephen Hemminger
2017-01-08  4:11           ` [PATCH v5 2/5] net/e1000: " Qiming Yang
2017-01-08 23:03             ` Stephen Hemminger
2017-01-09  1:48               ` Yang, Qiming
2017-01-08  4:11           ` [PATCH v5 3/5] net/ixgbe: " Qiming Yang
2017-01-08  4:11           ` [PATCH v5 4/5] net/i40e: " Qiming Yang
2017-01-08 23:08             ` Stephen Hemminger
2017-01-08  4:11           ` [PATCH v5 5/5] ethtool: display firmware version Qiming Yang
2017-01-08 23:11             ` Stephen Hemminger
2017-01-10  9:00           ` [DPDK 1/5] ethdev: add firmware version get Qiming Yang
2017-01-10  9:00             ` [DPDK 2/5] net/e1000: " Qiming Yang
2017-01-10  9:00             ` [DPDK 3/5] net/ixgbe: " Qiming Yang
2017-01-10  9:08           ` [PATCH v6 0/5] new API 'rte_eth_dev_fw_version_get' Qiming Yang
2017-01-10  9:08             ` [PATCH v6 1/5] ethdev: add firmware version get Qiming Yang
2017-01-11  6:41               ` [PATCH v7 0/5] new API 'rte_eth_dev_fw_version_get' Qiming Yang
2017-01-11  6:41                 ` [PATCH v7 1/5] ethdev: add firmware version get Qiming Yang
2017-01-11  6:41                 ` [PATCH v7 2/5] net/e1000: " Qiming Yang
2017-01-11 15:45                   ` Remy Horton
2017-01-12  1:25                     ` Yang, Qiming
2017-01-11  6:41                 ` [PATCH v7 3/5] net/ixgbe: " Qiming Yang
2017-01-11  6:41                 ` [PATCH v7 4/5] net/i40e: " Qiming Yang
2017-01-11  6:41                 ` [PATCH v7 5/5] ethtool: display firmware version Qiming Yang
2017-01-12  6:31                 ` [PATCH v8 0/5] new API 'rte_eth_dev_fw_version_get' Qiming Yang
2017-01-12  6:31                   ` [PATCH v8 1/5] ethdev: add firmware version get Qiming Yang
2017-01-15 20:56                     ` Thomas Monjalon
2017-01-16  5:44                     ` [PATCH v9 0/5] new API 'rte_eth_dev_fw_version_get' Qiming Yang
2017-01-16  5:44                       ` [PATCH v9 1/5] ethdev: add firmware version get Qiming Yang
2017-01-16  7:05                         ` Andrew Rybchenko
2017-01-16  8:51                           ` Yang, Qiming
2017-01-16  5:44                       ` [PATCH v9 2/5] net/e1000: " Qiming Yang
2017-01-16  5:44                       ` [PATCH v9 3/5] net/ixgbe: " Qiming Yang
2017-01-16  5:44                       ` [PATCH v9 4/5] net/i40e: " Qiming Yang
2017-01-16  5:44                       ` [PATCH v9 5/5] ethtool: display firmware version Qiming Yang
2017-01-16 10:48                       ` [PATCH v10 0/5] new API 'rte_eth_dev_fw_version_get' Qiming Yang
2017-01-16 10:48                         ` [PATCH v10 1/5] ethdev: add firmware version get Qiming Yang
2017-01-16 10:48                         ` [PATCH v10 2/5] net/e1000: " Qiming Yang
2017-01-16 10:48                         ` [PATCH v10 3/5] net/ixgbe: " Qiming Yang
2017-01-16 10:48                         ` [PATCH v10 4/5] net/i40e: " Qiming Yang
2017-01-16 10:48                         ` [PATCH v10 5/5] ethtool: display firmware version Qiming Yang
2017-01-17 21:35                         ` [PATCH v10 0/5] new API 'rte_eth_dev_fw_version_get' Thomas Monjalon
2017-01-12  6:31                   ` [PATCH v8 2/5] net/e1000: add firmware version get Qiming Yang
2017-01-12  6:31                   ` [PATCH v8 3/5] net/ixgbe: " Qiming Yang
2017-01-12  6:31                   ` [PATCH v8 4/5] net/i40e: " Qiming Yang
2017-01-12  6:31                   ` [PATCH v8 5/5] ethtool: display firmware version Qiming Yang
2017-01-10  9:08             ` [PATCH v6 2/5] net/e1000: add firmware version get Qiming Yang
2017-01-10  9:08             ` [PATCH v6 3/5] net/ixgbe: " Qiming Yang
2017-01-10  9:08             ` [PATCH v6 4/5] net/i40e: " Qiming Yang
2017-01-10  9:08             ` [PATCH v6 5/5] ethtool: display firmware version Qiming Yang
2016-11-17  9:42 ` [PATCH] ethtool: dispaly bus info and " Qiming Yang
2016-11-17  9:42 ` [PATCH] i40e: add firmware version get Qiming Yang
2016-11-17  9:42 ` [PATCH] ixgbe: " Qiming Yang
2016-11-17  9:42 ` [PATCH 2/5] e1000: " Qiming Yang
2016-11-17  9:42 ` [PATCH 3/5] ixgbe: " Qiming Yang
2016-11-17  9:42 ` [PATCH 4/5] i40e: " Qiming Yang
2016-11-17  9:42 ` [PATCH 5/5] ethtool: dispaly bus info and firmware version Qiming Yang
2016-11-18  1:10   ` Remy Horton

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=9a37d50f-8f14-b1a7-c960-6e0b8baf0b87@solarflare.com \
    --to=arybchenko@solarflare.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=helin.zhang@intel.com \
    --cc=qiming.yang@intel.com \
    --cc=remy.horton@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 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.