DPDK patches and discussions
 help / color / mirror / Atom feed
From: Leyi Rong <leyi.rong@intel.com>
To: Qiming Yang <qiming.yang@intel.com>, Wenzhuo Lu <wenzhuo.lu@intel.com>
Cc: dev@dpdk.org, Leyi Rong <leyi.rong@intel.com>
Subject: [dpdk-dev] [PATCH] net/ice: fix firmware-version in the drvinfo result of ethtool
Date: Thu, 10 Jan 2019 13:22:04 +0800	[thread overview]
Message-ID: <1547097724-108047-1-git-send-email-leyi.rong@intel.com> (raw)

Fix the drvinfo dumped firmware-version when using dpdk ethtool,
change it to the same result as linux ethtool shown info.

Fixes: e31cb9a36298 ("net/ice: support FW version getting")

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
---
 drivers/net/ice/ice_ethdev.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 0a81e04..5545f38 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2590,11 +2590,22 @@ static int
 ice_fw_version_get(struct rte_eth_dev *dev, char *fw_version, size_t fw_size)
 {
 	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	u32 full_ver;
+	u8 ver, patch;
+	u16 build;
 	int ret;
 
-	ret = snprintf(fw_version, fw_size, "%d.%d.%05d %d.%d",
-		       hw->fw_maj_ver, hw->fw_min_ver, hw->fw_build,
-		       hw->api_maj_ver, hw->api_min_ver);
+	full_ver = hw->nvm.oem_ver;
+	ver = (u8)(full_ver >> 24);
+	build = (u16)((full_ver >> 8) & 0xffff);
+	patch = (u8)(full_ver & 0xff);
+
+	ret = snprintf(fw_version, fw_size,
+			"%d.%d%d 0x%08x %d.%d.%d",
+			((hw->nvm.ver >> 12) & 0xf),
+			((hw->nvm.ver >> 4) & 0xff),
+			(hw->nvm.ver & 0xf), hw->nvm.eetrack,
+			ver, build, patch);
 
 	/* add the size of '\0' */
 	ret += 1;
-- 
2.7.4

             reply	other threads:[~2019-01-10  5:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-10  5:22 Leyi Rong [this message]
2019-01-10 12:08 ` Zhang, Qi Z

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=1547097724-108047-1-git-send-email-leyi.rong@intel.com \
    --to=leyi.rong@intel.com \
    --cc=dev@dpdk.org \
    --cc=qiming.yang@intel.com \
    --cc=wenzhuo.lu@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).