public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions•net>
To: Alexei Starovoitov <alexei.starovoitov@gmail•com>
Cc: Daniel Borkmann <daniel@iogearbox•net>,
	"netdev@vger•kernel.org" <netdev@vger•kernel.org>,
	Alexei Starovoitov <ast@kernel•org>
Subject: Re: eBPF - little-endian load instructions?
Date: Sat, 15 Apr 2017 09:06:11 +0200	[thread overview]
Message-ID: <1492239971.4735.5.camel@sipsolutions.net> (raw)
In-Reply-To: <20170414184228.GA41922@ast-mbp.thefacebook.com> (sfid-20170414_204234_987955_362A9588)

On Fri, 2017-04-14 at 11:42 -0700, Alexei Starovoitov wrote:

> bpf takes endianness of the cpu it runs on.

Ok, so then things are actually not as difficult as I thought.

> if we said that bpf 32-bit load insn is little endian, it would have
> screwed up all big-endian archs and the other way around.

Right.

But then basically we do only need to have builtins for endian
conversion, and #define them appropriately, as done anywhere else.

Perhaps we want to eventually be able to take advantage of "other-
endian" loads the CPU may have through the JIT, but getting it correct
first would be good :)

Either way though, it could be done with something like inline
assembly.

johannes

      reply	other threads:[~2017-04-15  7:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-11 10:38 eBPF - little-endian load instructions? Johannes Berg
2017-04-11 11:06 ` Daniel Borkmann
2017-04-11 11:15   ` Johannes Berg
2017-04-11 11:22     ` Daniel Borkmann
2017-04-11 11:26       ` Johannes Berg
2017-04-12 13:02   ` Johannes Berg
2017-04-12 16:58     ` Alexei Starovoitov
2017-04-12 19:38       ` Johannes Berg
2017-04-13  3:08         ` Alexei Starovoitov
2017-04-13  5:58           ` Johannes Berg
2017-04-14 18:42             ` Alexei Starovoitov
2017-04-15  7:06               ` 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=1492239971.4735.5.camel@sipsolutions.net \
    --to=johannes@sipsolutions$(echo .)net \
    --cc=alexei.starovoitov@gmail$(echo .)com \
    --cc=ast@kernel$(echo .)org \
    --cc=daniel@iogearbox$(echo .)net \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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