Skip to contentSkip to conversation

ixgbe: fix AF_XDP tx byte count

PATCH New Jeff Kirsher 2 participants 4 messages Apr 4, 2019 – Apr 8, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ixgbe: fix AF_XDP tx byte count

From: William Tu <[email protected]>

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
index bfe95ce0bd7f..71b8474a9b4c 100644
@@ -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++;
#1 lore raw

PATCH 2/2 ixgbe: fix AF_XDP tx packet count.

From: William Tu <[email protected]>

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
index 71b8474a9b4c..1a60764fb39b 100644
@@ -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);
#2 lore raw

PATCH 2/2 ixgbe: fix AF_XDP tx packet count.

Quoted 10 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Jeff Kirsher
Sent: Thursday, April 4, 2019 9:37 AM
To: intel-wired-lan at lists.osuosl.org
Cc: William Tu <[email protected]>
Subject: [Intel-wired-lan] [2/2] ixgbe: fix AF_XDP tx packet count.

From: William Tu <[email protected]>

Quoted 8 lines

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(+)
#3 lore raw

PATCH 1/2 ixgbe: fix AF_XDP tx byte count

In reply to Jeff Kirsher
Quoted 10 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Jeff Kirsher
Sent: Thursday, April 4, 2019 9:37 AM
To: intel-wired-lan at lists.osuosl.org
Cc: William Tu <[email protected]>
Subject: [Intel-wired-lan] [1/2] ixgbe: fix AF_XDP tx byte count

From: William Tu <[email protected]>

Quoted 8 lines

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(-)