IB/hfi1: Fix context recovery when PBC has an UnsupportedVL
authorMichael J. Ruhl <michael.j.ruhl@intel.com>
Thu, 20 Sep 2018 19:59:05 +0000 (12:59 -0700)
committerJason Gunthorpe <jgg@mellanox.com>
Fri, 21 Sep 2018 01:24:51 +0000 (19:24 -0600)
commitd623500b3c4efd8d4e945ac9003c6b87b469a9ab
tree17eeefe440d6466b95ee4e366ce9d9afb18614c9
parent94694d18cf27a6faad91487a38ce516c2b16e7d9
IB/hfi1: Fix context recovery when PBC has an UnsupportedVL

If a packet stream uses an UnsupportedVL (virtual lane), the send
engine will not send the packet, and it will not indicate that an
error has occurred.  This will cause the packet stream to block.

HFI has 8 virtual lanes available for packet streams.  Each lane can
be enabled or disabled using the UnsupportedVL mask.  If a lane is
disabled, adding a packet to the send context must be disallowed.

The current mask for determining unsupported VLs defaults to 0 (allow
all).  This is incorrect.  Only the VLs that are defined should be
allowed.

Determine which VLs are disabled (mtu == 0), and set the appropriate
unsupported bit in the mask.  The correct mask will allow the send
engine to error on the invalid VL, and error recovery will work
correctly.

Cc: <stable@vger.kernel.org> # 4.9.x+
Fixes: 7724105686e7 ("IB/hfi1: add driver files")
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Lukasz Odzioba <lukasz.odzioba@intel.com>
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/hfi1/pio.c