DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pankaj Gupta <pagupta@vmware.com>
To: jbehrens@vmware.com
Cc: dev@dpdk.org, pagupta@vmware.com,
	Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Subject: [PATCH v6 5/9] net/vmxnet3: report HW version on FW version get
Date: Tue, 24 May 2022 17:40:24 -0700	[thread overview]
Message-ID: <20220525004028.24938-6-pagupta@vmware.com> (raw)
In-Reply-To: <20220525004028.24938-1-pagupta@vmware.com>

Support rte_eth_dev_fw_version_get() API.

Tested, using testpmd, for different hardware versions on ESXi 7.0
Update 2.

Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
Reviewed-by: Jochen Behrens <jbehrens@vmware.com>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index e84d304378..62844f3d39 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -85,6 +85,8 @@ static int vmxnet3_dev_xstats_get(struct rte_eth_dev *dev,
 				  struct rte_eth_xstat *xstats, unsigned int n);
 static int vmxnet3_dev_info_get(struct rte_eth_dev *dev,
 				struct rte_eth_dev_info *dev_info);
+static int vmxnet3_hw_ver_get(struct rte_eth_dev *dev,
+			      char *fw_version, size_t fw_size);
 static const uint32_t *
 vmxnet3_dev_supported_ptypes_get(struct rte_eth_dev *dev);
 static int vmxnet3_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu);
@@ -103,6 +105,7 @@ static int
 vmxnet3_rss_reta_query(struct rte_eth_dev *dev,
 		       struct rte_eth_rss_reta_entry64 *reta_conf,
 		       uint16_t reta_size);
+
 static int vmxnet3_dev_rx_queue_intr_enable(struct rte_eth_dev *dev,
 						uint16_t queue_id);
 static int vmxnet3_dev_rx_queue_intr_disable(struct rte_eth_dev *dev,
@@ -136,6 +139,7 @@ static const struct eth_dev_ops vmxnet3_eth_dev_ops = {
 	.xstats_get           = vmxnet3_dev_xstats_get,
 	.xstats_get_names     = vmxnet3_dev_xstats_get_names,
 	.dev_infos_get        = vmxnet3_dev_info_get,
+	.fw_version_get       = vmxnet3_hw_ver_get,
 	.dev_supported_ptypes_get = vmxnet3_dev_supported_ptypes_get,
 	.vlan_filter_set      = vmxnet3_dev_vlan_filter_set,
 	.vlan_offload_set     = vmxnet3_dev_vlan_offload_set,
@@ -1410,6 +1414,22 @@ vmxnet3_dev_info_get(struct rte_eth_dev *dev,
 	return 0;
 }
 
+static int
+vmxnet3_hw_ver_get(struct rte_eth_dev *dev,
+		   char *fw_version, size_t fw_size)
+{
+	int ret;
+	struct vmxnet3_hw *hw = dev->data->dev_private;
+
+	ret = snprintf(fw_version, fw_size, "v%d", hw->version);
+
+	ret += 1; /* add the size of '\0' */
+	if (fw_size < (uint32_t)ret)
+		return ret;
+	else
+		return 0;
+}
+
 static const uint32_t *
 vmxnet3_dev_supported_ptypes_get(struct rte_eth_dev *dev)
 {
-- 
2.17.1


  parent reply	other threads:[~2022-05-25  0:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-25  0:40 [PATCH v6 0/9] net/vmxnet3: support versions 5 and 6 Pankaj Gupta
2022-05-25  0:40 ` [PATCH v6 1/9] net/vmxnet3: add version 5 support Pankaj Gupta
2022-05-25  0:40 ` [PATCH v6 2/9] net/vmxnet3: implement RETA query and RETA update Pankaj Gupta
2022-05-25  0:40 ` [PATCH v6 3/9] net/vmxnet3: add Rx queue usage count utility Pankaj Gupta
2022-05-25  0:40 ` [PATCH v6 4/9] net/vmxnet3: fix ethdev callbacks init order Pankaj Gupta
2022-05-25  0:40 ` Pankaj Gupta [this message]
2022-05-25  0:40 ` [PATCH v6 6/9] net/vmxnet3: add version 6 support Pankaj Gupta
2022-05-25  8:45   ` Andrew Rybchenko
2022-05-25 17:13     ` Pankaj Gupta
2022-05-31 12:54       ` Andrew Rybchenko
2022-05-25  0:40 ` [PATCH v6 7/9] net/vmxnet3: advertise RETA size in device info Pankaj Gupta
2022-05-25  0:40 ` [PATCH v6 8/9] net/vmxnet3: set packet type for fragmented packet Pankaj Gupta
2022-05-25  0:40 ` [PATCH v6 9/9] net/vmxnet3: fix merge error in Rx data ring initialization Pankaj Gupta
2022-05-31 13:40 ` [PATCH v6 0/9] net/vmxnet3: support versions 5 and 6 Andrew Rybchenko
2022-05-31 13:41   ` Andrew Rybchenko
  -- strict thread matches above, loose matches on Subject: below --
2022-05-03  4:22 [PATCH 0/8] vmxnet3 version V5 and V6 Pankaj Gupta
2022-05-19  8:04 ` [PATCH v6 0/9] net/vmxnet3: support versions 5 and 6 Andrew Rybchenko
2022-05-19  8:04   ` [PATCH v6 5/9] net/vmxnet3: report HW version on FW version get Andrew Rybchenko

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=20220525004028.24938-6-pagupta@vmware.com \
    --to=pagupta@vmware.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=jbehrens@vmware.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).