* [dpdk-dev] [PATCH] net/mlx: support firmware version query
@ 2019-02-06 21:59 Thomas Monjalon
2019-02-06 22:16 ` Stephen Hemminger
2019-02-06 22:25 ` [dpdk-dev] [PATCH v2] " Thomas Monjalon
0 siblings, 2 replies; 6+ messages in thread
From: Thomas Monjalon @ 2019-02-06 21:59 UTC (permalink / raw)
To: Matan Azrad, Shahaf Shuler, Yongseok Koh; +Cc: dev
The API function rte_eth_dev_fw_version_get() is querying drivers
via the operation callback fw_version_get().
The implementation of this operation is added for mlx4 and mlx5.
Both functions are copying the same ibverbs field fw_ver
which is retrieved when calling ibv_query_device[_ex]()
during the port probing.
It is tested with command "drvinfo" of examples/ethtool/.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
drivers/net/mlx4/mlx4.c | 1 +
drivers/net/mlx4/mlx4.h | 1 +
drivers/net/mlx4/mlx4_ethdev.c | 26 ++++++++++++++++++++++++++
drivers/net/mlx5/mlx5.c | 6 +++++-
drivers/net/mlx5/mlx5.h | 1 +
drivers/net/mlx5/mlx5_ethdev.c | 26 ++++++++++++++++++++++++++
6 files changed, 60 insertions(+), 1 deletion(-)
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 070cf7111..6f29e5a62 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -237,6 +237,7 @@ static const struct eth_dev_ops mlx4_dev_ops = {
.mac_addr_set = mlx4_mac_addr_set,
.stats_get = mlx4_stats_get,
.stats_reset = mlx4_stats_reset,
+ .fw_version_get = mlx4_fw_version_get,
.dev_infos_get = mlx4_dev_infos_get,
.dev_supported_ptypes_get = mlx4_dev_supported_ptypes_get,
.vlan_filter_set = mlx4_vlan_filter_set,
diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h
index e6fb934fa..6f4111582 100644
--- a/drivers/net/mlx4/mlx4.h
+++ b/drivers/net/mlx4/mlx4.h
@@ -131,6 +131,7 @@ int mlx4_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr);
int mlx4_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on);
int mlx4_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats);
void mlx4_stats_reset(struct rte_eth_dev *dev);
+int mlx4_fw_version_get(struct rte_eth_dev *dev, char *fw_ver, size_t fw_size);
void mlx4_dev_infos_get(struct rte_eth_dev *dev,
struct rte_eth_dev_info *info);
int mlx4_link_update(struct rte_eth_dev *dev, int wait_to_complete);
diff --git a/drivers/net/mlx4/mlx4_ethdev.c b/drivers/net/mlx4/mlx4_ethdev.c
index 195a1b6df..d0efa7d06 100644
--- a/drivers/net/mlx4/mlx4_ethdev.c
+++ b/drivers/net/mlx4/mlx4_ethdev.c
@@ -592,6 +592,32 @@ mlx4_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
info->flow_type_rss_offloads = mlx4_conv_rss_types(priv, 0, 1);
}
+/**
+ * Get firmware version of a device.
+ *
+ * @param dev
+ * Ethernet device port.
+ * @param fw_ver
+ * String output allocated by caller.
+ * @param fw_size
+ * Size of the output string, including terminating null byte.
+ *
+ * @return
+ * 0 on success, or the size of the non truncated string if too big.
+ */
+int mlx4_fw_version_get(struct rte_eth_dev *dev, char *fw_ver, size_t fw_size)
+{
+ struct priv *priv = dev->data->dev_private;
+ struct ibv_device_attr *attr = &priv->device_attr;
+ size_t size = strnlen(attr->fw_ver, sizeof(attr->fw_ver)) + 1;
+
+ if (fw_size < size)
+ return size;
+ if (fw_ver != NULL)
+ strlcpy(fw_ver, attr->fw_ver, fw_size);
+ return 0;
+}
+
/**
* DPDK callback to get device statistics.
*
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index a913a5955..df71707cc 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -374,6 +374,7 @@ const struct eth_dev_ops mlx5_dev_ops = {
.xstats_get = mlx5_xstats_get,
.xstats_reset = mlx5_xstats_reset,
.xstats_get_names = mlx5_xstats_get_names,
+ .fw_version_get = mlx5_fw_version_get,
.dev_infos_get = mlx5_dev_infos_get,
.dev_supported_ptypes_get = mlx5_dev_supported_ptypes_get,
.vlan_filter_set = mlx5_vlan_filter_set,
@@ -403,18 +404,20 @@ const struct eth_dev_ops mlx5_dev_ops = {
.is_removed = mlx5_is_removed,
};
+/* Available operations from secondary process. */
static const struct eth_dev_ops mlx5_dev_sec_ops = {
.stats_get = mlx5_stats_get,
.stats_reset = mlx5_stats_reset,
.xstats_get = mlx5_xstats_get,
.xstats_reset = mlx5_xstats_reset,
.xstats_get_names = mlx5_xstats_get_names,
+ .fw_version_get = mlx5_fw_version_get,
.dev_infos_get = mlx5_dev_infos_get,
.rx_descriptor_status = mlx5_rx_descriptor_status,
.tx_descriptor_status = mlx5_tx_descriptor_status,
};
-/* Available operators in flow isolated mode. */
+/* Available operations in flow isolated mode. */
const struct eth_dev_ops mlx5_dev_ops_isolate = {
.dev_configure = mlx5_dev_configure,
.dev_start = mlx5_dev_start,
@@ -432,6 +435,7 @@ const struct eth_dev_ops mlx5_dev_ops_isolate = {
.xstats_get = mlx5_xstats_get,
.xstats_reset = mlx5_xstats_reset,
.xstats_get_names = mlx5_xstats_get_names,
+ .fw_version_get = mlx5_fw_version_get,
.dev_infos_get = mlx5_dev_infos_get,
.dev_supported_ptypes_get = mlx5_dev_supported_ptypes_get,
.vlan_filter_set = mlx5_vlan_filter_set,
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 45f039821..3193ed9ca 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -274,6 +274,7 @@ int mlx5_set_flags(struct rte_eth_dev *dev, unsigned int keep,
unsigned int flags);
int mlx5_dev_configure(struct rte_eth_dev *dev);
void mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info);
+int mlx5_fw_version_get(struct rte_eth_dev *dev, char *fw_ver, size_t fw_size);
const uint32_t *mlx5_dev_supported_ptypes_get(struct rte_eth_dev *dev);
int mlx5_link_update(struct rte_eth_dev *dev, int wait_to_complete);
int mlx5_force_link_status_change(struct rte_eth_dev *dev, int status);
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index d178ed6a1..8158b4a9f 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -557,6 +557,32 @@ mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
}
}
+/**
+ * Get firmware version of a device.
+ *
+ * @param dev
+ * Ethernet device port.
+ * @param fw_ver
+ * String output allocated by caller.
+ * @param fw_size
+ * Size of the output string, including terminating null byte.
+ *
+ * @return
+ * 0 on success, or the size of the non truncated string if too big.
+ */
+int mlx5_fw_version_get(struct rte_eth_dev *dev, char *fw_ver, size_t fw_size)
+{
+ struct priv *priv = dev->data->dev_private;
+ struct ibv_device_attr *attr = &priv->device_attr.orig_attr;
+ size_t size = strnlen(attr->fw_ver, sizeof(attr->fw_ver)) + 1;
+
+ if (fw_size < size)
+ return size;
+ if (fw_ver != NULL)
+ strlcpy(fw_ver, attr->fw_ver, fw_size);
+ return 0;
+}
+
/**
* Get supported packet types.
*
--
2.20.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH] net/mlx: support firmware version query
2019-02-06 21:59 [dpdk-dev] [PATCH] net/mlx: support firmware version query Thomas Monjalon
@ 2019-02-06 22:16 ` Stephen Hemminger
2019-02-06 22:23 ` Thomas Monjalon
2019-02-06 22:25 ` [dpdk-dev] [PATCH v2] " Thomas Monjalon
1 sibling, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2019-02-06 22:16 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: Matan Azrad, Shahaf Shuler, Yongseok Koh, dev
On Wed, 6 Feb 2019 22:59:09 +0100
Thomas Monjalon <thomas@monjalon.net> wrote:
> The API function rte_eth_dev_fw_version_get() is querying drivers
> via the operation callback fw_version_get().
> The implementation of this operation is added for mlx4 and mlx5.
> Both functions are copying the same ibverbs field fw_ver
> which is retrieved when calling ibv_query_device[_ex]()
> during the port probing.
>
> It is tested with command "drvinfo" of examples/ethtool/.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Looks good, but hard to test because:
* testpmd doesn't report it
* with netvsc (and failsafe) the device is owned and not visible
Fixing testpmd is not hard, but what is best way to handle
the nested device situation.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH] net/mlx: support firmware version query
2019-02-06 22:16 ` Stephen Hemminger
@ 2019-02-06 22:23 ` Thomas Monjalon
2019-02-06 22:27 ` Stephen Hemminger
0 siblings, 1 reply; 6+ messages in thread
From: Thomas Monjalon @ 2019-02-06 22:23 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Matan Azrad, Shahaf Shuler, Yongseok Koh, dev
06/02/2019 23:16, Stephen Hemminger:
> On Wed, 6 Feb 2019 22:59:09 +0100
> Thomas Monjalon <thomas@monjalon.net> wrote:
>
> > The API function rte_eth_dev_fw_version_get() is querying drivers
> > via the operation callback fw_version_get().
> > The implementation of this operation is added for mlx4 and mlx5.
> > Both functions are copying the same ibverbs field fw_ver
> > which is retrieved when calling ibv_query_device[_ex]()
> > during the port probing.
> >
> > It is tested with command "drvinfo" of examples/ethtool/.
> >
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
>
> Looks good, but hard to test because:
> * testpmd doesn't report it
Yes, good idea, we should do this query somewhere in testpmd.
Can be a separate command or part of some other infos.
> * with netvsc (and failsafe) the device is owned and not visible
>
> Fixing testpmd is not hard, but what is best way to handle
> the nested device situation.
I am not sure we want to expose such info via failsafe or bonding.
If we are interested to know the underlying hardware, we should
access directly to the nested device.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH] net/mlx: support firmware version query
2019-02-06 22:23 ` Thomas Monjalon
@ 2019-02-06 22:27 ` Stephen Hemminger
0 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2019-02-06 22:27 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: Matan Azrad, Shahaf Shuler, Yongseok Koh, dev
On Wed, 06 Feb 2019 23:23:07 +0100
Thomas Monjalon <thomas@monjalon.net> wrote:
> 06/02/2019 23:16, Stephen Hemminger:
> > On Wed, 6 Feb 2019 22:59:09 +0100
> > Thomas Monjalon <thomas@monjalon.net> wrote:
> >
> > > The API function rte_eth_dev_fw_version_get() is querying drivers
> > > via the operation callback fw_version_get().
> > > The implementation of this operation is added for mlx4 and mlx5.
> > > Both functions are copying the same ibverbs field fw_ver
> > > which is retrieved when calling ibv_query_device[_ex]()
> > > during the port probing.
> > >
> > > It is tested with command "drvinfo" of examples/ethtool/.
> > >
> > > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> >
> > Looks good, but hard to test because:
> > * testpmd doesn't report it
>
> Yes, good idea, we should do this query somewhere in testpmd.
> Can be a separate command or part of some other infos.
>
> > * with netvsc (and failsafe) the device is owned and not visible
> >
> > Fixing testpmd is not hard, but what is best way to handle
> > the nested device situation.
>
> I am not sure we want to expose such info via failsafe or bonding.
> If we are interested to know the underlying hardware, we should
> access directly to the nested device.
The nested devices are not visible in testpmd (or other
applications that iterate over ports).
^ permalink raw reply [flat|nested] 6+ messages in thread
* [dpdk-dev] [PATCH v2] net/mlx: support firmware version query
2019-02-06 21:59 [dpdk-dev] [PATCH] net/mlx: support firmware version query Thomas Monjalon
2019-02-06 22:16 ` Stephen Hemminger
@ 2019-02-06 22:25 ` Thomas Monjalon
2019-02-10 15:11 ` Shahaf Shuler
1 sibling, 1 reply; 6+ messages in thread
From: Thomas Monjalon @ 2019-02-06 22:25 UTC (permalink / raw)
To: Matan Azrad, Shahaf Shuler, John McNamara, Marko Kovacevic, Yongseok Koh
Cc: dev
The API function rte_eth_dev_fw_version_get() is querying drivers
via the operation callback fw_version_get().
The implementation of this operation is added for mlx4 and mlx5.
Both functions are copying the same ibverbs field fw_ver
which is retrieved when calling ibv_query_device[_ex]()
during the port probing.
It is tested with command "drvinfo" of examples/ethtool/.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
v2: add feature in release notes and drivers table
---
doc/guides/nics/features/mlx4.ini | 1 +
doc/guides/nics/features/mlx5.ini | 1 +
doc/guides/rel_notes/release_19_05.rst | 6 ++++++
drivers/net/mlx4/mlx4.c | 1 +
drivers/net/mlx4/mlx4.h | 1 +
drivers/net/mlx4/mlx4_ethdev.c | 26 ++++++++++++++++++++++++++
drivers/net/mlx5/mlx5.c | 6 +++++-
drivers/net/mlx5/mlx5.h | 1 +
drivers/net/mlx5/mlx5_ethdev.c | 26 ++++++++++++++++++++++++++
9 files changed, 68 insertions(+), 1 deletion(-)
diff --git a/doc/guides/nics/features/mlx4.ini b/doc/guides/nics/features/mlx4.ini
index 98a3f6119..a211aef33 100644
--- a/doc/guides/nics/features/mlx4.ini
+++ b/doc/guides/nics/features/mlx4.ini
@@ -28,6 +28,7 @@ Inner L4 checksum = Y
Packet type parsing = Y
Basic stats = Y
Stats per queue = Y
+FW version = Y
Other kdrv = Y
Power8 = Y
x86-32 = Y
diff --git a/doc/guides/nics/features/mlx5.ini b/doc/guides/nics/features/mlx5.ini
index b28b43e5c..f7e73587b 100644
--- a/doc/guides/nics/features/mlx5.ini
+++ b/doc/guides/nics/features/mlx5.ini
@@ -39,6 +39,7 @@ Tx descriptor status = Y
Basic stats = Y
Extended stats = Y
Stats per queue = Y
+FW version = Y
Multiprocess aware = Y
Other kdrv = Y
ARMv8 = Y
diff --git a/doc/guides/rel_notes/release_19_05.rst b/doc/guides/rel_notes/release_19_05.rst
index e3a7ed22f..598001805 100644
--- a/doc/guides/rel_notes/release_19_05.rst
+++ b/doc/guides/rel_notes/release_19_05.rst
@@ -54,6 +54,12 @@ New Features
Also, make sure to start the actual text at the margin.
=========================================================
+* **Updated Mellanox drivers.**
+
+ New features and improvements were done in mlx4 and mlx5 PMDs:
+
+ * Added firmware version reading.
+
Removed Items
-------------
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 070cf7111..6f29e5a62 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -237,6 +237,7 @@ static const struct eth_dev_ops mlx4_dev_ops = {
.mac_addr_set = mlx4_mac_addr_set,
.stats_get = mlx4_stats_get,
.stats_reset = mlx4_stats_reset,
+ .fw_version_get = mlx4_fw_version_get,
.dev_infos_get = mlx4_dev_infos_get,
.dev_supported_ptypes_get = mlx4_dev_supported_ptypes_get,
.vlan_filter_set = mlx4_vlan_filter_set,
diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h
index e6fb934fa..6f4111582 100644
--- a/drivers/net/mlx4/mlx4.h
+++ b/drivers/net/mlx4/mlx4.h
@@ -131,6 +131,7 @@ int mlx4_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr);
int mlx4_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on);
int mlx4_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats);
void mlx4_stats_reset(struct rte_eth_dev *dev);
+int mlx4_fw_version_get(struct rte_eth_dev *dev, char *fw_ver, size_t fw_size);
void mlx4_dev_infos_get(struct rte_eth_dev *dev,
struct rte_eth_dev_info *info);
int mlx4_link_update(struct rte_eth_dev *dev, int wait_to_complete);
diff --git a/drivers/net/mlx4/mlx4_ethdev.c b/drivers/net/mlx4/mlx4_ethdev.c
index 195a1b6df..d0efa7d06 100644
--- a/drivers/net/mlx4/mlx4_ethdev.c
+++ b/drivers/net/mlx4/mlx4_ethdev.c
@@ -592,6 +592,32 @@ mlx4_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
info->flow_type_rss_offloads = mlx4_conv_rss_types(priv, 0, 1);
}
+/**
+ * Get firmware version of a device.
+ *
+ * @param dev
+ * Ethernet device port.
+ * @param fw_ver
+ * String output allocated by caller.
+ * @param fw_size
+ * Size of the output string, including terminating null byte.
+ *
+ * @return
+ * 0 on success, or the size of the non truncated string if too big.
+ */
+int mlx4_fw_version_get(struct rte_eth_dev *dev, char *fw_ver, size_t fw_size)
+{
+ struct priv *priv = dev->data->dev_private;
+ struct ibv_device_attr *attr = &priv->device_attr;
+ size_t size = strnlen(attr->fw_ver, sizeof(attr->fw_ver)) + 1;
+
+ if (fw_size < size)
+ return size;
+ if (fw_ver != NULL)
+ strlcpy(fw_ver, attr->fw_ver, fw_size);
+ return 0;
+}
+
/**
* DPDK callback to get device statistics.
*
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index a913a5955..df71707cc 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -374,6 +374,7 @@ const struct eth_dev_ops mlx5_dev_ops = {
.xstats_get = mlx5_xstats_get,
.xstats_reset = mlx5_xstats_reset,
.xstats_get_names = mlx5_xstats_get_names,
+ .fw_version_get = mlx5_fw_version_get,
.dev_infos_get = mlx5_dev_infos_get,
.dev_supported_ptypes_get = mlx5_dev_supported_ptypes_get,
.vlan_filter_set = mlx5_vlan_filter_set,
@@ -403,18 +404,20 @@ const struct eth_dev_ops mlx5_dev_ops = {
.is_removed = mlx5_is_removed,
};
+/* Available operations from secondary process. */
static const struct eth_dev_ops mlx5_dev_sec_ops = {
.stats_get = mlx5_stats_get,
.stats_reset = mlx5_stats_reset,
.xstats_get = mlx5_xstats_get,
.xstats_reset = mlx5_xstats_reset,
.xstats_get_names = mlx5_xstats_get_names,
+ .fw_version_get = mlx5_fw_version_get,
.dev_infos_get = mlx5_dev_infos_get,
.rx_descriptor_status = mlx5_rx_descriptor_status,
.tx_descriptor_status = mlx5_tx_descriptor_status,
};
-/* Available operators in flow isolated mode. */
+/* Available operations in flow isolated mode. */
const struct eth_dev_ops mlx5_dev_ops_isolate = {
.dev_configure = mlx5_dev_configure,
.dev_start = mlx5_dev_start,
@@ -432,6 +435,7 @@ const struct eth_dev_ops mlx5_dev_ops_isolate = {
.xstats_get = mlx5_xstats_get,
.xstats_reset = mlx5_xstats_reset,
.xstats_get_names = mlx5_xstats_get_names,
+ .fw_version_get = mlx5_fw_version_get,
.dev_infos_get = mlx5_dev_infos_get,
.dev_supported_ptypes_get = mlx5_dev_supported_ptypes_get,
.vlan_filter_set = mlx5_vlan_filter_set,
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 45f039821..3193ed9ca 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -274,6 +274,7 @@ int mlx5_set_flags(struct rte_eth_dev *dev, unsigned int keep,
unsigned int flags);
int mlx5_dev_configure(struct rte_eth_dev *dev);
void mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info);
+int mlx5_fw_version_get(struct rte_eth_dev *dev, char *fw_ver, size_t fw_size);
const uint32_t *mlx5_dev_supported_ptypes_get(struct rte_eth_dev *dev);
int mlx5_link_update(struct rte_eth_dev *dev, int wait_to_complete);
int mlx5_force_link_status_change(struct rte_eth_dev *dev, int status);
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index d178ed6a1..8158b4a9f 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -557,6 +557,32 @@ mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
}
}
+/**
+ * Get firmware version of a device.
+ *
+ * @param dev
+ * Ethernet device port.
+ * @param fw_ver
+ * String output allocated by caller.
+ * @param fw_size
+ * Size of the output string, including terminating null byte.
+ *
+ * @return
+ * 0 on success, or the size of the non truncated string if too big.
+ */
+int mlx5_fw_version_get(struct rte_eth_dev *dev, char *fw_ver, size_t fw_size)
+{
+ struct priv *priv = dev->data->dev_private;
+ struct ibv_device_attr *attr = &priv->device_attr.orig_attr;
+ size_t size = strnlen(attr->fw_ver, sizeof(attr->fw_ver)) + 1;
+
+ if (fw_size < size)
+ return size;
+ if (fw_ver != NULL)
+ strlcpy(fw_ver, attr->fw_ver, fw_size);
+ return 0;
+}
+
/**
* Get supported packet types.
*
--
2.20.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/mlx: support firmware version query
2019-02-06 22:25 ` [dpdk-dev] [PATCH v2] " Thomas Monjalon
@ 2019-02-10 15:11 ` Shahaf Shuler
0 siblings, 0 replies; 6+ messages in thread
From: Shahaf Shuler @ 2019-02-10 15:11 UTC (permalink / raw)
To: Thomas Monjalon, Matan Azrad, John McNamara, Marko Kovacevic,
Yongseok Koh
Cc: dev
Thursday, February 7, 2019 12:25 AM, Thomas Monjalon:
> Cc: dev@dpdk.org
> Subject: [PATCH v2] net/mlx: support firmware version query
>
> The API function rte_eth_dev_fw_version_get() is querying drivers via the
> operation callback fw_version_get().
> The implementation of this operation is added for mlx4 and mlx5.
> Both functions are copying the same ibverbs field fw_ver which is retrieved
> when calling ibv_query_device[_ex]() during the port probing.
>
> It is tested with command "drvinfo" of examples/ethtool/.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Applied to next-net-mlx, thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-02-10 15:11 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-06 21:59 [dpdk-dev] [PATCH] net/mlx: support firmware version query Thomas Monjalon
2019-02-06 22:16 ` Stephen Hemminger
2019-02-06 22:23 ` Thomas Monjalon
2019-02-06 22:27 ` Stephen Hemminger
2019-02-06 22:25 ` [dpdk-dev] [PATCH v2] " Thomas Monjalon
2019-02-10 15:11 ` Shahaf Shuler
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).