On Fri, Aug 25, 2023 at 03:03:58PM +0200, Magnus Karlsson wrote: > On Fri, 25 Aug 2023 at 14:57, Maciej Fijalkowski > <maciej.fijalkowski@xxxxxxxxx> wrote: > > > > On Thu, Aug 24, 2023 at 02:28:53PM +0200, Magnus Karlsson wrote: > > > From: Magnus Karlsson <magnus.karlsson@xxxxxxxxx> > > > > > > Introduce the XSKTEST_ETH environment variable to be able to set the > > > network interface that should be used for testing. > > > > > > Signed-off-by: Magnus Karlsson <magnus.karlsson@xxxxxxxxx> > > > --- > > > tools/testing/selftests/bpf/test_xsk.sh | 20 +++++++++----------- > > > 1 file changed, 9 insertions(+), 11 deletions(-) > > > > > > diff --git a/tools/testing/selftests/bpf/test_xsk.sh b/tools/testing/selftests/bpf/test_xsk.sh > > > index 9ec718043c1a..3e0a2302a185 100755 > > > --- a/tools/testing/selftests/bpf/test_xsk.sh > > > +++ b/tools/testing/selftests/bpf/test_xsk.sh > > > @@ -88,14 +88,12 @@ > > > > > > . xsk_prereqs.sh > > > > > > -ETH="" > > > - > > > while getopts "vi:dm:lt:h" flag > > > do > > > case "${flag}" in > > > v) verbose=1;; > > > d) debug=1;; > > > - i) ETH=${OPTARG};; > > > + i) XSKTEST_ETH=${OPTARG};; > > > m) XSKTEST_MODE=${OPTARG};; > > > l) list=1;; > > > t) XSKTEST_TEST=${OPTARG};; > > > @@ -157,9 +155,9 @@ if [[ $help -eq 1 ]]; then > > > exit > > > fi > > > > > > -if [ ! -z $ETH ]; then > > > - VETH0=${ETH} > > > - VETH1=${ETH} > > > +if [ -n "$XSKTEST_ETH" ]; then > > > > Sorry - is point of this patch is just to invert the logic and rename the > > env var? > > The purpose was to make it setable from the outside and give it a name > that is more descriptive and targeted only to xskxceiver. and this is accomplished by not having ETH initialized here? What will be 'the outside' ? Currently I don't see much value within this patch, unless you explain the need for setting this from outside of this script. Maybe I missed some discussion from v1. I can live with this variable being ETH, what's more concerning/confusing to me is that for ZC we have to set VETH0 and VETH1 to ETH and then use that later on. > > > > + VETH0=${XSKTEST_ETH} > > > + VETH1=${XSKTEST_ETH} > > > else > > > validate_root_exec > > > validate_veth_support ${VETH0} > > > @@ -203,10 +201,10 @@ fi > > > > > > exec_xskxceiver > > > > > > -if [ -z $ETH ]; then > > > +if [ -z $XSKTEST_ETH ]; then > > > cleanup_exit ${VETH0} ${VETH1} > > > else > > > - cleanup_iface ${ETH} ${MTU} > > > + cleanup_iface ${XSKTEST_ETH} ${MTU} > > > fi > > > > > > if [[ $list -eq 1 ]]; then > > > @@ -216,17 +214,17 @@ fi > > > TEST_NAME="XSK_SELFTESTS_${VETH0}_BUSY_POLL" > > > busy_poll=1 > > > > > > -if [ -z $ETH ]; then > > > +if [ -z $XSKTEST_ETH ]; then > > > setup_vethPairs > > > fi > > > exec_xskxceiver > > > > > > ## END TESTS > > > > > > -if [ -z $ETH ]; then > > > +if [ -z $XSKTEST_ETH ]; then > > > cleanup_exit ${VETH0} ${VETH1} > > > else > > > - cleanup_iface ${ETH} ${MTU} > > > + cleanup_iface ${XSKTEST_ETH} ${MTU} > > > fi > > > > > > failures=0 > > > -- > > > 2.34.1 > > >