OSDN Git Service

IB/uverbs: Add UVERBS_ATTR_FLAGS_IN to the specs language
authorJason Gunthorpe <jgg@mellanox.com>
Thu, 26 Jul 2018 22:37:14 +0000 (16:37 -0600)
committerJason Gunthorpe <jgg@mellanox.com>
Tue, 31 Jul 2018 02:23:29 +0000 (20:23 -0600)
commitbccd06223f21654eb268e153426a77deb117c1e8
tree301f159e973377bcea836731b484adf5b74a0297
parentd34ac5cd3a73aacd11009c4fc3ba15d7ea62c411
IB/uverbs: Add UVERBS_ATTR_FLAGS_IN to the specs language

This clearly indicates that the input is a bitwise combination of values
in an enum, and identifies which enum contains the definition of the bits.

Special accessors are provided that handle the mandatory validation of the
allowed bits and enforce the correct type for bitwise flags.

If we had introduced this at the start then the kabi would have uniformly
used u64 data to pass flags, however today there is a mixture of u64 and
u32 flags. All places are converted to accept both sizes and the accessor
fixes it. This allows all existing flags to grow to u64 in future without
any hassle.

Finally all flags are, by definition, optional. If flags are not passed
the accessor does not fail, but provides a value of zero.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
drivers/infiniband/core/uverbs_ioctl.c
drivers/infiniband/core/uverbs_std_types_counters.c
drivers/infiniband/core/uverbs_std_types_cq.c
drivers/infiniband/core/uverbs_std_types_mr.c
drivers/infiniband/hw/mlx5/devx.c
drivers/infiniband/hw/mlx5/main.c
include/rdma/uverbs_ioctl.h