]> git.baikalelectronics.ru Git - kernel.git/commit
IB/rdmavt: Setting of QP timeout can overflow jiffies computation
authorKaike Wan <kaike.wan@intel.com>
Sat, 17 Jun 2017 17:37:26 +0000 (10:37 -0700)
committerDoug Ledford <dledford@redhat.com>
Thu, 20 Jul 2017 15:20:50 +0000 (11:20 -0400)
commite28daf9ec009025f348f1ae6a853b83736aa7425
tree1abc324af4c736e444135f1c6aa0f97201611048
parentb29350a92ade4153f8511b8cea3a9b0914933a27
IB/rdmavt: Setting of QP timeout can overflow jiffies computation

Current computation of qp->timeout_jiffies in rvt_modify_qp() will cause
overflow due to the fact that the input to the function usecs_to_jiffies
is only 32-bit ( unsigned int). Overflow will occur when attr->timeout is
equal to or greater than 30. The consequence is unnecessarily excessive
retry and thus degradation of the system performance.

This patch fixes the problem by limiting the input to 5-bit and calling
usecs_to_jiffies() before multiplying the scaling factor.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/sw/rdmavt/qp.c
include/rdma/rdmavt_qp.h