dpdk-setup.sh: Prevent infinite loop, when end of input.
diff mbox series

Message ID 20200330141857.4681-1-piotr@dobra.waw.pl
State Changes Requested
Delegated to: Thomas Monjalon
Headers show
Series
  • dpdk-setup.sh: Prevent infinite loop, when end of input.
Related show

Checks

Context Check Description
ci/iol-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Piotr Sieduszewski March 30, 2020, 2:18 p.m. UTC
From: Piotr Sieduszewski <piotr.sieduszewski@intel.com>

Signed-off-by: Piotr Sieduszewski <piotr.sieduszewski@intel.com>
---
 usertools/dpdk-setup.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Thomas Monjalon May 24, 2020, 5:07 p.m. UTC | #1
30/03/2020 16:18, Piotr Sieduszewski:
> From: Piotr Sieduszewski <piotr.sieduszewski@intel.com>
> 
> Signed-off-by: Piotr Sieduszewski <piotr.sieduszewski@intel.com>

Please add some explanations, it may help getting reviews.
Thanks
Piotr May 24, 2020, 6:01 p.m. UTC | #2
Hi


The script dpdk-setup.sh was froze wit full cpu usage when EOF input.  
For example:


dpdk-setup.sh <<< '11'


or


dpdk-setup.sh <<EOF

11

EOF


Regards


Piotr


On 2020-05-24 7:07 p.m., Thomas Monjalon wrote:
> 30/03/2020 16:18, Piotr Sieduszewski:
>> From: Piotr Sieduszewski <piotr.sieduszewski@intel.com>
>>
>> Signed-off-by: Piotr Sieduszewski <piotr.sieduszewski@intel.com>
> Please add some explanations, it may help getting reviews.
> Thanks
>
>
Sieduszewski, Piotr May 25, 2020, 5:29 a.m. UTC | #3
Hi



I send answer yesterday, but now I put more examples from my scripts at work:





as first, very simple deadlock:

Dpd-setup.sh < /dev/null





Deadlock without patch:



for NIC in ${RTE_NIC-0000:3d:00.1} ; do

$RTE_SDK/usertools/dpdk-setup.sh <<< "51

${NIC}



62

"

Done



Above works only witch additional empty line:



for NIC in ${RTE_NIC-0000:3d:00.1} ; do

$RTE_SDK/usertools/dpdk-setup.sh <<< "51

${NIC}



62



"

Done





.. or other deadlock:



usertools/dpdk-setup.sh <<< '41



62

'



usertools/dpdk-setup.sh <<< '41



62



'





Regards



Piotr





-----Original Message-----
From: Thomas Monjalon <thomas@monjalon.net>
Sent: 2020 May 24 19:08
To: Sieduszewski, Piotr <piotr.sieduszewski@intel.com>
Cc: dev@dpdk.org; Piotr Sieduszewski <piotr@dobra.waw.pl>; sarosh.arif@emumba.com; m.bilal@emumba.com
Subject: Re: [dpdk-dev] [PATCH] dpdk-setup.sh: Prevent infinite loop, when end of input.



30/03/2020 16:18, Piotr Sieduszewski:

> From: Piotr Sieduszewski <piotr.sieduszewski@intel.com<mailto:piotr.sieduszewski@intel.com>>

>

> Signed-off-by: Piotr Sieduszewski <piotr.sieduszewski@intel.com<mailto:piotr.sieduszewski@intel.com>>



Please add some explanations, it may help getting reviews.

Thanks




---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
ul. Sowackiego 173 | 80-298 Gdask | Sd Rejonowy Gdask Pnoc | VII Wydzia Gospodarczy Krajowego Rejestru Sdowego - KRS 101882 | NIP 957-07-52-316 | Kapita zakadowy 200.000 PLN.
Ta wiadomo wraz z zacznikami jest przeznaczona dla okrelonego adresata i moe zawiera informacje poufne. W razie przypadkowego otrzymania tej wiadomoci, prosimy o powiadomienie nadawcy oraz trwae jej usunicie; jakiekolwiek przegldanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.
Thomas Monjalon May 25, 2020, 6:55 a.m. UTC | #4
25/05/2020 07:29, Sieduszewski, Piotr:
> Hi
> 
> I send answer yesterday, but now I put more examples from my scripts at work:

