Skip to content

Commit 5c57e50

Browse files
mfijalkoanguy11
authored andcommitted
ice: skip NULL check against XDP prog in ZC path
Whole zero-copy variant of clean Rx IRQ is executed when xsk_pool is attached to rx_ring and it can happen only when XDP program is present on interface. Therefore it is safe to assume that program is always !NULL and there is no need for checking it in ice_run_xdp_zc. Reviewed-by: Björn Töpel <[email protected]> Signed-off-by: Maciej Fijalkowski <[email protected]> Tested-by: Kiran Bhandare <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 43a925e commit 5c57e50

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/net/ethernet/intel/ice/ice_xsk.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -467,11 +467,10 @@ ice_run_xdp_zc(struct ice_ring *rx_ring, struct xdp_buff *xdp)
467467
u32 act;
468468

469469
rcu_read_lock();
470+
/* ZC patch is enabled only when XDP program is set,
471+
* so here it can not be NULL
472+
*/
470473
xdp_prog = READ_ONCE(rx_ring->xdp_prog);
471-
if (!xdp_prog) {
472-
rcu_read_unlock();
473-
return ICE_XDP_PASS;
474-
}
475474

476475
act = bpf_prog_run_xdp(xdp_prog, xdp);
477476
switch (act) {

0 commit comments

Comments
 (0)