aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/igc
diff options
context:
space:
mode:
authorZdenek Bouska <[email protected]>2025-03-19 14:18:48 +0000
committerTony Nguyen <[email protected]>2025-04-02 15:51:41 +0000
commitd931cf9b38da0f533cacfe51c863a9912e67822f (patch)
tree7bdae1cf88ef5e7356fd607855ccd1958c71c814 /drivers/net/ethernet/intel/igc
parentigc: Fix XSK queue NAPI ID mapping (diff)
downloadkernel-d931cf9b38da0f533cacfe51c863a9912e67822f.tar.gz
kernel-d931cf9b38da0f533cacfe51c863a9912e67822f.zip
igc: Fix TX drops in XDP ZC
Fixes TX frame drops in AF_XDP zero copy mode when budget < 4. xsk_tx_peek_desc() consumed TX frame and it was ignored because of low budget. Not even AF_XDP completion was done for dropped frames. It can be reproduced on i226 by sending 100000x 60 B frames with launch time set to minimal IPG (672 ns between starts of frames) on 1Gbit/s. Always 1026 frames are not sent and are missing a completion. Fixes: 9acf59a752d4c ("igc: Enable TX via AF_XDP zero-copy") Signed-off-by: Zdenek Bouska <[email protected]> Reviewed-by: Song Yoong Siang <[email protected]> Reviewed-by: Florian Bezdeka <[email protected]> Tested-by: Mor Bar-Gabay <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
Diffstat (limited to 'drivers/net/ethernet/intel/igc')
-rw-r--r--drivers/net/ethernet/intel/igc/igc_main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 27c99ff59ed4..156d123c0e21 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -3042,7 +3042,7 @@ static void igc_xdp_xmit_zc(struct igc_ring *ring)
* descriptors. Therefore, to be safe, we always ensure we have at least
* 4 descriptors available.
*/
- while (xsk_tx_peek_desc(pool, &xdp_desc) && budget >= 4) {
+ while (budget >= 4 && xsk_tx_peek_desc(pool, &xdp_desc)) {
struct igc_metadata_request meta_req;
struct xsk_tx_metadata *meta = NULL;
struct igc_tx_buffer *bi;