ixgbe: fix AF_XDP tx byte count
Subsystems (3)
PATCH 1/2 ixgbe: fix AF_XDP tx byte count
The tx bytecount is done twice. When running './xdpsock -t -N -i eth3' and 'ip -s link show dev eth3' The avg packet size is 120 instead of 60. So remove the extra one.
--- drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c +0 -1
@@ -704,7 +704,6 @@ bool ixgbe_clean_xdp_tx_irq(struct ixgbe_q_vector *q_vector, xsk_frames++; tx_bi->xdpf =NULL ; - total_bytes += tx_bi->bytecount; tx_bi++; tx_desc++;
Signature · 1 line
2.7.4
PATCH 2/2 ixgbe: fix AF_XDP tx packet count.
The total_packets count at ixgbe_clean_xdp_tx_irq is always zero when testing with xdpsock -t -N. Set the gso_segs to 1 to make the tx packet count correct.
--- drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c +1 -0
@@ -640,6 +640,7 @@ static bool ixgbe_xmit_zc(struct ixgbe_ring *xdp_ring, unsigned int budget) tx_bi = &xdp_ring->tx_buffer_info[xdp_ring->next_to_use]; tx_bi->bytecount = len; tx_bi->xdpf =NULL ; + tx_bi->gso_segs =1 ; tx_desc =IXGBE_TX_DESC (xdp_ring, xdp_ring->next_to_use); tx_desc->read.buffer_addr =cpu_to_le64 (dma);
Signature · 1 line
2.7.4
[ +Jeff ]
Given these two are contained to ixgbe, I presume Jeff wants to pick these up instead via his tree?
Quoted 23 lines · William Tu
The tx bytecount is done twice. When running './xdpsock -t -N -i eth3' and 'ip -s link show dev eth3' The avg packet size is 120 instead of 60. So remove the extra one.
Signed-off-by William Tu <[email protected]>--- drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c | 1 - 1 file changed, 1 deletion(-)drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c +0
-1@@ -704,7 +704,6 @@ bool ixgbe_clean_xdp_tx_irq(struct ixgbe_q_vector *q_vector, xsk_frames++; tx_bi->xdpf =NULL ; - total_bytes += tx_bi->bytecount; tx_bi++; tx_desc++;
Quoted 8 lines · Daniel Borkmann
[ +Jeff ]
Given these two are contained to ixgbe, I presume Jeff wants to pick these up instead via his tree?
Yes, I will be picking them up.
Quoted 26 lines
Quoted 25 lines · William Tu
The tx bytecount is done twice. When running './xdpsock -t -N -i eth3' and 'ip -s link show dev eth3' The avg packet size is 120 instead of 60. So remove the extra one.
Signed-off-by William Tu <[email protected]>---
drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c| 1 -1 file changed, 1 deletion(-)drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c +0
-1@@ -704,7 +704,6 @@ bool ixgbe_clean_xdp_tx_irq(struct ixgbe_q_vector *q_vector, xsk_frames++; tx_bi->xdpf =NULL ; - total_bytes += tx_bi->bytecount; tx_bi++; tx_desc++;