From: Arthur Kiyanovski Date: Mon, 16 Sep 2019 11:31:34 +0000 (+0300) Subject: net: ena: fix update of interrupt moderation register X-Git-Tag: microblaze-v5.5-rc1~160^2~2^2~2 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=7b8a28787e2ba671eaeb073e3b62fb4786338a09;p=linux-2.6-microblaze.git net: ena: fix update of interrupt moderation register Current implementation always updates the interrupt register with the smoothed_interval of the rx_ring. However this should be done only in case of adaptive interrupt moderation. If non-adaptive interrupt moderation is used, the non-adaptive interrupt moderation interval should be used. This commit fixes that. Signed-off-by: Arthur Kiyanovski Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c index 8b9f8b90e525..54539e57aa73 100644 --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c @@ -1187,12 +1187,15 @@ static void ena_unmask_interrupt(struct ena_ring *tx_ring, struct ena_ring *rx_ring) { struct ena_eth_io_intr_reg intr_reg; + u32 rx_interval = ena_com_get_adaptive_moderation_enabled(rx_ring->ena_dev) ? + rx_ring->smoothed_interval : + ena_com_get_nonadaptive_moderation_interval_rx(rx_ring->ena_dev); /* Update intr register: rx intr delay, * tx intr delay and interrupt unmask */ ena_com_update_intr_reg(&intr_reg, - rx_ring->smoothed_interval, + rx_interval, tx_ring->smoothed_interval, true);