Re: [ovs-dev] [PATCH v1] command-line.c: Support parsing ctl options via env variable

2019-10-24 Thread Ginwala, Aliasgar via dev
Thanks Ben for the review:

Yes you are right,  current patch is buggy as using same string twice with 
strtok_r() was always using first option instead of n options. Thanks for 
pointing out about svec.[ch]. I sent v2 
https://patchwork.ozlabs.org/patch/1183774/  to address the same. PTAL.


Ali

From: Ben Pfaff 
Sent: Thursday, October 24, 2019 6:14 PM
To: amgin...@gmail.com 
Cc: d...@openvswitch.org ; Ginwala, Aliasgar 

Subject: Re: [ovs-dev] [PATCH v1] command-line.c: Support parsing ctl options 
via env variable

On Tue, Oct 15, 2019 at 06:52:34PM -0700, amgin...@gmail.com wrote:
> From: Aliasgar Ginwala 
>
> Signed-off-by: Aliasgar Ginwala 

I'm pretty sure this code doesn't work properly because it tries to
parse the same string twice with strtok_r(), which is going to truncate
it after the first option.  Did you try it with more than one
space-separated option in the environment variable?

lib/svec.[ch] would make it easier to write this.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH v2] command-line.c: Support parsing ctl options via env variable

2019-10-24 Thread amginwal
From: Aliasgar Ginwala 

Signed-off-by: Aliasgar Ginwala 
---
 lib/command-line.c | 55 ++
 lib/command-line.h |  3 +++
 2 files changed, 58 insertions(+)

diff --git a/lib/command-line.c b/lib/command-line.c
index 9e000bd28..d13cca294 100644
--- a/lib/command-line.c
+++ b/lib/command-line.c
@@ -19,6 +19,7 @@
 #include 
 #include 
 #include 
+#include "svec.h"
 #include "openvswitch/dynamic-string.h"
 #include "ovs-thread.h"
 #include "util.h"
@@ -77,6 +78,60 @@ find_option_by_value(const struct option *options, int value)
 return NULL;
 }
 
