Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VLAN support? #7

Open
Nowatel opened this issue Jan 4, 2022 · 6 comments
Open

VLAN support? #7

Nowatel opened this issue Jan 4, 2022 · 6 comments

Comments

@Nowatel
Copy link

Nowatel commented Jan 4, 2022

Hi,

Is there a way to support vlan's via xdp-cpumap-tc? As I understand we can only redirect the traffic to the physical nic like eth0 as they have xps_cpus. Virtual interfaces like eth0.123 don't have multiple xps_cpus that we can use. I didn't see any example involving shaping on the vlan via this method.

@interduo
Copy link

Hi @Nowatel did You find the answer for that?

@Nowatel
Copy link
Author

Nowatel commented Aug 29, 2022

Hi @Nowatel did You find the answer for that?

Unfortunately it's not possible. As referenced in mentioned topic it can only be done via additional libreqos box.

@tohojo
Copy link
Member

tohojo commented Aug 30, 2022

There is already VLAN support. The packet parsing code already handles (i.e., skips) VLAN tags when it encounters them: https://github.com/xdp-project/xdp-cpumap-tc/blob/master/src/xdp_iphash_to_cpu_kern.c#L99-L120

If you just run the XDP program on the physical NIC (i.e., not the virtual VLAN interface), you'll get the packets redirected to the right CPU based on the inner IP header, and the network stack will take over on that CPU afterwards, handling the VLAN tagging and routing the packets to the stacked VLAN interface.

So it should be quite possible to use this as-is even in a VLAN setup...

@netoptimizer
Copy link
Member

There is already VLAN support.

Yes, even double-tagged VLAN support (which is run in production at @danielnielsennumber1 ).

As @thebracket noticed in LibreQoE/LibreQoS#26 the catch is that you need to disable hardware VLAN offloading on the NIC.
This is needed for XDP, as XDP need to vlan headers inline in the packet (in the future with XDP-hints this will be resolved).

Use commands:

 ethtool -K (interface-out) rxvlan off
 ethtool -K (interface-in) rxvlan off

The setup script bin/set_irq_affinity_with_rss_conf.sh also disable hardware offloaded VLAN.

@interduo
Copy link

interduo commented Oct 10, 2022

@netoptimizer So using the same card with two VLANs as inbound and outbound interface is possible? (case described here: LibreQoE/LibreQoS#48)

@thebracket
Copy link
Contributor

thebracket commented Oct 10, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants