IB/hfi1: Drop all TID RDMA READ RESP packets after r_next_psn
authorKaike Wan <kaike.wan@intel.com>
Mon, 15 Jul 2019 16:45:40 +0000 (12:45 -0400)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 22 Jul 2019 17:57:55 +0000 (14:57 -0300)
commitf4d46119f214f9a7620b0d18b153d7e0e8c90b4f
treeebfbba88f950a93cfde560a4aefa14d07687f193
parentdc25b239ebeaa3c58e5ceaa732140427d386aa16
IB/hfi1: Drop all TID RDMA READ RESP packets after r_next_psn

When a TID sequence error occurs while receiving TID RDMA READ RESP
packets, all packets after flow->flow_state.r_next_psn should be dropped,
including those response packets for subsequent segments.

The current implementation will drop the subsequent response packets for
the segment to complete next, but may accept packets for subsequent
segments and therefore mistakenly advance the r_next_psn fields for the
corresponding software flows. This may result in failures to complete
subsequent segments after the current segment is completed.

The fix is to only use the flow pointed by req->clear_tail for checking
KDETH PSN instead of finding a flow from the request's flow array.

Fixes: b885d5be9ca1 ("IB/hfi1: Unify the software PSN check for TID RDMA READ/WRITE")
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20190715164540.74174.54702.stgit@awfm-01.aw.intel.com
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/hfi1/tid_rdma.c