+/* Parses options set using environment variable.  The caller specifies the
+ * supported options in environment variable.  On success, adds the parsed
+ * env variables in 'argv', the number of options in 'argc', and returns argv.
+ *  */
+char **
+ovs_cmdl_env_parse_all(int *argcp, char *argv_[],
+   char *env_options)
+{
+char *str1, *token, *saveptr1;
+char **argv = NULL;
+int i, j, total_args, argc;
+int env_argc = 0;
+
+argc = *argcp;
+if (!env_options) {
+/* Copy args for parsing as is from argv_ */
+argv = xcalloc(argc + 1, sizeof( *argv_) + 1 );
+for (i = 0; i < argc; i++) {
+argv[i] = xstrdup(argv_[i]);
+}
+return argv;
+}
+
+/* Count number of options passed via environment variable */
+struct svec env_vars;
+svec_init(&env_vars);
+for (j = 1, str1 = env_options; ; j++, str1 = NULL) {
+token = strtok_r(str1, " ", &saveptr1);
+if (token == NULL) {
+break;
+}
+svec_add(&env_vars, token);
+env_argc++;
+}
+total_args = argc + env_argc + 1;
+argv = xcalloc(total_args, sizeof( *argv_) + env_argc + 1);
+
+/* Construct argv with command line + environment options. */
+for (i = 0, j = 0; i < argc; i++, j++) {
+if (j == 1) {
+const char *env;
+size_t k;
+SVEC_FOR_EACH (k, env, &env_vars) {
+argv[j] = xstrdup(env);
+j++;
+}
+}
+argv[j] = xstrdup(argv_[i]);
+}
+svec_destroy(&env_vars);
+*argcp = j;
+return argv;
+}
+
 /* Parses the command-line options in 'argc' and 'argv'.  The caller specifies
  * the supported options in 'options'.  On success, stores the parsed options
  * in '*pop', the number of options in '*n_pop', and returns NULL.  On failure,
diff --git a/lib/command-line.h b/lib/command-line.h
index 9d62dc250..4b8f76da7 100644
--- a/lib/command-line.h
+++ b/lib/command-line.h
@@ -54,6 +54,9 @@ char *ovs_cmdl_parse_all(int argc, char *argv[], const struct 
option *,
  struct ovs_cmdl_parsed_option **, size_t *)
 OVS_WARN_UNUSED_RESULT;
 
+char **ovs_cmdl_env_parse_all(int *argcp, char *argv_[],
+  char *env_options);
+
 void ovs_cmdl_print_options(const struct option *options);
 void ovs_cmdl_print_commands(const struct ovs_cmdl_command *commands);
 
-- 
2.20.1 (Apple Git-117)

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


Re: [ovs-dev] [PATCH v2 ovn 1/2] Add RDNSS support to OVN

2019-10-24 Thread Numan Siddique
On Wed, Oct 23, 2019 at 8:49 PM Lorenzo Bianconi <
lorenzo.bianc...@redhat.com> wrote:

> Introduce the possibility to specify a RDNSS option to Router
> Advertisement packets. DNS IPv6 address can be specified using
> 'rdnss' tag in the ipv6_ra_configs column of logical router
> port table
>
> Acked-by: Mark Michelson 
> Signed-off-by: Lorenzo Bianconi 
> ---
>  controller/pinctrl.c | 51 
>  northd/ovn-northd.c  |  5 +
>  ovn-nb.xml   |  4 
>  tests/ovn.at | 27 ---
>  4 files changed, 79 insertions(+), 8 deletions(-)
>
> diff --git a/controller/pinctrl.c b/controller/pinctrl.c
> index d826da186..1125f2ef3 100644
> --- a/controller/pinctrl.c
> +++ b/controller/pinctrl.c
> @@ -2192,6 +2192,8 @@ struct ipv6_ra_config {
>  uint8_t mo_flags; /* Managed/Other flags for RAs */
>  uint8_t la_flags; /* On-link/autonomous flags for address prefixes */
>  struct lport_addresses prefixes;
> +struct in6_addr rdnss;
> +bool has_rdnss;
>  };
>
>  struct ipv6_ra_state {
> @@ -2202,6 +2204,16 @@ struct ipv6_ra_state {
>  bool delete_me;
>  };
>
> +#define ND_RDNSS_OPT_LEN8
> +#define ND_OPT_RDNSS25
> +struct nd_rdnss_opt {
> +uint8_t type; /* ND_OPT_RDNSS. */
> +uint8_t len;  /* >= 3. */
> +ovs_be16 reserved;/* Always 0. */
> +ovs_be32 lifetime;
> +const ovs_be128 dns[0];
> +};
> +
>

I think this structure definition can be moved to lib/ovn-l7.h.
Can you please change the lifetime type to ovs_16aligned_be32, the way it
is done here -
https://github.com/openvswitch/ovs/blob/master/lib/packets.h#L1032
And also a macro - BUILD_ASSERT_DECL like it is done for the struct
- ovs_nd_prefix_opt.
If this function is later required in OVS, we can easily move these to the
ovs repo.

Also can you please add the RFC number for RDNSS in the comments ? It would
be easier for some one to
look into the RFC if required.

As per the RFC, I can see that we can include multiple RDNSS addressed in
the RA message, where as this patch restricts to just 1 address.
Any particular reason for this ?

Thanks
Numan



>  static void
>  init_ipv6_ras(void)
>  {
> @@ -2289,6 +2301,12 @@ ipv6_ra_update_config(const struct
> sbrec_port_binding *pb)
>  VLOG_WARN("Invalid IP source %s", ip_addr);
>  goto fail;
>  }
> +const char *rdnss = smap_get(&pb->options, "ipv6_ra_rdnss");
> +if (rdnss && !ipv6_parse(rdnss, &config->rdnss)) {
> +VLOG_WARN("Invalid RDNSS source %s", rdnss);
> +goto fail;
> +}
> +config->has_rdnss = !!rdnss;
>
>  return config;
>
> @@ -2319,6 +2337,35 @@ put_load(uint64_t value, enum mf_field_id dst, int
> ofs, int n_bits,
>  bitwise_one(ofpact_set_field_mask(sf), sf->field->n_bytes, ofs,
> n_bits);
>  }
>
> +static void
> +packet_put_ra_rdnss_opt(struct dp_packet *b, uint8_t num,
> +ovs_be32 lifetime, const struct in6_addr *dns)
> +{
> +size_t prev_l4_size = dp_packet_l4_size(b);
> +struct ip6_hdr *nh = dp_packet_l3(b);
> +size_t len = 2 * num + 1;
> +size_t size = len * 8;
> +
> +nh->ip6_plen = htons(prev_l4_size + len * 8);
> +
> +struct nd_rdnss_opt *nd_rdnss = dp_packet_put_uninit(b, size);
> +nd_rdnss->type = ND_OPT_RDNSS;
> +nd_rdnss->len = len;
> +nd_rdnss->reserved = 0;
> +nd_rdnss->lifetime = lifetime;
> +
> +ovs_be128 *addr = (ovs_be128 *)(nd_rdnss + 1);
> +for (int i = 0; i < num; i++) {
> +memcpy(addr + i, dns, sizeof(ovs_be32[4]));
> +}
> +
> +struct ovs_ra_msg *ra = dp_packet_l4(b);
> +ra->icmph.icmp6_cksum = 0;
> +uint32_t icmp_csum = packet_csum_pseudoheader6(dp_packet_l3(b));
> +ra->icmph.icmp6_cksum = csum_finish(csum_continue(icmp_csum, ra,
> +  prev_l4_size +
> size));
> +}
> +
>  /* Called with in the pinctrl_handler thread context. */
>  static long long int
>  ipv6_ra_send(struct rconn *swconn, struct ipv6_ra_state *ra)
> @@ -2343,6 +2390,10 @@ ipv6_ra_send(struct rconn *swconn, struct
> ipv6_ra_state *ra)
>  ra->config->la_flags,
> htonl(IPV6_ND_RA_OPT_PREFIX_VALID_LIFETIME),
>  htonl(IPV6_ND_RA_OPT_PREFIX_PREFERRED_LIFETIME), addr);
>  }
> +if (ra->config->has_rdnss) {
> +packet_put_ra_rdnss_opt(&packet, 1, htonl(0x),
> +&ra->config->rdnss);
> +}
>
>  uint64_t ofpacts_stub[4096 / 8];
>  struct ofpbuf ofpacts = OFPBUF_STUB_INITIALIZER(ofpacts_stub);
> diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c
> index ea8ad7c2d..d1de36e08 100644
> --- a/northd/ovn-northd.c
> +++ b/northd/ovn-northd.c
> @@ -6485,6 +6485,11 @@ copy_ra_to_sb(struct ovn_port *op, const char
> *address_mode)
>  smap_add(&options, "ipv6_ra_prefixes", ds_cstr(&s));
>  ds_destroy(&s);
>
> +const char *rdnss = smap_get(&op->nbrp->ipv6_ra_configs, "rdnss");
> +if (rdnss

Re: [ovs-dev] [PATCH ovn v2] ovn-northd: Limit ARP/ND broadcast domain whenever possible.

2019-10-24 Thread Numan Siddique
On Wed, Oct 23, 2019 at 12:41 PM Dumitru Ceara  wrote:

> ARP request and ND NS packets for router owned IPs were being
> flooded in the complete L2 domain (using the MC_FLOOD multicast group).
> However this creates a scaling issue in scenarios where aggregation
> logical switches are connected to more logical routers (~350). The
> logical pipelines of all routers would have to be executed before the
> packet is finally replied to by a single router, the owner of the IP
> address.
>
> This commit limits the broadcast domain by bypassing the L2 Lookup stage
> for ARP requests that will be replied by a single router. The packets
> are still flooded in the L2 domain but not on any of the other patch
> ports towards other routers connected to the switch. This restricted
> flooding is done by using a new multicast group (MC_ARP_ND_FLOOD).
>
> IPs that are owned by the routers and for which this fix applies are:
> - IP addresses configured on the router ports.
> - VIPs.
> - NAT IPs.
>
> Reported-at: https://bugzilla.redhat.com/1756945
> Reported-by: Anil Venkata 
> Signed-off-by: Dumitru Ceara 
>
> ---
> v2: Move ARP broadcast domain limiting to table S_SWITCH_IN_L2_LKUP to
> address localnet ports too.
> ---
>  lib/mcast-group-index.h |   1 +
>  northd/ovn-northd.8.xml |  16 
>  northd/ovn-northd.c | 190
> +---
>  tests/ovn.at|   4 +-
>  4 files changed, 181 insertions(+), 30 deletions(-)
>
> diff --git a/lib/mcast-group-index.h b/lib/mcast-group-index.h
> index ba995ba..06bd8b3 100644
> --- a/lib/mcast-group-index.h
> +++ b/lib/mcast-group-index.h
> @@ -27,6 +27,7 @@ enum ovn_mcast_tunnel_keys {
>
>  OVN_MCAST_FLOOD_TUNNEL_KEY = OVN_MIN_MULTICAST,
>  OVN_MCAST_UNKNOWN_TUNNEL_KEY,
> +OVN_MCAST_ARP_ND_TUNNEL_KEY,
>  OVN_MCAST_MROUTER_FLOOD_TUNNEL_KEY,
>  OVN_MCAST_MROUTER_STATIC_TUNNEL_KEY,
>  OVN_MCAST_STATIC_TUNNEL_KEY,
> diff --git a/northd/ovn-northd.8.xml b/northd/ovn-northd.8.xml
> index d3e0e5e..6bba8c9 100644
> --- a/northd/ovn-northd.8.xml
> +++ b/northd/ovn-northd.8.xml
> @@ -1005,6 +1005,22 @@ output;
>
>
>
> +Priority-80 flows for each port connected to a logical router
> +matching self originated GARP/ARP request/ND packets. These
> packets
> +are flooded to the MC_FLOOD which contains all
> logical
> +ports.
> +  
> +
> +  
> +Priority-75 flows for each IP address/VIP/NAT address owned by a
> +router port connected to the switch. These flows match ARP
> requests
> +and ND packets for the specific IP addresses.  Matched packets are
> +forwarded in the L3 domain only to the router that owns the IP
> +address and flooded in the L2 domain on all ports except patch
> +ports connected to logical routers.
> +  
> +
> +  
>  A priority-70 flow that outputs all packets with an Ethernet
> broadcast
>  or multicast eth.dst to the MC_FLOOD
>  multicast group.
> diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c
> index ea8ad7c..649c0ac 100644
> --- a/northd/ovn-northd.c
> +++ b/northd/ovn-northd.c
> @@ -1193,6 +1193,34 @@ ovn_port_allocate_key(struct ovn_datapath *od)
>1, (1u << 15) - 1, &od->port_key_hint);
>  }
>
> +/* Returns true if the logical switch port 'enabled' column is empty or
> + * set to true.  Otherwise, returns false. */
> +static bool
> +lsp_is_enabled(const struct nbrec_logical_switch_port *lsp)
> +{
> +return !lsp->n_enabled || *lsp->enabled;
> +}
> +
> +/* Returns true only if the logical switch port 'up' column is set to
> true.
> + * Otherwise, if the column is not set or set to false, returns false. */
> +static bool
> +lsp_is_up(const struct nbrec_logical_switch_port *lsp)
> +{
> +return lsp->n_up && *lsp->up;
> +}
> +
> +static bool
> +lsp_is_external(const struct nbrec_logical_switch_port *nbsp)
> +{
> +return !strcmp(nbsp->type, "external");
> +}
> +
> +static bool
> +lrport_is_enabled(const struct nbrec_logical_router_port *lrport)
> +{
> +return !lrport->enabled || *lrport->enabled;
> +}
> +
>  static char *
>  chassis_redirect_name(const char *port_name)
>  {
> @@ -3018,6 +3046,10 @@ static const struct multicast_group mc_static =
>  static const struct multicast_group mc_unknown =
>  { MC_UNKNOWN, OVN_MCAST_UNKNOWN_TUNNEL_KEY };
>
> +#define MC_ARP_ND "_MC_arp_nd"
> +static const struct multicast_group mc_arp_nd =
> +{ MC_ARP_ND, OVN_MCAST_ARP_ND_TUNNEL_KEY };
> +
>  static bool
>  multicast_group_equal(const struct multicast_group *a,
>const struct multicast_group *b)
> @@ -3719,28 +3751,6 @@ build_port_security_ip(enum ovn_pipeline pipeline,
> struct ovn_port *op,
>
>  }
>
> -/* Returns true if the logical switch port 'enabled' column is empty or
> - * set to true.  Otherwise, returns false. */
> -static bool
> -lsp_is_enabled(const struct nbrec_logical_switch_port *lsp)
> -{
> 

Re: [ovs-dev] [PATCH ovn] tests/system-ovn: Ignore some ovn-controller warnings

2019-10-24 Thread Numan Siddique
On Fri, Oct 25, 2019, 7:59 AM Numan Siddique  wrote:

>
>
> On Fri, Oct 25, 2019, 6:56 AM Russell Bryant  wrote:
>
>> This log message was introduced in commit 5344f24ecb.  It may be more
>> appropriate as a deubg message, but as a warning, it breaks this test
>> suite.
>> Filtering it out of the logs gets these tests passing for me.
>>
>> A sample of the messages encountered in a test run are:
>>
>> 2019-10-25T01:06:53.026Z|00010|chassis|WARN|Could not find Chassis :
>> stored (hv1) ovs (hv1)
>> 2019-10-25T01:06:53.026Z|00011|chassis|WARN|Could not find Chassis :
>> stored (hv1) ovs (hv1)
>> 2019-10-25T01:06:53.026Z|00013|chassis|WARN|Could not find Chassis :
>> stored (hv1) ovs (hv1)
>> 2019-10-25T01:06:53.026Z|00014|chassis|WARN|Could not find Chassis :
>> stored (hv1) ovs (hv1)
>>
>
> Hi Russell,
>
> Could you please provide the signed off tag
>

Acked-by: Numan Siddique 

Forgot that  will take care of the tag while committing.


Thanks
Numan


> Thanks
>
> ---
>>  tests/system-ovn.at | 33 ++---
>>  1 file changed, 22 insertions(+), 11 deletions(-)
>>
>> diff --git a/tests/system-ovn.at b/tests/system-ovn.at
>> index f88ad31e4..d6ec19bab 100644
>> --- a/tests/system-ovn.at
>> +++ b/tests/system-ovn.at
>> @@ -173,7 +173,8 @@ OVS_APP_EXIT_AND_WAIT([ovn-northd])
>>
>>  as
>>  OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
>> -/connection dropped.*/d"])
>> +/connection dropped.*/d
>> +/Could not find Chassis.*/d"])
>>  AT_CLEANUP
>>
>>  AT_SETUP([ovn -- 2 LRs connected via LS, gateway router, easy SNAT])
>> @@ -283,7 +284,8 @@ OVS_APP_EXIT_AND_WAIT([ovn-northd])
>>
>>  as
>>  OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
>> -/connection dropped.*/d"])
>> +/connection dropped.*/d
>> +/Could not find Chassis.*/d"])
>>  AT_CLEANUP
>>
>>  AT_SETUP([ovn -- multiple gateway routers, SNAT and DNAT])
>> @@ -503,7 +505,8 @@ OVS_APP_EXIT_AND_WAIT([ovn-northd])
>>
>>  as
>>  OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
>> -/connection dropped.*/d"])
>> +/connection dropped.*/d
>> +/Could not find Chassis.*/d"])
>>  AT_CLEANUP
>>
>>  AT_SETUP([ovn -- load-balancing])
>> @@ -650,7 +653,8 @@ as northd
>>  OVS_APP_EXIT_AND_WAIT([ovn-northd])
>>
>>  as
>> -OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d"])
>> +OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
>> +/Could not find Chassis.*/d"])
>>  AT_CLEANUP
>>
>>  AT_SETUP([ovn -- load-balancing - same subnet.])
>> @@ -757,7 +761,8 @@ as northd
>>  OVS_APP_EXIT_AND_WAIT([ovn-northd])
>>
>>  as
>> -OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d"])
>> +OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
>> +/Could not find Chassis.*/d"])
>>  AT_CLEANUP
>>
>>  AT_SETUP([ovn -- load balancing in gateway router])
>> @@ -908,7 +913,8 @@ OVS_APP_EXIT_AND_WAIT([ovn-northd])
>>
>>  as
>>  OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
>> -/connection dropped.*/d"])
>> +/connection dropped.*/d
>> +/Could not find Chassis.*/d"])
>>  AT_CLEANUP
>>
>>  AT_SETUP([ovn -- multiple gateway routers, load-balancing])
>> @@ -1077,7 +1083,8 @@ OVS_APP_EXIT_AND_WAIT([ovn-northd])
>>
>>  as
>>  OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
>> -/connection dropped.*/d"])
>> +/connection dropped.*/d
>> +/Could not find Chassis.*/d"])
>>  AT_CLEANUP
>>
>>  AT_SETUP([ovn -- load balancing in router with gateway router port])
>> @@ -1218,7 +1225,8 @@ OVS_APP_EXIT_AND_WAIT([ovn-northd])
>>
>>  as
>>  OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
>> -/connection dropped.*/d"])
>> +/connection dropped.*/d
>> +/Could not find Chassis.*/d"])
>>  AT_CLEANUP
>>
>>  AT_SETUP([ovn -- DNAT and SNAT on distributed router - N/S])
>> @@ -1367,7 +1375,8 @@ OVS_APP_EXIT_AND_WAIT([ovn-northd])
>>
>>  as
>>  OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
>> -/connection dropped.*/d"])
>> +/connection dropped.*/d
>> +/Could not find Chassis.*/d"])
>>  AT_CLEANUP
>>
>>  AT_SETUP([ovn -- DNAT and SNAT on distributed router - E/W])
>> @@ -1544,7 +1553,8 @@ OVS_APP_EXIT_AND_WAIT([ovn-northd])
>>
>>  as
>>  OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
>> -/connection dropped.*/d"])
>> +/connection dropped.*/d
>> +/Could not find Chassis.*/d"])
>>  AT_CLEANUP
>>
>>  AT_SETUP([ovn -- 2 LSs IGMP])
>> @@ -1663,5 +1673,6 @@ OVS_APP_EXIT_AND_WAIT([ovn-northd])
>>
>>  as
>>  OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
>> -/connection dropped.*/d"])
>> +/connection dropped.*/d
>> +/Could not find Chassis.*/d"])
>>  AT_CLEANUP
>> --
>> 2.21.0
>>
>> ___
>> 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] [PATCH ovn] tests/system-ovn: Ignore some ovn-controller warnings

2019-10-24 Thread Numan Siddique
On Fri, Oct 25, 2019, 6:56 AM Russell Bryant  wrote:

> This log message was introduced in commit 5344f24ecb.  It may be more
> appropriate as a deubg message, but as a warning, it breaks this test
> suite.
> Filtering it out of the logs gets these tests passing for me.
>
> A sample of the messages encountered in a test run are:
>
> 2019-10-25T01:06:53.026Z|00010|chassis|WARN|Could not find Chassis :
> stored (hv1) ovs (hv1)
> 2019-10-25T01:06:53.026Z|00011|chassis|WARN|Could not find Chassis :
> stored (hv1) ovs (hv1)
> 2019-10-25T01:06:53.026Z|00013|chassis|WARN|Could not find Chassis :
> stored (hv1) ovs (hv1)
> 2019-10-25T01:06:53.026Z|00014|chassis|WARN|Could not find Chassis :
> stored (hv1) ovs (hv1)
>

Hi Russell,

Could you please provide the signed off tag.

Thanks

---
>  tests/system-ovn.at | 33 ++---
>  1 file changed, 22 insertions(+), 11 deletions(-)
>
> diff --git a/tests/system-ovn.at b/tests/system-ovn.at
> index f88ad31e4..d6ec19bab 100644
> --- a/tests/system-ovn.at
> +++ b/tests/system-ovn.at
> @@ -173,7 +173,8 @@ OVS_APP_EXIT_AND_WAIT([ovn-northd])
>
>  as
>  OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
> -/connection dropped.*/d"])
> +/connection dropped.*/d
> +/Could not find Chassis.*/d"])
>  AT_CLEANUP
>
>  AT_SETUP([ovn -- 2 LRs connected via LS, gateway router, easy SNAT])
> @@ -283,7 +284,8 @@ OVS_APP_EXIT_AND_WAIT([ovn-northd])
>
>  as
>  OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
> -/connection dropped.*/d"])
> +/connection dropped.*/d
> +/Could not find Chassis.*/d"])
>  AT_CLEANUP
>
>  AT_SETUP([ovn -- multiple gateway routers, SNAT and DNAT])
> @@ -503,7 +505,8 @@ OVS_APP_EXIT_AND_WAIT([ovn-northd])
>
>  as
>  OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
> -/connection dropped.*/d"])
> +/connection dropped.*/d
> +/Could not find Chassis.*/d"])
>  AT_CLEANUP
>
>  AT_SETUP([ovn -- load-balancing])
> @@ -650,7 +653,8 @@ as northd
>  OVS_APP_EXIT_AND_WAIT([ovn-northd])
>
>  as
> -OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d"])
> +OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
> +/Could not find Chassis.*/d"])
>  AT_CLEANUP
>
>  AT_SETUP([ovn -- load-balancing - same subnet.])
> @@ -757,7 +761,8 @@ as northd
>  OVS_APP_EXIT_AND_WAIT([ovn-northd])
>
>  as
> -OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d"])
> +OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
> +/Could not find Chassis.*/d"])
>  AT_CLEANUP
>
>  AT_SETUP([ovn -- load balancing in gateway router])
> @@ -908,7 +913,8 @@ OVS_APP_EXIT_AND_WAIT([ovn-northd])
>
>  as
>  OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
> -/connection dropped.*/d"])
> +/connection dropped.*/d
> +/Could not find Chassis.*/d"])
>  AT_CLEANUP
>
>  AT_SETUP([ovn -- multiple gateway routers, load-balancing])
> @@ -1077,7 +1083,8 @@ OVS_APP_EXIT_AND_WAIT([ovn-northd])
>
>  as
>  OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
> -/connection dropped.*/d"])
> +/connection dropped.*/d
> +/Could not find Chassis.*/d"])
>  AT_CLEANUP
>
>  AT_SETUP([ovn -- load balancing in router with gateway router port])
> @@ -1218,7 +1225,8 @@ OVS_APP_EXIT_AND_WAIT([ovn-northd])
>
>  as
>  OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
> -/connection dropped.*/d"])
> +/connection dropped.*/d
> +/Could not find Chassis.*/d"])
>  AT_CLEANUP
>
>  AT_SETUP([ovn -- DNAT and SNAT on distributed router - N/S])
> @@ -1367,7 +1375,8 @@ OVS_APP_EXIT_AND_WAIT([ovn-northd])
>
>  as
>  OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
> -/connection dropped.*/d"])
> +/connection dropped.*/d
> +/Could not find Chassis.*/d"])
>  AT_CLEANUP
>
>  AT_SETUP([ovn -- DNAT and SNAT on distributed router - E/W])
> @@ -1544,7 +1553,8 @@ OVS_APP_EXIT_AND_WAIT([ovn-northd])
>
>  as
>  OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
> -/connection dropped.*/d"])
> +/connection dropped.*/d
> +/Could not find Chassis.*/d"])
>  AT_CLEANUP
>
>  AT_SETUP([ovn -- 2 LSs IGMP])
> @@ -1663,5 +1673,6 @@ OVS_APP_EXIT_AND_WAIT([ovn-northd])
>
>  as
>  OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
> -/connection dropped.*/d"])
> +/connection dropped.*/d
> +/Could not find Chassis.*/d"])
>  AT_CLEANUP
> --
> 2.21.0
>
> ___
> 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] [PATCH ovn] tests/system-ovn: Ignore some ovn-controller warnings

