Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

netif_utils: fix speeds > 65G #6

Merged
merged 1 commit into from
Oct 10, 2024
Merged

Conversation

KanjiMonster
Copy link
Collaborator

ethtool_cmd.speed is a 16 bit value, so the highest representable speed is 65.535 MB/s. For higher speeds, the upper bits are stored in cmd.speed_hi.

But since mstpd was only looking at speed, effectively the speed used was modulo 65536. This broke cost calculation, as a 200G link was now considered a 34.4G link, so its cost rose from expected 100 to 580.

Fix this by using the provided helper, ethtool_cmd_speed().

@KanjiMonster KanjiMonster requested a review from rubensfig October 9, 2024 09:40
ethtool_cmd.speed is a 16 bit value, so the highest representable speed
is 65.535 MB/s. For higher speeds, the upper bits are stored in
cmd.speed_hi.

But since mstpd was only looking at speed, effectively the speed used
was modulo 65536. This broke cost calculation, as a 200G link was now
considered a 34.4G link, so its cost rose from expected 100 to 580.

Fix this by using the provided helper, ethtool_cmd_speed().

Signed-off-by: Jonas Gorski <[email protected]>
@KanjiMonster KanjiMonster force-pushed the jogo_int_fix_hi_speed branch from 2ddbe40 to c5d42e2 Compare October 9, 2024 15:01
@rubensfig rubensfig merged commit 809b744 into 0.1.0+bisdn Oct 10, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants