mirror_ubuntu-kernels/drivers/net/ethernet/intel/iavf
Jacob Keller a206d9959f iavf: validate tx_coalesce_usecs even if rx_coalesce_usecs is zero
In __iavf_set_coalesce, the driver checks both ec->rx_coalesce_usecs and
ec->tx_coalesce_usecs for validity. It does this via a chain if if/else-if
blocks. If every single branch of the series of if statements exited, this
would be fine. However, the rx_coalesce_usecs is checked against zero to
print an informative message if use_adaptive_rx_coalesce is enabled. If
this check is true, it short circuits the entire chain of statements,
preventing validation of the tx_coalesce_usecs field.

Indeed, since commit e792779e6b ("iavf: Prevent changing static ITR
values if adaptive moderation is on") the iavf driver actually rejects any
change to the tx_coalesce_usecs or rx_coalesce_usecs when
use_adaptive_tx_coalesce or use_adaptive_rx_coalesce is enabled, making
this checking a bit redundant.

Fix this error by removing the unnecessary and redundant checks for
use_adaptive_rx_coalesce and use_adaptive_tx_coalesce. Since zero is a
valid value, and since the tx_coalesce_usecs and rx_coalesce_usecs fields
are already unsigned, remove the minimum value check. This allows assigning
an ITR value ranging from 0-8160 as described by the printed message.

Fixes: 65e87c0398 ("i40evf: support queue-specific settings for interrupt moderation")
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2023-12-05 10:51:22 -08:00
..
iavf_adminq_cmd.h
iavf_adminq.c iavf: Fix adminq error handling 2022-08-12 08:22:55 -07:00
iavf_adminq.h
iavf_adv_rss.c
iavf_adv_rss.h
iavf_alloc.h iavf: remove some unused functions and pointless wrappers 2023-06-22 09:26:55 -07:00
iavf_common.c iavf: delete unused iavf_mac_info fields 2023-10-19 13:23:14 +02:00
iavf_devids.h
iavf_ethtool.c iavf: validate tx_coalesce_usecs even if rx_coalesce_usecs is zero 2023-12-05 10:51:22 -08:00
iavf_fdir.c iavf: fix FDIR rule fields masks validation 2023-08-16 08:27:29 -07:00
iavf_fdir.h iavf: fix FDIR rule fields masks validation 2023-08-16 08:27:29 -07:00
iavf_main.c iavf: delete the iavf client interface 2023-10-27 15:35:49 -07:00
iavf_osdep.h iavf: remove some unused functions and pointless wrappers 2023-06-22 09:26:55 -07:00
iavf_prototype.h iavf: delete unused iavf_mac_info fields 2023-10-19 13:23:14 +02:00
iavf_register.h iavf: remove mask from iavf_irq_enable_queues() 2023-06-10 00:09:54 -07:00
iavf_status.h virtchnl: i40e/iavf: rename iwarp to rdma 2023-01-25 08:55:19 -08:00
iavf_trace.h
iavf_txrx.c iavf: remove "inline" functions from iavf_txrx.c 2023-10-03 15:25:13 -07:00
iavf_txrx.h iavf: validate tx_coalesce_usecs even if rx_coalesce_usecs is zero 2023-12-05 10:51:22 -08:00
iavf_type.h iavf: delete unused iavf_mac_info fields 2023-10-19 13:23:14 +02:00
iavf_virtchnl.c iavf: delete the iavf client interface 2023-10-27 15:35:49 -07:00
iavf.h iavf: delete the iavf client interface 2023-10-27 15:35:49 -07:00
Makefile iavf: delete the iavf client interface 2023-10-27 15:35:49 -07:00