OSDN Git Service

RDMA/ipoib: Update paths on CLIENT_REREG/SM_CHANGE events
authorDoug Ledford <dledford@redhat.com>
Fri, 18 May 2018 15:36:09 +0000 (11:36 -0400)
committerDoug Ledford <dledford@redhat.com>
Tue, 22 May 2018 17:16:05 +0000 (13:16 -0400)
commitfa9391dbad4b868512ed22a7e41765f881a8a935
tree15440130bd7b42599a662693295797017b9e3c67
parentda2f3b286a396928e9ddcb8c9a987597e751aa84
RDMA/ipoib: Update paths on CLIENT_REREG/SM_CHANGE events

We do a light flush on CLIENT_REREG and SM_CHANGE events.  This goes
through and marks paths invalid. But we weren't always checking for this
validity when we needed to, and so we could keep using a path marked
invalid.  What's more, once we establish a path with a valid ah, we put
a pointer to the ah in the neigh struct directly, so even if we mark the
path as invalid, as long as the neigh has a direct pointer to the ah, it
keeps using the old, outdated ah.

To fix this we do several things.

1) Put the valid flag in the ah instead of the path struct, so when we
put the ah pointer directly in the neigh struct, we can easily check the
validity of the ah on send events.
2) Check the neigh->ah and neigh->ah->valid elements in the needed
places, and if we have an ah, but it's invalid, then invoke a refresh of
the ah.
3) Fix the various places that check for path, but didn't check for
path->valid (now path->ah && path->ah->valid).

Reported-by: Evgenii Smirnov <evgenii.smirnov@profitbricks.com>
Fixes: ee1e2c82c245 ("IPoIB: Refresh paths instead of flushing them on SM change events")
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/ulp/ipoib/ipoib.h
drivers/infiniband/ulp/ipoib/ipoib_main.c