[dpdk-dev,v3,3/4] net/ixgbe: add firmware version get

Message ID 1482841816-54143-4-git-send-email-qiming.yang@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel compilation success Compilation OK

Commit Message

Qiming Yang Dec. 27, 2016, 12:30 p.m. UTC
  This patch add a new function ixgbe_fw_version_get.

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
---
v3 changes:
 * use ixgbe_fw_version_get(struct rte_eth_dev *dev,
   __rte_unused u32 *fw_major, __rte_unused u32 *fw_minor,
   __rte_unused u32 *fw_patch, u32 *etrack_id) instead of
    ixgbe_fw_version_get(struct rte_eth_dev *dev, char *fw_version,
   int fw_length). Add statusment in /doc/guides/nics/features/ixgbe.ini.
---
---
 doc/guides/nics/features/ixgbe.ini |  1 +
 drivers/net/ixgbe/ixgbe_ethdev.c   | 17 +++++++++++++++++
 2 files changed, 18 insertions(+)
  

Comments

Ferruh Yigit Jan. 3, 2017, 3:04 p.m. UTC | #1
On 12/27/2016 12:30 PM, Qiming Yang wrote:
> This patch add a new function ixgbe_fw_version_get.
> 
> Signed-off-by: Qiming Yang <qiming.yang@intel.com>

<...>

>  
>  static void
> +ixgbe_fw_version_get(struct rte_eth_dev *dev, __rte_unused u32 *fw_major,
> +	__rte_unused u32 *fw_minor, __rte_unused u32 *fw_patch, u32 *etrack_id)

This API at least provide major and minor fw versions I think. Isn't
there any kind of FW version information for ixgbe? Just providing
etrack_id is not looking good.

