Netdev List
 help / color / mirror / Atom feed
From: Jesper Dangaard Brouer <jbrouer@redhat.com>
To: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Cc: Yuya Kusakabe <yuya.kusakabe@gmail.com>,
	davem@davemloft.net, taketarou2@gmail.com,
	netdev@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Jakub Kicinski <jakub.kicinski@netronome.com>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>
Subject: Re: [PATCH] net: Fix missing meta data in skb with vlan packet
Date: Mon, 15 Apr 2019 11:57:26 +0200	[thread overview]
Message-ID: <20190415115726.3e1dc865@carbon> (raw)
In-Reply-To: <e8957171-4f74-5623-4e8a-19179bbd977f@lab.ntt.co.jp>

On Mon, 15 Apr 2019 15:05:36 +0900
Toshiaki Makita <makita.toshiaki@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.
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

  parent reply	other threads:[~2019-04-15  9:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-13 12:16 [PATCH] net: Fix missing meta data in skb with vlan packet Yuya Kusakabe
2019-04-15  6:05 ` Toshiaki Makita
2019-04-15  8:06   ` Yuya Kusakabe
2019-04-15  9:48     ` Toshiaki Makita
2019-04-15 14:21       ` [PATCH v2] " Yuya Kusakabe
2019-04-16  0:45         ` Toshiaki Makita
2019-04-16  1:17           ` Yuya Kusakabe
2019-04-16  1:22             ` [PATCH v3] " Yuya Kusakabe
2019-04-16  4:14               ` Toshiaki Makita
2019-04-17  4:30               ` David Miller
     [not found]   ` <CAGCJULPCzSc4E8vmQQkYqdQeLVXTv-Gpi-v0f+AF89bHH7GXDA@mail.gmail.com>
2019-04-15  8:07     ` [PATCH] " Toshiaki Makita
2019-04-15  8:28       ` Yuya Kusakabe
2019-04-15  9:57   ` Jesper Dangaard Brouer [this message]
2019-04-15 10:13     ` Toshiaki Makita

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190415115726.3e1dc865@carbon \
    --to=jbrouer@redhat.com \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=hawk@kernel.org \
    --cc=jakub.kicinski@netronome.com \
    --cc=john.fastabend@gmail.com \
    --cc=makita.toshiaki@lab.ntt.co.jp \
    --cc=netdev@vger.kernel.org \
    --cc=taketarou2@gmail.com \
    --cc=yuya.kusakabe@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox