DOCA Documentation v1.3

DPU CLI

NVIDIA DOCA DPU CLI

This document provides quick access to a useful set of CLI commands and utilities on the NVIDIA® BlueField® DPU environment.

This guide provides a concise guide on useful commands for DOCA deployment and configuration. This tables in this guide provide two categories of commands:

  • General commands for Linux/networking environment
  • DOCA/DPU-specific commands
Note:

For more information about these commands, such as usage instructions, flag options, arguments and so on, use the -h option after the command or use the manual (e.g., man lspci).


Command Description
ifconfig

Used to configure kernel-resident network interfaces. It is used at boot time to set up interfaces as necessary. After that, it is usually only needed when debugging or when system tuning is needed.

If no arguments are given, ifconfig displays the status of the currently active interfaces. If a single interface argument is given, it displays the status of the given interface only. If a single -a argument is given, it displays the status of all interfaces, even those that are down. Otherwise, it configures an interface.

ethtool <devname>

Used to query and control network device driver and hardware settings, particularly for wired Ethernet devices.

<devname> is the name of the network device on which ethtool should operate.

Note:

This command shows the speed of the network card of the DPU.


lspci Displays information about PCIe buses in the system and devices connected to them. By default, it shows a brief list of devices.
tcpdump Dump traffic on a network. Usage: tcpdump -i <interface> where <interface> is any port interface (physical/SF rep/VF port rep).
ovs-vsctl Utility for querying and configuring ovs-vswitchd. The ovs-vsctl program supports the model of a bridge implemented by Open vSwitch in which a single bridge supports ports on multiple VLANs.
mount 10.0.0.10:/vol/myshare/ myshare/ Used for mounting a work directory on the DPU.
Note:

Must be used after creating a new directory named myshare under root (i.e., mkdir /myshare)

scp Secure copy (remote file copy program). Useful for copying files from BlueField to the host and vice versa.
iperf Used for server-client connection. Useful to check if the network connection achieves the speed of the network card on the DPU (line rate).

Command Description
ibdev2netdev Displays available mlnx interfaces
mst Used to start MST service, to stop it, and for other operations with NVIDIA devices like reset and enabling remote access
cat /etc/mlnx-release Displays the full BlueField OS (bfb) version
cat /etc/os-release Displays the details of the underlying OS installed on BlueField
ibv_devinfo Displays the current InfiniBand connected devices and relevant information. Useful for checking current firmware version.
ipmitool power cycle Power cycle
echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages DPDK setup. Allocates hugepages for DPDK environment abstraction layer (EAL).
mlxdevm tool The mlxdevm tool is found under /opt/mellanox/iproute2/sbin/. With this tool it is possible to create an SF and set its state to active, configure a HW address and set it to trusted, deploy the created SF and print info about it.
/opt/mellanox/iproute2/sbin/mlxdevm port add pci/<pci_address> flavour pcisf pfnum <correspondig_physical_function_number> sfnum <unique_sf_number> Creates an SF in the flavor of the given PF with the given unique SF number. Example:

