On 2019/04/15 18:57, Jesper Dangaard Brouer wrote: > On Mon, 15 Apr 2019 15:05:36 +0900 > Toshiaki Makita <makita.toshi...@lab.ntt.co.jp> wrote: > >>> diff --git a/net/core/skbuff.c b/net/core/skbuff.c >>> index ef2cd5712098..6bc663249c4c 100644 >>> --- a/net/core/skbuff.c >>> +++ b/net/core/skbuff.c > [...] >>> @@ -5095,6 +5096,13 @@ static struct sk_buff >>> *skb_reorder_vlan_header(struct sk_buff *skb) >>> memmove(skb_mac_header(skb) + VLAN_HLEN, >>> skb_mac_header(skb), >>> mac_len - VLAN_HLEN - ETH_TLEN); >>> } >>> + >>> + meta_len = skb_metadata_len(skb); >>> + if (meta_len) { >> >> Since this is not used by non-XDP skb and skb path is slow-path for XDP >> anyway, should add unlikely here in favor of non-XDP case? > > I want to stress, that XDP is meant to cooperate with network stack. > The XDP metadata is meant as a communication channel between XDP and > network-stack SKBs. > > Thus, there are use-cases where this is not considered a slow-path.
Ah, that's true. Definitely there are cases where skb-path performance is also important with XDP enabled. Sorry about the confusion. > That said I don't care if this is marked unlikely(), as not many people > are using this metadata communication channel yet. > > In one customer use-case I have seen, they wanted to pop VLAN tags > (Q-in-Q) at XDP layer, but keep some of the info in metadata for TC-bpf > hook. I don't think they kept/left any VLAN headers in the SKB. > > >>> + meta = skb_metadata_end(skb) - meta_len; >>> + memmove(meta + VLAN_HLEN, meta, meta_len); >>> + }; >>> + -- Toshiaki Makita