Skip to content

Commit

Permalink
Merge pull request #421 from sy-c/master
Browse files Browse the repository at this point in the history
v0.45.1
  • Loading branch information
sy-c authored Jan 24, 2024
2 parents 20da230 + 87a244d commit 7bf9e5f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
3 changes: 3 additions & 0 deletions doc/releaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,6 @@ This file describes the main feature changes for released versions of ReadoutCar
## v0.45.0 - 03/10/2023
- 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.
- Added support for pattern-player configuration parsing (used by ALF).

## v0.45.1 - 24/01/2024
- 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.
2 changes: 1 addition & 1 deletion src/ReadoutCardVersion.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include "ReadoutCard/Version.h"

#define O2_READOUTCARD_VERSION "0.45.0"
#define O2_READOUTCARD_VERSION "0.45.1"

namespace o2
{
Expand Down
20 changes: 16 additions & 4 deletions src/RocPciDevice.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "ReadoutCard/ChannelFactory.h"
#include "ReadoutCard/Exception.h"
#include "ReadoutCard/Parameters.h"
#include "Utilities/Numa.h"

namespace o2
{
Expand Down Expand Up @@ -91,6 +92,17 @@ RocPciDevice::~RocPciDevice()
{
}

int getNumaNodeSafe(PciDevice* pciDevice) {
int numaNode = -1;
try {
numaNode = o2::roc::Utilities::getNumaNode(addressFromDevice(pciDevice));
}
catch(...) {
printf("getnumanode failed\n");
}
return numaNode;
}

void RocPciDevice::initWithSerialId(const SerialId& serialId)
{
int sequenceCounter = 0;
Expand All @@ -115,7 +127,7 @@ void RocPciDevice::initWithSerialId(const SerialId& serialId)

if (serial == serialId.getSerial() && endpoint == serialId.getEndpoint()) {
mPciDevice = pciDevice;
mDescriptor = CardDescriptor{ type.cardType, serialId, type.pciId, addressFromDevice(pciDevice), PciDevice_getNumaNode(pciDevice), sequenceCounter };
mDescriptor = CardDescriptor{ type.cardType, serialId, type.pciId, addressFromDevice(pciDevice), getNumaNodeSafe(pciDevice), sequenceCounter };
return;
}
sequenceCounter++;
Expand Down Expand Up @@ -151,7 +163,7 @@ void RocPciDevice::initWithAddress(const PciAddress& address)
endpoint = type.getEndpoint(mPdaBar0);

mPciDevice = pciDevice;
mDescriptor = CardDescriptor{ type.cardType, SerialId{ serial, endpoint }, type.pciId, address, PciDevice_getNumaNode(pciDevice), sequenceCounter };
mDescriptor = CardDescriptor{ type.cardType, SerialId{ serial, endpoint }, type.pciId, address, getNumaNodeSafe(pciDevice), sequenceCounter };
return;
}
sequenceCounter++;
Expand Down Expand Up @@ -187,7 +199,7 @@ void RocPciDevice::initWithSequenceNumber(const PciSequenceNumber& sequenceNumbe
endpoint = type.getEndpoint(mPdaBar0);

mPciDevice = pciDevice;
mDescriptor = CardDescriptor{ type.cardType, SerialId{ serial, endpoint }, type.pciId, addressFromDevice(pciDevice), PciDevice_getNumaNode(pciDevice), sequenceCounter };
mDescriptor = CardDescriptor{ type.cardType, SerialId{ serial, endpoint }, type.pciId, addressFromDevice(pciDevice), getNumaNodeSafe(pciDevice), sequenceCounter };
return;
}
sequenceCounter++;
Expand Down Expand Up @@ -225,7 +237,7 @@ std::vector<CardDescriptor> RocPciDevice::findSystemDevices()
endpoint = type.getEndpoint(pdaBar0);

try {
cards.push_back(CardDescriptor{ type.cardType, SerialId{ serial, endpoint }, type.pciId, addressFromDevice(pciDevice), PciDevice_getNumaNode(pciDevice), sequenceCounter });
cards.push_back(CardDescriptor{ type.cardType, SerialId{ serial, endpoint }, type.pciId, addressFromDevice(pciDevice), getNumaNodeSafe(pciDevice), sequenceCounter });
} catch (boost::exception& e) {
std::cout << boost::diagnostic_information(e);
}
Expand Down

0 comments on commit 7bf9e5f

Please sign in to comment.