On 8/20/20, David Miller <davem@xxxxxxxxxxxxx> wrote: > From: "Jason A. Donenfeld" <Jason@xxxxxxxxx> > Date: Thu, 20 Aug 2020 11:13:49 +0200 > >> It seems like if an eBPF program pushes on a VLAN tag or changes the >> protocol or does any other modification, it will be treated in exactly >> the same way as the L2 packet above by the remaining parts of the >> networking stack. > > What will update the skb metadata if the XDP program changes the > wireguard header(s)? > XDP runs after decryption/decapsulation, in the netif_rx path, which means there is no wireguard header at that point. All the wireguard crypto/udp/header stuff is all inside the driver itself, and the rest of the stack just deals in terms of plain vanilla L3 ipv4/ipv6 packets. The skb->protocol metadata is handled by the fake ethernet header. Is there other metadata I should keep in mind? WireGuard doesn't play with skb_metadata_*, for example. (Though it may implicitly reach a skb_metadata_clear via pskb_expand path.)