Skip to content

Commit 693536a

Browse files
mjruhlgregkh
authored andcommitted
IB/hfi1: Fix context recovery when PBC has an UnsupportedVL
commit d623500 upstream. 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: <[email protected]> # 4.9.x+ Fixes: 7724105 ("IB/hfi1: add driver files") Reviewed-by: Mike Marciniszyn <[email protected]> Reviewed-by: Lukasz Odzioba <[email protected]> Signed-off-by: Michael J. Ruhl <[email protected]> Signed-off-by: Dennis Dalessandro <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 412a4b4 commit 693536a

File tree

1 file changed

+7
-2
lines changed
  • drivers/infiniband/hw/hfi1

1 file changed

+7
-2
lines changed

drivers/infiniband/hw/hfi1/pio.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ void pio_send_control(struct hfi1_devdata *dd, int op)
8686
unsigned long flags;
8787
int write = 1; /* write sendctrl back */
8888
int flush = 0; /* re-read sendctrl to make sure it is flushed */
89+
int i;
8990

9091
spin_lock_irqsave(&dd->sendctrl_lock, flags);
9192

@@ -95,9 +96,13 @@ void pio_send_control(struct hfi1_devdata *dd, int op)
9596
reg |= SEND_CTRL_SEND_ENABLE_SMASK;
9697
/* Fall through */
9798
case PSC_DATA_VL_ENABLE:
99+
mask = 0;
100+
for (i = 0; i < ARRAY_SIZE(dd->vld); i++)
101+
if (!dd->vld[i].mtu)
102+
mask |= BIT_ULL(i);
98103
/* Disallow sending on VLs not enabled */
99-
mask = (((~0ull) << num_vls) & SEND_CTRL_UNSUPPORTED_VL_MASK) <<
100-
SEND_CTRL_UNSUPPORTED_VL_SHIFT;
104+
mask = (mask & SEND_CTRL_UNSUPPORTED_VL_MASK) <<
105+
SEND_CTRL_UNSUPPORTED_VL_SHIFT;
101106
reg = (reg & ~SEND_CTRL_UNSUPPORTED_VL_SMASK) | mask;
102107
break;
103108
case PSC_GLOBAL_DISABLE:

0 commit comments

Comments
 (0)