[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190415115726.3e1dc865@carbon>
Date: Mon, 15 Apr 2019 11:57:26 +0200
From: Jesper Dangaard Brouer <jbrouer@...hat.com>
To: Toshiaki Makita <makita.toshiaki@....ntt.co.jp>
Cc: Yuya Kusakabe <yuya.kusakabe@...il.com>, davem@...emloft.net,
taketarou2@...il.com, netdev@...r.kernel.org,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Jakub Kicinski <jakub.kicinski@...ronome.com>,
Jesper Dangaard Brouer <hawk@...nel.org>,
John Fastabend <john.fastabend@...il.com>
Subject: Re: [PATCH] net: Fix missing meta data in skb with vlan packet
On Mon, 15 Apr 2019 15:05:36 +0900
Toshiaki Makita <makita.toshiaki@....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.
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);
> > + };
> > +
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer
Powered by blists - more mailing lists