From 6cb12ee2b02dac4455bc60aebdcd326436dff743 Mon Sep 17 00:00:00 2001 From: Christian Iversen Date: Tue, 26 Jan 2021 22:47:29 +0100 Subject: [PATCH] [hermon] Increase polling rate for command completions Some older versions of the hardware (and/or firmware) do not report an event when an Infiniband link reaches the INIT state. The driver works around this missing event by calling ib_smc_update() on each event queue poll while the link is in the DOWN state. This results in a very large number of commands being issued while any open Infiniband link is in the DOWN state (e.g. unplugged), to the point that the 1ms delay from waiting for each command to complete will noticeably affect responsiveness. Fix by decreasing the command completion polling delay from 1ms to 10us. Signed-off-by: Christian Iversen Modified-by: Michael Brown Signed-off-by: Michael Brown --- src/drivers/infiniband/hermon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/drivers/infiniband/hermon.c b/src/drivers/infiniband/hermon.c index eb1255ffb..e818b4d29 100644 --- a/src/drivers/infiniband/hermon.c +++ b/src/drivers/infiniband/hermon.c @@ -137,13 +137,13 @@ static int hermon_cmd_wait ( struct hermon *hermon, struct hermonprm_hca_command_register *hcr ) { unsigned int wait; - for ( wait = HERMON_HCR_MAX_WAIT_MS ; wait ; wait-- ) { + for ( wait = ( 100 * HERMON_HCR_MAX_WAIT_MS ) ; wait ; wait-- ) { hcr->u.dwords[6] = readl ( hermon->config + HERMON_HCR_REG ( 6 ) ); if ( ( MLX_GET ( hcr, go ) == 0 ) && ( MLX_GET ( hcr, t ) == hermon->toggle ) ) return 0; - mdelay ( 1 ); + udelay ( 10 ); } return -EBUSY; }