]> git.baikalelectronics.ru Git - kernel.git/commit
rxe: correctly calculate iCRC for unaligned payloads
authorSteve Wise <larrystevenwise@gmail.com>
Tue, 3 Dec 2019 02:03:20 +0000 (20:03 -0600)
committerDoug Ledford <dledford@redhat.com>
Mon, 9 Dec 2019 18:55:26 +0000 (13:55 -0500)
commite60445cac808cd4107b6ea0c85627e63f09ded72
treefe5bbe9e2b18805e7c0270b80f39bffa3f71db68
parentdab36eaeb1e2934928157f30e599c4251d716ba5
rxe: correctly calculate iCRC for unaligned payloads

If RoCE PDUs being sent or received contain pad bytes, then the iCRC
is miscalculated, resulting in PDUs being emitted by RXE with an incorrect
iCRC, as well as ingress PDUs being dropped due to erroneously detecting
a bad iCRC in the PDU.  The fix is to include the pad bytes, if any,
in iCRC computations.

Note: This bug has caused broken on-the-wire compatibility with actual
hardware RoCE devices since the soft-RoCE driver was first put into the
mainstream kernel.  Fixing it will create an incompatibility with the
original soft-RoCE devices, but is necessary to be compatible with real
hardware devices.

Fixes: c4397c211d7d ("Soft RoCE driver")
Signed-off-by: Steve Wise <larrystevenwise@gmail.com>
Link: https://lore.kernel.org/r/20191203020319.15036-2-larrystevenwise@gmail.com
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/sw/rxe/rxe_recv.c
drivers/infiniband/sw/rxe/rxe_req.c
drivers/infiniband/sw/rxe/rxe_resp.c