[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3d46b922-472d-abe2-5808-6c01895cb0a5@lab.ntt.co.jp>
Date: Mon, 15 Apr 2019 19:13:07 +0900
From: Toshiaki Makita <makita.toshiaki@....ntt.co.jp>
To: Jesper Dangaard Brouer <jbrouer@...hat.com>
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 2019/04/15 18:57, Jesper Dangaard Brouer wrote:
> 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.
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
Powered by blists - more mailing lists