Re: [PATCH] staging: octeon: schedule the TX cleanup tasklet every 1024th packet
From: Dan Carpenter
Date: Thu Aug 20 2026 - 14:53:48 EST
On Thu, Aug 20, 2026 at 02:32:39PM +0300, Orgad Shaneh wrote:
> cvm_oct_xmit() means to schedule the cleanup tasklet once every 1024
> packets, as its comment says, to cover the pathological case of heavy
> traffic on one port delaying the cleanup of another port blocked
> waiting for it.
>
> The test is inverted: total_to_clean & 0x3ff is true for 1023 of every
> 1024 values, and false only on the multiples of 1024. So the tasklet is
> scheduled on nearly every packet, and skipped on exactly the packet the
> comment wants. That costs one TASKLET softirq per transmitted packet,
> each walking every port and doing an FAU fetch-and-add per non-empty
> queue, and it buys nothing for this port, which already frees its
> completed skbs inline from the skb_to_free value it reads out of the
> FAU.
>
> Test the mask against zero. On a CN50XX board (2 cores at 300MHz)
> carrying ~6.9k transmitted packets/s, TASKLET softirqs drop from 7133/s
> to 597/s with no throughput change; the freeing work is conserved, so
> this removes softirq entries, not work.
>
> Fixes: 4898c560103f ("Staging: Octeon: Free transmit SKBs in a timely manner")
> Signed-off-by: Orgad Shaneh <orgads@xxxxxxxxx>
> ---
Reviewed-by: Dan Carpenter <error27@xxxxxxxxx>
regards,
dan carpenter