]> asedeno.scripts.mit.edu Git - linux.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)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 Sep 2019 20:06:03 +0000 (22:06 +0200)
commit79226cea4a5ebbd84a4eee1762526f664c7beb62
treeb8110d3f7480f504771f6e3f13782741eb4c34ef
parent0eda847953d8dfb4b713ea62420f66157e230e13
net: ena: fix incorrect update of intr_delay_resolution

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>
drivers/net/ethernet/amazon/ena/ena_com.c
drivers/net/ethernet/amazon/ena/ena_com.h
drivers/net/ethernet/amazon/ena/ena_netdev.c