Skip to content

Commit cf83c8f

Browse files
DmytroLinkinSaeed Mahameed
authored andcommitted
net/mlx5e: Add missing ethtool driver info for representors
For all representors added firmware version info to show in ethtool driver info. For uplink representor, because only it is tied to the pci device sysfs, added pci bus info. Fixes: ff9b85d ("net/mlx5e: Add some ethtool port control entries to the uplink rep netdev") Signed-off-by: Dmytro Linkin <[email protected]> Reviewed-by: Gavi Teitz <[email protected]> Reviewed-by: Roi Dayan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 9558580 commit cf83c8f

File tree

1 file changed

+18
-1
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+18
-1
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_rep.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,26 @@ static void mlx5e_rep_indr_unregister_block(struct mlx5e_rep_priv *rpriv,
6565
static void mlx5e_rep_get_drvinfo(struct net_device *dev,
6666
struct ethtool_drvinfo *drvinfo)
6767
{
68+
struct mlx5e_priv *priv = netdev_priv(dev);
69+
struct mlx5_core_dev *mdev = priv->mdev;
70+
6871
strlcpy(drvinfo->driver, mlx5e_rep_driver_name,
6972
sizeof(drvinfo->driver));
7073
strlcpy(drvinfo->version, UTS_RELEASE, sizeof(drvinfo->version));
74+
snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version),
75+
"%d.%d.%04d (%.16s)",
76+
fw_rev_maj(mdev), fw_rev_min(mdev),
77+
fw_rev_sub(mdev), mdev->board_id);
78+
}
79+
80+
static void mlx5e_uplink_rep_get_drvinfo(struct net_device *dev,
81+
struct ethtool_drvinfo *drvinfo)
82+
{
83+
struct mlx5e_priv *priv = netdev_priv(dev);
84+
85+
mlx5e_rep_get_drvinfo(dev, drvinfo);
86+
strlcpy(drvinfo->bus_info, pci_name(priv->mdev->pdev),
87+
sizeof(drvinfo->bus_info));
7188
}
7289

7390
static const struct counter_desc sw_rep_stats_desc[] = {
@@ -363,7 +380,7 @@ static const struct ethtool_ops mlx5e_vf_rep_ethtool_ops = {
363380
};
364381

365382
static const struct ethtool_ops mlx5e_uplink_rep_ethtool_ops = {
366-
.get_drvinfo = mlx5e_rep_get_drvinfo,
383+
.get_drvinfo = mlx5e_uplink_rep_get_drvinfo,
367384
.get_link = ethtool_op_get_link,
368385
.get_strings = mlx5e_rep_get_strings,
369386
.get_sset_count = mlx5e_rep_get_sset_count,

0 commit comments

Comments
 (0)