netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Gur Stavi <gur.stavi@huawei.com>,  Gur Stavi <gur.stavi@huawei.com>
Cc: netdev@vger.kernel.org,  linux-kernel@vger.kernel.org,
	 "David S. Miller" <davem@davemloft.net>,
	 Eric Dumazet <edumazet@google.com>,
	 Jakub Kicinski <kuba@kernel.org>,
	 Paolo Abeni <pabeni@redhat.com>
Subject: Re: [PATCH net-next v01 3/4] selftests: net/psock_fanout: restore loopback up/down state on exit
Date: Mon, 07 Oct 2024 18:15:10 -0400	[thread overview]
Message-ID: <67045d6eb9340_1635eb294e@willemb.c.googlers.com.notmuch> (raw)
In-Reply-To: <7b2cb791fb402b88e22013ae012363d596befb50.1728303615.git.gur.stavi@huawei.com>

Gur Stavi wrote:
> Minimize the risk that psock_fanout leaves loopback device in a different
> state than the start state.
> 
> Restore loopback up/down state when test reaches end of main.
> For abort on errors, globally replace all 'exit' with 'cleanup_and_exit'
> that restores loopback up/down state.

Luckily tools/testing/selftests/net/run_afpackettests already runs
this test in a network namespace, so nothing terrible will happen if
it leaves lo down on exit.

I'd like to avoid this many code changes. As long as the test exits
with failure, it's fine if this particular state is left.

And prefer separate set_loopback_up and .._down helpers, rather than
a toggle whose behavior depends on current state.

> Signed-off-by: Gur Stavi <gur.stavi@huawei.com>

  reply	other threads:[~2024-10-07 22:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-07 12:40 [PATCH net-next v01 0/4] net: af_packet: allow joining a fanout when link is down Gur Stavi
2024-10-07 12:40 ` [PATCH net-next v01 1/4] af_packet: allow fanout_add when socket is not RUNNING Gur Stavi
2024-10-07 22:08   ` Willem de Bruijn
2024-10-07 12:40 ` [PATCH net-next v01 2/4] selftests: net/psock_fanout: add loopback up/down toggle facility Gur Stavi
2024-10-07 12:40 ` [PATCH net-next v01 3/4] selftests: net/psock_fanout: restore loopback up/down state on exit Gur Stavi
2024-10-07 22:15   ` Willem de Bruijn [this message]
2024-10-07 12:40 ` [PATCH net-next v01 4/4] selftests: net/psock_fanout: socket joins fanout when link is down Gur Stavi

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=67045d6eb9340_1635eb294e@willemb.c.googlers.com.notmuch \
    --to=willemdebruijn.kernel@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gur.stavi@huawei.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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).