mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: ast@plumgrid.com
Cc: mingo@kernel.org, torvalds@linux-foundation.org,
	luto@amacapital.net, dborkman@redhat.com,
	hannes@stressinduktion.org, chema@google.com,
	edumazet@google.com, a.p.zijlstra@chello.nl, pablo@netfilter.org,
	hpa@zytor.com, akpm@linux-foundation.org, keescook@chromium.org,
	linux-api@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v12 net-next 03/11] bpf: add lookup/update/delete/iterate methods to BPF maps
Date: Tue, 16 Sep 2014 16:54:52 -0400 (EDT)	[thread overview]
Message-ID: <20140916.165452.1747695341192703967.davem@davemloft.net> (raw)
In-Reply-To: <CAMEtUuxp6709mdygiQyCqwjv-0kF-CbNOzCCZmKw_mUckF4NZA@mail.gmail.com>

From: Alexei Starovoitov <ast@plumgrid.com>
Date: Tue, 16 Sep 2014 13:44:12 -0700

> the union indeed changes alignment from patch #1 to #3,
> but, imo, it is not a problem, since kernel does:

It changes the alignment of the datastructures in userspace.

> I haven't thought of 'aligned_u64' for this case.
> For counters and masks it would be perfect, but here user is
> passing real pointers to key and value, so they have to
> be 'void __user *', otherwise user would need to type cast
> them, which I want to avoid.

The cost of the compat layer must be considered and weighted
against this cast, which I think is really no big deal.

> I think compat layer is a better option.

It's overhead you'll have to support forever, I think you should
reconsider.

All of the "ugly casting" will be hidden, or can be hidden, in the
syscall wrappers and/or interfaces in userspace.

  reply	other threads:[~2014-09-16 20:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-15 19:18 [PATCH v12 net-next 00/11] eBPF syscall, verifier, testsuite Alexei Starovoitov
2014-09-15 19:18 ` [PATCH v12 net-next 01/11] bpf: introduce BPF syscall and maps Alexei Starovoitov
2014-09-15 19:18 ` [PATCH v12 net-next 02/11] bpf: enable bpf syscall on x64 and i386 Alexei Starovoitov
2014-09-15 19:18 ` [PATCH v12 net-next 03/11] bpf: add lookup/update/delete/iterate methods to BPF maps Alexei Starovoitov
2014-09-16 19:16   ` David Miller
2014-09-16 20:44     ` Alexei Starovoitov
2014-09-16 20:54       ` David Miller [this message]
2014-09-16 21:23         ` Alexei Starovoitov
2014-09-16 21:49           ` David Miller
2014-09-16 22:06             ` Alexei Starovoitov
2014-09-15 19:18 ` [PATCH v12 net-next 04/11] bpf: expand BPF syscall with program load/unload Alexei Starovoitov
2014-09-16 19:17   ` David Miller
2014-09-15 19:18 ` [PATCH v12 net-next 05/11] bpf: handle pseudo BPF_CALL insn Alexei Starovoitov
2014-09-15 19:18 ` [PATCH v12 net-next 06/11] bpf: verifier (add docs) Alexei Starovoitov
2014-09-15 19:18 ` [PATCH v12 net-next 07/11] bpf: verifier (add ability to receive verification log) Alexei Starovoitov
2014-09-15 19:18 ` [PATCH v12 net-next 08/11] bpf: handle pseudo BPF_LD_IMM64 insn Alexei Starovoitov
2014-09-15 19:18 ` [PATCH v12 net-next 09/11] bpf: verifier (add branch/goto checks) Alexei Starovoitov
2014-09-15 19:18 ` [PATCH v12 net-next 10/11] bpf: verifier (add verifier core) Alexei Starovoitov
2014-09-15 19:18 ` [PATCH v12 net-next 11/11] bpf: mini eBPF library, test stubs and verifier testsuite Alexei Starovoitov

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=20140916.165452.1747695341192703967.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=ast@plumgrid.com \
    --cc=chema@google.com \
    --cc=dborkman@redhat.com \
    --cc=edumazet@google.com \
    --cc=hannes@stressinduktion.org \
    --cc=hpa@zytor.com \
    --cc=keescook@chromium.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mingo@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=torvalds@linux-foundation.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

all inboxes | Powered by JetHome®