netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Gartrell <alexgartrell@gmail.com>
To: ast@plumgrid.com, daniel@iogearbox.net
Cc: netdev <netdev@vger.kernel.org>
Subject: Why return E2BIG from bpf map update?
Date: Mon, 20 Jul 2015 15:15:50 -0700	[thread overview]
Message-ID: <CALCkm3eCUYFOon6Gza4A8Ske8MS1rVFJJip_J9dWQp79ju8zBw@mail.gmail.com> (raw)

The ship has probably sailed on this one, but it seems like ENOSPC
makes more sense than E2BIG.  Any chance of changing it so that poor
ebpf library maintainers in the future don't have to wonder how their
argument list got too big?

net-next/master:kernel/bpf/hashtab.c=static int
htab_map_update_elem(struct bpf_map *map, void *key, void *value,
--
net-next/master:kernel/bpf/hashtab.c-
net-next/master:kernel/bpf/hashtab.c-   if (!l_old &&
unlikely(htab->count >= map->max_entries)) {
net-next/master:kernel/bpf/hashtab.c-           /* if elem with this
'key' doesn't exist and we've reached
net-next/master:kernel/bpf/hashtab.c-            * max_entries limit,
fail insertion of new elem
net-next/master:kernel/bpf/hashtab.c-            */
net-next/master:kernel/bpf/hashtab.c:           ret = -E2BIG;
net-next/master:kernel/bpf/hashtab.c-           goto err;
net-next/master:kernel/bpf/hashtab.c-   }
net-next/master:kernel/bpf/hashtab.c-
net-next/master:kernel/bpf/hashtab.c-   if (l_old && map_flags == BPF_NOEXIST) {
net-next/master:kernel/bpf/hashtab.c-           /* elem already exists */

-- 
Alex Gartrell <agartrell@fb.com>

             reply	other threads:[~2015-07-20 22:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-20 22:15 Alex Gartrell [this message]
2015-07-20 22:24 ` Why return E2BIG from bpf map update? Alexei Starovoitov
2015-07-21  9:40   ` Daniel Borkmann
2015-07-21 10:13     ` Alex Gartrell
2015-07-21 21:34       ` 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=CALCkm3eCUYFOon6Gza4A8Ske8MS1rVFJJip_J9dWQp79ju8zBw@mail.gmail.com \
    --to=alexgartrell@gmail.com \
    --cc=ast@plumgrid.com \
    --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).