Skip to content

Commit e5df0fd

Browse files
magnus-karlssonkernel-patches-bot
authored andcommitted
i40e: remove unnecessary sw_ring access from xsk Tx
Remove the unnecessary access to the software ring for the AF_XDP zero-copy driver. This was used to record the length of the packet so that the driver Tx completion code could sum this up to produce the total bytes sent. This is now performed during the transmission of the packet, so no need to record this in the software ring. Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com> Acked-by: John Fastabend <john.fastabend@gmail.com>
1 parent c429d72 commit e5df0fd

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

drivers/net/ethernet/intel/i40e/i40e_xsk.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,6 @@ static bool i40e_xmit_zc(struct i40e_ring *xdp_ring, unsigned int budget)
392392
{
393393
unsigned int sent_frames = 0, total_bytes = 0;
394394
struct i40e_tx_desc *tx_desc = NULL;
395-
struct i40e_tx_buffer *tx_bi;
396395
struct xdp_desc desc;
397396
dma_addr_t dma;
398397

@@ -404,9 +403,6 @@ static bool i40e_xmit_zc(struct i40e_ring *xdp_ring, unsigned int budget)
404403
xsk_buff_raw_dma_sync_for_device(xdp_ring->xsk_pool, dma,
405404
desc.len);
406405

407-
tx_bi = &xdp_ring->tx_bi[xdp_ring->next_to_use];
408-
tx_bi->bytecount = desc.len;
409-
410406
tx_desc = I40E_TX_DESC(xdp_ring, xdp_ring->next_to_use);
411407
tx_desc->buffer_addr = cpu_to_le64(dma);
412408
tx_desc->cmd_type_offset_bsz =
@@ -415,7 +411,7 @@ static bool i40e_xmit_zc(struct i40e_ring *xdp_ring, unsigned int budget)
415411
0, desc.len, 0);
416412

417413
sent_frames++;
418-
total_bytes += tx_bi->bytecount;
414+
total_bytes += desc.len;
419415

420416
xdp_ring->next_to_use++;
421417
if (xdp_ring->next_to_use == xdp_ring->count)

0 commit comments

Comments
 (0)