/opt/mellanox/iproute2/sbin/mlxdevm port add pci/0000:03`:00.0 flavour pcisf pfnum 0 sfnum 4

/opt/mellanox/iproute2/sbin/mlxdevm port show Displays information about the available SFs
/opt/mellanox/iproute2/sbin/mlxdevm port function set pci/0000:03:00.0/<sf_index> hw_addr <HW_address> trust on state active Configures SF capabilities such as setting the HW address, making it "trusted", and setting its state to active. <sf_index> the SF. To obtain this index, you may run mlxdevm port show. Example:

/opt/mellanox/iproute2/sbin/mlxdevm port function set pci/0000:03:00.0/229377 hw_addr 02:25:f2:8d:a2:4c trust on state active

$ echo mlx5_core.sf.<next_serial> > /sys/bus/auxiliary/drivers/mlx5_core.sf_cfg/unbind

$ echo mlx5_core.sf. <next_serial> > /sys/bus/auxiliary/drivers/mlx5_core.sf/bind

These two commands deploy the created SF. The first command unbinds the SF from the default driver, while the second command binds the SF to the actual driver. The deployment phase should be done after the capabilities of the SF are configured. The SF is identified by <next_serial> which can be obtained by running the command below.
ls /sys/bus/auxiliary/devices/mlx5_core.sf.*

Displays additional information about the created SFs and their "next serial numbers".

For example, if mlx5_core.sf.2 exists in the output of the command, then running cat /sys/bus/auxiliary/devices/mlx5_core.sf.2/sfnum would output the sfnum that is related to mlx5_core.sf.2.

/opt/mellanox/iproute2/sbin/mlxdevm port function set pci/<pci_address>/<sf_index> state inactive

/opt/mellanox/iproute2/sbin/mlxdevm port del pci/<pci_address>/<sf_index>

These two commands must be executed to delete a given SF. First, users must set the state of the SF to inactive, and only then should it be deleted.

/opt/mellanox/iproute2/sbin/mlxdevm port help Displays additional information about operations that can be used on created SF ports
crictl pods Displays currently active K8S pods, and their IDs (it might take up to 20-30 seconds for the pod to start)
crictl ps Displays currently active containers and their IDs
crictl ps -a Displays all containers, including containers that recently finished their execution
crictl logs <container-id> Examines the logs of a given container
crictl exec -it <container-id> /bin/bash Attaches a shell to a running container
journalctl -u kubelet Examines the Kubelet logs. Useful when a pod/container fails to spawn.
crictl stopp <pod-id> Stops a running K8S pod
crictl stop <container-id> Stops a running container
crictl rmi <image-id> Removes a container image from the local K8S registry

Notice

This document is provided for information purposes only and shall not be regarded as a warranty of a certain functionality, condition, or quality of a product. NVIDIA Corporation nor any of its direct or indirect subsidiaries and affiliates (collectively: “NVIDIA”) make no representations or warranties, expressed or implied, as to the accuracy or completeness of the information contained in this document and assume no responsibility for any errors contained herein. NVIDIA shall have no liability for the consequences or use of such information or for any infringement of patents or other rights of third parties that may result from its use. This document is not a commitment to develop, release, or deliver any Material (defined below), code, or functionality.

NVIDIA reserves the right to make corrections, modifications, enhancements, improvements, and any other changes to this document, at any time without notice.

Customer should obtain the latest relevant information before placing orders and should verify that such information is current and complete.

NVIDIA products are sold subject to the NVIDIA standard terms and conditions of sale supplied at the time of order acknowledgement, unless otherwise agreed in an individual sales agreement signed by authorized representatives of NVIDIA and customer (“Terms of Sale”). NVIDIA hereby expressly objects to applying any customer general terms and conditions with regards to the purchase of the NVIDIA product referenced in this document. No contractual obligations are formed either directly or indirectly by this document.

NVIDIA products are not designed, authorized, or warranted to be suitable for use in medical, military, aircraft, space, or life support equipment, nor in applications where failure or malfunction of the NVIDIA product can reasonably be expected to result in personal injury, death, or property or environmental damage. NVIDIA accepts no liability for inclusion and/or use of NVIDIA products in such equipment or applications and therefore such inclusion and/or use is at customer’s own risk.

NVIDIA makes no representation or warranty that products based on this document will be suitable for any specified use. Testing of all parameters of each product is not necessarily performed by NVIDIA. It is customer’s sole responsibility to evaluate and determine the applicability of any information contained in this document, ensure the product is suitable and fit for the application planned by customer, and perform the necessary testing for the application in order to avoid a default of the application or the product. Weaknesses in customer’s product designs may affect the quality and reliability of the NVIDIA product and may result in additional or different conditions and/or requirements beyond those contained in this document. NVIDIA accepts no liability related to any default, damage, costs, or problem which may be based on or attributable to: (i) the use of the NVIDIA product in any manner that is contrary to this document or (ii) customer product designs.

No license, either expressed or implied, is granted under any NVIDIA patent right, copyright, or other NVIDIA intellectual property right under this document. Information published by NVIDIA regarding third-party products or services does not constitute a license from NVIDIA to use such products or services or a warranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual property rights of the third party, or a license from NVIDIA under the patents or other intellectual property rights of NVIDIA.

Reproduction of information in this document is permissible only if approved in advance by NVIDIA in writing, reproduced without alteration and in full compliance with all applicable export laws and regulations, and accompanied by all associated conditions, limitations, and notices.

THIS DOCUMENT AND ALL NVIDIA DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS, DIAGNOSTICS, LISTS, AND OTHER DOCUMENTS (TOGETHER AND SEPARATELY, “MATERIALS”) ARE BEING PROVIDED “AS IS.” NVIDIA MAKES NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL NVIDIA BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, PUNITIVE, OR CONSEQUENTIAL DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF ANY USE OF THIS DOCUMENT, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Notwithstanding any damages that customer might incur for any reason whatsoever, NVIDIA’s aggregate and cumulative liability towards customer for the products described herein shall be limited in accordance with the Terms of Sale for the product.

Trademarks

NVIDIA, the NVIDIA logo, and Mellanox are trademarks and/or registered trademarks of Mellanox Technologies Ltd. and/or NVIDIA Corporation in the U.S. and in other countries. The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world¬wide basis. Other company and product names may be trademarks of the respective companies with which they are associated.

Copyright

© 2022 NVIDIA Corporation & affiliates. All rights reserved.

© Copyright 2023, NVIDIA. Last updated on May 9, 2022.