Use the imgctrl tool to query, program and switch to a new FPGA image.
Check the correct FPGA image number of the SmartNIC. See FPGA image types and numbers in DN-1128.
The imgctrl tool is a Napatech standalone tool which manages the FPGA image configuration of Napatech SmartNICs. This procedure describes imgctrl command examples to query, program and switch to a new FPGA image.
-
Check the FPGA state of the SmartNIC.
An output example:/opt/napatech3/bin/imgctrl -q... Scanning for Napatech adapters.. Adapter 0: PCI SLOT : 0000:42:00.0 PCI DEVICE ID : 01D5 PCI LANES : x16 ADAPTER TYPE : NT50B01-01-NEBS-2x25-E3-FF-ANL 2x25Gb SFP28 platform RUNNING FPGA: FPGA IDENT : 200-9541-35-20-0000 DESCRIPTION : 2x25/10Gb, capture FPGA BANK0: PRODUCT CODE : 9541 VERSION : 35.20 DOWNLOADED BY : ntope FPGA BANK1: PRODUCT CODE : 9541 VERSION : 35.20 DOWNLOADED BY : ntope SUPPORTCHIP INFO: NT50B01 : v3.5s FPGA IMAGE STATE: IMAGE STATE : NEUTRAL (code 0) PRIMARY BANK : 0 RUNNING BANK : 0There are two flash banks in the SmartNIC as shown in the output example. The currently loaded FPGA image is displayed as
PRIMARY BANKwhich is bank 0 in this example. -
Enter the following command to list the available FPGA images.
ls -R /opt/napatech3/images/ -
Program the FPGA with the appropriate image using the imgctrl
command.
where:imgctrl -a 0 -p --ntimg <path_to_image_file> --ini <id_string>path_to_image_filespecifies the path to the.ntimgFPGA image file to be uploaded to the flashid_stringspecifies a user-chosen identifier
This is an example of the command to program the FPGA image.
/opt/napatech3/bin/imgctrl -a0 -p \ --ntimg 200-9530-42-05-00-210601-2117.ntimg --ini capAn output example:
The FPGA upgrade must not be interrupted.... Scanning for Napatech adapters.. Adapter upgrade commencing.. Writing FPGA bank 1 Erasing................... 100% done Writing................... 100% done Verifying................. 100% done Done writing FPGA bank 1 ... Upgrade process complete -
Switch to the new FPGA image using the imgctrl command.
Run the following command to complete switching the image./opt/napatech3/bin/imgctrl -a0 -s
An output example:/opt/napatech3/bin/imgctrl -a0 -s --confirmScanning for Napatech adapters.. Applying current running image as safeboot image.. OK. Adapter PrimaryImage has been updated to reflect current running image. -
Switching to the new FPGA image may fail with an error as follows on some
servers.
You must reboot the server to be able to detect the SmartNIC again.... Error: Adapter did not wake up after image switch. Please reboot machine to re-enable adapter. You may need to apply --pcirst next time you switch image. FAIL. Switching failed. Use --query to examine adapter
After the server reboot, check the image state of the SmartNIC.reboot
An output example:/opt/napatech3/bin/imgctrl -q
The image is in... FPGA IMAGE STATE: IMAGE STATE : FAILED (code 3) ...FAILEDstate. Run the following command to reset the image to theNEUTRALstate.
An output example:/opt/napatech3/bin/imgctrl -a0 -s --discard
Check the image state again.Scanning for Napatech adapters.. Resetting bank switch statemachine back to neutral.. OK. Adapter bank switch statemachine is reset back to neutral
Confirm that the image is in/opt/napatech3/bin/imgctrl -qNEUTRALstate and switch the image with the --pcirst parameter.
An output example:/opt/napatech3/bin/imgctrl -a0 -s --pcirst
Reboot the server.Scanning for Napatech adapters.. Switching image on adapter 0: OK. Reboot required to switch image. Do not forget to --confirm/--discard the adapter once rebooted!
Run the following command to complete switching the image.reboot
An output example:/opt/napatech3/bin/imgctrl -a0 -s --confirmScanning for Napatech adapters.. Applying current running image as safeboot image.. OK. Adapter PrimaryImage has been updated to reflect current running image. -
Confirm the FPGA image state.
An output example:/opt/napatech3/bin/imgctrl -q... Adapter 0: PCI SLOT : 0000:42:00.0 PCI DEVICE ID : 01D5 PCI LANES : x16 ADAPTER TYPE : NT50B01-01-NEBS-2x25-E3-FF-ANL 2x25Gb SFP28 platform RUNNING FPGA: FPGA IDENT : 200-9541-47-07-0000 DESCRIPTION : 2x25/10Gb, capture FPGA BANK0: PRODUCT CODE : 9541 VERSION : 35.20 DOWNLOADED BY : ntope FPGA BANK1: PRODUCT CODE : 9541 VERSION : 47.07 DOWNLOADED BY : cap SUPPORTCHIP INFO: NT50B01 : v3.5s FPGA IMAGE STATE: IMAGE STATE : NEUTRAL (code 0) PRIMARY BANK : 1 RUNNING BANK : 1
The latest FPGA image is programmed and switched as the primary image in the SmartNIC.