struct ice_tx_desc *tx_desc;
        u16 cnt = xdp_ring->count;
        struct ice_tx_buf *tx_buf;
+       u16 completed_frames = 0;
        u16 xsk_frames = 0;
        u16 last_rs;
        int i;
        if ((tx_desc->cmd_type_offset_bsz &
            cpu_to_le64(ICE_TX_DESC_DTYPE_DESC_DONE))) {
                if (last_rs >= ntc)
-                       xsk_frames = last_rs - ntc + 1;
+                       completed_frames = last_rs - ntc + 1;
                else
-                       xsk_frames = last_rs + cnt - ntc + 1;
+                       completed_frames = last_rs + cnt - ntc + 1;
        }
 
-       if (!xsk_frames)
+       if (!completed_frames)
                return;
 
-       if (likely(!xdp_ring->xdp_tx_active))
+       if (likely(!xdp_ring->xdp_tx_active)) {
+               xsk_frames = completed_frames;
                goto skip;
+       }
 
        ntc = xdp_ring->next_to_clean;
-       for (i = 0; i < xsk_frames; i++) {
+       for (i = 0; i < completed_frames; i++) {
                tx_buf = &xdp_ring->tx_buf[ntc];
 
                if (tx_buf->raw_buf) {
        }
 skip:
        tx_desc->cmd_type_offset_bsz = 0;
-       xdp_ring->next_to_clean += xsk_frames;
+       xdp_ring->next_to_clean += completed_frames;
        if (xdp_ring->next_to_clean >= cnt)
                xdp_ring->next_to_clean -= cnt;
        if (xsk_frames)