linux/drivers/net/ethernet/intel/ice
Maciej Fijalkowski e102db780e ice: track AF_XDP ZC enabled queues in bitmap
Commit c7a219048e ("ice: Remove xsk_buff_pool from VSI structure")
silently introduced a regression and broke the Tx side of AF_XDP in copy
mode. xsk_pool on ice_ring is set only based on the existence of the XDP
prog on the VSI which in turn picks ice_clean_tx_irq_zc to be executed.
That is not something that should happen for copy mode as it should use
the regular data path ice_clean_tx_irq.

This results in a following splat when xdpsock is run in txonly or l2fwd
scenarios in copy mode:

<snip>
[  106.050195] BUG: kernel NULL pointer dereference, address: 0000000000000030
[  106.057269] #PF: supervisor read access in kernel mode
[  106.062493] #PF: error_code(0x0000) - not-present page
[  106.067709] PGD 0 P4D 0
[  106.070293] Oops: 0000 [#1] PREEMPT SMP NOPTI
[  106.074721] CPU: 61 PID: 0 Comm: swapper/61 Not tainted 5.12.0-rc2+ #45
[  106.081436] Hardware name: Intel Corporation S2600WFT/S2600WFT, BIOS SE5C620.86B.02.01.0008.031920191559 03/19/2019
[  106.092027] RIP: 0010:xp_raw_get_dma+0x36/0x50
[  106.096551] Code: 74 14 48 b8 ff ff ff ff ff ff 00 00 48 21 f0 48 c1 ee 30 48 01 c6 48 8b 87 90 00 00 00 48 89 f2 81 e6 ff 0f 00 00 48 c1 ea 0c <48> 8b 04 d0 48 83 e0 fe 48 01 f0 c3 66 66 2e 0f 1f 84 00 00 00 00
[  106.115588] RSP: 0018:ffffc9000d694e50 EFLAGS: 00010206
[  106.120893] RAX: 0000000000000000 RBX: ffff88984b8c8a00 RCX: ffff889852581800
[  106.128137] RDX: 0000000000000006 RSI: 0000000000000000 RDI: ffff88984cd8b800
[  106.135383] RBP: ffff888123b50001 R08: ffff889896800000 R09: 0000000000000800
[  106.142628] R10: 0000000000000000 R11: ffffffff826060c0 R12: 00000000000000ff
[  106.149872] R13: 0000000000000000 R14: 0000000000000040 R15: ffff888123b50018
[  106.157117] FS:  0000000000000000(0000) GS:ffff8897e0f40000(0000) knlGS:0000000000000000
[  106.165332] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  106.171163] CR2: 0000000000000030 CR3: 000000000560a004 CR4: 00000000007706e0
[  106.178408] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  106.185653] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[  106.192898] PKRU: 55555554
[  106.195653] Call Trace:
[  106.198143]  <IRQ>
[  106.200196]  ice_clean_tx_irq_zc+0x183/0x2a0 [ice]
[  106.205087]  ice_napi_poll+0x3e/0x590 [ice]
[  106.209356]  __napi_poll+0x2a/0x160
[  106.212911]  net_rx_action+0xd6/0x200
[  106.216634]  __do_softirq+0xbf/0x29b
[  106.220274]  irq_exit_rcu+0x88/0xc0
[  106.223819]  common_interrupt+0x7b/0xa0
[  106.227719]  </IRQ>
[  106.229857]  asm_common_interrupt+0x1e/0x40
</snip>

Fix this by introducing the bitmap of queues that are zero-copy enabled,
where each bit, corresponding to a queue id that xsk pool is being
configured on, will be set/cleared within ice_xsk_pool_{en,dis}able and
checked within ice_xsk_pool(). The latter is a function used for
deciding which napi poll routine is executed.
Idea is being taken from our other drivers such as i40e and ixgbe.

