Message ID | 20190326134535.3826-3-idosch@mellanox.com |
---|---|
State | Superseded |
Delegated to: | David Miller |
Headers | show |
Series | mlxsw: Add support for devlink info command | expand |
On Tue, 26 Mar 2019 13:46:26 +0000, Ido Schimmel wrote: > From: Shalom Toledo <shalomt@mellanox.com> > > Expose the following ASIC information via devlink info command: > - Hardware revision > - Firmware PSID > - Running firmware version > > Standard output example: > $ devlink dev info pci/0000:03:00.0 > pci/0000:03:00.0: > versions: > fixed: > hw.revision A0 > fw.psid MT_2750110033 > running: > fw.version 13.1910.622 > > Pretty JSON example: > $ devlink -jp dev info pci/0000:03:00.0 > { > "info": { > "pci/0000:03:00.0": { > "versions": { > "fixed": { > "hw.revision": "A0", > "fw.psid": "MT_2750110033" > }, > "running": { > "fw.version": "13.1910.622" > } > } > } > } > } > > Signed-off-by: Shalom Toledo <shalomt@mellanox.com> > Acked-by: Jiri Pirko <jiri@mellanox.com> > Signed-off-by: Ido Schimmel <idosch@mellanox.com> Looks good & glad to see it, but what's a PSID? ;) I found this after 5 seconds of googling: http://www.mellanox.com/page/firmware_HCA_FW_identification But it still just say "PSID" without explaining what the acronym stands for :)
Jakub Kicinski <jakub.kicinski@netronome.com> writes: > Looks good & glad to see it, but what's a PSID? ;) > > I found this after 5 seconds of googling: > > http://www.mellanox.com/page/firmware_HCA_FW_identification > > But it still just say "PSID" without explaining what the acronym stands > for :) "Parameter Set ID" http://www.mellanox.com/pdf/MFT/MFT_Windows_user_manual.pdf
Tue, Mar 26, 2019 at 09:48:07PM CET, jakub.kicinski@netronome.com wrote: >On Tue, 26 Mar 2019 13:46:26 +0000, Ido Schimmel wrote: >> From: Shalom Toledo <shalomt@mellanox.com> >> >> Expose the following ASIC information via devlink info command: >> - Hardware revision >> - Firmware PSID >> - Running firmware version >> >> Standard output example: >> $ devlink dev info pci/0000:03:00.0 >> pci/0000:03:00.0: >> versions: >> fixed: >> hw.revision A0 >> fw.psid MT_2750110033 >> running: >> fw.version 13.1910.622 >> >> Pretty JSON example: >> $ devlink -jp dev info pci/0000:03:00.0 >> { >> "info": { >> "pci/0000:03:00.0": { >> "versions": { >> "fixed": { >> "hw.revision": "A0", >> "fw.psid": "MT_2750110033" >> }, >> "running": { >> "fw.version": "13.1910.622" >> } >> } >> } >> } >> } >> >> Signed-off-by: Shalom Toledo <shalomt@mellanox.com> >> Acked-by: Jiri Pirko <jiri@mellanox.com> >> Signed-off-by: Ido Schimmel <idosch@mellanox.com> > >Looks good & glad to see it, but what's a PSID? ;) > >I found this after 5 seconds of googling: > >http://www.mellanox.com/page/firmware_HCA_FW_identification > >But it still just say "PSID" without explaining what the acronym stands >for :) It's Mellanox board/setup identification.
On Wed, 27 Mar 2019 09:47:14 +0000, Petr Machata wrote: > Jakub Kicinski <jakub.kicinski@netronome.com> writes: > > > Looks good & glad to see it, but what's a PSID? ;) > > > > I found this after 5 seconds of googling: > > > > http://www.mellanox.com/page/firmware_HCA_FW_identification > > > > But it still just say "PSID" without explaining what the acronym stands > > for :) > > "Parameter Set ID" > http://www.mellanox.com/pdf/MFT/MFT_Windows_user_manual.pdf Thanks, would it be okay for you guys to spell that out, or at least add a description to the doc? Hopefully that can help with reuse and on the flip side avoiding using the same acronym for completely different things..
On Wed, Mar 27, 2019 at 10:53:37AM -0700, Jakub Kicinski wrote: > On Wed, 27 Mar 2019 09:47:14 +0000, Petr Machata wrote: > > Jakub Kicinski <jakub.kicinski@netronome.com> writes: > > > > > Looks good & glad to see it, but what's a PSID? ;) > > > > > > I found this after 5 seconds of googling: > > > > > > http://www.mellanox.com/page/firmware_HCA_FW_identification > > > > > > But it still just say "PSID" without explaining what the acronym stands > > > for :) > > > > "Parameter Set ID" > > http://www.mellanox.com/pdf/MFT/MFT_Windows_user_manual.pdf > > Thanks, would it be okay for you guys to spell that out, or at least > add a description to the doc? Hopefully that can help with reuse and > on the flip side avoiding using the same acronym for completely > different things.. OK. We can add fw.psid to Documentation/networking/devlink-info-versions.rst
On Wed, 27 Mar 2019 19:44:11 +0000, Ido Schimmel wrote: > On Wed, Mar 27, 2019 at 10:53:37AM -0700, Jakub Kicinski wrote: > > On Wed, 27 Mar 2019 09:47:14 +0000, Petr Machata wrote: > > > Jakub Kicinski <jakub.kicinski@netronome.com> writes: > > > > > > > Looks good & glad to see it, but what's a PSID? ;) > > > > > > > > I found this after 5 seconds of googling: > > > > > > > > http://www.mellanox.com/page/firmware_HCA_FW_identification > > > > > > > > But it still just say "PSID" without explaining what the acronym stands > > > > for :) > > > > > > "Parameter Set ID" > > > http://www.mellanox.com/pdf/MFT/MFT_Windows_user_manual.pdf > > > > Thanks, would it be okay for you guys to spell that out, or at least > > add a description to the doc? Hopefully that can help with reuse and > > on the flip side avoiding using the same acronym for completely > > different things.. > > OK. We can add fw.psid to > Documentation/networking/devlink-info-versions.rst Thanks!
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c index e70bb673eeec..61ab3fea2376 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core.c @@ -934,6 +934,41 @@ mlxsw_devlink_sb_occ_tc_port_bind_get(struct devlink_port *devlink_port, pool_type, p_cur, p_max); } +static int +mlxsw_devlink_info_get(struct devlink *devlink, struct devlink_info_req *req, + struct netlink_ext_ack *extack) +{ + struct mlxsw_core *mlxsw_core = devlink_priv(devlink); + char fw_info_psid[MLXSW_REG_MGIR_FW_INFO_PSID_SIZE]; + u32 hw_rev, fw_major, fw_minor, fw_sub_minor; + char mgir_pl[MLXSW_REG_MGIR_LEN]; + char buf[32]; + int err; + + mlxsw_reg_mgir_pack(mgir_pl); + err = mlxsw_reg_query(mlxsw_core, MLXSW_REG(mgir), mgir_pl); + if (err) + return err; + mlxsw_reg_mgir_unpack(mgir_pl, &hw_rev, fw_info_psid, &fw_major, + &fw_minor, &fw_sub_minor); + + sprintf(buf, "%X", hw_rev); + err = devlink_info_version_fixed_put(req, "hw.revision", buf); + if (err) + return err; + + err = devlink_info_version_fixed_put(req, "fw.psid", fw_info_psid); + if (err) + return err; + + sprintf(buf, "%d.%d.%d", fw_major, fw_minor, fw_sub_minor); + err = devlink_info_version_running_put(req, "fw.version", buf); + if (err) + return err; + + return 0; +} + static int mlxsw_devlink_core_bus_device_reload(struct devlink *devlink, struct netlink_ext_ack *extack) { @@ -968,6 +1003,7 @@ static const struct devlink_ops mlxsw_devlink_ops = { .sb_occ_max_clear = mlxsw_devlink_sb_occ_max_clear, .sb_occ_port_pool_get = mlxsw_devlink_sb_occ_port_pool_get, .sb_occ_tc_port_bind_get = mlxsw_devlink_sb_occ_tc_port_bind_get, + .info_get = mlxsw_devlink_info_get, }; static int