-
Notifications
You must be signed in to change notification settings - Fork 25
Ethernet: Added force link speed on eth interface via ethtool #222
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,11 +37,32 @@ rm -f "$res_file" "$summary_file" | |
| log_info "--------------------------------------------------------------------------" | ||
| log_info "-------------------Starting $TESTNAME Testcase----------------------------" | ||
|
|
||
| # CLI parsing: --interface/-i, --speed/-s | ||
| user_iface="" | ||
| speed="" | ||
|
|
||
| while [ $# -gt 0 ]; do | ||
| case "$1" in | ||
| --interface|-i) | ||
| user_iface="$2" | ||
| shift 2 | ||
| ;; | ||
| --speed|-s) | ||
vnarapar marked this conversation as resolved.
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm considering how a user would know which port speed to provide. Wouldn't it be better to fetch the information from ethtool and set the speed based on the model, instead of letting the user choose? |
||
| speed="$2" | ||
| shift 2 | ||
| ;; | ||
| *) | ||
| log_warn "Unknown argument: $1 (ignoring)" | ||
| shift 1 | ||
| ;; | ||
| esac | ||
| done | ||
|
|
||
| [ -z "$speed" ] && speed=1000 | ||
|
|
||
| # Check for dependencies | ||
| check_dependencies ip ping | ||
|
|
||
| # User-specified interface (argument) or all detected | ||
| user_iface="$1" | ||
| if [ -n "$user_iface" ]; then | ||
| ETH_IFACES="$user_iface" | ||
| log_info "User specified interface: $user_iface" | ||
|
|
@@ -62,6 +83,15 @@ any_tested=0 | |
|
|
||
| for iface in $ETH_IFACES; do | ||
| log_info "---- Testing interface: $iface ----" | ||
| model=$(get_machine_model) | ||
|
|
||
| if [ "$model" = "Monaco EVK" ] || [ "$model" = "Lemans EVK" ] || [ "$model" = "Lemans Ride Rev3" ] || [ "$model" = "QCS8300 Ride" ] || [ "$model" = "Robotics RB3gen2" ]; then | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can this be made more generic instead of being specific to SoC? |
||
| log_info "Setting MAC-PHY speed to $speed for $model" | ||
| ethtool -s "$iface" speed "$speed" autoneg off duplex full | ||
| sleep 5 | ||
| else | ||
| log_info "Skipping force speed; model is '$model'" | ||
| fi | ||
|
|
||
| if ! is_interface_up "$iface"; then | ||
| log_warn "$iface is DOWN, skipping" | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.