Re: [ovs-dev] [PATCH ovn] ovn-sbctl.at: Fix timing problem of count-flows test.

2021-07-19 Thread Han Zhou
On Mon, Jul 19, 2021 at 11:22 AM Ben Pfaff  wrote:
>
> On Thu, Jul 15, 2021 at 06:10:40PM -0700, Han Zhou wrote:
> > On Thu, Jul 15, 2021 at 4:57 PM Ben Pfaff  wrote:
> >
> > > On Thu, Jul 15, 2021 at 04:34:51PM -0700, Han Zhou wrote:
> > > > Fixes: 895e02ec0be6("ovn-sbctl.c Add logical flows count numbers")
> > > > Signed-off-by: Han Zhou 
> > > > ---
> > > >  tests/ovn-sbctl.at | 4 ++--
> > > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > >
> > > > diff --git a/tests/ovn-sbctl.at b/tests/ovn-sbctl.at
> > > > index 16f5dabcc..dabf62d2b 100644
> > > > --- a/tests/ovn-sbctl.at
> > > > +++ b/tests/ovn-sbctl.at
> > > > @@ -200,7 +200,7 @@ Total number of logical flows = 0
> > > >  ])
> > > >
> > > >  # create some logical flows
> > > > -check ovn-nbctl ls-add count-test
> > > > +check ovn-nbctl --wait=sb ls-add count-test
> > > >
> > > >  OVS_WAIT_UNTIL([total_lflows=`count_entries`; test $total_lflows
-ne 0])
> > >
> > > I'm surprised that the above change is needed, since OVS_WAIT_UNTIL
> > > should wait until the condition is true.
> >
> >
> > Yes you are right. This is not needed, but I think it’s not harmful
either.
> > Do you want me to send a v2 with this removed?
>
> I don't think you need to send a v2, but I'd prefer to not check in that
> part of the change.
>
> > The second place is where this test occasionally fails.
>
> That one makes sense!  For that part:
> Acked-by: Ben Pfaff 
>

Thanks Ben. I applied with the first change removed.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] ofproto-dpif-xlate: Fix continuations with OF instructions in OF1.1+.

2021-07-19 Thread Ben Pfaff
On Wed, Jul 07, 2021 at 11:51:50AM -0700, Ben Pfaff wrote:
> Open vSwitch supports OpenFlow "instructions", which were introduced in
> OpenFlow 1.1 and act like restricted kinds of actions that can only
> appear in a particular order and particular circumstances.  OVS did
> not support two of these instructions, "write_metadata" and
> "goto_table", properly in the case where they appeared in a flow that
> needed to be frozen for continuations.

I would appreciate a review for this bug fix.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v3 2/2] Minimize the number of time calls in time_poll()

2021-07-19 Thread Ben Pfaff
On Fri, Jul 16, 2021 at 02:42:33PM +0100, anton.iva...@cambridgegreys.com wrote:
> From: Anton Ivanov 
> 
> time_poll() makes an excessive number of time_msec() calls
> which incur a performance penalty.
> 
> 1. Avoid time_msec() call for timeout calculation when time_poll()
> is asked to skip poll()
> 
> 2. Reuse the time_msec() result from deadline calculation for
> last_wakeup and timeout calculation.
> 
> Signed-off-by: Anton Ivanov 

I'll take another look at this in v4.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v3 1/2] Optimize the poll loop for poll_immediate_wake()

2021-07-19 Thread Ben Pfaff
On Fri, Jul 16, 2021 at 02:42:32PM +0100, anton.iva...@cambridgegreys.com wrote:
> From: Anton Ivanov 
> 
> If we are not obtaining any useful information out of the poll(),
> such as is a fd busy or not, we do not need to do a poll() if
> an immediate_wake() has been requested.
> 
> This cuts out all the pollfd hash additions, forming the poll
> arguments and the actual poll() after a call to
> poll_immediate_wake()
> 
> Signed-off-by: Anton Ivanov 

Thanks for v3.

I believe that the existing code here properly handles the pathological
case where the current time is less than 0.  This is a case that I have
seen happen on real systems that have a real-time clock with a bad
current time and do not have proper support for a monotonic clock.  I
believe that your new code does not properly handle this case, because
it treats all times less than 0 as immediate.  I think that you can fix
it by comparing against LLONG_MIN rather than zero.

In poll-loop, I would move
COVERAGE_INC(poll_zero_timeout);
inside the new statement that is already conditional on timeout_when ==
LLONG_MIN.

I don't like the new assumption in time_poll() that n_pollfds == 0 means
we're waking immediately.

Thanks,

Ben.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v2 2/2] Match: Do not print igmp match keyword

2021-07-19 Thread 0-day Robot
Bleep bloop.  Greetings Salvatore Daniele, I am a robot and I have tried out 
your patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.
Patch skipped due to previous failure.

Please check this out.  If you feel there has been an error, please email 
acon...@redhat.com

Thanks,
0-day Robot
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v2 1/2] ovs-save: Save igmp flows in ofp_parse syntax

2021-07-19 Thread 0-day Robot
Bleep bloop.  Greetings Salvatore Daniele, I am a robot and I have tried out 
your patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


checkpatch:
ERROR: Co-author Adrian Moreno  needs to sign off.
Lines checked: 35, Warnings: 0, Errors: 1


Please check this out.  If you feel there has been an error, please email 
acon...@redhat.com

Thanks,
0-day Robot
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH v2 1/2] ovs-save: Save igmp flows in ofp_parse syntax

2021-07-19 Thread Salvatore Daniele
match.c generates the keyword "igmp", which is not supported in ofp-parse.
This means that flow dumps containing 'igmp' can not be restored.

Removing the 'igmp' keyword entirely could break existing scripts in stable
branches, so this patch creates a workaround within ovs-save by converting any
instances of "igmp" within $bridge.flows.dump into "ip, nw_proto=2".

Signed-off-by: Salvatore Daniele 
Co-authored-by: Adrian Moreno 
---
 utilities/ovs-save | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/utilities/ovs-save b/utilities/ovs-save
index 27ce3a9aa..23cb0d9d9 100755
--- a/utilities/ovs-save
+++ b/utilities/ovs-save
@@ -150,7 +150,8 @@ save_flows () {
 ovs-ofctl -O $ofp_version dump-flows --no-names --no-stats "$bridge" | 
\
 sed -e '/NXST_FLOW/d' \
 -e '/OFPST_FLOW/d' \
--e 's/\(idle\|hard\)_age=[^,]*,//g' > \
+-e 's/\(idle\|hard\)_age=[^,]*,//g' \
+-e 's/igmp/ip,nw_proto=2/g' > \
 "$workdir/$bridge.flows.dump"
 done
 echo "rm -rf \"$workdir\""
-- 
2.31.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH v2 2/2] Match: Do not print igmp match keyword

2021-07-19 Thread Salvatore Daniele
The match keyword "igmp" is not supported in ofp-parse, which means
that flow dumps cannot be restored. Previously a workaround was
added to ovs-save to avoid changing output in stable branches.

This patch removes that work around, and instead prints the igmp
match in the accepted format (ip,nw_proto=2). Tests are added, and
NEWS is updated to reflect this change.

Signed-off-by: Salvatore Daniele 
Co-authored-by: Adrian Moreno 
---
 NEWS   | 2 ++
 lib/match.c| 2 --
 tests/ovs-ofctl.at | 6 ++
 utilities/ovs-save | 3 +--
 4 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index 0005c96e8..7ac29e060 100644
--- a/NEWS
+++ b/NEWS
@@ -71,6 +71,8 @@ Post-v2.15.0
- OVS now reports the datapath capability 'ct_zero_snat', which reflects
  whether the SNAT with all-zero IP address is supported.
  See ovs-vswitchd.conf.db(5) for details.
+   - ovs-ofctl dump-flows no longer prints "igmp". Instead the flag 
+ "ip,nw_proto=2" is used. 
 
 
 v2.15.0 - 15 Feb 2021
diff --git a/lib/match.c b/lib/match.c
index ba716579d..4a0778c30 100644
--- a/lib/match.c
+++ b/lib/match.c
@@ -1556,8 +1556,6 @@ match_format(const struct match *match,
 skip_proto = true;
 if (f->nw_proto == IPPROTO_ICMP) {
 ds_put_format(s, "%sicmp%s,", colors.value, colors.end);
-} else if (f->nw_proto == IPPROTO_IGMP) {
-ds_put_format(s, "%sigmp%s,", colors.value, colors.end);
 } else if (f->nw_proto == IPPROTO_TCP) {
 ds_put_format(s, "%stcp%s,", colors.value, colors.end);
 } else if (f->nw_proto == IPPROTO_UDP) {
diff --git a/tests/ovs-ofctl.at b/tests/ovs-ofctl.at
index 604f15c2d..4b3039438 100644
--- a/tests/ovs-ofctl.at
+++ b/tests/ovs-ofctl.at
@@ -190,6 +190,7 @@ udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
 cookie=0x123456789abcdef hard_timeout=10 priority=6 actions=controller
 actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
 ip,actions=set_field:10.4.3.77->ip_src,mod_nw_ecn:2
+ip,nw_proto=2 actions=drop
 sctp actions=drop
 sctp actions=drop
 in_port=0 actions=resubmit:0
@@ -224,6 +225,7 @@ OFPT_FLOW_MOD: ADD udp,nw_src=192.168.0.3,tp_dst=53 
actions=pop_queue,output:1
 OFPT_FLOW_MOD: ADD priority=6 cookie:0x123456789abcdef hard:10 
actions=CONTROLLER:65535
 OFPT_FLOW_MOD: ADD 
actions=note:41.42.43.00.00.00,note:00.01.02.03.04.05.06.07.00.00.00.00.00.00,note:00.00.00.00.00.00
 OFPT_FLOW_MOD: ADD ip actions=mod_nw_src:10.4.3.77,load:0x2->NXM_NX_IP_ECN[]
+OFPT_FLOW_MOD: ADD ip,nw_proto=2 actions=drop
 OFPT_FLOW_MOD: ADD sctp actions=drop
 OFPT_FLOW_MOD: ADD sctp actions=drop
 OFPT_FLOW_MOD: ADD in_port=0 actions=resubmit:0
@@ -257,6 +259,7 @@ udp,nw_src=192.168.0.3,tp_dst=53 
actions=mod_nw_ecn:2,output:1
 cookie=0x123456789abcdef hard_timeout=10 priority=6 actions=controller
 actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
 ip,actions=mod_nw_ttl:1,set_field:10.4.3.77->ip_src
+ip,nw_proto=2 actions=drop
 sctp actions=drop
 sctp actions=drop
 in_port=0 actions=resubmit:0
@@ -277,6 +280,7 @@ OFPT_FLOW_MOD (OF1.1): ADD udp,nw_src=192.168.0.3,tp_dst=53 
actions=mod_nw_ecn:2
 OFPT_FLOW_MOD (OF1.1): ADD priority=6 cookie:0x123456789abcdef hard:10 
actions=CONTROLLER:65535
 OFPT_FLOW_MOD (OF1.1): ADD 
actions=note:41.42.43.00.00.00,note:00.01.02.03.04.05.06.07.00.00.00.00.00.00,note:00.00.00.00.00.00
 OFPT_FLOW_MOD (OF1.1): ADD ip actions=mod_nw_ttl:1,mod_nw_src:10.4.3.77
+OFPT_FLOW_MOD (OF1.1): ADD ip,nw_proto=2 actions=drop
 OFPT_FLOW_MOD (OF1.1): ADD sctp actions=drop
 OFPT_FLOW_MOD (OF1.1): ADD sctp actions=drop
 OFPT_FLOW_MOD (OF1.1): ADD in_port=0 actions=resubmit:0
@@ -300,6 +304,7 @@ actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
 ipv6,actions=set_field:fe80:0123:4567:890a:a6ba:dbff:fefe:59fa->ipv6_src
 sctp actions=set_field:3334->sctp_src
 sctp actions=set_field:4445->sctp_dst
+ip,nw_proto=2 actions=drop
 tcp actions=mod_tp_dst:1234
 udp actions=mod_tp_src:
 ip 
actions=mod_nw_src:10.1.1.2,mod_nw_dst:192.168.10.1,mod_nw_ttl:1,mod_nw_tos:16,mod_nw_ecn:2
@@ -326,6 +331,7 @@ OFPT_FLOW_MOD (OF1.2): ADD 
actions=note:41.42.43.00.00.00,note:00.01.02.03.04.05
 OFPT_FLOW_MOD (OF1.2): ADD ipv6 
actions=set_field:fe80:123:4567:890a:a6ba:dbff:fefe:59fa->ipv6_src
 OFPT_FLOW_MOD (OF1.2): ADD sctp actions=set_field:3334->sctp_src
 OFPT_FLOW_MOD (OF1.2): ADD sctp actions=set_field:4445->sctp_dst
+OFPT_FLOW_MOD (OF1.2): ADD ip,nw_proto=2 actions=drop
 OFPT_FLOW_MOD (OF1.2): ADD tcp actions=set_field:1234->tcp_dst
 OFPT_FLOW_MOD (OF1.2): ADD udp actions=set_field:->udp_src
 OFPT_FLOW_MOD (OF1.2): ADD ip 
actions=set_field:10.1.1.2->ip_src,set_field:192.168.10.1->ip_dst,mod_nw_ttl:1,set_field:4->ip_dscp,set_field:2->nw_ecn
diff --git a/utilities/ovs-save b/utilities/ovs-save
index 23cb0d9d9..27ce3a9aa 100755
--- a/utilities/ovs-save
+++ b/utilities/ovs-save
@@ -150,8 +150,7 @@ save_flows () {
   

[ovs-dev] [PATCH v2 0/2] flow dumps containing igmp match cannot be restored

2021-07-19 Thread Salvatore Daniele
match_format() prints the keyword "igmp" for flows with the field
"ip,nw_proto=2". ofp_parse_protocol does not accept this value.

This results in flow dump restoration failing when the ovs-save script
is used by "ovs-ctl restart" on a dump of flows containing this match.
However, removing the "igmp" keyword entirely could break existing
scripts in stable branches.

The first patch addresses this issue by providing a workaround within
ovs-save to preserve the 'igmp' keyword while allowing flows to be
restored. This change would be backported to all stable branches.

The second patch removes this workaround, and removes the 'igmp' output
entirely, replacing it with 'ip,nw_proto=2'. This has been added to
NEWS, and would be applied in master branch only.

---
v2
- Address comments made of v1 with regard to a work around for stable
  branches
___
___

Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1982743

Signed-off-by: Salatore Daniele 
Co-Authored-by: Adrian Moreno 

Salvatore Daniele (2):
  ovs-save: Save igmp flows in ofp_parse syntax
  Match: Do not print igmp match keyword

 NEWS   | 2 ++
 lib/match.c| 2 --
 tests/ovs-ofctl.at | 6 ++
 3 files changed, 8 insertions(+), 2 deletions(-)

-- 
2.31.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH ovn] ovn-sbctl.at: Fix timing problem of count-flows test.

2021-07-19 Thread Ben Pfaff
On Thu, Jul 15, 2021 at 06:10:40PM -0700, Han Zhou wrote:
> On Thu, Jul 15, 2021 at 4:57 PM Ben Pfaff  wrote:
> 
> > On Thu, Jul 15, 2021 at 04:34:51PM -0700, Han Zhou wrote:
> > > Fixes: 895e02ec0be6("ovn-sbctl.c Add logical flows count numbers")
> > > Signed-off-by: Han Zhou 
> > > ---
> > >  tests/ovn-sbctl.at | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/tests/ovn-sbctl.at b/tests/ovn-sbctl.at
> > > index 16f5dabcc..dabf62d2b 100644
> > > --- a/tests/ovn-sbctl.at
> > > +++ b/tests/ovn-sbctl.at
> > > @@ -200,7 +200,7 @@ Total number of logical flows = 0
> > >  ])
> > >
> > >  # create some logical flows
> > > -check ovn-nbctl ls-add count-test
> > > +check ovn-nbctl --wait=sb ls-add count-test
> > >
> > >  OVS_WAIT_UNTIL([total_lflows=`count_entries`; test $total_lflows -ne 0])
> >
> > I'm surprised that the above change is needed, since OVS_WAIT_UNTIL
> > should wait until the condition is true.
> 
> 
> Yes you are right. This is not needed, but I think it’s not harmful either.
> Do you want me to send a v2 with this removed?