2019-10-24 Thread 0-day Robot
Bleep bloop.  Greetings Russell Bryant, 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 Russell Bryant  needs to sign off.
Lines checked: 135, 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] tests/system-ovn: Ignore some ovn-controller warnings

2019-10-24 Thread Russell Bryant
This log message was introduced in commit 5344f24ecb.  It may be more
appropriate as a deubg message, but as a warning, it breaks this test suite.
Filtering it out of the logs gets these tests passing for me.

A sample of the messages encountered in a test run are:

2019-10-25T01:06:53.026Z|00010|chassis|WARN|Could not find Chassis : stored 
(hv1) ovs (hv1)
2019-10-25T01:06:53.026Z|00011|chassis|WARN|Could not find Chassis : stored 
(hv1) ovs (hv1)
2019-10-25T01:06:53.026Z|00013|chassis|WARN|Could not find Chassis : stored 
(hv1) ovs (hv1)
2019-10-25T01:06:53.026Z|00014|chassis|WARN|Could not find Chassis : stored 
(hv1) ovs (hv1)
---
 tests/system-ovn.at | 33 ++---
 1 file changed, 22 insertions(+), 11 deletions(-)

diff --git a/tests/system-ovn.at b/tests/system-ovn.at
index f88ad31e4..d6ec19bab 100644
--- a/tests/system-ovn.at
+++ b/tests/system-ovn.at
@@ -173,7 +173,8 @@ OVS_APP_EXIT_AND_WAIT([ovn-northd])
 
 as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
-/connection dropped.*/d"])
+/connection dropped.*/d
+/Could not find Chassis.*/d"])
 AT_CLEANUP
 
 AT_SETUP([ovn -- 2 LRs connected via LS, gateway router, easy SNAT])
@@ -283,7 +284,8 @@ OVS_APP_EXIT_AND_WAIT([ovn-northd])
 
 as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
-/connection dropped.*/d"])
+/connection dropped.*/d
+/Could not find Chassis.*/d"])
 AT_CLEANUP
 
 AT_SETUP([ovn -- multiple gateway routers, SNAT and DNAT])
@@ -503,7 +505,8 @@ OVS_APP_EXIT_AND_WAIT([ovn-northd])
 
 as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
-/connection dropped.*/d"])
+/connection dropped.*/d
+/Could not find Chassis.*/d"])
 AT_CLEANUP
 
 AT_SETUP([ovn -- load-balancing])
@@ -650,7 +653,8 @@ as northd
 OVS_APP_EXIT_AND_WAIT([ovn-northd])
 
 as
-OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d"])
+OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
+/Could not find Chassis.*/d"])
 AT_CLEANUP
 
 AT_SETUP([ovn -- load-balancing - same subnet.])
@@ -757,7 +761,8 @@ as northd
 OVS_APP_EXIT_AND_WAIT([ovn-northd])
 
 as
-OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d"])
+OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
+/Could not find Chassis.*/d"])
 AT_CLEANUP
 
 AT_SETUP([ovn -- load balancing in gateway router])
@@ -908,7 +913,8 @@ OVS_APP_EXIT_AND_WAIT([ovn-northd])
 
 as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
-/connection dropped.*/d"])
+/connection dropped.*/d
+/Could not find Chassis.*/d"])
 AT_CLEANUP
 
 AT_SETUP([ovn -- multiple gateway routers, load-balancing])
@@ -1077,7 +1083,8 @@ OVS_APP_EXIT_AND_WAIT([ovn-northd])
 
 as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
-/connection dropped.*/d"])
+/connection dropped.*/d
+/Could not find Chassis.*/d"])
 AT_CLEANUP
 
 AT_SETUP([ovn -- load balancing in router with gateway router port])
@@ -1218,7 +1225,8 @@ OVS_APP_EXIT_AND_WAIT([ovn-northd])
 
 as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
-/connection dropped.*/d"])
+/connection dropped.*/d
+/Could not find Chassis.*/d"])
 AT_CLEANUP
 
 AT_SETUP([ovn -- DNAT and SNAT on distributed router - N/S])
@@ -1367,7 +1375,8 @@ OVS_APP_EXIT_AND_WAIT([ovn-northd])
 
 as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
-/connection dropped.*/d"])
+/connection dropped.*/d
+/Could not find Chassis.*/d"])
 AT_CLEANUP
 
 AT_SETUP([ovn -- DNAT and SNAT on distributed router - E/W])
@@ -1544,7 +1553,8 @@ OVS_APP_EXIT_AND_WAIT([ovn-northd])
 
 as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
-/connection dropped.*/d"])
+/connection dropped.*/d
+/Could not find Chassis.*/d"])
 AT_CLEANUP
 
 AT_SETUP([ovn -- 2 LSs IGMP])
@@ -1663,5 +1673,6 @@ OVS_APP_EXIT_AND_WAIT([ovn-northd])
 
 as
 OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
-/connection dropped.*/d"])
+/connection dropped.*/d
+/Could not find Chassis.*/d"])
 AT_CLEANUP
-- 
2.21.0

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


Re: [ovs-dev] [PATCH v1] command-line.c: Support parsing ctl options via env variable

2019-10-24 Thread Ben Pfaff
On Tue, Oct 15, 2019 at 06:52:34PM -0700, amgin...@gmail.com wrote:
> From: Aliasgar Ginwala 
> 
> Signed-off-by: Aliasgar Ginwala 

I'm pretty sure this code doesn't work properly because it tries to
parse the same string twice with strtok_r(), which is going to truncate
it after the first option.  Did you try it with more than one
space-separated option in the environment variable?

lib/svec.[ch] would make it easier to write this.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH V2] Add offload packets statistics

2019-10-24 Thread Ben Pfaff
On Tue, Oct 15, 2019 at 02:56:23PM +0800, zhaozhanxu wrote:
> Add argument '-m' for command ovs-appctl bridge/dump-flows
> to display the offloaded packets statistics.

Thanks for the updated patch.

Are n_offload_packets a subset of n_packets, or in addition to them?  If
they are a subset, then n_offload_packets should always be less than or
equal to n_packets; if they are in addition, then there is no
relationship between the two.  Either way, this should be explained in
comments on struct dpif_flow_stats.

I guess that "subset" makes more sense--after all, offloaded packets are
still packets--but then we need to update a few places, like
rule_dpif_credit_stats__().  If we take the "additional" choice, then we
need to change other places: I think most places that n_packets is
referenced, we need to write n_packets + n_offload_packets instead.

Please also update the documentation for bridge/dump-flows in
ovs-vswitchd(8).

get_dpif_flow_stats(), in lib/dpif-netdev.c, should initialize '*stats'.
I don't think it initializes the new members, but it should.

dpif_netdev_flow_put() adds together dpif_flow_stats.  Currently I think
those dpif_flow_stats always have zero in n_offload_*, but it might be a
good idea to add them together anyway.

