RDMA/rxe: Let destroy qp succeed with stuck packet
authorBob Pearson <rpearsonhpe@gmail.com>
Fri, 29 Mar 2024 14:55:15 +0000 (09:55 -0500)
committerJason Gunthorpe <jgg@nvidia.com>
Mon, 22 Apr 2024 19:55:57 +0000 (16:55 -0300)
commit1a633bdc8fd9e9e4a9f9a668ae122edfc5aacc86
treed8c23ad0a3a97af05524f269ada670ecdfa0c4f8
parent9cc6290991e6cfc9a6447823275fa4ba4d902103
RDMA/rxe: Let destroy qp succeed with stuck packet

In some situations a sent packet may get queued in the NIC longer than
than timeout of a ULP. Currently if this happens the ULP may try to reset
the link by destroying the qp and setting up an alternate connection but
will fail because the rxe driver is waiting for the packet to finish
getting sent and be returned to the skb destructor function where the qp
reference holding things up will be dropped. This patch modifies the way
that the qp is passed to the destructor to pass the qp index and not a qp
pointer.  Then the destructor will attempt to lookup the qp from its index
and if it fails exit early. This requires taking a reference on the struct
sock rather than the qp allowing the qp to be destroyed while the sk is
still around waiting for the packet to finish.

Link: https://lore.kernel.org/r/20240329145513.35381-15-rpearsonhpe@gmail.com
Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/sw/rxe/rxe_net.c
drivers/infiniband/sw/rxe/rxe_qp.c