linux/drivers/net/ethernet/amazon/ena
Shay Agroskin 8b147f6f3e net: ena: Change WARN_ON expression in ena_del_napi_in_range()
The ena_del_napi_in_range() function unregisters the napi handler for
rings in a given range.
This function had the following WARN_ON macro:

    WARN_ON(ENA_IS_XDP_INDEX(adapter, i) &&
	    adapter->ena_napi[i].xdp_ring);

This macro prints the call stack if the expression inside of it is
true [1], but the expression inside of it is the wanted situation.
The expression checks whether the ring has an XDP queue and its index
corresponds to a XDP one.

This patch changes the expression to
    !ENA_IS_XDP_INDEX(adapter, i) && adapter->ena_napi[i].xdp_ring
which indicates an unwanted situation.

Also, change the structure of the function. The napi handler is
unregistered for all rings, and so there's no need to check whether the
index is an XDP index or not. By removing this check the code becomes
much more readable.

Fixes: 548c4940b9 ("net: ena: Implement XDP_TX action")
Signed-off-by: Shay Agroskin <shayagr@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-19 15:32:58 -07:00
..
ena_admin_defs.h net: ena: support new LLQ acceleration mode 2020-07-21 15:59:04 -07:00
ena_com.c net: ena: support new LLQ acceleration mode 2020-07-21 15:59:04 -07:00
ena_com.h net: ena: support new LLQ acceleration mode 2020-07-21 15:59:04 -07:00
ena_common_defs.h net: ena: cosmetic: fix spacing issues 2020-05-22 14:12:48 -07:00
ena_eth_com.c net: ena: support new LLQ acceleration mode 2020-07-21 15:59:04 -07:00
ena_eth_com.h net: ena: support new LLQ acceleration mode 2020-07-21 15:59:04 -07:00
ena_eth_io_defs.h net: ena: cosmetic: fix spacing issues 2020-05-22 14:12:48 -07:00
ena_ethtool.c net: ena: cosmetic: change ena_com_stats_admin stats to u64 2020-07-21 15:59:04 -07:00
ena_netdev.c net: ena: Change WARN_ON expression in ena_del_napi_in_range() 2020-08-19 15:32:58 -07:00
ena_netdev.h net: ena: support new LLQ acceleration mode 2020-07-21 15:59:04 -07:00
ena_pci_id_tbl.h net: ena: add reserved PCI device ID 2020-07-21 15:59:04 -07:00
ena_regs_defs.h net: ena: cosmetic: fix spacing issues 2020-05-22 14:12:48 -07:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00