Actually dpif_netdev_flow_del() does the same thing.  Probably that
means it would be a good idea to factor out the code that adds these
things together into a new helper function since there's already
duplicate code and this adds more of it.

dpif_netlink_flow_get_stats() needs to initialize the new fields.

dpif_flow_stats_extract() needs to initialize the new fields.

I imagine that dpif_flow_stats_format() should display the new
fields--perhaps only if they are nonzero?

Should parse_tc_flower_to_match() set n_offload_* instead of packets and
bytes?  (Or both of them to the same values, if n_offload_* is a subset
of the regular values.)

Ditto for netdev_tc_flow_del().

upcall_xlate() should initialize n_offload_*.

Ditto for revalidate_ukey() and push_dp_ops().

Thanks,

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


[ovs-dev] Beneficios de la documentación de los procesos

2019-10-24 Thread Mapeo de Procesos
21 de Noviembre | Horario de 10:00 a 17:00 hrs.  |  (hora del centro de México) 

- Mapeo de Procesos - Webinar en Vivo


 Este taller está dirigido al personal de las áreas de calidad, procesos, 
proyectos de mejora y profesionales dedicados a la documentación de procesos
 en general y les permitirá conocer los pasos a seguir para el mapeo de los 
procesos de su organización ya sea para una documentación posterior de 
procedimientos o para la implementación de un sistema de gestión basado en el 
mapa de procesos.

Objetivos específicos:

- Conocerá los términos generales que se utilizan para la documentación de 
procesos.
- Aplicará una secuencia lógica para la documentación de los procesos e 
identificar los procedimientos que se pueden derivar.
- Aprovechará los beneficios de la documentación de los procesos para los 
diferentes negocios.

Solicita información respondiendo a este correo con la palabra MAPEO, junto con 
los siguientes datos:

Nombre:
Correo electrónico:
Número telefónico:

Números de Atención:  (045) 55 15 54 66 30 - (045) 55 85567293 - (045) 
5530167085 

En caso de que haya recibido este correo sin haberlo solicitado o si desea 
dejar de recibir nuestra promoción favor de responder con la palabra baja o 
enviar un correo a bajas@ innovalearn.net


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


Re: [ovs-dev] [PATCH] rhel: Support RHEL7.7 build and packaging

2019-10-24 Thread Ben Pfaff
On Fri, Oct 11, 2019 at 02:49:14PM -0700, Yifeng Sun wrote:
> This patch provides essential fixes for OVS to support
> RHEL7.7's new kernel.
> 
> make rpm-fedora-kmod \
> RPMBUILD_OPT='-D "kversion 3.10.0-1062.1.2.el7.x86_64"'
> 
> Signed-off-by: Yifeng Sun 

Thanks, applied to master.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v2] ovsdb-server: Allow replication from older schema version servers.

2019-10-24 Thread Ben Pfaff
On Mon, Oct 21, 2019 at 10:26:51PM +0530, num...@ovn.org wrote:
> From: Numan Siddique 
> 
> Presently, replication is not allowed if there is a schema version mismatch 
> between
> the schema returned by the active ovsdb-server and the local db schema. This 
> is
> causing failures in OVN DB HA deployments during uprades.
> 
> In the case of OpenStack tripleo deployment with OVN, OVN DB ovsdb-servers are
> deployed on a multi node controller cluster in active/standby mode. During
> minor updates or major upgrades, the cluster is updated one at a time. If
> a node A is running active OVN DB ovsdb-servers and when it is updated, 
> another
> node B becomes active. After the update when OVN DB ovsdb-servers in A are 
> started,
> these ovsdb-servers fail to replicate from the active if there is a schema
> version mismatch.
> 
> This patch addresses this issue by allowing replication even if there is a
> schema version mismatch only if all the active db schema tables and its 
> colums are
> present in the local db schema.
> 
> This should not result in any data loss.

I applied this to master.  I made a few superficial changes to log
messages and style.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] lacp: warn transmit failure of lacp pdu

2019-10-24 Thread Ben Pfaff
On Mon, Oct 21, 2019 at 07:34:36PM +0530, Gowrishankar Muthukrishnan wrote:
> It might be difficult to trace whether LACP PDU tx (as in
> response) was successful when the pdu was not transmitted by
> egress slave for various reasons (including resource contention
> within NIC) and only way to trace its fate is by looking at
> ofproto->stats.tx_[packets/bytes] and slave port stats.
> 
> Adding a warning when there is tx failure could help user
> debug at the root of this problem.
> 
> Signed-off-by: Gowrishankar Muthukrishnan 

This logic seems like it's probably true for all users of
ofproto_dpif_send_packet(), not just LACP PDU transmission.  Would it be
a good idea to simply make ofproto_dpif_send_packet() log a warning when
tx fails?
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] flow: Fix crash on vlan packets with partial offloading.

2019-10-24 Thread Ben Pfaff
On Thu, Oct 24, 2019 at 12:09:16PM +0200, Ilya Maximets wrote:
> parse_tcp_flags() does not care about vlan tags in a packet thus
> not able to parse them.  As a result, if partial offloading is
> enabled in userspace datapath vlan packets are not parsed, i.e.
> has no initialized offsets.  This causes OVS crash on any attempt
> to access/modify packet header fields.

Thanks!  Good catch!

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


Re: [ovs-dev] [PATCH] lldp: Fix for OVS crashes when a LLDP-enabled port is deleted

2019-10-24 Thread Ben Pfaff
On Mon, Oct 21, 2019 at 12:42:02PM +0530, Surya Rudra via dev wrote:
> Issue:
> When LLDP is enabled on a port, a structure to hold LLDP related state
> is created and that structure has a reference to the port. The ofproto
> monitor thread accesses the LLDP structure to periodically send packets
> over the associated port. When the port is deleted, the LLDP structure
> is not cleaned up and it continues to refer to the deleted port.
> 
> When the monitor thread attempts to access the deleted port OVS crashes.
> Crash can happen with bridge delete and bond delete also.
> 
> Fix:
> Remove all references to the LLDP structure and free it when
> the port is deleted.
> 
> Signed-off-by: Surya Rudra 

Thank you for the bug fix.  I applied this to master and I am in the
process of backporting it to older branches.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 1/1] ovsdb-server: fix memory leak in ovsdb_convert_table() function.

2019-10-24 Thread Ben Pfaff
On Thu, Oct 24, 2019 at 09:20:49AM +0200, Damijan Skvarc wrote:
> Memory leak happens while converting existing database into new database 
> according to
> the specified schema (ovsdb-client convert new-schema). Memory leak was 
> detected
> by valgrind while executing functional test "schema conversion online - 
> clustered"
> 
> ==16202== 96 bytes in 6 blocks are definitely lost in loss record 326 of 399
> ==16202==at 0x4C2DB8F: malloc (in 
> /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==16202==by 0x44A5D4: xmalloc (util.c:138)
> ==16202==by 0x4377A6: alloc_default_atoms (ovsdb-data.c:315)
> ==16202==by 0x437F18: ovsdb_datum_init_default (ovsdb-data.c:918)
> ==16202==by 0x413D82: ovsdb_row_create (row.c:59)
> ==16202==by 0x40AA53: ovsdb_convert_table (file.c:220)
> ==16202==by 0x40AA53: ovsdb_convert (file.c:275)
> ==16202==by 0x416BE1: ovsdb_trigger_try (trigger.c:255)
> ==16202==by 0x40D29E: ovsdb_jsonrpc_trigger_create (jsonrpc-server.c:1119)
> ==16202==by 0x40D29E: ovsdb_jsonrpc_session_got_request 
> (jsonrpc-server.c:986)
> ==16202==by 0x40D29E: ovsdb_jsonrpc_session_run (jsonrpc-server.c:556)
> ==16202==by 0x40D29E: ovsdb_jsonrpc_session_run_all (jsonrpc-server.c:586)
> ==16202==by 0x40D29E: ovsdb_jsonrpc_server_run (jsonrpc-server.c:401)
> ==16202==by 0x40682E: main_loop (ovsdb-server.c:209)
> ==16202==by 0x40682E: main (ovsdb-server.c:460)
> 
> The problem was in ovsdb_datum_convert() function, which overrides pointers 
> to datum memory allocated in
> ovsdb_row_create() function. Fix was done by freeing this memory before 
> ovsdb_datum_convert() is called.
> 
> Signed-off-by: Damijan Skvarc 

Thanks a lot for finding the memory leak.

I think that this adds a risk of bad memory access on the error path,
because ovsdb_datum_convert() leaves its destination datum indeterminate
on error.  I think that the following cures that:
diff --git a/ovsdb/file.c b/ovsdb/file.c
index 7ac7df0510f0..22f89a39791b 100644
--- a/ovsdb/file.c
+++ b/ovsdb/file.c
@@ -241,6 +241,7 @@ ovsdb_convert_table(struct ovsdb_txn *txn,
 &dst_row->fields[dst_column->index], &dst_column->type,
 &src_row->fields[src_column->index], &src_column->type);
 if (error) {
+ovsdb_datum_init_empty(&dst_row->fields[dst_column->index]);
 ovsdb_row_destroy(dst_row);
 return error;
 }

Would you please check my work on that and make sure it still does the
job and submit a v2?  Thanks very much.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH v10 3/3] ovs-bugtool: Script to collect the port statistics

2019-10-24 Thread Sriram Vatala via dev
Sometimes, analysing the drop statistics of the ports
will be helpful in debugging. This patch adds script
to collect all supported port stats which also includes
the drop counters in userspace datapath. The output of
this scirpt is included in the bugtool output.

Signed-off-by: Sriram Vatala 
---
 utilities/bugtool/automake.mk |  3 ++-
 utilities/bugtool/ovs-bugtool-get-port-stats  | 15 +++
 .../plugins/network-status/openvswitch.xml|  1 +
 3 files changed, 18 insertions(+), 1 deletion(-)
 create mode 100755 utilities/bugtool/ovs-bugtool-get-port-stats

diff --git a/utilities/bugtool/automake.mk b/utilities/bugtool/automake.mk
index 4c85b9cba..0a9b93088 100644
--- a/utilities/bugtool/automake.mk
+++ b/utilities/bugtool/automake.mk
@@ -21,7 +21,8 @@ bugtool_scripts = \
utilities/bugtool/ovs-bugtool-ovs-bridge-datapath-type \
utilities/bugtool/ovs-bugtool-ovs-vswitchd-threads-affinity \
utilities/bugtool/ovs-bugtool-qos-configs \
-   utilities/bugtool/ovs-bugtool-get-dpdk-nic-numa
+   utilities/bugtool/ovs-bugtool-get-dpdk-nic-numa \
+   utilities/bugtool/ovs-bugtool-get-port-stats
 
 scripts_SCRIPTS += $(bugtool_scripts)
 
diff --git a/utilities/bugtool/ovs-bugtool-get-port-stats 
b/utilities/bugtool/ovs-bugtool-get-port-stats
new file mode 100755
index 0..23e61034e
--- /dev/null
+++ b/utilities/bugtool/ovs-bugtool-get-port-stats
@@ -0,0 +1,15 @@
+#! /bin/bash
+
+#Iterate through each port of every bridge and print
+#the port statistics
+
+for bridge in `ovs-vsctl -- --real list-br`
+do
+echo "${bridge} : "
+echo "  ${bridge} : `ovs-vsctl get interface ${bridge} statistics`"
+for iface in `ovs-vsctl list-ifaces ${bridge}`
+do
+echo "  ${iface} : `ovs-vsctl get interface ${iface} statistics`"
+done
+echo -e "\n"
+done
diff --git a/utilities/bugtool/plugins/network-status/openvswitch.xml 
b/utilities/bugtool/plugins/network-status/openvswitch.xml
index b0e7a1510..72aa44930 100644
--- a/utilities/bugtool/plugins/network-status/openvswitch.xml
+++ b/utilities/bugtool/plugins/network-status/openvswitch.xml
@@ -41,4 +41,5 @@
 /usr/share/openvswitch/scripts/ovs-bugtool-ovs-ofctl-loop-over-bridges
 "dump-group-stats"
 /usr/share/openvswitch/scripts/ovs-bugtool-get-dpdk-nic-numa
 ip -s -s link 
