bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Björn Töpel" <bjorn.topel@gmail.com>
To: "Toke Høiland-Jørgensen" <toke@redhat.com>
Cc: Netdev <netdev@vger.kernel.org>,
	"Alexei Starovoitov" <ast@kernel.org>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	"Björn Töpel" <bjorn.topel@intel.com>, bpf <bpf@vger.kernel.org>,
	"Magnus Karlsson" <magnus.karlsson@gmail.com>,
	"Karlsson, Magnus" <magnus.karlsson@intel.com>,
	"Samudrala, Sridhar" <sridhar.samudrala@intel.com>,
	"Jiong Wang" <jiong.wang@netronome.com>
Subject: Re: [PATCH bpf-next v2] libbpf: use implicit XSKMAP lookup from AF_XDP XDP program
Date: Mon, 21 Oct 2019 16:35:06 +0200	[thread overview]
Message-ID: <CAJ+HfNjd+eMAmeBnZ8iANjcea9ZT2cnvm3axuRwvUEMDpa5zHw@mail.gmail.com> (raw)
In-Reply-To: <CAJ+HfNgWeY7oLwun2Lt4nbT-Mh2yETZfHOGcYhvD=A+-UxWVOw@mail.gmail.com>

On Mon, 21 Oct 2019 at 15:37, Björn Töpel <bjorn.topel@gmail.com> wrote:
>
> On Mon, 21 Oct 2019 at 14:19, Toke Høiland-Jørgensen <toke@redhat.com> wrote:
> >
> > Björn Töpel <bjorn.topel@gmail.com> writes:
> >
> [...]
> > >
> > > bpf_redirect_map() returns a 32-bit signed int, so the upper 32-bit
> > > will need to be cleared. Having an explicit AND is one instruction
> > > less than two shifts. So, it's an optimization (every instruction is
> > > sacred).
> >
> > OIC. Well, a comment explaining that might be nice (since you're doing
> > per-instruction comments anyway)? :)
> >
>
> Sure, I can do a v3 with a comment, unless someone has a better idea
> avoiding both shifts and AND.
>
> Thanks for taking a look!
>

Now wait, there are the JMP32 instructions that Jiong added. So,
shifts/AND can be avoided. Now, regarding backward compat... JMP32 is
pretty new. I need to think a bit how to approach this. I mean, I'd
like to be able to use new BPF instructions.


Björn

>
> Björn
>
>
> > -Toke
> >

  reply	other threads:[~2019-10-21 14:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-21 10:59 [PATCH bpf-next v2] libbpf: use implicit XSKMAP lookup from AF_XDP XDP program Björn Töpel
2019-10-21 11:50 ` Toke Høiland-Jørgensen
2019-10-21 12:02   ` Björn Töpel
2019-10-21 12:19     ` Toke Høiland-Jørgensen
2019-10-21 13:37       ` Björn Töpel
2019-10-21 14:35         ` Björn Töpel [this message]
2019-10-21 15:43           ` Toke Høiland-Jørgensen
2019-10-22  7:16             ` Björn Töpel

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=CAJ+HfNjd+eMAmeBnZ8iANjcea9ZT2cnvm3axuRwvUEMDpa5zHw@mail.gmail.com \
    --to=bjorn.topel@gmail.com \
    --cc=ast@kernel.org \
    --cc=bjorn.topel@intel.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=jiong.wang@netronome.com \
    --cc=magnus.karlsson@gmail.com \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=sridhar.samudrala@intel.com \
    --cc=toke@redhat.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;
as well as URLs for NNTP newsgroup(s).