1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/ethernet/intel
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
..
e1000 e1000: replace deprecated strncpy with strscpy 2023-10-18 18:10:17 -07:00
e1000e e1000e: Add support for the next LOM generation 2023-08-24 12:55:25 -07:00
fm10k fm10k: replace deprecated strncpy with strscpy 2023-10-18 18:10:17 -07:00
i40e i40e: Fix unexpected MFS warning message 2023-12-05 10:51:22 -08:00
iavf iavf: validate tx_coalesce_usecs even if rx_coalesce_usecs is zero 2023-12-05 10:51:22 -08:00
ice ice: Restore fix disabling RX VLAN filtering 2023-12-05 10:51:22 -08:00
idpf idpf: fix potential use-after-free in idpf_tso() 2023-11-06 17:24:37 -08:00
igb Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-10-26 13:46:28 -07:00
igbvf igbvf: replace deprecated strncpy with strscpy 2023-10-18 18:10:18 -07:00
igc Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-10-26 13:46:28 -07:00
ixgbe ixgbe: fix end of loop test in ixgbe_set_vf_macvlan() 2023-10-20 12:53:06 +01:00
ixgbevf ixgbevf: Remove unused function declarations 2023-08-04 18:03:00 -07:00
e100.c e100: replace deprecated strncpy with strscpy 2023-10-18 18:10:17 -07:00
Kconfig i40e: Add initial devlink support 2023-10-15 14:33:41 +01:00
Makefile idpf: add SRIOV support and other ndo_ops 2023-09-13 14:59:24 -07:00