Bridge Offload

1.0
Note

Bridge offload is supported switchdev mode only.

Note

Bridge offload is supported from kernel version 5.15 onward.

A Linux bridge is an in-kernel software network switch (based on and implementing a subset of IEEE 802.1D standard) used to connect Ethernet segments together in a protocol-independent manner. Packets are forwarded based on L2 Ethernet header addresses.

mlx5 provides the ability to offload bridge dataplane unicast packet forwarding and VLAN management to hardware.

  1. Initialize the ASAP2 environment:

    1. Create the VFs.

    2. Enter switchdev mode.

  2. Create a bridge and add mlx5 representors to bridge:

    Copy
    Copied!
                

    ip link add name bridge0 type bridge ip link set enp8s0f0_0 master bridge0

  1. Enable VLAN filtering on the bridge:

    Copy
    Copied!
                

    ip link set bridge0 type bridge vlan_filtering 1

  2. Configure port VLAN matching (trunk mode). In this configuration, only packets with specified VID are allowed.

    Copy
    Copied!
                

    bridge vlan add dev enp8s0f0_0 vid 2

  3. Configure port VLAN tagging (access mode). In this configuration, VLAN header is pushed/popped upon reception/transmission on port.

    Copy
    Copied!
                

    bridge vlan add dev enp8s0f0_0 vid 2 pvid untagged

Bridge supports offloading on bond net device that is fully initialized with mlx5 uplink representors and is in single (shared) FDB LAG mode. Details about initialization of LAG are provided in section "SR-IOV VF LAG".

To add a bonding net device to bridge:

Copy
Copied!
            

ip link set bond0 master bridge0

For further information on interacting with Linux bridge via iproute2 bridge tool, refer to man 8 bridge.

© Copyright 2024, NVIDIA. Last updated on Feb 9, 2024.