]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
net: ena: fix update of interrupt moderation register
authorArthur Kiyanovski <akiyano@amazon.com>
Mon, 16 Sep 2019 11:31:34 +0000 (14:31 +0300)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 4 Dec 2019 09:29:26 +0000 (10:29 +0100)
BugLink: https://bugs.launchpad.net/bugs/1853180
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 <akiyano@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 7b8a28787e2ba671eaeb073e3b62fb4786338a09)
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Acked-by: Khaled Elmously <khalid.elmously@canonical.com>
Acked-by: Connor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/net/ethernet/amazon/ena/ena_netdev.c

index f672cd8a63b0fbdd5a91d445523923d697c5fab7..3396c85bcab0899ded92905e43dc2f9e8551d0ab 100644 (file)
@@ -1188,12 +1188,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);