]> asedeno.scripts.mit.edu Git - linux.git/commit
IB/uverbs: Use uverbs_api to unmarshal ioctl commands
authorJason Gunthorpe <jgg@mellanox.com>
Fri, 10 Aug 2018 02:14:42 +0000 (20:14 -0600)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 13 Aug 2018 15:17:16 +0000 (09:17 -0600)
commit3a863577a7496278892360a69d90d8465733100c
treeb2db539aebd48c5d6fe2d994e8f5abe0c10cdccc
parentb61815e241652096b61f59ca2063edecb23602a2
IB/uverbs: Use uverbs_api to unmarshal ioctl commands

Convert the ioctl method syscall path to use the uverbs_api data
structures. The new uapi structure includes all the same information, just
in a different and more optimal way.

 - Use attr_bkey instead of 2 level radix trees for everything related to
   attributes. This includes the attribute storage, presence, and
   detection of missing mandatory attributes.
 - Avoid iterating over all attribute storage at finish, instead use
   find_first_bit with the attr_bkey to locate only those attrs that need
   cleanup.
 - Organize things to always run, and always rely on, cleanup. This
   avoids a bunch of tricky error unwind cases.
 - Locate the method using the radix tree, and locate the attributes
   using a very efficient incremental radix tree lookup
 - Use the precomputed destroy_bkey to handle uobject destruction
 - Use the precomputed allocation sizes and precomputed 'need_stack'
   to avoid maths in the fast path. This is optimal if userspace
   does not pass (many) unsupported attributes.

Overall this results in much better codegen for the attribute accessors,
everything is now stored in bitmaps or linear arrays indexed by attr_bkey.
The compiler can compute attr_bkey values at compile time for all method
attributes, meaning things like uverbs_attr_is_valid() now compile into
single instruction bit tests.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/rdma_core.h
drivers/infiniband/core/uverbs_ioctl.c
drivers/infiniband/core/uverbs_uapi.c
include/rdma/uverbs_ioctl.h