> +{
> +	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> +	u16 eeprom_verh, eeprom_verl;
> +
> +	ixgbe_read_eeprom(hw, 0x2e, &eeprom_verh);
> +	ixgbe_read_eeprom(hw, 0x2d, &eeprom_verl);
> +
> +	*etrack_id = (eeprom_verh << 16) | eeprom_verl;
> +}
> +
> +static void
>  ixgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
>  {
>  	struct rte_pci_device *pci_dev = IXGBE_DEV_TO_PCI(dev);
>
  
Qiming Yang Jan. 4, 2017, 2:44 a.m. UTC | #2
You can see the kernel version ethtool, use command 'ethtool -i  <ixgbe NIC name>'
driver: ixgbe
version: 4.2.1-k
firmware-version: 0x61bf0001

Ixgbe's FW version do not have the major and minor number, and the original purpose of this function is get FW version, so I think it's enough. 

-----Original Message-----
From: Yigit, Ferruh 
Sent: Tuesday, January 3, 2017 11:04 PM
To: Yang, Qiming <qiming.yang@intel.com>; dev@dpdk.org; thomas.monjalon@6wind.com
Cc: Horton, Remy <remy.horton@intel.com>
Subject: Re: [PATCH v3 3/4] net/ixgbe: add firmware version get

On 12/27/2016 12:30 PM, Qiming Yang wrote:
> This patch add a new function ixgbe_fw_version_get.
> 
> Signed-off-by: Qiming Yang <qiming.yang@intel.com>

<...>

>  
>  static void
> +ixgbe_fw_version_get(struct rte_eth_dev *dev, __rte_unused u32 *fw_major,
> +	__rte_unused u32 *fw_minor, __rte_unused u32 *fw_patch, u32 
> +*etrack_id)

This API at least provide major and minor fw versions I think. Isn't there any kind of FW version information for ixgbe? Just providing etrack_id is not looking good.

> +{
> +	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> +	u16 eeprom_verh, eeprom_verl;
> +
> +	ixgbe_read_eeprom(hw, 0x2e, &eeprom_verh);
> +	ixgbe_read_eeprom(hw, 0x2d, &eeprom_verl);
> +
> +	*etrack_id = (eeprom_verh << 16) | eeprom_verl; }
> +
> +static void
>  ixgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info 
> *dev_info)  {
>  	struct rte_pci_device *pci_dev = IXGBE_DEV_TO_PCI(dev);
>
  
Ferruh Yigit Jan. 4, 2017, 9:06 a.m. UTC | #3
On 1/4/2017 2:44 AM, Yang, Qiming wrote:
> You can see the kernel version ethtool, use command 'ethtool -i  <ixgbe NIC name>'
> driver: ixgbe
> version: 4.2.1-k
> firmware-version: 0x61bf0001
> 
> Ixgbe's FW version do not have the major and minor number, and the original purpose of this function is get FW version, so I think it's enough.

Is etrack_id a unique value that defines the FW version on its own?

And is above definition true for all NICs (or at least Intel ones)?
Because I can see i40e is using 4 bit value for etrack_id ?

> 
> -----Original Message-----
> From: Yigit, Ferruh 
> Sent: Tuesday, January 3, 2017 11:04 PM
> To: Yang, Qiming <qiming.yang@intel.com>; dev@dpdk.org; thomas.monjalon@6wind.com
> Cc: Horton, Remy <remy.horton@intel.com>
> Subject: Re: [PATCH v3 3/4] net/ixgbe: add firmware version get
> 
> On 12/27/2016 12:30 PM, Qiming Yang wrote:
>> This patch add a new function ixgbe_fw_version_get.
>>
>> Signed-off-by: Qiming Yang <qiming.yang@intel.com>
> 
> <...>
> 
>>  
>>  static void
>> +ixgbe_fw_version_get(struct rte_eth_dev *dev, __rte_unused u32 *fw_major,
>> +	__rte_unused u32 *fw_minor, __rte_unused u32 *fw_patch, u32 
>> +*etrack_id)
> 
> This API at least provide major and minor fw versions I think. Isn't there any kind of FW version information for ixgbe? Just providing etrack_id is not looking good.
> 
>> +{
>> +	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
>> +	u16 eeprom_verh, eeprom_verl;
>> +
>> +	ixgbe_read_eeprom(hw, 0x2e, &eeprom_verh);
>> +	ixgbe_read_eeprom(hw, 0x2d, &eeprom_verl);
>> +
>> +	*etrack_id = (eeprom_verh << 16) | eeprom_verl; }
>> +
>> +static void
>>  ixgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info 
>> *dev_info)  {
>>  	struct rte_pci_device *pci_dev = IXGBE_DEV_TO_PCI(dev);
>>
>
  
Qiming Yang Jan. 4, 2017, 9:48 a.m. UTC | #4
Yes,  etrack_id is an unique value. But not all NICs have this value.
I didn't find any value about fw version in fm10k.
I40e is 8 bit too.
firmware-version: 5.04 0x800024ca

-----Original Message-----
From: Yigit, Ferruh 
Sent: Wednesday, January 4, 2017 5:06 PM
To: Yang, Qiming <qiming.yang@intel.com>; dev@dpdk.org; thomas.monjalon@6wind.com
Cc: Horton, Remy <remy.horton@intel.com>
Subject: Re: [PATCH v3 3/4] net/ixgbe: add firmware version get

On 1/4/2017 2:44 AM, Yang, Qiming wrote:
> You can see the kernel version ethtool, use command 'ethtool -i  <ixgbe NIC name>'
> driver: ixgbe
> version: 4.2.1-k
> firmware-version: 0x61bf0001
> 
> Ixgbe's FW version do not have the major and minor number, and the original purpose of this function is get FW version, so I think it's enough.

Is etrack_id a unique value that defines the FW version on its own?

And is above definition true for all NICs (or at least Intel ones)?
Because I can see i40e is using 4 bit value for etrack_id ?

> 
> -----Original Message-----
> From: Yigit, Ferruh 
> Sent: Tuesday, January 3, 2017 11:04 PM
> To: Yang, Qiming <qiming.yang@intel.com>; dev@dpdk.org; thomas.monjalon@6wind.com
> Cc: Horton, Remy <remy.horton@intel.com>
> Subject: Re: [PATCH v3 3/4] net/ixgbe: add firmware version get
> 
> On 12/27/2016 12:30 PM, Qiming Yang wrote:
>> This patch add a new function ixgbe_fw_version_get.
>>
>> Signed-off-by: Qiming Yang <qiming.yang@intel.com>
> 
> <...>
> 
>>  
>>  static void
>> +ixgbe_fw_version_get(struct rte_eth_dev *dev, __rte_unused u32 *fw_major,
>> +	__rte_unused u32 *fw_minor, __rte_unused u32 *fw_patch, u32 
>> +*etrack_id)
> 
> This API at least provide major and minor fw versions I think. Isn't there any kind of FW version information for ixgbe? Just providing etrack_id is not looking good.
> 
>> +{
>> +	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
>> +	u16 eeprom_verh, eeprom_verl;
>> +
>> +	ixgbe_read_eeprom(hw, 0x2e, &eeprom_verh);
>> +	ixgbe_read_eeprom(hw, 0x2d, &eeprom_verl);
>> +
>> +	*etrack_id = (eeprom_verh << 16) | eeprom_verl; }
>> +
>> +static void
>>  ixgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info 
>> *dev_info)  {
>>  	struct rte_pci_device *pci_dev = IXGBE_DEV_TO_PCI(dev);
>>
>
  
Ferruh Yigit Jan. 4, 2017, 12:01 p.m. UTC | #5
On 1/4/2017 9:48 AM, Yang, Qiming wrote:
> Yes,  etrack_id is an unique value. But not all NICs have this value.
> I didn't find any value about fw version in fm10k.

Yes, you are right, following is from i40e datasheet:

"
The EEPROM Manager tool writes a unique 32-bit eTrack_ID number in two
sequential NVM words.
The eTrack_ID is written when EEPROM Manager tool creates an image on
the Intel network. The eTrack_ID DB tracks NVM images back to a specific
SCM build
"

So it is unique, and can be used to identify FW version. And yes it can
be enough on its own without having major minor FW version fields.

> I40e is 8 bit too.
> firmware-version: 5.04 0x800024ca

Right, I read it wrong, i40e also has 32bits etrack-id.

Thanks,
ferruh
  

Patch

diff --git a/doc/guides/nics/features/ixgbe.ini b/doc/guides/nics/features/ixgbe.ini
index 4a5667f..e4a0830 100644
--- a/doc/guides/nics/features/ixgbe.ini
+++ b/doc/guides/nics/features/ixgbe.ini
@@ -52,3 +52,4 @@  Linux VFIO           = Y
 ARMv8                = Y
 x86-32               = Y
 x86-64               = Y
+FW_version           = Y
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index ec2edad..e2234c0 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -193,6 +193,9 @@  static int ixgbe_dev_queue_stats_mapping_set(struct rte_eth_dev *eth_dev,
 					     uint16_t queue_id,
 					     uint8_t stat_idx,
 					     uint8_t is_rx);
+static void ixgbe_fw_version_get(struct rte_eth_dev *dev,
+	__rte_unused u32 *fw_major, __rte_unused u32 *fw_minor,
+	__rte_unused u32 *fw_patch, u32 *etrack_id);
 static void ixgbe_dev_info_get(struct rte_eth_dev *dev,
 			       struct rte_eth_dev_info *dev_info);
 static const uint32_t *ixgbe_dev_supported_ptypes_get(struct rte_eth_dev *dev);
@@ -538,6 +541,7 @@  static const struct eth_dev_ops ixgbe_eth_dev_ops = {
 	.xstats_reset         = ixgbe_dev_xstats_reset,
 	.xstats_get_names     = ixgbe_dev_xstats_get_names,
 	.queue_stats_mapping_set = ixgbe_dev_queue_stats_mapping_set,
+	.fw_version_get       = ixgbe_fw_version_get,
 	.dev_infos_get        = ixgbe_dev_info_get,
 	.dev_supported_ptypes_get = ixgbe_dev_supported_ptypes_get,
 	.mtu_set              = ixgbe_dev_mtu_set,
@@ -3029,6 +3033,19 @@  ixgbevf_dev_stats_reset(struct rte_eth_dev *dev)
 }
 
 static void
+ixgbe_fw_version_get(struct rte_eth_dev *dev, __rte_unused u32 *fw_major,
+	__rte_unused u32 *fw_minor, __rte_unused u32 *fw_patch, u32 *etrack_id)
+{
+	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	u16 eeprom_verh, eeprom_verl;
+
+	ixgbe_read_eeprom(hw, 0x2e, &eeprom_verh);
+	ixgbe_read_eeprom(hw, 0x2d, &eeprom_verl);
+
+	*etrack_id = (eeprom_verh << 16) | eeprom_verl;
+}
+
+static void
 ixgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 {
 	struct rte_pci_device *pci_dev = IXGBE_DEV_TO_PCI(dev);