Skip to content

Commit 923096b

Browse files
alobakinborkmann
authored andcommitted
ice: Remove two impossible branches on XDP Tx cleaning
The tagged commit started sending %XDP_TX frames from XSk Rx ring directly without converting it to an &xdp_frame. However, when XSk is enabled on a queue pair, it has its separate Tx cleaning functions, so neither ice_clean_xdp_irq() nor ice_unmap_and_free_tx_buf() ever happens there. Remove impossible branches in order to reduce the diffstat of the upcoming change. Fixes: a24b4c6 ("ice: xsk: Do not convert to buff to frame for XDP_TX") Suggested-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> Signed-off-by: Alexander Lobakin <alexandr.lobakin@intel.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> Link: https://lore.kernel.org/bpf/20230210170618.1973430-4-alexandr.lobakin@intel.com
1 parent 0bd939b commit 923096b

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,7 @@ ice_unmap_and_free_tx_buf(struct ice_tx_ring *ring, struct ice_tx_buf *tx_buf)
116116
if (tx_buf->tx_flags & ICE_TX_FLAGS_DUMMY_PKT) {
117117
devm_kfree(ring->dev, tx_buf->raw_buf);
118118
} else if (ice_ring_is_xdp(ring)) {
119-
if (ring->xsk_pool)
120-
xsk_buff_free(tx_buf->xdp);
121-
else
122-
page_frag_free(tx_buf->raw_buf);
119+
page_frag_free(tx_buf->raw_buf);
123120
} else {
124121
dev_kfree_skb_any(tx_buf->skb);
125122
}

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,7 @@ static u32 ice_clean_xdp_irq(struct ice_tx_ring *xdp_ring)
275275
ready_frames -= frags + 1;
276276
xdp_tx++;
277277

278-
if (xdp_ring->xsk_pool)
279-
xsk_buff_free(tx_buf->xdp);
280-
else
281-
ice_clean_xdp_tx_buf(xdp_ring, tx_buf);
278+
ice_clean_xdp_tx_buf(xdp_ring, tx_buf);
282279
ntc++;
283280
if (ntc == cnt)
284281
ntc = 0;

0 commit comments

Comments
 (0)