From: Sarosh Arif <sarosh.arif@emumba.com>
To: dev@dpdk.org, Thomas Monjalon <thomas@monjalon.net>
Cc: Muhammad Bilal <m.bilal@emumba.com>,
stable@dpdk.org, "Mcnamara, John" <john.mcnamara@intel.com>
Subject: Re: [dpdk-dev] [PATCH v4] usertools/dpdk-setup.sh: fix dpdk-setup's behaviour on non-alphanumeric inputs
Date: Thu, 23 Jul 2020 17:13:17 +0500 [thread overview]
Message-ID: <CABoZmYO0+cxHXKuQrkgx2bgdGZ30RT2zgP52fBVOeW84mHg3dg@mail.gmail.com> (raw)
In-Reply-To: <20200602073813.1484-1-sarosh.arif@emumba.com>
Since this script has no maintainer who is responsible for providing ACK or
NAK on the patches related to this script?
On Tue, Jun 2, 2020 at 12:39 PM Sarosh Arif <sarosh.arif@emumba.com> wrote:
> Combine https://patches.dpdk.org/patch/67855/ with v2 of this patch to fix
> the overall behaviour of dpdk-setup.sh on non-alphanumeric inputs.
> Instead of crashing the script will prompt the user to re-enter the input
> in case of non-alphanumeric input.
>
> Bugzilla ID: 419
> Signed-off-by: Sarosh Arif <sarosh.arif@emumba.com>
> Signed-off-by: Muhammad Bilal <m.bilal@emumba.com>
> ---
> v4: fix signoff
> ---
> usertools/dpdk-setup.sh | 37 ++++++++++++++++++++++++++-----------
> 1 file changed, 26 insertions(+), 11 deletions(-)
>
> diff --git a/usertools/dpdk-setup.sh b/usertools/dpdk-setup.sh
> index e5bbe9fee..69cd1d2bd 100755
> --- a/usertools/dpdk-setup.sh
> +++ b/usertools/dpdk-setup.sh
> @@ -320,14 +320,18 @@ set_non_numa_pages()
> echo " enter '64' to reserve 64 * 2MB pages"
> echo -n "Number of pages: "
> read Pages
> + numeric="^[[:digit:]]+$"
> + PG_PATH="/sys/kernel/mm/hugepages/hugepages-${HUGEPGSZ}"
> + if [[ $Pages =~ $numeric ]]; then
> + echo "echo $Pages > $PG_PATH/nr_hugepages" > .echo_tmp
> + echo "Reserving hugepages"
> + sudo sh .echo_tmp
> + rm -f .echo_tmp
> + create_mnt_huge
> + else
> + echo "Please enter a numeric value"
> + fi
>
> - 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
> }
>
> #
> @@ -343,10 +347,16 @@ set_numa_pages()
> echo " enter '64' to reserve 64 * 2MB pages on each node"
>
> echo > .echo_tmp
> + numeric="^[[:digit:]]+$"
> for d in /sys/devices/system/node/node? ; do
> node=$(basename $d)
> echo -n "Number of pages for $node: "
> read Pages
> + while [[ ! "$Pages" =~ $numeric ]]; do
> + echo "Please enter a numeric value"
> + echo -n "Number of pages for $node: "
> + read Pages
> + done
> echo "echo $Pages >
> $d/hugepages/hugepages-${HUGEPGSZ}/nr_hugepages" >> .echo_tmp
> done
> echo "Reserving hugepages"
> @@ -592,10 +602,15 @@ while [ "$QUIT" == "0" ]; do
> echo "[$OPTION_NUM] Exit Script"
> OPTIONS[$OPTION_NUM]="quit"
> echo ""
> - echo -n "Option: "
> - read our_entry
> - echo ""
> - ${OPTIONS[our_entry]} ${our_entry}
> + read -p "Option: " our_entry
> + [ $? -eq 0 ] || exit 0
> +
> + numeric="^[[:digit:]]+$"
> + if [[ "$our_entry" =~ $numeric ]]; then
> + ${OPTIONS[our_entry]} ${our_entry}
> + else
> + echo "Please enter a numeric value"
> + fi
>
> if [ "$QUIT" == "0" ] ; then
> echo
> --
> 2.17.1
>
>
next prev parent reply other threads:[~2020-07-23 12:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200319174423.28378>
2020-03-20 6:50 ` [dpdk-dev] [PATCH v2] " Sarosh Arif
2020-04-17 12:50 ` Sarosh Arif
2020-05-24 17:04 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
2020-06-01 8:40 ` [dpdk-dev] [PATCH v3] " Sarosh Arif
2020-06-02 7:38 ` [dpdk-dev] [PATCH v4] " Sarosh Arif
2020-07-23 12:13 ` Sarosh Arif [this message]
2020-07-23 17:00 ` Stephen Hemminger
2020-07-24 13:29 ` Thomas Monjalon
2020-07-24 14:05 ` Jerin Jacob
2020-11-26 17:54 ` 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=CABoZmYO0+cxHXKuQrkgx2bgdGZ30RT2zgP52fBVOeW84mHg3dg@mail.gmail.com \
--to=sarosh.arif@emumba.com \
--cc=dev@dpdk.org \
--cc=john.mcnamara@intel.com \
--cc=m.bilal@emumba.com \
--cc=stable@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).