]> asedeno.scripts.mit.edu Git - linux.git/commit
IB/hfi1: Fix adaptive pio packet corruption
authorMike Marciniszyn <mike.marciniszyn@intel.com>
Mon, 7 Mar 2016 19:35:41 +0000 (11:35 -0800)
committerDoug Ledford <dledford@redhat.com>
Thu, 17 Mar 2016 19:55:21 +0000 (15:55 -0400)
commit47177f1bac9ca2b65eefdc9b0b63d0505bd4e11e
tree7f1db81f25a35f121f6130129ad5a62eed0cacf2
parentcef504c5c019ea4f59cf3a69e7341b2b34091cda
IB/hfi1: Fix adaptive pio packet corruption

The adaptive pio heuristic missed a case that causes a corrupted
packet on the wire.

The case is if SDMA egress had been chosen for a pio-able packet and
then encountered a ring space wait, the packet is queued.   The sge
cursor had been incremented as part of the packet build out for SDMA.

After the send engine restart, the heuristic might now chose pio based
on the sdma count being zero and start the mmio copy using the already
incremented sge cursor.

Fix this by forcing SDMA egress when the SDMA descriptor has already
been built.

Additionally, the code to wait for a QPs pio count to zero when
switching to SDMA was missing.  Add it.

There is also an issue with UD QPs, in that the different SLs can pick
a different egress send context.  For now, just insure the UD/GSI
always go through SDMA.

Reviewed-by: Vennila Megavannan <vennila.megavannan@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/staging/rdma/hfi1/verbs.c