I don't think you need to send a v2, but I'd prefer to not check in that
part of the change.

> The second place is where this test occasionally fails.

That one makes sense!  For that part:
Acked-by: Ben Pfaff 

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v2 2/2] Match: Do not print igmp match keyword

2021-07-19 Thread 0-day Robot
Bleep bloop.  Greetings Salvatore Daniele, I am a robot and I have tried out 
your patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.
Patch skipped due to previous failure.

Please check this out.  If you feel there has been an error, please email 
acon...@redhat.com

Thanks,
0-day Robot
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v2 1/2] ovs-save: Save igmp flows in ofp_parse syntax

2021-07-19 Thread 0-day Robot
Bleep bloop.  Greetings Salvatore Daniele, I am a robot and I have tried out 
your patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


checkpatch:
WARNING: Unexpected sign-offs from developers who are not authors or co-authors 
or committers: Adrian Moreno 
Lines checked: 35, Warnings: 1, Errors: 0


Please check this out.  If you feel there has been an error, please email 
acon...@redhat.com

Thanks,
0-day Robot
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH v2 2/2] Match: Do not print igmp match keyword

2021-07-19 Thread Salvatore Daniele
The match keyword "igmp" is not supported in ofp-parse, which means
that flow dumps cannot be restored. Previously a workaround was
added to ovs-save to avoid changing output in stable branches.

This patch removes that work around, and instead prints the igmp
match in the accepted format (ip,nw_proto=2). Tests are added, and
NEWS is updated to reflect this change.

Signed-off-by: Salvatore Daniele 
Signed-off-by: Adrian Moreno 
---
 NEWS   | 2 ++
 lib/match.c| 2 --
 tests/ovs-ofctl.at | 6 ++
 utilities/ovs-save | 3 +--
 4 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index 0005c96e8..7ac29e060 100644
--- a/NEWS
+++ b/NEWS
@@ -71,6 +71,8 @@ Post-v2.15.0
- OVS now reports the datapath capability 'ct_zero_snat', which reflects
  whether the SNAT with all-zero IP address is supported.
  See ovs-vswitchd.conf.db(5) for details.
+   - ovs-ofctl dump-flows no longer prints "igmp". Instead the flag 
+ "ip,nw_proto=2" is used. 
 
 
 v2.15.0 - 15 Feb 2021
