]> git.baikalelectronics.ru Git - kernel.git/commit
IB/hfi1: Correct issues with sc5 computation
authorMike Marciniszyn <mike.marciniszyn@intel.com>
Fri, 1 Jul 2016 22:57:02 +0000 (15:57 -0700)
committerDoug Ledford <dledford@redhat.com>
Tue, 12 Jul 2016 14:46:24 +0000 (10:46 -0400)
commit749e1038e77582dc893ad98d0e4b27dbbf8cce83
tree4e83c3712ac135406a6d57a999e6ff8a5d5c71a6
parent0bbe890fa998d2f37acbcf71cdb101a3c511f94d
IB/hfi1: Correct issues with sc5 computation

There are several computatations of the sc in the
ud receive routine.

Besides the code duplication, all are wrong when the
sc is greater than 15.   In that case the code incorrectly
or's a 1 into the computed sc instead of 1 shifted left
by 4.

Fix precomputed sc5 by using an already implemented routine
hdr2sc() and deleting flawed duplicated code.

Cc: Stable <stable@vger.kernel.org> # 4.6+
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/hfi1/ud.c