On Thu, Jan 5, 2023 at 11:17 AM Eelco Chaudron <[email protected]> wrote:
> On 5 Jan 2023, at 11:05, David Marchand wrote:
> > On Thu, Jan 5, 2023 at 10:46 AM Eelco Chaudron <[email protected]> wrote:
> >>
> >> In some environments, ovs-vswitchd gets shutdown before the pkill of
> >> testpmd has been completed, which results in the following error messages:
> >>
> >>   Removing port 'dpdkvhostuser0' while vhost device still attached.
> >>   To restore connectivity after re-adding of port, VM on socket '' must be 
> >> restarted.
> >>
> >> This patch ignore these error messages.
> >
> > I remember hitting this...
> >
> > Another way would be to wait for vhost to notice the virtio port 
> > disappeared.
> > I had a patch that I never finished working on:
> >
> > diff --git a/tests/system-dpdk.at b/tests/system-dpdk.at
> > index 5ef7f8ccdc..e8e404ad70 100644
> > --- a/tests/system-dpdk.at
> > +++ b/tests/system-dpdk.at
> > @@ -154,6 +154,9 @@ AT_CHECK([ip netns exec ns1 ping -c 4 -I tap0
> > 172.31.110.12], [], [stdout],
> >  dnl Clean up the testpmd now
> >  pkill -f -x -9 'tail -f /dev/null'
> >
> > +dnl Wait for vhost-user handling the socket disconnection
> > +OVS_WAIT_UNTIL([grep "vHost Device '$OVS_RUNDIR/dpdkvhostuser0' has
> > been removed" ovs-vswitchd.log])
> > +
>
> Yes, I also had something like the below, but I thought adding the logs would 
> be the easiest:
>
> KILL_PID=$(pgrep -f -x 'tail -f /dev/null’)
> kill -9 $KILL_PID; wait $KILL_PID

Just ignoring the log means that this test may finish with some
testpmd processes (probably finishing, yet still running) in the
background.
That could impact a next unit test which uses the same resources, like
maybe some vfio-pci bound device, or the same hugetlbfs files (though
I have another patch to switch to --in-memory in system-dpdk tests..).

So I prefer a clear synchronisation point when cleaning up.
IOW, either wait on the log to appear, or sync on killing testpmd.


Thanks.

-- 
David Marchand

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to