show
+/usr/share/openvswitch/scripts/ovs-bugtool-get-port-stats
 
-- 
2.20.1

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


[ovs-dev] [PATCH v10 1/3] netdev-dpdk: Reuse vhost function for dpdk ETH custom stats.

2019-10-24 Thread Sriram Vatala via dev
From: Ilya Maximets 

This is yet another refactoring for upcoming detailed drop stats.
It allowes to use single function for all the software calculated
statistics in netdev-dpdk for both vhost and ETH ports.

UINT64_MAX used as a marker for non-supported statistics in a
same way as it's done in bridge.c for common netdev stats.

Co-authored-by: Sriram Vatala 
Cc: Sriram Vatala 
Signed-off-by: Ilya Maximets 
Signed-off-by: Sriram Vatala 
---
 lib/netdev-dpdk.c | 69 +++
 1 file changed, 40 insertions(+), 29 deletions(-)

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 04e1a2d1b..2cc2516a9 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -474,6 +474,8 @@ struct netdev_rxq_dpdk {
 static void netdev_dpdk_destruct(struct netdev *netdev);
 static void netdev_dpdk_vhost_destruct(struct netdev *netdev);
 
+static int netdev_dpdk_get_sw_custom_stats(const struct netdev *,
+   struct netdev_custom_stats *);
 static void netdev_dpdk_clear_xstats(struct netdev_dpdk *dev);
 
 int netdev_dpdk_get_vid(const struct netdev_dpdk *dev);
@@ -1174,7 +1176,7 @@ common_construct(struct netdev *netdev, dpdk_port_t 
port_no,
 dev->rte_xstats_ids = NULL;
 dev->rte_xstats_ids_size = 0;
 
-dev->tx_retries = 0;
+dev->tx_retries = (dev->type == DPDK_DEV_VHOST) ? 0 : UINT64_MAX;
 
 return 0;
 }
@@ -2775,7 +2777,9 @@ netdev_dpdk_get_custom_stats(const struct netdev *netdev,
 
 uint32_t i;
 struct netdev_dpdk *dev = netdev_dpdk_cast(netdev);
-int rte_xstats_ret;
+int rte_xstats_ret, sw_stats_size;
+
+netdev_dpdk_get_sw_custom_stats(netdev, custom_stats);
 
 ovs_mutex_lock(&dev->mutex);
 
@@ -2790,23 +2794,22 @@ netdev_dpdk_get_custom_stats(const struct netdev 
*netdev,
 if (rte_xstats_ret > 0 &&
 rte_xstats_ret <= dev->rte_xstats_ids_size) {
 
-custom_stats->size = rte_xstats_ret;
-custom_stats->counters =
-(struct netdev_custom_counter *) xcalloc(rte_xstats_ret,
-sizeof(struct netdev_custom_counter));
+sw_stats_size = custom_stats->size;
+custom_stats->size += rte_xstats_ret;
+custom_stats->counters = xrealloc(custom_stats->counters,
+  custom_stats->size *
+  sizeof *custom_stats->counters);
 
 for (i = 0; i < rte_xstats_ret; i++) {
-ovs_strlcpy(custom_stats->counters[i].name,
+ovs_strlcpy(custom_stats->counters[sw_stats_size + i].name,
 netdev_dpdk_get_xstat_name(dev,
dev->rte_xstats_ids[i]),
 NETDEV_CUSTOM_STATS_NAME_SIZE);
-custom_stats->counters[i].value = values[i];
+custom_stats->counters[sw_stats_size + i].value = values[i];
 }
 } else {
 VLOG_WARN("Cannot get XSTATS values for port: "DPDK_PORT_ID_FMT,
   dev->port_id);
-custom_stats->counters = NULL;
-custom_stats->size = 0;
 /* Let's clear statistics cache, so it will be
  * reconfigured */
 netdev_dpdk_clear_xstats(dev);
@@ -2821,39 +2824,47 @@ netdev_dpdk_get_custom_stats(const struct netdev 
*netdev,
 }
 
 static int
-netdev_dpdk_vhost_get_custom_stats(const struct netdev *netdev,
-   struct netdev_custom_stats *custom_stats)
+netdev_dpdk_get_sw_custom_stats(const struct netdev *netdev,
+struct netdev_custom_stats *custom_stats)
 {
 struct netdev_dpdk *dev = netdev_dpdk_cast(netdev);
-int i;
+int i, n;
 
-#define VHOST_CSTATS \
-VHOST_CSTAT(tx_retries)
+#define SW_CSTATS \
+SW_CSTAT(tx_retries)
 
-#define VHOST_CSTAT(NAME) + 1
-custom_stats->size = VHOST_CSTATS;
-#undef VHOST_CSTAT
+#define SW_CSTAT(NAME) + 1
+custom_stats->size = SW_CSTATS;
+#undef SW_CSTAT
 custom_stats->counters = xcalloc(custom_stats->size,
  sizeof *custom_stats->counters);
-i = 0;
-#define VHOST_CSTAT(NAME) \
-ovs_strlcpy(custom_stats->counters[i++].name, #NAME, \
-NETDEV_CUSTOM_STATS_NAME_SIZE);
-VHOST_CSTATS;
-#undef VHOST_CSTAT
 
 ovs_mutex_lock(&dev->mutex);
 
 rte_spinlock_lock(&dev->stats_lock);
 i = 0;
-#define VHOST_CSTAT(NAME) \
+#define SW_CSTAT(NAME) \
 custom_stats->counters[i++].value = dev->NAME;
-VHOST_CSTATS;
-#undef VHOST_CSTAT
+SW_CSTATS;
+#undef SW_CSTAT
 rte_spinlock_unlock(&dev->stats_lock);
 
 ovs_mutex_unlock(&dev->mutex);
 
+i = 0;
+n = 0;
+#define SW_CSTAT(NAME) \
+if (custom_stats->counters[i].value != UINT64_MAX) {   \
+ovs_strlcpy(custom_stats->counters[n].name, #NAME, \
+

[ovs-dev] [PATCH v10 2/3] netdev-dpdk : Detailed packet drop statistics

2019-10-24 Thread Sriram Vatala via dev
OVS may be unable to transmit packets for multiple reasons on
the userspace datapath and today there is a single counter to
track packets dropped due to any of those reasons. This patch
adds custom software stats for the different reasons packets
may be dropped during tx/rx on the userspace datapath in OVS.

- MTU drops : drops that occur due to a too large packet size
- Qos drops : drops that occur due to egress/ingress QOS
- Tx failures: drops as returned by the DPDK PMD send function

Note that the reason for tx failures is not specificied in OVS.
In practice for vhost ports it is most common that tx failures
are because there are not enough available descriptors,
which is usually caused by misconfiguration of the guest queues
and/or because the guest is not consuming packets fast enough
from the queues.

These counters are displayed along with other stats in
"ovs-vsctl get interface  statistics" command and are
available for dpdk and vhostuser/vhostuserclient ports.

Also the existing "tx_retries" counter for vhost ports has been
renamed to "ovs_tx_retries", so that all the custom statistics
that OVS accumulates itself will have the prefix "ovs_". This
will prevent any custom stats names overlapping with
driver/HW stats.

Signed-off-by: Sriram Vatala 
---
 Documentation/topics/dpdk/bridge.rst |  6 ++
 Documentation/topics/dpdk/vhost-user.rst |  2 +-
 lib/netdev-dpdk.c| 82 +++-
 3 files changed, 72 insertions(+), 18 deletions(-)

diff --git a/Documentation/topics/dpdk/bridge.rst 
b/Documentation/topics/dpdk/bridge.rst
index d9bc7eba4..f0ef42ecc 100644
--- a/Documentation/topics/dpdk/bridge.rst
+++ b/Documentation/topics/dpdk/bridge.rst
@@ -75,6 +75,12 @@ OpenFlow14`` option::
 
 $ ovs-ofctl -O OpenFlow14 dump-ports br0
 
+There are custom statistics that OVS accumulates itself and these stats has
+``ovs_`` as prefix. These custom stats are shown along with other stats
+using the following command::
+
+$ ovs-vsctl get Interface  statistics
+
 EMC Insertion Probability
 -
 
diff --git a/Documentation/topics/dpdk/vhost-user.rst 
b/Documentation/topics/dpdk/vhost-user.rst
index cda5b122f..ec0caeb16 100644
--- a/Documentation/topics/dpdk/vhost-user.rst
+++ b/Documentation/topics/dpdk/vhost-user.rst
@@ -551,7 +551,7 @@ processing packets at the required rate.
 The amount of Tx retries on a vhost-user or vhost-user-client interface can be
 shown with::
 
-  $ ovs-vsctl get Interface dpdkvhostclient0 statistics:tx_retries
+  $ ovs-vsctl get Interface dpdkvhostclient0 statistics:ovs_tx_retries
 
 vhost-user Dequeue Zero Copy (experimental)
 ---
diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 2cc2516a9..6922e61ca 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -174,6 +174,20 @@ static const struct vhost_device_ops virtio_net_device_ops 
=
 .destroy_connection = destroy_connection,
 };
 
+/* Custom software stats for dpdk ports */
+struct netdev_dpdk_sw_stats {
+/* No. of retries when unable to transmit. */
+uint64_t tx_retries;
+/* Packet drops when unable to transmit; Probably Tx queue is full. */
+uint64_t tx_failure_drops;
+/* Packet length greater than device MTU. */
+uint64_t tx_mtu_exceeded_drops;
+/* Packet drops in egress policer processing. */
+uint64_t tx_qos_drops;
+/* Packet drops in ingress policer processing. */
+uint64_t rx_qos_drops;
+};
+
 enum { DPDK_RING_SIZE = 256 };
 BUILD_ASSERT_DECL(IS_POW2(DPDK_RING_SIZE));
 enum { DRAIN_TSC = 20ULL };
@@ -416,11 +430,10 @@ struct netdev_dpdk {
 
 PADDED_MEMBERS(CACHE_LINE_SIZE,
 struct netdev_stats stats;
-/* Custom stat for retries when unable to transmit. */
-uint64_t tx_retries;
+struct netdev_dpdk_sw_stats *sw_stats;
 /* Protects stats */
 rte_spinlock_t stats_lock;
-/* 4 pad bytes here. */
+/* 36 pad bytes here. */
 );
 
 PADDED_MEMBERS(CACHE_LINE_SIZE,
@@ -1176,7 +1189,8 @@ common_construct(struct netdev *netdev, dpdk_port_t 
port_no,
 dev->rte_xstats_ids = NULL;
 dev->rte_xstats_ids_size = 0;
 
-dev->tx_retries = (dev->type == DPDK_DEV_VHOST) ? 0 : UINT64_MAX;
+dev->sw_stats = xzalloc(sizeof *dev->sw_stats);
+dev->sw_stats->tx_retries = (dev->type == DPDK_DEV_VHOST) ? 0 : UINT64_MAX;
 
 return 0;
 }
@@ -1362,6 +1376,7 @@ common_destruct(struct netdev_dpdk *dev)
 ovs_list_remove(&dev->list_node);
 free(ovsrcu_get_protected(struct ingress_policer *,
   &dev->ingress_policer));
+free(dev->sw_stats);
 ovs_mutex_destroy(&dev->mutex);
 }
 
@@ -2212,6 +2227,7 @@ netdev_dpdk_vhost_rxq_recv(struct netdev_rxq *rxq,
 rte_spinlock_lock(&dev->stats_lock);
 netdev_dpdk_vhost_update_rx_counters(&dev->stats, batch->packets,
  nb_rx, dropped);
+dev->sw_stats->rx_qos_drops += dropped;
 

[ovs-dev] [PATCH v10 1/3] netdev-dpdk: Reuse vhost function for dpdk ETH custom stats.

2019-10-24 Thread Sriram Vatala
From: Ilya Maximets 

This is yet another refactoring for upcoming detailed drop stats.
It allowes to use single function for all the software calculated
statistics in netdev-dpdk for both vhost and ETH ports.

UINT64_MAX used as a marker for non-supported statistics in a
same way as it's done in bridge.c for common netdev stats.

Cc: Sriram Vatala 
Signed-off-by: Ilya Maximets 
---
 lib/netdev-dpdk.c | 69 +++
 1 file changed, 40 insertions(+), 29 deletions(-)

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 04e1a2d1b..2cc2516a9 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -474,6 +474,8 @@ struct netdev_rxq_dpdk {
 static void netdev_dpdk_destruct(struct netdev *netdev);
 static void netdev_dpdk_vhost_destruct(struct netdev *netdev);
 
+static int netdev_dpdk_get_sw_custom_stats(const struct netdev *,
+   struct netdev_custom_stats *);
 static void netdev_dpdk_clear_xstats(struct netdev_dpdk *dev);
 
 int netdev_dpdk_get_vid(const struct netdev_dpdk *dev);
@@ -1174,7 +1176,7 @@ common_construct(struct netdev *netdev, dpdk_port_t 
port_no,
 dev->rte_xstats_ids = NULL;
 dev->rte_xstats_ids_size = 0;
 
-dev->tx_retries = 0;
+dev->tx_retries = (dev->type == DPDK_DEV_VHOST) ? 0 : UINT64_MAX;
 
 return 0;
 }
@@ -2775,7 +2777,9 @@ netdev_dpdk_get_custom_stats(const struct netdev *netdev,
 
 uint32_t i;
 struct netdev_dpdk *dev = netdev_dpdk_cast(netdev);
-int rte_xstats_ret;
+int rte_xstats_ret, sw_stats_size;
+
+netdev_dpdk_get_sw_custom_stats(netdev, custom_stats);
 
 ovs_mutex_lock(&dev->mutex);
 
@@ -2790,23 +2794,22 @@ netdev_dpdk_get_custom_stats(const struct netdev 
*netdev,
 if (rte_xstats_ret > 0 &&
 rte_xstats_ret <= dev->rte_xstats_ids_size) {
 
-custom_stats->size = rte_xstats_ret;
-custom_stats->counters =
-(struct netdev_custom_counter *) xcalloc(rte_xstats_ret,
-sizeof(struct netdev_custom_counter));
+sw_stats_size = custom_stats->size;
+custom_stats->size += rte_xstats_ret;
+custom_stats->counters = xrealloc(custom_stats->counters,
+  custom_stats->size *
+  sizeof *custom_stats->counters);
 
 for (i = 0; i < rte_xstats_ret; i++) {
-ovs_strlcpy(custom_stats->counters[i].name,
+ovs_strlcpy(custom_stats->counters[sw_stats_size + i].name,
 netdev_dpdk_get_xstat_name(dev,
dev->rte_xstats_ids[i]),
 NETDEV_CUSTOM_STATS_NAME_SIZE);
-custom_stats->counters[i].value = values[i];
+custom_stats->counters[sw_stats_size + i].value = values[i];
 }
 } else {
 VLOG_WARN("Cannot get XSTATS values for port: "DPDK_PORT_ID_FMT,
   dev->port_id);
-custom_stats->counters = NULL;
-custom_stats->size = 0;
 /* Let's clear statistics cache, so it will be
  * reconfigured */
 netdev_dpdk_clear_xstats(dev);
@@ -2821,39 +2824,47 @@ netdev_dpdk_get_custom_stats(const struct netdev 
*netdev,
 }
 
 static int
-netdev_dpdk_vhost_get_custom_stats(const struct netdev *netdev,
-   struct netdev_custom_stats *custom_stats)
+netdev_dpdk_get_sw_custom_stats(const struct netdev *netdev,
+struct netdev_custom_stats *custom_stats)
 {
 struct netdev_dpdk *dev = netdev_dpdk_cast(netdev);
-int i;
+int i, n;
 
-#define VHOST_CSTATS \
-VHOST_CSTAT(tx_retries)
+#define SW_CSTATS \
+SW_CSTAT(tx_retries)
 
-#define VHOST_CSTAT(NAME) + 1
-custom_stats->size = VHOST_CSTATS;
-#undef VHOST_CSTAT
+#define SW_CSTAT(NAME) + 1
+custom_stats->size = SW_CSTATS;
+#undef SW_CSTAT
 custom_stats->counters = xcalloc(custom_stats->size,
  sizeof *custom_stats->counters);
-i = 0;
-#define VHOST_CSTAT(NAME) \
-ovs_strlcpy(custom_stats->counters[i++].name, #NAME, \
-NETDEV_CUSTOM_STATS_NAME_SIZE);
-VHOST_CSTATS;
-#undef VHOST_CSTAT
 
 ovs_mutex_lock(&dev->mutex);
 
 rte_spinlock_lock(&dev->stats_lock);
 i = 0;
-#define VHOST_CSTAT(NAME) \
+#define SW_CSTAT(NAME) \
 custom_stats->counters[i++].value = dev->NAME;
-VHOST_CSTATS;
-#undef VHOST_CSTAT
+SW_CSTATS;
+#undef SW_CSTAT
 rte_spinlock_unlock(&dev->stats_lock);
 
 ovs_mutex_unlock(&dev->mutex);
 
+i = 0;
+n = 0;
+#define SW_CSTAT(NAME) \
+if (custom_stats->counters[i].value != UINT64_MAX) {   \
+ovs_strlcpy(custom_stats->counters[n].name, #NAME, \
+NETDEV_CUSTOM_STATS_NAME_SIZE);  

[ovs-dev] Darlehen Angebot

2019-10-24 Thread care1xd
Ein guter und legitimer Kreditgeber Ich gebe Darlehen an diejenigen, die 
Darlehen benötigen. Ich gebe Geschäftskredite, medizinische Kredite, 
Bildungskredite, Privat- oder Investitionskredite, Hausmietkredite usw. zu 2% 
Zinssatz aus

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


Re: [ovs-dev] [PATCH ovn 19/19] tutorial: Add tutorial for OVN Interconnection.

2019-10-24 Thread Han Zhou
On Sun, Oct 20, 2019 at 5:52 PM Han Zhou  wrote:

> diff --git a/Documentation/tutorials/ovn-interconnection.rst
b/Documentation/tutorials/ovn-interconnection.rst
...
> +
> +For each OVN deployment, start the ``ovn-ic`` daemon on central nodes ::
> +
> +$ ovn-ctl --ovninb-db= --ovnisb-db= \
> +  --ovnnb-db= --ovnsb-db= [more options] start_ic
> +

Sorry that here the options names are wrong. It should be:
$ ovn-ctl --ovn-ic-inb-db= --ovn-ic-isb-db= \
  --ovn-northd-nb-db= --ovn-northd-sb-db= [more
options] start_ic

I will correct it in v2, but I want to wait for more feedbacks on other
patches in the series.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] tests: Fix indentation in userspace packet type aware test.

2019-10-24 Thread Ben Pfaff
On Thu, Oct 24, 2019 at 02:41:48PM +0200, Ilya Maximets wrote:
> CC: Ben Pfaff 
> Fixes: 7be29a47576d ("ofproto-dpif: Remove tabs from output.")
> Signed-off-by: Ilya Maximets 

If you've run the test and this makes it pass:
Acked-by: Ben Pfaff 

Also, thank you!
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] dpif-netdev: Do not mix recirculation depth into RSS hash itself.

2019-10-24 Thread Jan Scheurich via dev
Even simpler solution to the problem.
Acked-by: Jan Scheurich 

BR, Jan

> -Original Message-
> From: Ilya Maximets 
> Sent: Thursday, 24 October, 2019 14:32
> To: ovs-dev@openvswitch.org
> Cc: Ian Stokes ; Kevin Traynor ;
> Jan Scheurich ; ychen103...@163.com; Ilya
> Maximets 
> Subject: [PATCH] dpif-netdev: Do not mix recirculation depth into RSS hash
> itself.
> 
> Mixing of RSS hash with recirculation depth is useful for flow lookup because
> same packet after recirculation should match with different datapath rule.
> Setting of the mixed value back to the packet is completely unnecessary
> because recirculation depth is different on each recirculation, i.e. we will 
> have
> different packet hash for flow lookup anyway.
> 
> This should fix the issue that packets from the same flow could be directed to
> different buckets based on a dp_hash or different ports of a balanced bonding
> in case they were recirculated different number of times (e.g. due to 
> conntrack
> rules).
> With this change, the original RSS hash will remain the same making it 
> possible
> to calculate equal dp_hash values for such packets.
> 
> Reported-at: https://protect2.fireeye.com/v1/url?k=0a51a6c3-56db840c-
> 0a51e658-0cc47ad93ea4-b7f1e9be8f7bbef8&q=1&e=c9f55798-de3c-45f4-afeb-
> 9a87d3d594ca&u=https%3A%2F%2Fmail.openvswitch.org%2Fpipermail%2Fovs-
> dev%2F2019-September%2F363127.html
> Fixes: 048963aa8507 ("dpif-netdev: Reset RSS hash when recirculating.")
> Signed-off-by: Ilya Maximets 
> ---
>  lib/dpif-netdev.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 4546b55e8..c09b8fd95
> 100644
> --- a/lib/dpif-netdev.c
> +++ b/lib/dpif-netdev.c
> @@ -6288,7 +6288,6 @@ dpif_netdev_packet_get_rss_hash(struct dp_packet
> *packet,
>  recirc_depth = *recirc_depth_get_unsafe();
>  if (OVS_UNLIKELY(recirc_depth)) {
>  hash = hash_finish(hash, recirc_depth);
> -dp_packet_set_rss_hash(packet, hash);
>  }
>  return hash;
>  }
> --
> 2.17.1

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


[ovs-dev] [PATCH] tests: Fix indentation in userspace packet type aware test.

2019-10-24 Thread Ilya Maximets
CC: Ben Pfaff 
Fixes: 7be29a47576d ("ofproto-dpif: Remove tabs from output.")
Signed-off-by: Ilya Maximets 
---
 tests/system-userspace-packet-type-aware.at | 64 ++---
 1 file changed, 32 insertions(+), 32 deletions(-)

diff --git a/tests/system-userspace-packet-type-aware.at 
b/tests/system-userspace-packet-type-aware.at
index 24a7698ab..c2246316d 100644
--- a/tests/system-userspace-packet-type-aware.at
+++ b/tests/system-userspace-packet-type-aware.at
@@ -252,39 +252,39 @@ AT_CHECK([
 
 ### Verify datapath configuration
 AT_CHECK([
-ovs-appctl dpif/show | grep -v hit | sed 's/\t//g'
+ovs-appctl dpif/show | grep -v hit
 ], [0], [dnl
-br-in1:
-br-in1 65534/2: (tap)
-gre12 1020/14: (gre: remote_ip=10.0.0.2)
-gre12_l3 1021/14: (gre: packet_type=legacy_l3, remote_ip=10.0.0.2)
-gre13 1030/14: (gre: remote_ip=10.0.0.3)
-ovs-n1 10/15: (system)
-br-in2:
-br-in2 65534/3: (tap)
-gre21 2010/14: (gre: packet_type=ptap, remote_ip=20.0.0.1)
-gre23 2030/14: (gre: packet_type=ptap, remote_ip=20.0.0.3)
-ovs-n2 20/16: (system)
-br-in3:
-br-in3 65534/4: (tap)
-gre31 3010/14: (gre: remote_ip=30.0.0.1)
-gre32 3020/14: (gre: remote_ip=30.0.0.2)
-gre32_l3 3021/14: (gre: packet_type=legacy_l3, remote_ip=30.0.0.2)
-ovs-n3 30/17: (system)
-br-p1:
-br-p1 65534/5: (tap)
-p1-0 2/8: (system)
-br-p2:
-br-p2 65534/6: (tap)
-p2-0 2/9: (system)
-br-p3:
-br-p3 65534/7: (tap)
-p3-0 2/10: (system)
-br0:
-br0 65534/1: (tap)
-p0-1 10/11: (system)
-p0-2 20/12: (system)
-p0-3 30/13: (system)
+  br-in1:
+br-in1 65534/2: (tap)
+gre12 1020/14: (gre: remote_ip=10.0.0.2)
+gre12_l3 1021/14: (gre: packet_type=legacy_l3, remote_ip=10.0.0.2)
+gre13 1030/14: (gre: remote_ip=10.0.0.3)
+ovs-n1 10/15: (system)
+  br-in2:
+br-in2 65534/3: (tap)
+gre21 2010/14: (gre: packet_type=ptap, remote_ip=20.0.0.1)
+gre23 2030/14: (gre: packet_type=ptap, remote_ip=20.0.0.3)
+ovs-n2 20/16: (system)
+  br-in3:
+br-in3 65534/4: (tap)
+gre31 3010/14: (gre: remote_ip=30.0.0.1)
+gre32 3020/14: (gre: remote_ip=30.0.0.2)
+gre32_l3 3021/14: (gre: packet_type=legacy_l3, remote_ip=30.0.0.2)
+ovs-n3 30/17: (system)
+  br-p1:
+br-p1 65534/5: (tap)
+p1-0 2/8: (system)
+  br-p2:
+br-p2 65534/6: (tap)
+p2-0 2/9: (system)
+  br-p3:
+br-p3 65534/7: (tap)
+p3-0 2/10: (system)
+  br0:
+br0 65534/1: (tap)
+p0-1 10/11: (system)
+p0-2 20/12: (system)
+p0-3 30/13: (system)
 ])
 
 ### Test L3 forwarding flows
-- 
2.21.0

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


[ovs-dev] [PATCH] dpif-netdev: Do not mix recirculation depth into RSS hash itself.

2019-10-24 Thread Ilya Maximets
Mixing of RSS hash with recirculation depth is useful for flow lookup
because same packet after recirculation should match with different
datapath rule.  Setting of the mixed value back to the packet is
completely unnecessary because recirculation depth is different on
each recirculation, i.e. we will have different packet hash for
flow lookup anyway.

This should fix the issue that packets from the same flow could be
directed to different buckets based on a dp_hash or different ports of
a balanced bonding in case they were recirculated different number of
times (e.g. due to conntrack rules).
With this change, the original RSS hash will remain the same making
it possible to calculate equal dp_hash values for such packets.

Reported-at: 
https://mail.openvswitch.org/pipermail/ovs-dev/2019-September/363127.html
Fixes: 048963aa8507 ("dpif-netdev: Reset RSS hash when recirculating.")
Signed-off-by: Ilya Maximets 
---
 lib/dpif-netdev.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 4546b55e8..c09b8fd95 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -6288,7 +6288,6 @@ dpif_netdev_packet_get_rss_hash(struct dp_packet *packet,
 recirc_depth = *recirc_depth_get_unsafe();
 if (OVS_UNLIKELY(recirc_depth)) {
 hash = hash_finish(hash, recirc_depth);
-dp_packet_set_rss_hash(packet, hash);
 }
 return hash;
 }
-- 
2.17.1

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


[ovs-dev] [PATCH] flow: Fix crash on vlan packets with partial offloading.

2019-10-24 Thread Ilya Maximets
parse_tcp_flags() does not care about vlan tags in a packet thus
not able to parse them.  As a result, if partial offloading is
enabled in userspace datapath vlan packets are not parsed, i.e.
has no initialized offsets.  This causes OVS crash on any attempt
to access/modify packet header fields.

For example, having the flow with following actions:
  in_port=1,ip,actions=mod_nw_src:192.168.0.7,output:IN_PORT

will lead to OVS crash on vlan packet handling:

 Process terminating with default action of signal 11 (SIGSEGV)
 Invalid read of size 4
at 0x785657: get_16aligned_be32 (unaligned.h:249)
by 0x785657: odp_set_ipv4 (odp-execute.c:82)
by 0x785657: odp_execute_masked_set_action (odp-execute.c:527)
by 0x785657: odp_execute_actions (odp-execute.c:894)
by 0x74CDA9: dp_netdev_execute_actions (dpif-netdev.c:7355)
by 0x74CDA9: packet_batch_per_flow_execute (dpif-netdev.c:6339)
by 0x74CDA9: dp_netdev_input__ (dpif-netdev.c:6845)
by 0x74DB6E: dp_netdev_input (dpif-netdev.c:6854)
by 0x74DB6E: dp_netdev_process_rxq_port (dpif-netdev.c:4287)
by 0x74E863: dpif_netdev_run (dpif-netdev.c:5264)
by 0x703F57: type_run (ofproto-dpif.c:370)
by 0x6EC8B8: ofproto_type_run (ofproto.c:1760)
by 0x6DA52B: bridge_run__ (bridge.c:3188)
by 0x6E083F: bridge_run (bridge.c:3252)
by 0x1642E4: main (ovs-vswitchd.c:127)
  Address 0xc is not stack'd, malloc'd or (recently) free'd

Fix that by properly parsing vlan tags first.  Function 'parse_dl_type'
transformed for that purpose as it had no users anyway.

Added unit test for packet modification with partial offloading that
triggers above crash.

Fixes: aab96ec4d81e ("dpif-netdev: retrieve flow directly from the flow mark")
Signed-off-by: Ilya Maximets 
---
 lib/flow.c   | 12 +++
 lib/flow.h   |  1 -
 tests/dpif-netdev.at | 78 
 3 files changed, 83 insertions(+), 8 deletions(-)

diff --git a/lib/flow.c b/lib/flow.c
index 317e3712c..a18a1e610 100644
--- a/lib/flow.c
+++ b/lib/flow.c
@@ -1073,15 +1073,14 @@ miniflow_extract(struct dp_packet *packet, struct 
miniflow *dst)
 dst->map = mf.map;
 }
 
-ovs_be16
-parse_dl_type(const struct eth_header *data_, size_t size)
+static ovs_be16
+parse_dl_type(const void **datap, size_t *sizep)
 {
-const void *data = data_;
 union flow_vlan_hdr vlans[FLOW_MAX_VLAN_HEADERS];
 
-parse_vlan(&data, &size, vlans);
+parse_vlan(datap, sizep, vlans);
 
-return parse_ethertype(&data, &size);
+return parse_ethertype(datap, sizep);
 }
 
 /* Parses and return the TCP flags in 'packet', converted to host byte order.
@@ -1104,8 +1103,7 @@ parse_tcp_flags(struct dp_packet *packet)
 
 dp_packet_reset_offsets(packet);
 
-data_pull(&data, &size, ETH_ADDR_LEN * 2);
-dl_type = parse_ethertype(&data, &size);
+dl_type = parse_dl_type(&data, &size);
 if (OVS_UNLIKELY(eth_type_mpls(dl_type))) {
 packet->l2_5_ofs = (char *)data - frame;
 }
diff --git a/lib/flow.h b/lib/flow.h
index 7298c71f3..75751763c 100644
--- a/lib/flow.h
+++ b/lib/flow.h
@@ -133,7 +133,6 @@ void packet_expand(struct dp_packet *, const struct flow *, 
size_t size);
 bool parse_ipv6_ext_hdrs(const void **datap, size_t *sizep, uint8_t *nw_proto,
  uint8_t *nw_frag,
  const struct ovs_16aligned_ip6_frag **frag_hdr);
-ovs_be16 parse_dl_type(const struct eth_header *data_, size_t size);
 bool parse_nsh(const void **datap, size_t *sizep, struct ovs_key_nsh *key);
 uint16_t parse_tcp_flags(struct dp_packet *packet);
 
diff --git a/tests/dpif-netdev.at b/tests/dpif-netdev.at
index af8a29e44..ef521ddb8 100644
--- a/tests/dpif-netdev.at
+++ b/tests/dpif-netdev.at
@@ -420,3 +420,81 @@ p1: flow del: mark: 0
 
 DPIF_NETDEV_FLOW_HW_OFFLOAD([dummy])
 DPIF_NETDEV_FLOW_HW_OFFLOAD([dummy-pmd])
+
+
+m4_define([DPIF_NETDEV_FLOW_HW_OFFLOAD_OFFSETS],
+  [AT_SETUP([dpif-netdev - partial hw offload with packet modifications - $1])
+   OVS_VSWITCHD_START(
+ [add-port br0 p1 -- \
+  set interface p1 type=$1 ofport_request=1 options:pcap=p1.pcap 
options:ifindex=1 -- \
+  set bridge br0 datapath-type=dummy \
+ other-config:datapath-id=1234 fail-mode=secure], [], [],
+  [m4_if([$1], [dummy-pmd], [--dummy-numa="0,0,0,0,1,1,1,1"], [])])
+   AT_CHECK([ovs-appctl vlog/set dpif:file:dbg dpif_netdev:file:dbg 
netdev_dummy:file:dbg])
+
+   AT_CHECK([ovs-vsctl set Open_vSwitch . other_config:hw-offload=true])
+   OVS_WAIT_UNTIL([grep "netdev: Flow API Enabled" ovs-vswitchd.log])
+
+   AT_CHECK([ovs-ofctl del-flows br0])
+
+   # Setting flow to modify ipv4 src address and udp dst port to be sure that
+   # offloaded packets has correctly initialized l3/l4 offsets.
+   AT_CHECK([ovs-ofctl add-flow br0 
in_port=1,udp,actions=mod_nw_src:192.168.0.7,mod_tp_dst:3773,output:IN_PORT])
+
+   
packet="packet_type(ns=0,id=0),eth(src=00:06:07:08:09:0a,dst=00:01:02:03:04:05),eth_type(0x8100),v

Re: [ovs-dev] [PATCH] tc: Limit the max action number to 16

2019-10-24 Thread Simon Horman
On Mon, Oct 21, 2019 at 07:01:38AM +, Roi Dayan wrote:
> 
> 
> On 2019-10-18 1:00 PM, Simon Horman wrote:
> > On Wed, Oct 16, 2019 at 11:53:52AM +, Roi Dayan wrote:
> >>
> >>
> >> On 2019-10-16 2:40 PM, Simon Horman wrote:
> >>> On Wed, Oct 16, 2019 at 11:37:14AM +0300, Roi Dayan wrote:
>  From: Chris Mi 
> 
>  Currently, ovs supports to offload max TCA_ACT_MAX_PRIO(32) actions.
>  But net sched api has a limit of 4K message size which is not enough
>  for 32 actions when echo flag is set.
> 
>  After a lot of testing, we find that 16 actions is a reasonable number.
>  So in this commit, we introduced a new define to limit the max actions.
> 
>  Fixes: 0c70132cd288("tc: Make the actions order consistent")
>  Signed-off-by: Chris Mi 
>  Reviewed-by: Roi Dayan 
> >>>
> >>> Hi Chris,
> >>>
> >>> I'm unclear on what problem is this patch solving.
> >>
> >> Hi Simon,
> >>
> >> I can help with the answer here.
> >> When ovs send netlink msg to tc to add a filter we also add
> >> the echo flag to get a reply data. this reply can be big as
> >> it contains everything from the request and if it pass the 4K
> >> size then the kernel will just not fill/send it but the return
> >> status of the tc command is still 0 for success.
> >>
> >> In ovs we use that reply to get back the handle id on success but
> >> for this case will fail.
> >> To make sure this ack reply always exists for successful tc calls
> >> we limit the number of actions here to avoid reaching the 4K size limit.
> > 
> > Thanks,
> > 
> > It sounds like it would be good to develop a mechanism where
> > the information required can be retrieved in a less verbose manner,
> > thus allowing a higher limit.
> > 
> > But I do agree that this resolves a problem and I have applied it to
> > master. Let me know if you think it is also appropriate for older branches.
> > 
> > Kind regards,
> > Simon
> > 
> 
> thanks Simon.
> this patch can be applied also to branches 2.10, 2.11, 2.12.

Thanks,

I have pushed a backport to branch-2.12.
And I intend to do likewise for branch-2.11 if travis-ci passes.

https://travis-ci.org/horms2/ovs/builds/602211621

I am however holding back on branch-2.10 as it seems broken
with respect to travis-ci. And I do not like to add patches
to broken branches.

I am trying to investigate the cause of that breakage.
I would also welcome any help in this area.

Kind regards,
Simon

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


[ovs-dev] Spende für dich

2019-10-24 Thread Azim Premji


Ich bin * Azim Hashim Premji *, ein indisches Wirtschaftsmagazin, Investor und 
Philanthrop. Ich bin Vorsitzender von Wipro Limited. Ich habe 25 Prozent meiner 
persönlichen Vermögensanträge. Und ich habe auch versprochen, den Rest von 25% 
im Jahr 2019 zu verschenken. Ich habe beschlossen, Ihnen eine Spende von 
1.000.000,00 Euro * zukommen zu lassen. Wenn Sie an meiner Spende interessiert 
sind, kontaktieren Sie mich für weitere Informationen. Ich will es auch. Sie 
sind Teil meiner gemeinnützigen Stiftung, sobald Sie das Geld erhalten, damit 
wir die Armen versöhnen können
Sie können über den folgenden Link auch mehr über mich lesen: 
https://en.wikipedia.org/wiki/Azim_Premji

Kontaktieren Sie sie per E-Mail für weitere Informationen: 
azimpremji...@gmail.com
 Ihre
Geschäftsführer Wipro Limited
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 1/1] ovsdb-server: fix memory leak in ovsdb_convert_table() function.

2019-10-24 Thread 0-day Robot
Bleep bloop.  Greetings Damijan Skvarc, 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 88 characters long (recommended limit is 79)
#43 FILE: ovsdb/file.c:238:
ovsdb_datum_destroy(&dst_row->fields[dst_column->index], 
&dst_column->type);

Lines checked: 50, 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 1/1] ovsdb-server: fix memory leak in ovsdb_convert_table() function.

2019-10-24 Thread Damijan Skvarc
Memory leak happens while converting existing database into new database 
according to
the specified schema (ovsdb-client convert new-schema). Memory leak was detected
by valgrind while executing functional test "schema conversion online - 
clustered"

==16202== 96 bytes in 6 blocks are definitely lost in loss record 326 of 399
==16202==at 0x4C2DB8F: malloc (in 
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==16202==by 0x44A5D4: xmalloc (util.c:138)
==16202==by 0x4377A6: alloc_default_atoms (ovsdb-data.c:315)
==16202==by 0x437F18: ovsdb_datum_init_default (ovsdb-data.c:918)
==16202==by 0x413D82: ovsdb_row_create (row.c:59)
==16202==by 0x40AA53: ovsdb_convert_table (file.c:220)
==16202==by 0x40AA53: ovsdb_convert (file.c:275)
==16202==by 0x416BE1: ovsdb_trigger_try (trigger.c:255)
==16202==by 0x40D29E: ovsdb_jsonrpc_trigger_create (jsonrpc-server.c:1119)
==16202==by 0x40D29E: ovsdb_jsonrpc_session_got_request 
(jsonrpc-server.c:986)
==16202==by 0x40D29E: ovsdb_jsonrpc_session_run (jsonrpc-server.c:556)
==16202==by 0x40D29E: ovsdb_jsonrpc_session_run_all (jsonrpc-server.c:586)
==16202==by 0x40D29E: ovsdb_jsonrpc_server_run (jsonrpc-server.c:401)
==16202==by 0x40682E: main_loop (ovsdb-server.c:209)
==16202==by 0x40682E: main (ovsdb-server.c:460)

The problem was in ovsdb_datum_convert() function, which overrides pointers to 
datum memory allocated in
ovsdb_row_create() function. Fix was done by freeing this memory before 
ovsdb_datum_convert() is called.

Signed-off-by: Damijan Skvarc 
---
 ovsdb/file.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ovsdb/file.c b/ovsdb/file.c
index 8d16b09..7ac7df0 100644
--- a/ovsdb/file.c
+++ b/ovsdb/file.c
@@ -235,6 +235,8 @@ ovsdb_convert_table(struct ovsdb_txn *txn,
 continue;
 }
 
+ovsdb_datum_destroy(&dst_row->fields[dst_column->index], 
&dst_column->type);
+
 struct ovsdb_error *error = ovsdb_datum_convert(
 &dst_row->fields[dst_column->index], &dst_column->type,
 &src_row->fields[src_column->index], &src_column->type);
-- 
2.7.4

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


Re: [ovs-dev] [PATCH net-next v4 08/10] net: openvswitch: fix possible memleak on destroy flow-table

2019-10-24 Thread Pravin Shelar
On Tue, Oct 22, 2019 at 7:35 PM Tonghao Zhang  wrote:
>
> On Tue, Oct 22, 2019 at 2:58 PM Pravin Shelar  wrote:
> >
...

> > > >
> > Sure, I can review it, Can you send the patch inlined in mail?
> >
> > Thanks.
> diff --git a/net/openvswitch/flow_table.c b/net/openvswitch/flow_table.c
> index 5df5182..5b20793 100644
> --- a/net/openvswitch/flow_table.c
> +++ b/net/openvswitch/flow_table.c
> @@ -257,10 +257,75 @@ static void flow_tbl_destroy_rcu_cb(struct rcu_head 
> *rcu)
> __table_instance_destroy(ti);
>  }
>
> -static void table_instance_destroy(struct table_instance *ti,
> -  struct table_instance *ufid_ti,
> +static void tbl_mask_array_del_mask(struct flow_table *tbl,
> +   struct sw_flow_mask *mask)
> +{
> +   struct mask_array *ma = ovsl_dereference(tbl->mask_array);
> +   int i, ma_count = READ_ONCE(ma->count);
> +
> +   /* Remove the deleted mask pointers from the array */
> +   for (i = 0; i < ma_count; i++) {
> +   if (mask == ovsl_dereference(ma->masks[i]))
> +   goto found;
> +   }
> +
> +   BUG();
> +   return;
> +
> +found:
> +   WRITE_ONCE(ma->count, ma_count -1);
> +
> +   rcu_assign_pointer(ma->masks[i], ma->masks[ma_count -1]);
> +   RCU_INIT_POINTER(ma->masks[ma_count -1], NULL);
> +
> +   kfree_rcu(mask, rcu);
> +
> +   /* Shrink the mask array if necessary. */
> +   if (ma->max >= (MASK_ARRAY_SIZE_MIN * 2) &&
> +   ma_count <= (ma->max / 3))
> +   tbl_mask_array_realloc(tbl, ma->max / 2);
> +}
> +
> +/* Remove 'mask' from the mask list, if it is not needed any more. */
> +static void flow_mask_remove(struct flow_table *tbl, struct sw_flow_mask 
> *mask)
> +{
> +   if (mask) {
> +   /* ovs-lock is required to protect mask-refcount and
> +* mask list.
> +*/
> +   ASSERT_OVSL();
> +   BUG_ON(!mask->ref_count);
> +   mask->ref_count--;
> +
> +   if (!mask->ref_count)
> +   tbl_mask_array_del_mask(tbl, mask);
> +   }
> +}
> +
> +static void table_instance_remove(struct flow_table *table, struct
> sw_flow *flow)
> +{
> +   struct table_instance *ti = ovsl_dereference(table->ti);
> +   struct table_instance *ufid_ti = ovsl_dereference(table->ufid_ti);
> +
> +   BUG_ON(table->count == 0);
> +   hlist_del_rcu(&flow->flow_table.node[ti->node_ver]);
> +   table->count--;
> +   if (ovs_identifier_is_ufid(&flow->id)) {
> +   hlist_del_rcu(&flow->ufid_table.node[ufid_ti->node_ver]);
> +   table->ufid_count--;
> +   }
> +
> +   /* RCU delete the mask. 'flow->mask' is not NULLed, as it should be
> +* accessible as long as the RCU read lock is held.
> +*/
> +   flow_mask_remove(table, flow->mask);
> +}
> +
> +static void table_instance_destroy(struct flow_table *table,
>bool deferred)
>  {
> +   struct table_instance *ti = ovsl_dereference(table->ti);
> +   struct table_instance *ufid_ti = ovsl_dereference(table->ufid_ti);
> int i;
>
> if (!ti)
> @@ -274,13 +339,9 @@ static void table_instance_destroy(struct
> table_instance *ti,
> struct sw_flow *flow;
> struct hlist_head *head = &ti->buckets[i];
> struct hlist_node *n;
> -   int ver = ti->node_ver;
> -   int ufid_ver = ufid_ti->node_ver;
>
> -   hlist_for_each_entry_safe(flow, n, head, 
> flow_table.node[ver]) {
> -   hlist_del_rcu(&flow->flow_table.node[ver]);
> -   if (ovs_identifier_is_ufid(&flow->id))
> -   
> hlist_del_rcu(&flow->ufid_table.node[ufid_ver]);
> +   hlist_for_each_entry_safe(flow, n, head,
> flow_table.node[ti->node_ver]) {
> +   table_instance_remove(table, flow);
> ovs_flow_free(flow, deferred);
> }
> }
> @@ -300,12 +361,9 @@ static void table_instance_destroy(struct
> table_instance *ti,
>   */
>  void ovs_flow_tbl_destroy(struct flow_table *table)
>  {
> -   struct table_instance *ti = rcu_dereference_raw(table->ti);
> -   struct table_instance *ufid_ti = rcu_dereference_raw(table->ufid_ti);
> -
> free_percpu(table->mask_cache);
> kfree_rcu(rcu_dereference_raw(table->mask_array), rcu);
> -   table_instance_destroy(ti, ufid_ti, false);
> +   table_instance_destroy(table, false);
>  }
>
>  struct sw_flow *ovs_flow_tbl_dump_next(struct table_instance *ti,
> @@ -400,10 +458,9 @@ static struct table_instance
> *table_instance_rehash(struct table_instance *ti,
> return new_ti;
>  }
>
> -int ovs_flow_tbl_flush(struct flow_table *flow_table)
> +int ovs_flow_tbl_flush(struct flow_table *table)
>  {
> -   struct table_instance *old_ti, *new_t