netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Why return E2BIG from bpf map update?
@ 2015-07-20 22:15 Alex Gartrell
  2015-07-20 22:24 ` Alexei Starovoitov
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Gartrell @ 2015-07-20 22:15 UTC (permalink / raw)
  To: ast, daniel; +Cc: netdev

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>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-07-21 21:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-20 22:15 Why return E2BIG from bpf map update? Alex Gartrell
2015-07-20 22:24 ` Alexei Starovoitov
2015-07-21  9:40   ` Daniel Borkmann
2015-07-21 10:13     ` Alex Gartrell
2015-07-21 21:34       ` Alexei Starovoitov

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).