OSDN Git Service

RDMA: Fix storage of PortInfo CapabilityMask in the kernel
authorJason Gunthorpe <jgg@mellanox.com>
Wed, 4 Jul 2018 12:57:48 +0000 (15:57 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Tue, 10 Jul 2018 17:06:45 +0000 (11:06 -0600)
commit2f944c0fbf58b1f390e5e61affd98ba0061214c6
tree60d5ada14869030e9e0d57ac2ad5050d3fa5b8a0
parent3fda24324582ae790961137ecb88b3f0f2feb1f0
RDMA: Fix storage of PortInfo CapabilityMask in the kernel

The internal flag IP_BASED_GIDS was added to a field that was being used
to hold the port Info CapabilityMask without considering the effects this
will have. Since most drivers just use the value from the HW MAD it means
IP_BASED_GIDS will also become set on any HW that sets the IBA flag
IsOtherLocalChangesNoticeSupported - which is not intended.

Fix this by keeping port_cap_flags only for the IBA CapabilityMask value
and store unrelated flags externally. Move the bit definitions for this to
ib_mad.h to make it clear what is happening.

To keep the uAPI unchanged define a new set of flags in the uapi header
that are only used by ib_uverbs_query_port_resp.port_cap_flags which match
the current flags supported in rdma-core, and the values exposed by the
current kernel.

Fixes: b4a26a27287a ("IB: Report using RoCE IP based gids in port caps")
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Artemy Kovalyov <artemyko@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
12 files changed:
drivers/infiniband/core/uverbs_cmd.c
drivers/infiniband/hw/bnxt_re/ib_verbs.c
drivers/infiniband/hw/mlx4/main.c
drivers/infiniband/hw/mlx5/main.c
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
drivers/infiniband/hw/qedr/verbs.c
drivers/infiniband/hw/qib/qib_verbs.h
drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c
include/rdma/ib_mad.h
include/rdma/ib_verbs.h
include/uapi/rdma/ib_user_ioctl_verbs.h
include/uapi/rdma/ib_user_verbs.h