The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] staging: octeon: schedule the TX cleanup tasklet every 1024th packet
@ 2026-08-20 11:32 Orgad Shaneh
  2026-08-20 18:48 ` Dan Carpenter
  0 siblings, 1 reply; 2+ messages in thread
From: Orgad Shaneh @ 2026-08-20 11:32 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, Orgad Shaneh

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@gmail.com>
---
 drivers/staging/octeon/ethernet-tx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/octeon/ethernet-tx.c b/drivers/staging/octeon/ethernet-tx.c
index cc20c1e6791..5e536827f87 100644
--- a/drivers/staging/octeon/ethernet-tx.c
+++ b/drivers/staging/octeon/ethernet-tx.c
@@ -481,7 +481,7 @@ netdev_tx_t cvm_oct_xmit(struct sk_buff *skb, struct net_device *dev)
 			cvmx_fau_fetch_and_add32(FAU_TOTAL_TX_TO_CLEAN, 1);
 	}
 
-	if (total_to_clean & 0x3ff) {
+	if ((total_to_clean & 0x3ff) == 0) {
 		/*
 		 * Schedule the cleanup tasklet every 1024 packets for
 		 * the pathological case of high traffic on one port
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging: octeon: schedule the TX cleanup tasklet every 1024th packet
  2026-08-20 11:32 [PATCH] staging: octeon: schedule the TX cleanup tasklet every 1024th packet Orgad Shaneh
@ 2026-08-20 18:48 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2026-08-20 18:48 UTC (permalink / raw)
  To: Orgad Shaneh; +Cc: gregkh, linux-staging, linux-kernel

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@gmail.com>
> ---

Reviewed-by: Dan Carpenter <error27@gmail.com>

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-08-20 18:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-20 11:32 [PATCH] staging: octeon: schedule the TX cleanup tasklet every 1024th packet Orgad Shaneh
2026-08-20 18:48 ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox