From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Thomas Monjalon <thomas@monjalon.net>
Cc: Ferruh Yigit <ferruh.yigit@intel.com>,
dev@dpdk.org, techboard@dpdk.org,
Stephen Hemminger <stephen@networkplumber.org>,
Bruce Richardson <bruce.richardson@intel.com>
Subject: [dpdk-dev] [PATCH 4/6] usertools/setup: remove hugepage functions
Date: Wed, 25 Nov 2020 19:19:06 +0000 [thread overview]
Message-ID: <20201125191908.1867106-5-ferruh.yigit@intel.com> (raw)
In-Reply-To: <20201125191908.1867106-1-ferruh.yigit@intel.com>
There is a specific tool to setup hugepages, with better support, no
need to have duplication.
The hugepage script is: './usertools/dpdk-hugepages.py'
Please try "./usertools/dpdk-hugepages.py -h" for more information about
the tool.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
usertools/dpdk-setup.sh | 145 +++-------------------------------------
1 file changed, 9 insertions(+), 136 deletions(-)
diff --git a/usertools/dpdk-setup.sh b/usertools/dpdk-setup.sh
index 759f6c096536..1e36661e572e 100755
--- a/usertools/dpdk-setup.sh
+++ b/usertools/dpdk-setup.sh
@@ -15,8 +15,6 @@ echo "--------------------------------------------------------------------------
echo " RTE_SDK exported as $RTE_SDK"
echo "------------------------------------------------------------------------------"
-HUGEPGSZ=`cat /proc/meminfo | grep Hugepagesize | cut -d : -f 2 | tr -d ' '`
-
#
# Sets QUIT variable so script will finish.
#
@@ -31,36 +29,6 @@ q()
quit
}
-#
-# Creates hugepage filesystem.
-#
-create_mnt_huge()
-{
- echo "Creating /mnt/huge and mounting as hugetlbfs"
- sudo mkdir -p /mnt/huge
-
- grep -s '/mnt/huge' /proc/mounts > /dev/null
- if [ $? -ne 0 ] ; then
- sudo mount -t hugetlbfs nodev /mnt/huge
- fi
-}
-
-#
-# Removes hugepage filesystem.
-#
-remove_mnt_huge()
-{
- echo "Unmounting /mnt/huge and removing directory"
- grep -s '/mnt/huge' /proc/mounts > /dev/null
- if [ $? -eq 0 ] ; then
- sudo umount /mnt/huge
- fi
-
- if [ -d /mnt/huge ] ; then
- sudo rm -R /mnt/huge
- fi
-}
-
#
# Unloads igb_uio.ko.
#
@@ -182,79 +150,6 @@ set_vfio_permissions()
fi
}
-#
-# Removes all reserved hugepages.
-#
-clear_huge_pages()
-{
- echo > .echo_tmp
- for d in /sys/devices/system/node/node? ; do
- echo "echo 0 > $d/hugepages/hugepages-${HUGEPGSZ}/nr_hugepages" >> .echo_tmp
- done
- echo "Removing currently reserved hugepages"
- sudo sh .echo_tmp
- rm -f .echo_tmp
-
- remove_mnt_huge
-}
-
-#
-# Creates hugepages.
-#
-set_non_numa_pages()
-{
- clear_huge_pages
-
- echo ""
- 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-${HUGEPGSZ}/nr_hugepages" > .echo_tmp
-
- echo "Reserving hugepages"
- sudo sh .echo_tmp
- rm -f .echo_tmp
-
- create_mnt_huge
-}
-
-#
-# Creates hugepages on specific NUMA nodes.
-#
-set_numa_pages()
-{
- clear_huge_pages
-
- echo ""
- 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
- for d in /sys/devices/system/node/node? ; do
- node=$(basename $d)
- echo -n "Number of pages for $node: "
- read Pages
- echo "echo $Pages > $d/hugepages/hugepages-${HUGEPGSZ}/nr_hugepages" >> .echo_tmp
- done
- echo "Reserving hugepages"
- sudo sh .echo_tmp
- rm -f .echo_tmp
-
- create_mnt_huge
-}
-
-#
-# Print hugepage information.
-#
-grep_meminfo()
-{
- grep -i huge /proc/meminfo
-}
-
#
# Calls dpdk-devbind.py --status to show the devices and what they
# are all bound to, in terms of drivers.
@@ -329,41 +224,23 @@ step1_func()
TEXT[1]="Insert VFIO module"
FUNC[1]="load_vfio_module"
- TEXT[2]="Setup hugepage mappings for non-NUMA systems"
- FUNC[2]="set_non_numa_pages"
-
- TEXT[3]="Setup hugepage mappings for NUMA systems"
- FUNC[3]="set_numa_pages"
+ TEXT[2]="Display current Ethernet/Baseband/Crypto device settings"
+ FUNC[2]="show_devices"
- TEXT[4]="Display current Ethernet/Baseband/Crypto device settings"
- FUNC[4]="show_devices"
+ TEXT[3]="Bind Ethernet/Baseband/Crypto device to IGB UIO module"
+ FUNC[3]="bind_devices_to_igb_uio"
- TEXT[5]="Bind Ethernet/Baseband/Crypto device to IGB UIO module"
- FUNC[5]="bind_devices_to_igb_uio"
-
- TEXT[6]="Bind Ethernet/Baseband/Crypto device to VFIO module"
- FUNC[6]="bind_devices_to_vfio"
-
- TEXT[7]="Setup VFIO permissions"
- FUNC[7]="set_vfio_permissions"
-}
-
-#
-# Other options
-#
-step2_func()
-{
- TITLE="Other tools"
-
- TEXT[1]="List hugepage info from /proc/meminfo"
- FUNC[1]="grep_meminfo"
+ TEXT[4]="Bind Ethernet/Baseband/Crypto device to VFIO module"
+ FUNC[4]="bind_devices_to_vfio"
+ TEXT[5]="Setup VFIO permissions"
+ FUNC[5]="set_vfio_permissions"
}
#
# Options for cleaning up the system
#
-step3_func()
+step2_func()
{
TITLE="Uninstall and system cleanup"
@@ -378,14 +255,10 @@ step3_func()
TEXT[4]="Remove KNI module"
FUNC[4]="remove_kni_module"
-
- TEXT[5]="Remove hugepage mappings"
- FUNC[5]="clear_huge_pages"
}
STEPS[1]="step1_func"
STEPS[2]="step2_func"
-STEPS[3]="step3_func"
QUIT=0
--
2.26.2
next prev parent reply other threads:[~2020-11-25 19:20 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-25 19:19 [dpdk-dev] [PATCH 0/6] update dpdk-setup.sh Ferruh Yigit
2020-11-25 19:19 ` [dpdk-dev] [PATCH 1/6] usertools/setup: remove make based build Ferruh Yigit
2020-11-26 13:56 ` Walsh, Conor
2020-11-25 19:19 ` [dpdk-dev] [PATCH 2/6] usertools/setup: remove inserting custom kernel modules Ferruh Yigit
2020-11-26 14:00 ` Walsh, Conor
2020-11-25 19:19 ` [dpdk-dev] [PATCH 3/6] usertools/setup: remove running built applications Ferruh Yigit
2020-11-26 14:02 ` Walsh, Conor
2020-11-26 14:04 ` Thomas Monjalon
2020-11-25 19:19 ` Ferruh Yigit [this message]
2020-11-26 14:10 ` [dpdk-dev] [PATCH 4/6] usertools/setup: remove hugepage functions Walsh, Conor
2020-11-25 19:19 ` [dpdk-dev] [PATCH 5/6] usertools/setup: fix loading vfio module Ferruh Yigit
2020-11-25 19:19 ` [dpdk-dev] [PATCH 6/6] usertools/setup: move removal target to 21.11 Ferruh Yigit
2020-11-27 13:57 ` [dpdk-dev] [PATCH 0/6] update dpdk-setup.sh Burakov, Anatoly
2020-11-27 14:12 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201125191908.1867106-5-ferruh.yigit@intel.com \
--to=ferruh.yigit@intel.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=stephen@networkplumber.org \
--cc=techboard@dpdk.org \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).