Jump to contentJump to page navigation: previous page [access key p]/next page [access key n]
documentation.suse.com / The Physical Function Baseband Device Configuration Using pf_bb_config

The Physical Function Baseband Device Configuration Using pf_bb_config

Publication Date: 05 Dec 2024
WHAT?

The pf_bb_config tool utilizes given configuration files to customize and control the physical functions of various baseband devices.

WHY?

This article focuses on installation and usage of the pf_bb_config tool.

EFFORT

It takes approximately 10 minutes to read the article.

GOAL

You will know how to configure broadband devices and how to enable direct access to hardware for virtual machines.

REQUIREMENTS

A registered running instance of SUSE Linux Micro

1 What is pf_bb_config?

pf_bb_config is a tool that enables you to configure broadband devices on your host system. The tool accesses the configuration space and sets parameters using memory-mapped I/O (MMIO) read and write operations.

The particular broadband device configuration parameters are parsed from a passed configuration file specific to that device.

2 Installing the pf_bb_config tool

The physical function broadband devices configuration tool is not delivered as part of the pre-built images. To use it, you need to install it first:

  1. Refresh repositories:

    > sudo zypper ref
  2. Install the pf-bb-config package:

    > sudo transactional-update pkg install pf-bb-config
  3. In certain cases, you may need to use the Data Plane Development Kit. To install it, run:

    > sudo transactional-update --continue pkg install dpdk
  4. Reboot the system:

    > sudo reboot

3 Usage of pf_bb_config

To run the pf_bb_config tool, use the following command:

# pf_bb_config DEVICE_NAME [-h] [-c PATH_TO_CONFIG_FILE] [-p PCI_ID] [-v VFIO_TOKEN] [-f FFT_LUT_FILE]

Where the arguments and options have the following meaning:

DEVICE_NAME

The device name is mandatory.

-h

To print out help.

-c PATH_TO_CONFIG_FILE

Passes the configuration file to use for the particular BB device. Configuration examples are installed to /opt/pf-bb-config/. For details regarding these examples, refer to Section 3.2, “Configuration examples description”.

-p PCI_ID

Specify the PCI ID of the device to be configured.

-v VFIO_TOKEN

Provide a VFIO token that can be obtained using the uuid command:

# uuid=$(cat /proc/sys/kernel/random/uuid)

Then, to display it:

# echo $uuid
-f FFT_LUT_FILE

Using the option, you can provide an alternative FFT LUT file. If not specified, the default one is used.

3.1 Using the vfio-pci module

To enable your device's direct access to hardware resources, you need to use the vfio-pci driver. Before proceeding further, ensure that the following conditions are met:

  • The vfio-pci module is built in.

  • Intel™ VT-d is enabled in kernel and UEFI and implemented in IOMMU.

  • IOMMU is enabled on runtime. To check that, run the command:

    > sudo dmesg | grep "DMAR: IOMMU"
  • DPDK is installed.

If the above conditions are met, you can enable the vfio-pci driver as described below.

  1. The vfio-pci module is loaded automatically during boot. You just need to pass parameters to the module. You can do that in three ways:

    • pass the following parameters on the kernel CLI:

      vfio_pci.enable_sriov=1 vfio_pci.disable_idle_d3=1
    • set the required parameters after the system is fully booted:

      # echo 1 | sudo tee /sys/module/vfio_pci/parameters/enable_sriov
      
      # echo 1 | sudo tee /sys/module/vfio_pci/parameters/disable_idle_d3
    • or you can use modprobe to load the module with these parameters:

      # modprobe vfio-pci enable_sriov=1 disable_idle_d3=1
  2. Bind the PF with the vfio-pci module:

    > sudo PATH_TO_DPDK/usertools/dpdk-devbind.py --bind=vfio-pci $PCI_DRIVER_ADDRESS
  3. Configure the device using the pf_bb_config tool:

    > sudo ./pf_bb_config ACC100 -v 00112233-4455-6677-8899-aabbccddeeff -c acc100/acc100_config_2vf_4g5g.cfg
    
  4. For example, create two VFs on the device:

    > sudo echo 2 | sudo tee /sys/bus/pci/devices/0000:$PF_PCI_DEVICE_ADDRESS/sriov_numvfs

3.2 Configuration examples description

You can find the broadband devices confiration examples in /opt/pf-bb-config. Each device has a specific set of configuration files, however, all configuration files follow the same format.

[section name]
key = value
; This is a comment.

The following section provides details regarding ACC100/ACC200 accelerator.

3.2.1 The ACC100/ACC200 configuration

In the examples /opt/pf-bb-config/acc*, you can adjust the following attributes:

pf_mode_en

If set to 1, all queues on the device are assigned to physical functions (PF) and none are assigned to virtual functions (VF). PF and VF are mutually exclusive.

num_qgroups

There are eight queue groups available that you can allocate to all operations.

num_vf_bundles

Choose a value between 1 and 16. The available DDR is then split.

num_aqs_per_groups

Defines the maximum count of atomic queues in a single queue group.