bnxtnvm - Broadcom NetXtreme网卡固件更新和配置实用程序。使用该工具可以对Broadcom网卡进行固件更新、配置修改以及日志收集等工作。该工程支持Linux/Windows/Esxi/FreeBSD等主流常用操作系统。本文以Linux系统为例简要概述了该工具的命令选项及使用方法。
一、命令参数概览
[root@node01 ~]# bnxtnvm -h
SURNAME
bnxtnvm
DESCRIPTION
Broadcom NetXtreme-C/E/S firmware update and configuration utility
SYNOPSIS
bnxtnvm [OPTIONS] <COMMAND> [Params]
OPTIONS
-h : Display help message
-dev=<device> : Specify the physical device name
-live : Update the Firmware without the server reboot or power cycle
-save : This option is supported only for tunnel commands.
Use this option to save the vxlan_ipv4 tunnel type configuration into NVM
-online : Fetch FW image online from Broadcom server and perform upgrade
-type=<type> : Specify item type by name or number (?=list)
-savemac : Save MAC Address of all PF's of the device
-y|--yes : Specify this option to answer 'yes' in prompt
-force : Force installation
COMMANDS
Firmware update commands
install : Install firmware package file for Broadcom devices
verify : Verify if firmware package is installed correctly on the device
fw_sync : Synchronize SBI, SRT and CRT Primary and Secondary images
Query commands
version : Query bnxtnvm version
list : Query package components and associated version details
view : Query package component details
listdev : Scan and display the supported Broadcom device information
saveoptions : Save NVM configuration options on the device to a file
devid : Query Broadcom device id's
device_info : Query Broadcom device information and default hardware resources profile version
getoption : Query current NVM configuration option settings of a device
pkgver : Query firmware package version installed on the device
device_temperature : Query the device temperature in Celsius
moduleinfo : Query the PHY module information
ether_serdes_eye_diagram : Query the ethernet serdes eye diagram
pci_eye_diagram : Query the pci eye diagram
pcie_counters : Query the pcie counters of the device
query_tunnel_redirect : Query tunnel redirection for a specified VF
get_mtu : Query MTU of requested PF
read : Read NVM item data and write contents to a file
optionhelp : Query detailed help for each NVM configuration option
pci_eye_scope : Query the Horizontal, Vertical margin values along with PCIe link rating and displays eye diagram
get_backup_power_config : Query backup power configuration of the device. This is applicable only for NX-S devices
Configure commands
setoption : Configure NVM configuration option settings of a device
resmgmt : Resource Management to Get/Set Resources
write : Create or overwrite NVM data item with a file
cfgtunnel : Custom tunnel configuration (Query, free Port and Set Port)
add_tunnel_redirect : Add tunnel redirection for a specified VF
del_tunnel_redirect : Remove tunnel redirection for a specified VF
reset_ap : Reset the management processor. This is applicable only for NX-S devices
set_mtu : Configure MTU of requested PF
vf : Configure the trusted VF
flow_reset : Resets the CFA flows of the device
prbs_test : Configure and run PRBS test on a given port
add_ntuple_filter : Add ntuple flow filter for the specified MAC and destination port
free_ntuple_filter : Free ntuple flow filter for the specified filter id
reset : Reset the device. This command is not supported in multi host environments.
restore_factory_defaults : Restores NVM configuration to factory defaults
set_backup_power_config : Configure backup power configuration of the device. This is applicable only for NX-S devices
loopback : Configure different loopback modes ie phy loopback, mac loopback and external loopback
Debug commands
coredump : Retrieves coredump data from device. A .core file will be generated in the same directory
backup : Read NVM contents to a file
device_health_check : Checks the device health
dscdump : Retrieves DSC Dump from device. A .dmp file will be generated in the same directory
fwcli : Retrieve firmware CLI dump of the device.
EXAMPLES
To display supported devices : bnxtnvm listdev
To install firmware : bnxtnvm -dev=<ethX> install <package file>
To verify firmware installed : bnxtnvm -dev=<ethX> verify
To get NVM config option : bnxtnvm -dev=<ethX> getoption=<NVM_option_name>:[function/port index]
To set NVM config option : bnxtnvm -dev=<ethX> setoption=<NVM_option_name>:[function/port index]#<val>
To get resources of PF : bnxtnvm -dev=<ethX> resmgmt min
bnxtnvm -dev=<ethX> resmgmt max
bnxtnvm -dev=<ethX> resmgmt max_cmpl
To get MTU of PF : bnxtnvm -dev=<ethX> get_mtu pf <pf_index>
To set MTU of PF : bnxtnvm -dev=<ethX> set_mtu <value> pf <pf_index>
To display pci eye diagram : bnxtnvm -dev=<ethX> pci_eye_diagram <pci_lane_number>
To configure tunnel redirection : bnxtnvm -dev=<ethX> cfgtunnel vxlan_ipv4 dst_port <port num>
To retrieve coredump : bnxtnvm -dev=<ethX> coredump
To reset firmware: bnxtnvm -dev=<ethX> reset
二、常用命令选项介绍
2.1,bnxtnvm listdev
扫描并显示支持的Broadcom设备信息。
[root@node01 ~]# bnxtnvm listdev
Broadcom NetXtreme E-Series Quad-port 25Gb SFP28 PCIe Ethernet Adapter #1
Device Interface Name: enp13f0np0
MACAddress: e4:3d:1a:86:8a:90
PCI Device Name: 0000:af:00.0
2.2,bnxtnvm device_info
查询Broadcom设备信息和默认硬件资源配置文件。
[root@node01 ~]# bnxtnvm device_info
Device Interface Name: enp13f0np0
MACAddress: e4:3d:1a:86:8a:90
Base MACAddress : Not Available
Device Serial Number: P425G21240009KFV
Chip Number: BCM57504
Part Number: BCM957504-P425G
Description : Broadcom NetXtreme E-Series Quad-port 25Gb SFP28 PCIe Ethernet Adapter
PCI Vendor ID: 14e4
PCI Device ID: 1751
PCI Subsys Vendor Id: 14e4
PCI Subsys Device Id: 4250
PCI Device Name: 0000:af:00.0
Adapter Rev: 11
Active Package version: 216.0.333.11
Package version on NVM: 216.0.333.11
Active NVM config version : Not Available
NVM config version : Not Available
Firmware Reset Counter: Not Available
Error Recovery Counter: Not Available
Crash Dump Timestamp: Not Available
Reboot Required: No
FW Image Status: Not Available
2.3,bnxtnvm install
为Broadcom设备安装固件包文件(更新网卡固件)
[root@node01 ~]# ls -lh Firmware-218.0.169.0/BCM957504-P425G.pkg
-rw-r--r--. 1 root root 2.0M Sep 16 11:49 Firmware-218.0.169.0/BCM957504-P425G.pkg
[root@fedora ~]# bnxtnvm -dev=enp13f0np0 install Firmware-218.0.169.0/BCM957504-P425G.pkg
Broadcom NetXtreme-C/E/S firmware update and configuration utility version v218.0.219.6
NetXtreme-E Controller #1 at PCI Domain:0000 Bus:af Dev:00
Firmware on NVM - v216.0.333.11
NetXtreme-E Controller #1 will be updated to firmware version v218.0.169.0
Do you want to continue (Y/N)?y
NetXtreme-C/E/S Controller #1 is being updated.................................. ........
Firmware update is completed.
A system reboot is needed for firmware update to take effect.
[root@node01 ~]# bnxtnvm verify
Device #1
---------
Device: enp13f0np0
Verifying the NVM components
All the NVM components are verified successfully
[root@node01 ~]# bnxtnvm device_info
Device Interface Name: enp13f0np0
MACAddress: e4:3d:1a:86:8a:90
Base MACAddress : Not Available
Device Serial Number: P425G21240009KFV
Chip Number: BCM57504
Part Number: BCM957504-P425G
Description : Broadcom NetXtreme E-Series Quad-port 25Gb SFP28 PCIe Ethernet Adapter
PCI Vendor ID: 14e4
PCI Device ID: 1751
PCI Subsys Vendor Id: 14e4
PCI Subsys Device Id: 4250
PCI Device Name: 0000:af:00.0
Adapter Rev: 11
Active Package version: 216.0.333.11
Package version on NVM: 218.0.169.0
Active NVM config version : Not Available
NVM config version : Not Available
Firmware Reset Counter: Not Available
Error Recovery Counter: Not Available
Crash Dump Timestamp: Not Available
Reboot Required: Yes
FW Image Status: Not Available
2.4,bnxtnvm version
查看bnxtnvm版本。
[root@node01 ~]# bnxtnvm version
Broadcom NetXtreme-C/E/S firmware update and configuration utility
Version v218.0.219.6
2.5,bnxtnvm list
查询网卡固件相关的包组件和相关的版本详细信息。
[root@node01 ~]# bnxtnvm list
Device #1
---------
Device: enp13f0np0
item type ord.ext data/length attr version
1 VPD 0.0 324/4096 0000
2 systemCfg 0.0 36864/36864 0001
3 pkgLog 0.0 624/4096 0000 218.0.219.21
4 update 0.0 2091956/2097152 0000
5 iSCSIboot 0.0 64096/65536 0010 218.0.3.0
6 SBIImage 0.0 212176/524288 0000 218.0.109.0
7 MBA 0.0 223008/225280 0010 218.0.219.1
8 iSCSIcfg 0.0 2048/4096 0000
9 iSCSIcfg 1.0 2048/4096 0000
10 iSCSIcfg 2.0 2048/4096 0000
11 iSCSIcfg 3.0 2048/4096 0000
12 factoryCfg 0.0 36864/36864 0001
13 SRTImage 1.0 334672/335872 0000 218.0.219.13
14 CRTImage 1.0 1143952/1146880 0000 218.0.219.13
15 SBIImage 1.0 212176/524288 0000 218.0.109.0
16 CrashDmpData 0.0 524288/524288 0001
17 CrashDmpData 1.0 524288/524288 0001
18 CRTImage 0.0 1143952/1146880 0000 218.0.219.13
19 CCM 0.0 62240/65536 0010 218.0.219.2
20 SRTImage 0.0 334672/335872 0000 218.0.219.13
2.6,bnxtnvm view
查询网卡固件包组件详细信息。
[root@node01 ~]# bnxtnvm view
Device #1
---------
Device: enp13f0np0
type ord.ext data/length attr version
VPD 0.0 324/4096 0000
VPD Resource Tag ID "Broadcom NetXtreme E-Series Quad-port 25Gb SFP28 PCIe Ethernet Adapter"
VPD Resource Tag VPD-R
PN: "BCM957504-P425G"
MN: "14E4"
V0: "218.0.219.21"
V1: "218.0.219.7"
V3: "218.0.219.13"
V6: "218.0.219.1"
V7: "218.0.219.2"
V9: "218.0.3.0"
VB: "REV015DEV525"
SN: "P425G21240009KFV"
VPD Resource Tag END
type ord.ext data/length attr version
systemCfg 0.0 36864/36864 0001
type ord.ext data/length attr version
pkgLog 0.0 624/4096 0000 218.0.219.21
2020-06-28 17:52:56Z Broadcom NetXtreme E-Series Quad-port 25Gb SFP28 PCIe Ethernet Adapter 216.0.333.11 2020-06-09 15:49:36Z 260AB987 11 ffb
2021-06-15 15:29:10Z Broadcom NetXtreme E-Series Quad-port 25Gb SFP28 PCIe Ethernet Adapter 216.0.333.11 2020-06-28 10:53:23 08B45EA3 14 3fff
2021-09-16 09:51:11Z Broadcom NetXtreme E-Series Quad-port 25Gb SFP28 PCIe Ethernet Adapter 218.0.169.0 2021-01-18 21:15:30Z Success 7AAC3E35 8 5c3a 0 cfw May 18 2020 0
2021-09-16 09:59:48Z Broadcom NetXtreme E-Series Quad-port 25Gb SFP28 PCIe Ethernet Adapter 218.0.219.21 2021-05-18 21:56:54Z Success F4644DEC 8 5c3a 0 cfw Dec 29 2020 0
type ord.ext data/length attr version
update 0.0 2091956/2097152 0000
type ord.ext data/length attr version
iSCSIboot 0.0 64096/65536 0010 218.0.3.0
type ord.ext data/length attr version
SBIImage 0.0 212176/524288 0000 218.0.109.0
type ord.ext data/length attr version
MBA 0.0 223008/225280 0010 218.0.219.1
type ord.ext data/length attr version
iSCSIcfg 0.0 2048/4096 0000
type ord.ext data/length attr version
iSCSIcfg 1.0 2048/4096 0000
type ord.ext data/length attr version
iSCSIcfg 2.0 2048/4096 0000
type ord.ext data/length attr version
iSCSIcfg 3.0 2048/4096 0000
type ord.ext data/length attr version
factoryCfg 0.0 36864/36864 0001
type ord.ext data/length attr version
SRTImage 1.0 334672/335872 0000 218.0.219.13
type ord.ext data/length attr version
CRTImage 1.0 1143952/1146880 0000 218.0.219.13
type ord.ext data/length attr version
SBIImage 1.0 212176/524288 0000 218.0.109.0
type ord.ext data/length attr version
CrashDmpData 0.0 524288/524288 0001
type ord.ext data/length attr version
CrashDmpData 1.0 524288/524288 0001
type ord.ext data/length attr version
CRTImage 0.0 1143952/1146880 0000 218.0.219.13
type ord.ext data/length attr version
CCM 0.0 62240/65536 0010 218.0.219.2
type ord.ext data/length attr version
SRTImage 0.0 334672/335872 0000 218.0.219.13
2.7,bnxtnvm devid
查询网卡设备ID信息。
[root@node01 ~]# bnxtnvm devid
Device #1
---------
Device: enp13f0np0
PCI VendorID: 14e4
PCI DeviceID: 1751
PCI Subsys VendorID: 14e4
PCI Subsys DeviceID: 4250
PCI Device Name: 0000:af:00:0
2.8,bnxtnvm pkgver
查询网卡设备上安装的固件包版本号。
[root@node01 ~]# bnxtnvm -dev=ens13f0np0 pkgver
Active Package version: 218.0.219.21
Package version on NVM: 218.0.219.21
Primary SBI Version: 218.0.109.0
Secondary SBI Version: 218.0.109.0
Primary SRT version: 218.0.219.13
Secondary SRT version: 218.0.219.13
Primary CRT version: 218.0.219.13
Secondary CRT version: 218.0.219.13
三、收集网卡DUMP日志
3.1,收集网卡dump日志通常需要执行bnxtnvm coredump 和 bnxtnvm backup。
[root@node01 ~]# bnxtnvm -dev=enp13f0np0 coredump
Retrieving CoreDump, please wait.........
Generated CoreDump file node01.localdomain_20240425_042012_822222.core
[root@node01 ~]# bnxtnvm -dev=enp13f0np0 backup
Package file 00620bbba94c.pkg is generated from NVM contents
3.2,命令执行完成后,会在当前目录生成相应的.core文件和.pkg文件,将其copy出来交给技术支持,通常这需要Broadcom厂家技术人员进行分析。
四,修改网卡设置
1,以 “media_auto_detect” 为例,使用getoption和setoption进行配置的查询和修改。
[root@node01 ~]# bnxtnvm -dev=ens13f0np0 getoption=media_auto_detect:0
media_auto_detect = Enabled
[root@node01 ~]# bnxtnvm -dev=ens13f0np0 setoption=media_auto_detect:0#0
media_auto_detect is set successfully
Please reboot the system to apply the configuration
2,修改完成并重启服务器后,再次查询。
[root@node01 ~]# bnxtnvm -dev=ens13f0np0 getoption=media_auto_detect:0
media_auto_detect = Disabled
3,查询所有支持修改的NVM Config option。
[root@node01 ~]# bnxtnvm -dev=ens13f0np0 optionhelp=?
Name Scope
---------------- ---------
an_protocol Port
autodetect_speed_exclude_mask Port
afm_rm_resc_strategy Device
bw_reservation Function
bw_reservation_valid Function
bw_limit Function
bw_limit_valid Function
cos_precedence_order Device
dcbx_mode Port
dcbx_capability Port
drv_flow_control Port
disable_ntuple Function
drv_link_speed Port
disable_gre_ver_check Device
disable_bcast_mcast Function
device_secure_mode Device
disable_roce_v1 Device
disable_nvgre_rx Device
disable_nvgre_tx Device
default_evb_mode Port
disable_rx_vlan_accel Device
disable_tx_vlan_accel Device
eee_pwr_save_mode Port
enable_sriov Device
enable_pme_capability Device
enable_l2_em_filter Device
enable_live_fw_upgrade Device
enable_adapter_error_recovery Device
enable_ecn Device
enable_truflow Function
enable_roce_bidi_optimization Device
firmware_link_speed_d0 Port
firmware_link_speed_d3 Port
flow_control_disable Function
fwd_err_correct Port
hide_host_pf Device
ignore_ari_capability Device
ipv4ovxlan_udp_port Device
ipv4ovxlan_redirect_vf Port
lldp_nearest_bridge Port
lldp_nearest_non_tpmr_bridge Port
link_training Port
logical_link_mode Function
max_num_pf_msix_vect Device
msix_vectors_per_vf Function
mf_mode Port
magic_packet_wol Port
media_auto_detect Port
mba Function
mba_boot_type Function
mba_delay_time Function
mba_setup_hot_key Function
mba_hide_setup_prompt Function
mba_boot_retry_count Function
mba_vlan Function
mba_vlan_value Function
mba_boot_protocol Function
mba_link_speed Function
mac_address Function
min_pf_msix_vectors Device
num_partitions_per_port Port
num_vf_per_pf Function
oobm_session_port Device
oobm_session_timeout Device
oobm_ap_uart_enable Device
oobm_ap_uart_timeout Device
oobm_watchdog Device
oobm_syslog_port Device
oobm_syslog_server_addr Device
oobm_debug Device
oobm_mac_address_port_0 Device
oobm_ipv4_addr_port_0 Device
oobm_ipv4_subnet_mask_port_0 Device
oobm_ipv4_default_gateway_port_0 Device
oobm_mac_address_port_1 Device
oobm_ipv4_addr_port_1 Device
oobm_ipv4_subnet_mask_port_1 Device
oobm_ipv4_default_gateway_port_1 Device
oobm_mac_address_port_2 Device
oobm_ipv4_addr_port_2 Device
oobm_ipv4_subnet_mask_port_2 Device
oobm_ipv4_default_gateway_port_2 Device
oobm_mac_address_port_3 Device
oobm_ipv4_addr_port_3 Device
oobm_ipv4_subnet_mask_port_3 Device
oobm_ipv4_default_gateway_port_3 Device
oobm_high_availability Device
oobm_port_selection Device
oobm_ipv4_src_addr Device
oobm_ipv4_src_subnet_mask Device
oobm_src_ip_control Device
phy_select Device
pairing_tunnel_type Device
pause_monitor_disable Device
port_hide Device
port_hide_capable Device
pci_preset Device
pfc_flood_check_time Device
pfc_flood_reenable_time Device
pcie_relaxed_ordering Device
rdma_capable Device
roce_bw_rate Device
roce_group_resource_max Device
roce_group_id Function
support_rdma Function
secondary_ext_phy_link_speed_d0 Port
secondary_ext_fw_link_speed_d3 Port
tx_sched_alloc_mode Device
For additional information about each parameter, please
run bnxtnvm -dev=<interface_name> optionhelp=<parameter> and/or
see the document 5740X-AN201-RDS NetXtreme NVRAM Access Application Note
4,查询具体的NVM Config option修改项。
[root@node01 ~]# bnxtnvm -dev=ens13f0np0 optionhelp=media_auto_detect
Name : media_auto_detect
Description : Media Auto Detect: Provides auto detection/sensing of the attached media
connector if present.
Option Type : Multi Instance Type
Max Instance Indexes : 0 to 15
Valid values :
0 (Disabled)
1 (Enabled)