diff mbox

test: perf: l2fwd detect missing odp_generator

Message ID 1452638195-23806-1-git-send-email-mike.holmes@linaro.org
State Superseded
Headers show

Commit Message

Mike Holmes Jan. 12, 2016, 10:36 p.m. UTC
The script did not check that the odp_generator was present and worse it
failed silently if it was not present.

Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
---
 test/performance/odp_l2fwd_run | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Stuart Haslam Jan. 13, 2016, 10:44 a.m. UTC | #1
On Tue, Jan 12, 2016 at 05:36:35PM -0500, Mike Holmes wrote:
> The script did not check that the odp_generator was present and worse it
> failed silently if it was not present.
> 
> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
> ---
>  test/performance/odp_l2fwd_run | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/test/performance/odp_l2fwd_run b/test/performance/odp_l2fwd_run
> index 001d8c2..a1446e8 100755
> --- a/test/performance/odp_l2fwd_run
> +++ b/test/performance/odp_l2fwd_run
> @@ -54,6 +54,16 @@ run_l2fwd()
>  		exit $TEST_SKIPPED
>  	fi
>  
> +	type odp_generator > /dev/null
> +	if [ $? -ne 0 ]; then
> +		echo "odp_generator not installed. Aborting."
> +		cleanup_pktio_env
> +		if [ $? -ne 0 ]; then
> +			echo "cleanup_pktio_env error $?"
> +		fi

If you pass "clean" as an argument to setup_pktio_env it'll install an
exit trap that runs cleanup_pktio_env, so you won't need to do it here.

That would also solve the problem of interfaces not being cleanup up on
a ctrl-c.

--
Stuart.
Mike Holmes Jan. 13, 2016, 12:47 p.m. UTC | #2
On 13 January 2016 at 05:44, Stuart Haslam <stuart.haslam@linaro.org> wrote:

> On Tue, Jan 12, 2016 at 05:36:35PM -0500, Mike Holmes wrote:

> > The script did not check that the odp_generator was present and worse it

> > failed silently if it was not present.

> >

> > Signed-off-by: Mike Holmes <mike.holmes@linaro.org>

> > ---

> >  test/performance/odp_l2fwd_run | 10 ++++++++++

> >  1 file changed, 10 insertions(+)

> >

> > diff --git a/test/performance/odp_l2fwd_run

> b/test/performance/odp_l2fwd_run

> > index 001d8c2..a1446e8 100755

> > --- a/test/performance/odp_l2fwd_run

> > +++ b/test/performance/odp_l2fwd_run

> > @@ -54,6 +54,16 @@ run_l2fwd()

> >               exit $TEST_SKIPPED

> >       fi

> >

> > +     type odp_generator > /dev/null

> > +     if [ $? -ne 0 ]; then

> > +             echo "odp_generator not installed. Aborting."

> > +             cleanup_pktio_env

> > +             if [ $? -ne 0 ]; then

> > +                     echo "cleanup_pktio_env error $?"

> > +             fi

>

> If you pass "clean" as an argument to setup_pktio_env it'll install an

> exit trap that runs cleanup_pktio_env, so you won't need to do it here.

>

>

Ok so I should remove the check that is further down in this file after a
call cleanup_pktio_env to also ?


> That would also solve the problem of interfaces not being cleanup up on

> a ctrl-c.

>

> --

> Stuart.

>




-- 
Mike Holmes
Technical Manager - Linaro Networking Group
Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM SoCs
diff mbox

Patch

diff --git a/test/performance/odp_l2fwd_run b/test/performance/odp_l2fwd_run
index 001d8c2..a1446e8 100755
--- a/test/performance/odp_l2fwd_run
+++ b/test/performance/odp_l2fwd_run
@@ -54,6 +54,16 @@  run_l2fwd()
 		exit $TEST_SKIPPED
 	fi
 
+	type odp_generator > /dev/null
+	if [ $? -ne 0 ]; then
+		echo "odp_generator not installed. Aborting."
+		cleanup_pktio_env
+		if [ $? -ne 0 ]; then
+			echo "cleanup_pktio_env error $?"
+		fi
+		exit 1
+	fi
+
 	#@todo: limit odp_generator to cores
 	#https://bugs.linaro.org/show_bug.cgi?id=1398
 	(odp_generator${EXEEXT} -I $IF0 \