Please send a patch v2 with more explanations in sentences.
It would be appreciated if you use --in-reply-to.

PS: please do not top-post, do not use HTML, and do not mark email as confidential.



> as first, very simple deadlock:
> 
> Dpd-setup.sh < /dev/null
> 
> 
> 
> 
> 
> Deadlock without patch:
> 
> 
> 
> for NIC in ${RTE_NIC-0000:3d:00.1} ; do
> 
> $RTE_SDK/usertools/dpdk-setup.sh <<< "51
> 
> ${NIC}
> 
> 
> 
> 62
> 
> "
> 
> Done
> 
> 
> 
> Above works only witch additional empty line:
> 
> 
> 
> for NIC in ${RTE_NIC-0000:3d:00.1} ; do
> 
> $RTE_SDK/usertools/dpdk-setup.sh <<< "51
> 
> ${NIC}
> 
> 
> 
> 62
> 
> 
> 
> "
> 
> Done
> 
> 
> 
> 
> 
> .. or other deadlock:
> 
> 
> 
> usertools/dpdk-setup.sh <<< '41
> 
> 
> 
> 62
> 
> '
> 
> 
> 
> usertools/dpdk-setup.sh <<< '41
> 
> 
> 
> 62
> 
> 
> 
> '
> 
> 
> 
> 
> 
> Regards
> 
> 
> 
> Piotr
> 
> 
> 
> 
> 
> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: 2020 May 24 19:08
> To: Sieduszewski, Piotr <piotr.sieduszewski@intel.com>
> Cc: dev@dpdk.org; Piotr Sieduszewski <piotr@dobra.waw.pl>; sarosh.arif@emumba.com; m.bilal@emumba.com
> Subject: Re: [dpdk-dev] [PATCH] dpdk-setup.sh: Prevent infinite loop, when end of input.
> 
> 
> 
> 30/03/2020 16:18, Piotr Sieduszewski:
> 
> > From: Piotr Sieduszewski <piotr.sieduszewski@intel.com<mailto:piotr.sieduszewski@intel.com>>
> 
> >
> 
> > Signed-off-by: Piotr Sieduszewski <piotr.sieduszewski@intel.com<mailto:piotr.sieduszewski@intel.com>>
> 
> 
> 
> Please add some explanations, it may help getting reviews.
> 
> Thanks
> 
> 
> 
> 
> ---------------------------------------------------------------------
> Intel Technology Poland sp. z o.o.
> ul. Sowackiego 173 | 80-298 Gdask | Sd Rejonowy Gdask Pnoc | VII Wydzia Gospodarczy Krajowego Rejestru Sdowego - KRS 101882 | NIP 957-07-52-316 | Kapita zakadowy 200.000 PLN.
> Ta wiadomo wraz z zacznikami jest przeznaczona dla okrelonego adresata i moe zawiera informacje poufne. W razie przypadkowego otrzymania tej wiadomoci, prosimy o powiadomienie nadawcy oraz trwae jej usunicie; jakiekolwiek przegldanie lub rozpowszechnianie jest zabronione.
> This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.
>  
>

Patch
diff mbox series

diff --git a/usertools/dpdk-setup.sh b/usertools/dpdk-setup.sh
index e5bbe9fee..c9660f950 100755
--- a/usertools/dpdk-setup.sh
+++ b/usertools/dpdk-setup.sh
@@ -593,7 +593,7 @@  while [ "$QUIT" == "0" ]; do
 	OPTIONS[$OPTION_NUM]="quit"
 	echo ""
 	echo -n "Option: "
-	read our_entry
+	read our_entry || break
 	echo ""
 	${OPTIONS[our_entry]} ${our_entry}