[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20140916.165452.1747695341192703967.davem@davemloft.net>
Date: Tue, 16 Sep 2014 16:54:52 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: ast@...mgrid.com
Cc: mingo@...nel.org, torvalds@...ux-foundation.org,
luto@...capital.net, dborkman@...hat.com,
hannes@...essinduktion.org, chema@...gle.com, edumazet@...gle.com,
a.p.zijlstra@...llo.nl, pablo@...filter.org, hpa@...or.com,
akpm@...ux-foundation.org, keescook@...omium.org,
linux-api@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v12 net-next 03/11] bpf: add
lookup/update/delete/iterate methods to BPF maps
From: Alexei Starovoitov <ast@...mgrid.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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists