[ovs-dev] [PATCH net-next v1 1/1] net: openvswitch: ovs_packet_cmd_execute put sw_flow mainbody in stack

2023-02-17 Thread Eddy Tao
Add 2 performance revisions for ovs_packet_cmd_execute

1.Stores mainbody of sw_flow(600+ bytes) in stack
  Benifit: avoid kmem cache alloc/free caused by ovs_flow_alloc/free

2.Define sw_flow_without_stats_init to initialize mainbody of
  struct sw_flow, which does not provides memory for sw_flow_stats.
  Reason: ovs_execute_actions does not touch sw_flow_stats.
  Benefit: less memzero, say each 'sw_flow_stats *' takes 4/8
  bytes, on systems with 20 to 128 logic cpus, this is a good deal.

Signed-off-by: Eddy Tao 
---
 net/openvswitch/datapath.c | 22 --
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index fcee6012293b..337947d34355 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -589,6 +589,12 @@ static int queue_userspace_packet(struct datapath *dp, 
struct sk_buff *skb,
return err;
 }
 
+static void sw_flow_without_stats_init(struct sw_flow *flow)
+{
+   memset(flow, 0, sizeof(*flow));
+   flow->stats_last_writer = -1;
+}
+
 static int ovs_packet_cmd_execute(struct sk_buff *skb, struct genl_info *info)
 {
struct ovs_header *ovs_header = info->userhdr;
@@ -596,7 +602,8 @@ static int ovs_packet_cmd_execute(struct sk_buff *skb, 
struct genl_info *info)
struct nlattr **a = info->attrs;
struct sw_flow_actions *acts;
struct sk_buff *packet;
-   struct sw_flow *flow;
+   struct sw_flow f;
+   struct sw_flow *flow = &f;
struct sw_flow_actions *sf_acts;
struct datapath *dp;
struct vport *input_vport;
@@ -636,20 +643,18 @@ static int ovs_packet_cmd_execute(struct sk_buff *skb, 
struct genl_info *info)
}
 
/* Build an sw_flow for sending this packet. */
-   flow = ovs_flow_alloc();
-   err = PTR_ERR(flow);
-   if (IS_ERR(flow))
-   goto err_kfree_skb;
+   /* This flow has no sw_flow_stats */
+   sw_flow_without_stats_init(flow);
 
err = ovs_flow_key_extract_userspace(net, a[OVS_PACKET_ATTR_KEY],
 packet, &flow->key, log);
if (err)
-   goto err_flow_free;
+   goto err_kfree_skb;
 
err = ovs_nla_copy_actions(net, a[OVS_PACKET_ATTR_ACTIONS],
   &flow->key, &acts, log);
if (err)
-   goto err_flow_free;
+   goto err_kfree_skb;
 
rcu_assign_pointer(flow->sf_acts, acts);
packet->priority = flow->key.phy.priority;
@@ -677,13 +682,10 @@ static int ovs_packet_cmd_execute(struct sk_buff *skb, 
struct genl_info *info)
local_bh_enable();
rcu_read_unlock();
 
-   ovs_flow_free(flow, false);
return err;
 
 err_unlock:
rcu_read_unlock();
-err_flow_free:
-   ovs_flow_free(flow, false);
 err_kfree_skb:
kfree_skb(packet);
 err:
-- 
2.27.0

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


Re: [ovs-dev] [PATCH ovn 2/2] Prepare for post-23.03.0.

2023-02-17 Thread Mark Michelson

Thanks Dumitru,

I added my sign-off and pushed this to main.

On 2/17/23 16:07, Dumitru Ceara wrote:

On 2/17/23 14:32, Mark Michelson wrote:

---
  NEWS | 3 +++
  configure.ac | 2 +-
  debian/changelog | 6 ++
  3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index 74510866e..39e567a36 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+Post v23.03.0
+-
+
  OVN v23.03.0
  -
- ovn-controller: Experimental support for co-hosting multiple controller
diff --git a/configure.ac b/configure.ac
index b51d0f01e..674fef8de 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13,7 +13,7 @@
  # limitations under the License.
  
  AC_PREREQ(2.63)

-AC_INIT(ovn, 23.03.0, b...@openvswitch.org)
+AC_INIT(ovn, 23.03.90, b...@openvswitch.org)
  AC_CONFIG_MACRO_DIR([m4])
  AC_CONFIG_AUX_DIR([build-aux])
  AC_CONFIG_HEADERS([config.h])
diff --git a/debian/changelog b/debian/changelog
index a70fdfe25..18dd19953 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+ovn (23.03.90-1) unstable; urgency=low
+
+   * New upstream version
+
+ -- OVN team   Fri, 17 Feb 2023 08:29:57 -0500
+
  ovn (23.03.0-1) unstable; urgency=low
  
 * New upstream version


Misses a sign off but with that addressed:
Acked-by: Dumitru Ceara 

Regards,
Dumitru



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


Re: [ovs-dev] [PATCH ovn 1/2] Prepare for 23.03.0.

2023-02-17 Thread Mark Michelson

Thanks Dumitru,

I added the date placeholder to NEWS, added my sign-off, and pushed the 
change to main, and created branch-23.03 from main on this commit.


On 2/17/23 16:06, Dumitru Ceara wrote:

On 2/17/23 14:32, Mark Michelson wrote:

---
  NEWS | 2 +-
  configure.ac | 2 +-
  debian/changelog | 4 ++--
  3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index fd0fee75c..74510866e 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-Post v22.12.0
+OVN v23.03.0
  -


Aren't we missing the date placeholder here?  Something like:

OVN v23.03.0 - XX XXX 
--

As the robot pointed out this also needs a signoff.  With these fixed:
Acked-by: Dumitru Ceara 

Regards,
Dumitru



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


Re: [ovs-dev] [PATCH ovn 2/2] Prepare for post-23.03.0.

2023-02-17 Thread Dumitru Ceara
On 2/17/23 14:32, Mark Michelson wrote:
> ---
>  NEWS | 3 +++
>  configure.ac | 2 +-
>  debian/changelog | 6 ++
>  3 files changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/NEWS b/NEWS
> index 74510866e..39e567a36 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -1,3 +1,6 @@
> +Post v23.03.0
> +-
> +
>  OVN v23.03.0
>  -
>- ovn-controller: Experimental support for co-hosting multiple controller
> diff --git a/configure.ac b/configure.ac
> index b51d0f01e..674fef8de 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -13,7 +13,7 @@
>  # limitations under the License.
>  
>  AC_PREREQ(2.63)
> -AC_INIT(ovn, 23.03.0, b...@openvswitch.org)
> +AC_INIT(ovn, 23.03.90, b...@openvswitch.org)
>  AC_CONFIG_MACRO_DIR([m4])
>  AC_CONFIG_AUX_DIR([build-aux])
>  AC_CONFIG_HEADERS([config.h])
> diff --git a/debian/changelog b/debian/changelog
> index a70fdfe25..18dd19953 100644
> --- a/debian/changelog
> +++ b/debian/changelog
> @@ -1,3 +1,9 @@
> +ovn (23.03.90-1) unstable; urgency=low
> +
> +   * New upstream version
> +
> + -- OVN team   Fri, 17 Feb 2023 08:29:57 -0500
> +
>  ovn (23.03.0-1) unstable; urgency=low
>  
> * New upstream version

Misses a sign off but with that addressed:
Acked-by: Dumitru Ceara 

Regards,
Dumitru

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


Re: [ovs-dev] [PATCH ovn 1/2] Prepare for 23.03.0.

2023-02-17 Thread Dumitru Ceara
On 2/17/23 14:32, Mark Michelson wrote:
> ---
>  NEWS | 2 +-
>  configure.ac | 2 +-
>  debian/changelog | 4 ++--
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/NEWS b/NEWS
> index fd0fee75c..74510866e 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -1,4 +1,4 @@
> -Post v22.12.0
> +OVN v23.03.0
>  -

Aren't we missing the date placeholder here?  Something like:

OVN v23.03.0 - XX XXX 
--

As the robot pointed out this also needs a signoff.  With these fixed:
Acked-by: Dumitru Ceara 

Regards,
Dumitru

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


Re: [ovs-dev] [PATCH v4 ovn] Add IPv6 support for lb health-check

2023-02-17 Thread Dumitru Ceara
On 2/17/23 18:50, Lorenzo Bianconi wrote:
> Add Similar to IPv4 counterpart, introduce IPv6 load-balancer health
> check support.
> 
> Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=2136094
> Reviewed-by: Ales Musil 
> Acked-by: Mark Michelson 
> Signed-off-by: Lorenzo Bianconi 
> ---

Thanks, Lorenzo, Ales and Mark!  I pushed this to the main branch.

Regards,
Dumitru

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


Re: [ovs-dev] [PATCH v4 ovn] Add IPv6 support for lb health-check

2023-02-17 Thread Dumitru Ceara
On 2/17/23 18:50, Lorenzo Bianconi wrote:
> Add Similar to IPv4 counterpart, introduce IPv6 load-balancer health
> check support.
> 
> Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=2136094
> Reviewed-by: Ales Musil 
> Acked-by: Mark Michelson 
> Signed-off-by: Lorenzo Bianconi 
> ---

Thanks, Lorenzo, Ales and Mark!  I pushed this to the main branch.

Regards,
Dumitru

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


[ovs-dev] [PATCH ovn] northd: Use LB port_str in northd.

2023-02-17 Thread Dumitru Ceara
As mentioned in the structure definition in lb.h, northd should never
use 'vip_port' instead it should always use 'port_str'.  That's because
it might not always be possible to evaluate the port value in northd,
e.g., when using LB templates.

This commit also updates other occurrences of 'vip_port' replacing them
with 'port_str' in northd.  Those were not causing issues because they
were only in cases when templates are not supported (LB affinity for
example) but it's better to have consistency in style.

Fixes: 7b94d212f694 ("northd: Refactor build_lrouter_nat_flows_for_lb function")
Signed-off-by: Dumitru Ceara 
---
 northd/northd.c | 44 
 tests/system-ovn.at | 82 +++--
 2 files changed, 86 insertions(+), 40 deletions(-)

diff --git a/northd/northd.c b/northd/northd.c
index cd9a410ac8..877d05ac3c 100644
--- a/northd/northd.c
+++ b/northd/northd.c
@@ -7161,9 +7161,9 @@ build_lb_affinity_lr_flows(struct hmap *lflows, struct 
ovn_northd_lb *lb,
 ds_put_format(&aff_action, "%s = %s; ", reg_vip, lb_vip->vip_str);
 ds_put_cstr(&aff_action_learn, "commit_lb_aff(vip = \"");
 
-if (lb_vip->vip_port) {
-ds_put_format(&aff_action_learn, ipv6 ? "[%s]:%"PRIu16 : "%s:%"PRIu16,
-  lb_vip->vip_str, lb_vip->vip_port);
+if (lb_vip->port_str) {
+ds_put_format(&aff_action_learn, ipv6 ? "[%s]:%s" : "%s:%s",
+  lb_vip->vip_str, lb_vip->port_str);
 } else {
 ds_put_cstr(&aff_action_learn, lb_vip->vip_str);
 }
@@ -7175,12 +7175,12 @@ build_lb_affinity_lr_flows(struct hmap *lflows, struct 
ovn_northd_lb *lb,
 ds_put_cstr(&aff_action_learn, "\", backend = \"");
 
 /* Prepare common part of affinity learn match. */
-if (lb_vip->vip_port) {
+if (lb_vip->port_str) {
 ds_put_format(&aff_match_learn, REGBIT_KNOWN_LB_SESSION" == 0 && "
   "ct.new && %s && %s == %s && "
-  REG_ORIG_TP_DPORT_ROUTER" == %"PRIu16" && "
+  REG_ORIG_TP_DPORT_ROUTER" == %s && "
   "%s.dst == ", ip_match, reg_vip, lb_vip->vip_str,
-  lb_vip->vip_port, ip_match);
+  lb_vip->port_str, ip_match);
 } else {
 ds_put_format(&aff_match_learn, REGBIT_KNOWN_LB_SESSION" == 0 && "
   "ct.new && %s && %s == %s && %s.dst == ", ip_match,
@@ -7226,7 +7226,7 @@ build_lb_affinity_lr_flows(struct hmap *lflows, struct 
ovn_northd_lb *lb,
 ds_put_cstr(&aff_action, ");");
 ds_put_char(&aff_action_learn, '"');
 
-if (lb_vip->vip_port) {
+if (lb_vip->port_str) {
 ds_put_format(&aff_action_learn, ", proto = %s", lb->proto);
 }
 
@@ -7316,9 +7316,9 @@ build_lb_affinity_ls_flows(struct hmap *lflows, struct 
ovn_northd_lb *lb,
   lb_vip->vip_str);
 }
 
-if (lb_vip->vip_port) {
-ds_put_format(&new_lb_match, " && "REG_ORIG_TP_DPORT " == %"PRIu16,
-  lb_vip->vip_port);
+if (lb_vip->port_str) {
+ds_put_format(&new_lb_match, " && "REG_ORIG_TP_DPORT " == %s",
+  lb_vip->port_str);
 }
 
 static char *aff_check = REGBIT_KNOWN_LB_SESSION" = chk_lb_aff(); next;";
@@ -7345,11 +7345,11 @@ build_lb_affinity_ls_flows(struct hmap *lflows, struct 
ovn_northd_lb *lb,
   reg_vip, lb_vip->vip_str);
 ds_put_cstr(&aff_action_learn, "commit_lb_aff(vip = \"");
 
-if (lb_vip->vip_port) {
-ds_put_format(&aff_action, REG_ORIG_TP_DPORT" = %"PRIu16"; ",
-  lb_vip->vip_port);
-ds_put_format(&aff_action_learn, ipv6 ? "[%s]:%"PRIu16 : "%s:%"PRIu16,
-  lb_vip->vip_str, lb_vip->vip_port);
+if (lb_vip->port_str) {
+ds_put_format(&aff_action, REG_ORIG_TP_DPORT" = %s; ",
+  lb_vip->port_str);
+ds_put_format(&aff_action_learn, ipv6 ? "[%s]:%s" : "%s:%s",
+  lb_vip->vip_str, lb_vip->port_str);
 } else {
 ds_put_cstr(&aff_action_learn, lb_vip->vip_str);
 }
@@ -7358,12 +7358,12 @@ build_lb_affinity_ls_flows(struct hmap *lflows, struct 
ovn_northd_lb *lb,
 ds_put_cstr(&aff_action_learn, "\", backend = \"");
 
 /* Prepare common part of affinity learn match. */
-if (lb_vip->vip_port) {
+if (lb_vip->port_str) {
 ds_put_format(&aff_match_learn, REGBIT_KNOWN_LB_SESSION" == 0 && "
   "ct.new && %s && %s == %s && "
-  REG_ORIG_TP_DPORT" == %"PRIu16" && %s.dst == ",
+  REG_ORIG_TP_DPORT" == %s && %s.dst == ",
   ip_match, reg_vip, lb_vip->vip_str,
-  lb_vip->vip_port, ip_match);
+  lb_vip->port_str, ip_match);
 } else {
 ds_put_format(&aff_match_learn, REGBIT_KNOWN_LB_SESSION" == 0 && "
   "ct.new && %s && %s == %s && %s.dst == ",
@@ -7

[ovs-dev] [PATCH] classifier: Fix missing masks on a final stage with ports trie.

2023-02-17 Thread Ilya Maximets
Flow lookup doesn't include masks of the final stage in a resulted
flow wildcards in case that stage had L4 ports match.  Only the result
of ports trie lookup is added to the mask.  It might be sufficient in
many cases, but it's not correct, because ports trie is not how we
decided that the packet didn't match in this subtable.  In fact, we
used a full subtable mask in order to determine that, so all the
subtable mask bits has to be added.

Ports trie can still be used to adjust ports' mask, but it is not
sufficient to determine that the packet didn't match.

Assuming we have following 2 OpenFlow rules on the bridge:

 table=0, priority=10,tcp,tp_dst=80,tcp_flags=+psh actions=drop
 table=0, priority=0 actions=output(1)

The first high priority rule supposed to drop all the TCP data traffic
sent on port 80.  The handshake, however, is allowed for forwarding.

Both 'tcp_flags' and 'tp_dst' are on the final stage in the flow.
Since the stage mask from that stage is not incorporated into the flow
wildcards and only ports mask is getting updated, we have the following
megaflow for the SYN packet that has no match on 'tcp_flags':

 $ ovs-appctl ofproto/trace br0 "in_port=br0,tcp,tp_dst=80,tcp_flags=syn"

 Megaflow: recirc_id=0,eth,tcp,in_port=LOCAL,nw_frag=no,tp_dst=80
 Datapath actions: 1

If this flow is getting installed into datapath flow table, all the
packets for port 80, regardless of TCP flags, will be forwarded.

Incorporating all the looked at bits from the final stage into the
stages map in order to get all the necessary wildcards.  Ports mask
has to be updated as a last step, because it doesn't cover the full
64-bit slot in the flowmap.

With this change, in the example above, OVS is producing correct
flow wildcards including match on TCP flags:

 Megaflow: recirc_id=0,eth,tcp,in_port=LOCAL,nw_frag=no,tp_dst=80,tcp_flags=-psh
 Datapath actions: 1

This way only -psh packets will be forwarded, as expected.

This issue affects all other fields on stage 4, not only TCP flags.
Tests included to cover tcp_flags, nd_target and ct_tp_src/dst.
First two are frequently used, ct ones are sharing the same flowmap
slot with L4 ports, so important to test.

Before the pre-computation of stage masks, flow wildcards were updated
during lookup, so there was no issue.  The bits of the final stage was
lost with introduction of 'stages_map'.

Recent adjustment of segment boundaries exposed 'tcp_flags' to the issue.

Reported-at: https://github.com/openvswitch/ovs-issues/issues/272
Fixes: ca44218515f0 ("classifier: Adjust segment boundary to execute 
prerequisite processing.")
Fixes: fa2fdbf8d0c1 ("classifier: Pre-compute stage masks.")
Signed-off-by: Ilya Maximets 
---
 lib/classifier.c| 25 ++---
 tests/classifier.at | 88 +
 2 files changed, 108 insertions(+), 5 deletions(-)

diff --git a/lib/classifier.c b/lib/classifier.c
index 0a89626cc..18dbfc83a 100644
--- a/lib/classifier.c
+++ b/lib/classifier.c
@@ -1695,6 +1695,8 @@ find_match_wc(const struct cls_subtable *subtable, 
ovs_version_t version,
 const struct cls_match *rule = NULL;
 struct flowmap stages_map = FLOWMAP_EMPTY_INITIALIZER;
 unsigned int mask_offset = 0;
+bool adjust_ports_mask = false;
+ovs_be32 ports_mask;
 int i;
 
 /* Try to finish early by checking fields in segments. */
@@ -1722,6 +1724,9 @@ find_match_wc(const struct cls_subtable *subtable, 
ovs_version_t version,
 subtable->index_maps[i], flow, wc)) {
 goto no_match;
 }
+/* Accumulate the map used so far. */
+stages_map = flowmap_or(stages_map, subtable->index_maps[i]);
+
 hash = flow_hash_in_minimask_range(flow, &subtable->mask,
subtable->index_maps[i],
&mask_offset, &basis);
@@ -1731,14 +1736,16 @@ find_match_wc(const struct cls_subtable *subtable, 
ovs_version_t version,
  * unwildcarding all the ports bits, use the ports trie to figure out a
  * smaller set of bits to unwildcard. */
 unsigned int mbits;
-ovs_be32 value, plens, mask;
+ovs_be32 value, plens;
 
-mask = miniflow_get_ports(&subtable->mask.masks);
-value = ((OVS_FORCE ovs_be32 *)flow)[TP_PORTS_OFS32] & mask;
+ports_mask = miniflow_get_ports(&subtable->mask.masks);
+value = ((OVS_FORCE ovs_be32 *) flow)[TP_PORTS_OFS32] & ports_mask;
 mbits = trie_lookup_value(&subtable->ports_trie, &value, &plens, 32);
 
-((OVS_FORCE ovs_be32 *)&wc->masks)[TP_PORTS_OFS32] |=
-mask & be32_prefix_mask(mbits);
+ports_mask &= be32_prefix_mask(mbits);
+ports_mask |= ((OVS_FORCE ovs_be32 *) &wc->masks)[TP_PORTS_OFS32];
+
+adjust_ports_mask = true;
 
 goto no_match;
 }
@@ -1751,6 +1758,14 @@ no_match:
 /* Unwildcard the bits in stages so far, as they were used in determining
  * there is no match. */
 flow

[ovs-dev] [PATCH v4 ovn] Add IPv6 support for lb health-check

2023-02-17 Thread Lorenzo Bianconi
Add Similar to IPv4 counterpart, introduce IPv6 load-balancer health
check support.

Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=2136094
Reviewed-by: Ales Musil 
Acked-by: Mark Michelson 
Signed-off-by: Lorenzo Bianconi 
---
Changes since v3:
- improve code parsing in ovn_lb_svc_create()
- improve system-ovn.at test
- remove leftover code

Changes since v2:
- cosmetics

Changes since v1:
- fix potential crash in ovn-northd
- improve documentation
---
 controller/pinctrl.c| 216 ++--
 northd/northd.c |  75 ++
 northd/ovn-northd.8.xml |  17 
 ovn-nb.xml  |  21 ++--
 tests/ovn.at| 201 -
 tests/system-ovn.at | 185 +-
 6 files changed, 612 insertions(+), 103 deletions(-)

diff --git a/controller/pinctrl.c b/controller/pinctrl.c
index ffceb7e5f..f8ebc3a9e 100644
--- a/controller/pinctrl.c
+++ b/controller/pinctrl.c
@@ -6736,9 +6736,10 @@ sync_svc_monitors(struct ovsdb_idl_txn *ovnsb_idl_txn,
 
 struct in6_addr ip_addr;
 ovs_be32 ip4;
-if (ip_parse(sb_svc_mon->ip, &ip4)) {
+bool is_ipv4 = ip_parse(sb_svc_mon->ip, &ip4);
+if (is_ipv4) {
 ip_addr = in6_addr_mapped_ipv4(ip4);
-} else {
+} else if (!ipv6_parse(sb_svc_mon->ip, &ip_addr)) {
 continue;
 }
 
@@ -6751,16 +6752,27 @@ sync_svc_monitors(struct ovsdb_idl_txn *ovnsb_idl_txn,
 continue;
 }
 
-for (size_t j = 0; j < laddrs.n_ipv4_addrs; j++) {
-if (ip4 == laddrs.ipv4_addrs[j].addr) {
-ea = laddrs.ea;
-mac_found = true;
-break;
+if (is_ipv4) {
+for (size_t j = 0; j < laddrs.n_ipv4_addrs; j++) {
+if (ip4 == laddrs.ipv4_addrs[j].addr) {
+ea = laddrs.ea;
+mac_found = true;
+break;
+}
+}
+} else {
+for (size_t j = 0; j < laddrs.n_ipv6_addrs; j++) {
+if (IN6_ARE_ADDR_EQUAL(&ip_addr,
+   &laddrs.ipv6_addrs[j].addr)) {
+ea = laddrs.ea;
+mac_found = true;
+break;
+}
 }
 }
 
-if (!mac_found && !laddrs.n_ipv4_addrs) {
-/* IPv4 address(es) are not configured. Use the first mac. */
+if (!mac_found && !laddrs.n_ipv4_addrs && !laddrs.n_ipv6_addrs) {
+/* IP address(es) are not configured. Use the first mac. */
 ea = laddrs.ea;
 mac_found = true;
 }
@@ -6794,7 +6806,7 @@ sync_svc_monitors(struct ovsdb_idl_txn *ovnsb_idl_txn,
 svc_mon->port_key = port_key;
 svc_mon->proto_port = sb_svc_mon->port;
 svc_mon->ip = ip_addr;
-svc_mon->is_ip6 = false;
+svc_mon->is_ip6 = !is_ipv4;
 svc_mon->state = SVC_MON_S_INIT;
 svc_mon->status = SVC_MON_ST_UNKNOWN;
 svc_mon->protocol = protocol;
@@ -7562,26 +7574,30 @@ svc_monitor_send_tcp_health_check__(struct rconn 
*swconn,
 ovs_be32 tcp_ack,
 ovs_be16 tcp_src)
 {
-if (svc_mon->is_ip6) {
-return;
-}
-
 /* Compose a TCP-SYN packet. */
 uint64_t packet_stub[128 / 8];
 struct dp_packet packet;
+dp_packet_use_stub(&packet, packet_stub, sizeof packet_stub);
 
 struct eth_addr eth_src;
 eth_addr_from_string(svc_mon->sb_svc_mon->src_mac, ð_src);
-ovs_be32 ip4_src;
-ip_parse(svc_mon->sb_svc_mon->src_ip, &ip4_src);
-
-dp_packet_use_stub(&packet, packet_stub, sizeof packet_stub);
-pinctrl_compose_ipv4(&packet, eth_src, svc_mon->ea,
- ip4_src, in6_addr_get_mapped_ipv4(&svc_mon->ip),
- IPPROTO_TCP, 63, TCP_HEADER_LEN);
+if (svc_mon->is_ip6) {
+struct in6_addr ip6_src;
+ipv6_parse(svc_mon->sb_svc_mon->src_ip, &ip6_src);
+pinctrl_compose_ipv6(&packet, eth_src, svc_mon->ea,
+ &ip6_src, &svc_mon->ip, IPPROTO_TCP,
+ 63, TCP_HEADER_LEN);
+} else {
+ovs_be32 ip4_src;
+ip_parse(svc_mon->sb_svc_mon->src_ip, &ip4_src);
+pinctrl_compose_ipv4(&packet, eth_src, svc_mon->ea,
+ ip4_src, in6_addr_get_mapped_ipv4(&svc_mon->ip),
+ IPPROTO_TCP, 63, TCP_HEADER_LEN);
+}
 
 struct tcp_header *th = dp_packet_l4(&packet);
 dp_packet_set_l4(&packet, th);
+th->tcp_csum = 0;
 th->tcp_dst = htons(svc_mon->proto_port);
 th->tcp_src = tcp_src;
 
@@ -7592,7 +7608,11 @@ svc_monitor_send_tcp_health_check__(struc

Re: [ovs-dev] [PATCH v3 ovn] Add IPv6 support for lb health-check

2023-02-17 Thread Lorenzo Bianconi
> On 2/10/23 12:18, Lorenzo Bianconi wrote:
> > Add Similar to IPv4 counterpart, introduce IPv6 load-balancer health
> > check support.
> > 
> > Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=2136094
> > Acked-by: Mark Michelson 
> > Signed-off-by: Lorenzo Bianconi 
> > ---
> > Changes since v2:
> > - cosmetics
> > 
> > Changes since v1:
> > - fix potential crash in ovn-northd
> > - improve documentation
> > ---
> 
> Hi Lorenzo,
> 
> Thanks for this revision; I have a few comments below.

Hi Dumitru,

thx for the review.

> 
> >  controller/pinctrl.c| 216 -
> >  northd/northd.c |  74 +
> >  northd/ovn-northd.8.xml |  17 +++
> >  ovn-nb.xml  |  21 ++--
> >  tests/ovn.at| 201 ++-
> >  tests/system-ovn.at | 230 +++-
> >  6 files changed, 656 insertions(+), 103 deletions(-)
> > 
> > diff --git a/controller/pinctrl.c b/controller/pinctrl.c
> > index ffceb7e5f..f8ebc3a9e 100644
> > --- a/controller/pinctrl.c
> > +++ b/controller/pinctrl.c
> > @@ -6736,9 +6736,10 @@ sync_svc_monitors(struct ovsdb_idl_txn 
> > *ovnsb_idl_txn,
> >  
> >  struct in6_addr ip_addr;
> >  ovs_be32 ip4;
> > -if (ip_parse(sb_svc_mon->ip, &ip4)) {
> > +bool is_ipv4 = ip_parse(sb_svc_mon->ip, &ip4);
> > +if (is_ipv4) {
> >  ip_addr = in6_addr_mapped_ipv4(ip4);
> > -} else {
> > +} else if (!ipv6_parse(sb_svc_mon->ip, &ip_addr)) {
> >  continue;
> >  }
> >  
> > @@ -6751,16 +6752,27 @@ sync_svc_monitors(struct ovsdb_idl_txn 
> > *ovnsb_idl_txn,
> >  continue;
> >  }
> >  
> > -for (size_t j = 0; j < laddrs.n_ipv4_addrs; j++) {
> > -if (ip4 == laddrs.ipv4_addrs[j].addr) {
> > -ea = laddrs.ea;
> > -mac_found = true;
> > -break;
> > +if (is_ipv4) {
> > +for (size_t j = 0; j < laddrs.n_ipv4_addrs; j++) {
> > +if (ip4 == laddrs.ipv4_addrs[j].addr) {
> > +ea = laddrs.ea;
> > +mac_found = true;
> > +break;
> > +}
> > +}
> > +} else {
> > +for (size_t j = 0; j < laddrs.n_ipv6_addrs; j++) {
> > +if (IN6_ARE_ADDR_EQUAL(&ip_addr,
> > +   &laddrs.ipv6_addrs[j].addr)) {
> > +ea = laddrs.ea;
> > +mac_found = true;
> > +break;
> > +}
> >  }
> >  }
> >  
> > -if (!mac_found && !laddrs.n_ipv4_addrs) {
> > -/* IPv4 address(es) are not configured. Use the first mac. 
> > */
> > +if (!mac_found && !laddrs.n_ipv4_addrs && 
> > !laddrs.n_ipv6_addrs) {
> > +/* IP address(es) are not configured. Use the first mac. */
> >  ea = laddrs.ea;
> >  mac_found = true;
> >  }
> > @@ -6794,7 +6806,7 @@ sync_svc_monitors(struct ovsdb_idl_txn *ovnsb_idl_txn,
> >  svc_mon->port_key = port_key;
> >  svc_mon->proto_port = sb_svc_mon->port;
> >  svc_mon->ip = ip_addr;
> > -svc_mon->is_ip6 = false;
> > +svc_mon->is_ip6 = !is_ipv4;
> >  svc_mon->state = SVC_MON_S_INIT;
> >  svc_mon->status = SVC_MON_ST_UNKNOWN;
> >  svc_mon->protocol = protocol;
> > @@ -7562,26 +7574,30 @@ svc_monitor_send_tcp_health_check__(struct rconn 
> > *swconn,
> >  ovs_be32 tcp_ack,
> >  ovs_be16 tcp_src)
> >  {
> > -if (svc_mon->is_ip6) {
> > -return;
> > -}
> > -
> >  /* Compose a TCP-SYN packet. */
> >  uint64_t packet_stub[128 / 8];
> >  struct dp_packet packet;
> > +dp_packet_use_stub(&packet, packet_stub, sizeof packet_stub);
> >  
> >  struct eth_addr eth_src;
> >  eth_addr_from_string(svc_mon->sb_svc_mon->src_mac, ð_src);
> > -ovs_be32 ip4_src;
> > -ip_parse(svc_mon->sb_svc_mon->src_ip, &ip4_src);
> > -
> > -dp_packet_use_stub(&packet, packet_stub, sizeof packet_stub);
> > -pinctrl_compose_ipv4(&packet, eth_src, svc_mon->ea,
> > - ip4_src, in6_addr_get_mapped_ipv4(&svc_mon->ip),
> > - IPPROTO_TCP, 63, TCP_HEADER_LEN);
> > +if (svc_mon->is_ip6) {
> > +struct in6_addr ip6_src;
> > +ipv6_parse(svc_mon->sb_svc_mon->src_ip, &ip6_src);
> > +pinctrl_compose_ipv6(&packet, eth_src, svc_mon->ea,
> > + &ip6_src, &svc_mon->ip, IPPROTO_TCP,
> > + 63, TCP_HEADER_LEN);
> > +} else {
> > +ovs_be32 ip4_src;
> > +ip_parse(svc_mon->

Re: [ovs-dev] [PATCH ovn 2/7] ovs: Bump submodule to recent master

2023-02-17 Thread Ilya Maximets
On 2/17/23 11:38, Ales Musil wrote:
> Bump ovs submodule to cd1cf6a2 which is after
> 0a758703 ("conntrack: Properly unNAT inner header of related traffic.").
> This patch is needed for "LB - ICMP related traffic" system test to work
> with OvS userspace netdev.
> 
> Signed-off-by: Ales Musil 
> ---
>  ovs | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/ovs b/ovs
> index 8986d4d55..cd1cf6a24 16
> --- a/ovs
> +++ b/ovs
> @@ -1 +1 @@
> -Subproject commit 8986d4d5564401eeef3dea828b51fe8bae2cc8aa
> +Subproject commit cd1cf6a24b708b6f133fa83913ab3e4f586a200c

We don't need to bump to master.  OVN is currently tracking branch-3.1
and the fix is available on that branch.

Best regards, Ilya Maximets.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH v4] ofproto-dpif-xlate: Remove repeated function for judge garp

2023-02-17 Thread Han Ding
Function is_gratuitous_arp() and function is_garp() are all used to judge
whether the flow is gratuitous arp. It is not necessary to use two functions
to do the same thing and just keep one.

Gratuitous ARP message is a generally link-level broadcast messages and
carry the same IP in sender and target fields. This patch add the check
in function is_garp() whether the arp is a broadcast message and whether
the arp is an arp request or an arp reply.

Signed-off-by: Han Ding 
---

Notes:
v2:
- Add the check whether the ARP packet is a broadcast message in is_garp().

v3:
- Add the check whether the packet is an arp request or an arp reply in 
is_garp().

v4:
- Add description of differences between patch versions
- Use WC_MASK_FIELD() macro instead of memset.

 lib/flow.h   | 19 +--
 ofproto/ofproto-dpif-xlate.c | 32 ++--
 2 files changed, 19 insertions(+), 32 deletions(-)

diff --git a/lib/flow.h b/lib/flow.h
index c647ad83c..9294a1b24 100644
--- a/lib/flow.h
+++ b/lib/flow.h
@@ -1133,8 +1133,23 @@ static inline bool is_garp(const struct flow *flow,
struct flow_wildcards *wc)
 {
 if (is_arp(flow)) {
-return (FLOW_WC_GET_AND_MASK_WC(flow, wc, nw_src) ==
-FLOW_WC_GET_AND_MASK_WC(flow, wc, nw_dst));
+if (wc) {
+WC_MASK_FIELD(wc, dl_dst);
+}
+
+if (!eth_addr_is_broadcast(flow->dl_dst)) {
+return false;
+}
+
+if (wc) {
+WC_MASK_FIELD(wc, nw_proto);
+}
+
+if (flow->nw_proto == ARP_OP_REQUEST ||
+flow->nw_proto == ARP_OP_REPLY) {
+return (FLOW_WC_GET_AND_MASK_WC(flow, wc, nw_src) ==
+FLOW_WC_GET_AND_MASK_WC(flow, wc, nw_dst));
+}
 }

 return false;
diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index a9cf3cbee..b3c13f6bf 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -2543,34 +2543,6 @@ output_normal(struct xlate_ctx *ctx, const struct 
xbundle *out_xbundle,
 memcpy(&ctx->xin->flow.vlans, &old_vlans, sizeof(old_vlans));
 }

-/* A VM broadcasts a gratuitous ARP to indicate that it has resumed after
- * migration.  Older Citrix-patched Linux DomU used gratuitous ARP replies to
- * indicate this; newer upstream kernels use gratuitous ARP requests. */
-static bool
-is_gratuitous_arp(const struct flow *flow, struct flow_wildcards *wc)
-{
-if (flow->dl_type != htons(ETH_TYPE_ARP)) {
-return false;
-}
-
-memset(&wc->masks.dl_dst, 0xff, sizeof wc->masks.dl_dst);
-if (!eth_addr_is_broadcast(flow->dl_dst)) {
-return false;
-}
-
-memset(&wc->masks.nw_proto, 0xff, sizeof wc->masks.nw_proto);
-if (flow->nw_proto == ARP_OP_REPLY) {
-return true;
-} else if (flow->nw_proto == ARP_OP_REQUEST) {
-memset(&wc->masks.nw_src, 0xff, sizeof wc->masks.nw_src);
-memset(&wc->masks.nw_dst, 0xff, sizeof wc->masks.nw_dst);
-
-return flow->nw_src == flow->nw_dst;
-} else {
-return false;
-}
-}
-
 /* Determines whether packets in 'flow' within 'xbridge' should be forwarded or
  * dropped.  Returns true if they may be forwarded, false if they should be
  * dropped.
@@ -2619,7 +2591,7 @@ is_admissible(struct xlate_ctx *ctx, struct xport 
*in_port,
 mac = mac_learning_lookup(xbridge->ml, flow->dl_src, vlan);
 if (mac
 && mac_entry_get_port(xbridge->ml, mac) != in_xbundle->ofbundle
-&& (!is_gratuitous_arp(flow, ctx->wc)
+&& (!is_garp(flow, ctx->wc)
 || mac_entry_is_grat_arp_locked(mac))) {
 ovs_rwlock_unlock(&xbridge->ml->rwlock);
 xlate_report(ctx, OFT_DETAIL,
@@ -3062,7 +3034,7 @@ xlate_normal(struct xlate_ctx *ctx)
 }

 /* Learn source MAC. */
-bool is_grat_arp = is_gratuitous_arp(flow, wc);
+bool is_grat_arp = is_garp(flow, wc);
 if (ctx->xin->allow_side_effects
 && flow->packet_type == htonl(PT_ETH)
 && in_port && in_port->pt_mode != NETDEV_PT_LEGACY_L3
--
2.27.0




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


Re: [ovs-dev] [PATCH 2/2] ci: Run tc offload tests in GitHub Actions.

2023-02-17 Thread Aaron Conole
Ilya Maximets  writes:

> On 2/14/23 14:54, Eelco Chaudron wrote:
>> Run "make check-offloads" as part of the GitHub actions tests.
>> 
>> This test was run 25 times using GitHub actions, and the
>> failing rerun test cases where excluded. There are quite some
>> first-run failures, but unfortunately, there is no other
>> more stable kernel available as a GitHub-hosted runner.
>> 
>> Signed-off-by: Eelco Chaudron 
>> ---
>
> It doesn't seems to take that much time.  Maybe it's not that
> bad of an idea after all. :)
>
> It might make sense to run this job with asan/ubsan enabled.
> What do you think?  We might re-structure asan/ubsan jobs to
> run them at the same time for this, like OVN does.
>
>>  .ci/linux-build.sh   |6 +-
>>  .github/workflows/build-and-test.yml |8 +++-
>>  2 files changed, 12 insertions(+), 2 deletions(-)
>> 
>> diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
>> index 10021fddb..cafff4d83 100755
>> --- a/.ci/linux-build.sh
>> +++ b/.ci/linux-build.sh
>> @@ -163,7 +163,7 @@ fi
>>  
>>  OPTS="${EXTRA_OPTS} ${OPTS} $*"
>>  
>> -if [ "$TESTSUITE" ]; then
>> +if [ "$TESTSUITE" = 'test' ]; then
>>  # 'distcheck' will reconfigure with required options.
>>  # Now we only need to prepare the Makefile without sparse-wrapped CC.
>>  configure_ovs
>> @@ -173,6 +173,10 @@ if [ "$TESTSUITE" ]; then
>>  TESTSUITEFLAGS=-j4 RECHECK=yes
>>  else
>>  build_ovs
>> +if [ -n "$TESTSUITE" ]; then
>> +sudo -E PATH="$PATH" make "$TESTSUITE" TESTSUITEFLAGS="$TEST_OPTS" \
>> +RECHECK=yes
>> +fi
>>  fi
>>  
>>  exit 0
>> diff --git a/.github/workflows/build-and-test.yml 
>> b/.github/workflows/build-and-test.yml
>> index 82675b973..4020f0882 100644
>> --- a/.github/workflows/build-and-test.yml
>> +++ b/.github/workflows/build-and-test.yml
>> @@ -18,9 +18,10 @@ jobs:
>>M32: ${{ matrix.m32 }}
>>OPTS:${{ matrix.opts }}
>>TESTSUITE:   ${{ matrix.testsuite }}
>> +  TEST_OPTS:   ${{ matrix.test_opts }}
>>  
>>  name: linux ${{ join(matrix.*, ' ') }}
>> -runs-on: ubuntu-20.04
>> +runs-on: ubuntu-22.04
>>  timeout-minutes: 30
>>  
>>  strategy:
>> @@ -90,6 +91,10 @@ jobs:
>>  m32:  m32
>>  opts: --disable-ssl
>>  
>> +  - compiler: gcc
>> +testsuite:check-offloads
>> +test_opts:"-k !'offloads - check interface meter 
>> offloading',!'offloads - check_pkt_len action',!'conntrack - force 
>> commit',!'conntrack - Multiple ICMP traverse'"
>
> This doesn't look pretty, especially in the job name.  Maybe we can
> add a special keyword like "AT_KEYWORDS([github_skip])" and have
> "!github_skip" here instead?

I agree, this doesn't look nice.

Actually, I think with TESTSUITEFLAGS="--list" we can see the keywords
associated as well, so it would be possible to see which tests are
included as well.

If we do choose something like this, it should be put in the
documentation clearly that we have such a skip keyword, and such option
should be used sparingly.

> Meter offload failures still look like a bug to me though.
>
>> +
>>  steps:
>>  - name: checkout
>>uses: actions/checkout@v3
>> @@ -152,6 +157,7 @@ jobs:
>>  mkdir logs
>>  cp config.log ./logs/
>>  cp -r ./*/_build/sub/tests/testsuite.* ./logs/ || true
>> +cp -r ./*/_build/sub/tests/system-offloads-testsuite.* ./logs/ || 
>> true
>>  tar -czvf logs.tgz logs/
>>  
>>  - name: upload logs on failure

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


Re: [ovs-dev] [PATCH ovn 2/2] Prepare for post-23.03.0.

2023-02-17 Thread 0-day Robot
Bleep bloop.  Greetings Mark Michelson, 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: Author Mark Michelson  needs to sign off.
Lines checked: 53, 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


Re: [ovs-dev] [PATCH ovn 1/2] Prepare for 23.03.0.

2023-02-17 Thread 0-day Robot
Bleep bloop.  Greetings Mark Michelson, 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: Author Mark Michelson  needs to sign off.
Lines checked: 53, 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 ovn 2/2] Prepare for post-23.03.0.

2023-02-17 Thread Mark Michelson
---
 NEWS | 3 +++
 configure.ac | 2 +-
 debian/changelog | 6 ++
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index 74510866e..39e567a36 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+Post v23.03.0
+-
+
 OVN v23.03.0
 -
   - ovn-controller: Experimental support for co-hosting multiple controller
diff --git a/configure.ac b/configure.ac
index b51d0f01e..674fef8de 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13,7 +13,7 @@
 # limitations under the License.
 
 AC_PREREQ(2.63)
-AC_INIT(ovn, 23.03.0, b...@openvswitch.org)
+AC_INIT(ovn, 23.03.90, b...@openvswitch.org)
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_HEADERS([config.h])
diff --git a/debian/changelog b/debian/changelog
index a70fdfe25..18dd19953 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+ovn (23.03.90-1) unstable; urgency=low
+
+   * New upstream version
+
+ -- OVN team   Fri, 17 Feb 2023 08:29:57 -0500
+
 ovn (23.03.0-1) unstable; urgency=low
 
* New upstream version
-- 
2.38.1

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


[ovs-dev] [PATCH ovn 1/2] Prepare for 23.03.0.

2023-02-17 Thread Mark Michelson
---
 NEWS | 2 +-
 configure.ac | 2 +-
 debian/changelog | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index fd0fee75c..74510866e 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-Post v22.12.0
+OVN v23.03.0
 -
   - ovn-controller: Experimental support for co-hosting multiple controller
 instances on the same host.
diff --git a/configure.ac b/configure.ac
index 7d343c986..b51d0f01e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13,7 +13,7 @@
 # limitations under the License.
 
 AC_PREREQ(2.63)
-AC_INIT(ovn, 22.12.90, b...@openvswitch.org)
+AC_INIT(ovn, 23.03.0, b...@openvswitch.org)
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_HEADERS([config.h])
diff --git a/debian/changelog b/debian/changelog
index bcfbcb9e5..a70fdfe25 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,8 @@
-ovn (22.12.90-1) unstable; urgency=low
+ovn (23.03.0-1) unstable; urgency=low
 
* New upstream version
 
- -- OVN team   Mon, 28 Nov 2022 10:42:29 -0500
+ -- OVN team   Fri, 17 Feb 2023 08:29:57 -0500
 
 ovn (22.12.0-1) unstable; urgency=low
 
-- 
2.38.1

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


Re: [ovs-dev] [PATCH ovn v3] utilities: Add simple container automation

2023-02-17 Thread Ales Musil
On Fri, Feb 17, 2023 at 1:04 PM Dumitru Ceara  wrote:

> On 2/16/23 17:43, Mark Michelson wrote:
> > Thanks Ales,
> >
> > Acked-by: Mark Michelson 
> >
>
> Thanks, Ales and Mark!  I applied this to the main branch.  But I do
> have one concern: I think we need to start using this in CI upstream to
> avoid the script/dockerfile going stale.  Ales, do you have some cycles
> to look into that?
>
> Regards,
> Dumitru
>
>
Agreed, I'll look into it.

Thanks,
Ales

-- 

Ales Musil

Senior Software Engineer - OVN Core

Red Hat EMEA 

amu...@redhat.comIM: amusil

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


Re: [ovs-dev] [PATCH ovn v3] utilities: Add simple container automation

2023-02-17 Thread Dumitru Ceara
On 2/16/23 17:43, Mark Michelson wrote:
> Thanks Ales,
> 
> Acked-by: Mark Michelson 
> 

Thanks, Ales and Mark!  I applied this to the main branch.  But I do
have one concern: I think we need to start using this in CI upstream to
avoid the script/dockerfile going stale.  Ales, do you have some cycles
to look into that?

Regards,
Dumitru

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


Re: [ovs-dev] [PATCH ovn v2 2/2] controller: Flush CT for removed LB backends

2023-02-17 Thread Dumitru Ceara
On 2/16/23 20:20, Mark Michelson wrote:
> Thanks Ales,
> 
> Acked-by: Mark Michelson 
> 

Thanks, Mark and Ales!

I applied this to the main branch with a minor change.  Please see
below.

Regards,
Dumitru

diff --git a/lib/lb.c b/lib/lb.c
index a5cd0eced9..e941434c4e 100644
--- a/lib/lb.c
+++ b/lib/lb.c
@@ -519,24 +519,6 @@ ovn_lb_get_health_check(const struct nbrec_load_balancer 
*nbrec_lb,
 return NULL;
 }
 
-static inline uint32_t
-hash_add_in6_addr(uint32_t hash, const struct in6_addr *addr)
-{
-for (uint8_t i = 0; i < 4; i++) {
-#ifdef s6_addr32
-hash = hash_add(hash, addr->s6_addr32[i]);
-#else
-uint8_t index = i * 4;
-uint32_t part = (uint32_t) addr->s6_addr[index]
-| (uint32_t) addr->s6_addr[index + 1] << 8
-| (uint32_t) addr->s6_addr[index + 2] << 16
-| (uint32_t) addr->s6_addr[index + 3] << 24;
-hash = hash_add(hash, part);
-#endif
-}
-return hash;
-}
-
 struct ovn_northd_lb *
 ovn_northd_lb_create(const struct nbrec_load_balancer *nbrec_lb,
  size_t n_datapaths)
diff --git a/lib/ovn-util.h b/lib/ovn-util.h
index 6ce40c7f6e..cda1fde487 100644
--- a/lib/ovn-util.h
+++ b/lib/ovn-util.h
@@ -313,6 +313,23 @@ void ddlog_warn(const char *msg);
 void ddlog_err(const char *msg);
 #endif
 
+static inline uint32_t
+hash_add_in6_addr(uint32_t hash, const struct in6_addr *addr)
+{
+for (uint8_t i = 0; i < 4; i++) {
+#ifdef s6_addr32
+hash = hash_add(hash, addr->s6_addr32[i]);
+#else
+uint8_t index = i * 4;
+uint32_t part = (uint32_t) addr->s6_addr[index]
+| (uint32_t) addr->s6_addr[index + 1] << 8
+| (uint32_t) addr->s6_addr[index + 2] << 16
+| (uint32_t) addr->s6_addr[index + 3] << 24;
+hash = hash_add(hash, part);
+#endif
+}
+return hash;
+}
 
 /* Must be a bit-field ordered from most-preferred (higher number) to
  * least-preferred (lower number). */
---

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


Re: [ovs-dev] [PATCH ovn v2 1/2] controller: Store load balancer data in separate node

2023-02-17 Thread Dumitru Ceara
On 2/16/23 20:04, Mark Michelson wrote:
> The "local_datapths" typo is still present in this version of the patch.
> However, since that's the only thing holding it back,
> 
> Acked-by: Mark Michelson 
> 
> I think whoever commits this can correct the typo.
> 

Thanks, Mark and Ales!  I applied it with the following minor changes:

diff --git a/controller/local_data.c b/controller/local_data.c
index abd372172b..acaf1de6d0 100644
--- a/controller/local_data.c
+++ b/controller/local_data.c
@@ -652,8 +652,7 @@ lb_is_local(const struct sbrec_load_balancer *sbrec_lb,
 {
 /* Check if the lb is local or not.  It is enough to find one datapath
  * in "local_datapaths" to consider the LB to be local. */
-size_t i;
-for (i = 0; i < sbrec_lb->n_datapaths; i++) {
+for (size_t i = 0; i < sbrec_lb->n_datapaths; i++) {
 if (get_local_datapath(local_datapaths,
sbrec_lb->datapaths[i]->tunnel_key)) {
 return true;
@@ -662,7 +661,7 @@ lb_is_local(const struct sbrec_load_balancer *sbrec_lb,
 
 struct sbrec_logical_dp_group *dp_group = sbrec_lb->datapath_group;
 
-for (i = 0; dp_group && i < dp_group->n_datapaths; i++) {
+for (size_t i = 0; dp_group && i < dp_group->n_datapaths; i++) {
 if (get_local_datapath(local_datapaths,
dp_group->datapaths[i]->tunnel_key)) {
 return true;
diff --git a/controller/ovn-controller.c b/controller/ovn-controller.c
index d96f16cc2a..805fb1b3cc 100644
--- a/controller/ovn-controller.c
+++ b/controller/ovn-controller.c
@@ -2687,7 +2687,7 @@ struct ed_type_lb_data {
 
 struct lb_data_ctx_in {
 const struct sbrec_load_balancer_table *lb_table;
-const struct hmap *local_datapths;
+const struct hmap *local_datapaths;
 const struct smap *template_vars;
 };
 
@@ -2766,7 +2766,7 @@ lb_data_handle_changed_ref(enum objdep_type type, const 
char *res_name,
 
 const struct sbrec_load_balancer *sbrec_lb =
 sbrec_load_balancer_table_get_for_uuid(ctx_in->lb_table, uuid);
-if (!lb_is_local(sbrec_lb, ctx_in->local_datapths)) {
+if (!lb_is_local(sbrec_lb, ctx_in->local_datapaths)) {
 free(resource_lb_uuid);
 continue;
 }
@@ -2886,7 +2886,7 @@ lb_data_template_var_handler(struct engine_node *node, 
void *data)
 
 const struct lb_data_ctx_in ctx_in = {
 .lb_table = lb_table,
-.local_datapths = &rt_data->local_datapaths,
+.local_datapaths = &rt_data->local_datapaths,
 .template_vars = &tv_data->local_templates
 };
 
---

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


Re: [ovs-dev] [PATCH ovn 7/7] ci: Replace clang jemalloc suite with system-test-userspace

2023-02-17 Thread 0-day Robot
Bleep bloop.  Greetings Ales Musil, 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: Line is 81 characters long (recommended limit is 79)
#27 FILE: .github/workflows/test.yml:50:
- { compiler: gcc, testsuite: system-test-userspace, test_range: "-100" 
}

WARNING: Line is 84 characters long (recommended limit is 79)
#28 FILE: .github/workflows/test.yml:51:
- { compiler: gcc, testsuite: system-test-userspace, test_range: 
"101-200" }

WARNING: Line is 81 characters long (recommended limit is 79)
#29 FILE: .github/workflows/test.yml:52:
- { compiler: gcc, testsuite: system-test-userspace, test_range: "201-" 
}

Lines checked: 36, Warnings: 3, 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 ovn 1/7] ci: Add support for userspace system test

2023-02-17 Thread Ales Musil
Add support for running system tests with
OvS userspace netdev.

Signed-off-by: Ales Musil 
---
 .ci/linux-build.sh | 69 ++
 1 file changed, 46 insertions(+), 23 deletions(-)

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index d7a49b6c0..2e38358a2 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -7,13 +7,14 @@ ARCH=${ARCH:-"x86_64"}
 COMMON_CFLAGS=""
 OVN_CFLAGS=""
 OPTS="$OPTS --enable-Werror"
+JOBS=${JOBS:-"-j4"}
 
 function configure_ovs()
 {
 pushd ovs
 ./boot.sh && ./configure CFLAGS="${COMMON_CFLAGS}" $* || \
 { cat config.log; exit 1; }
-make -j4 || { cat config.log; exit 1; }
+make $JOBS || { cat config.log; exit 1; }
 popd
 }
 
@@ -50,34 +51,56 @@ function configure_clang()
 COMMON_CFLAGS="${COMMON_CFLAGS} -Wno-error=unused-command-line-argument"
 }
 
+function execute_tests()
+{
+# 'distcheck' will reconfigure with required options.
+# Now we only need to prepare the Makefile without sparse-wrapped CC.
+configure_ovn
+
+export DISTCHECK_CONFIGURE_FLAGS="$OPTS"
+if ! make distcheck CFLAGS="${COMMON_CFLAGS} ${OVN_CFLAGS}" $JOBS \
+TESTSUITEFLAGS="$JOBS $TEST_RANGE" RECHECK=yes
+then
+# testsuite.log is necessary for debugging.
+cat */_build/sub/tests/testsuite.log
+exit 1
+fi
+}
+
+function execute_system_tests()
+{
+  type=$1
+  log_file=$2
+
+  configure_ovn $OPTS
+  make $JOBS || { cat config.log; exit 1; }
+  if ! sudo make $JOBS $type TESTSUITEFLAGS="$TEST_RANGE" RECHECK=yes; then
+  # $log_file is necessary for debugging.
+  cat tests/$log_file
+  exit 1
+  fi
+}
+
 configure_$CC
 
 if [ "$TESTSUITE" ]; then
-if [ "$TESTSUITE" = "system-test" ]; then
-configure_ovn $OPTS
-make -j4 || { cat config.log; exit 1; }
-if ! sudo make -j4 check-kernel TESTSUITEFLAGS="$TEST_RANGE" 
RECHECK=yes; then
-# system-kmod-testsuite.log is necessary for debugging.
-cat tests/system-kmod-testsuite.log
-exit 1
-fi
-else
-# 'distcheck' will reconfigure with required options.
-# Now we only need to prepare the Makefile without sparse-wrapped CC.
-configure_ovn
+case "$TESTSUITE" in
+"test")
+execute_tests
+;;
 
-export DISTCHECK_CONFIGURE_FLAGS="$OPTS"
-if ! make distcheck CFLAGS="${COMMON_CFLAGS} ${OVN_CFLAGS}" -j4 \
-TESTSUITEFLAGS="-j4 $TEST_RANGE" RECHECK=yes
-then
-# testsuite.log is necessary for debugging.
-cat */_build/sub/tests/testsuite.log
-exit 1
-fi
-fi
+"system-test")
+execute_system_tests "check-kernel" "system-kmod-testsuite.log"
+;;
+
+"system-test-userspace")
+execute_system_tests "check-system-userspace" \
+"system-userspace-testsuite.log"
+;;
+esac
 else
 configure_ovn $OPTS
-make -j4 || { cat config.log; exit 1; }
+make $JOBS || { cat config.log; exit 1; }
 fi
 
 exit 0
-- 
2.39.1

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


[ovs-dev] [PATCH ovn 5/7] system-tests: Use revalidator/purge instead of dpctl/del-flows

2023-02-17 Thread Ales Musil
The dpctl/del-flows shouldn't be used on running
ofproto layer, use revalidator/purge instead.

Signed-off-by: Ales Musil 
---
 tests/system-ovn.at | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/system-ovn.at b/tests/system-ovn.at
index f2a0b7b33..29671690f 100644
--- a/tests/system-ovn.at
+++ b/tests/system-ovn.at
@@ -6658,7 +6658,7 @@ AT_CHECK([ovs-appctl dpctl/dump-flows | grep ct_mark | 
grep -v ipv6 -c], [0], [i
 # Clear ACL for sw0
 check ovn-nbctl --wait=hv clear logical_switch sw0 acls
 
-check ovs-appctl dpctl/del-flows
+check ovs-appctl revalidator/purge
 
 check ovn-nbctl --wait=hv sync
 
-- 
2.39.1

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


[ovs-dev] [PATCH ovn 4/7] system-tests: Replace use of ADD_INT with ADD_VETH

2023-02-17 Thread Ales Musil
The ADD_INT does not work very well with userspace datapath.
To avoid any warnings that might fail the tests
use ADD_VETH instead. Also encourage this in
documentation for ADD_INT, because there should
be good reasoning behind using internal interface.

Signed-off-by: Ales Musil 
---
 tests/system-common-macros.at | 20 +---
 tests/system-ovn.at   | 35 +++
 2 files changed, 20 insertions(+), 35 deletions(-)

diff --git a/tests/system-common-macros.at b/tests/system-common-macros.at
index d65f359a6..2b23f89b0 100644
--- a/tests/system-common-macros.at
+++ b/tests/system-common-macros.at
@@ -49,6 +49,7 @@ m4_define([ADD_BR], [ovs-vsctl _ADD_BR([$1]) -- $2])
 # Add an internal port to 'ovs-br', then shift it into 'namespace' and
 # configure it with 'ip_addr' (specified in CIDR notation).
 # Optionally add an ipv6 address
+# The ADD_VETH should be used instead if possible.
 m4_define([ADD_INT],
 [ AT_CHECK([ovs-vsctl add-port $3 $1 -- set int $1 type=internal])
   AT_CHECK([ip link set $1 netns $2])
@@ -60,25 +61,6 @@ m4_define([ADD_INT],
 ]
 )
 
-# NS_ADD_INT([port], [namespace], [ovs-br], [ip_addr] [mac_addr] [ip6_addr] 
[default_gw] [default_ipv6_gw])
-# Create a namespace
-# Add an internal port to 'ovs-br', then shift it into 'namespace'.
-# Configure it with 'ip_addr' (specified in CIDR notation) and ip6_addr.
-# Set mac_addr
-# Add default gw for ipv4 and ipv6
-m4_define([NS_ADD_INT],
-[ AT_CHECK([ovs-vsctl add-port $3 $1 -- set int $1 type=internal  
external_ids:iface-id=$1])
-  ADD_NAMESPACES($2)
-  AT_CHECK([ip link set $1 netns $2])
-  NS_CHECK_EXEC([$2], [ip link set $1 address $5])
-  NS_CHECK_EXEC([$2], [ip link set dev $1 up])
-  NS_CHECK_EXEC([$2], [ip addr add $4 dev $1])
-  NS_CHECK_EXEC([$2], [ip addr add $6 dev $1])
-  NS_CHECK_EXEC([$2], [ip route add default via $7 dev $1])
-  NS_CHECK_EXEC([$2], [ip -6 route add default via $8 dev $1])
-]
-)
-
 # ADD_VETH([port], [namespace], [ovs-br], [ip_addr] [mac_addr], [gateway],
 #  [ip_addr_flags])
 #
diff --git a/tests/system-ovn.at b/tests/system-ovn.at
index cdcbb5be6..f2a0b7b33 100644
--- a/tests/system-ovn.at
+++ b/tests/system-ovn.at
@@ -8299,11 +8299,22 @@ check ovn-nbctl lsp-set-addresses ln unknown
 check ovn-nbctl lr-nat-add lr1 snat 172.16.1.10 192.168.1.0/24
 check ovn-nbctl lr-nat-add lr1 snat 1711::10 2001::/64
 
-NS_ADD_INT(ls1p1, ls1p1, br-int, "192.168.1.1/24", "00:00:00:01:01:01", 
"2001::1/64", "192.168.1.254", "2001::a" )
-NS_ADD_INT(ls1p2, ls1p2, br-int, "192.168.1.2/24", "00:00:00:01:01:02", 
"2001::2/64", "192.168.1.254", "2001::a" )
+ADD_NAMESPACES(ls1p1)
+ADD_VETH(ls1p1, ls1p1, br-int, "192.168.1.1/24", "00:00:00:01:01:01", \
+ "192.168.1.254")
+NS_CHECK_EXEC([ls1p1], [ip addr add 2001::1/64 dev ls1p1], [0])
+NS_CHECK_EXEC([ls1p1], [ip route add default via 2001::a dev ls1p1], [0])
+
+ADD_NAMESPACES(ls1p2)
+ADD_VETH(ls1p2, ls1p2, br-int, "192.168.1.2/24", "00:00:00:01:01:02", \
+ "192.168.1.254")
+NS_CHECK_EXEC([ls1p2], [ip addr add 2001::2/64 dev ls1p2], [0])
+NS_CHECK_EXEC([ls1p2], [ip route add default via 2001::a dev ls1p2], [0])
 
 ADD_NAMESPACES(ext1)
-ADD_INT(ext1, ext1, br0, 172.16.1.1/24, 1711::1/64)
+ADD_VETH(ext1, ext1, br0, "172.16.1.1/24", "00:ee:00:01:01:01")
+NS_CHECK_EXEC([ext1], [ip addr add 1711::1/64 dev ext1], [0])
+
 check ovn-nbctl --wait=hv sync
 wait_for_ports_up
 OVS_WAIT_UNTIL([test "$(ip netns exec ls1p1 ip a | grep 2001::1 | grep 
tentative)" = ""])
@@ -8365,25 +8376,17 @@ wait_igmp_flows_installed()
 }
 
 ADD_NAMESPACES(vm1)
-ADD_INT([vm1], [vm1], [br-int], [42.42.42.1/24])
-NS_CHECK_EXEC([vm1], [ip link set vm1 address 00:00:00:00:00:01], [0])
-NS_CHECK_EXEC([vm1], [ip route add default via 42.42.42.5], [0])
-check ovs-vsctl set Interface vm1 external_ids:iface-id=vm1
+ADD_VETH(vm1, vm1, br-int, "42.42.42.1/24", "00:00:00:00:00:01", \
+ "42.42.42.5")
 
 ADD_NAMESPACES(vm2)
-ADD_INT([vm2], [vm2], [br-int], [42.42.42.2/24])
-NS_CHECK_EXEC([vm2], [ip link set vm2 address 00:00:00:00:00:02], [0])
-NS_CHECK_EXEC([vm2], [ip link set lo up], [0])
-check ovs-vsctl set Interface vm2 external_ids:iface-id=vm2
+ADD_VETH(vm2, vm2, br-int, "42.42.42.2/24", "00:00:00:00:00:02")
 
 ADD_NAMESPACES(vm3)
 NETNS_DAEMONIZE([vm3], [tcpdump -n -i any -nnleX > vm3.pcap 2>/dev/null], 
[tcpdump3.pid])
 
-ADD_INT([vm3], [vm3], [br-int], [42.42.42.3/24])
-NS_CHECK_EXEC([vm3], [ip link set vm3 address 00:00:00:00:00:03], [0])
-NS_CHECK_EXEC([vm3], [ip link set lo up], [0])
-NS_CHECK_EXEC([vm3], [ip route add default via 42.42.42.5], [0])
-check ovs-vsctl set Interface vm3 external_ids:iface-id=vm3
+ADD_VETH(vm3, vm3, br-int, "42.42.42.3/24", "00:00:00:00:00:03", \
+ "42.42.42.5")
 
 NS_CHECK_EXEC([vm2], [sysctl -w net.ipv4.igmp_max_memberships=100], [ignore], 
[ignore])
 NS_CHECK_EXEC([vm3], [sysctl -w net.ipv4.igmp_max_memberships=100], [ignore], 
[ignore])
-- 
2.39.1


[ovs-dev] [PATCH ovn 7/7] ci: Replace clang jemalloc suite with system-test-userspace

2023-02-17 Thread Ales Musil
The test with jemalloc and clang is redundant as
we are already testing jemalloc with gcc. Replace
it with system-test-userspace which runs system tests
over userspace OvS datapath.

Signed-off-by: Ales Musil 
---
 .github/workflows/test.yml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 0f8d9d193..90dc8a6f1 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -47,9 +47,9 @@ jobs:
 - { compiler: gcc, testsuite: test, libs: -ljemalloc, test_range: 
"-500" }
 - { compiler: gcc, testsuite: test, libs: -ljemalloc, test_range: 
"501-1000" }
 - { compiler: gcc, testsuite: test, libs: -ljemalloc, test_range: 
"1001-" }
-- { compiler: clang, testsuite: test, libs: -ljemalloc, test_range: 
"-500" }
-- { compiler: clang, testsuite: test, libs: -ljemalloc, test_range: 
"501-1000" }
-- { compiler: clang, testsuite: test, libs: -ljemalloc, test_range: 
"1001-" }
+- { compiler: gcc, testsuite: system-test-userspace, test_range: 
"-100" }
+- { compiler: gcc, testsuite: system-test-userspace, test_range: 
"101-200" }
+- { compiler: gcc, testsuite: system-test-userspace, test_range: 
"201-" }
 - { compiler: gcc, testsuite: system-test, test_range: "-100" }
 - { compiler: gcc, testsuite: system-test, test_range: "101-200" }
 - { compiler: gcc, testsuite: system-test, test_range: "201-" }
-- 
2.39.1

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


[ovs-dev] [PATCH ovn 3/7] system-tests: Do not use verbose output for ping6

2023-02-17 Thread Ales Musil
Newer versions of ping6 print some info to
stderr when specified with -v flag. This info
causes tests to fail. Do not use the verbose
output.

Signed-off-by: Ales Musil 
---
 tests/system-ovn.at | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/system-ovn.at b/tests/system-ovn.at
index a99584971..cdcbb5be6 100644
--- a/tests/system-ovn.at
+++ b/tests/system-ovn.at
@@ -285,7 +285,7 @@ ovn-nbctl --wait=hv sync
 OVS_WAIT_UNTIL([ovs-ofctl dump-flows br-int | grep 'nat(src=fd30::1)'])
 
 # 'alice1' should be able to ping 'foo1' directly.
-NS_CHECK_EXEC([alice1], [ping6 -v -q -c 3 -i 0.3 -w 2 fd11::2 | FORMAT_PING], \
+NS_CHECK_EXEC([alice1], [ping6 -q -c 3 -i 0.3 -w 2 fd11::2 | FORMAT_PING], \
 [0], [dnl
 3 packets transmitted, 3 received, 0% packet loss, time 0ms
 ])
@@ -8314,7 +8314,7 @@ NS_CHECK_EXEC([ls1p1], [ping -q -c 3 -i 0.3 -w 2  
172.16.1.1 | FORMAT_PING], \
 3 packets transmitted, 3 received, 0% packet loss, time 0ms
 ])
 
-NS_CHECK_EXEC([ls1p1], [ping6 -v -q -c 3 -i 0.3 -w 2 1711::1  | FORMAT_PING], \
+NS_CHECK_EXEC([ls1p1], [ping6 -q -c 3 -i 0.3 -w 2 1711::1  | FORMAT_PING], \
 [0], [dnl
 3 packets transmitted, 3 received, 0% packet loss, time 0ms
 ])
-- 
2.39.1

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


[ovs-dev] [PATCH ovn 6/7] system-test: Skip LB affinity for now with OvS userspace

2023-02-17 Thread Ales Musil
There is a bug in userspace datapath that causes
failures within the LB affinity test [0].
Skip the test until the bug is fixed.

[0] https://bugzilla.redhat.com/2170828
Signed-off-by: Ales Musil 
---
 tests/system-kmod-macros.at  | 6 ++
 tests/system-ovn.at  | 2 ++
 tests/system-userspace-macros.at | 9 +
 3 files changed, 17 insertions(+)

diff --git a/tests/system-kmod-macros.at b/tests/system-kmod-macros.at
index 787a59c97..e72a2970b 100644
--- a/tests/system-kmod-macros.at
+++ b/tests/system-kmod-macros.at
@@ -183,3 +183,9 @@ m4_define([OVS_CHECK_KERNEL_EXCL],
 sublevel=$(uname -r | sed -e 's/\./ /g' | awk '{print $ 2}')
 AT_SKIP_IF([ ! ( test $version -lt $1 || ( test $version -eq $1 && test 
$sublevel -lt $2 ) || test $version -gt $3 || ( test $version -eq $3 && test 
$sublevel -gt $4 ) ) ])
 ])
+
+# CHECK_USERSPACE_DATAPATH()
+#
+# Perform requirements checks for running with OvS userspace datapath.
+# Some tests are failing for userspace datapath.
+m4_define([CHECK_USERSPACE_DATAPATH])
diff --git a/tests/system-ovn.at b/tests/system-ovn.at
index 29671690f..6e1671d47 100644
--- a/tests/system-ovn.at
+++ b/tests/system-ovn.at
@@ -8526,6 +8526,7 @@ AT_KEYWORDS([ovnlb])
 
 CHECK_CONNTRACK()
 CHECK_CONNTRACK_NAT()
+CHECK_USERSPACE_DATAPATH()
 ovn_start
 OVS_TRAFFIC_VSWITCHD_START()
 ADD_BR([br-int])
@@ -8822,6 +8823,7 @@ AT_KEYWORDS([ovnlb])
 
 CHECK_CONNTRACK()
 CHECK_CONNTRACK_NAT()
+CHECK_USERSPACE_DATAPATH()
 ovn_start
 OVS_TRAFFIC_VSWITCHD_START()
 ADD_BR([br-int])
diff --git a/tests/system-userspace-macros.at b/tests/system-userspace-macros.at
index 86ed22622..1dc682783 100644
--- a/tests/system-userspace-macros.at
+++ b/tests/system-userspace-macros.at
@@ -294,3 +294,12 @@ m4_define([OVS_CHECK_KERNEL_EXCL],
 [
 AT_SKIP_IF([:])
 ])
+
+# CHECK_USERSPACE_DATAPATH()
+#
+# Perform requirements checks for running with OvS userspace datapath.
+# Some tests are failing for userspace datapath.
+m4_define([CHECK_USERSPACE_DATAPATH],
+[
+AT_SKIP_IF([:])
+])
-- 
2.39.1

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


[ovs-dev] [PATCH ovn 2/7] ovs: Bump submodule to recent master

2023-02-17 Thread Ales Musil
Bump ovs submodule to cd1cf6a2 which is after
0a758703 ("conntrack: Properly unNAT inner header of related traffic.").
This patch is needed for "LB - ICMP related traffic" system test to work
with OvS userspace netdev.

Signed-off-by: Ales Musil 
---
 ovs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ovs b/ovs
index 8986d4d55..cd1cf6a24 16
--- a/ovs
+++ b/ovs
@@ -1 +1 @@
-Subproject commit 8986d4d5564401eeef3dea828b51fe8bae2cc8aa
+Subproject commit cd1cf6a24b708b6f133fa83913ab3e4f586a200c
-- 
2.39.1

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


[ovs-dev] [PATCH ovn 0/7] Enable system tests over userspace datapath in CI

2023-02-17 Thread Ales Musil
In order to allow there are ome fixes done to the
tests itself. The LB affinity needs a fix from OvS
side so it is marked as skip for the time being.

To save some on the CI the last patch replaces
unit tests with Clang and Jemalloc with the
userspace system tests, the Jemalloc still
run with GCC.

Ales Musil (7):
  ci: Add support for userspace system test
  ovs: Bump submodule to recent master
  system-tests: Do not use verbose output for ping6
  system-tests: Replace use of ADD_INT with ADD_VETH
  system-tests: Use revalidator/purge instead of dpctl/del-flows
  system-test: Skip LB affinity for now with OvS userspace
  ci: Replace clang jemalloc suite with system-test-userspace

 .ci/linux-build.sh   | 69 +---
 .github/workflows/test.yml   |  6 +--
 ovs  |  2 +-
 tests/system-common-macros.at| 20 +
 tests/system-kmod-macros.at  |  6 +++
 tests/system-ovn.at  | 43 +++-
 tests/system-userspace-macros.at |  9 +
 7 files changed, 90 insertions(+), 65 deletions(-)

-- 
2.39.1

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