summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJerin Jacob <jerin.jacob@caviumnetworks.com>2016-03-14 17:45:31 +0530
committerThomas Monjalon <thomas.monjalon@6wind.com>2016-03-24 22:04:10 +0100
commit080358a3155b73dd00f5abe8290c6e84e595b03b (patch)
treeaba0925eca80ab81a39a5b521fb2905c3b6d68af /tools
parentb610787fb93c09a20b04fd917f2fa3299cd6ce67 (diff)
downloaddpdk-080358a3155b73dd00f5abe8290c6e84e595b03b.zip
dpdk-080358a3155b73dd00f5abe8290c6e84e595b03b.tar.gz
dpdk-080358a3155b73dd00f5abe8290c6e84e595b03b.tar.xz
tools: fix setup with huge page size other than 2MB
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/setup.sh18
1 files changed, 10 insertions, 8 deletions
diff --git a/tools/setup.sh b/tools/setup.sh
index faa5eee..b290b87 100755
--- a/tools/setup.sh
+++ b/tools/setup.sh
@@ -44,6 +44,8 @@ echo "--------------------------------------------------------------------------
echo " RTE_SDK exported as $RTE_SDK"
echo "------------------------------------------------------------------------------"
+HUGEPGSZ=`cat /proc/meminfo | grep Hugepagesize | cut -d : -f 2 | tr -d ' '`
+
#
# Application EAL parameters for setting memory options (amount/channels/ranks).
#
@@ -325,7 +327,7 @@ clear_huge_pages()
{
echo > .echo_tmp
for d in /sys/devices/system/node/node? ; do
- echo "echo 0 > $d/hugepages/hugepages-2048kB/nr_hugepages" >> .echo_tmp
+ echo "echo 0 > $d/hugepages/hugepages-${HUGEPGSZ}/nr_hugepages" >> .echo_tmp
done
echo "Removing currently reserved hugepages"
sudo sh .echo_tmp
@@ -342,13 +344,13 @@ set_non_numa_pages()
clear_huge_pages
echo ""
- echo " Input the number of 2MB pages"
- echo " Example: to have 128MB of hugepages available, enter '64' to"
- echo " reserve 64 * 2MB pages"
+ echo " Input the number of ${HUGEPGSZ} hugepages"
+ echo " Example: to have 128MB of hugepages available in a 2MB huge page system,"
+ echo " enter '64' to reserve 64 * 2MB pages"
echo -n "Number of pages: "
read Pages
- echo "echo $Pages > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages" > .echo_tmp
+ echo "echo $Pages > /sys/kernel/mm/hugepages/hugepages-${HUGEPGSZ}/nr_hugepages" > .echo_tmp
echo "Reserving hugepages"
sudo sh .echo_tmp
@@ -365,8 +367,8 @@ set_numa_pages()
clear_huge_pages
echo ""
- echo " Input the number of 2MB pages for each node"
- echo " Example: to have 128MB of hugepages available per node,"
+ echo " Input the number of ${HUGEPGSZ} hugepages for each node"
+ echo " Example: to have 128MB of hugepages available per node in a 2MB huge page system,"
echo " enter '64' to reserve 64 * 2MB pages on each node"
echo > .echo_tmp
@@ -374,7 +376,7 @@ set_numa_pages()
node=$(basename $d)
echo -n "Number of pages for $node: "
read Pages
- echo "echo $Pages > $d/hugepages/hugepages-2048kB/nr_hugepages" >> .echo_tmp
+ echo "echo $Pages > $d/hugepages/hugepages-${HUGEPGSZ}/nr_hugepages" >> .echo_tmp
done
echo "Reserving hugepages"
sudo sh .echo_tmp