netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Petr Machata <petrm@nvidia.com>
To: Ido Schimmel <idosch@idosch.org>
Cc: Petr Machata <petrm@nvidia.com>, <vladimir.oltean@nxp.com>,
	Ido Schimmel <idosch@nvidia.com>, <netdev@vger.kernel.org>,
	<davem@davemloft.net>, <kuba@kernel.org>, <pabeni@redhat.com>,
	<edumazet@google.com>, <razor@blackwall.org>,
	<mirsad.todorovac@alu.unizg.hr>
Subject: Re: [PATCH net 10/17] selftests: forwarding: ethtool_mm: Skip when using veth pairs
Date: Wed, 2 Aug 2023 16:22:35 +0200	[thread overview]
Message-ID: <87y1itcyg2.fsf@nvidia.com> (raw)
In-Reply-To: <ZMpadrHS4Sp3zE9F@shredder>


Ido Schimmel <idosch@idosch.org> writes:

> On Wed, Aug 02, 2023 at 02:27:49PM +0200, Petr Machata wrote:
>> 
>> Vladimir Oltean <vladimir.oltean@nxp.com> writes:
>> 
>> > @@ -266,6 +278,14 @@ setup_prepare()
>> >  	h1=${NETIFS[p1]}
>> >  	h2=${NETIFS[p2]}
>> >
>> > +	for netif in ${NETIFS[@]}; do
>> > +		ethtool --show-mm $netif 2>&1 &> /dev/null
>> > +		if [[ $? -ne 0 ]]; then
>> > +			echo "SKIP: $netif does not support MAC Merge"
>> > +			exit $ksft_skip
>> > +		fi
>> > +	done
>> > +
>> 
>> Ido, if you decide to go this route, just hoist the loop to the global
>> scope before registering the trap, then you don't need the hX_created
>> business.
>
> I think the idea was to run this check after verifying that ethtool
> supports MAC Merge in setup_prepare(). How about moving all these checks

True, I missed that.

> before doing any configuration and registering a trap handler?
>
> diff --git a/tools/testing/selftests/net/forwarding/ethtool_mm.sh b/tools/testing/selftests/net/forwarding/ethtool_mm.sh
> index 4331e2161e8d..39e736f30322 100755
> --- a/tools/testing/selftests/net/forwarding/ethtool_mm.sh
> +++ b/tools/testing/selftests/net/forwarding/ethtool_mm.sh
> @@ -258,11 +258,6 @@ h2_destroy()
>  
>  setup_prepare()
>  {
> -       check_ethtool_mm_support
> -       check_tc_fp_support
> -       require_command lldptool
> -       bail_on_lldpad "autoconfigure the MAC Merge layer" "configure it manually"
> -
>         h1=${NETIFS[p1]}
>         h2=${NETIFS[p2]}
>  
> @@ -278,7 +273,18 @@ cleanup()
>         h1_destroy
>  }
>  
> -skip_on_veth
> +check_ethtool_mm_support
> +check_tc_fp_support
> +require_command lldptool
> +bail_on_lldpad "autoconfigure the MAC Merge layer" "configure it manually"
> +
> +for netif in ${NETIFS[@]}; do
> +       ethtool --show-mm $netif 2>&1 &> /dev/null
> +       if [[ $? -ne 0 ]]; then
> +               echo "SKIP: $netif does not support MAC Merge"
> +               exit $ksft_skip
> +       fi
> +done
>  
>  trap cleanup EXIT
>

Looks good. These checks are usually placed right after sourcing the
libraries, but I don't care much one way or another.

  parent reply	other threads:[~2023-08-02 14:27 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-02  7:51 [PATCH net 00/17] selftests: forwarding: Various fixes Ido Schimmel
2023-08-02  7:51 ` [PATCH net 01/17] selftests: forwarding: Skip test when no interfaces are specified Ido Schimmel
2023-08-02  7:51 ` [PATCH net 02/17] selftests: forwarding: Switch off timeout Ido Schimmel
2023-08-02  7:51 ` [PATCH net 03/17] selftests: forwarding: bridge_mdb: Check iproute2 version Ido Schimmel
2023-08-02  7:51 ` [PATCH net 04/17] selftests: forwarding: bridge_mdb_max: " Ido Schimmel
2023-08-02  7:51 ` [PATCH net 05/17] selftests: forwarding: Set default IPv6 traceroute utility Ido Schimmel
2023-08-02  7:51 ` [PATCH net 06/17] selftests: forwarding: Add a helper to skip test when using veth pairs Ido Schimmel
2023-08-02  7:51 ` [PATCH net 07/17] selftests: forwarding: ethtool: Skip " Ido Schimmel
2023-08-02  7:51 ` [PATCH net 08/17] selftests: forwarding: ethtool_extended_state: " Ido Schimmel
2023-08-02  7:51 ` [PATCH net 09/17] selftests: forwarding: hw_stats_l3_gre: " Ido Schimmel
2023-08-02  7:51 ` [PATCH net 10/17] selftests: forwarding: ethtool_mm: " Ido Schimmel
2023-08-02 10:52   ` Vladimir Oltean
2023-08-02 12:27     ` Petr Machata
2023-08-02 13:30       ` Ido Schimmel
2023-08-02 13:33         ` Vladimir Oltean
2023-08-02 14:22         ` Petr Machata [this message]
2023-08-02  7:51 ` [PATCH net 11/17] selftests: forwarding: tc_actions: Use ncat instead of nc Ido Schimmel
2023-08-02  7:51 ` [PATCH net 12/17] selftests: forwarding: tc_flower: Relax success criterion Ido Schimmel
2023-08-02  7:51 ` [PATCH net 13/17] selftests: forwarding: tc_tunnel_key: Make filters more specific Ido Schimmel
2023-08-02  8:30   ` Davide Caratti
2023-08-02  8:37     ` Ido Schimmel
2023-08-02  8:52       ` Davide Caratti
2023-08-02  7:51 ` [PATCH net 14/17] selftests: forwarding: tc_flower_l2_miss: Fix failing test with old libnet Ido Schimmel
2023-08-02  7:51 ` [PATCH net 15/17] selftests: forwarding: bridge_mdb: " Ido Schimmel
2023-08-02  7:51 ` [PATCH net 16/17] selftests: forwarding: bridge_mdb_max: " Ido Schimmel
2023-08-02  7:51 ` [PATCH net 17/17] selftests: forwarding: bridge_mdb: Make test more robust Ido Schimmel

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=87y1itcyg2.fsf@nvidia.com \
    --to=petrm@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=idosch@idosch.org \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=mirsad.todorovac@alu.unizg.hr \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=razor@blackwall.org \
    --cc=vladimir.oltean@nxp.com \
    /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).