netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] genetlink improvements
@ 2016-10-24 12:40 Johannes Berg
  2016-10-24 12:40 ` [PATCH 1/5] genetlink: introduce and use genl_family_attrbuf() Johannes Berg
                   ` (6 more replies)
  0 siblings, 7 replies; 18+ messages in thread
From: Johannes Berg @ 2016-10-24 12:40 UTC (permalink / raw)
  To: netdev

This series contains some generic netlink improvements, making
the API safer to use, and making the function pointers in the
family struct safer by allowing it to be __ro_after_init.

The first patch, introducing genl_family_attrbuf(), just ensures
that the users of family->attrbuf aren't actually racy, but making
them use the indirection function for obtaining a reference and
checking that the context can actually do so.

The second patch removes the more or less broken ability to have
a static family ID, the three IDs that need to be static because
it's simply needed (genl controller), or due to old API misused.
Everything else couldn't be static anyway, or could fail when the
family is registered, if somebody else already got a static ID.

The third patch statically initializes the families, mostly to save
some code. I wrote this initially because I thought I could make
them all const, but that ends up being very inefficient (it would
require always doing some kind of family -> id lookup), so now it's
just here because I had it already and it reduces the code size.

The fourth patch then, finally, lays the groundwork for what I had
really wanted - now with __ro_after_init instead of const; I remove
code there to do the ID->family hash table mapping in genetlink and
use IDR instead to both allocate and map the IDs, which again ends
up saving some code size.

Finally, the fifth patch updates all families, as it turns out, no
families exist that really dynamically register/unregister. This
last patch should perhaps be split up, I could submit it for each
subsystem separately, but it'd depend on the second and third to
go in first, so would take a while. I can do that though, if that
seems better to you.

johannes

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

end of thread, other threads:[~2016-11-03 20:49 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-24 12:40 [PATCH 0/5] genetlink improvements Johannes Berg
2016-10-24 12:40 ` [PATCH 1/5] genetlink: introduce and use genl_family_attrbuf() Johannes Berg
2016-10-24 12:40 ` [PATCH 2/5] genetlink: no longer support using static family IDs Johannes Berg
2016-10-24 12:40 ` [PATCH 3/5] genetlink: statically initialize families Johannes Berg
2016-10-24 12:55   ` Johannes Berg
2016-10-25 11:25     ` David Laight
2016-10-25 11:38       ` Johannes Berg
2016-10-24 12:40 ` [PATCH 4/5] genetlink: use idr to track families Johannes Berg
2016-10-24 12:40 ` [PATCH 5/5] genetlink: mark families as __ro_after_init Johannes Berg
2016-10-27 20:16 ` [PATCH 0/5] genetlink improvements David Miller
2016-11-01 17:28 ` new kmemleak reports (was: Re: [PATCH 0/5] genetlink improvements) Jakub Kicinski
2016-11-01 18:32   ` Cong Wang
2016-11-01 18:56     ` Jakub Kicinski
2016-11-02 20:30       ` Cong Wang
2016-11-02 23:47         ` [RFC] make kmemleak scan __ro_after_init section " Jakub Kicinski
2016-11-03  5:40           ` Cong Wang
2016-11-03 15:48           ` Johannes Berg
2016-11-03 20:49           ` Catalin Marinas

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