diff --git a/lib/match.c b/lib/match.c
index ba716579d..4a0778c30 100644
--- a/lib/match.c
+++ b/lib/match.c
@@ -1556,8 +1556,6 @@ match_format(const struct match *match,
 skip_proto = true;
 if (f->nw_proto == IPPROTO_ICMP) {
 ds_put_format(s, "%sicmp%s,", colors.value, colors.end);
-} else if (f->nw_proto == IPPROTO_IGMP) {
-ds_put_format(s, "%sigmp%s,", colors.value, colors.end);
 } else if (f->nw_proto == IPPROTO_TCP) {
 ds_put_format(s, "%stcp%s,", colors.value, colors.end);
 } else if (f->nw_proto == IPPROTO_UDP) {
diff --git a/tests/ovs-ofctl.at b/tests/ovs-ofctl.at
index 604f15c2d..4b3039438 100644
--- a/tests/ovs-ofctl.at
+++ b/tests/ovs-ofctl.at
@@ -190,6 +190,7 @@ udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
 cookie=0x123456789abcdef hard_timeout=10 priority=6 actions=controller
 actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
 ip,actions=set_field:10.4.3.77->ip_src,mod_nw_ecn:2
+ip,nw_proto=2 actions=drop
 sctp actions=drop
 sctp actions=drop
 in_port=0 actions=resubmit:0
@@ -224,6 +225,7 @@ OFPT_FLOW_MOD: ADD udp,nw_src=192.168.0.3,tp_dst=53 
actions=pop_queue,output:1
 OFPT_FLOW_MOD: ADD priority=6 cookie:0x123456789abcdef hard:10 
actions=CONTROLLER:65535
 OFPT_FLOW_MOD: ADD 
actions=note:41.42.43.00.00.00,note:00.01.02.03.04.05.06.07.00.00.00.00.00.00,note:00.00.00.00.00.00
 OFPT_FLOW_MOD: ADD ip actions=mod_nw_src:10.4.3.77,load:0x2->NXM_NX_IP_ECN[]
+OFPT_FLOW_MOD: ADD ip,nw_proto=2 actions=drop
 OFPT_FLOW_MOD: ADD sctp actions=drop
 OFPT_FLOW_MOD: ADD sctp actions=drop
 OFPT_FLOW_MOD: ADD in_port=0 actions=resubmit:0
@@ -257,6 +259,7 @@ udp,nw_src=192.168.0.3,tp_dst=53 
actions=mod_nw_ecn:2,output:1
 cookie=0x123456789abcdef hard_timeout=10 priority=6 actions=controller
 actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
 ip,actions=mod_nw_ttl:1,set_field:10.4.3.77->ip_src
+ip,nw_proto=2 actions=drop
 sctp actions=drop
 sctp actions=drop
 in_port=0 actions=resubmit:0
@@ -277,6 +280,7 @@ OFPT_FLOW_MOD (OF1.1): ADD udp,nw_src=192.168.0.3,tp_dst=53 
actions=mod_nw_ecn:2
 OFPT_FLOW_MOD (OF1.1): ADD priority=6 cookie:0x123456789abcdef hard:10 
actions=CONTROLLER:65535
 OFPT_FLOW_MOD (OF1.1): ADD 
actions=note:41.42.43.00.00.00,note:00.01.02.03.04.05.06.07.00.00.00.00.00.00,note:00.00.00.00.00.00
 OFPT_FLOW_MOD (OF1.1): ADD ip actions=mod_nw_ttl:1,mod_nw_src:10.4.3.77
+OFPT_FLOW_MOD (OF1.1): ADD ip,nw_proto=2 actions=drop
 OFPT_FLOW_MOD (OF1.1): ADD sctp actions=drop
 OFPT_FLOW_MOD (OF1.1): ADD sctp actions=drop
 OFPT_FLOW_MOD (OF1.1): ADD in_port=0 actions=resubmit:0
@@ -300,6 +304,7 @@ actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
 ipv6,actions=set_field:fe80:0123:4567:890a:a6ba:dbff:fefe:59fa->ipv6_src
 sctp actions=set_field:3334->sctp_src
 sctp actions=set_field:4445->sctp_dst
+ip,nw_proto=2 actions=drop
 tcp actions=mod_tp_dst:1234
 udp actions=mod_tp_src:
 ip 
actions=mod_nw_src:10.1.1.2,mod_nw_dst:192.168.10.1,mod_nw_ttl:1,mod_nw_tos:16,mod_nw_ecn:2
@@ -326,6 +331,7 @@ OFPT_FLOW_MOD (OF1.2): ADD 
actions=note:41.42.43.00.00.00,note:00.01.02.03.04.05
 OFPT_FLOW_MOD (OF1.2): ADD ipv6 
actions=set_field:fe80:123:4567:890a:a6ba:dbff:fefe:59fa->ipv6_src
 OFPT_FLOW_MOD (OF1.2): ADD sctp actions=set_field:3334->sctp_src
 OFPT_FLOW_MOD (OF1.2): ADD sctp actions=set_field:4445->sctp_dst
+OFPT_FLOW_MOD (OF1.2): ADD ip,nw_proto=2 actions=drop
 OFPT_FLOW_MOD (OF1.2): ADD tcp actions=set_field:1234->tcp_dst
 OFPT_FLOW_MOD (OF1.2): ADD udp actions=set_field:->udp_src
 OFPT_FLOW_MOD (OF1.2): ADD ip 
actions=set_field:10.1.1.2->ip_src,set_field:192.168.10.1->ip_dst,mod_nw_ttl:1,set_field:4->ip_dscp,set_field:2->nw_ecn
diff --git a/utilities/ovs-save b/utilities/ovs-save
index 23cb0d9d9..27ce3a9aa 100755
--- a/utilities/ovs-save
+++ b/utilities/ovs-save
@@ -150,8 +150,7 @@ save_flows () {

[ovs-dev] [PATCH v2 1/2] ovs-save: Save igmp flows in ofp_parse syntax

2021-07-19 Thread Salvatore Daniele
match.c generates the keyword "igmp", which is not supported in ofp-parse.
This means that flow dumps containing 'igmp' can not be restored.

Removing the 'igmp' keyword entirely could break existing scripts in stable
branches, so this patch creates a workaround within ovs-save by converting any
instances of "igmp" within $bridge.flows.dump into "ip, nw_proto=2".

Signed-off-by: Salvatore Daniele 
Signed-off-by: Adrian Moreno 
---
 utilities/ovs-save | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/utilities/ovs-save b/utilities/ovs-save
index 27ce3a9aa..23cb0d9d9 100755
--- a/utilities/ovs-save
+++ b/utilities/ovs-save
@@ -150,7 +150,8 @@ save_flows () {
 ovs-ofctl -O $ofp_version dump-flows --no-names --no-stats "$bridge" | 
\
 sed -e '/NXST_FLOW/d' \
 -e '/OFPST_FLOW/d' \
--e 's/\(idle\|hard\)_age=[^,]*,//g' > \
+-e 's/\(idle\|hard\)_age=[^,]*,//g' \
+-e 's/igmp/ip,nw_proto=2/g' > \
 "$workdir/$bridge.flows.dump"
 done
 echo "rm -rf \"$workdir\""
-- 
2.31.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH v2 0/2] flow dumps containing igmp match cannot be restored

2021-07-19 Thread Salvatore Daniele
match_format() prints the keyword "igmp" for flows with the field
"ip,nw_proto=2". ofp_parse_protocol does not accept this value.

This results in flow dump restoration failing when the ovs-save script
is used by "ovs-ctl restart" on a dump of flows containing this match.
However, removing the "igmp" keyword entirely could break existing
scripts in stable branches.

The first patch addresses this issue by providing a workaround within
ovs-save to preserve the 'igmp' keyword while allowing flows to be
restored. This change would be backported to all stable branches.

The second patch removes this workaround, and removes the 'igmp' output
entirely, replacing it with 'ip,nw_proto=2'. This has been added to
NEWS, and would be applied in master branch only.

---
v2
- Address comments made of v1 with regard to a work around for stable
  branches
___
___

Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1982743

Signed-off-by: Salatore Daniele 
Signed-off-by: Adrian Moreno 


Salvatore Daniele (2):
  ovs-save: Save igmp flows in ofp_parse syntax
  Match: Do not print igmp match keyword

 NEWS   | 2 ++
 lib/match.c| 2 --
 tests/ovs-ofctl.at | 6 ++
 3 files changed, 8 insertions(+), 2 deletions(-)

-- 
2.31.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH v2 ovn] controller: set vlan-limit=0

2021-07-19 Thread Ihar Hrachyshka
This allows L3+ ACLs to match against double tagged vlan traffic on
vlan-passthru switches.

The default in OVS is vlan-limit=1 for backwards compatibility. This
means packets are not "parsed" deeper than one tag level.

This patch sets it to 0, which means "parse as deep as OVS supports".
Right now it's effectively the same as setting it to "2", which is the
maximum number of tag levels that OVS supports right now.

It is already set to 2 in puppet-vswitch that is used in some OpenStack
distributions:

https://opendev.org/openstack/puppet-vswitch/commit/14011d69c18e628a3466fa71db25cefb7adff425

Signed-off-by: Ihar Hrachyshka 

---

v1: initial version
v2: set vlan-limit=0 only if it's not no-op
---
 controller/ovn-controller.c | 13 ++
 tests/ovn.at| 91 +
 2 files changed, 104 insertions(+)

diff --git a/controller/ovn-controller.c b/controller/ovn-controller.c
index 2418c301b..845c183a6 100644
--- a/controller/ovn-controller.c
+++ b/controller/ovn-controller.c
@@ -915,6 +915,7 @@ ctrl_register_ovs_idl(struct ovsdb_idl *ovs_idl)
  * their interest explicitly. */
 ovsdb_idl_add_table(ovs_idl, &ovsrec_table_open_vswitch);
 ovsdb_idl_add_column(ovs_idl, &ovsrec_open_vswitch_col_external_ids);
+ovsdb_idl_add_column(ovs_idl, &ovsrec_open_vswitch_col_other_config);
 ovsdb_idl_add_column(ovs_idl, &ovsrec_open_vswitch_col_bridges);
 ovsdb_idl_add_column(ovs_idl, &ovsrec_open_vswitch_col_datapaths);
 ovsdb_idl_add_table(ovs_idl, &ovsrec_table_interface);
@@ -3190,6 +3191,18 @@ main(int argc, char *argv[])
 process_br_int(ovs_idl_txn, bridge_table, ovs_table,
&br_int, &br_int_dp);
 
+/* Enable ACL matching for double tagged traffic. */
+if (ovs_idl_txn) {
+const struct ovsrec_open_vswitch *cfg =
+ovsrec_open_vswitch_table_first(ovs_table);
+const char *vlan_limit = smap_get_def(
+&cfg->other_config, "vlan-limit", "-1");
+if (strcmp(vlan_limit, "0")) {
+ovsrec_open_vswitch_update_other_config_setkey(
+cfg, "vlan-limit", "0");
+}
+}
+
 if (ovsdb_idl_has_ever_connected(ovnsb_idl_loop.idl) &&
 northd_version_match) {
 
diff --git a/tests/ovn.at b/tests/ovn.at
index 93e1a0267..5f2738b58 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -1907,6 +1907,97 @@ AT_CLEANUP
 
 AT_BANNER([OVN end-to-end tests])
 
+OVN_FOR_EACH_NORTHD([
+AT_SETUP([ovn -- enables vlan-limit=0])
+ovn_start
+
+net_add n
+check ovs-vsctl add-br br-phys
+ovn_attach n br-phys 192.168.0.1
+
+OVS_WAIT_UNTIL([test x`ovs-vsctl get Open_vSwitch . other_config:vlan-limit | 
tr -d '""'` = x0])
+
+AT_CLEANUP
+])
+
+OVN_FOR_EACH_NORTHD([
+AT_SETUP([ovn -- allows ACLs to match against vlan-transparent double tagged 
traffic L3 fields])
+ovn_start
+
+for i in 1 2; do
+check ovn-nbctl ls-add lsw$i
+check ovn-nbctl --wait=sb add Logical-Switch lsw$i other_config 
vlan-passthru=true
+
+ln_port_name=ln-$i
+check ovn-nbctl lsp-add lsw$i $ln_port_name
+check ovn-nbctl lsp-set-addresses $ln_port_name unknown
+check ovn-nbctl lsp-set-type $ln_port_name localnet
+check ovn-nbctl lsp-set-options $ln_port_name network_name=phys
+net_add n
+done
+
+# two hypervisors, each connected to the same network
+for i in 1 2; do
+sim_add hv-$i
+as hv-$i
+ovs-vsctl add-br br-phys
+ovs-vsctl set open . external-ids:ovn-bridge-mappings=phys:br-phys
+ovn_attach n br-phys 192.168.0.$i
+done
+
+check ovs-vsctl add-port br-phys tap
+for i in 1 2; do
+as hv-$i
+check ovs-vsctl add-port br-int vif$i -- set Interface vif$i \
+external-ids:iface-id=lp$i options:tx_pcap=vif$i-tx.pcap 
options:rxq_pcap=vif$i-rx.pcap
+check ovn-nbctl lsp-add lsw$i lp$i
+check ovn-nbctl lsp-set-addresses lp$i "f0:00:00:00:00:0$i 10.0.0.$i"
+done
+for i in 1 2; do
+OVS_WAIT_UNTIL([test x`ovn-nbctl lsp-get-up lp$i` = xup])
+> $i.expected
+done
+
+test_tcp_packet() {
+local inport=$1 eth_dst=$2 eth_src=$3 ip_dst=$4 ip_src=$5 eout=$6 lout=$7 
fail=$8
+tag=81ff
+local 
packet=${eth_dst}${eth_src}${tag}${tag}080045284000ff06${ip_src}${ip_dst}0001000100015000
+as hv-$inport ovs-appctl netdev-dummy/receive vif$inport $packet
+if [[ $fail -eq 0 ]]; then
+echo $packet >> ${eout#lp}.expected
+fi
+}
+
+# first check that acl drop rule works for tagged traffic
+for i in 1 2; do
+check ovn-nbctl acl-add lsw$i to-lport 1000 'tcp' drop
+done
+check ovn-nbctl --wait=hv sync
+
+test_tcp_packet 1 f002 f001 0a02 0a01 lp2 lp2 1
+test_tcp_packet 2 f001 f002 0a01 0a02 lp1 lp1 1
+
+for i in 1 2; do
+OVN_CHECK_PACKETS_REMOVE_BROADCAST([vif$i-tx.pcap], [$i.expected])
+done
+
+# now check that with no rule traffic passes through
+for i in 1 2; do
+check ovn-nbctl

[ovs-dev] [PATCH ovn] controller: set vlan-limit=0

2021-07-19 Thread Ihar Hrachyshka
This allows L3+ ACLs to match against double tagged vlan traffic on
vlan-passthru switches.

The default in OVS is vlan-limit=1 for backwards compatibility. This
means packets are not "parsed" deeper than one tag level.

This patch sets it to 0, which means "parse as deep as OVS supports".
Right now it's effectively the same as setting it to "2", which is the
maximum number of tag levels that OVS supports right now.

It is already set to 2 in puppet-vswitch that is used in some OpenStack
distributions:

https://opendev.org/openstack/puppet-vswitch/commit/14011d69c18e628a3466fa71db25cefb7adff425

Signed-off-by: Ihar Hrachyshka 

---

v1: initial version
v2: set vlan-limit=0 only if it's not no-op
---
 controller/ovn-controller.c | 13 ++
 tests/ovn.at| 91 +
 2 files changed, 104 insertions(+)

diff --git a/controller/ovn-controller.c b/controller/ovn-controller.c
index 2418c301b..845c183a6 100644
--- a/controller/ovn-controller.c
+++ b/controller/ovn-controller.c
@@ -915,6 +915,7 @@ ctrl_register_ovs_idl(struct ovsdb_idl *ovs_idl)
  * their interest explicitly. */
 ovsdb_idl_add_table(ovs_idl, &ovsrec_table_open_vswitch);
 ovsdb_idl_add_column(ovs_idl, &ovsrec_open_vswitch_col_external_ids);
+ovsdb_idl_add_column(ovs_idl, &ovsrec_open_vswitch_col_other_config);
 ovsdb_idl_add_column(ovs_idl, &ovsrec_open_vswitch_col_bridges);
 ovsdb_idl_add_column(ovs_idl, &ovsrec_open_vswitch_col_datapaths);
 ovsdb_idl_add_table(ovs_idl, &ovsrec_table_interface);
@@ -3190,6 +3191,18 @@ main(int argc, char *argv[])
 process_br_int(ovs_idl_txn, bridge_table, ovs_table,
&br_int, &br_int_dp);
 
+/* Enable ACL matching for double tagged traffic. */
+if (ovs_idl_txn) {
+const struct ovsrec_open_vswitch *cfg =
+ovsrec_open_vswitch_table_first(ovs_table);
+const char *vlan_limit = smap_get_def(
+&cfg->other_config, "vlan-limit", "-1");
+if (strcmp(vlan_limit, "0")) {
+ovsrec_open_vswitch_update_other_config_setkey(
+cfg, "vlan-limit", "0");
+}
+}
+
 if (ovsdb_idl_has_ever_connected(ovnsb_idl_loop.idl) &&
 northd_version_match) {
 
diff --git a/tests/ovn.at b/tests/ovn.at
index 93e1a0267..5f2738b58 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -1907,6 +1907,97 @@ AT_CLEANUP
 
 AT_BANNER([OVN end-to-end tests])
 
+OVN_FOR_EACH_NORTHD([
+AT_SETUP([ovn -- enables vlan-limit=0])
+ovn_start
+
+net_add n
+check ovs-vsctl add-br br-phys
+ovn_attach n br-phys 192.168.0.1
+
+OVS_WAIT_UNTIL([test x`ovs-vsctl get Open_vSwitch . other_config:vlan-limit | 
tr -d '""'` = x0])
+
+AT_CLEANUP
+])
+
+OVN_FOR_EACH_NORTHD([
+AT_SETUP([ovn -- allows ACLs to match against vlan-transparent double tagged 
traffic L3 fields])
+ovn_start
+
+for i in 1 2; do
+check ovn-nbctl ls-add lsw$i
+check ovn-nbctl --wait=sb add Logical-Switch lsw$i other_config 
vlan-passthru=true
+
+ln_port_name=ln-$i
+check ovn-nbctl lsp-add lsw$i $ln_port_name
+check ovn-nbctl lsp-set-addresses $ln_port_name unknown
+check ovn-nbctl lsp-set-type $ln_port_name localnet
+check ovn-nbctl lsp-set-options $ln_port_name network_name=phys
+net_add n
+done
+
+# two hypervisors, each connected to the same network
+for i in 1 2; do
+sim_add hv-$i
+as hv-$i
+ovs-vsctl add-br br-phys
+ovs-vsctl set open . external-ids:ovn-bridge-mappings=phys:br-phys
+ovn_attach n br-phys 192.168.0.$i
+done
+
+check ovs-vsctl add-port br-phys tap
+for i in 1 2; do
+as hv-$i
+check ovs-vsctl add-port br-int vif$i -- set Interface vif$i \
+external-ids:iface-id=lp$i options:tx_pcap=vif$i-tx.pcap 
options:rxq_pcap=vif$i-rx.pcap
+check ovn-nbctl lsp-add lsw$i lp$i
+check ovn-nbctl lsp-set-addresses lp$i "f0:00:00:00:00:0$i 10.0.0.$i"
+done
+for i in 1 2; do
+OVS_WAIT_UNTIL([test x`ovn-nbctl lsp-get-up lp$i` = xup])
+> $i.expected
+done
+
+test_tcp_packet() {
+local inport=$1 eth_dst=$2 eth_src=$3 ip_dst=$4 ip_src=$5 eout=$6 lout=$7 
fail=$8
+tag=81ff
+local 
packet=${eth_dst}${eth_src}${tag}${tag}080045284000ff06${ip_src}${ip_dst}0001000100015000
+as hv-$inport ovs-appctl netdev-dummy/receive vif$inport $packet
+if [[ $fail -eq 0 ]]; then
+echo $packet >> ${eout#lp}.expected
+fi
+}
+
+# first check that acl drop rule works for tagged traffic
+for i in 1 2; do
+check ovn-nbctl acl-add lsw$i to-lport 1000 'tcp' drop
+done
+check ovn-nbctl --wait=hv sync
+
+test_tcp_packet 1 f002 f001 0a02 0a01 lp2 lp2 1
+test_tcp_packet 2 f001 f002 0a01 0a02 lp1 lp1 1
+
+for i in 1 2; do
+OVN_CHECK_PACKETS_REMOVE_BROADCAST([vif$i-tx.pcap], [$i.expected])
+done
+
+# now check that with no rule traffic passes through
+for i in 1 2; do
+check ovn-nbctl

Re: [ovs-dev] [PATCH ovn] tests: check localport->localnet->external flows cleared

2021-07-19 Thread Numan Siddique
On Thu, Jul 15, 2021 at 4:39 PM Ihar Hrachyshka  wrote:
>
> In addition to external port deleted scenario already covered in the
> test scenario, also validate that HA group change or unset also
> behaves properly (rules allowing external port traffic to leak into
> localnet gone).
>
> Related: 1148580290d0a ("Don't suppress localport traffic directed to
> external port")
>
> Signed-off-by: Ihar Hrachyshka 

Thanks.  I applied the patch.

Numan

> ---
>  tests/ovn.at | 42 +++---
>  1 file changed, 31 insertions(+), 11 deletions(-)
>
> diff --git a/tests/ovn.at b/tests/ovn.at
> index 93e1a0267..9cdf130e9 100644
> --- a/tests/ovn.at
> +++ b/tests/ovn.at
> @@ -12198,24 +12198,28 @@ send_garp() {
>  ovs-appctl netdev-dummy/receive $inport $request
>  }
>
> -spa=$(ip_to_hex 10 0 0 1)
> -tpa=$(ip_to_hex 10 0 0 2)
> -send_garp lp 0001 0002 $spa $tpa
> -
> -spa=$(ip_to_hex 10 0 0 1)
> -tpa=$(ip_to_hex 10 0 0 10)
> -send_garp lp 0001 0010 $spa $tpa
> +send_frames() {
> +spa=$(ip_to_hex 10 0 0 1)
> +tpa=$(ip_to_hex 10 0 0 2)
> +send_garp lp 0001 0002 $spa $tpa
> +
> +spa=$(ip_to_hex 10 0 0 1)
> +tpa=$(ip_to_hex 10 0 0 10)
> +send_garp lp 0001 0010 $spa $tpa
> +
> +spa=$(ip_to_hex 10 0 0 1)
> +tpa=$(ip_to_hex 10 0 0 3)
> +send_garp lp 0001 0003 $spa $tpa
> +}
>
> -spa=$(ip_to_hex 10 0 0 1)
> -tpa=$(ip_to_hex 10 0 0 3)
> -send_garp lp 0001 0003 $spa $tpa
> +send_frames
>
>  dnl external traffic from localport should be sent to localnet
>  AT_CHECK([tcpdump -r main/br-phys_n1-tx.pcap arp[[24:4]]=0x0a02 | wc 
> -l],[0],[dnl
>  1
>  ],[ignore])
>
> -#dnl ...regardless of localnet / external ports creation order
> +dnl ...regardless of localnet / external ports creation order
>  AT_CHECK([tcpdump -r main/br-phys_n1-tx.pcap arp[[24:4]]=0x0a0a | wc 
> -l],[0],[dnl
>  1
>  ],[ignore])
> @@ -12225,6 +12229,22 @@ AT_CHECK([tcpdump -r main/br-phys_n1-tx.pcap 
> arp[[24:4]]=0x0a03 | wc -l],[0]
>  0
>  ],[ignore])
>
> +# now disown both external ports, one by moving to another (non-existing)
> +# chassis, another by removing the port from any ha groups
> +check ovn-nbctl --wait=sb ha-chassis-group-add fake_hagrp
> +fake_hagrp_uuid=`ovn-nbctl --bare --columns _uuid find ha_chassis_group 
> name=fake_hagrp`
> +check ovn-nbctl set logical_switch_port lext 
> ha_chassis_group=$fake_hagrp_uuid
> +check ovn-nbctl clear logical_switch_port lext2 ha_chassis_group
> +
> +# check that traffic no longer leaks into localnet
> +send_frames
> +
> +for suffix in 2 a; do
> +AT_CHECK([tcpdump -r main/br-phys_n1-tx.pcap 
> arp[[24:4]]=0x0a0${suffix} | wc -l],[0],[dnl
> +1
> +],[ignore])
> +done
> +
>  AT_CLEANUP
>  ])
>
> --
> 2.31.1
>
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] FW: [ovs-dev v1 1-1] datapath-windows-Correct checksum for DNAT action

2021-07-19 Thread Ben Pfaff
On Sun, Jul 18, 2021 at 04:22:02AM +, Wilson Peng wrote:
> Hi,  d...@openvswitch.org ,
> 
> I would like to send out one patch for some issue found on datapah-windows in 
> OVS repo,
> 
> I have sent the patch via the email attached in the mail and the guided doc to
> Submit the patch is got via link below.
>  
> https://docs.openvswitch.org/en/latest/internals/contributing/submitting-patches/
> 
> And I also subscribe the mail-list for ovs-dev, but I could not get the patch 
> I have submitted.
> 
> This is the first time I sent out the patch into the OVS community. Not sure 
> how could I go
> To proceed for the patch submitting.

I don't think I saw a patch get caught in the spam filters (I would have
released it if I had), so this is pretty odd.

We have several submitters who submit from vmware.com email addresses,
so I don't think that's the problem.

If you can't figure it out, you could always use a different email
account to submit the patches (you can still use the vmware.com address
as the commit author), or you could submit PRs against github instead.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] Documentation: Remove duplicate words.

2021-07-19 Thread Ben Pfaff
On Mon, Jul 19, 2021 at 01:27:16PM +0200, David Marchand wrote:
> This is a simple cleanup with a script of mine.
> 
> Signed-off-by: David Marchand 
> ---
> This script is a bit too silly/simplistic and requires manual review
> (too many false positives), but I don't think it is worth investing too
> much time into integrating this kind of check in utilities/checkpatch.py.

Thanks, pushed!
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH ovn] ovn.at: Fix "Symmetric IPv6 ECMP reply flows" test.

2021-07-19 Thread Mark Gray
On 19/07/2021 14:51, Dumitru Ceara wrote:
> When running tests against OVS master branch, the "Symmetric IPv6 ECMP
> reply flows" test was failing because it wasn't taking into account the
> possibility that null-SNAT might be supported by the userspace datapath
> (which it is, since ba16a36f358a ("dpif-netdev: Add all-zero SNAT to the
> advertised features of ct.")).
> 
> Fixes: 58683a4271e6 ("ovn-controller: Handle DNAT/no-NAT conntrack tuple 
> collisions.")
> Signed-off-by: Dumitru Ceara 
> ---
>  tests/ovn.at | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/ovn.at b/tests/ovn.at
> index 93e1a0267..fa86052bf 100644
> --- a/tests/ovn.at
> +++ b/tests/ovn.at
> @@ -23447,7 +23447,7 @@ AT_CHECK([
>  for hv in 1 2; do
>  grep table=15 hv${hv}flows | \
>  grep "priority=100" | \
> -grep -c 
> "ct(commit,zone=NXM_NX_REG11\\[[0..15\\]],exec(move:NXM_OF_ETH_SRC\\[[\\]]->NXM_NX_CT_LABEL\\[[32..79\\]],load:0x[[0-9]]->NXM_NX_CT_LABEL\\[[80..95\\]]))"
> +grep -c 
> "ct(commit,zone=NXM_NX_REG11\\[[0..15\\]],.*exec(move:NXM_OF_ETH_SRC\\[[\\]]->NXM_NX_CT_LABEL\\[[32..79\\]],load:0x[[0-9]]->NXM_NX_CT_LABEL\\[[80..95\\]]))"
>  
>  grep table=22 hv${hv}flows | \
>  grep "priority=200" | \
> 


Acked-by: Mark D. Gray 

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH v2] tests: fix module not find error for pyhton ver less than 3.6

2021-07-19 Thread kumar Amber
This fixes the flake8 error on pyhton version older than 3.6
as ModuleNotFoundError in not available before 3.6 and that is now
replaced to ImportError which is present in earlier versions.

../../tests/mfex_fuzzy.py:5:8: F821 undefined name 'ModuleNotFoundError'
2653Makefile:5826: recipe for target 'flake8-check' failed

Fixes: 50be6715c0 ("test/sytem-dpdk: Add unit test for mfex autovalidator")
Signed-off-by: kumar Amber 

--
v2:
- remove try and catch
- change pip3 to import to skip the fuzzy tests.
--
---
 tests/mfex_fuzzy.py  | 7 ++-
 tests/system-dpdk.at | 2 +-
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/tests/mfex_fuzzy.py b/tests/mfex_fuzzy.py
index 5b056bb48..73e39d9de 100755
--- a/tests/mfex_fuzzy.py
+++ b/tests/mfex_fuzzy.py
@@ -1,9 +1,6 @@
 #!/usr/bin/python3
-try:
-from scapy.all import RandMAC, RandIP, PcapWriter, RandIP6, RandShort, fuzz
-from scapy.all import IPv6, Dot1Q, IP, Ether, UDP, TCP
-except ModuleNotFoundError as err:
-print(err + ": Scapy")
+from scapy.all import RandMAC, RandIP, PcapWriter, RandIP6, RandShort, fuzz
+from scapy.all import IPv6, Dot1Q, IP, Ether, UDP, TCP
 import sys
 
 path = str(sys.argv[1]) + "/pcap/fuzzy.pcap"
diff --git a/tests/system-dpdk.at b/tests/system-dpdk.at
index 7091a58ad..e0e750fde 100644
--- a/tests/system-dpdk.at
+++ b/tests/system-dpdk.at
@@ -263,7 +263,7 @@ dnl 
--
 dnl Add standard DPDK PHY port
 AT_SETUP([OVS-DPDK - MFEX Autovalidator Fuzzy])
 AT_KEYWORDS([dpdk])
-AT_SKIP_IF([! pip3 list | grep scapy], [], [])
+AT_SKIP_IF([! $PYTHON3 -c "import scapy"], [], [])
 AT_CHECK([$PYTHON3 $srcdir/mfex_fuzzy.py $srcdir], [], [stdout])
 OVS_DPDK_START()
 
-- 
2.25.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH ovn] ovn.at: Fix "Symmetric IPv6 ECMP reply flows" test.

2021-07-19 Thread Dumitru Ceara
When running tests against OVS master branch, the "Symmetric IPv6 ECMP
reply flows" test was failing because it wasn't taking into account the
possibility that null-SNAT might be supported by the userspace datapath
(which it is, since ba16a36f358a ("dpif-netdev: Add all-zero SNAT to the
advertised features of ct.")).

Fixes: 58683a4271e6 ("ovn-controller: Handle DNAT/no-NAT conntrack tuple 
collisions.")
Signed-off-by: Dumitru Ceara 
---
 tests/ovn.at | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/ovn.at b/tests/ovn.at
index 93e1a0267..fa86052bf 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -23447,7 +23447,7 @@ AT_CHECK([
 for hv in 1 2; do
 grep table=15 hv${hv}flows | \
 grep "priority=100" | \
-grep -c 
"ct(commit,zone=NXM_NX_REG11\\[[0..15\\]],exec(move:NXM_OF_ETH_SRC\\[[\\]]->NXM_NX_CT_LABEL\\[[32..79\\]],load:0x[[0-9]]->NXM_NX_CT_LABEL\\[[80..95\\]]))"
+grep -c 
"ct(commit,zone=NXM_NX_REG11\\[[0..15\\]],.*exec(move:NXM_OF_ETH_SRC\\[[\\]]->NXM_NX_CT_LABEL\\[[32..79\\]],load:0x[[0-9]]->NXM_NX_CT_LABEL\\[[80..95\\]]))"
 
 grep table=22 hv${hv}flows | \
 grep "priority=200" | \
-- 
2.27.0

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v1] tests: fix python2 module not find error

2021-07-19 Thread Amber, Kumar
Hi IIya,

Will update the v2 with both the changes.

Br
Amber

> -Original Message-
> From: Ilya Maximets 
> Sent: Monday, July 19, 2021 6:55 PM
> To: Amber, Kumar ; Ilya Maximets
> ; ovs-dev@openvswitch.org
> Cc: Stokes, Ian 
> Subject: Re: [PATCH v1] tests: fix python2 module not find error
> 
> On 7/19/21 1:35 PM, Amber, Kumar wrote:
> > Hi llya,
> >
> >
> > Pls find my comments inline.
> >
> >> -Original Message-
> >> From: Ilya Maximets 
> >> Sent: Monday, July 19, 2021 4:51 PM
> >> To: Amber, Kumar ; Ilya Maximets
> >> ; ovs-dev@openvswitch.org
> >> Cc: Stokes, Ian 
> >> Subject: Re: [PATCH v1] tests: fix python2 module not find error
> >>
> >> On 7/19/21 1:03 PM, Amber, Kumar wrote:
> >>> Hi llya,
> >>>
> >>> Pls find the comments inline.
> >>>
>  -Original Message-
>  From: Ilya Maximets 
>  Sent: Monday, July 19, 2021 4:07 PM
>  To: Ilya Maximets ; Amber, Kumar
>  ; ovs-dev@openvswitch.org
>  Cc: Stokes, Ian 
>  Subject: Re: [PATCH v1] tests: fix python2 module not find error
> 
>  On 7/19/21 12:35 PM, Ilya Maximets wrote:
> > On 7/17/21 5:21 AM, Amber, Kumar wrote:
> >> Hi llya,
> >>
> >> This is what I get after a minor tweek :
> >> "except ImportError as err:
> >>  print(err)"
> >>
> >> when Scapy is not present :
> >>
> >> No module named 'scapy'
> >> Traceback (most recent call last):
> >>   File "./../mfex_fuzzy.py", line 10, in 
> >> pktdump = PcapWriter(path, append=False, sync=True)
> >> NameError: name 'PcapWriter' is not defined
> >>
> >> Is this ohk ?
> >
> > I don't understand why we're catching this exception.
> > Even with your changes if the package is not available, we will
> > catch the ImportError, print it and go further, later while trying
> > to use modules that wasn't imported we will get another more vague
> >> exception.
> > So what is the port catching ImportError in the first place?
> 
>  s/port/point/
> 
> >
> > If we'll exit after printing... well, but doesn't python print
> > exception trace by itself?
> >
> > BTW, the title of this patch is incorrect.  We do not support
> > python2, this problem is with python3 < 3.6.
> >>>
> >>> Yes makes sense now logs are very clear we don’t need the try and
> >>> catch block  at all removed in the patch And fixed the heading .
> >>>
> >>> Traceback (most recent call last):
> >>>   File "./mfex_fuzzy.py", line 2, in 
> >>> from scapy.all import RandMAC, RandIP, PcapWriter, RandIP6,
> >>> RandShort, fuzz
> >>> ModuleNotFoundError: No module named 'scapy
> >>
> >> OK.  And since we're here, the pip3 might not be available on a
> >> system, so checking for 'pip3 list' is not reliable.
> >> Please, replace it with the import attempt. See how idl tests are
> >> checking for SSL support for example:
> >>
> >> https://github.com/openvswitch/ovs/blob/master/tests/ovsdb-idl.at#L22
> >> 8-
> >> L230
> >>
> >
> > -AT_SKIP_IF([! pip3 list | grep scapy], [], [])
> > +AT_SKIP_IF([! $PYTHON3 -c "import scapy"], [], [])
> >
> >
> > And with Scapy :
> >   6: OVS-DPDK - MFEX Autovalidator   ok
> >   7: OVS-DPDK - MFEX Autovalidator Fuzzy ok
> >   8: OVS-DPDK - MFEX Configuration   ok
> >
> > Without scapy :
> >
> >   6: OVS-DPDK - MFEX Autovalidator   ok
> >   7: OVS-DPDK - MFEX Autovalidator Fuzzy skipped 
> > (system-dpdk.at:266)
> >   8: OVS-DPDK - MFEX Configuration   ok
> >
> 
> I didn't test, but it seems OK to me.  Thanks.
> 
> > Regards
> > Amber
> >
> >>
> >
> > Best regards, Ilya Maximets.
> >
> >>
> >> Regards
> >> Amber
> >>
> >>
> >>> -Original Message-
> >>> From: Ilya Maximets 
> >>> Sent: Saturday, July 17, 2021 12:21 AM
> >>> To: Amber, Kumar ; ovs-
> >> d...@openvswitch.org
> >>> Cc: i.maxim...@ovn.org; Stokes, Ian 
> >>> Subject: Re: [PATCH v1] tests: fix python2 module not find error
> >>>
> >>> On 7/16/21 8:15 PM, kumar Amber wrote:
>  This fixes the flake8 error on pyhton version older than 3.6 as
>  ModuleNotFoundError in not available before 3.6 and that is now
>  replaced to ImportError which is present in earlier versions.
> 
>  ../../tests/mfex_fuzzy.py:5:8: F821 undefined name
>  'ModuleNotFoundError'
>  2653Makefile:5826: recipe for target 'flake8-check' failed
> 
>  Fixes: 50be6715c0 ("test/sytem-dpdk: Add unit test for mfex
>  autovalidator")
>  Signed-off-by: kumar Amber 
>  ---
>   tests/mfex_fuzzy.py | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
>  diff --git a/tests/mfex_fuzzy.py b/tests/mfex_fuzzy.py index
>  5b056bb48..fd257ffb6 100755
>  --- a/tests/mfex_fuzzy.py
>  +++ b/tests/mfex_fuzzy.py
>  

[ovs-dev] [PATCH v2 ovn] controller: instrument ovn-controller loop with stopwatch

2021-07-19 Thread Lorenzo Bianconi
Introduce stopwatch instrumentation to the following ovn-controller
routines:
- commit_ct_zones
- bfd_run
- patch_run
- pinctrl_run
- if_status_mgr_update
- if_status_mgr_run
- ofctrl_seqno_run

Acked-by: Dumitru Ceara 
Signed-off-by: Lorenzo Bianconi 
---
Changes since v1:
- rebase on top of ovn master
---
 controller/ovn-controller.c | 38 +
 1 file changed, 38 insertions(+)

diff --git a/controller/ovn-controller.c b/controller/ovn-controller.c
index 2418c301b..85384908d 100644
--- a/controller/ovn-controller.c
+++ b/controller/ovn-controller.c
@@ -95,6 +95,13 @@ static unixctl_cb_func debug_delay_nb_cfg_report;
 
 #define CONTROLLER_LOOP_STOPWATCH_NAME "flow-generation"
 #define OFCTRL_PUT_STOPWATCH_NAME "flow-installation"
+#define PINCTRL_RUN_STOPWATCH_NAME "pinctrl-run"
+#define PATCH_RUN_STOPWATCH_NAME "patch-run"
+#define CT_ZONE_COMMIT_STOPWATCH_NAME "ct-zone-commit"
+#define IF_STATUS_MGR_RUN_STOPWATCH_NAME "if-status-mgr-run"
+#define IF_STATUS_MGR_UPDATE_STOPWATCH_NAME "if-status-mgr-update"
+#define OFCTRL_SEQNO_RUN_STOPWATCH_NAME "ofctrl-seqno-run"
+#define BFD_RUN_STOPWATCH_NAME "bfd-run"
 
 #define OVS_NB_CFG_NAME "ovn-nb-cfg"
 #define OVS_NB_CFG_TS_NAME "ovn-nb-cfg-ts"
@@ -2890,6 +2897,13 @@ main(int argc, char *argv[])
 
 stopwatch_create(CONTROLLER_LOOP_STOPWATCH_NAME, SW_MS);
 stopwatch_create(OFCTRL_PUT_STOPWATCH_NAME, SW_MS);
+stopwatch_create(PINCTRL_RUN_STOPWATCH_NAME, SW_MS);
+stopwatch_create(PATCH_RUN_STOPWATCH_NAME, SW_MS);
+stopwatch_create(CT_ZONE_COMMIT_STOPWATCH_NAME, SW_MS);
+stopwatch_create(IF_STATUS_MGR_RUN_STOPWATCH_NAME, SW_MS);
+stopwatch_create(IF_STATUS_MGR_UPDATE_STOPWATCH_NAME, SW_MS);
+stopwatch_create(OFCTRL_SEQNO_RUN_STOPWATCH_NAME, SW_MS);
+stopwatch_create(BFD_RUN_STOPWATCH_NAME, SW_MS);
 
 /* Define inc-proc-engine nodes. */
 ENGINE_NODE_CUSTOM_DATA(ct_zones, "ct_zones");
@@ -3275,23 +3289,33 @@ main(int argc, char *argv[])
 ct_zones_data = engine_get_data(&en_ct_zones);
 if (ovs_idl_txn) {
 if (ct_zones_data) {
+stopwatch_start(CT_ZONE_COMMIT_STOPWATCH_NAME,
+time_msec());
 commit_ct_zones(br_int, &ct_zones_data->pending);
+stopwatch_stop(CT_ZONE_COMMIT_STOPWATCH_NAME,
+   time_msec());
 }
+stopwatch_start(BFD_RUN_STOPWATCH_NAME, time_msec());
 bfd_run(ovsrec_interface_table_get(ovs_idl_loop.idl),
 br_int, chassis,
 sbrec_ha_chassis_group_table_get(
 ovnsb_idl_loop.idl),
 sbrec_sb_global_table_get(ovnsb_idl_loop.idl));
+stopwatch_stop(BFD_RUN_STOPWATCH_NAME, time_msec());
 }
 
 runtime_data = engine_get_data(&en_runtime_data);
 if (runtime_data) {
+stopwatch_start(PATCH_RUN_STOPWATCH_NAME, time_msec());
 patch_run(ovs_idl_txn,
 sbrec_port_binding_by_type,
 ovsrec_bridge_table_get(ovs_idl_loop.idl),
 ovsrec_open_vswitch_table_get(ovs_idl_loop.idl),
 ovsrec_port_table_get(ovs_idl_loop.idl),
 br_int, chassis, &runtime_data->local_datapaths);
+stopwatch_stop(PATCH_RUN_STOPWATCH_NAME, time_msec());
+stopwatch_start(PINCTRL_RUN_STOPWATCH_NAME,
+time_msec());
 pinctrl_run(ovnsb_idl_txn,
 sbrec_datapath_binding_by_key,
 sbrec_port_binding_by_datapath,
@@ -3312,6 +3336,8 @@ main(int argc, char *argv[])
 &runtime_data->active_tunnels,
 &runtime_data->local_active_ports_ipv6_pd,
 &runtime_data->local_active_ports_ras);
+stopwatch_stop(PINCTRL_RUN_STOPWATCH_NAME,
+   time_msec());
 /* Updating monitor conditions if runtime data or
  * logical datapath goups changed. */
 if (engine_node_changed(&en_runtime_data)
@@ -3334,7 +3360,11 @@ main(int argc, char *argv[])
 
 struct local_binding_data *binding_data =
 runtime_data ? &runtime_data->lbinding_data : NULL;
+stopwatch_start(IF_STATUS_MGR_UPDATE_STOPWATCH_NAME,
+time_msec());
 if_status_mgr_update(if_mgr, binding

Re: [ovs-dev] [PATCH v1] tests: fix python2 module not find error

2021-07-19 Thread Ilya Maximets
On 7/19/21 1:35 PM, Amber, Kumar wrote:
> Hi llya,
> 
> 
> Pls find my comments inline.
> 
>> -Original Message-
>> From: Ilya Maximets 
>> Sent: Monday, July 19, 2021 4:51 PM
>> To: Amber, Kumar ; Ilya Maximets
>> ; ovs-dev@openvswitch.org
>> Cc: Stokes, Ian 
>> Subject: Re: [PATCH v1] tests: fix python2 module not find error
>>
>> On 7/19/21 1:03 PM, Amber, Kumar wrote:
>>> Hi llya,
>>>
>>> Pls find the comments inline.
>>>
 -Original Message-
 From: Ilya Maximets 
 Sent: Monday, July 19, 2021 4:07 PM
 To: Ilya Maximets ; Amber, Kumar
 ; ovs-dev@openvswitch.org
 Cc: Stokes, Ian 
 Subject: Re: [PATCH v1] tests: fix python2 module not find error

 On 7/19/21 12:35 PM, Ilya Maximets wrote:
> On 7/17/21 5:21 AM, Amber, Kumar wrote:
>> Hi llya,
>>
>> This is what I get after a minor tweek :
>> "except ImportError as err:
>>  print(err)"
>>
>> when Scapy is not present :
>>
>> No module named 'scapy'
>> Traceback (most recent call last):
>>   File "./../mfex_fuzzy.py", line 10, in 
>> pktdump = PcapWriter(path, append=False, sync=True)
>> NameError: name 'PcapWriter' is not defined
>>
>> Is this ohk ?
>
> I don't understand why we're catching this exception.
> Even with your changes if the package is not available, we will
> catch the ImportError, print it and go further, later while trying
> to use modules that wasn't imported we will get another more vague
>> exception.
> So what is the port catching ImportError in the first place?

 s/port/point/

>
> If we'll exit after printing... well, but doesn't python print
> exception trace by itself?
>
> BTW, the title of this patch is incorrect.  We do not support
> python2, this problem is with python3 < 3.6.
>>>
>>> Yes makes sense now logs are very clear we don’t need the try and
>>> catch block  at all removed in the patch And fixed the heading .
>>>
>>> Traceback (most recent call last):
>>>   File "./mfex_fuzzy.py", line 2, in 
>>> from scapy.all import RandMAC, RandIP, PcapWriter, RandIP6,
>>> RandShort, fuzz
>>> ModuleNotFoundError: No module named 'scapy
>>
>> OK.  And since we're here, the pip3 might not be available on a system, so
>> checking for 'pip3 list' is not reliable.
>> Please, replace it with the import attempt. See how idl tests are checking 
>> for SSL
>> support for example:
>>   https://github.com/openvswitch/ovs/blob/master/tests/ovsdb-idl.at#L228-
>> L230
>>
> 
> -AT_SKIP_IF([! pip3 list | grep scapy], [], [])
> +AT_SKIP_IF([! $PYTHON3 -c "import scapy"], [], [])
>  
> 
> And with Scapy :
>   6: OVS-DPDK - MFEX Autovalidator   ok
>   7: OVS-DPDK - MFEX Autovalidator Fuzzy ok
>   8: OVS-DPDK - MFEX Configuration   ok
> 
> Without scapy :
> 
>   6: OVS-DPDK - MFEX Autovalidator   ok
>   7: OVS-DPDK - MFEX Autovalidator Fuzzy skipped 
> (system-dpdk.at:266)
>   8: OVS-DPDK - MFEX Configuration   ok
> 

I didn't test, but it seems OK to me.  Thanks.

> Regards
> Amber
> 
>>
>
> Best regards, Ilya Maximets.
>
>>
>> Regards
>> Amber
>>
>>
>>> -Original Message-
>>> From: Ilya Maximets 
>>> Sent: Saturday, July 17, 2021 12:21 AM
>>> To: Amber, Kumar ; ovs-
>> d...@openvswitch.org
>>> Cc: i.maxim...@ovn.org; Stokes, Ian 
>>> Subject: Re: [PATCH v1] tests: fix python2 module not find error
>>>
>>> On 7/16/21 8:15 PM, kumar Amber wrote:
 This fixes the flake8 error on pyhton version older than 3.6 as
 ModuleNotFoundError in not available before 3.6 and that is now
 replaced to ImportError which is present in earlier versions.

 ../../tests/mfex_fuzzy.py:5:8: F821 undefined name
 'ModuleNotFoundError'
 2653Makefile:5826: recipe for target 'flake8-check' failed

 Fixes: 50be6715c0 ("test/sytem-dpdk: Add unit test for mfex
 autovalidator")
 Signed-off-by: kumar Amber 
 ---
  tests/mfex_fuzzy.py | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/tests/mfex_fuzzy.py b/tests/mfex_fuzzy.py index
 5b056bb48..fd257ffb6 100755
 --- a/tests/mfex_fuzzy.py
 +++ b/tests/mfex_fuzzy.py
 @@ -2,7 +2,7 @@
  try:
  from scapy.all import RandMAC, RandIP, PcapWriter, RandIP6,
 RandShort,
>>> fuzz
  from scapy.all import IPv6, Dot1Q, IP, Ether, UDP, TCP
 -except ModuleNotFoundError as err:
 +except ImportError as err:
  print(err + ": Scapy")
  import sys


>>>
>>> I can confirm that this fixes the flake8 issue.
>>>
>>> But I'm not sure how that is supposed to work at all.
>>> Here is what I get in a plain python console:
>>>
>>> Python

Re: [ovs-dev] [PATCH ovn] controller: instrument ovn-controller loop with stopwatch

2021-07-19 Thread Dumitru Ceara
On 7/12/21 2:45 PM, Lorenzo Bianconi wrote:
> Introduce stopwatch instrumentation to the following ovn-controller
> routines:
> - commit_ct_zones
> - bfd_run
> - patch_run
> - pinctrl_run
> - if_status_mgr_update
> - if_status_mgr_run
> - ofctrl_seqno_run
> 
> Signed-off-by: Lorenzo Bianconi 
> ---

Hi Lorenzo,

This needs a minor rebase.  Please feel free to add my ack to v2:

Acked-by: Dumitru Ceara 

Thanks,
Dumitru

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v1] tests: fix python2 module not find error

2021-07-19 Thread Amber, Kumar
Hi llya,


Pls find my comments inline.

> -Original Message-
> From: Ilya Maximets 
> Sent: Monday, July 19, 2021 4:51 PM
> To: Amber, Kumar ; Ilya Maximets
> ; ovs-dev@openvswitch.org
> Cc: Stokes, Ian 
> Subject: Re: [PATCH v1] tests: fix python2 module not find error
> 
> On 7/19/21 1:03 PM, Amber, Kumar wrote:
> > Hi llya,
> >
> > Pls find the comments inline.
> >
> >> -Original Message-
> >> From: Ilya Maximets 
> >> Sent: Monday, July 19, 2021 4:07 PM
> >> To: Ilya Maximets ; Amber, Kumar
> >> ; ovs-dev@openvswitch.org
> >> Cc: Stokes, Ian 
> >> Subject: Re: [PATCH v1] tests: fix python2 module not find error
> >>
> >> On 7/19/21 12:35 PM, Ilya Maximets wrote:
> >>> On 7/17/21 5:21 AM, Amber, Kumar wrote:
>  Hi llya,
> 
>  This is what I get after a minor tweek :
>  "except ImportError as err:
>   print(err)"
> 
>  when Scapy is not present :
> 
>  No module named 'scapy'
>  Traceback (most recent call last):
>    File "./../mfex_fuzzy.py", line 10, in 
>  pktdump = PcapWriter(path, append=False, sync=True)
>  NameError: name 'PcapWriter' is not defined
> 
>  Is this ohk ?
> >>>
> >>> I don't understand why we're catching this exception.
> >>> Even with your changes if the package is not available, we will
> >>> catch the ImportError, print it and go further, later while trying
> >>> to use modules that wasn't imported we will get another more vague
> exception.
> >>> So what is the port catching ImportError in the first place?
> >>
> >> s/port/point/
> >>
> >>>
> >>> If we'll exit after printing... well, but doesn't python print
> >>> exception trace by itself?
> >>>
> >>> BTW, the title of this patch is incorrect.  We do not support
> >>> python2, this problem is with python3 < 3.6.
> >
> > Yes makes sense now logs are very clear we don’t need the try and
> > catch block  at all removed in the patch And fixed the heading .
> >
> > Traceback (most recent call last):
> >   File "./mfex_fuzzy.py", line 2, in 
> > from scapy.all import RandMAC, RandIP, PcapWriter, RandIP6,
> > RandShort, fuzz
> > ModuleNotFoundError: No module named 'scapy
> 
> OK.  And since we're here, the pip3 might not be available on a system, so
> checking for 'pip3 list' is not reliable.
> Please, replace it with the import attempt. See how idl tests are checking 
> for SSL
> support for example:
>   https://github.com/openvswitch/ovs/blob/master/tests/ovsdb-idl.at#L228-
> L230
> 

-AT_SKIP_IF([! pip3 list | grep scapy], [], [])
+AT_SKIP_IF([! $PYTHON3 -c "import scapy"], [], [])
 

And with Scapy :
  6: OVS-DPDK - MFEX Autovalidator   ok
  7: OVS-DPDK - MFEX Autovalidator Fuzzy ok
  8: OVS-DPDK - MFEX Configuration   ok

Without scapy :

  6: OVS-DPDK - MFEX Autovalidator   ok
  7: OVS-DPDK - MFEX Autovalidator Fuzzy skipped 
(system-dpdk.at:266)
  8: OVS-DPDK - MFEX Configuration   ok

Regards
Amber

> 
> >>>
> >>> Best regards, Ilya Maximets.
> >>>
> 
>  Regards
>  Amber
> 
> 
> > -Original Message-
> > From: Ilya Maximets 
> > Sent: Saturday, July 17, 2021 12:21 AM
> > To: Amber, Kumar ; ovs-
> d...@openvswitch.org
> > Cc: i.maxim...@ovn.org; Stokes, Ian 
> > Subject: Re: [PATCH v1] tests: fix python2 module not find error
> >
> > On 7/16/21 8:15 PM, kumar Amber wrote:
> >> This fixes the flake8 error on pyhton version older than 3.6 as
> >> ModuleNotFoundError in not available before 3.6 and that is now
> >> replaced to ImportError which is present in earlier versions.
> >>
> >> ../../tests/mfex_fuzzy.py:5:8: F821 undefined name
> >> 'ModuleNotFoundError'
> >> 2653Makefile:5826: recipe for target 'flake8-check' failed
> >>
> >> Fixes: 50be6715c0 ("test/sytem-dpdk: Add unit test for mfex
> >> autovalidator")
> >> Signed-off-by: kumar Amber 
> >> ---
> >>  tests/mfex_fuzzy.py | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/tests/mfex_fuzzy.py b/tests/mfex_fuzzy.py index
> >> 5b056bb48..fd257ffb6 100755
> >> --- a/tests/mfex_fuzzy.py
> >> +++ b/tests/mfex_fuzzy.py
> >> @@ -2,7 +2,7 @@
> >>  try:
> >>  from scapy.all import RandMAC, RandIP, PcapWriter, RandIP6,
> >> RandShort,
> > fuzz
> >>  from scapy.all import IPv6, Dot1Q, IP, Ether, UDP, TCP
> >> -except ModuleNotFoundError as err:
> >> +except ImportError as err:
> >>  print(err + ": Scapy")
> >>  import sys
> >>
> >>
> >
> > I can confirm that this fixes the flake8 issue.
> >
> > But I'm not sure how that is supposed to work at all.
> > Here is what I get in a plain python console:
> >
> > Python 3.6.8 (default, Mar 18 2021, 08:58:41) [GCC 8.4.1 20200928
> > (Red Hat 8.4.1-1)] on linux Type "help", "copyright", "credits" or
> > "license" for

[ovs-dev] [PATCH] Documentation: Remove duplicate words.

2021-07-19 Thread David Marchand
This is a simple cleanup with a script of mine.

Signed-off-by: David Marchand 
---
This script is a bit too silly/simplistic and requires manual review
(too many false positives), but I don't think it is worth investing too
much time into integrating this kind of check in utilities/checkpatch.py.

---
 Documentation/howto/qos.rst  | 2 +-
 Documentation/intro/install/windows.rst  | 6 +++---
 Documentation/topics/dpdk/memory.rst | 3 +--
 Documentation/topics/dpdk/vhost-user.rst | 4 ++--
 Documentation/topics/integration.rst | 2 +-
 Documentation/topics/testing.rst | 2 +-
 MAINTAINERS.rst  | 2 +-
 7 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/Documentation/howto/qos.rst b/Documentation/howto/qos.rst
index 352bf7c31e..4462856baa 100644
--- a/Documentation/howto/qos.rst
+++ b/Documentation/howto/qos.rst
@@ -139,7 +139,7 @@ Additional Information
 Open vSwitch's rate-limiting uses policing, which does not queue packets. It
 drops any packets beyond the specified rate. Specifying a larger burst size
 lets the algorithm be more forgiving, which is important for protocols like TCP
-that react severely to dropped packets. Setting a burst size of less than than
+that react severely to dropped packets. Setting a burst size of less than
 the MTU (e.g., 10 kb) should be avoided.
 
 For TCP traffic, setting a burst size to be a sizeable fraction (e.g., > 10%)
diff --git a/Documentation/intro/install/windows.rst 
b/Documentation/intro/install/windows.rst
index 79d4c62612..fb6c2c5ec9 100644
--- a/Documentation/intro/install/windows.rst
+++ b/Documentation/intro/install/windows.rst
@@ -311,8 +311,8 @@ NIC named 'Ethernet 1' is:
You can obtain the list of physical NICs on the host using 'Get-NetAdapter'
command.
 
-In the properties of any switch, you should should now see "Open vSwitch
-Extension" under 'Extensions'.  Click the check box to enable the extension.
+In the properties of any switch, you should now see "Open vSwitch Extension"
+under 'Extensions'.  Click the check box to enable the extension.
 An alternative way to do the same is to run the following command:
 
 ::
@@ -729,7 +729,7 @@ Where  is one of: ``stt`` or ``vxlan``
 
 .. note::
 
-   Any patch ports created between br-int and br-pif MUST be be deleted prior
+   Any patch ports created between br-int and br-pif MUST be deleted prior
to adding tunnels.
 
 Windows Services
diff --git a/Documentation/topics/dpdk/memory.rst 
b/Documentation/topics/dpdk/memory.rst
index 9ebfd11e40..7a9d02c184 100644
--- a/Documentation/topics/dpdk/memory.rst
+++ b/Documentation/topics/dpdk/memory.rst
@@ -176,8 +176,7 @@ where:
 * **min(RTE_MAX_LCORE,  requested number of rxqs)**: Compare the maximum
   number of lcores supported by DPDK to the number of requested receive
   queues for the device and use the variable of lesser value.
-* **NETDEV_MAX_BURST**: Maximum number of of packets in a burst, defined as
-  32.
+* **NETDEV_MAX_BURST**: Maximum number of packets in a burst, defined as 32.
 * **MIN_NB_MBUF**: Additional memory for corner case, defined as 16384.
 
 For all examples below assume the following values:
diff --git a/Documentation/topics/dpdk/vhost-user.rst 
b/Documentation/topics/dpdk/vhost-user.rst
index bcd51e65c0..4545f8f645 100644
--- a/Documentation/topics/dpdk/vhost-user.rst
+++ b/Documentation/topics/dpdk/vhost-user.rst
@@ -524,8 +524,8 @@ introduced in QEMU 2.7.0 / libvirt 2.3.0::
   
   
 
-The guest application will also need need to provide enough descriptors. For
-example with ``testpmd`` the command line argument can be used::
+The guest application will also need to provide enough descriptors.
+For example with ``testpmd`` the command line argument can be used::
 
  --rxd=1024 --txd=1024
 
diff --git a/Documentation/topics/integration.rst 
b/Documentation/topics/integration.rst
index 0a21aab708..060e1bd879 100644
--- a/Documentation/topics/integration.rst
+++ b/Documentation/topics/integration.rst
@@ -50,7 +50,7 @@ An integrator sets the columns in the database by talking to 
the ovsdb-server
 daemon.  A few of the columns can be set during startup by calling the ovs-ctl
 tool from inside the startup scripts.  The ``xenserver/etc_init.d_openvswitch``
 script provides examples of its use, and the ovs-ctl(8) manpage contains
-complete documentation.  At runtime, ovs-vsctl can be be used to set columns in
+complete documentation.  At runtime, ovs-vsctl can be used to set columns in
 the database.  The script ``xenserver/etc_xensource_scripts_vif`` contains
 examples of its use, and ovs-vsctl(8) manpage contains complete documentation.
 
diff --git a/Documentation/topics/testing.rst b/Documentation/topics/testing.rst
index 951fe9e851..0ddcbd58ab 100644
--- a/Documentation/topics/testing.rst
+++ b/Documentation/topics/testing.rst
@@ -79,7 +79,7 @@ To see a complete list of test options, run::
 $ make check TESTSUITEFLAGS=--help
 
 The results of a testing run 

Re: [ovs-dev] [PATCH v1] tests: fix python2 module not find error

2021-07-19 Thread Ilya Maximets
On 7/19/21 1:03 PM, Amber, Kumar wrote:
> Hi llya,
> 
> Pls find the comments inline.
> 
>> -Original Message-
>> From: Ilya Maximets 
>> Sent: Monday, July 19, 2021 4:07 PM
>> To: Ilya Maximets ; Amber, Kumar
>> ; ovs-dev@openvswitch.org
>> Cc: Stokes, Ian 
>> Subject: Re: [PATCH v1] tests: fix python2 module not find error
>>
>> On 7/19/21 12:35 PM, Ilya Maximets wrote:
>>> On 7/17/21 5:21 AM, Amber, Kumar wrote:
 Hi llya,

 This is what I get after a minor tweek :
 "except ImportError as err:
  print(err)"

 when Scapy is not present :

 No module named 'scapy'
 Traceback (most recent call last):
   File "./../mfex_fuzzy.py", line 10, in 
 pktdump = PcapWriter(path, append=False, sync=True)
 NameError: name 'PcapWriter' is not defined

 Is this ohk ?
>>>
>>> I don't understand why we're catching this exception.
>>> Even with your changes if the package is not available, we will catch
>>> the ImportError, print it and go further, later while trying to use
>>> modules that wasn't imported we will get another more vague exception.
>>> So what is the port catching ImportError in the first place?
>>
>> s/port/point/
>>
>>>
>>> If we'll exit after printing... well, but doesn't python print
>>> exception trace by itself?
>>>
>>> BTW, the title of this patch is incorrect.  We do not support python2,
>>> this problem is with python3 < 3.6.
> 
> Yes makes sense now logs are very clear we don’t need the try and catch block 
>  at all removed in the patch
> And fixed the heading .
> 
> Traceback (most recent call last):
>   File "./mfex_fuzzy.py", line 2, in 
> from scapy.all import RandMAC, RandIP, PcapWriter, RandIP6, RandShort, 
> fuzz
> ModuleNotFoundError: No module named 'scapy

OK.  And since we're here, the pip3 might not be available
on a system, so checking for 'pip3 list' is not reliable.
Please, replace it with the import attempt. See how idl tests
are checking for SSL support for example:
  https://github.com/openvswitch/ovs/blob/master/tests/ovsdb-idl.at#L228-L230


>>>
>>> Best regards, Ilya Maximets.
>>>

 Regards
 Amber


> -Original Message-
> From: Ilya Maximets 
> Sent: Saturday, July 17, 2021 12:21 AM
> To: Amber, Kumar ; ovs-dev@openvswitch.org
> Cc: i.maxim...@ovn.org; Stokes, Ian 
> Subject: Re: [PATCH v1] tests: fix python2 module not find error
>
> On 7/16/21 8:15 PM, kumar Amber wrote:
>> This fixes the flake8 error on pyhton version older than 3.6 as
>> ModuleNotFoundError in not available before 3.6 and that is now
>> replaced to ImportError which is present in earlier versions.
>>
>> ../../tests/mfex_fuzzy.py:5:8: F821 undefined name
>> 'ModuleNotFoundError'
>> 2653Makefile:5826: recipe for target 'flake8-check' failed
>>
>> Fixes: 50be6715c0 ("test/sytem-dpdk: Add unit test for mfex
>> autovalidator")
>> Signed-off-by: kumar Amber 
>> ---
>>  tests/mfex_fuzzy.py | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/tests/mfex_fuzzy.py b/tests/mfex_fuzzy.py index
>> 5b056bb48..fd257ffb6 100755
>> --- a/tests/mfex_fuzzy.py
>> +++ b/tests/mfex_fuzzy.py
>> @@ -2,7 +2,7 @@
>>  try:
>>  from scapy.all import RandMAC, RandIP, PcapWriter, RandIP6,
>> RandShort,
> fuzz
>>  from scapy.all import IPv6, Dot1Q, IP, Ether, UDP, TCP -except
>> ModuleNotFoundError as err:
>> +except ImportError as err:
>>  print(err + ": Scapy")
>>  import sys
>>
>>
>
> I can confirm that this fixes the flake8 issue.
>
> But I'm not sure how that is supposed to work at all.
> Here is what I get in a plain python console:
>
> Python 3.6.8 (default, Mar 18 2021, 08:58:41) [GCC 8.4.1 20200928
> (Red Hat 8.4.1-1)] on linux Type "help", "copyright", "credits" or
> "license" for more information.
 try:
> ... from scapy.all import RandMAC
> ... except ImportError as err:
> ... print(err + ": Scapy")
> ...
> Traceback (most recent call last):
>   File "", line 2, in 
> ModuleNotFoundError: No module named 'scapy'
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "", line 4, in 
> TypeError: unsupported operand type(s) for +: 'ModuleNotFoundError' and
>> 'str'
>
>
> Best regards, Ilya Maximets.
>>>
> 

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v1] tests: fix python2 module not find error

2021-07-19 Thread Amber, Kumar
Hi llya,

Pls find the comments inline.

> -Original Message-
> From: Ilya Maximets 
> Sent: Monday, July 19, 2021 4:07 PM
> To: Ilya Maximets ; Amber, Kumar
> ; ovs-dev@openvswitch.org
> Cc: Stokes, Ian 
> Subject: Re: [PATCH v1] tests: fix python2 module not find error
> 
> On 7/19/21 12:35 PM, Ilya Maximets wrote:
> > On 7/17/21 5:21 AM, Amber, Kumar wrote:
> >> Hi llya,
> >>
> >> This is what I get after a minor tweek :
> >> "except ImportError as err:
> >>  print(err)"
> >>
> >> when Scapy is not present :
> >>
> >> No module named 'scapy'
> >> Traceback (most recent call last):
> >>   File "./../mfex_fuzzy.py", line 10, in 
> >> pktdump = PcapWriter(path, append=False, sync=True)
> >> NameError: name 'PcapWriter' is not defined
> >>
> >> Is this ohk ?
> >
> > I don't understand why we're catching this exception.
> > Even with your changes if the package is not available, we will catch
> > the ImportError, print it and go further, later while trying to use
> > modules that wasn't imported we will get another more vague exception.
> > So what is the port catching ImportError in the first place?
> 
> s/port/point/
> 
> >
> > If we'll exit after printing... well, but doesn't python print
> > exception trace by itself?
> >
> > BTW, the title of this patch is incorrect.  We do not support python2,
> > this problem is with python3 < 3.6.

Yes makes sense now logs are very clear we don’t need the try and catch block  
at all removed in the patch
And fixed the heading .

Traceback (most recent call last):
  File "./mfex_fuzzy.py", line 2, in 
from scapy.all import RandMAC, RandIP, PcapWriter, RandIP6, RandShort, fuzz
ModuleNotFoundError: No module named 'scapy
> >
> > Best regards, Ilya Maximets.
> >
> >>
> >> Regards
> >> Amber
> >>
> >>
> >>> -Original Message-
> >>> From: Ilya Maximets 
> >>> Sent: Saturday, July 17, 2021 12:21 AM
> >>> To: Amber, Kumar ; ovs-dev@openvswitch.org
> >>> Cc: i.maxim...@ovn.org; Stokes, Ian 
> >>> Subject: Re: [PATCH v1] tests: fix python2 module not find error
> >>>
> >>> On 7/16/21 8:15 PM, kumar Amber wrote:
>  This fixes the flake8 error on pyhton version older than 3.6 as
>  ModuleNotFoundError in not available before 3.6 and that is now
>  replaced to ImportError which is present in earlier versions.
> 
>  ../../tests/mfex_fuzzy.py:5:8: F821 undefined name
> 'ModuleNotFoundError'
>  2653Makefile:5826: recipe for target 'flake8-check' failed
> 
>  Fixes: 50be6715c0 ("test/sytem-dpdk: Add unit test for mfex
>  autovalidator")
>  Signed-off-by: kumar Amber 
>  ---
>   tests/mfex_fuzzy.py | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
>  diff --git a/tests/mfex_fuzzy.py b/tests/mfex_fuzzy.py index
>  5b056bb48..fd257ffb6 100755
>  --- a/tests/mfex_fuzzy.py
>  +++ b/tests/mfex_fuzzy.py
>  @@ -2,7 +2,7 @@
>   try:
>   from scapy.all import RandMAC, RandIP, PcapWriter, RandIP6,
>  RandShort,
> >>> fuzz
>   from scapy.all import IPv6, Dot1Q, IP, Ether, UDP, TCP -except
>  ModuleNotFoundError as err:
>  +except ImportError as err:
>   print(err + ": Scapy")
>   import sys
> 
> 
> >>>
> >>> I can confirm that this fixes the flake8 issue.
> >>>
> >>> But I'm not sure how that is supposed to work at all.
> >>> Here is what I get in a plain python console:
> >>>
> >>> Python 3.6.8 (default, Mar 18 2021, 08:58:41) [GCC 8.4.1 20200928
> >>> (Red Hat 8.4.1-1)] on linux Type "help", "copyright", "credits" or
> >>> "license" for more information.
> >> try:
> >>> ... from scapy.all import RandMAC
> >>> ... except ImportError as err:
> >>> ... print(err + ": Scapy")
> >>> ...
> >>> Traceback (most recent call last):
> >>>   File "", line 2, in 
> >>> ModuleNotFoundError: No module named 'scapy'
> >>>
> >>> During handling of the above exception, another exception occurred:
> >>>
> >>> Traceback (most recent call last):
> >>>   File "", line 4, in 
> >>> TypeError: unsupported operand type(s) for +: 'ModuleNotFoundError' and
> 'str'
> >>>
> >>>
> >>> Best regards, Ilya Maximets.
> >

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v1] tests: fix python2 module not find error

2021-07-19 Thread Ilya Maximets
On 7/19/21 12:35 PM, Ilya Maximets wrote:
> On 7/17/21 5:21 AM, Amber, Kumar wrote:
>> Hi llya,
>>
>> This is what I get after a minor tweek :
>> "except ImportError as err:
>>  print(err)"
>>
>> when Scapy is not present :
>>
>> No module named 'scapy'
>> Traceback (most recent call last):
>>   File "./../mfex_fuzzy.py", line 10, in 
>> pktdump = PcapWriter(path, append=False, sync=True)
>> NameError: name 'PcapWriter' is not defined
>>
>> Is this ohk ?
> 
> I don't understand why we're catching this exception.
> Even with your changes if the package is not available,
> we will catch the ImportError, print it and go further,
> later while trying to use modules that wasn't imported
> we will get another more vague exception.  So what is
> the port catching ImportError in the first place?

s/port/point/

> 
> If we'll exit after printing... well, but doesn't python
> print exception trace by itself?
> 
> BTW, the title of this patch is incorrect.  We do not
> support python2, this problem is with python3 < 3.6.
> 
> Best regards, Ilya Maximets.
> 
>>
>> Regards
>> Amber
>>
>>
>>> -Original Message-
>>> From: Ilya Maximets 
>>> Sent: Saturday, July 17, 2021 12:21 AM
>>> To: Amber, Kumar ; ovs-dev@openvswitch.org
>>> Cc: i.maxim...@ovn.org; Stokes, Ian 
>>> Subject: Re: [PATCH v1] tests: fix python2 module not find error
>>>
>>> On 7/16/21 8:15 PM, kumar Amber wrote:
 This fixes the flake8 error on pyhton version older than 3.6 as
 ModuleNotFoundError in not available before 3.6 and that is now
 replaced to ImportError which is present in earlier versions.

 ../../tests/mfex_fuzzy.py:5:8: F821 undefined name 'ModuleNotFoundError'
 2653Makefile:5826: recipe for target 'flake8-check' failed

 Fixes: 50be6715c0 ("test/sytem-dpdk: Add unit test for mfex
 autovalidator")
 Signed-off-by: kumar Amber 
 ---
  tests/mfex_fuzzy.py | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/tests/mfex_fuzzy.py b/tests/mfex_fuzzy.py index
 5b056bb48..fd257ffb6 100755
 --- a/tests/mfex_fuzzy.py
 +++ b/tests/mfex_fuzzy.py
 @@ -2,7 +2,7 @@
  try:
  from scapy.all import RandMAC, RandIP, PcapWriter, RandIP6, RandShort,
>>> fuzz
  from scapy.all import IPv6, Dot1Q, IP, Ether, UDP, TCP -except
 ModuleNotFoundError as err:
 +except ImportError as err:
  print(err + ": Scapy")
  import sys


>>>
>>> I can confirm that this fixes the flake8 issue.
>>>
>>> But I'm not sure how that is supposed to work at all.
>>> Here is what I get in a plain python console:
>>>
>>> Python 3.6.8 (default, Mar 18 2021, 08:58:41) [GCC 8.4.1 20200928 (Red Hat
>>> 8.4.1-1)] on linux Type "help", "copyright", "credits" or "license" for more
>>> information.
>> try:
>>> ... from scapy.all import RandMAC
>>> ... except ImportError as err:
>>> ... print(err + ": Scapy")
>>> ...
>>> Traceback (most recent call last):
>>>   File "", line 2, in 
>>> ModuleNotFoundError: No module named 'scapy'
>>>
>>> During handling of the above exception, another exception occurred:
>>>
>>> Traceback (most recent call last):
>>>   File "", line 4, in 
>>> TypeError: unsupported operand type(s) for +: 'ModuleNotFoundError' and 
>>> 'str'
>>>
>>>
>>> Best regards, Ilya Maximets.
> 

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v1] tests: fix python2 module not find error

2021-07-19 Thread Ilya Maximets
On 7/17/21 5:21 AM, Amber, Kumar wrote:
> Hi llya,
> 
> This is what I get after a minor tweek :
> "except ImportError as err:
>  print(err)"
> 
> when Scapy is not present :
> 
> No module named 'scapy'
> Traceback (most recent call last):
>   File "./../mfex_fuzzy.py", line 10, in 
> pktdump = PcapWriter(path, append=False, sync=True)
> NameError: name 'PcapWriter' is not defined
> 
> Is this ohk ?

I don't understand why we're catching this exception.
Even with your changes if the package is not available,
we will catch the ImportError, print it and go further,
later while trying to use modules that wasn't imported
we will get another more vague exception.  So what is
the port catching ImportError in the first place?

If we'll exit after printing... well, but doesn't python
print exception trace by itself?

BTW, the title of this patch is incorrect.  We do not
support python2, this problem is with python3 < 3.6.

Best regards, Ilya Maximets.

> 
> Regards
> Amber
> 
> 
>> -Original Message-
>> From: Ilya Maximets 
>> Sent: Saturday, July 17, 2021 12:21 AM
>> To: Amber, Kumar ; ovs-dev@openvswitch.org
>> Cc: i.maxim...@ovn.org; Stokes, Ian 
>> Subject: Re: [PATCH v1] tests: fix python2 module not find error
>>
>> On 7/16/21 8:15 PM, kumar Amber wrote:
>>> This fixes the flake8 error on pyhton version older than 3.6 as
>>> ModuleNotFoundError in not available before 3.6 and that is now
>>> replaced to ImportError which is present in earlier versions.
>>>
>>> ../../tests/mfex_fuzzy.py:5:8: F821 undefined name 'ModuleNotFoundError'
>>> 2653Makefile:5826: recipe for target 'flake8-check' failed
>>>
>>> Fixes: 50be6715c0 ("test/sytem-dpdk: Add unit test for mfex
>>> autovalidator")
>>> Signed-off-by: kumar Amber 
>>> ---
>>>  tests/mfex_fuzzy.py | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/tests/mfex_fuzzy.py b/tests/mfex_fuzzy.py index
>>> 5b056bb48..fd257ffb6 100755
>>> --- a/tests/mfex_fuzzy.py
>>> +++ b/tests/mfex_fuzzy.py
>>> @@ -2,7 +2,7 @@
>>>  try:
>>>  from scapy.all import RandMAC, RandIP, PcapWriter, RandIP6, RandShort,
>> fuzz
>>>  from scapy.all import IPv6, Dot1Q, IP, Ether, UDP, TCP -except
>>> ModuleNotFoundError as err:
>>> +except ImportError as err:
>>>  print(err + ": Scapy")
>>>  import sys
>>>
>>>
>>
>> I can confirm that this fixes the flake8 issue.
>>
>> But I'm not sure how that is supposed to work at all.
>> Here is what I get in a plain python console:
>>
>> Python 3.6.8 (default, Mar 18 2021, 08:58:41) [GCC 8.4.1 20200928 (Red Hat
>> 8.4.1-1)] on linux Type "help", "copyright", "credits" or "license" for more
>> information.
> try:
>> ... from scapy.all import RandMAC
>> ... except ImportError as err:
>> ... print(err + ": Scapy")
>> ...
>> Traceback (most recent call last):
>>   File "", line 2, in 
>> ModuleNotFoundError: No module named 'scapy'
>>
>> During handling of the above exception, another exception occurred:
>>
>> Traceback (most recent call last):
>>   File "", line 4, in 
>> TypeError: unsupported operand type(s) for +: 'ModuleNotFoundError' and 'str'
>>
>>
>> Best regards, Ilya Maximets.

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v14 00/11] MFEX Infrastructure + Optimizations

2021-07-19 Thread Eelco Chaudron



On 16 Jul 2021, at 13:27, Stokes, Ian wrote:

>> v14:
>> - fixed format and xmas order in patch 6
>> - added additonal negative test-cases for mfex commands
>> - added core mask for configuration test case
>
> Hi all, thanks for all the work reviewing/testing. I've made the required 
> updates for patches 3, 6 and 7 (mostly coding style and log messages).
>
> I've pushed this to master.

Thanks for making these final adjustments! The commit looks good.

>
> Thanks
> Ian
>
>> v13:
>> - add Acks from Flavio
>> - fixed atomic set and static var in study
>> - shotened null check in first patch
>> - added improvements to set command as per discussion
>> - added test-case to test for set commands both negative and positive
>> v12:
>> - re-work the set command to sweep method
>> - changes skip for unit-test to true from not-available
>> - added acks from Eelco
>> - minor doc fixed and typos
>> v11:
>> - reworked set command in alingment with Eelco and Harry
>> - added Acks from Eelco.
>> - added skip to unit test if other implementations not available
>> - minor typos and fixes
>> - clang build fixes
>> - removed patch whith Scalar DPIF, will send separately
>> v10 update:
>> - re-worked the default implementation
>> - fix comments from Flavio and Eelco
>> - Include Acks from Eelco in study
>> v9 update:
>> - Include review comments from Flavio
>> - Rebase onto Master
>> - Include Acks from Flavio
>> v8 updates:
>> - Include documentation on AVX512 MFEX as per Eelco's suggestion on list
>> v7 updates:
>> - Rebase onto DPIF v15
>> - Changed commands to get and set MFEX
>> - Fixed comments from Flavio, Eelco
>> - Segrated addition of MFEX options to seaprate patch 12 for Scalar DPIF
>> - Removed sleep from auto-validator and added frame counter check
>> - Documentation updates
>> - Minor bug fixes
>> v6 updates:
>> - Fix non-ssl build
>> v5 updates:
>> - reabse onto latest DPIF v14
>> - use Enum for mfex impls
>> - add pmd core id set paramter in set command
>> - get command modified to display the pmd thread for individual mfex 
>> functions
>> - resolved comments from Eelco, Ian, Flavio
>> - Use Atomic to get and set miniflow implementations
>> - removed and reduced sleep in unit tests
>> - fixed scalar miniflow perf degradation
>> v4 updates:
>> - rebase on to latest DPIF v13
>> - fix fuzzy.py script with random mac/ip
>> v3 updates:
>> - rebase on to latest DPIF v12
>> - add additonal AVX512 traffic profiles for tcp and vlan
>> - add new command line for study function to add packet count
>> - add unit tests for fuzzy testing and auto-validation of mfex
>> - add mfex option hit stats to perf-show command
>> v2 updates:
>> - rebase on to latest DPIF v11
>> This patchset introduces miniflow extract Infrastructure changes
>> which allows user to choose different type of ISA based optimized
>> miniflow extract variants which can be user choosen or set based on
>> packets studies automatically by OVS using different commands.
>> The Infrastructure also provides a way to check the correctness of
>> different ISA optimized miniflow extract variants against the scalar
>> version.
>>
>> Harry van Haaren (4):
>>   dpif/stats: Add miniflow extract opt hits counter
>>   dpdk: Add additional CPU ISA detection strings
>>   dpif-netdev/mfex: Add AVX512 based optimized miniflow extract
>>   dpif-netdev/mfex: Add more AVX512 traffic profiles
>>
>> Kumar Amber (7):
>>   dpif-netdev: Add command line and function pointer for miniflow
>> extract
>>   dpif-netdev: Add auto validation function for miniflow extract
>>   dpif-netdev: Add study function to select the best mfex function
>>   docs/dpdk/bridge: Add miniflow extract section.
>>   dpif-netdev: Add configure to enable autovalidator at build time.
>>   dpif-netdev: Add packet count and core id paramters for study
>>   test/sytem-dpdk: Add unit test for mfex autovalidator
>>
>>  Documentation/topics/dpdk/bridge.rst | 146 +++
>>  NEWS |  11 +
>>  acinclude.m4 |  16 +
>>  configure.ac |   1 +
>>  lib/automake.mk  |   4 +
>>  lib/dpdk.c   |   2 +
>>  lib/dpif-netdev-avx512.c |  34 +-
>>  lib/dpif-netdev-extract-avx512.c | 630 +++
>>  lib/dpif-netdev-extract-study.c  | 158 +++
>>  lib/dpif-netdev-perf.c   |   3 +
>>  lib/dpif-netdev-perf.h   |   1 +
>>  lib/dpif-netdev-private-extract.c| 371 
>>  lib/dpif-netdev-private-extract.h| 203 +
>>  lib/dpif-netdev-private-thread.h |   8 +
>>  lib/dpif-netdev-unixctl.man  |   4 +
>>  lib/dpif-netdev.c| 238 +-
>>  tests/.gitignore |   1 +
>>  tests/automake.mk|   6 +
>>  tests/mfex_fuzzy.py  |  33 ++
>>  tests/pcap/mfex_test.pcap| Bin 0 -> 416 bytes
>>  tests/pmd.at |   6 +-
>