Use the imgctrl tool to query, program and switch to a new FPGA image.
Before you begin
Check the correct FPGA image number of the SmartNIC. See the FPGA images table in FPGA image types and numbers or DN-1128.
About this task
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.
Procedure
-
Check the FPGA state of the SmartNIC.
/opt/napatech3/bin/imgctrl -q
An output example:... 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 : 0
There are two flash banks in the SmartNIC as shown in the output example. The currently loaded FPGA image is displayed as PRIMARY BANK which 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.
imgctrl -a 0 -p --ntimg <path_to_image_file> --ini <id_string>
where:- path_to_image_file specifies the path to the .ntimg FPGA image file to be uploaded to the flash
- id_string specifies 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 cap
An output example:... 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
The FPGA upgrade must not be interrupted. -
Switch to the new FPGA image using the imgctrl command.
/opt/napatech3/bin/imgctrl -a0 -s /opt/napatech3/bin/imgctrl -a0 -s --confirm
Run the following command to complete switching the image./opt/napatech3/bin/imgctrl -a0 -s --confirm
An output example:Scanning 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.
... 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
You must reboot the server to be able to detect the SmartNIC again.reboot
After the server reboot, check the image state of the SmartNIC./opt/napatech3/bin/imgctrl -q
An output example:... FPGA IMAGE STATE: IMAGE STATE : FAILED (code 3) ...
The image is in FAILED state. Run the following command to reset the image to the NEUTRAL state./opt/napatech3/bin/imgctrl -a0 -s --discard
An output example:Scanning for Napatech adapters.. Resetting bank switch statemachine back to neutral.. OK. Adapter bank switch statemachine is reset back to neutral
Check the image state again./opt/napatech3/bin/imgctrl -q
Confirm that the image is in NEUTRAL state and switch the image with the --pcirst parameter./opt/napatech3/bin/imgctrl -a0 -s --pcirst
An output example: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!
Reboot the server.reboot
Run the following command to complete switching the image./opt/napatech3/bin/imgctrl -a0 -s --confirm
An output example:Scanning 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.
/opt/napatech3/bin/imgctrl -q
An output example:... 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
Note: Refer to DN-0487 for complete documentation on the Napatech image control tool imgctrl.
Results
The latest FPGA image is programmed and switched as the primary image in the SmartNIC.