[dpdk-dev,v2,5/5] ethtool: dispaly bus info and firmware version

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

Checks

Context Check Description
checkpatch/checkpatch success coding style OK

Commit Message

Qiming Yang Dec. 6, 2016, 7:16 a.m. UTC
  This patch enhances the ethtool example to support to show
bus information and firmware version, in the same way that
the Linux kernel ethtool does.

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
---
v2 changes:
*  modified the commit log
---
---
 examples/ethtool/ethtool-app/ethapp.c | 2 ++
 examples/ethtool/lib/rte_ethtool.c    | 3 +++
 2 files changed, 5 insertions(+)
  

Comments

Ferruh Yigit Dec. 23, 2016, 12:50 p.m. UTC | #1
On 12/6/2016 7:16 AM, Qiming Yang wrote:
> This patch enhances the ethtool example to support to show
> bus information and firmware version, in the same way that
> the Linux kernel ethtool does.
> 
> Signed-off-by: Qiming Yang <qiming.yang@intel.com>
> ---
> v2 changes:
> *  modified the commit log
> ---
> ---
>  examples/ethtool/ethtool-app/ethapp.c | 2 ++
>  examples/ethtool/lib/rte_ethtool.c    | 3 +++
>  2 files changed, 5 insertions(+)
> 
> diff --git a/examples/ethtool/ethtool-app/ethapp.c b/examples/ethtool/ethtool-app/ethapp.c
> index 38e466c..9b77385 100644
> --- a/examples/ethtool/ethtool-app/ethapp.c
> +++ b/examples/ethtool/ethtool-app/ethapp.c
> @@ -184,6 +184,8 @@ pcmd_drvinfo_callback(__rte_unused void *ptr_params,
>  		printf("Port %i driver: %s (ver: %s)\n",
>  			id_port, info.driver, info.version
>  		      );
> +		printf("bus-info: %s\n", info.bus_info);

Can you please remove above line from this patch, if you want can be a
separate patch.

Thanks,
ferruh

> +		printf("firmware-version: %s\n", info.fw_version);
>  	}
>  }
>  
> diff --git a/examples/ethtool/lib/rte_ethtool.c b/examples/ethtool/lib/rte_ethtool.c

<...>
  

Patch

diff --git a/examples/ethtool/ethtool-app/ethapp.c b/examples/ethtool/ethtool-app/ethapp.c
index 38e466c..9b77385 100644
--- a/examples/ethtool/ethtool-app/ethapp.c
+++ b/examples/ethtool/ethtool-app/ethapp.c
@@ -184,6 +184,8 @@  pcmd_drvinfo_callback(__rte_unused void *ptr_params,
 		printf("Port %i driver: %s (ver: %s)\n",
 			id_port, info.driver, info.version
 		      );
+		printf("bus-info: %s\n", info.bus_info);
+		printf("firmware-version: %s\n", info.fw_version);
 	}
 }
 
diff --git a/examples/ethtool/lib/rte_ethtool.c b/examples/ethtool/lib/rte_ethtool.c
index a1f91d4..542179c 100644
--- a/examples/ethtool/lib/rte_ethtool.c
+++ b/examples/ethtool/lib/rte_ethtool.c
@@ -54,6 +54,9 @@  rte_ethtool_get_drvinfo(uint8_t port_id, struct ethtool_drvinfo *drvinfo)
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 
+	rte_eth_dev_fwver_get(port_id, drvinfo->fw_version,
+			      sizeof(drvinfo->fw_version));
+
 	memset(&dev_info, 0, sizeof(dev_info));
 	rte_eth_dev_info_get(port_id, &dev_info);