Hi Ilya

Thanks for those additional comments.

On Mon, Jun 29, 2026 at 7:21 PM Ilya Maximets <[email protected]> wrote:

> On 6/29/26 2:40 PM, Xavier Simonart via dev wrote:
> > Using ofport_request can make the test flaky, as OVS might have
> > already used the requested ofport (typically when ovn created
> > ovn-hv[0-9]-0 ports). In that case, it takes some time (between
> > a few msec to multiple seconds) until the requested ofport is
> > obtained. OVN handles this properly (flows are recalculated), but
> > tests do not handle this properly (e.g. if it happens when comparing
> > I-P and recompute flows).
> >
> > This patch removes all ofport-request, querying the obtained ofport
> > when needed.
> >
> > Signed-off-by: Xavier Simonart <[email protected]>
> > ---
> >  tests/ovn.at | 1055 ++++++++++++++++++--------------------------------
> >  1 file changed, 373 insertions(+), 682 deletions(-)
> >
> > diff --git a/tests/ovn.at b/tests/ovn.at
> > index 5dda50044..6ae12acc7 100644
> > --- a/tests/ovn.at
> > +++ b/tests/ovn.at
> > @@ -2641,7 +2641,7 @@ for i in 1 2 3; do
> >      ovn_attach n1 br-phys 192.168.0.$i
> >
> >      for j in 1 2 3; do
> > -        check ovs-vsctl add-port br-int vif$i$j -- set Interface
> vif$i$j external-ids:iface-id=lp$i$j options:tx_pcap=hv$i/vif$i$j-tx.pcap
> options:rxq_pcap=hv$i/vif$i$j-rx.pcap ofport-request=$i$j
> > +        check ovs-vsctl add-port br-int vif$i$j -- set Interface
> vif$i$j external-ids:iface-id=lp$i$j options:tx_pcap=hv$i/vif$i$j-tx.pcap
> options:rxq_pcap=hv$i/vif$i$j-rx.pcap
> >          check ovn-nbctl lsp-add lsw0 lp$i$j
> >          if test $j = 1; then
> >              check ovn-nbctl lsp-set-addresses lp$i$j
> "f0:00:00:00:00:$i$j 192.168.0.$i$j" unknown
> > @@ -2912,7 +2912,7 @@ for i in 1 2; do
> >      ovn_attach n1 br-phys 192.168.0.$i
> >
> >      for j in 1 2; do
> > -        ovs-vsctl add-port br-int vif$i$j -- set Interface vif$i$j
> external-ids:iface-id=lp$i$j options:tx_pcap=hv$i/vif$i$j-tx.pcap
> options:rxq_pcap=hv$i/vif$i$j-rx.pcap ofport-request=$i$j
> > +        ovs-vsctl add-port br-int vif$i$j -- set Interface vif$i$j
> external-ids:iface-id=lp$i$j options:tx_pcap=hv$i/vif$i$j-tx.pcap
> options:rxq_pcap=hv$i/vif$i$j-rx.pcap
> >          check ovn-nbctl lsp-add lsw0 lp$i$j
> >          ip_addrs="192.168.0.$i$j"
> >          check ovn-nbctl lsp-set-addresses lp$i$j "f0:00:00:00:00:$i$j
> $ip_addrs"
> > @@ -3359,8 +3359,7 @@ for i in 1 2; do
> >          ovs-vsctl add-port br-int vif$i$j -- \
> >              set Interface vif$i$j external-ids:iface-id=lp$i$j \
> >                                    options:tx_pcap=hv$i/vif$i$j-tx.pcap \
> > -                                  options:rxq_pcap=hv$i/vif$i$j-rx.pcap
> \
> > -                                  ofport-request=$i$j
> > +                                  options:rxq_pcap=hv$i/vif$i$j-rx.pcap
> >
>
> I also wonder if all those 'ovs-vsctl add-port' commands should be
> replaced with a macro, since we're touching all of them here anyway.
>
We could do that; a quick look shows around 1,500 fewer lines and more
readable code in most cases.

> So, the next time we don't have to.
>
I am not sure that, even with a macro, we would not have had to re-modify
all lines (we would have, for example, OVS_ADD_PORT(br-int,
vif$i$j, lp$i$j, ..., ofport-request=$i$j), and we still would have had to
delete or modify all requested ofports.
But it would have been easier.
So I'll send a v2 with a new macro, and the changes mentioned in the
previous mail (i.e. remove most ofport requests and use a prefix such as
1000 when requesting one)

>
> Best regards, Ilya Maximets.
>
Thanks
Xavier
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to