Re: XDP_REDIRECT not working in XDP_DRV_MODE with Intel xgbe driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Sophia Yoo <sy6@xxxxxxxxxxxxx> writes:

> Hello,
> I am relatively new to BPF/XDP, and I’m currently trying to use a TC
> egress program to redirect a packet back to ingress, where I have an
> XDP program attached. When the XDP program is attached in generic mode
> (XDP_SKB_MODE), the redirect occurs properly and the packet is seen on
> the ingress of the interface, but when the program is attached in
> native mode (XDP_DRV_MODE), the packet never redirects and is just
> seen exiting the interface, even though the return code of the
> redirect function is “success”.

The difference between XDP generic and driver mode is that the generic
mode is hooked into the core networking stack whereas driver mode runs
in the driver as the very first thing after packets are physically
received from the network.

This also explains why what you're trying to do doesn't work: the TC
hook runs in the core networking stack, and when it does a redirect, the
packet does not actually pass through the network driver, it appears
further up in the stack, where only the generic XDP hook will see it.

So this has nothing to do with the support in the driver; XDP is simply
not suitable for what you're trying to do. Why are you trying to do this
in the first place? I.e., what's the higher-level use case here?


[Index of Archives]     [Linux Networking Development]     [Fedora Linux Users]     [Linux SCTP]     [DCCP]     [Gimp]     [Yosemite Campsites]

  Powered by Linux