bnxt: apply computed clamp value for coalece parameter
authorJonathan Lemon <jonathan.lemon@gmail.com>
Tue, 10 Dec 2019 16:39:46 +0000 (08:39 -0800)
committerJakub Kicinski <jakub.kicinski@netronome.com>
Fri, 13 Dec 2019 23:32:44 +0000 (15:32 -0800)
After executing "ethtool -C eth0 rx-usecs-irq 0", the box becomes
unresponsive, likely due to interrupt livelock.  It appears that
a minimum clamp value for the irq timer is computed, but is never
applied.

Fix by applying the corrected clamp value.

Fixes: 74706afa712d ("bnxt_en: Update interrupt coalescing logic.")
Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
drivers/net/ethernet/broadcom/bnxt/bnxt.c

index a754903..c779f9c 100644 (file)
@@ -6190,7 +6190,7 @@ static void bnxt_hwrm_set_coal_params(struct bnxt *bp,
                tmr = bnxt_usec_to_coal_tmr(bp, hw_coal->coal_ticks_irq);
                val = clamp_t(u16, tmr, 1,
                              coal_cap->cmpl_aggr_dma_tmr_during_int_max);
-               req->cmpl_aggr_dma_tmr_during_int = cpu_to_le16(tmr);
+               req->cmpl_aggr_dma_tmr_during_int = cpu_to_le16(val);
                req->enables |=
                        cpu_to_le16(BNXT_COAL_CMPL_AGGR_TMR_DURING_INT_ENABLE);
        }