netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Daniel Borkmann <daniel@iogearbox.net>, netdev@vger.kernel.org
Cc: Alexei Starovoitov <ast@kernel.org>
Subject: Re: [PATCH] bpf: use 'ctx' instead of 'skb' in debug message
Date: Tue, 04 Apr 2017 19:30:10 +0200	[thread overview]
Message-ID: <1491327010.26929.2.camel@sipsolutions.net> (raw)
In-Reply-To: <58E3D73B.5050806@iogearbox.net>

On Tue, 2017-04-04 at 19:26 +0200, Daniel Borkmann wrote:

> >   	if (regs[BPF_REG_6].type != PTR_TO_CTX) {
> > -		verbose("at the time of BPF_LD_ABS|IND R6 !=
> > pointer to skb\n");
> > +		verbose("at the time of BPF_LD_ABS|IND R6 !=
> > pointer to ctx\n");
> >   		return -EINVAL;
> 
> Seems okay, the reason why we had 'skb' in the verbose message here
> is due to BPF_LD + BPF_ABS/BPF_IND operations being only specific to
> skbs and no other context (see __bpf_prog_run(), and in verifier
> may_access_skb() check before that verbose() message in
> check_ld_abs()). Reason for this is mostly historical due to the cBPF
> to eBPF migration so that these loads don't get slowed down when
> migrated to eBPF and can be handled by JIT optimizations (e.g.,
> caching skb->data), too. Anyway, just to provide some more background
> on this. I've no strong opinion if you want to change the verifier
> error message, so:

Ah. I really have no opinion on this either - it just seemed somewhat
inconsistent. I clearly neglected to read the comment in front of the
function though, that explains that we must have ctx == skb. I think
therefore it's probably better to drop this - thanks for the
explanation!

johannes

      reply	other threads:[~2017-04-04 17:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-04 14:46 [PATCH] bpf: use 'ctx' instead of 'skb' in debug message Johannes Berg
2017-04-04 17:26 ` Daniel Borkmann
2017-04-04 17:30   ` Johannes Berg [this message]

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=1491327010.26929.2.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).