From 04747cf219a7f0e539cb83f74dc9c369ac9c9ba8 Mon Sep 17 00:00:00 2001 From: Sylvain Chapeland Date: Thu, 19 Dec 2024 09:26:27 +0100 Subject: [PATCH 1/3] added bench-dma example --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 807f33b2..c0e222a7 100644 --- a/README.md +++ b/README.md @@ -378,6 +378,14 @@ It may use files in these directories for DMA buffers: The program will report the exact file used. They can be inspected manually if needed, e.g. with hexdump: `hexdump -e '"%07_ax" " | " 4/8 "%08x " "\n"' [filename]` +Example usage: +``` +for i in 0 1; do roc-config --i=#$i --clock=local --links=0-1 --tf=32 --byp --loop --dyn --force --datapathmode=streaming; done +roc-bench-dma --i=#0 --fast --data=FEE --bypass +o2-roc-ctp-emulator --id=#0 --trigger-mode=continuous --init-orbit=0x1e +``` + + ### roc-cleanup In the event of a serious crash, such as a segfault, it may be necessary to clean up and reset. This tool serves this purpose and is intended to be run as root. Be aware that this will make every From 6c4f342d2ddd670cc802b936b6d95e6c38e275c8 Mon Sep 17 00:00:00 2001 From: Sylvain Chapeland Date: Thu, 19 Dec 2024 09:53:30 +0100 Subject: [PATCH 2/3] internal fallback when hugeadm / libhugetlbfs not found --- src/o2-roc-setup-hugetlbfs.sh | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/src/o2-roc-setup-hugetlbfs.sh b/src/o2-roc-setup-hugetlbfs.sh index 5a34429a..e98f46e3 100755 --- a/src/o2-roc-setup-hugetlbfs.sh +++ b/src/o2-roc-setup-hugetlbfs.sh @@ -13,6 +13,13 @@ HUGEPAGES_1G_SYSFILE=/sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages HUGEPAGES_1G_NUMBER=6 +which hugeadm +if [ "$?" == "0" ]; then + FOUND_HUGEADM=1 +else + echo "hugeadm command not found, using internal fallback" +fi + # Allocate hugepages of each type echo -n "File '${HUGEPAGES_2M_CONF}' " if [ -f $HUGEPAGES_2M_CONF ]; then @@ -34,7 +41,22 @@ echo $HUGEPAGES_1G_NUMBER > $HUGEPAGES_1G_SYSFILE # Create hugetlbfs mounts in /var/lib/hugetlbfs/global/... echo "Creating hugetlbfs mounts" -hugeadm --create-global-mounts +if [ "$FOUND_HUGEADM" == "1" ]; then + hugeadm --create-global-mounts +else + for sz in 2M 1G; do + MPDIR=/var/lib/hugetlbfs/global/pagesize-${sz}B + mountpoint -q $MPDIR + if [ "$?" -ne 0 ]; then + echo "Mounting $MPDIR" + mount -t hugetlbfs -o pagesize=${sz} none $MPDIR + chown root:root $MPDIR + chmod 1777 $MPDIR + else + echo "Already mounted: $MPDIR" + fi + done +fi echo "Setting permissions on hugeltbfs mounts" chgrp -R pda /var/lib/hugetlbfs/global/* chmod -R g+rwx /var/lib/hugetlbfs/global/* @@ -42,7 +64,14 @@ chmod -R g+rwx /var/lib/hugetlbfs/global/* # Display hugepage status echo "" echo "Hugepages:" -hugeadm --pool-list +if [ "$FOUND_HUGEADM" == "1" ]; then + hugeadm --pool-list +else + echo -n "Number of 2MB hugepages: " + cat $HUGEPAGES_2M_SYSFILE + echo -n "Number of 1GB hugepages: " + cat $HUGEPAGES_1G_SYSFILE +fi echo "" echo "Use 'echo [number] > /sys/kernel/mm/hugepages/hugepages-[size]/nr_hugepages' to allocate hugepages manually" echo "Or set a number in the following conf files and run the script again:" From bc422d395bc8e5fc4cbe17fe7709b9c368c82748 Mon Sep 17 00:00:00 2001 From: Sylvain Chapeland Date: Thu, 19 Dec 2024 14:04:15 +0100 Subject: [PATCH 3/3] v0.45.4 --- doc/releaseNotes.md | 3 +++ src/ReadoutCardVersion.cxx | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/releaseNotes.md b/doc/releaseNotes.md index 8621de24..780233f7 100644 --- a/doc/releaseNotes.md +++ b/doc/releaseNotes.md @@ -84,3 +84,6 @@ This file describes the main feature changes for released versions of ReadoutCar ## v0.45.4 - 26/09/2024 - Updated list of firmwares. + +## v0.45.5 - 19/12/2024 +- Added internal fallback when hugeadm tool not available to setup hugepages (e.g.for RHEL9). diff --git a/src/ReadoutCardVersion.cxx b/src/ReadoutCardVersion.cxx index 296f7b1c..ddedddb4 100644 --- a/src/ReadoutCardVersion.cxx +++ b/src/ReadoutCardVersion.cxx @@ -11,7 +11,7 @@ #include "ReadoutCard/Version.h" -#define O2_READOUTCARD_VERSION "0.45.3" +#define O2_READOUTCARD_VERSION "0.45.5" namespace o2 {