Skip to content

Commit

Permalink
Use all ports on module when tcvr id is specified
Browse files Browse the repository at this point in the history
Summary:
If we specify the transceiver ID, e.g.

```
sudo wedge_qsfp_util 20 --tx_disable
```
We currently will only operate on the first port on the module. If specifying the module ID, it seems like the intent would be to operate on the whole module, rather than just the first port on it.

This caused some issues in DNE testing: T202508655

Reviewed By: xanabani

Differential Revision: D63272105

fbshipit-source-id: dec878725e3d9a9e6dbcb8e69600d1488924f511
  • Loading branch information
Chet Powers authored and facebook-github-bot committed Sep 24, 2024
1 parent af9e703 commit 7efeea8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fboss/util/qsfp_util_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,14 @@ int main(int argc, char* argv[]) {
portNames.push_back(portStr);
} else {
portNum = folly::to<unsigned int>(argv[n]);
auto portName = wedgeManager->getPortName(TransceiverID(portNum - 1));
auto portName =
wedgeManager->getPortNames(TransceiverID(portNum - 1));
if (portName.empty()) {
throw FbossError(
"Couldn't find a portName for transceiverID (1-indexed):",
portNum);
}
portNames.push_back(portName);
portNames.insert(portNames.end(), portName.begin(), portName.end());
}
ports.push_back(portNum);
} catch (const std::exception& ex) {
Expand Down

0 comments on commit 7efeea8

Please sign in to comment.