netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Aaron Conole <aconole@redhat.com>
Cc: Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, dev@openvswitch.org,
	linux-kselftest@vger.kernel.org
Subject: Re: selftests: openvswitch: Questions about possible enhancements
Date: Thu, 25 Apr 2024 08:40:27 +0100	[thread overview]
Message-ID: <20240425074027.GT42092@kernel.org> (raw)
In-Reply-To: <f7tle52aary.fsf@redhat.com>

On Wed, Apr 24, 2024 at 02:14:09PM -0400, Aaron Conole wrote:
> Simon Horman <horms@kernel.org> writes:
> 
> > Hi Aaron, Jakub, all,
> >
> > I have recently been exercising the Open vSwitch kernel selftests,
> > using vng, something like this:
> >
> > 	TESTDIR="tools/testing/selftests/net/openvswitch"
> >
> >         vng -v --run . --user root --cpus 2 \
> >                 --overlay-rwdir "$PWD" -- \
> >                 "modprobe openvswitch && \
> > 		 echo \"timeout=90\" >> \"${TESTDIR}/settings\" && \
> >                  make -C \"$TESTDIR\" run_tests"
> >
> > And I have some observations that I'd like to ask about.
> >
> > 1. Building the kernel using the following command does not
> >    build the openvswitch kernel module.
> >
> > 	vng -v --build \
> > 		--config tools/testing/selftests/net/config
> >
> >    All that seems to be missing is CONFIG_OPENVSWITCH=m
> >    and I am wondering what the best way of resolving this is.
> >
> >    Perhaps I am doing something wrong.
> >    Or perhaps tools/testing/selftests/net/openvswitch/config
> >    should be created? If so, should it include (most of?) what is in
> >    tools/testing/selftests/net/config, or just CONFIG_OPENVSWITCH=m?
> 
> I have a series that I need to get back to fixing:
> 
> https://mail.openvswitch.org/pipermail/ovs-dev/2024-February/411917.html
> 
> which does include the config listed, and some of the fixes for things
> you've noted.
> 
> I think it makes sense to get back to it.

Thanks Aaron,

I was hoping you might say something like that.

WRT to the config itself, as Benjamin mentioned elsewhere in this thread [1]
there is a question about how this should be handled consistently for
all selftests.

[1] https://lore.kernel.org/netdev/ZilIgbIvB04iUal2@f4/

> 
> > 2. As per my example above, it seems that a modprobe openvswitch is
> >    required (if openvswitch is a module).
> >
> >    Again, perhaps I am doing something wrong. But if not, should this be
> >    incorporated into tools/testing/selftests/net/openvswitch/openvswitch.sh
> >    or otherwise automated?
> >
> > 3. I have observed that the last test fails (yesterday, but not today!),
> >    because the namespace it tries to create already exists. I believe this
> >    is because it is pending deletion.
> >
> >    My work-around is as follows:
> >
> >  ovs_add_netns_and_veths () {
> >  	info "Adding netns attached: sbx:$1 dp:$2 {$3, $4, $5}"
> > +	for i in $(seq 10); do
> > +		ovs_sbx "$1" test -e "/var/run/netns/$3" || break
> > +		info "Namespace $3 still exists (attempt $i)"
> > +		ovs_sbx "$1" ip netns del "$3"
> > +		sleep "$i"
> > +	done
> >  	ovs_sbx "$1" ip netns add "$3" || return 1
> >  	on_exit "ovs_sbx $1 ip netns del $3"
> >  	ovs_sbx "$1" ip link add "$4" type veth peer name "$5" || return 1
> >
> >    N.B.: the "netns del" part is probably not needed,
> >    but I'm not able to exercise it effectively right now.
> >
> >    I am wondering if a loop like this is appropriate to add, perhaps also
> >    to namespace deletion. Or if it would be appropriate to port
> >    openvswitch.sh to use ./tools/testing/selftests/net/lib.sh, which I
> >    believe handles this.
> >
> > 4. I am observing timeouts whith the default value of 45s.
> >    Bumping this to 90s seems to help.
> >    Are there any objections to a patch to bump the timeout?

Regarding points 3 and 4.

I did a bit more testing after I sent my email yesterday.
I have two test machines. It turns out, to my surprise, that one is
much slower than the other when running openvswitch.sh with vng.

I am unsure why, but that isn't really on topic. The point
is that I'm currently only seeing problems 3 and 4 manifest
on the slow machine.

I think problem 3 is probably worth solving.
But the timeout question is more subjective.

  reply	other threads:[~2024-04-25  7:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-24 16:44 selftests: openvswitch: Questions about possible enhancements Simon Horman
2024-04-24 17:37 ` [ovs-dev] " Simon Horman
2024-04-24 17:59   ` Benjamin Poirier
2024-04-24 18:14     ` Aaron Conole
2024-04-25  7:33     ` Simon Horman
2024-04-24 18:14 ` Aaron Conole
2024-04-25  7:40   ` Simon Horman [this message]
2024-04-25 20:00     ` Aaron Conole
2024-04-25  0:30 ` Jakub Kicinski
2024-04-25  8:26   ` Simon Horman
2024-04-25 18:57     ` [ovs-dev] " Simon Horman
2024-04-25 19:21       ` Jakub Kicinski
2024-04-25 20:04         ` Aaron Conole
2024-04-26  7:05         ` Simon Horman
2024-04-25 19:58   ` Aaron Conole

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=20240425074027.GT42092@kernel.org \
    --to=horms@kernel.org \
    --cc=aconole@redhat.com \
    --cc=dev@openvswitch.org \
    --cc=kuba@kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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).