Current default non-adaptive tx interrupt moderation interval is 196 us.
This commit sets it to 0, which is much more sensible as a default value.
It can be modified using ethtool -C.
Signed-off-by: Arthur Kiyanovski <email address hidden>
Reference: https://<email address hidden>/
Signed-off-by: Kamal Mostafa <email address hidden>
expected output: rx-usecs 128
actual output: rx-usecs 0
Reason for issue:
In stage 3, ethtool userspace calls first the ena_get_coalesce() handler
to get the current value of all properties, and then the ena_set_coalesce()
handler. When ena_get_coalesce() is called the adaptive interrupt
moderation is still on. There is an if in the code that returns the
rx_coalesce_usecs only if the adaptive interrupt moderation is off.
And since it is still on, rx_coalesce_usecs is not set, meaning it
stays 0.
Solution to issue:
Remove this if static interrupt moderation intervals have nothing to do with
dynamic ones.
expected output: rx-usecs 128
actual output: rx-usecs 0
Reason for issue:
In stage 3, when ena_set_coalesce() is called, the handler tests if
rx adaptive interrupt moderation is on, and if it is, it returns before
getting to the part in the function that sets the rx non-adaptive
interrupt moderation interval.
Solution to issue:
Remove the return from the function when rx adaptive interrupt moderation
is on.
Additional small fixes in this commit:
--------------------------------------
1. Remove 2 unnecessary comments.
2. Remove 4 unnecesary "{}" in single row if statements.
3. Reorder ena_set_coalesce() to make sense.
4. Change the names of ena_update_tx/rx_rings_intr_moderation()
functions to ena_update_tx/rx_rings_nonadaptive_intr_moderation() for
clarity.
Signed-off-by: Arthur Kiyanovski <email address hidden>
Reference: https://<email address hidden>/
Signed-off-by: Kamal Mostafa <email address hidden>
If CONFIG_ENA_ETHERNET=y and CONFIG_DIMLIB=n,
below erros can be found:
drivers/net/ethernet/amazon/ena/ena_netdev.o: In function `ena_dim_work':
ena_netdev.c:(.text+0x21cc): undefined reference to `net_dim_get_rx_moderation'
ena_netdev.c:(.text+0x21cc): relocation truncated to
fit: R_AARCH64_CALL26 against undefined symbol `net_dim_get_rx_moderation'
drivers/net/ethernet/amazon/ena/ena_netdev.o: In function `ena_io_poll':
ena_netdev.c:(.text+0x7bd4): undefined reference to `net_dim'
ena_netdev.c:(.text+0x7bd4): relocation truncated to fit:
R_AARCH64_CALL26 against undefined symbol `net_dim'
After commit 282faf61a053 ("net: ena: switch to dim algorithm for rx adaptive
interrupt moderation"), it introduces dim algorithm, which configured by CONFIG_DIMLIB.
So, this patch is to select DIMLIB for ENA_ETHERNET.
Fixes: 282faf61a053 ("net: ena: switch to dim algorithm for rx adaptive interrupt moderation")
Signed-off-by: Mao Wenan <email address hidden>
Signed-off-by: Jakub Kicinski <email address hidden>
(cherry picked from commit ff04cfbaa23644562f369eeca0b44ef66e185c9e)
Signed-off-by: Kamal Mostafa <email address hidden>
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 <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
(cherry picked from commit 79226cea4a5ebbd84a4eee1762526f664c7beb62)
Signed-off-by: Kamal Mostafa <email address hidden>
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 <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
(cherry picked from commit 0eda847953d8dfb4b713ea62420f66157e230e13)
Signed-off-by: Kamal Mostafa <email address hidden>
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 <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
(cherry picked from commit 7b8a28787e2ba671eaeb073e3b62fb4786338a09)
Signed-off-by: Kamal Mostafa <email address hidden>
Remove previous implementation of adaptive rx interrupt moderation
from ena_com files.
Signed-off-by: Arthur Kiyanovski <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
(cherry picked from commit 3ced8cbdf7ddb3160ffa714a91040dd18f39a12c)
Signed-off-by: Kamal Mostafa <email address hidden>
Deleted unused 4 fields from struct ena_adapter and their only user
ena_restore_ethtool_params().
Signed-off-by: Arthur Kiyanovski <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
(cherry picked from commit 64d1fb9dfc6c5d8589312fa847fee14ec14ee12b)
Signed-off-by: Kamal Mostafa <email address hidden>
1. Out of the fields {per_napi_bytes, per_napi_packets} in struct ena_ring,
only rx_ring->per_napi_packets are used to determine if napi did work
for dim.
This commit removes all other uses of these fields.
2. Remove ena_ring->moder_tbl_idx, which is not used by dim.
3. Remove all calls to ena_com_destroy_interrupt_moderation(), since all it
did was to destroy the interrupt moderation table, which is removed as
part of removing old interrupt moderation code.
Signed-off-by: Arthur Kiyanovski <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
(cherry picked from commit 242d81fd3dd9f301b0c20564aafec8efdb2bbe5b)
Signed-off-by: Kamal Mostafa <email address hidden>
Signed-off-by: Arthur Kiyanovski <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
(cherry picked from commit 57e3a5f24bb5bf265988e973a911845abcbf6a00)
Signed-off-by: Kamal Mostafa <email address hidden>