Netdev List
 help / color / mirror / Atom feed
* [PATCH net v5 0/2] net/sched: cbs: fix 32-bit rate conversions and slope tearing
@ 2026-12-05  7:33 Jack Wang
  2026-12-05  7:33 ` [PATCH net v5 1/2] net/sched: cbs: use signed 64-bit math for BYTES_PER_KBIT conversions Jack Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jack Wang @ 2026-12-05  7:33 UTC (permalink / raw)
  To: vinicius.gomes, jhs, xiyou.wangcong, jiri, davem, edumazet, kuba,
	pabeni
  Cc: horms, victor, mhm.dawod, esalomatkina, andriy.shevchenko, netdev,
	linux-kernel

This series fixes two 32-bit issues in sch_cbs:

1. Perform BYTES_PER_KBIT rate/slope conversions in signed 64-bit
   arithmetic to restore software CBS shaping on ILP32 kernels.
2. Convert q->idleslope and q->sendslope to atomic64_t to prevent
   64-bit tearing on 32-bit kernels.

The separate 32-bit overflow in len * NSEC_PER_SEC in cbs_dequeue_soft()
is being addressed independently by Mohamed Dawod, and the pre-existing
watchdog busy-loop and timediff_to_credits() overflow will be handled in
a separate follow-up patch.

v5:
- Restore the problem description and user-visible regression details
  in patch 1, and scope its title to BYTES_PER_KBIT conversions.
- Split the atomic64_t conversion into patch 2 with its own Fixes: tag.

v4: https://lore.kernel.org/netdev/20261201085406.228-1-163wangjack@gmail.com/
- Drop the partial idleslope < 0 check (watchdog busy-loop will be
  fixed separately).
- Cast BYTES_PER_KBIT to s64 for signed 64-bit math on ILP32 and LP64.
- Convert idleslope/sendslope to atomic64_t to prevent 32-bit tearing.
- Update Fixes: tags, remove the blank line in the tag block, and drop
  v1 Acked-by due to the atomic64_t change.

v3: https://lore.kernel.org/netdev/20260813060256.28748-1-163wangjack@gmail.com/
- Reject only negative idleslope (keep 0 for tdc test 1820).
- Defer timediff_to_credits() overflow to a separate follow-up.

v2: https://lore.kernel.org/netdev/20260812080204.32373-1-163wangjack@gmail.com/
- Reject non-positive idleslope values.

v1: https://lore.kernel.org/netdev/20260806155253.50252-1-163wangjack@gmail.com/

Jack Wang (2):
  net/sched: cbs: use signed 64-bit math for BYTES_PER_KBIT conversions
  net/sched: cbs: use atomic64_t for idleslope and sendslope

 net/sched/sch_cbs.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)


base-commit: 7b53449540502cb21b32bca62a6258e22cd97bbe
-- 
2.53.0


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

end of thread, other threads:[~2026-12-05 11:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-05  7:33 [PATCH net v5 0/2] net/sched: cbs: fix 32-bit rate conversions and slope tearing Jack Wang
2026-12-05  7:33 ` [PATCH net v5 1/2] net/sched: cbs: use signed 64-bit math for BYTES_PER_KBIT conversions Jack Wang
2026-12-05 11:19   ` Andy Shevchenko
2026-12-05  7:33 ` [PATCH net v5 2/2] net/sched: cbs: use atomic64_t for idleslope and sendslope Jack Wang
2026-12-05 11:22   ` Andy Shevchenko
2026-12-05  7:38 ` [PATCH net v5 0/2] net/sched: cbs: fix 32-bit rate conversions and slope tearing netdev-bot+sinfo

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