]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
net: ena: fix incorrect update of intr_delay_resolution
authorArthur Kiyanovski <akiyano@amazon.com>
Mon, 16 Sep 2019 11:31:36 +0000 (14:31 +0300)
committerStefan Bader <stefan.bader@canonical.com>
Thu, 28 Nov 2019 16:48:46 +0000 (17:48 +0100)
commit609a35e8d72f98552f49cffb57fea2adb1e381ec
tree951374a449a9d9a83a7f477b767daf036373da45
parent7a2424b72aada71e3d23cc97dcb0476a723815b8
net: ena: fix incorrect update of intr_delay_resolution

BugLink: https://bugs.launchpad.net/bugs/1853180
ena_dev->intr_moder_rx/tx_interval save the intervals received from the
user after dividing them by ena_dev->intr_delay_resolution. Therefore
when intr_delay_resolution changes, the code needs to first mutiply
intr_moder_rx/tx_interval by the previous intr_delay_resolution to get
the value originally given by the user, and only then divide it by the
new intr_delay_resolution.

Current code does not first multiply intr_moder_rx/tx_interval by the old
intr_delay_resolution. This commit fixes it.

Also initialize ena_dev->intr_delay_resolution to be 1.

Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 79226cea4a5ebbd84a4eee1762526f664c7beb62)
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_com.c
drivers/net/ethernet/amazon/ena/ena_com.h
drivers/net/ethernet/amazon/ena/ena_netdev.c