]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[hermon] Increase polling rate for command completions
authorChristian Iversen <ci@iversenit.dk>
Tue, 26 Jan 2021 21:47:29 +0000 (22:47 +0100)
committerMichael Brown <mcb30@ipxe.org>
Thu, 28 Jan 2021 23:47:00 +0000 (23:47 +0000)
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 <ci@iversenit.dk>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/infiniband/hermon.c

index eb1255ffb71575c540f2c499ba28058e6c57c187..e818b4d29a0176dd2f22406fe72c03af58279781 100644 (file)
@@ -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;
 }