Skip to content

Commit fbf5644

Browse files
committed
changed source of NUMA node info for ROC cards, fixes wrong value reported
1 parent 20da230 commit fbf5644

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

doc/releaseNotes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,6 @@ This file describes the main feature changes for released versions of ReadoutCar
7070
## v0.45.0 - 03/10/2023
7171
- o2-roc-pat-player: options have changed to match the [latest firmware conventions](https://gitlab.cern.ch/alice-cru/cru-fw/-/tree/pplayer/TTC#address-table). Values can specified as decimal or hexadecimal numbers.
7272
- Added support for pattern-player configuration parsing (used by ALF).
73+
74+
## next
75+
- o2-roc-list-cards: get NUMA card info from system instead of PDA PciDevice_getNumaNode() function, which reports wrong node for RH8. Fix also applies to field in RocPciDevice internal class.

src/RocPciDevice.cxx

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "ReadoutCard/ChannelFactory.h"
3030
#include "ReadoutCard/Exception.h"
3131
#include "ReadoutCard/Parameters.h"
32+
#include "Utilities/Numa.h"
3233

3334
namespace o2
3435
{
@@ -91,6 +92,17 @@ RocPciDevice::~RocPciDevice()
9192
{
9293
}
9394

95+
int getNumaNodeSafe(PciDevice* pciDevice) {
96+
int numaNode = -1;
97+
try {
98+
numaNode = o2::roc::Utilities::getNumaNode(addressFromDevice(pciDevice));
99+
}
100+
catch(...) {
101+
printf("getnumanode failed\n");
102+
}
103+
return numaNode;
104+
}
105+
94106
void RocPciDevice::initWithSerialId(const SerialId& serialId)
95107
{
96108
int sequenceCounter = 0;
@@ -115,7 +127,7 @@ void RocPciDevice::initWithSerialId(const SerialId& serialId)
115127

116128
if (serial == serialId.getSerial() && endpoint == serialId.getEndpoint()) {
117129
mPciDevice = pciDevice;
118-
mDescriptor = CardDescriptor{ type.cardType, serialId, type.pciId, addressFromDevice(pciDevice), PciDevice_getNumaNode(pciDevice), sequenceCounter };
130+
mDescriptor = CardDescriptor{ type.cardType, serialId, type.pciId, addressFromDevice(pciDevice), getNumaNodeSafe(pciDevice), sequenceCounter };
119131
return;
120132
}
121133
sequenceCounter++;
@@ -151,7 +163,7 @@ void RocPciDevice::initWithAddress(const PciAddress& address)
151163
endpoint = type.getEndpoint(mPdaBar0);
152164

153165
mPciDevice = pciDevice;
154-
mDescriptor = CardDescriptor{ type.cardType, SerialId{ serial, endpoint }, type.pciId, address, PciDevice_getNumaNode(pciDevice), sequenceCounter };
166+
mDescriptor = CardDescriptor{ type.cardType, SerialId{ serial, endpoint }, type.pciId, address, getNumaNodeSafe(pciDevice), sequenceCounter };
155167
return;
156168
}
157169
sequenceCounter++;
@@ -187,7 +199,7 @@ void RocPciDevice::initWithSequenceNumber(const PciSequenceNumber& sequenceNumbe
187199
endpoint = type.getEndpoint(mPdaBar0);
188200

189201
mPciDevice = pciDevice;
190-
mDescriptor = CardDescriptor{ type.cardType, SerialId{ serial, endpoint }, type.pciId, addressFromDevice(pciDevice), PciDevice_getNumaNode(pciDevice), sequenceCounter };
202+
mDescriptor = CardDescriptor{ type.cardType, SerialId{ serial, endpoint }, type.pciId, addressFromDevice(pciDevice), getNumaNodeSafe(pciDevice), sequenceCounter };
191203
return;
192204
}
193205
sequenceCounter++;
@@ -225,7 +237,7 @@ std::vector<CardDescriptor> RocPciDevice::findSystemDevices()
225237
endpoint = type.getEndpoint(pdaBar0);
226238

227239
try {
228-
cards.push_back(CardDescriptor{ type.cardType, SerialId{ serial, endpoint }, type.pciId, addressFromDevice(pciDevice), PciDevice_getNumaNode(pciDevice), sequenceCounter });
240+
cards.push_back(CardDescriptor{ type.cardType, SerialId{ serial, endpoint }, type.pciId, addressFromDevice(pciDevice), getNumaNodeSafe(pciDevice), sequenceCounter });
229241
} catch (boost::exception& e) {
230242
std::cout << boost::diagnostic_information(e);
231243
}

0 commit comments

Comments
 (0)