Skip to content

Commit d050342

Browse files
committed
[list-cards] Remove superfluous columns
1 parent 83f1718 commit d050342

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/CommandLineUtilities/ProgramListCards.cxx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ class ProgramListCards : public Program
5454
{
5555
std::ostringstream table;
5656

57-
auto formatHeader = " %-3s %-6s %-10s %-8s %-13s %-5s %-11s %-11s %-25s %-17s\n";
58-
auto formatRow = " %-3s %-6s %-10s %-8s %-13s %-5s 0x%-9s 0x%-9s %-25s %-17s\n";
59-
auto header = (boost::format(formatHeader) % "#" % "Type" % "PCI Addr" % "Serial" % "Endpoint ID" % "NUMA" % "Vendor ID" % "Device ID" % "FW Version" % "Card ID").str();
57+
auto formatHeader = " %-3s %-6s %-10s %-8s %-10s %-5s %-12s\n";
58+
auto formatRow = " %-3s %-6s %-10s %-8s %-10s %-5s %-12s\n";
59+
auto header = (boost::format(formatHeader) % "#" % "Type" % "PCI Addr" % "Serial" % "Endpoint" % "NUMA" % "FW Version").str();
6060
auto lineFat = std::string(header.length(), '=') + '\n';
6161
auto lineThin = std::string(header.length(), '-') + '\n';
6262

@@ -73,15 +73,13 @@ class ProgramListCards : public Program
7373
for (const auto& card : cardsFound) {
7474
const std::string na = "n/a";
7575
std::string firmware = na;
76-
std::string cardId = na;
7776
std::string numaNode = std::to_string(card.numaNode);
7877
try {
7978
Parameters params2 = Parameters::makeParameters(card.pciAddress, 2);
8079
auto bar2 = ChannelFactory().getBar(params2);
8180
firmware = bar2->getFirmwareInfo().value_or(na);
8281
// Check if the firmware is tagged
8382
firmware = FirmwareChecker().resolveFirmwareTag(firmware);
84-
cardId = bar2->getCardId().value_or(na);
8583
} catch (const Exception& e) {
8684
if (isVerbose()) {
8785
std::cout << "Error parsing card information through BAR\n"
@@ -93,8 +91,8 @@ class ProgramListCards : public Program
9391
std::string endpoint = std::to_string(card.serialId.getEndpoint());
9492

9593
if (!mOptions.jsonOut) {
96-
auto format = boost::format(formatRow) % i % CardType::toString(card.cardType) % card.pciAddress.toString() % serial % endpoint % card.numaNode % card.pciId.vendor % card.pciId.device %
97-
firmware % cardId;
94+
auto format = boost::format(formatRow) % i % CardType::toString(card.cardType) % card.pciAddress.toString() % serial %
95+
endpoint % card.numaNode % firmware;
9896

9997
table << format;
10098
std::cout << table.str();

src/FirmwareChecker.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ FirmwareChecker::FirmwareChecker() : mCompatibleFirmwareList({ /* CRU */
2525
{ "d458317e", "v3.5.2" },
2626
{ "6baf11da", "v3.5.1" },
2727
/* CRORC */
28-
{ "0", "alpha" } })
28+
{ "72cdb92", "v2.4.1" } })
2929
{
3030
}
3131

@@ -35,7 +35,7 @@ FirmwareChecker::~FirmwareChecker()
3535

3636
std::string FirmwareChecker::resolveFirmwareTag(std::string firmware)
3737
{
38-
firmware = firmware.substr(firmware.find_last_of("-") + 1);
38+
//firmware = firmware.substr(firmware.find_last_of("-") + 1);
3939
if (mCompatibleFirmwareList.find(firmware) != mCompatibleFirmwareList.end()) {
4040
return mCompatibleFirmwareList.at(firmware);
4141
} else {
@@ -55,7 +55,7 @@ std::string FirmwareChecker::getFirmwareCompatibilityList()
5555
void FirmwareChecker::checkFirmwareCompatibilityWrapped(std::shared_ptr<BarInterface> bar2)
5656
{
5757
auto firmware = bar2->getFirmwareInfo().value_or("");
58-
firmware = firmware.substr(firmware.find_last_of("-") + 1);
58+
//firmware = firmware.substr(firmware.find_last_of("-") + 1);
5959
auto serial = bar2->getSerial().value_or(-1);
6060
if (mCompatibleFirmwareList.find(firmware) == mCompatibleFirmwareList.end()) {
6161
BOOST_THROW_EXCEPTION(Exception() << ErrorInfo::Message(

0 commit comments

Comments
 (0)