devlink-sb - Linux


Overview

devlink-sb is a command-line tool used to interact with the Linux datapath by conducting operations on switchdev devices. It enables network engineers and administrators to configure and manage switchdev devices and their data paths. Whether it’s configuring offloads, manipulating tables or groups, or accessing detailed statistics and diagnostics, devlink-sb provides a versatile way to manage your network infrastructure.

Syntax

devlink-sb [options] <command> [parameters]

Options/Flags

  • -h, –help: Display help and usage information.
  • -v, –version: Print the version of devlink-sb.
  • –debug: Enable debug logging.
  • -a, –all: Perform action on all switchdev devices.
  • -s, –dev : Specify a switchdev device name.

Examples

List all switchdev devices

devlink-sb -a list

Configure offloads for a switchdev device

devlink-sb -s <dev> offload set xmit_hw_checksum on

Add a flow to a bridge port

devlink-sb create flow sb rule add br0 ingress match src_mac 00:11:22:33:44:55

Display detailed statistics for a switchdev device

devlink-sb -s <dev> stats show

Common Issues

Device not found

Ensure that the switchdev device name entered is correct.

Operation not supported

Some operations may not be supported by all switchdev devices. Refer to the documentation for your device for supported operations.

Integration

devlink-sb can be integrated with other tools and scripts for advanced network management tasks. For example, you can use it with tc to configure traffic control rules based on devlink-sb device statistics.

Related Commands

  • ethtool
  • tc
  • ip link