From: Arthur Kiyanovski Date: Mon, 16 Sep 2019 11:31:35 +0000 (+0300) Subject: net: ena: fix retrieval of nonadaptive interrupt moderation intervals X-Git-Tag: archive/raspbian/5.7.6-1+rpi1^2^2^2^2^2^2^2^2^2^2~4 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=67305fc58af2cfb484cc1d8d9612f7fc7297696f;p=linux.git net: ena: fix retrieval of nonadaptive interrupt moderation intervals Nonadaptive interrupt moderation intervals are assigned the value set by the user in ethtool -C divided by ena_dev->intr_delay_resolution. Therefore when the user tries to get the nonadaptive interrupt moderation intervals with ethtool -c the code needs to multiply the saved value by ena_dev->intr_delay_resolution. The current code erroneously divides instead of multiplying in ethtool -c. This patch fixes this. Signed-off-by: Arthur Kiyanovski Signed-off-by: David S. Miller Gbp-Pq: Topic features/all/ena Gbp-Pq: Name 0011-net-ena-fix-retrieval-of-nonadaptive-interrupt-moder.patch --- diff --git a/drivers/net/ethernet/amazon/ena/ena_ethtool.c b/drivers/net/ethernet/amazon/ena/ena_ethtool.c index 0f90e229663..16553d92fad 100644 --- a/drivers/net/ethernet/amazon/ena/ena_ethtool.c +++ b/drivers/net/ethernet/amazon/ena/ena_ethtool.c @@ -310,14 +310,15 @@ static int ena_get_coalesce(struct net_device *net_dev, /* the devie doesn't support interrupt moderation */ return -EOPNOTSUPP; } + coalesce->tx_coalesce_usecs = - ena_com_get_nonadaptive_moderation_interval_tx(ena_dev) / + ena_com_get_nonadaptive_moderation_interval_tx(ena_dev) * ena_dev->intr_delay_resolution; if (!ena_com_get_adaptive_moderation_enabled(ena_dev)) coalesce->rx_coalesce_usecs = ena_com_get_nonadaptive_moderation_interval_rx(ena_dev) - / ena_dev->intr_delay_resolution; + * ena_dev->intr_delay_resolution; coalesce->use_adaptive_rx_coalesce = ena_com_get_adaptive_moderation_enabled(ena_dev);