Skip to content

Commit

Permalink
Merge branch 'bnxt_en-next'
Browse files Browse the repository at this point in the history
Michael Chan says:

====================
bnxt_en: Fix IRQ coalescing regressions.

There was a typo and missing guard-rail against illegal values in the
recent code clean up.  All reported by Andy Gospodarek.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Nov 3, 2017
2 parents 8f918d3 + b153cbc commit 739c596
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion drivers/net/ethernet/broadcom/bnxt/bnxt.c
Original file line number Diff line number Diff line change
Expand Up @@ -4548,9 +4548,13 @@ static void bnxt_hwrm_set_coal_params(struct bnxt_coal *hw_coal,

val = clamp_t(u16, hw_coal->coal_bufs, 1, max);
req->num_cmpl_aggr_int = cpu_to_le16(val);

/* This is a 6-bit value and must not be 0, or we'll get non stop IRQ */
val = min_t(u16, val, 63);
req->num_cmpl_dma_aggr = cpu_to_le16(val);

val = clamp_t(u16, hw_coal->coal_bufs_irq, 1, max);
/* This is a 6-bit value and must not be 0, or we'll get non stop IRQ */
val = clamp_t(u16, hw_coal->coal_bufs_irq, 1, 63);
req->num_cmpl_dma_aggr_during_int = cpu_to_le16(val);

tmr = BNXT_USEC_TO_COAL_TIMER(hw_coal->coal_ticks);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static int bnxt_set_coalesce(struct net_device *dev,
hw_coal->coal_ticks_irq = coal->rx_coalesce_usecs_irq;
hw_coal->coal_bufs_irq = coal->rx_max_coalesced_frames_irq * mult;

hw_coal = &bp->rx_coal;
hw_coal = &bp->tx_coal;
mult = hw_coal->bufs_per_record;
hw_coal->coal_ticks = coal->tx_coalesce_usecs;
hw_coal->coal_bufs = coal->tx_max_coalesced_frames * mult;
Expand Down

0 comments on commit 739c596

Please sign in to comment.