Aggregate LNet counters across multiple EFA interfaces in mount_fsx.sh - #1203
Open
davidk-mir wants to merge 1 commit into
Open
Aggregate LNet counters across multiple EFA interfaces in mount_fsx.sh#1203davidk-mir wants to merge 1 commit into
davidk-mir wants to merge 1 commit into
Conversation
…transport
verify_efa_transport() reads send_count/recv_count from `lnetctl net show
-v --net efa` with `awk '/send_count:/ {print $2}'` and compares the
before/after values with `[[ "$send_after" -le "$send_before" ]]`.
On an instance with a single EFA interface this prints one line and the
comparison works. On instances with multiple EFA interfaces (e.g. p5/p6
families expose more than one EFA device), `lnetctl net show -v --net
efa` reports one send_count/recv_count line per interface, so the awk
pipeline emits a newline-separated list of numbers instead of a single
integer. The subsequent `[[ ... -le ... ]]` integer comparison then fails
with "integer expression expected", and verify_efa_transport aborts with
a bash error instead of actually verifying whether traffic is flowing
over EFA — on exactly the instance types most likely to use it.
Fix by summing the per-interface counters in awk (`{sum += $2} END
{print sum + 0}`) so the comparison always receives a single integer,
regardless of how many EFA interfaces the instance exposes.
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Relates to #989, which added the EFA transport verification to
mount_fsx.sh.verify_efa_transport()reads LNet counters withawk '/send_count:/ {print $2}'.lnetctl net show -v --net efaprints onesend_count:/recv_count:line per EFA interface, so on instances with more than one EFA interface the pipeline emits a newline-separated list of numbers instead of a single integer. The subsequent[[ "$send_after" -le "$send_before" ]]comparison then fails with a bash "integer expression expected" error, aborting the verification (and, via theERRtrap, the lifecycle script) — on exactly the instance families most likely to use EFA.Changes
awk({sum += $2} END {print sum + 0}) for the before/aftersend_countandrecv_countreads, so the comparison always receives a single integer regardless of how many EFA interfaces the instance exposes.sum + 0prints0rather than an empty string when no lines match, preserving the existing comparison semantics.Test Plan
Environment:
Test commands:
Test Results
verify_efa_transport()aborts withinteger expression expected— the awk pipeline emits one value per interface as a newline-separated list.Checklist
mainbranch.latest). (N/A — no dependencies added)By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.