On 21 April 2015 at 09:01, Bala Manoharan <bala.manoha...@linaro.org> wrote:

> On 21 April 2015 at 16:57, Maxim Uvarov <maxim.uva...@linaro.org> wrote:
> > Bala, one more comment. Please do parsing arguments before odp init.
> >
> >
> > About this code Mike found that it will be abort if you do not run it
> under
> > root due to
> > unable do raw socket operations.
> >
> >
> >     pktio = odp_pktio_open(dev, pool);
> >     if (pktio == ODP_PKTIO_INVALID)
> >         EXAMPLE_ABORT("pktio create failed for %s\n", dev);
>
>
> The abort in this case if because the EXAMPLE_ABORT macro implements
> abort() function instead of exit(EXIT_FAILURE)
> IMO calling exit is better as this causes a graceful shutdown of the
> system. In any case I believe it is better for the application to call
> this macro and the macro definition can implement exit() instead of
> abort()
>
> >
> > I tried "loop" application starts well. But needed some traffic so that
> loop
> > is no good fit.
> > I think it's better to exit from this app with some return code and add
> > small note to
> > Usage that for linux-generic user has to be root to open real devices in
> raw
> > mode.
>
> I believe the reason we added this macro EXAMPLE_ABORT was to be used
> by the application in the scenario when it wants to terminate the
> function so that the macro can be modified by different platforms.
> We can call usage() to display the usage here but I am against calling
> exit() directly in the application
>
>
EXAMPLE_ABORT cant call exit, that would be EXAMPLE_EXIT and there is no
reason not to add one.
As soon as make  check starts to call the examples which it does in my
sandbox having a non root run fault out is ugly. It would be better in my
opinion to wrap this with a script or have it directly return 99 so that
make check knows that it cant run unless you are root and so it reports
"TEST_SKIPPED" rather than an error that is indistinguishable from an
actual error in the test.



snip -----
_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to