Fixes: c7a219048e ("ice: Remove xsk_buff_pool from VSI structure")
Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Tested-by: Kiran Bhandare <kiranx.bhandare@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2021-06-03 08:38:37 -07:00
..
ice_adminq_cmd.h ice: Use default configuration mode for PHY configuration 2021-04-07 17:09:15 -07:00
ice_arfs.c ice: Delay netdev registration 2021-03-31 14:21:27 -07:00
ice_arfs.h ice: Implement aRFS 2020-05-22 22:02:34 -07:00
ice_base.c ice: refactor ITR data structures 2021-04-14 17:00:06 -07:00
ice_base.h
ice_common.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-04-09 20:48:35 -07:00
ice_common.h ice: Use default configuration mode for PHY configuration 2021-04-07 17:09:15 -07:00
ice_controlq.c ice: remove unused struct member 2021-04-14 17:00:06 -07:00
ice_controlq.h ice: remove unused struct member 2021-04-14 17:00:06 -07:00
ice_dcb_lib.c ice: use kernel definitions for IANA protocol ports and ether-types 2021-04-14 17:00:05 -07:00
ice_dcb_lib.h ice: Implement LFC workaround 2020-07-29 08:38:54 -07:00
ice_dcb_nl.c ice: remove DCBNL_DEVRESET bit from PF state 2021-03-29 10:37:19 -07:00
ice_dcb_nl.h
ice_dcb.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-04-17 11:08:07 -07:00
ice_dcb.h ice: replace single-element array used for C struct hack 2020-07-01 16:35:23 -07:00
ice_devids.h
ice_devlink.c ice: display stored UNDI firmware version via devlink info 2021-02-05 11:44:16 -08:00
ice_devlink.h ice: refactor devlink_port to be per-VSI 2020-10-09 13:14:19 -07:00
ice_ethtool_fdir.c ice: Drop leading underscores in enum ice_pf_state 2021-04-14 17:00:05 -07:00
ice_ethtool.c ice: Reimplement module reads used by ethtool 2021-04-14 17:00:06 -07:00
ice_fdir.c ice: Fix prototype warnings 2021-03-23 11:34:02 -07:00
ice_fdir.h ice: Add more FDIR filter type for AVF 2021-03-22 11:32:12 -07:00
ice_flex_pipe.c ice: suppress false cppcheck issues 2021-04-14 17:12:17 -07:00
ice_flex_pipe.h ice: Support to separate GTP-U uplink and downlink 2021-03-22 11:32:12 -07:00
ice_flex_type.h ice: cleanup style issues 2021-03-31 14:21:28 -07:00
ice_flow.c ice: Support RSS configure removal for AVF 2021-04-22 09:26:22 -07:00
ice_flow.h ice: Support RSS configure removal for AVF 2021-04-22 09:26:22 -07:00
ice_fltr.c
ice_fltr.h
ice_fw_update.c ice: report timeout length for erasing during devlink flash 2021-02-05 09:34:24 -08:00
ice_fw_update.h ice: add support for flash update overwrite mask 2020-09-25 17:20:57 -07:00
ice_hw_autogen.h ice: manage interrupts during poll exit 2021-04-14 17:00:05 -07:00
ice_lag.c ice: Add initial support framework for LAG 2021-02-08 16:27:01 -08:00
ice_lag.h ice: Add initial support framework for LAG 2021-02-08 16:27:01 -08:00
ice_lan_tx_rx.h ice: Check FDIR program status for AVF 2021-03-22 11:32:12 -07:00
ice_lib.c ice: track AF_XDP ZC enabled queues in bitmap 2021-06-03 08:38:37 -07:00
ice_lib.h ice: remove return variable 2021-04-14 17:12:17 -07:00
ice_main.c ice: warn about potentially malicious VFs 2021-04-22 09:26:22 -07:00
ice_nvm.c ice: suppress false cppcheck issues 2021-04-14 17:12:17 -07:00
ice_nvm.h ice: display stored UNDI firmware version via devlink info 2021-02-05 11:44:16 -08:00
ice_osdep.h
ice_protocol_type.h ice: Add more advanced protocol support in flow filter 2021-03-22 11:32:12 -07:00
ice_sched.c ice: suppress false cppcheck issues 2021-04-14 17:12:17 -07:00
ice_sched.h ice: Use PSM clock frequency to calculate RL profiles 2021-02-08 16:27:01 -08:00
ice_sriov.c ice: warn about potentially malicious VFs 2021-04-22 09:26:22 -07:00
ice_sriov.h ice: warn about potentially malicious VFs 2021-04-22 09:26:22 -07:00
ice_status.h ice: display stored netlist versions via devlink info 2021-02-05 11:43:37 -08:00
ice_switch.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-04-09 20:48:35 -07:00
ice_switch.h
ice_txrx_lib.c ice: Fix fall-through warnings for Clang 2021-03-23 11:34:02 -07:00
ice_txrx_lib.h
ice_txrx.c ice: add correct exception tracing for XDP 2021-06-03 08:38:37 -07:00
ice_txrx.h ice: refactor ITR data structures 2021-04-14 17:00:06 -07:00
ice_type.h ice: warn about potentially malicious VFs 2021-04-22 09:26:22 -07:00
ice_virtchnl_allowlist.c ice: Enable RSS configure for AVF 2021-04-22 09:26:22 -07:00
ice_virtchnl_allowlist.h ice: Allow ignoring opcodes on specific VF 2021-04-22 09:26:22 -07:00
ice_virtchnl_fdir.c ice: Drop leading underscores in enum ice_pf_state 2021-04-14 17:00:05 -07:00
ice_virtchnl_fdir.h ice: Check FDIR program status for AVF 2021-03-22 11:32:12 -07:00
ice_virtchnl_pf.c ice: Support RSS configure removal for AVF 2021-04-22 09:26:22 -07:00
ice_virtchnl_pf.h ice: Allow ignoring opcodes on specific VF 2021-04-22 09:26:22 -07:00
ice_xsk.c ice: track AF_XDP ZC enabled queues in bitmap 2021-06-03 08:38:37 -07:00
ice_xsk.h xsk: i40e: ice: ixgbe: mlx5: Pass buffer pool to driver instead of umem 2020-08-31 21:15:03 +02:00
ice.h ice: track AF_XDP ZC enabled queues in bitmap 2021-06-03 08:38:37 -07:00
Makefile ice: Allow ignoring opcodes on specific VF 2021-04-22 09:26:22 -07:00