]> git.baikalelectronics.ru Git - kernel.git/commit
IB{cm, core}: Introduce and use ah_attr copy, move, replace APIs
authorJason Gunthorpe <jgg@mellanox.com>
Wed, 13 Jun 2018 07:22:05 +0000 (10:22 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 18 Jun 2018 17:11:26 +0000 (11:11 -0600)
commit26215b4dd31af8935291bd1b24bd3efc6d1704eb
tree8a0775903a601c8c9b4ad3e1b43601ea7568e127
parent72b919abd94ac956c5de2033a7c1e053d9f00bf9
IB{cm, core}: Introduce and use ah_attr copy, move, replace APIs

Introduce AH attribute copy, move and replace APIs to be used by core and
provider drivers.

In CM code flow when ah attribute might be re-initialized twice while
processing incoming request, or initialized once while from path record
while sending out CM requests. Therefore use rdma_move_ah_attr API to
handle such scenarios instead of memcpy().

Provider drivers keeps a copy ah_attr during the lifetime of the ah.
Therefore, use rdma_replace_ah_attr() which conditionally release
reference to old ah_attr and holds reference to new attribute whose
referrence is released when the AH is freed.

Signed-off-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
drivers/infiniband/core/cm.c
drivers/infiniband/core/verbs.c
drivers/infiniband/hw/qedr/verbs.c
drivers/infiniband/sw/rdmavt/ah.c
drivers/infiniband/sw/rdmavt/qp.c
include/rdma/ib_verbs.h