Skip to content

Commit 94c06b7

Browse files
authored
Merge pull request #425 from sy-c/master
v0.45.5
2 parents 53c5c81 + 3fd3fdc commit 94c06b7

File tree

4 files changed

+43
-3
lines changed

4 files changed

+43
-3
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,14 @@ It may use files in these directories for DMA buffers:
378378
The program will report the exact file used.
379379
They can be inspected manually if needed, e.g. with hexdump: `hexdump -e '"%07_ax" " | " 4/8 "%08x " "\n"' [filename]`
380380
381+
Example usage:
382+
```
383+
for i in 0 1; do roc-config --i=#$i --clock=local --links=0-1 --tf=32 --byp --loop --dyn --force --datapathmode=streaming; done
384+
roc-bench-dma --i=#0 --fast --data=FEE --bypass
385+
o2-roc-ctp-emulator --id=#0 --trigger-mode=continuous --init-orbit=0x1e
386+
```
387+
388+
381389
### roc-cleanup
382390
In the event of a serious crash, such as a segfault, it may be necessary to clean up and reset.
383391
This tool serves this purpose and is intended to be run as root. Be aware that this will make every

doc/releaseNotes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,6 @@ This file describes the main feature changes for released versions of ReadoutCar
8484

8585
## v0.45.4 - 26/09/2024
8686
- Updated list of firmwares.
87+
88+
## v0.45.5 - 19/12/2024
89+
- Added internal fallback when hugeadm tool not available to setup hugepages (e.g.for RHEL9).

src/ReadoutCardVersion.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#include "ReadoutCard/Version.h"
1313

14-
#define O2_READOUTCARD_VERSION "0.45.3"
14+
#define O2_READOUTCARD_VERSION "0.45.5"
1515

1616
namespace o2
1717
{

src/o2-roc-setup-hugetlbfs.sh

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ HUGEPAGES_1G_SYSFILE=/sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages
1313
HUGEPAGES_1G_NUMBER=6
1414

1515

16+
which hugeadm
17+
if [ "$?" == "0" ]; then
18+
FOUND_HUGEADM=1
19+
else
20+
echo "hugeadm command not found, using internal fallback"
21+
fi
22+
1623
# Allocate hugepages of each type
1724
echo -n "File '${HUGEPAGES_2M_CONF}' "
1825
if [ -f $HUGEPAGES_2M_CONF ]; then
@@ -34,15 +41,37 @@ echo $HUGEPAGES_1G_NUMBER > $HUGEPAGES_1G_SYSFILE
3441

3542
# Create hugetlbfs mounts in /var/lib/hugetlbfs/global/...
3643
echo "Creating hugetlbfs mounts"
37-
hugeadm --create-global-mounts
44+
if [ "$FOUND_HUGEADM" == "1" ]; then
45+
hugeadm --create-global-mounts
46+
else
47+
for sz in 2M 1G; do
48+
MPDIR=/var/lib/hugetlbfs/global/pagesize-${sz}B
49+
mountpoint -q $MPDIR
50+
if [ "$?" -ne 0 ]; then
51+
echo "Mounting $MPDIR"
52+
mount -t hugetlbfs -o pagesize=${sz} none $MPDIR
53+
chown root:root $MPDIR
54+
chmod 1777 $MPDIR
55+
else
56+
echo "Already mounted: $MPDIR"
57+
fi
58+
done
59+
fi
3860
echo "Setting permissions on hugeltbfs mounts"
3961
chgrp -R pda /var/lib/hugetlbfs/global/*
4062
chmod -R g+rwx /var/lib/hugetlbfs/global/*
4163

4264
# Display hugepage status
4365
echo ""
4466
echo "Hugepages:"
45-
hugeadm --pool-list
67+
if [ "$FOUND_HUGEADM" == "1" ]; then
68+
hugeadm --pool-list
69+
else
70+
echo -n "Number of 2MB hugepages: "
71+
cat $HUGEPAGES_2M_SYSFILE
72+
echo -n "Number of 1GB hugepages: "
73+
cat $HUGEPAGES_1G_SYSFILE
74+
fi
4675
echo ""
4776
echo "Use 'echo [number] > /sys/kernel/mm/hugepages/hugepages-[size]/nr_hugepages' to allocate hugepages manually"
4877
echo "Or set a number in the following conf files and run the script again:"

0 commit comments

Comments
 (0)