Skip to content

xdp-forward: VLAN support in flowtable mode #488

@sbraz

Description

@sbraz

Hi,
I am attempting to use xdp-forward's flowtable mode to improve performance with a 4-port router (2 ports use the igc driver and 2 ports use atlantic).
My setup is the following:

  • the lan interface is a bridge containing 3 physical interfaces: lan0, lan1 and lan2.
  • the wan interface is a VLAN subinterface of the physical wan0 interface (that's a requirement from my ISP).

My setup is that of a simple customer router. Forwarding happens between the lan and wan interfaces.
To attempt to improve performance, I have the following nftables configuration:

table inet filter {
    flowtable f {
        hook ingress priority filter
        devices = { lan0, lan1, lan2, wan0 }
    }
    chain forward {
        type filter hook forward priority filter; policy accept;
        meta l4proto { tcp, udp } ct state established,related flow add @f comment "offload established connections"
    }
}

I assume the flowtable works as expected because the rx and tx counters for wan and lan do not seem to follow that of the physical interfaces, and connections are marked with [OFFLOAD] in /proc/net/nf_conntrack.

Now, after setting up the flowtable, I can successfully execute xdp-forward load -f flowtable lan0 lan1 lan2 wan0. I am doing this with kernel 6.12.12-amd64 (Debian Trixie) and xdp-tools 1.5.2.

However, when I check e.g. ethtool -S lan0 or ethtool -S wan0 (both interfaces use the atlantic driver), I see something like this, the redirect counter always stays at 0, only the pass one increases:

     Queue[0] InPackets: 658016
     Queue[0] XdpPass: 18229
     Queue[0] XdpRedirect: 0
     Queue[0] OutPackets: 5028

My understanding is that the XDP program never redirects packets to another interface and I suspect that this happens because forwarding is supposed to occur between a physical interface ( lan0, lan1 or lan2, all part of the lan bridge) and wan, the VLAN interface using the physical interface wan0.

Is there any way to make xdp-forward work in my situation? My tests show that simply adding the Netfilter flowtable doesn't really improve performance (100% CPU usage on one core and lots of dropped packets on wan0 with a single TCP connection at high bit rates) and I was hoping that XDP would help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions