[ovs-dev] Several conntrack problems, including some critical bugs.

2018-08-27 Thread Zang MingJie
While developing application using ovs userspace conntrack, we found
some bugs worth mention here.

1. conntrack_clean may causes ovs crash.

conntrack_clean function iterators through all buckets, and free
entries in the bucket with bucket lock, but when releasing a NAT
connection, inside nat_clean function, the bucket lock is temporarily
released, if other PMD acquires the lock and modifies the bucket,
further loop may causing invalid memory access inside sweep_bucket
function.

2. occasionally incorrectly DNAT to 1024 port, despite whatever port specified.

We found 2 scenarios, both leads to this result.

First, consider there are two virtual server share the same backend,
which are implemented by DNAT, both V1 and V2 are DNAT to R. While
there is already a connection C->V1 which is DNAT as C->R, if there is
another incoming connection C->V2, will also DNAT as C->R, causing
conntrack table conflict, but instead of dropping the packet, the
connection is DNAT to port 1024. Because the NAT function search
through port 1024 - 65535 when conflict occurred.

Second, if a conntrack entry is expired but not yet released, mostly
in TIMEWAIT state, the client may reuse the same port to establish a
new connection, when this condition is met, will also cause a
conflict, the connection will DNAT to port 1024 if DNAT is used.

There are also some other problems under investigation, and I'll post
them when we find the cause.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] OVS DPDK: dpdk_merge pull request for master

2018-08-27 Thread Vishal Deep Ajmera
Thanks Ian and Ben.

Warm Regards,
Vishal Ajmera

> -Original Message-
> From: ovs-dev-boun...@openvswitch.org  boun...@openvswitch.org> On Behalf Of Ben Pfaff
> Sent: Tuesday, August 28, 2018 2:00 AM
> To: Ian Stokes 
> Cc: d...@openvswitch.org
> Subject: Re: [ovs-dev] OVS DPDK: dpdk_merge pull request for master
> 
> On Mon, Aug 27, 2018 at 08:17:25PM +0100, Ian Stokes wrote:
> > Hi Ben,
> >
> > The following changes since commit
> 418a7a84245f5fbe589dd1267463fc9ba27a1dd6:
> >
> >   ofproto-dpif-trace: Make -generate send packets to controller again.
> > (2018-08-27 09:35:21 -0700)
> >
> > are available in the git repository at:
> >
> >   https://github.com/istokes/ovs dpdk_merge
> >
> > for you to fetch changes up to
> 9b4f08cdcaf253175edda088683bdd3db9e4c097:
> >
> >   dpif-netdev: Avoid reordering of packets in a batch with same megaflow
> > (2018-08-27 17:48:23 +0100)
> 
> Merged, thanks!
> ___
> 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] [RFC patch v1] datapath: Fix builds on older kernels.

2018-08-27 Thread Yifeng Sun
Good catch. Just like Greg said, it is so complex when doing back porting.

Do you mind putting 3.19 in the travis.yaml? So that later on we can catch
this kind of bug, thanks.

Yifeng

On Mon, Aug 27, 2018 at 7:34 PM Gregory Rose  wrote:

>
> On 8/27/2018 7:19 PM, Darrell Ball wrote:
> > On older kernels, for example 3.19, the function rt6_get_cookie() is
> > not available and used with ipv6 config enabled;  it was introduced in
> > 4.2.  Put back the replacement function if it does not exist.
>
> Interesting that builds on 3.16.57 but not 3.19.  You can never tell
> what's getting backported and
> to which kernel.  Keeps us busy!
>
> Thanks Darrell, looks like a good catch. I'll let Yifeng provide the
> review.
>
> - Greg
>
> >
> > CC: Yifeng Sun 
> > Fixes: bf61b8b1c1db ("datapath: Add support for kernel 4.16.x & 4.17.x.")
> > Signed-off-by: Darrell Ball 
> > ---
> >   acinclude.m4|  5 
> >   datapath/linux/Modules.mk   |  1 +
> >   datapath/linux/compat/include/net/ip6_fib.h | 43
> +
> >   3 files changed, 49 insertions(+)
> >   create mode 100644 datapath/linux/compat/include/net/ip6_fib.h
> >
> > diff --git a/acinclude.m4 b/acinclude.m4
> > index ab141bd..0690bae 100644
> > --- a/acinclude.m4
> > +++ b/acinclude.m4
> > @@ -459,6 +459,9 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
> > OVS_GREP_IFELSE([$KSRC/arch/x86/include/asm/checksum_32.h],
> [src_err,],
> > [OVS_DEFINE([HAVE_CSUM_COPY_DBG])])
> >
> > +  OVS_GREP_IFELSE([$KSRC/include/net/ip6_fib.h], [rt6_get_cookie],
> > +  [OVS_DEFINE([HAVE_RT6_GET_COOKIE])])
> > +
> > OVS_GREP_IFELSE([$KSRC/include/net/addrconf.h],
> [ipv6_dst_lookup.*net],
> > [OVS_DEFINE([HAVE_IPV6_DST_LOOKUP_NET])])
> > OVS_GREP_IFELSE([$KSRC/include/net/addrconf.h], [ipv6_stub])
> > @@ -803,6 +806,8 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
> > [OVS_DEFINE(HAVE_NF_CONNTRACK_HELPER_PUT)])
> >
>  
> OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h],:space:]]]SKB_GSO_UDP[[[:space:,
> > [OVS_DEFINE([HAVE_SKB_GSO_UDP])])
> > +  OVS_GREP_IFELSE([$KSRC/include/net/dst.h],[DST_NOCACHE],
> > +  [OVS_DEFINE([HAVE_DST_NOCACHE])])
> > OVS_FIND_FIELD_IFELSE([$KSRC/include/net/rtnetlink.h],
> [rtnl_link_ops],
> >   [extack],
> > [OVS_DEFINE([HAVE_EXT_ACK_IN_RTNL_LINKOPS])])
> > diff --git a/datapath/linux/Modules.mk b/datapath/linux/Modules.mk
> > index b06ca15..e31d784 100644
> > --- a/datapath/linux/Modules.mk
> > +++ b/datapath/linux/Modules.mk
> > @@ -82,6 +82,7 @@ openvswitch_headers += \
> >   linux/compat/include/net/inetpeer.h \
> >   linux/compat/include/net/ip.h \
> >   linux/compat/include/net/ip_tunnels.h \
> > +linux/compat/include/net/ip6_fib.h \
> >   linux/compat/include/net/ip6_route.h \
> >   linux/compat/include/net/ip6_tunnel.h \
> >   linux/compat/include/net/ipv6.h \
> > diff --git a/datapath/linux/compat/include/net/ip6_fib.h
> b/datapath/linux/compat/include/net/ip6_fib.h
> > new file mode 100644
> > index 000..0cc4358
> > --- /dev/null
> > +++ b/datapath/linux/compat/include/net/ip6_fib.h
> > @@ -0,0 +1,43 @@
> > +/*
> > + *  Linux INET6 implementation
> > + *
> > + *  Authors:
> > + *  Pedro Roque 
> > + *
> > + *  This program is free software; you can redistribute it and/or
> > + *  modify it under the terms of the GNU General Public License
> > + *  as published by the Free Software Foundation; either version
> > + *  2 of the License, or (at your option) any later version.
> > + */
> > +
> > +#ifndef _IP6_FIB_WRAPPER_H
> > +#define _IP6_FIB_WRAPPER_H
> > +
> > +#include_next 
> > +
> > +#ifndef HAVE_RT6_GET_COOKIE
> > +
> > +#ifndef RTF_PCPU
> > +#define RTF_PCPU0x4000
> > +#endif
> > +
> > +#ifndef RTF_LOCAL
> > +#define RTF_LOCAL   0x8000
> > +#endif
> > +
> > +#define rt6_get_cookie rpl_rt6_get_cookie
> > +static inline u32 rt6_get_cookie(const struct rt6_info *rt)
> > +{
> > +   if (rt->rt6i_flags & RTF_PCPU ||
> > +#ifdef HAVE_DST_NOCACHE
> > +   (unlikely(rt->dst.flags & DST_NOCACHE) && rt->dst.from))
> > +#else
> > +   (unlikely(!list_empty(>rt6i_uncached)) && rt->dst.from))
> > +#endif
> > +   rt = (struct rt6_info *)(rt->dst.from);
> > +
> > +   return rt->rt6i_node ? rt->rt6i_node->fn_sernum : 0;
> > +}
> > +#endif
> > +
> > +#endif
>
> ___
> 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 v2] debian: Move libovn out from package libopenvswitch.

2018-08-27 Thread aginwala
Tested-by: aginwala  wrote:

> On Fri, Aug 24, 2018 at 06:07:24PM -0700, Han Zhou wrote:
> > From: Han Zhou 
> >
> > Since we are packaging OVN and OVS components separately, libovn
> > shouldn't belong to OVS, so move it to ovn-common. Also, remove
> > it from libopenvswitch-dev.
> >
> > Signed-off-by: Han Zhou 
>
> This is one where I'd appreciate a Tested-by: from someone.  Anyone out
> there?  :-)
> ___
> 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] [RFC patch v1] datapath: Fix builds on older kernels.

2018-08-27 Thread Gregory Rose


On 8/27/2018 7:19 PM, Darrell Ball wrote:

On older kernels, for example 3.19, the function rt6_get_cookie() is
not available and used with ipv6 config enabled;  it was introduced in
4.2.  Put back the replacement function if it does not exist.


Interesting that builds on 3.16.57 but not 3.19.  You can never tell 
what's getting backported and

to which kernel.  Keeps us busy!

Thanks Darrell, looks like a good catch. I'll let Yifeng provide the review.

- Greg



CC: Yifeng Sun 
Fixes: bf61b8b1c1db ("datapath: Add support for kernel 4.16.x & 4.17.x.")
Signed-off-by: Darrell Ball 
---
  acinclude.m4|  5 
  datapath/linux/Modules.mk   |  1 +
  datapath/linux/compat/include/net/ip6_fib.h | 43 +
  3 files changed, 49 insertions(+)
  create mode 100644 datapath/linux/compat/include/net/ip6_fib.h

diff --git a/acinclude.m4 b/acinclude.m4
index ab141bd..0690bae 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -459,6 +459,9 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
OVS_GREP_IFELSE([$KSRC/arch/x86/include/asm/checksum_32.h], [src_err,],
[OVS_DEFINE([HAVE_CSUM_COPY_DBG])])
  
+  OVS_GREP_IFELSE([$KSRC/include/net/ip6_fib.h], [rt6_get_cookie],

+  [OVS_DEFINE([HAVE_RT6_GET_COOKIE])])
+
OVS_GREP_IFELSE([$KSRC/include/net/addrconf.h], [ipv6_dst_lookup.*net],
[OVS_DEFINE([HAVE_IPV6_DST_LOOKUP_NET])])
OVS_GREP_IFELSE([$KSRC/include/net/addrconf.h], [ipv6_stub])
@@ -803,6 +806,8 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
[OVS_DEFINE(HAVE_NF_CONNTRACK_HELPER_PUT)])

OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h],:space:]]]SKB_GSO_UDP[[[:space:,
[OVS_DEFINE([HAVE_SKB_GSO_UDP])])
+  OVS_GREP_IFELSE([$KSRC/include/net/dst.h],[DST_NOCACHE],
+  [OVS_DEFINE([HAVE_DST_NOCACHE])])
OVS_FIND_FIELD_IFELSE([$KSRC/include/net/rtnetlink.h], [rtnl_link_ops],
  [extack],
[OVS_DEFINE([HAVE_EXT_ACK_IN_RTNL_LINKOPS])])
diff --git a/datapath/linux/Modules.mk b/datapath/linux/Modules.mk
index b06ca15..e31d784 100644
--- a/datapath/linux/Modules.mk
+++ b/datapath/linux/Modules.mk
@@ -82,6 +82,7 @@ openvswitch_headers += \
linux/compat/include/net/inetpeer.h \
linux/compat/include/net/ip.h \
linux/compat/include/net/ip_tunnels.h \
+linux/compat/include/net/ip6_fib.h \
linux/compat/include/net/ip6_route.h \
linux/compat/include/net/ip6_tunnel.h \
linux/compat/include/net/ipv6.h \
diff --git a/datapath/linux/compat/include/net/ip6_fib.h 
b/datapath/linux/compat/include/net/ip6_fib.h
new file mode 100644
index 000..0cc4358
--- /dev/null
+++ b/datapath/linux/compat/include/net/ip6_fib.h
@@ -0,0 +1,43 @@
+/*
+ *  Linux INET6 implementation
+ *
+ *  Authors:
+ *  Pedro Roque 
+ *
+ *  This program is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public License
+ *  as published by the Free Software Foundation; either version
+ *  2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _IP6_FIB_WRAPPER_H
+#define _IP6_FIB_WRAPPER_H
+
+#include_next 
+
+#ifndef HAVE_RT6_GET_COOKIE
+
+#ifndef RTF_PCPU
+#define RTF_PCPU0x4000
+#endif
+
+#ifndef RTF_LOCAL
+#define RTF_LOCAL   0x8000
+#endif
+
+#define rt6_get_cookie rpl_rt6_get_cookie
+static inline u32 rt6_get_cookie(const struct rt6_info *rt)
+{
+   if (rt->rt6i_flags & RTF_PCPU ||
+#ifdef HAVE_DST_NOCACHE
+   (unlikely(rt->dst.flags & DST_NOCACHE) && rt->dst.from))
+#else
+   (unlikely(!list_empty(>rt6i_uncached)) && rt->dst.from))
+#endif
+   rt = (struct rt6_info *)(rt->dst.from);
+
+   return rt->rt6i_node ? rt->rt6i_node->fn_sernum : 0;
+}
+#endif
+
+#endif


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


[ovs-dev] Sistemas de gestión ambiental

2018-08-27 Thread Energías renovables y medio ambiente




  






 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 


 
 
 
 
 
 
 
 
 
 
 
 
 
 

---
Este correo electrónico ha sido comprobado en busca de virus por AVG.
http://www.avg.com
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [RFC patch v1] datapath: Fix builds on older kernels.

2018-08-27 Thread Darrell Ball
On older kernels, for example 3.19, the function rt6_get_cookie() is
not available and used with ipv6 config enabled;  it was introduced in
4.2.  Put back the replacement function if it does not exist.

CC: Yifeng Sun 
Fixes: bf61b8b1c1db ("datapath: Add support for kernel 4.16.x & 4.17.x.")
Signed-off-by: Darrell Ball 
---
 acinclude.m4|  5 
 datapath/linux/Modules.mk   |  1 +
 datapath/linux/compat/include/net/ip6_fib.h | 43 +
 3 files changed, 49 insertions(+)
 create mode 100644 datapath/linux/compat/include/net/ip6_fib.h

diff --git a/acinclude.m4 b/acinclude.m4
index ab141bd..0690bae 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -459,6 +459,9 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
   OVS_GREP_IFELSE([$KSRC/arch/x86/include/asm/checksum_32.h], [src_err,],
   [OVS_DEFINE([HAVE_CSUM_COPY_DBG])])
 
+  OVS_GREP_IFELSE([$KSRC/include/net/ip6_fib.h], [rt6_get_cookie],
+  [OVS_DEFINE([HAVE_RT6_GET_COOKIE])])
+
   OVS_GREP_IFELSE([$KSRC/include/net/addrconf.h], [ipv6_dst_lookup.*net],
   [OVS_DEFINE([HAVE_IPV6_DST_LOOKUP_NET])])
   OVS_GREP_IFELSE([$KSRC/include/net/addrconf.h], [ipv6_stub])
@@ -803,6 +806,8 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
   [OVS_DEFINE(HAVE_NF_CONNTRACK_HELPER_PUT)])
   
OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h],:space:]]]SKB_GSO_UDP[[[:space:,
   [OVS_DEFINE([HAVE_SKB_GSO_UDP])])
+  OVS_GREP_IFELSE([$KSRC/include/net/dst.h],[DST_NOCACHE],
+  [OVS_DEFINE([HAVE_DST_NOCACHE])])
   OVS_FIND_FIELD_IFELSE([$KSRC/include/net/rtnetlink.h], [rtnl_link_ops],
 [extack],
   [OVS_DEFINE([HAVE_EXT_ACK_IN_RTNL_LINKOPS])])
diff --git a/datapath/linux/Modules.mk b/datapath/linux/Modules.mk
index b06ca15..e31d784 100644
--- a/datapath/linux/Modules.mk
+++ b/datapath/linux/Modules.mk
@@ -82,6 +82,7 @@ openvswitch_headers += \
linux/compat/include/net/inetpeer.h \
linux/compat/include/net/ip.h \
linux/compat/include/net/ip_tunnels.h \
+linux/compat/include/net/ip6_fib.h \
linux/compat/include/net/ip6_route.h \
linux/compat/include/net/ip6_tunnel.h \
linux/compat/include/net/ipv6.h \
diff --git a/datapath/linux/compat/include/net/ip6_fib.h 
b/datapath/linux/compat/include/net/ip6_fib.h
new file mode 100644
index 000..0cc4358
--- /dev/null
+++ b/datapath/linux/compat/include/net/ip6_fib.h
@@ -0,0 +1,43 @@
+/*
+ *  Linux INET6 implementation
+ *
+ *  Authors:
+ *  Pedro Roque 
+ *
+ *  This program is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public License
+ *  as published by the Free Software Foundation; either version
+ *  2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _IP6_FIB_WRAPPER_H
+#define _IP6_FIB_WRAPPER_H
+
+#include_next 
+
+#ifndef HAVE_RT6_GET_COOKIE
+
+#ifndef RTF_PCPU
+#define RTF_PCPU0x4000
+#endif
+
+#ifndef RTF_LOCAL
+#define RTF_LOCAL   0x8000
+#endif
+
+#define rt6_get_cookie rpl_rt6_get_cookie
+static inline u32 rt6_get_cookie(const struct rt6_info *rt)
+{
+   if (rt->rt6i_flags & RTF_PCPU ||
+#ifdef HAVE_DST_NOCACHE
+   (unlikely(rt->dst.flags & DST_NOCACHE) && rt->dst.from))
+#else
+   (unlikely(!list_empty(>rt6i_uncached)) && rt->dst.from))
+#endif
+   rt = (struct rt6_info *)(rt->dst.from);
+
+   return rt->rt6i_node ? rt->rt6i_node->fn_sernum : 0;
+}
+#endif
+
+#endif
-- 
1.9.1

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


Re: [ovs-dev] [PATCH 3/4] ofp-port: Fix leak on error path in parse_intel_port_custom_property().

2018-08-27 Thread Yifeng Sun
It seems (struct ofputil_port_stats).custom_stats.counters is still leaked
by
the below code path even after this fix.

parse_intel_port_custom_property
<- ofputil_pull_ofp14_port_stats
<- ofputil_decode_port_stats
<- ofputil_count_port_stats

I created a diff, how do you like it? Thanks.

diff --git a/lib/ofp-port.c b/lib/ofp-port.c
index 8d882a14b..b9ad34dbe 100644
--- a/lib/ofp-port.c
+++ b/lib/ofp-port.c
@@ -1711,7 +1711,9 @@ ofputil_count_port_stats(const struct ofp_header *oh)

 for (size_t n = 0; ; n++) {
 struct ofputil_port_stats ps;
-if (ofputil_decode_port_stats(, )) {
+   int err = ofputil_decode_port_stats(, );
+   free(ps.custom_stats.counters);
+   if (err) {
 return n;
 }
 }


Yifeng


On Fri, Aug 24, 2018 at 2:51 PM Ben Pfaff  wrote:

> Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9972
> Signed-off-by
> :
> Ben Pfaff 
> ---
>  lib/ofp-port.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/lib/ofp-port.c b/lib/ofp-port.c
> index 8d882a14b4df..f19beb64a04c 100644
> --- a/lib/ofp-port.c
> +++ b/lib/ofp-port.c
> @@ -1618,6 +1618,7 @@ parse_intel_port_custom_property(struct ofpbuf
> *payload,
>  uint8_t *name_len = ofpbuf_try_pull(payload, sizeof *name_len);
>  char *name = name_len ? ofpbuf_try_pull(payload, *name_len) :
> NULL;
>  if (!name_len || !name) {
> +free(ops->custom_stats.counters);
>  return OFPERR_OFPBPC_BAD_LEN;
>  }
>
> @@ -1628,6 +1629,7 @@ parse_intel_port_custom_property(struct ofpbuf
> *payload,
>  /* Counter value. */
>  ovs_be64 *value = ofpbuf_try_pull(payload, sizeof *value);
>  if (!value) {
> +free(ops->custom_stats.counters);
>  return OFPERR_OFPBPC_BAD_LEN;
>  }
>  c->value = ntohll(get_unaligned_be64(value));
> --
> 2.16.1
>
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 2/4] nx-match: Avoid double-free on some error paths.

2018-08-27 Thread Yifeng Sun
Looks good to me, thanks for the fix.

Reviewed-by: Yifeng Sun 

On Fri, Aug 24, 2018 at 2:50 PM Ben Pfaff  wrote:

> Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9966
> Reported-at
> :
> https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9968
> Fixes: f1eb32b9641c ("ofp-group: Fix memory leak in error cases parsing
> group requests.")
> Signed-off-by: Ben Pfaff 
> ---
>  lib/nx-match.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/lib/nx-match.c b/lib/nx-match.c
> index 3b030833cb2c..8f98032195af 100644
> --- a/lib/nx-match.c
> +++ b/lib/nx-match.c
> @@ -763,6 +763,7 @@ oxm_pull_field_array(const void *fields_data, size_t
> fields_len,
>  ofperr_to_string(error));
>
>  free(fa->values);
> +fa->values = NULL;
>  return error;
>  }
>  }
> --
> 2.16.1
>
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] dpctl: Fix memory leak in dp_exists().

2018-08-27 Thread Darrell Ball
oops; good catch.

On 8/27/18, 9:08 AM, "ovs-dev-boun...@openvswitch.org on behalf of Ben Pfaff" 
 wrote:

On Mon, Aug 27, 2018 at 07:52:55PM +0800, wangyunjian wrote:
> From: Yunjian Wang 
> 
> Fixes: ffdcd110fa62 ("dpctl: Make opt_dpif_open() more general.")
> Signed-off-by: Yunjian Wang 

Thanks, applied to master and branch-2.10.
___
dev mailing list
d...@openvswitch.org

https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail.openvswitch.org%2Fmailman%2Flistinfo%2Fovs-devdata=02%7C01%7Cdball%40vmware.com%7Cac75f6bb5b48428e881708d60c37475a%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636709828951186926sdata=JEDAZmr1hD%2FZAcE2F%2F49GjrxxQ6SdaDiBSdsWS%2FhSgU%3Dreserved=0




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


Re: [ovs-dev] OVN/OVS split: OVN mailing list?

2018-08-27 Thread Justin Pettit


> On Aug 10, 2018, at 10:52 AM, Mark Michelson  wrote:
> 
> A topic that's come up from time to time for a while now is splitting OVN out 
> of the OVS source and into a separate project. Based on discussions in recent 
> OVN IRC meetings, it seems like this will start actually happening sometime 
> soon.
> 
> Before starting in-depth technical discussions on this list or the ovs-dev 
> list, I'm curious if people would be interested in splitting off a separate 
> OVN list for this and future OVN-related discussions? I can see merits of 
> keeping discussions on this list and of starting a new one, so I'm interested 
> in what others think about the matter.

I would prefer that we make more progress on splitting the projects before we 
split the mailing lists.  I think splitting the mailing lists beforehand will 
just cause confusion about where patches should go and who should be subscribed 
to which list.  While we don't have to have the projects completely separate, 
I'd like to at least have a plan and see some progress on how we're going to do 
it.  I'd also like to have at least some preliminary discussions on it's parent 
organization, since they will be ultimately be the ones maintaining the list.

Thanks,

--Justin


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


Re: [ovs-dev] [PATCH] datapath-windows: Add support to configure ct zone limits

2018-08-27 Thread Anand Kumar
Hi Sairam,

Thanks for the review, please find my response inline.
I send out a v2 addressing review comments.

Regards,
Anand Kumar

On 8/24/18, 2:58 PM, "Sairam Venugopal"  wrote:

Hi Anand,

Thanks for the patch. See comments inline. 

Thanks,
Sairam

On 8/21/18, 2:58 PM, "ovs-dev-boun...@openvswitch.org on behalf of Anand 
Kumar"  
wrote:

This patch implements limiting conntrack entries
per zone using dpctl commands.

Example:
ovs-appctl dpctl/ct-set-limits default=5 zone=1,limit=2 zone=1,limit=3
ovs-appctl dpct/ct-del-limits zone=4
ovs-appctl dpct/ct-get-limits zone=1,2,3

- Also update the netlink-socket.c to support netlink family
  'OVS_WIN_NL_CTLIMIT_FAMILY_ID' for conntrack zone limit.

Signed-off-by: Anand Kumar 
---
 datapath-windows/include/OvsDpInterfaceExt.h |   1 +
 datapath-windows/ovsext/Conntrack.c  | 163 
++-
 datapath-windows/ovsext/Conntrack.h  |  12 ++
 datapath-windows/ovsext/Datapath.c   |  34 +-
 lib/netlink-socket.c |   5 +
 5 files changed, 212 insertions(+), 3 deletions(-)

diff --git a/datapath-windows/include/OvsDpInterfaceExt.h 
b/datapath-windows/include/OvsDpInterfaceExt.h
index db91c3e..5fd8000 100644
--- a/datapath-windows/include/OvsDpInterfaceExt.h
+++ b/datapath-windows/include/OvsDpInterfaceExt.h
@@ -72,6 +72,7 @@
  */
 
 #define OVS_WIN_NL_CT_FAMILY_ID  (NLMSG_MIN_TYPE + 7)
+#define OVS_WIN_NL_CTLIMIT_FAMILY_ID (NLMSG_MIN_TYPE + 8)
 
 #define OVS_WIN_NL_INVALID_MCGRP_ID  0
 #define OVS_WIN_NL_MCGRP_START_ID100
diff --git a/datapath-windows/ovsext/Conntrack.c 
b/datapath-windows/ovsext/Conntrack.c
index dd16602..b806cd7 100644
--- a/datapath-windows/ovsext/Conntrack.c
+++ b/datapath-windows/ovsext/Conntrack.c
@@ -34,6 +34,8 @@ static OVS_CT_THREAD_CTX ctThreadCtx;
 static PNDIS_RW_LOCK_EX *ovsCtBucketLock = NULL;
 extern POVS_SWITCH_CONTEXT gOvsSwitchContext;
 static ULONG ctTotalEntries;
+static POVS_CT_ZONE_INFO zoneInfo = NULL;
+static ULONG defaultCtLimit;
 
 static __inline OvsCtFlush(UINT16 zone, struct ovs_key_ct_tuple_ipv4 
*tuple);
 static __inline NDIS_STATUS
@@ -99,6 +101,19 @@ OvsInitConntrack(POVS_SWITCH_CONTEXT context)
 if (status != STATUS_SUCCESS) {
 OvsCleanupConntrack();
 }
+

Sai: Can you move the following prior to the OvsNatInit or handle 
OvsCleanupConntrack()?
Also, shouldn't zoneInfo have a lock for manipulation?
[AK]: Sure, I will move it before OvsNatInit(). A lock is needed only when 
there are
multiple calls to manipulate same zone id/defaults in parallel. I will handle 
this with a spinlock in v2 patch.

+zoneInfo = OvsAllocateMemoryWithTag(sizeof(OVS_CT_ZONE_INFO) *
+(UINT16_MAX + 1), 
OVS_CT_POOL_TAG);
+if (zoneInfo == NULL) {
+status = STATUS_INSUFFICIENT_RESOURCES;
+goto freeBucketLock;
+}
+
+defaultCtLimit = CT_MAX_ENTRIES;
+for (int i = 0; i <= UINT16_MAX; i++) {
+zoneInfo[i].entries = 0;
+zoneInfo[i].limit = defaultCtLimit;
+}
 return STATUS_SUCCESS;
 
 freeBucketLock:
@@ -149,6 +164,22 @@ OvsCleanupConntrack(VOID)
 OvsFreeMemoryWithTag(ovsCtBucketLock, OVS_CT_POOL_TAG);
 ovsCtBucketLock = NULL;
 OvsNatCleanup();
+if (zoneInfo) {
+OvsFreeMemoryWithTag(zoneInfo, OVS_CT_POOL_TAG);
+}
+}
+
+VOID


Sai: can we set zone to UINT16 instead of int?
[AK]: zone cannot be UINT16 since it is set to -1 when ct-set-limits is called 
with a default argument.

+OvsCtSetZoneLimit(int zone, ULONG value) {
+   if (zone == -1) {
+/* Set default limit for all zones. */
+defaultCtLimit = value;
+for (UINT32 i = 0; i <= UINT16_MAX; i++) {
+zoneInfo[i].limit = value;
+}
+} else {
+zoneInfo[(UINT16)zone].limit = value;
+}
 }
 
 /*
@@ -263,6 +294,7 @@ OvsCtAddEntry(POVS_CT_ENTRY entry,
>link);
 
 NdisInterlockedIncrement((PLONG));
+zoneInfo[ctx->key.zone].entries++;
 NdisReleaseRWLock(ovsCtBucketLock[bucketIdx], );
 return TRUE;
 }
@@ -437,6 +469,7 @@ OvsCtEntryDelete(POVS_CT_ENTRY 

Re: [ovs-dev] [PATCH] datapath-windows: Add support to configure ct zone limits

2018-08-27 Thread Anand Kumar
Hi Shashank,

Thanks for reviewing the patch. Please find response inline.

Regards,
Anand Kumar

On 8/27/18, 9:00 AM, "Shashank Ram"  wrote:



On 08/21/2018 02:57 PM, Anand Kumar wrote:
> This patch implements limiting conntrack entries
> per zone using dpctl commands.
>
> Example:
> ovs-appctl dpctl/ct-set-limits default=5 zone=1,limit=2 zone=1,limit=3
> ovs-appctl dpct/ct-del-limits zone=4
> ovs-appctl dpct/ct-get-limits zone=1,2,3
>
> - Also update the netlink-socket.c to support netlink family
>'OVS_WIN_NL_CTLIMIT_FAMILY_ID' for conntrack zone limit.
>
> Signed-off-by: Anand Kumar 
> ---
>   datapath-windows/include/OvsDpInterfaceExt.h |   1 +
>   datapath-windows/ovsext/Conntrack.c  | 163 
++-
>   datapath-windows/ovsext/Conntrack.h  |  12 ++
>   datapath-windows/ovsext/Datapath.c   |  34 +-
>   lib/netlink-socket.c |   5 +
>   5 files changed, 212 insertions(+), 3 deletions(-)
>
> diff --git a/datapath-windows/include/OvsDpInterfaceExt.h 
b/datapath-windows/include/OvsDpInterfaceExt.h
> index db91c3e..5fd8000 100644
> --- a/datapath-windows/include/OvsDpInterfaceExt.h
> +++ b/datapath-windows/include/OvsDpInterfaceExt.h
> @@ -72,6 +72,7 @@
>*/
>   
>   #define OVS_WIN_NL_CT_FAMILY_ID  (NLMSG_MIN_TYPE + 7)
> +#define OVS_WIN_NL_CTLIMIT_FAMILY_ID (NLMSG_MIN_TYPE + 8)
>   
>   #define OVS_WIN_NL_INVALID_MCGRP_ID  0
>   #define OVS_WIN_NL_MCGRP_START_ID100
> diff --git a/datapath-windows/ovsext/Conntrack.c 
b/datapath-windows/ovsext/Conntrack.c
> index dd16602..b806cd7 100644
> --- a/datapath-windows/ovsext/Conntrack.c
> +++ b/datapath-windows/ovsext/Conntrack.c
> @@ -34,6 +34,8 @@ static OVS_CT_THREAD_CTX ctThreadCtx;
>   static PNDIS_RW_LOCK_EX *ovsCtBucketLock = NULL;
>   extern POVS_SWITCH_CONTEXT gOvsSwitchContext;
>   static ULONG ctTotalEntries;
> +static POVS_CT_ZONE_INFO zoneInfo = NULL;
> +static ULONG defaultCtLimit;
>   
>   static __inline OvsCtFlush(UINT16 zone, struct ovs_key_ct_tuple_ipv4 
*tuple);
>   static __inline NDIS_STATUS
> @@ -99,6 +101,19 @@ OvsInitConntrack(POVS_SWITCH_CONTEXT context)
>   if (status != STATUS_SUCCESS) {
>   OvsCleanupConntrack();
>   }
> +
> +zoneInfo = OvsAllocateMemoryWithTag(sizeof(OVS_CT_ZONE_INFO) *
> +(UINT16_MAX + 1), 
OVS_CT_POOL_TAG);

Please define UINT16_MAX as an appropriate macro in the CT module and 
use that. It is not only more intuitive in the code, but is also more 
safe in terms of the abstraction.
[AK]: Done

> +if (zoneInfo == NULL) {
> +status = STATUS_INSUFFICIENT_RESOURCES;
> +goto freeBucketLock;
> +}
> +
> +defaultCtLimit = CT_MAX_ENTRIES;
> +for (int i = 0; i <= UINT16_MAX; i++) {

Please define UINT16_MAX as CT_XXX
[AK]: Done

> +zoneInfo[i].entries = 0;
> +zoneInfo[i].limit = defaultCtLimit;
> +}
>   return STATUS_SUCCESS;
>   
>   freeBucketLock:
> @@ -149,6 +164,22 @@ OvsCleanupConntrack(VOID)
>   OvsFreeMemoryWithTag(ovsCtBucketLock, OVS_CT_POOL_TAG);
>   ovsCtBucketLock = NULL;
>   OvsNatCleanup();
> +if (zoneInfo) {
> +OvsFreeMemoryWithTag(zoneInfo, OVS_CT_POOL_TAG);
> +}
> +}
> +
> +VOID
> +OvsCtSetZoneLimit(int zone, ULONG value) {
> +   if (zone == -1) {
> +/* Set default limit for all zones. */
> +defaultCtLimit = value;
> +for (UINT32 i = 0; i <= UINT16_MAX; i++) {

Why is a UINT32 being used as the index variable? This is because of not 
properly making use of a well defined macro in the CT module that 
abstracts UNINT16_MAX + 1 as the max limit.
[AK]: Need a 32 bit variable as the index, since max value exceeds 16 bits.

> +zoneInfo[i].limit = value;
> +}
> +} else {
> +zoneInfo[(UINT16)zone].limit = value;
> +}
>   }
>   
>   /*
> @@ -263,6 +294,7 @@ OvsCtAddEntry(POVS_CT_ENTRY entry,
>  >link);
>   
>   NdisInterlockedIncrement((PLONG));
> +zoneInfo[ctx->key.zone].entries++;
>   NdisReleaseRWLock(ovsCtBucketLock[bucketIdx], );
>   return TRUE;
>   }
> @@ -437,6 +469,7 @@ OvsCtEntryDelete(POVS_CT_ENTRY entry, BOOLEAN 
forceDelete)
>   if (entry->natInfo.natAction) {
>   OvsNatDeleteKey(>key);
>   }
> +zoneInfo[entry->key.zone].entries--;
>   OvsPostCtEventEntry(entry, OVS_EVENT_CT_DELETE);
>   RemoveEntryList(>link);
>   

Re: [ovs-dev] [branch 2.9] ovn: Fix the issue in IPv6 Neigh Solicitation responder for router IPs

2018-08-27 Thread Ben Pfaff
On Tue, Aug 28, 2018 at 02:01:07AM +0530, nusid...@redhat.com wrote:
> From: Numan Siddique 
> 
> Commit [1] added a new action 'nd_na_router' to set the router bit
> in the 'flags' field of the Neighbour Adv packet for router IPs.
> This action was used in the router pipeline. But the logical switch
> pipeline also adds the Neighbour Adv flows for router IPs but with
> 'nd_na' action (which the commit [1] didn't handle).
> 
> This patch fixes this by changing the action to 'nd_na_router' for
> router IPs.
> 
> Without this patch, the IPv6 functionality is broken.
> 
> [1] - "c9756229ed: ovn: Set proper Neighbour Adv flag when replying
> for NS request for router IP"
> 
> Signed-off-by: Numan Siddique 
> Acked-by: Han Zhou 

Thanks for the backport.  Applied to branch-2.9.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] OVS DPDK: dpdk_merge pull request for branch-2.10

2018-08-27 Thread Ben Pfaff
On Mon, Aug 27, 2018 at 08:17:37PM +0100, Ian Stokes wrote:
> Hi Ben,
> 
> The following changes since commit 052602d269480c69007bea771ebb8beffc2e377c:
> 
>   ovn-northd: Support learning neighbor from ARP request. (2018-08-27
> 09:50:28 -0700)
> 
> are available in the git repository at:
> 
>   https://github.com/istokes/ovs dpdk_merge_2_10
> 
> for you to fetch changes up to d80f42c39cb9fcdb57897ec0e524154a17a297fb:
> 
>   vswitch.xml: Fix type of dpdk-init key. (2018-08-27 19:33:58 +0100)

Thanks.  I merged all the pull requests for 2.10 back to 2.7.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v2] ovn: Fix the issue in IPv6 Neigh Solicitation responder for router IPs

2018-08-27 Thread Numan Siddique
On Tue, Aug 28, 2018 at 12:12 AM Ben Pfaff  wrote:

> On Mon, Aug 27, 2018 at 11:01:50PM +0530, Numan Siddique wrote:
> > On Mon, Aug 27, 2018, 9:53 PM Ben Pfaff  wrote:
> > > Thanks, applied to master and branch-2.10.
> >
> > Thanks Ben and Han. Can this be applied to branch 2.9 as well ?
>
> There's a merge conflict in tests/ovn.at.  Would you mind sending a
> backport patch that resolves that?
>

Done -  https://patchwork.ozlabs.org/patch/962629/

Thanks
Numan


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


[ovs-dev] [branch 2.9] ovn: Fix the issue in IPv6 Neigh Solicitation responder for router IPs

2018-08-27 Thread nusiddiq
From: Numan Siddique 

Commit [1] added a new action 'nd_na_router' to set the router bit
in the 'flags' field of the Neighbour Adv packet for router IPs.
This action was used in the router pipeline. But the logical switch
pipeline also adds the Neighbour Adv flows for router IPs but with
'nd_na' action (which the commit [1] didn't handle).

This patch fixes this by changing the action to 'nd_na_router' for
router IPs.

Without this patch, the IPv6 functionality is broken.

[1] - "c9756229ed: ovn: Set proper Neighbour Adv flag when replying
for NS request for router IP"

Signed-off-by: Numan Siddique 
Acked-by: Han Zhou 

(cherry picked from commit bec7c6415d1d770c90ff32e3626c0f63d55763af)
Conflicts:
tests/ovn.at
---
 ovn/northd/ovn-northd.8.xml | 24 ++--
 ovn/northd/ovn-northd.c |  4 +++-
 tests/ovn.at| 22 +-
 3 files changed, 46 insertions(+), 4 deletions(-)

diff --git a/ovn/northd/ovn-northd.8.xml b/ovn/northd/ovn-northd.8.xml
index 7cd7a10ed..78df522c9 100644
--- a/ovn/northd/ovn-northd.8.xml
+++ b/ovn/northd/ovn-northd.8.xml
@@ -544,8 +544,8 @@ output;
 
   Priority-50 flows that match IPv6 ND neighbor solicitations to
   each known IP address A (and A's
-  solicited node address) of every logical switch port, and
-  respond with neighbor advertisements directly with
+  solicited node address) of every logical switch port except of type
+  router, and respond with neighbor advertisements directly with
   corresponding Ethernet address E:
 
 
@@ -561,6 +561,26 @@ nd_na {
 };
 
 
+
+  Priority-50 flows that match IPv6 ND neighbor solicitations to
+  each known IP address A (and A's
+  solicited node address) of logical switch port of type router, and
+  respond with neighbor advertisements directly with
+  corresponding Ethernet address E:
+
+
+
+nd_na_router {
+eth.src = E;
+ip6.src = A;
+nd.target = A;
+nd.tll = E;
+outport = inport;
+flags.loopback = 1;
+output;
+};
+
+
 
   These flows are omitted for logical ports (other than router ports or
   localport ports) that are down.
diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c
index 56bddffcd..9ae4daafe 100644
--- a/ovn/northd/ovn-northd.c
+++ b/ovn/northd/ovn-northd.c
@@ -3733,7 +3733,7 @@ build_lswitch_flows(struct hmap *datapaths, struct hmap 
*ports,
 
 ds_clear();
 ds_put_format(,
-"nd_na { "
+"%s { "
 "eth.src = %s; "
 "ip6.src = %s; "
 "nd.target = %s; "
@@ -3742,6 +3742,8 @@ build_lswitch_flows(struct hmap *datapaths, struct hmap 
*ports,
 "flags.loopback = 1; "
 "output; "
 "};",
+!strcmp(op->nbsp->type, "router") ?
+"nd_na_router" : "nd_na",
 op->lsp_addrs[i].ea_s,
 op->lsp_addrs[i].ipv6_addrs[j].addr_s,
 op->lsp_addrs[i].ipv6_addrs[j].addr_s,
diff --git a/tests/ovn.at b/tests/ovn.at
index 460f5f5e2..add506a54 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -9192,7 +9192,7 @@ ovn-nbctl lr-add lr0_ip6
 ovn-nbctl lrp-add lr0_ip6 lrp0_ip6 00:00:00:00:af:01 aef0:0:0:0:0:0:0:0/64
 ovn-nbctl lsp-add sw0_ip6 lrp0_ip6-attachment
 ovn-nbctl lsp-set-type lrp0_ip6-attachment router
-ovn-nbctl lsp-set-addresses lrp0_ip6-attachment 00:00:00:00:af:01
+ovn-nbctl lsp-set-addresses lrp0_ip6-attachment router
 ovn-nbctl lsp-set-options lrp0_ip6-attachment router-port=lrp0_ip6
 ovn-nbctl set logical_router_port lrp0_ip6 ipv6_ra_configs:address_mode=slaac
 
@@ -9228,6 +9228,26 @@ ovs-vsctl set open . 
external-ids:ovn-bridge-mappings=phys:br-phys
 # XXX This should be more systematic.
 sleep 1
 
+OVS_WAIT_UNTIL([test x`ovn-nbctl lsp-get-up sw0_ip6-port1` = xup])
+
+# There should be 2 Neighbor Advertisement flows for the router port
+# aef0:: ip address in logical switch pipeline with action nd_na_router.
+AT_CHECK([ovn-sbctl dump-flows sw0_ip6 | grep ls_in_arp_rsp | \
+grep "nd_na_router" | wc -l], [0], [2
+])
+
+# There should be 4 Neighbor Advertisement flows with action nd_na_router
+# in the router pipeline for the router lr0_ip6.
+AT_CHECK([ovn-sbctl dump-flows lr0_ip6 | grep nd_na_router | \
+wc -l], [0], [4
+])
+
+cr_uuid=`ovn-sbctl find port_binding logical_port=cr-ip6_public | grep _uuid | 
cut -f2 -d ":"`
+
+# There is only one chassis.
+chassis_uuid=`ovn-sbctl list chassis | grep _uuid | cut -f2 -d ":"`
+OVS_WAIT_UNTIL([test $chassis_uuid = `ovn-sbctl get port_binding $cr_uuid 
chassis`])
+
 trim_zeros() {
 sed 's/\(00\)\{1,\}$//'
 }
-- 
2.17.1

___
dev mailing list

Re: [ovs-dev] OVS DPDK: dpdk_merge pull request for master

2018-08-27 Thread Ben Pfaff
On Mon, Aug 27, 2018 at 08:17:25PM +0100, Ian Stokes wrote:
> Hi Ben,
> 
> The following changes since commit 418a7a84245f5fbe589dd1267463fc9ba27a1dd6:
> 
>   ofproto-dpif-trace: Make -generate send packets to controller again.
> (2018-08-27 09:35:21 -0700)
> 
> are available in the git repository at:
> 
>   https://github.com/istokes/ovs dpdk_merge
> 
> for you to fetch changes up to 9b4f08cdcaf253175edda088683bdd3db9e4c097:
> 
>   dpif-netdev: Avoid reordering of packets in a batch with same megaflow
> (2018-08-27 17:48:23 +0100)

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


Re: [ovs-dev] OVS DPDK: dpdk_merge pull request for branch-2.10

2018-08-27 Thread 0-day Robot
Bleep bloop.  Greetings Ian Stokes, 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: Too many signoffs; are you missing Co-authored-by lines?
Lines checked: 401, Warnings: 0, Errors: 1


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

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


[ovs-dev] OVS DPDK: dpdk_merge pull request for branch-2.7

2018-08-27 Thread Ian Stokes

Hi Ben,

The following changes since commit 576a2011a2872bf0f05ae19cf20425f88c837999:

  netdev-linux: Avoid division by 0 if kernel reports bad scheduler 
data. (2018-08-20 09:31:06 -0700)


are available in the git repository at:

  https://github.com/istokes/ovs dpdk_merge_2_7

for you to fetch changes up to 921256e694b7e037a78c37bcd533901122dbe042:

  netdev-dpdk: Support the link speed of XL710 (2018-08-22 15:29:58 +0100)


Xu Binbin (1):
  netdev-dpdk: Support the link speed of XL710

 lib/netdev-dpdk.c | 3 +++
 1 file changed, 3 insertions(+)

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


[ovs-dev] OVS DPDK: dpdk_merge pull request for branch-2.8

2018-08-27 Thread Ian Stokes

Hi Ben,

The following changes since commit f860e9ec5b009d836de6211510b17ebe2b894ef1:

  netdev-linux: Avoid division by 0 if kernel reports bad scheduler 
data. (2018-08-20 09:31:00 -0700)


are available in the git repository at:

  https://github.com/istokes/ovs dpdk_merge_2_8

for you to fetch changes up to 5ac1c9866f46818fefd437fcab866b897094aac2:

  netdev-dpdk: Support the link speed of XL710 (2018-08-22 15:30:23 +0100)


Xu Binbin (1):
  netdev-dpdk: Support the link speed of XL710

 lib/netdev-dpdk.c | 3 +++
 1 file changed, 3 insertions(+)

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


[ovs-dev] OVS DPDK: dpdk_merge pull request for branch-2.9

2018-08-27 Thread Ian Stokes

Hi Ben,

The following changes since commit 9b2b68660e9a939a82e9142f25ba0f7942188925:

  ovn-northd: Support learning neighbor from ARP request. (2018-08-27 
09:51:21 -0700)


are available in the git repository at:

  https://github.com/istokes/ovs dpdk_merge_2_9

for you to fetch changes up to a1d88db2483ec3b8e6e0303ba30e90c2a2e761e5:

  netdev-dpdk: Support the link speed of XL710 (2018-08-27 19:34:23 +0100)


Xu Binbin (1):
  netdev-dpdk: Support the link speed of XL710

 lib/netdev-dpdk.c | 3 +++
 1 file changed, 3 insertions(+)

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


[ovs-dev] OVS DPDK: dpdk_merge pull request for branch-2.10

2018-08-27 Thread Ian Stokes

Hi Ben,

The following changes since commit 052602d269480c69007bea771ebb8beffc2e377c:

  ovn-northd: Support learning neighbor from ARP request. (2018-08-27 
09:50:28 -0700)


are available in the git repository at:

  https://github.com/istokes/ovs dpdk_merge_2_10

for you to fetch changes up to d80f42c39cb9fcdb57897ec0e524154a17a297fb:

  vswitch.xml: Fix type of dpdk-init key. (2018-08-27 19:33:58 +0100)


Ilya Maximets (1):
  vswitch.xml: Fix type of dpdk-init key.

Xu Binbin (1):
  netdev-dpdk: Support the link speed of XL710

 lib/netdev-dpdk.c| 3 +++
 vswitchd/vswitch.xml | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)


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


[ovs-dev] OVS DPDK: dpdk_merge pull request for master

2018-08-27 Thread Ian Stokes

Hi Ben,

The following changes since commit 418a7a84245f5fbe589dd1267463fc9ba27a1dd6:

  ofproto-dpif-trace: Make -generate send packets to controller again. 
(2018-08-27 09:35:21 -0700)


are available in the git repository at:

  https://github.com/istokes/ovs dpdk_merge

for you to fetch changes up to 9b4f08cdcaf253175edda088683bdd3db9e4c097:

  dpif-netdev: Avoid reordering of packets in a batch with same 
megaflow (2018-08-27 17:48:23 +0100)



Ben Pfaff (1):
  netdev: Clean up class initialization.

Ilya Maximets (1):
  vswitch.xml: Fix type of dpdk-init key.

Vishal Deep Ajmera (1):
  dpif-netdev: Avoid reordering of packets in a batch with same 
megaflow


Xu Binbin (1):
  netdev-dpdk: Support the link speed of XL710

 configure.ac  |   1 +
 lib/dpif-netdev.c | 125 

 lib/netdev-dpdk.c | 237 
++--

 lib/netdev-dpdk.h |   4 +++
 lib/netdev-dummy.c| 134 
+++---
 lib/netdev-linux.c| 340 
+++

 lib/netdev-linux.h|  18 +--
 lib/netdev-provider.h |   2 --
 lib/netdev-vport.c| 223 
+---

 vswitchd/vswitch.xml  |   3 +-
 10 files changed, 483 insertions(+), 604 deletions(-)

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


Re: [ovs-dev] [PATCH v2] ovn: Fix the issue in IPv6 Neigh Solicitation responder for router IPs

2018-08-27 Thread Ben Pfaff
On Mon, Aug 27, 2018 at 11:01:50PM +0530, Numan Siddique wrote:
> On Mon, Aug 27, 2018, 9:53 PM Ben Pfaff  wrote:
> > Thanks, applied to master and branch-2.10.
> 
> Thanks Ben and Han. Can this be applied to branch 2.9 as well ?

There's a merge conflict in tests/ovn.at.  Would you mind sending a
backport patch that resolves that?

Thanks,

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


Re: [ovs-dev] [PATCH v2] ovn: Fix the issue in IPv6 Neigh Solicitation responder for router IPs

2018-08-27 Thread Numan Siddique
On Mon, Aug 27, 2018, 9:53 PM Ben Pfaff  wrote:

> On Fri, Aug 24, 2018 at 02:11:05PM -0700, Han Zhou wrote:
> > On Fri, Aug 24, 2018 at 12:27 PM  wrote:
> > >
> > > From: Numan Siddique 
> > >
> > > Commit [1] added a new action 'nd_na_router' to set the router bit
> > > in the 'flags' field of the Neighbour Adv packet for router IPs.
> > > This action was used in the router pipeline. But the logical switch
> > > pipeline also adds the Neighbour Adv flows for router IPs but with
> > > 'nd_na' action (which the commit [1] didn't handle).
> > >
> > > This patch fixes this by changing the action to 'nd_na_router' for
> > > router IPs.
> > >
> > > Without this patch, the IPv6 functionality is broken.
> > >
> > > [1] - "c9756229ed: ovn: Set proper Neighbour Adv flag when replying
> > > for NS request for router IP"
> > >
> > > Signed-off-by: Numan Siddique 
> > > ---
> > >  ovn/northd/ovn-northd.8.xml | 24 ++--
> > >  ovn/northd/ovn-northd.c |  4 +++-
> > >  tests/ovn.at| 15 ++-
> > >  3 files changed, 39 insertions(+), 4 deletions(-)
> > >
> > > v1 -> v2
> > > ---
> > > Addressed the review comments from Han Zhou by using the nd_na_router
> > > action for router IPs in the logical switch pipeline.
> > >
> > >
> > > diff --git a/ovn/northd/ovn-northd.8.xml b/ovn/northd/ovn-northd.8.xml
> > > index e5ff2b661..7352c6764 100644
> > > --- a/ovn/northd/ovn-northd.8.xml
> > > +++ b/ovn/northd/ovn-northd.8.xml
> > > @@ -549,8 +549,8 @@ output;
> > >  
> > >Priority-50 flows that match IPv6 ND neighbor solicitations
> to
> > >each known IP address A (and A's
> > > -  solicited node address) of every logical switch port, and
> > > -  respond with neighbor advertisements directly with
> > > +  solicited node address) of every logical switch port except
> of
> > type
> > > +  router, and respond with neighbor advertisements directly
> with
> > >corresponding Ethernet address E:
> > >  
> > >
> > > @@ -566,6 +566,26 @@ nd_na {
> > >  };
> > >  
> > >
> > > +
> > > +  Priority-50 flows that match IPv6 ND neighbor solicitations
> to
> > > +  each known IP address A (and A's
> > > +  solicited node address) of logical switch port of type
> router,
> > and
> > > +  respond with neighbor advertisements directly with
> > > +  corresponding Ethernet address E:
> > > +
> > > +
> > > +
> > > +nd_na_router {
> > > +eth.src = E;
> > > +ip6.src = A;
> > > +nd.target = A;
> > > +nd.tll = E;
> > > +outport = inport;
> > > +flags.loopback = 1;
> > > +output;
> > > +};
> > > +
> > > +
> > >  
> > >These flows are omitted for logical ports (other than router
> > ports or
> > >localport ports) that are down.
> > > diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c
> > > index 1d020a739..72e25181d 100644
> > > --- a/ovn/northd/ovn-northd.c
> > > +++ b/ovn/northd/ovn-northd.c
> > > @@ -4163,7 +4163,7 @@ build_lswitch_flows(struct hmap *datapaths,
> struct
> > hmap *ports,
> > >
> > >  ds_clear();
> > >  ds_put_format(,
> > > -"nd_na { "
> > > +"%s { "
> > >  "eth.src = %s; "
> > >  "ip6.src = %s; "
> > >  "nd.target = %s; "
> > > @@ -4172,6 +4172,8 @@ build_lswitch_flows(struct hmap *datapaths,
> struct
> > hmap *ports,
> > >  "flags.loopback = 1; "
> > >  "output; "
> > >  "};",
> > > +!strcmp(op->nbsp->type, "router") ?
> > > +"nd_na_router" : "nd_na",
> > >  op->lsp_addrs[i].ea_s,
> > >  op->lsp_addrs[i].ipv6_addrs[j].addr_s,
> > >  op->lsp_addrs[i].ipv6_addrs[j].addr_s,
> > > diff --git a/tests/ovn.at b/tests/ovn.at
> > > index c5d054c21..e10a7f9ba 100644
> > > --- a/tests/ovn.at
> > > +++ b/tests/ovn.at
> > > @@ -9530,7 +9530,7 @@ ovn-nbctl lr-add lr0_ip6
> > >  ovn-nbctl lrp-add lr0_ip6 lrp0_ip6 00:00:00:00:af:01
> > aef0:0:0:0:0:0:0:0/64
> > >  ovn-nbctl lsp-add sw0_ip6 lrp0_ip6-attachment
> > >  ovn-nbctl lsp-set-type lrp0_ip6-attachment router
> > > -ovn-nbctl lsp-set-addresses lrp0_ip6-attachment 00:00:00:00:af:01
> > > +ovn-nbctl lsp-set-addresses lrp0_ip6-attachment router
> > >  ovn-nbctl lsp-set-options lrp0_ip6-attachment router-port=lrp0_ip6
> > >  ovn-nbctl set logical_router_port lrp0_ip6
> > ipv6_ra_configs:address_mode=slaac
> > >
> > > @@ -9563,6 +9563,19 @@ ovs-vsctl -- add-port br-int hv1-vif1 -- \
> > >  ovs-vsctl set open . external-ids:ovn-bridge-mappings=phys:br-phys
> > >
> > >  OVS_WAIT_UNTIL([test x`ovn-nbctl lsp-get-up sw0_ip6-port1` = xup])
> > > +
> > > +# There should be 2 

Re: [ovs-dev] [PATCH 1/2] ovn-northd: LR respond ARP from valid subnet only.

2018-08-27 Thread Ben Pfaff
On Tue, Aug 21, 2018 at 04:24:27PM -0700, Han Zhou wrote:
> On Tue, Aug 21, 2018 at 3:38 PM Ben Pfaff  wrote:
> >
> > On Tue, Aug 21, 2018 at 03:03:16PM -0700, Han Zhou wrote:
> > > On Tue, Aug 21, 2018 at 11:36 AM Ben Pfaff  wrote:
> > > >
> > > > On Sun, Aug 19, 2018 at 10:27:30PM -0700, Han Zhou wrote:
> > > > > Currently ovn LR datapath responds ARP requests even if the ARP
> > > > > requestor's src IP doesn't belong to the LR port's subnets. This
> > > > > may generate unnecessary ARP responses and there could also be
> > > > > security concerns. This patch restricts the ARP response only if
> > > > > the requestor's IP matches the LR port's subnets.
> > > > >
> > > > > Signed-off-by: Han Zhou 
> > > >
> > > > Thanks, this series seems fine and the tests pass, so I applied it to
> > > > master.
> > >
> > > Thanks Ben. Shall we backport to at least 2.9 and 2.10? Without this,
> GARP
> > > request won't work for mac-binding update.
> >
> > How much of a problem is it in practice?  The patch series was the first
> > I'd heard of the problem.
> 
> The first patch in this series may not be critical, but the second one
> regarding GARP is quite important IMHO, since GARP request is very commonly
> used for announcing IP-MAC bindings.
> In practice, there are 2 common cases that will have problem:
> 
> 1) When IP-MAC bindings update in the external network behind OVN GW. The
> IPs are usually default next hop GW of OVN logical routers, or next hop of
> some static routes in OVN. There is a good chance that these bindings
> change after device replacement/upgrade etc. These are not frequent
> operations, but once it happens it will be a big impact. Someone has to
> debug this and finally delete the stale mac-binding entries manually from
> SB DB, so that traffic can go through the new device.
> 
> 2) When nested workloads are running behind OVN logical ports, such as,
> running containers inside VMs. If we don't use child port feature, we'd
> rely on mac-binding for container's IP to be accessible. If the
> implementation of the container orchestration system uses GARP request to
> update the neighbors, then it won't work without the GARP patch. There is a
> workaround in this case - change the container orchestration system
> implementation to use ARP reply to update the neighbors, but it would be
> better if OVN supports the general scenario.

Thanks a lot for the explanation.

This applied cleanly and built as far back as branch-2.8, so I
backported as far as that.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v2] debian: Move libovn out from package libopenvswitch.

2018-08-27 Thread Ben Pfaff
On Fri, Aug 24, 2018 at 06:07:24PM -0700, Han Zhou wrote:
> From: Han Zhou 
> 
> Since we are packaging OVN and OVS components separately, libovn
> shouldn't belong to OVS, so move it to ovn-common. Also, remove
> it from libopenvswitch-dev.
> 
> Signed-off-by: Han Zhou 

This is one where I'd appreciate a Tested-by: from someone.  Anyone out
there?  :-)
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] ofproto-dpif-trace: Make -generate send packets to controller again.

2018-08-27 Thread Ben Pfaff
On Fri, Aug 24, 2018 at 01:30:24PM -0700, Justin Pettit wrote:
> 
> > On Aug 24, 2018, at 12:25 PM, Ben Pfaff  wrote:
> > 
> > +/* Copies ODP actions from 'in' (with length 'size') to 'out', dropping
> > + * OVS_ACTION_ATTR_OUTPUT along the way. */
> > +static void
> > +prune_output_actions(const struct ofpbuf *in, struct ofpbuf *out)
> 
> Do you think it's worth clarifying that it's 'in->size'?  Otherwise it
> sounds like a separate argument.

Oh, whoops, this was a separate argument in a previous version.

I dropped the parenthetical.

> > +/* Executes all of the datapath actions, except for any 
> > OVS_ACTION_ATTR_OUTPUT
> > + * actions, in 'actions' on 'packet', which has the given 'flow', on 
> > 'dpif'.
> > + * The actions have slow path reason 'slow' (if any).  Appends any error
> > + * message to 'output'.
> > + *
> > + * This is mainly useful to execute actions to send a packet to an OpenFlow
> > + * controller. */
> 
> Does this now generate NetFlow and sFlow events?  If so, do you think it's 
> worth mentioning here and in the commit message?

It does generate them.  I'll update things.

I decided to make it drop recirc actions too, which can also have side
effects.

> Thanks for fixing this!
> 
> Acked-by: Justin Pettit 

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


Re: [ovs-dev] [PATCH v2] ovn: Fix the issue in IPv6 Neigh Solicitation responder for router IPs

2018-08-27 Thread Ben Pfaff
On Fri, Aug 24, 2018 at 02:11:05PM -0700, Han Zhou wrote:
> On Fri, Aug 24, 2018 at 12:27 PM  wrote:
> >
> > From: Numan Siddique 
> >
> > Commit [1] added a new action 'nd_na_router' to set the router bit
> > in the 'flags' field of the Neighbour Adv packet for router IPs.
> > This action was used in the router pipeline. But the logical switch
> > pipeline also adds the Neighbour Adv flows for router IPs but with
> > 'nd_na' action (which the commit [1] didn't handle).
> >
> > This patch fixes this by changing the action to 'nd_na_router' for
> > router IPs.
> >
> > Without this patch, the IPv6 functionality is broken.
> >
> > [1] - "c9756229ed: ovn: Set proper Neighbour Adv flag when replying
> > for NS request for router IP"
> >
> > Signed-off-by: Numan Siddique 
> > ---
> >  ovn/northd/ovn-northd.8.xml | 24 ++--
> >  ovn/northd/ovn-northd.c |  4 +++-
> >  tests/ovn.at| 15 ++-
> >  3 files changed, 39 insertions(+), 4 deletions(-)
> >
> > v1 -> v2
> > ---
> > Addressed the review comments from Han Zhou by using the nd_na_router
> > action for router IPs in the logical switch pipeline.
> >
> >
> > diff --git a/ovn/northd/ovn-northd.8.xml b/ovn/northd/ovn-northd.8.xml
> > index e5ff2b661..7352c6764 100644
> > --- a/ovn/northd/ovn-northd.8.xml
> > +++ b/ovn/northd/ovn-northd.8.xml
> > @@ -549,8 +549,8 @@ output;
> >  
> >Priority-50 flows that match IPv6 ND neighbor solicitations to
> >each known IP address A (and A's
> > -  solicited node address) of every logical switch port, and
> > -  respond with neighbor advertisements directly with
> > +  solicited node address) of every logical switch port except of
> type
> > +  router, and respond with neighbor advertisements directly with
> >corresponding Ethernet address E:
> >  
> >
> > @@ -566,6 +566,26 @@ nd_na {
> >  };
> >  
> >
> > +
> > +  Priority-50 flows that match IPv6 ND neighbor solicitations to
> > +  each known IP address A (and A's
> > +  solicited node address) of logical switch port of type router,
> and
> > +  respond with neighbor advertisements directly with
> > +  corresponding Ethernet address E:
> > +
> > +
> > +
> > +nd_na_router {
> > +eth.src = E;
> > +ip6.src = A;
> > +nd.target = A;
> > +nd.tll = E;
> > +outport = inport;
> > +flags.loopback = 1;
> > +output;
> > +};
> > +
> > +
> >  
> >These flows are omitted for logical ports (other than router
> ports or
> >localport ports) that are down.
> > diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c
> > index 1d020a739..72e25181d 100644
> > --- a/ovn/northd/ovn-northd.c
> > +++ b/ovn/northd/ovn-northd.c
> > @@ -4163,7 +4163,7 @@ build_lswitch_flows(struct hmap *datapaths, struct
> hmap *ports,
> >
> >  ds_clear();
> >  ds_put_format(,
> > -"nd_na { "
> > +"%s { "
> >  "eth.src = %s; "
> >  "ip6.src = %s; "
> >  "nd.target = %s; "
> > @@ -4172,6 +4172,8 @@ build_lswitch_flows(struct hmap *datapaths, struct
> hmap *ports,
> >  "flags.loopback = 1; "
> >  "output; "
> >  "};",
> > +!strcmp(op->nbsp->type, "router") ?
> > +"nd_na_router" : "nd_na",
> >  op->lsp_addrs[i].ea_s,
> >  op->lsp_addrs[i].ipv6_addrs[j].addr_s,
> >  op->lsp_addrs[i].ipv6_addrs[j].addr_s,
> > diff --git a/tests/ovn.at b/tests/ovn.at
> > index c5d054c21..e10a7f9ba 100644
> > --- a/tests/ovn.at
> > +++ b/tests/ovn.at
> > @@ -9530,7 +9530,7 @@ ovn-nbctl lr-add lr0_ip6
> >  ovn-nbctl lrp-add lr0_ip6 lrp0_ip6 00:00:00:00:af:01
> aef0:0:0:0:0:0:0:0/64
> >  ovn-nbctl lsp-add sw0_ip6 lrp0_ip6-attachment
> >  ovn-nbctl lsp-set-type lrp0_ip6-attachment router
> > -ovn-nbctl lsp-set-addresses lrp0_ip6-attachment 00:00:00:00:af:01
> > +ovn-nbctl lsp-set-addresses lrp0_ip6-attachment router
> >  ovn-nbctl lsp-set-options lrp0_ip6-attachment router-port=lrp0_ip6
> >  ovn-nbctl set logical_router_port lrp0_ip6
> ipv6_ra_configs:address_mode=slaac
> >
> > @@ -9563,6 +9563,19 @@ ovs-vsctl -- add-port br-int hv1-vif1 -- \
> >  ovs-vsctl set open . external-ids:ovn-bridge-mappings=phys:br-phys
> >
> >  OVS_WAIT_UNTIL([test x`ovn-nbctl lsp-get-up sw0_ip6-port1` = xup])
> > +
> > +# There should be 2 Neighbor Advertisement flows for the router port
> > +# aef0:: ip address in logical switch pipeline with action nd_na_router.
> > +AT_CHECK([ovn-sbctl dump-flows sw0_ip6 | grep ls_in_arp_rsp | \
> > +grep "nd_na_router" | wc -l], [0], [2
> > +])
> > +
> > +# There should be 4 Neighbor Advertisement flows with 

Re: [ovs-dev] OVS DPDK Latest & HWOL Branches

2018-08-27 Thread Ben Pfaff
I can help with some of these.

On Mon, Aug 27, 2018 at 04:05:39PM +, Ophir Munk wrote:
> Ian, can you please specify the practical steps regarding the new branches?
> Specifically, what is the procedure for adding a new patch for either of the 
> branches (OVS DPDK latest or HWOK)?
> 1. What should the patch title include?

I guess this is up to Ian, although he should coordinate with Aaron to
make sure that the patch robot understands too.

> 2. Who is going to merge a new patch (as well as ongoing master branch 
> updates) into the relevant branch?

I expect that Ian will be the only one pushing to the new branches.

> 3. Can I have write permissions in the new branches?

I'd prefer to have just Ian doing this work for now.

> 4. How can I inspect the new branches? Currently I am not seeing them.

I do not think that Ian has created the new branches yet.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] dpctl: Fix memory leak in dp_exists().

2018-08-27 Thread Ben Pfaff
On Mon, Aug 27, 2018 at 07:52:55PM +0800, wangyunjian wrote:
> From: Yunjian Wang 
> 
> Fixes: ffdcd110fa62 ("dpctl: Make opt_dpif_open() more general.")
> Signed-off-by: Yunjian Wang 

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


Re: [ovs-dev] OVS DPDK Latest & HWOL Branches

2018-08-27 Thread Ophir Munk



> -Original Message-
> From: ovs-dev-boun...@openvswitch.org [mailto:ovs-dev-
> boun...@openvswitch.org] On Behalf Of Stokes, Ian
> Sent: Tuesday, August 21, 2018 11:26 AM
> To: Ben Pfaff ; Justin Pettit 
> Cc: d...@openvswitch.org
> Subject: Re: [ovs-dev] OVS DPDK Latest & HWOL Branches
> 
> > On Thu, Aug 16, 2018 at 09:00:04AM -0700, Ben Pfaff wrote:
> > > On Wed, Aug 15, 2018 at 01:14:46PM -0700, Ben Pfaff wrote:
> > > > On Wed, Aug 15, 2018 at 11:17:21AM -0700, Ben Pfaff wrote:
> > > > > On Wed, Aug 15, 2018 at 01:49:45PM +0100, Ian Stokes wrote:
> > > > > > On 8/14/2018 10:19 PM, Ben Pfaff wrote:
> > > > > > >On Tue, Aug 14, 2018 at 04:42:06PM +, Stokes, Ian wrote:
> > > > > > >>Recently at the OVS DPDK community meeting the case for 2
> > > > > > >>new
> > branches was raised.
> > > > > > >>
> > > > > > >>https://emea01.safelinks.protection.outlook.com/?url=https%3
> > > > > > >>A%2F%2Fmail.openvswitch.org%2Fpipermail%2Fovs-
> dev%2F2018-Aug
> > > > > >
> >>ust%2F350data=02%7C01%7Cophirmu%40mellanox.com%7C97612
> e
> > > > > >
> >>fb96cc486bfb5108d6073fcf42%7Ca652971c7d2e4d9ba6a4d149256f461
> > > > > >
> >>b%7C0%7C0%7C636704367993334270sdata=3PLHsiCSUF6dzODKkp
> p
> > > > > > >>Fwy5g9cD92Z3WJ7raP1V9sQc%3Dreserved=0
> > > > > > >>898.html
> > > > > > >>
> > > > > > >>These branches would be:
> > > > > > >>
> > > > > > >>(i) OVS DPDK Latest: This branch would essentially be OVS
> > > > > > >>master
> > using the latest DPDK release (Including non LTS releases).
> > > > > > >>
> > > > > > >>The purpose of this branch would be to allow OVS DPDK
> > > > > > >>developers
> > to assess the latest DPDK releases with OVS and provide feedback to
> > the DPDK community if changes are required. Currently OVS transitions
> > between supported DPDK releases using DPDK LTS releases only. DPDK LTS
> > releases happen annually. The next DPDK LTS release would be 18.11.
> > However the other non-lts DPDK releases (x.02, x.05, x.08) can
> > introduce/change APIs that impact OVS DPDK (Such as the HWOL). This
> > feedback would be in place for the next LTS release before OVS transitions
> to the next x.11 LTS.
> > > > > > >>
> > > > > > >>(ii) OVS DPDK HWOL: This branch would be forked from OVS
> > > > > > >>DPDK
> > Latest but would encompass the HWOL development work that is ongoing.
> > > > > > >>
> > > > > > >>The feeling as regards the need for a OVS DPDK HWOL branch
> > > > > > >>is
> > that it requires new features only available in the latest DPDK
> > releases and that there will be a lot of code rework required as its
> > validated with various HW devices over time before an acceptable
> > solution will be in place.
> > > > > > >>
> > > > > > >>There was a question as regards the logistics of where the
> > branches should reside. It was suggested that they could be part of
> > the OVS Repo to centralize the development work but that is obviously
> > something that would have to be raised with yourself and the other
> > project maintainers.
> > > > > > >>
> > > > > > >>An alternative would be that it would be hosted on a
> > > > > > >>developers
> > GitHub repo similar to how the dpdk_merge branches currently work.
> > > > > > >>
> > > > > > >>Neither of the branches would be subject to releases as the
> > > > > > >>end
> > goal of the development work carried out on them would make its way
> > into OVS Master eventually.
> > > > > > >
> > > > > > >This seems reasonable, as long as it doesn't overburden
> > > > > > >developers with branches.
> > > > > >
> > > > > > I agree, and I think the messaging as regards its purpose of
> > > > > > usage should be clear, it's intended as a tool to aid
> > > > > > development of features for intended for OVS master in the
> > > > > > future such as DPDK releases or . Developers could ignore
> > > > > > these branches if the features they develop are already
> > > > > > available in the
> > existing supported DPDK.
> > > > > >
> > > > > > >
> > > > > > >How do you prefer to host it?  Any of the following would be
> > > > > > >fine with me, in descending order of preference:
> > > > > > >
> > > > > > >* Host in openvswitch github repo forked from main
> > openvswitch/ovs repo.
> > > > > >
> > > > > > I think the option above would be good, better than being
> > > > > > provisioned on a developers own github repo. At least when
> > > > > > documenting its purpose it would look a little more official
> > rather than pointing to a personal github repo.
> > > > > >
> > > > > > In terms of commit access I take it the default ovs committers
> > > > > > would have access here as well (I take it they would be the
> > > > > > people
> > to create the repo).
> > > > > > In terms of merging would this follow the pull_request process
> > > > > > to
> > yourself?
> > > > >
> > > > > I'd think it would make sense to give you the ability to push
> > > > > directly to this new repo.  It's only merging into release
> > > > > branches that the OVS contribution policy is supposed 

Re: [ovs-dev] [PATCH] datapath-windows: Add support to configure ct zone limits

2018-08-27 Thread Shashank Ram




On 08/21/2018 02:57 PM, Anand Kumar wrote:

This patch implements limiting conntrack entries
per zone using dpctl commands.

Example:
ovs-appctl dpctl/ct-set-limits default=5 zone=1,limit=2 zone=1,limit=3
ovs-appctl dpct/ct-del-limits zone=4
ovs-appctl dpct/ct-get-limits zone=1,2,3

- Also update the netlink-socket.c to support netlink family
   'OVS_WIN_NL_CTLIMIT_FAMILY_ID' for conntrack zone limit.

Signed-off-by: Anand Kumar 
---
  datapath-windows/include/OvsDpInterfaceExt.h |   1 +
  datapath-windows/ovsext/Conntrack.c  | 163 ++-
  datapath-windows/ovsext/Conntrack.h  |  12 ++
  datapath-windows/ovsext/Datapath.c   |  34 +-
  lib/netlink-socket.c |   5 +
  5 files changed, 212 insertions(+), 3 deletions(-)

diff --git a/datapath-windows/include/OvsDpInterfaceExt.h 
b/datapath-windows/include/OvsDpInterfaceExt.h
index db91c3e..5fd8000 100644
--- a/datapath-windows/include/OvsDpInterfaceExt.h
+++ b/datapath-windows/include/OvsDpInterfaceExt.h
@@ -72,6 +72,7 @@
   */
  
  #define OVS_WIN_NL_CT_FAMILY_ID  (NLMSG_MIN_TYPE + 7)

+#define OVS_WIN_NL_CTLIMIT_FAMILY_ID (NLMSG_MIN_TYPE + 8)
  
  #define OVS_WIN_NL_INVALID_MCGRP_ID  0

  #define OVS_WIN_NL_MCGRP_START_ID100
diff --git a/datapath-windows/ovsext/Conntrack.c 
b/datapath-windows/ovsext/Conntrack.c
index dd16602..b806cd7 100644
--- a/datapath-windows/ovsext/Conntrack.c
+++ b/datapath-windows/ovsext/Conntrack.c
@@ -34,6 +34,8 @@ static OVS_CT_THREAD_CTX ctThreadCtx;
  static PNDIS_RW_LOCK_EX *ovsCtBucketLock = NULL;
  extern POVS_SWITCH_CONTEXT gOvsSwitchContext;
  static ULONG ctTotalEntries;
+static POVS_CT_ZONE_INFO zoneInfo = NULL;
+static ULONG defaultCtLimit;
  
  static __inline OvsCtFlush(UINT16 zone, struct ovs_key_ct_tuple_ipv4 *tuple);

  static __inline NDIS_STATUS
@@ -99,6 +101,19 @@ OvsInitConntrack(POVS_SWITCH_CONTEXT context)
  if (status != STATUS_SUCCESS) {
  OvsCleanupConntrack();
  }
+
+zoneInfo = OvsAllocateMemoryWithTag(sizeof(OVS_CT_ZONE_INFO) *
+(UINT16_MAX + 1), OVS_CT_POOL_TAG);


Please define UINT16_MAX as an appropriate macro in the CT module and 
use that. It is not only more intuitive in the code, but is also more 
safe in terms of the abstraction.



+if (zoneInfo == NULL) {
+status = STATUS_INSUFFICIENT_RESOURCES;
+goto freeBucketLock;
+}
+
+defaultCtLimit = CT_MAX_ENTRIES;
+for (int i = 0; i <= UINT16_MAX; i++) {


Please define UINT16_MAX as CT_XXX


+zoneInfo[i].entries = 0;
+zoneInfo[i].limit = defaultCtLimit;
+}
  return STATUS_SUCCESS;
  
  freeBucketLock:

@@ -149,6 +164,22 @@ OvsCleanupConntrack(VOID)
  OvsFreeMemoryWithTag(ovsCtBucketLock, OVS_CT_POOL_TAG);
  ovsCtBucketLock = NULL;
  OvsNatCleanup();
+if (zoneInfo) {
+OvsFreeMemoryWithTag(zoneInfo, OVS_CT_POOL_TAG);
+}
+}
+
+VOID
+OvsCtSetZoneLimit(int zone, ULONG value) {
+   if (zone == -1) {
+/* Set default limit for all zones. */
+defaultCtLimit = value;
+for (UINT32 i = 0; i <= UINT16_MAX; i++) {


Why is a UINT32 being used as the index variable? This is because of not 
properly making use of a well defined macro in the CT module that 
abstracts UNINT16_MAX + 1 as the max limit.



+zoneInfo[i].limit = value;
+}
+} else {
+zoneInfo[(UINT16)zone].limit = value;
+}
  }
  
  /*

@@ -263,6 +294,7 @@ OvsCtAddEntry(POVS_CT_ENTRY entry,
 >link);
  
  NdisInterlockedIncrement((PLONG));

+zoneInfo[ctx->key.zone].entries++;
  NdisReleaseRWLock(ovsCtBucketLock[bucketIdx], );
  return TRUE;
  }
@@ -437,6 +469,7 @@ OvsCtEntryDelete(POVS_CT_ENTRY entry, BOOLEAN forceDelete)
  if (entry->natInfo.natAction) {
  OvsNatDeleteKey(>key);
  }
+zoneInfo[entry->key.zone].entries--;
  OvsPostCtEventEntry(entry, OVS_EVENT_CT_DELETE);
  RemoveEntryList(>link);
  OVS_RELEASE_SPIN_LOCK(&(entry->lock), irql);
@@ -877,12 +910,16 @@ OvsCtExecute_(OvsForwardingContext *fwdCtx,
   );
  
  } else {

-if (commit && ctTotalEntries >= CT_MAX_ENTRIES) {
+if (commit && (ctTotalEntries >= CT_MAX_ENTRIES ||
+zoneInfo[ctx.key.zone].entries >= zoneInfo[ctx.key.zone].limit)) {
  /* Don't proceed with processing if the max limit has been hit.
   * This blocks only new entries from being created and doesn't
   * affect existing connections.
   */
-OVS_LOG_ERROR("Conntrack Limit hit: %lu", ctTotalEntries);
+OVS_LOG_ERROR("Conntrack Limit hit: zone(%u), zoneLimit(%lu),"
+  "zoneEntries(%lu), ctTotalEntries(%lu),", zone,

Move arguments to a separate line.


+   zoneInfo[ctx.key.zone].limit,
+   

Re: [ovs-dev] [PATCH V2] ofproto-dpif: Check for EBUSY as well

2018-08-27 Thread Ben Pfaff
On Fri, Aug 24, 2018 at 01:36:29PM -0700, Greg Rose wrote:
> Guru reported that we can't create more than one geneve tunnel.
> Sometimes a driver will return EBUSY as well as EEXIST for some
> duplicate configurations.  Check for EBUSY too.
> 
> Fixes: 7521e0cf9e ("ofproto-dpif: Let the dpif report when a ...")
> Reported-at: 
> https://mail.openvswitch.org/pipermail/ovs-discuss/2018-August/047214.html
> Reported-by: Guru Shetty 
> Signed-off-by: Greg Rose 

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


Re: [ovs-dev] [PATCH] oss-fuzz: Move oss-fuzz test harnesses and fuzzer configs to ovs source repo

2018-08-27 Thread Bhargava Shastry
I am just pointing out that there was a change. No action is required on
your part. Sorry for the confusion.

Regards,
Bhargava

On 08/27/2018 05:43 PM, Ben Pfaff wrote:
> Do you mean that we should change the name in OVS?  Or are you just
> pointing out that it changed?
> 
> Thanks,
> 
> Ben.
> 
> On Mon, Aug 27, 2018 at 04:50:35PM +0200, Bhargava Shastry wrote:
>> Minor change in naming: Now, the fuzzer binaries are called $name_target
>> instead of $name_fuzzer
>>
>> On 08/27/2018 04:49 PM, Bhargava Shastry wrote:
>>> Thanks. The new oss-fuzz scripts for fetching, building and fuzzing OvS
>>> is upstream
>>>
>>> https://github.com/google/oss-fuzz/tree/master/projects/openvswitch
>>>
>>> On 08/24/2018 10:05 PM, Ben Pfaff wrote:
 Thanks.  Applied to master.

 On Wed, Aug 22, 2018 at 03:09:26PM +0200, Bhargava Shastry wrote:
> Sorry, I forgot to attach the patch itself. Here it is (attached).
>
> On 08/22/2018 02:37 PM, Bhargava Shastry wrote:
>> Hi Ben,
>>
>> The patch looks good to me. I have signed it here:
>>
>> https://github.com/bshastry/ovs/tree/try-patch-v3
>>
>> that was rebased on top off latest master.
>>
>> Regards, Bhargava
>>
>> On 08/22/2018 01:01 AM, Ben Pfaff wrote:
>>> I sent a v2: https://patchwork.ozlabs.org/patch/960749/
>>>
>>> If you like it, I need a Signed-off-by from you.
>>>
>>> Q: What's a Signed-off-by and how do I provide one?
>>>
>>> A: Free and open source software projects usually require a
>>> contributor to provide some assurance that they're entitled to
>>> contribute the code that they provide.  Some projects, for
>>> example, do this with a Contributor License Agreement (CLA) or
>>> a copyright assignment that is signed on paper or
>>> electronically.
>>>
>>> For this purpose, Open vSwitch has adopted something called the
>>> Developer's Certificate of Origin (DCO), which is also used by
>>> the Linux kernel and originated there.  Informally stated,
>>> agreeing to the DCO is the developer's way of attesting that a
>>> particular commit that they are contributing is one that they
>>> are allowed to contribute.  You should visit 
>>> https://developercertificate.org/ to read the full statement of
>>> the DCO, which is less than 200 words long.
>>>
>>> To certify compliance with the Developer's Certificate of
>>> Origin for a particular commit, just add the following line to
>>> the end of your commit message, properly substituting your name
>>> and email address:
>>>
>>> Signed-off-by: Firstname Lastname 
>>>
>>> Git has special support for adding a Signed-off-by line to a
>>> commit message: when you run "git commit", just add the -s
>>> option, as in "git commit -s".  If you use the "git citool" GUI
>>> for commits, you can add a Signed-off-by line to the commit
>>> message by pressing Control+S.  Other Git user interfaces may
>>> provide similar support.
>>>
>>> Thanks,
>>>
>>> Ben.
>>>
>>> On Fri, Aug 03, 2018 at 10:51:39AM +0200, Bhargava Shastry
>>> wrote:
 Hello,

 Gentle reminder to check if the proposed patch works :-)

 Thanks, Bhargava

 On 07/30/2018 11:58 AM, Bhargava Shastry wrote:
> Any updates on the proposed patch? :-)
>
> On 07/16/2018 02:07 PM, Bhargava Shastry wrote:
>> Update: I fixed these errors in the attached patch that
>> supersedes the patch here
>> (https://patchwork.ozlabs.org/patch/942118/)
>>
>> The major change is that I add the following line for
>> each fuzz target binary in the tests/oss-fuzz/automake.mk
>> file:
>>
>> e.g., tests_oss_fuzz_flow_extract_target_LDFLAGS =
>> $(LIB_FUZZING_ENGINE) \ -lc++
>>
>> Regards, Bhargava
>>
>> On 07/16/2018 11:45 AM, Bhargava Shastry wrote:
>>> Oops, here's the link failure log:
>>>
>>> ``` 
>>> /usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../x86_64-linux-gnu/crt1.o:
>>> In function `_start': (.text+0x20): undefined reference
>>> to `main' clang-7: error: linker command failed with
>>> exit code 1 (use -v to see invocation) Makefile:4159:
>>> recipe for target 'tests/oss-fuzz/flow_extract_target'
>>> failed make: *** [tests/oss-fuzz/flow_extract_target]
>>> Error 1 fuzzers build failed. ```
>>>
>>> The main symbol is provided by libfuzzer (clang++
>>> -lFuzzingEngine)
>>>
>>> Regards, Bhargava
>>>
>>> On 07/16/2018 11:36 AM, Bhargava Shastry wrote:
 Hi Ben,

> Never mind that one, I failed to check in some of
> that.
>
> I sent it formally: 
> 

Re: [ovs-dev] [PATCH] oss-fuzz: Move oss-fuzz test harnesses and fuzzer configs to ovs source repo

2018-08-27 Thread Ben Pfaff
Do you mean that we should change the name in OVS?  Or are you just
pointing out that it changed?

Thanks,

Ben.

On Mon, Aug 27, 2018 at 04:50:35PM +0200, Bhargava Shastry wrote:
> Minor change in naming: Now, the fuzzer binaries are called $name_target
> instead of $name_fuzzer
> 
> On 08/27/2018 04:49 PM, Bhargava Shastry wrote:
> > Thanks. The new oss-fuzz scripts for fetching, building and fuzzing OvS
> > is upstream
> > 
> > https://github.com/google/oss-fuzz/tree/master/projects/openvswitch
> > 
> > On 08/24/2018 10:05 PM, Ben Pfaff wrote:
> >> Thanks.  Applied to master.
> >>
> >> On Wed, Aug 22, 2018 at 03:09:26PM +0200, Bhargava Shastry wrote:
> >>> Sorry, I forgot to attach the patch itself. Here it is (attached).
> >>>
> >>> On 08/22/2018 02:37 PM, Bhargava Shastry wrote:
>  Hi Ben,
> 
>  The patch looks good to me. I have signed it here:
> 
>  https://github.com/bshastry/ovs/tree/try-patch-v3
> 
>  that was rebased on top off latest master.
> 
>  Regards, Bhargava
> 
>  On 08/22/2018 01:01 AM, Ben Pfaff wrote:
> > I sent a v2: https://patchwork.ozlabs.org/patch/960749/
> >
> > If you like it, I need a Signed-off-by from you.
> >
> > Q: What's a Signed-off-by and how do I provide one?
> >
> > A: Free and open source software projects usually require a
> > contributor to provide some assurance that they're entitled to
> > contribute the code that they provide.  Some projects, for
> > example, do this with a Contributor License Agreement (CLA) or
> > a copyright assignment that is signed on paper or
> > electronically.
> >
> > For this purpose, Open vSwitch has adopted something called the
> > Developer's Certificate of Origin (DCO), which is also used by
> > the Linux kernel and originated there.  Informally stated,
> > agreeing to the DCO is the developer's way of attesting that a
> > particular commit that they are contributing is one that they
> > are allowed to contribute.  You should visit 
> > https://developercertificate.org/ to read the full statement of
> > the DCO, which is less than 200 words long.
> >
> > To certify compliance with the Developer's Certificate of
> > Origin for a particular commit, just add the following line to
> > the end of your commit message, properly substituting your name
> > and email address:
> >
> > Signed-off-by: Firstname Lastname 
> >
> > Git has special support for adding a Signed-off-by line to a
> > commit message: when you run "git commit", just add the -s
> > option, as in "git commit -s".  If you use the "git citool" GUI
> > for commits, you can add a Signed-off-by line to the commit
> > message by pressing Control+S.  Other Git user interfaces may
> > provide similar support.
> >
> > Thanks,
> >
> > Ben.
> >
> > On Fri, Aug 03, 2018 at 10:51:39AM +0200, Bhargava Shastry
> > wrote:
> >> Hello,
> >>
> >> Gentle reminder to check if the proposed patch works :-)
> >>
> >> Thanks, Bhargava
> >>
> >> On 07/30/2018 11:58 AM, Bhargava Shastry wrote:
> >>> Any updates on the proposed patch? :-)
> >>>
> >>> On 07/16/2018 02:07 PM, Bhargava Shastry wrote:
>  Update: I fixed these errors in the attached patch that
>  supersedes the patch here
>  (https://patchwork.ozlabs.org/patch/942118/)
> 
>  The major change is that I add the following line for
>  each fuzz target binary in the tests/oss-fuzz/automake.mk
>  file:
> 
>  e.g., tests_oss_fuzz_flow_extract_target_LDFLAGS =
>  $(LIB_FUZZING_ENGINE) \ -lc++
> 
>  Regards, Bhargava
> 
>  On 07/16/2018 11:45 AM, Bhargava Shastry wrote:
> > Oops, here's the link failure log:
> >
> > ``` 
> > /usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../x86_64-linux-gnu/crt1.o:
> > In function `_start': (.text+0x20): undefined reference
> > to `main' clang-7: error: linker command failed with
> > exit code 1 (use -v to see invocation) Makefile:4159:
> > recipe for target 'tests/oss-fuzz/flow_extract_target'
> > failed make: *** [tests/oss-fuzz/flow_extract_target]
> > Error 1 fuzzers build failed. ```
> >
> > The main symbol is provided by libfuzzer (clang++
> > -lFuzzingEngine)
> >
> > Regards, Bhargava
> >
> > On 07/16/2018 11:36 AM, Bhargava Shastry wrote:
> >> Hi Ben,
> >>
> >>> Never mind that one, I failed to check in some of
> >>> that.
> >>>
> >>> I sent it formally: 
> >>> https://patchwork.ozlabs.org/patch/942118/
> >>
> >> Thanks for the patch. This fixes the previous error.
> >> Now, there are some new errors during the
> >> 

Re: [ovs-dev] [PATCH v3 1/1] netdev-vport: reject concomitant incompatible tunnels

2018-08-27 Thread Eelco Chaudron



On 11 Jul 2018, at 10:01, Eelco Chaudron wrote:


On 10 Jul 2018, at 23:45, Ben Pfaff wrote:




Does this support the case where, in a single database transaction, a
GBP VXLAN tunnel is removed and a non-GBP VXLAN tunnel is created 
that
would otherwise interfere with one another (and the converse case)?  
If

so, could that be included in the test?


I did some testing earlier and it does. Will add some test cases for 
it.



Tried it again and due to the order of adding and removing the actual 
netdev you do get the error, but it will be corrected by the system when 
the netdev gets removed. However, when using the test framework I do not 
see this behavior.


Is this due to known test framework limitation regarding cleanup, use of 
(vport)netdevs?


If not known, I’ll try to figure out why it’s not working on the 
test framework.

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


Re: [ovs-dev] Regarding OVS Datapath Flow !

2018-08-27 Thread Gregory Rose



On 8/27/2018 5:09 AM, rakesh kumar wrote:

Hi Team,

I am was trying to put log in the datapath module in Linux environment to
trace the flow if we ping one host to another host using ovs switch(using
mininet emulator)..

Inside *vport.c* file *ovs_vport_send *function is being called and then
internally it calls *vport->ops->send*() function I am unable to trace from
this function , can anyone tell me *where the call will go after calling
vport->ops->send* function  inside* vport.c* file.


Please give your valuable suggestions !


It will go to the vport driver's registered send function - you can get 
the name via the vport

structure's net_device member dev->name.

- Greg

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


Re: [ovs-dev] [PATCH v3 1/2] dpif-netdev: Add round-robin based rxq to pmd assignment.

2018-08-27 Thread Ilya Maximets
On 27.08.2018 17:19, Kevin Traynor wrote:
> On 08/27/2018 02:30 PM, Ilya Maximets wrote:
>> On 25.08.2018 13:00, Kevin Traynor wrote:
>>> Prior to OVS 2.9 automatic assignment of Rxqs to PMDs
>>> (i.e. CPUs) was done by round-robin.
>>>
>>> That was changed in OVS 2.9 to ordering the Rxqs based on
>>> their measured processing cycles. This was to assign the
>>> busiest Rxqs to different PMDs, improving aggregate
>>> throughput.
>>>
>>> For the most part the new scheme should be better, but
>>> there could be situations where a user prefers a simple
>>> round-robin scheme because Rxqs from a single port are
>>> more likely to be spread across multiple PMDs, and/or
>>> traffic is very bursty/unpredictable.
>>>
>>> Add 'pmd-rxq-assign' config to allow a user to select
>>> round-robin based assignment.
>>>
>>> Signed-off-by: Kevin Traynor 
>>> Acked-by: Eelco Chaudron 
>>> ---
>>>
>>> V3:
>>> - Rolled in some style and vswitch.xml changes (Ilya)
>>> - Set cycles mode by default on wrong config (Ilya)
>>>
>>> V2:
>>> - simplified nextpmd change (Eelco)
>>> - removed confusing doc sentence (Eelco)
>>> - fixed commit msg (Ilya)
>>> - made change in pmd-rxq-assign value also perform re-assignment (Ilya)
>>> - renamed to roundrobin mode (Ilya)
>>> - moved vswitch.xml changes to right config section (Ilya)
>>> - comment/log updates
>>> - moved NEWS update to separate patch as it's been changing on master
>>>
>>>  Documentation/topics/dpdk/pmd.rst | 33 +---
>>>  lib/dpif-netdev.c | 83 
>>> +--
>>>  tests/pmd.at  | 12 +-
>>>  vswitchd/vswitch.xml  | 24 +++
>>>  4 files changed, 123 insertions(+), 29 deletions(-)
>>>
>>> diff --git a/Documentation/topics/dpdk/pmd.rst 
>>> b/Documentation/topics/dpdk/pmd.rst
>>> index 5f0671e..dd9172d 100644
>>> --- a/Documentation/topics/dpdk/pmd.rst
>>> +++ b/Documentation/topics/dpdk/pmd.rst
>>> @@ -113,10 +113,15 @@ means that this thread will only poll the *pinned* Rx 
>>> queues.
>>>  
>>>  If ``pmd-rxq-affinity`` is not set for Rx queues, they will be assigned to 
>>> PMDs
>>> -(cores) automatically. Where known, the processing cycles that have been 
>>> stored
>>> -for each Rx queue will be used to assign Rx queue to PMDs based on a round
>>> -robin of the sorted Rx queues. For example, take the following example, 
>>> where
>>> -there are five Rx queues and three cores - 3, 7, and 8 - available and the
>>> -measured usage of core cycles per Rx queue over the last interval is seen 
>>> to
>>> -be:
>>> +(cores) automatically.
>>> +
>>> +The algorithm used to automatically assign Rxqs to PMDs can be set by::
>>> +
>>> +$ ovs-vsctl set Open_vSwitch . other_config:pmd-rxq-assign=
>>> +
>>> +By default, ``cycles`` assignment is used where the Rxqs will be ordered by
>>> +their measured processing cycles, and then be evenly assigned in descending
>>> +order to PMDs based on an up/down walk of the PMDs. For example, where 
>>> there
>>> +are five Rx queues and three cores - 3, 7, and 8 - available and the 
>>> measured
>>> +usage of core cycles per Rx queue over the last interval is seen to be:
>>>  
>>>  - Queue #0: 30%
>>> @@ -132,4 +137,20 @@ The Rx queues will be assigned to the cores in the 
>>> following order::
>>>  Core 8: Q3 (60%) | Q0 (30%)
>>>  
>>> +Alternatively, ``roundrobin`` assignment can be used, where the Rxqs are
>>> +assigned to PMDs in a round-robined fashion. This algorithm was used by
>>> +default prior to OVS 2.9. For example, given the following ports and 
>>> queues:
>>> +
>>> +- Port #0 Queue #0 (P0Q0)
>>> +- Port #0 Queue #1 (P0Q1)
>>> +- Port #1 Queue #0 (P1Q0)
>>> +- Port #1 Queue #1 (P1Q1)
>>> +- Port #1 Queue #2 (P1Q2)
>>> +
>>> +The Rx queues may be assigned to the cores in the following order::
>>> +
>>> +Core 3: P0Q0 | P1Q1
>>> +Core 7: P0Q1 | P1Q2
>>> +Core 8: P1Q0 |
>>> +
>>>  To see the current measured usage history of PMD core cycles for each Rx
>>>  queue::
>>> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
>>> index 7f836bb..8f004c5 100644
>>> --- a/lib/dpif-netdev.c
>>> +++ b/lib/dpif-netdev.c
>>> @@ -342,4 +342,6 @@ struct dp_netdev {
>>>  struct id_pool *tx_qid_pool;
>>>  struct ovs_mutex tx_qid_pool_mutex;
>>> +/* Use measured cycles for rxq to pmd assignment. */
>>> +bool pmd_rxq_assign_cyc;
>>>  
>>>  /* Protects the access of the 'struct dp_netdev_pmd_thread'
>>> @@ -1493,4 +1495,5 @@ create_dp_netdev(const char *name, const struct 
>>> dpif_class *class,
>>>  
>>>  cmap_init(>poll_threads);
>>> +dp->pmd_rxq_assign_cyc = true;
>>>  
>>>  ovs_mutex_init(>tx_qid_pool_mutex);
>>> @@ -3717,4 +3720,6 @@ dpif_netdev_set_config(struct dpif *dpif, const 
>>> struct smap *other_config)
>>>  struct dp_netdev *dp = get_dp_netdev(dpif);
>>>  const char *cmask = smap_get(other_config, "pmd-cpu-mask");
>>> +const char *pmd_rxq_assign = smap_get_def(other_config, 
>>> 

Re: [ovs-dev] [PATCH] oss-fuzz: Move oss-fuzz test harnesses and fuzzer configs to ovs source repo

2018-08-27 Thread Bhargava Shastry
Minor change in naming: Now, the fuzzer binaries are called $name_target
instead of $name_fuzzer

On 08/27/2018 04:49 PM, Bhargava Shastry wrote:
> Thanks. The new oss-fuzz scripts for fetching, building and fuzzing OvS
> is upstream
> 
> https://github.com/google/oss-fuzz/tree/master/projects/openvswitch
> 
> On 08/24/2018 10:05 PM, Ben Pfaff wrote:
>> Thanks.  Applied to master.
>>
>> On Wed, Aug 22, 2018 at 03:09:26PM +0200, Bhargava Shastry wrote:
>>> Sorry, I forgot to attach the patch itself. Here it is (attached).
>>>
>>> On 08/22/2018 02:37 PM, Bhargava Shastry wrote:
 Hi Ben,

 The patch looks good to me. I have signed it here:

 https://github.com/bshastry/ovs/tree/try-patch-v3

 that was rebased on top off latest master.

 Regards, Bhargava

 On 08/22/2018 01:01 AM, Ben Pfaff wrote:
> I sent a v2: https://patchwork.ozlabs.org/patch/960749/
>
> If you like it, I need a Signed-off-by from you.
>
> Q: What's a Signed-off-by and how do I provide one?
>
> A: Free and open source software projects usually require a
> contributor to provide some assurance that they're entitled to
> contribute the code that they provide.  Some projects, for
> example, do this with a Contributor License Agreement (CLA) or
> a copyright assignment that is signed on paper or
> electronically.
>
> For this purpose, Open vSwitch has adopted something called the
> Developer's Certificate of Origin (DCO), which is also used by
> the Linux kernel and originated there.  Informally stated,
> agreeing to the DCO is the developer's way of attesting that a
> particular commit that they are contributing is one that they
> are allowed to contribute.  You should visit 
> https://developercertificate.org/ to read the full statement of
> the DCO, which is less than 200 words long.
>
> To certify compliance with the Developer's Certificate of
> Origin for a particular commit, just add the following line to
> the end of your commit message, properly substituting your name
> and email address:
>
> Signed-off-by: Firstname Lastname 
>
> Git has special support for adding a Signed-off-by line to a
> commit message: when you run "git commit", just add the -s
> option, as in "git commit -s".  If you use the "git citool" GUI
> for commits, you can add a Signed-off-by line to the commit
> message by pressing Control+S.  Other Git user interfaces may
> provide similar support.
>
> Thanks,
>
> Ben.
>
> On Fri, Aug 03, 2018 at 10:51:39AM +0200, Bhargava Shastry
> wrote:
>> Hello,
>>
>> Gentle reminder to check if the proposed patch works :-)
>>
>> Thanks, Bhargava
>>
>> On 07/30/2018 11:58 AM, Bhargava Shastry wrote:
>>> Any updates on the proposed patch? :-)
>>>
>>> On 07/16/2018 02:07 PM, Bhargava Shastry wrote:
 Update: I fixed these errors in the attached patch that
 supersedes the patch here
 (https://patchwork.ozlabs.org/patch/942118/)

 The major change is that I add the following line for
 each fuzz target binary in the tests/oss-fuzz/automake.mk
 file:

 e.g., tests_oss_fuzz_flow_extract_target_LDFLAGS =
 $(LIB_FUZZING_ENGINE) \ -lc++

 Regards, Bhargava

 On 07/16/2018 11:45 AM, Bhargava Shastry wrote:
> Oops, here's the link failure log:
>
> ``` 
> /usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../x86_64-linux-gnu/crt1.o:
> In function `_start': (.text+0x20): undefined reference
> to `main' clang-7: error: linker command failed with
> exit code 1 (use -v to see invocation) Makefile:4159:
> recipe for target 'tests/oss-fuzz/flow_extract_target'
> failed make: *** [tests/oss-fuzz/flow_extract_target]
> Error 1 fuzzers build failed. ```
>
> The main symbol is provided by libfuzzer (clang++
> -lFuzzingEngine)
>
> Regards, Bhargava
>
> On 07/16/2018 11:36 AM, Bhargava Shastry wrote:
>> Hi Ben,
>>
>>> Never mind that one, I failed to check in some of
>>> that.
>>>
>>> I sent it formally: 
>>> https://patchwork.ozlabs.org/patch/942118/
>>
>> Thanks for the patch. This fixes the previous error.
>> Now, there are some new errors during the
>> compilation/linking process. I think most of this can
>> be fixed if I figure out how automake works. In a
>> nutshell, here's the problem:
>>
>> - oss-fuzz provides compilation flags that can be
>> plugged in like so ``` CC=clang CXX=clang++ 
>> CFLAGS=-O1 -fno-omit-frame-pointer
>> -gline-tables-only 
>> -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
>> 

Re: [ovs-dev] [PATCH] oss-fuzz: Move oss-fuzz test harnesses and fuzzer configs to ovs source repo

2018-08-27 Thread Bhargava Shastry
Thanks. The new oss-fuzz scripts for fetching, building and fuzzing OvS
is upstream

https://github.com/google/oss-fuzz/tree/master/projects/openvswitch

On 08/24/2018 10:05 PM, Ben Pfaff wrote:
> Thanks.  Applied to master.
> 
> On Wed, Aug 22, 2018 at 03:09:26PM +0200, Bhargava Shastry wrote:
>> Sorry, I forgot to attach the patch itself. Here it is (attached).
>> 
>> On 08/22/2018 02:37 PM, Bhargava Shastry wrote:
>>> Hi Ben,
>>> 
>>> The patch looks good to me. I have signed it here:
>>> 
>>> https://github.com/bshastry/ovs/tree/try-patch-v3
>>> 
>>> that was rebased on top off latest master.
>>> 
>>> Regards, Bhargava
>>> 
>>> On 08/22/2018 01:01 AM, Ben Pfaff wrote:
 I sent a v2: https://patchwork.ozlabs.org/patch/960749/
 
 If you like it, I need a Signed-off-by from you.
 
 Q: What's a Signed-off-by and how do I provide one?
 
 A: Free and open source software projects usually require a
 contributor to provide some assurance that they're entitled to
 contribute the code that they provide.  Some projects, for
 example, do this with a Contributor License Agreement (CLA) or
 a copyright assignment that is signed on paper or
 electronically.
 
 For this purpose, Open vSwitch has adopted something called the
 Developer's Certificate of Origin (DCO), which is also used by
 the Linux kernel and originated there.  Informally stated,
 agreeing to the DCO is the developer's way of attesting that a
 particular commit that they are contributing is one that they
 are allowed to contribute.  You should visit 
 https://developercertificate.org/ to read the full statement of
 the DCO, which is less than 200 words long.
 
 To certify compliance with the Developer's Certificate of
 Origin for a particular commit, just add the following line to
 the end of your commit message, properly substituting your name
 and email address:
 
 Signed-off-by: Firstname Lastname 
 
 Git has special support for adding a Signed-off-by line to a
 commit message: when you run "git commit", just add the -s
 option, as in "git commit -s".  If you use the "git citool" GUI
 for commits, you can add a Signed-off-by line to the commit
 message by pressing Control+S.  Other Git user interfaces may
 provide similar support.
 
 Thanks,
 
 Ben.
 
 On Fri, Aug 03, 2018 at 10:51:39AM +0200, Bhargava Shastry
 wrote:
> Hello,
> 
> Gentle reminder to check if the proposed patch works :-)
> 
> Thanks, Bhargava
> 
> On 07/30/2018 11:58 AM, Bhargava Shastry wrote:
>> Any updates on the proposed patch? :-)
>> 
>> On 07/16/2018 02:07 PM, Bhargava Shastry wrote:
>>> Update: I fixed these errors in the attached patch that
>>> supersedes the patch here
>>> (https://patchwork.ozlabs.org/patch/942118/)
>>> 
>>> The major change is that I add the following line for
>>> each fuzz target binary in the tests/oss-fuzz/automake.mk
>>> file:
>>> 
>>> e.g., tests_oss_fuzz_flow_extract_target_LDFLAGS =
>>> $(LIB_FUZZING_ENGINE) \ -lc++
>>> 
>>> Regards, Bhargava
>>> 
>>> On 07/16/2018 11:45 AM, Bhargava Shastry wrote:
 Oops, here's the link failure log:
 
 ``` 
 /usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../x86_64-linux-gnu/crt1.o:
 In function `_start': (.text+0x20): undefined reference
 to `main' clang-7: error: linker command failed with
 exit code 1 (use -v to see invocation) Makefile:4159:
 recipe for target 'tests/oss-fuzz/flow_extract_target'
 failed make: *** [tests/oss-fuzz/flow_extract_target]
 Error 1 fuzzers build failed. ```
 
 The main symbol is provided by libfuzzer (clang++
 -lFuzzingEngine)
 
 Regards, Bhargava
 
 On 07/16/2018 11:36 AM, Bhargava Shastry wrote:
> Hi Ben,
> 
>> Never mind that one, I failed to check in some of
>> that.
>> 
>> I sent it formally: 
>> https://patchwork.ozlabs.org/patch/942118/
> 
> Thanks for the patch. This fixes the previous error.
> Now, there are some new errors during the
> compilation/linking process. I think most of this can
> be fixed if I figure out how automake works. In a
> nutshell, here's the problem:
> 
> - oss-fuzz provides compilation flags that can be
> plugged in like so ``` CC=clang CXX=clang++ 
> CFLAGS=-O1 -fno-omit-frame-pointer
> -gline-tables-only 
> -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
> -fsanitize=address -fsanitize-address-use-after-scope
> -fsanitize=fuzzer-no-link CXXFLAGS=-O1
> -fno-omit-frame-pointer -gline-tables-only 
> -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
> -fsanitize=address 

Re: [ovs-dev] [PATCH v3 1/2] dpif-netdev: Add round-robin based rxq to pmd assignment.

2018-08-27 Thread Kevin Traynor
On 08/27/2018 02:30 PM, Ilya Maximets wrote:
> On 25.08.2018 13:00, Kevin Traynor wrote:
>> Prior to OVS 2.9 automatic assignment of Rxqs to PMDs
>> (i.e. CPUs) was done by round-robin.
>>
>> That was changed in OVS 2.9 to ordering the Rxqs based on
>> their measured processing cycles. This was to assign the
>> busiest Rxqs to different PMDs, improving aggregate
>> throughput.
>>
>> For the most part the new scheme should be better, but
>> there could be situations where a user prefers a simple
>> round-robin scheme because Rxqs from a single port are
>> more likely to be spread across multiple PMDs, and/or
>> traffic is very bursty/unpredictable.
>>
>> Add 'pmd-rxq-assign' config to allow a user to select
>> round-robin based assignment.
>>
>> Signed-off-by: Kevin Traynor 
>> Acked-by: Eelco Chaudron 
>> ---
>>
>> V3:
>> - Rolled in some style and vswitch.xml changes (Ilya)
>> - Set cycles mode by default on wrong config (Ilya)
>>
>> V2:
>> - simplified nextpmd change (Eelco)
>> - removed confusing doc sentence (Eelco)
>> - fixed commit msg (Ilya)
>> - made change in pmd-rxq-assign value also perform re-assignment (Ilya)
>> - renamed to roundrobin mode (Ilya)
>> - moved vswitch.xml changes to right config section (Ilya)
>> - comment/log updates
>> - moved NEWS update to separate patch as it's been changing on master
>>
>>  Documentation/topics/dpdk/pmd.rst | 33 +---
>>  lib/dpif-netdev.c | 83 
>> +--
>>  tests/pmd.at  | 12 +-
>>  vswitchd/vswitch.xml  | 24 +++
>>  4 files changed, 123 insertions(+), 29 deletions(-)
>>
>> diff --git a/Documentation/topics/dpdk/pmd.rst 
>> b/Documentation/topics/dpdk/pmd.rst
>> index 5f0671e..dd9172d 100644
>> --- a/Documentation/topics/dpdk/pmd.rst
>> +++ b/Documentation/topics/dpdk/pmd.rst
>> @@ -113,10 +113,15 @@ means that this thread will only poll the *pinned* Rx 
>> queues.
>>  
>>  If ``pmd-rxq-affinity`` is not set for Rx queues, they will be assigned to 
>> PMDs
>> -(cores) automatically. Where known, the processing cycles that have been 
>> stored
>> -for each Rx queue will be used to assign Rx queue to PMDs based on a round
>> -robin of the sorted Rx queues. For example, take the following example, 
>> where
>> -there are five Rx queues and three cores - 3, 7, and 8 - available and the
>> -measured usage of core cycles per Rx queue over the last interval is seen to
>> -be:
>> +(cores) automatically.
>> +
>> +The algorithm used to automatically assign Rxqs to PMDs can be set by::
>> +
>> +$ ovs-vsctl set Open_vSwitch . other_config:pmd-rxq-assign=
>> +
>> +By default, ``cycles`` assignment is used where the Rxqs will be ordered by
>> +their measured processing cycles, and then be evenly assigned in descending
>> +order to PMDs based on an up/down walk of the PMDs. For example, where there
>> +are five Rx queues and three cores - 3, 7, and 8 - available and the 
>> measured
>> +usage of core cycles per Rx queue over the last interval is seen to be:
>>  
>>  - Queue #0: 30%
>> @@ -132,4 +137,20 @@ The Rx queues will be assigned to the cores in the 
>> following order::
>>  Core 8: Q3 (60%) | Q0 (30%)
>>  
>> +Alternatively, ``roundrobin`` assignment can be used, where the Rxqs are
>> +assigned to PMDs in a round-robined fashion. This algorithm was used by
>> +default prior to OVS 2.9. For example, given the following ports and queues:
>> +
>> +- Port #0 Queue #0 (P0Q0)
>> +- Port #0 Queue #1 (P0Q1)
>> +- Port #1 Queue #0 (P1Q0)
>> +- Port #1 Queue #1 (P1Q1)
>> +- Port #1 Queue #2 (P1Q2)
>> +
>> +The Rx queues may be assigned to the cores in the following order::
>> +
>> +Core 3: P0Q0 | P1Q1
>> +Core 7: P0Q1 | P1Q2
>> +Core 8: P1Q0 |
>> +
>>  To see the current measured usage history of PMD core cycles for each Rx
>>  queue::
>> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
>> index 7f836bb..8f004c5 100644
>> --- a/lib/dpif-netdev.c
>> +++ b/lib/dpif-netdev.c
>> @@ -342,4 +342,6 @@ struct dp_netdev {
>>  struct id_pool *tx_qid_pool;
>>  struct ovs_mutex tx_qid_pool_mutex;
>> +/* Use measured cycles for rxq to pmd assignment. */
>> +bool pmd_rxq_assign_cyc;
>>  
>>  /* Protects the access of the 'struct dp_netdev_pmd_thread'
>> @@ -1493,4 +1495,5 @@ create_dp_netdev(const char *name, const struct 
>> dpif_class *class,
>>  
>>  cmap_init(>poll_threads);
>> +dp->pmd_rxq_assign_cyc = true;
>>  
>>  ovs_mutex_init(>tx_qid_pool_mutex);
>> @@ -3717,4 +3720,6 @@ dpif_netdev_set_config(struct dpif *dpif, const struct 
>> smap *other_config)
>>  struct dp_netdev *dp = get_dp_netdev(dpif);
>>  const char *cmask = smap_get(other_config, "pmd-cpu-mask");
>> +const char *pmd_rxq_assign = smap_get_def(other_config, 
>> "pmd-rxq-assign",
>> + "cycles");
>>  unsigned long long insert_prob =
>>  smap_get_ullong(other_config, "emc-insert-inv-prob",
>> @@ 

Re: [ovs-dev] [PATCH 2/2] vswitch.xml: Fix type of dpdk-init key.

2018-08-27 Thread Stokes, Ian
> On 08/24/2018 04:18 PM, Ilya Maximets wrote:
> > This adds available modes to the man page.
> >
> > CC: Kevin Traynor 
> > Fixes: 6d947d508a51 ("vswitch.xml: Update dpdk-init documentation.")
> > Signed-off-by: Ilya Maximets 
> 
> Thanks for catching here and in roundrobin patch.
> 
> Acked-by: Kevin Traynor 

Thanks, I'll add this to today's pull request and backport to 2.10.

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


Re: [ovs-dev] [PATCH 1/2] vswitch.xml: Fix key type and description style of tc-policy.

2018-08-27 Thread Simon Horman
On Fri, Aug 24, 2018 at 06:13:19PM +0300, Ilya Maximets wrote:
> The set of supported values specified.
> Style fixed to look good in man page. Fixed indents.
> 
> CC: Paul Blakey 
> Fixes: 691d20cbdcf3 ("other-config: Add tc-policy switch to
>   control tc flower flag")
> Signed-off-by: Ilya Maximets 

Thanks,

This looks fine to me but I will wait to see if there are other reviews
before applying.

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


[ovs-dev] Regarding OVS Datapath Flow !

2018-08-27 Thread rakesh kumar
Hi Team,

I am was trying to put log in the datapath module in Linux environment to
trace the flow if we ping one host to another host using ovs switch(using
mininet emulator)..

Inside *vport.c* file *ovs_vport_send *function is being called and then
internally it calls *vport->ops->send*() function I am unable to trace from
this function , can anyone tell me *where the call will go after calling
vport->ops->send* function  inside* vport.c* file.


Please give your valuable suggestions !

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


[ovs-dev] [PATCH] dpctl: Fix memory leak in dp_exists().

2018-08-27 Thread wangyunjian
From: Yunjian Wang 

Fixes: ffdcd110fa62 ("dpctl: Make opt_dpif_open() more general.")
Signed-off-by: Yunjian Wang 
---
 lib/dpctl.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/dpctl.c b/lib/dpctl.c
index 743944d..2f8498f 100644
--- a/lib/dpctl.c
+++ b/lib/dpctl.c
@@ -202,6 +202,8 @@ dp_exists(const char *queried_dp)
 
 sset_destroy(_names);
 sset_destroy(_types);
+free(queried_name);
+free(queried_type);
 return found;
 }
 
-- 
1.8.3.1


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


Re: [ovs-dev] [PATCH v2 6/6] system-dpdk: Execute testpmd on the background

2018-08-27 Thread Ian Stokes

On 8/22/2018 2:37 PM, Aaron Conole wrote:

From: Bala Sankaran 

This adds a new test to the 'check-dpdk' subsystem that will exercise
allocations, PMDs, and the vhost-user code path.

Signed-off-by: Bala Sankaran 
Co-authored-by: Aaron Conole 
Signed-off-by: Aaron Conole 
---
  tests/system-dpdk.at | 77 
  1 file changed, 77 insertions(+)

diff --git a/tests/system-dpdk.at b/tests/system-dpdk.at
index 58dc8aaae..914a1b644 100644
--- a/tests/system-dpdk.at
+++ b/tests/system-dpdk.at
@@ -1,3 +1,6 @@
+m4_define([CONFIGURE_VETH_OFFLOADS],
+   [AT_CHECK([ethtool -K $1 tx off], [0], [ignore], [ignore])])
+
  AT_BANNER([OVS-DPDK unit tests])
  
  dnl --

@@ -74,3 +77,77 @@ OVS_VSWITCHD_STOP(["\@does not exist. The Open vSwitch 
kernel module is probably
  \@EAL: No free hugepages reported in hugepages-1048576kB@d"])
  AT_CLEANUP
  dnl --
+
+
+
+dnl --
+dnl Ping vhost-user-client port

This test uses vhost user server so above should be changed to reflect this.


+AT_SETUP([OVS-DPDK datapath - ping vhost-user-client ports])
+AT_KEYWORDS([dpdk])
+OVS_DPDK_PRE_CHECK()
+OVS_DPDK_START()
+
+dnl Add userspace bridge and attach it to OVS
+AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
+AT_CHECK([ovs-vsctl add-port br10 vhu0 -- set Interface vhu0 \


I'd like to keep the name of the vhost user interfaces uniform across 
the tests. Can we change the interface name to dpdkvhostuser0 instead of 
vhu0? This is in keeping with the existing vhost tests and the OVS DPDK 
documentation.



+  type=dpdkvhostuser], [],
+ [stdout], [stderr])
+AT_CHECK([ovs-vsctl show], [], [stdout])
+
+dnl Parse log file
+AT_CHECK([grep "VHOST_CONFIG: vhost-user server: socket created" \
+  ovs-vswitchd.log], [], [stdout])
+AT_CHECK([grep "Socket $OVS_RUNDIR/vhu0 created for vhost-user port vhu0" \
+  ovs-vswitchd.log], [], [stdout])
+AT_CHECK([grep "VHOST_CONFIG: bind to $OVS_RUNDIR/vhu0" ovs-vswitchd.log], [],
+ [stdout])
+
+dnl Set up namespaces
+ADD_NAMESPACES(ns1, ns2)
+
+dnl execute testpmd in background


To be uniform the first word after each dnl should be capitalized 
(applies to a few of the other dnl added in this test also).



+on_exit "pkill -f -x -9 'tail -f /dev/null'"
+tail -f /dev/null | testpmd --socket-mem=512 \
+   --vdev="net_virtio_user,path=$OVS_RUNDIR/vhu0" \
+   --vdev="net_tap0,iface=tap0" --file-prefix page0 \
+   --single-file-segments -- -a >$OVS_RUNDIR/testpmd-vhu0.log 2>&1 &


I have a few queries as regards running testpmd.

Is the assumption that testpmd is a recognized command?

How exactly were you testing this? I believe DPDK 18.08 is required in 
the case of testpmd but 17.11 is still linked against for OVS? Ideally 
I'd like to remove the dependency on 18.08. What issues were seen when 
using testpmd in 17.11?


Is it expected that DPDK has been installed from a repo and in a default 
location?


If it is then I think we should provision for an environmental variable 
specifying the path to testpmd also. It could be the case someone is 
building DPDK from source and the testpmd executable is elsewhere.


Ian

+
+dnl add veth device
+ADD_VETH(tap1, ns2, br10, "172.31.110.12/24")
+
+dnl give settling time to the testpmd processes - NOTE: this is bad form.
+sleep 10
+
+dnl move the tap devices to the namespaces
+AT_CHECK([ps aux | grep testpmd], [], [stdout], [stderr])
+AT_CHECK([ip link show], [], [stdout], [stderr])
+AT_CHECK([ip link set tap0 netns ns1], [], [stdout], [stderr])
+
+AT_CHECK([ip netns exec ns1 ip link show], [], [stdout], [stderr])
+AT_CHECK([ip netns exec ns1 ip link show | grep tap0], [], [stdout], [stderr])
+AT_CHECK([ip netns exec ns1 ip link set tap0 up], [], [stdout], [stderr])
+AT_CHECK([ip netns exec ns1 ip addr add 172.31.110.11/24 dev tap0], [],
+ [stdout], [stderr])
+
+AT_CHECK([ip netns exec ns1 ip link show], [], [stdout], [stderr])
+AT_CHECK([ip netns exec ns2 ip link show], [], [stdout], [stderr])
+AT_CHECK([ip netns exec ns1 arping -c 4 -I tap0 172.31.110.12], [], [stdout],
+ [stderr])
+
+dnl clean up the testpmd now
+pkill -f -x -9 'tail -f /dev/null'
+
+dnl Clean up
+AT_CHECK([ovs-vsctl del-port br10 vhu0], [], [stdout], [stderr])
+OVS_VSWITCHD_STOP(["\@does not exist. The Open vSwitch kernel module is 
probably not loaded.@d
+\@Failed to enable flow control@d
+\@VHOST_CONFIG: recvmsg failed@d
+\@VHOST_CONFIG: failed to connect to $OVS_RUNDIR/vhu0: No such file or 
directory@d
+\@Global register is changed during@d
+\@dpdkvhostuser ports are considered deprecated;  please migrate to 
dpdkvhostuserclient ports.@d
+\@failed to enumerate system datapaths: No such file or directory@d
+\@EAL:   Invalid NUMA 

Re: [ovs-dev] [PATCH v2 5/6] system-dpdk: Convert /tmp to use OVS_RUNDIR

2018-08-27 Thread Ian Stokes

On 8/22/2018 2:37 PM, Aaron Conole wrote:

From: Bala Sankaran 

When multiple users run the DPDK testsuite ther dependence on /tmp

Minor typo above 'ther' -> 'their'

Ian

will cause conflicts. Use the RUNDIR as a dynamic path to overcome
this.

NOTE: This still doesn't solve the dependency on /var/run that
DPDK requires.

Signed-off-by: Bala Sankaran 
Co-authored-by: Aaron Conole 
Signed-off-by: Aaron Conole 
---
  tests/system-dpdk.at | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/system-dpdk.at b/tests/system-dpdk.at
index 834ba06fb..58dc8aaae 100644
--- a/tests/system-dpdk.at
+++ b/tests/system-dpdk.at
@@ -54,20 +54,20 @@ OVS_DPDK_START()
  
  dnl Add userspace bridge and attach it to OVS

  AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
-AT_CHECK([ovs-vsctl add-port br10 dpdkvhostuserclient0 -- set Interface 
dpdkvhostuserclient0 type=dpdkvhostuserclient 
options:vhost-server-path=/tmp/dpdkvhostclient0], [], [stdout], [stderr])
+AT_CHECK([ovs-vsctl add-port br10 dpdkvhostuserclient0 -- set Interface 
dpdkvhostuserclient0 type=dpdkvhostuserclient 
options:vhost-server-path=$OVS_RUNDIR/dpdkvhostclient0], [], [stdout], [stderr])
  AT_CHECK([ovs-vsctl show], [], [stdout])
  sleep 2
  
  dnl Parse log file

  AT_CHECK([grep "VHOST_CONFIG: vhost-user client: socket created" 
ovs-vswitchd.log], [], [stdout])
  AT_CHECK([grep "vHost User device 'dpdkvhostuserclient0' created in 'client' mode, 
using client socket" ovs-vswitchd.log], [], [stdout])
-AT_CHECK([grep "VHOST_CONFIG: /tmp/dpdkvhostclient0: reconnecting..." 
ovs-vswitchd.log], [], [stdout])
+AT_CHECK([grep "VHOST_CONFIG: $OVS_RUNDIR/dpdkvhostclient0: reconnecting..." 
ovs-vswitchd.log], [], [stdout])
  
  dnl Clean up

  AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], 
[stderr])
  OVS_VSWITCHD_STOP(["\@does not exist. The Open vSwitch kernel module is 
probably not loaded.@d
  \@Failed to enable flow control@d
-\@VHOST_CONFIG: failed to connect to /tmp/dpdkvhostclient0: No such file or 
directory@d
+\@VHOST_CONFIG: failed to connect to $OVS_RUNDIR/dpdkvhostclient0: No such 
file or directory@d
  \@Global register is changed during@d
  \@EAL:   Invalid NUMA socket, default to 0@d
  \@EAL: WARNING: cpu flags constant_tsc=yes nonstop_tsc=no -> using unreliable 
clock cycles !@d



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


Re: [ovs-dev] [PATCH v2 3/6] system-dpdk: Allow running the dpdk tests from a VM

2018-08-27 Thread Ian Stokes

On 8/22/2018 2:37 PM, Aaron Conole wrote:

Some VM configurations result in CPU flags that cause warnings to be issued by
the DPDK libraries.  When these warnings are issued, the tests will fail.

This commit adds the unreliable tsc warning to the list of ignored warnings.


LGTM, tested and no issues found.

Ian


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


Re: [ovs-dev] [PATCH v2 4/6] system-dpdk: Use a different character marker for sed commands

2018-08-27 Thread Ian Stokes

On 8/22/2018 2:37 PM, Aaron Conole wrote:

The default marker for sed commands according to the manual is /, but this
is inconvenient when working with paths.  The solution is either to escape
all instances of / or use sed's \cREGEXc feature.


LGTM,

Ian


Signed-off-by: Aaron Conole 
---
  tests/system-dpdk.at | 14 +++---
  1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/tests/system-dpdk.at b/tests/system-dpdk.at
index 723ba794f..834ba06fb 100644
--- a/tests/system-dpdk.at
+++ b/tests/system-dpdk.at
@@ -65,12 +65,12 @@ AT_CHECK([grep "VHOST_CONFIG: /tmp/dpdkvhostclient0: 
reconnecting..." ovs-vswitc
  
  dnl Clean up

  AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], 
[stderr])
-OVS_VSWITCHD_STOP(["/does not exist. The Open vSwitch kernel module is 
probably not loaded./d
-/Failed to enable flow control/d
-/failed to connect to \/tmp\/dpdkvhostclient0: No such file or directory/d
-/Global register is changed during/d
-/EAL:   Invalid NUMA socket, default to 0/d
-/EAL: WARNING: cpu flags constant_tsc=yes nonstop_tsc=no -> using unreliable 
clock cycles !/d
-/EAL: No free hugepages reported in hugepages-1048576kB/d"])
+OVS_VSWITCHD_STOP(["\@does not exist. The Open vSwitch kernel module is 
probably not loaded.@d
+\@Failed to enable flow control@d
+\@VHOST_CONFIG: failed to connect to /tmp/dpdkvhostclient0: No such file or 
directory@d
+\@Global register is changed during@d
+\@EAL:   Invalid NUMA socket, default to 0@d
+\@EAL: WARNING: cpu flags constant_tsc=yes nonstop_tsc=no -> using unreliable 
clock cycles !@d
+\@EAL: No free hugepages reported in hugepages-1048576kB@d"])
  AT_CLEANUP
  dnl --



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


Re: [ovs-dev] [PATCH v2 2/6] system-dpdk: skip all tests if there are no hugepages

2018-08-27 Thread Ian Stokes

On 8/22/2018 2:37 PM, Aaron Conole wrote:

From: Bala Sankaran 

A failure is quite harsh in this scenario.  It's better to
simply skip all the tests and let the user look at the logs
to understand the missing hugepages.


This is ok, again however I'd like to see the expected behavior called 
out clearly to a user in the docs i.e. all tests will skip if no huge 
pages are allocated. Phy test will skip if no phy device available.


Documentation/topics/testing.rst b/Documentation/topics/testing.rst

Thanks
Ian


Signed-off-by: Bala Sankaran 
Co-authored-by: Aaron Conole 
Signed-off-by: Aaron Conole 
---
  tests/system-dpdk-macros.at | 2 +-
  tests/system-dpdk.at| 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/system-dpdk-macros.at b/tests/system-dpdk-macros.at
index 2e5571fc4..f772a1945 100644
--- a/tests/system-dpdk-macros.at
+++ b/tests/system-dpdk-macros.at
@@ -6,7 +6,7 @@
  m4_define([OVS_DPDK_PRE_CHECK],
[dnl Check Hugepages
 AT_CHECK([cat /proc/meminfo], [], [stdout])
-   AT_CHECK([grep HugePages_ stdout], [], [stdout])
+   AT_SKIP_IF([egrep 'HugePages_Free: *0' stdout], [], [stdout])
 AT_CHECK([mount], [], [stdout])
 AT_CHECK([grep 'hugetlbfs' stdout], [], [stdout], [])
  
diff --git a/tests/system-dpdk.at b/tests/system-dpdk.at

index 6901d19e6..c1c908411 100644
--- a/tests/system-dpdk.at
+++ b/tests/system-dpdk.at
@@ -47,7 +47,7 @@ dnl 
--
  dnl Add vhost-user-client port
  AT_SETUP([OVS-DPDK datapath - add vhost-user-client port])
  AT_KEYWORDS([dpdk])
-
+OVS_DPDK_PRE_CHECK()
  OVS_DPDK_START()
  
  dnl Add userspace bridge and attach it to OVS




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


Re: [ovs-dev] [PATCH v2 1/6] system-dpdk: update test suite for non-phy testing

2018-08-27 Thread Ian Stokes

On 8/22/2018 2:37 PM, Aaron Conole wrote:

This allows a system that doesn't have a dedicated DPDK nic to
execute some DPDK tests.  In this fashion, tests that operate on
virtual ports (such as dpdkvhostuserclient) can be executed in
a wider set of environments.


Overall I think this approach is fine, however the DPDK testing 
documentation should also be updated in this patch to flag that a NIC is 
no longer required.


Documentation/topics/testing.rst b/Documentation/topics/testing.rst

Ian


Signed-off-by: Aaron Conole 
---
  tests/system-dpdk-macros.at | 18 +++---
  tests/system-dpdk.at| 16 
  2 files changed, 23 insertions(+), 11 deletions(-)

diff --git a/tests/system-dpdk-macros.at b/tests/system-dpdk-macros.at
index 0762ee055..2e5571fc4 100644
--- a/tests/system-dpdk-macros.at
+++ b/tests/system-dpdk-macros.at
@@ -2,7 +2,6 @@
  #
  # Check prerequisites for DPDK tests. Following settings are checked:
  #  - Hugepages
-#  - UIO driver
  #
  m4_define([OVS_DPDK_PRE_CHECK],
[dnl Check Hugepages
@@ -11,13 +10,26 @@ m4_define([OVS_DPDK_PRE_CHECK],
 AT_CHECK([mount], [], [stdout])
 AT_CHECK([grep 'hugetlbfs' stdout], [], [stdout], [])
  
+])

+
+
+# OVS_DPDK_PRE_PHY_SKIP()
+#
+# Skip any phy related tests if the PHY variable is not set.
+# This is done by checking for a bound driver.
+#
+m4_define([OVS_DPDK_PRE_PHY_SKIP],
+  [dnl Perform the precheck
+   OVS_DPDK_PRE_CHECK()
+
 dnl Check if VFIO or UIO driver is loaded
-   AT_CHECK([lsmod | grep -E "igb_uio|vfio"], [], [stdout])
+   AT_SKIP_IF([ ! (lsmod | grep -E "igb_uio|vfio") ], [], [stdout])
  
 dnl Find PCI address candidate, skip if there is no DPDK-compatible NIC

 AT_CHECK([$DPDK_DIR/usertools/dpdk-devbind.py -s | head -n +4 | tail -1], 
[], [stdout])
 AT_CHECK([cat stdout | cut -d" " -s -f1 > PCI_ADDR])
-   AT_CHECK([test -s PCI_ADDR || exit 77])
+   AT_SKIP_IF([ ! test -s PCI_ADDR ])
+
  ])
  
  
diff --git a/tests/system-dpdk.at b/tests/system-dpdk.at

index 3d21b0136..6901d19e6 100644
--- a/tests/system-dpdk.at
+++ b/tests/system-dpdk.at
@@ -4,14 +4,14 @@ dnl 
--
  dnl Check if EAL init is successfull
  AT_SETUP([OVS-DPDK datapath - EAL init])
  AT_KEYWORDS([dpdk])
-dnl OVS_DPDK_PRE_CHECK()
+OVS_DPDK_PRE_CHECK()
  OVS_DPDK_START()
  AT_CHECK([grep "DPDK Enabled - initializing..." ovs-vswitchd.log], [], 
[stdout])
  AT_CHECK([grep "EAL" ovs-vswitchd.log], [], [stdout])
  AT_CHECK([grep "DPDK Enabled - initialized" ovs-vswitchd.log], [], [stdout])
-OVS_VSWITCHD_STOP("/Global register is changed during/d
-/EAL: No free hugepages reported in hugepages-1048576kB/d
-")
+OVS_VSWITCHD_STOP(["/Global register is changed during/d
+/EAL:   Invalid NUMA socket, default to 0/d
+/EAL: No free hugepages reported in hugepages-1048576kB/d"])
  AT_CLEANUP
  dnl --
  
@@ -22,7 +22,7 @@ dnl Add standard DPDK PHY port

  AT_SETUP([OVS-DPDK datapath - add standard DPDK port])
  AT_KEYWORDS([dpdk])
  
-OVS_DPDK_PRE_CHECK()

+OVS_DPDK_PRE_PHY_SKIP()
  OVS_DPDK_START()
  
  dnl Add userspace bridge and attach it to OVS

@@ -63,11 +63,11 @@ AT_CHECK([grep "VHOST_CONFIG: /tmp/dpdkvhostclient0: 
reconnecting..." ovs-vswitc
  
  dnl Clean up

  AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], 
[stderr])
-OVS_VSWITCHD_STOP("/does not exist. The Open vSwitch kernel module is probably 
not loaded./d
+OVS_VSWITCHD_STOP(["/does not exist. The Open vSwitch kernel module is 
probably not loaded./d
  /Failed to enable flow control/d
  /failed to connect to \/tmp\/dpdkvhostclient0: No such file or directory/d
  /Global register is changed during/d
-/EAL: No free hugepages reported in hugepages-1048576kB/d
-")
+/EAL:   Invalid NUMA socket, default to 0/d
+/EAL: No free hugepages reported in hugepages-1048576kB/d"])
  AT_CLEANUP
  dnl --



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


Re: [ovs-dev] OVN/OVS split: OVN mailing list?

2018-08-27 Thread Lucas Alvares Gomes
Hi,

Is there any progress on this ?

Cheers,
Lucas

On Mon, Aug 13, 2018 at 1:43 PM Miguel Angel Ajo Pelayo
 wrote:
>
> +1 on my side too :) Thank you for bringing up the topic
>
> On Mon, Aug 13, 2018 at 2:03 PM Daniel Alvarez Sanchez  
> wrote:
>>
>> +1 for the split of the ML
>>
>> On Mon, Aug 13, 2018 at 11:17 AM Lucas Alvares Gomes 
>> wrote:
>>
>> > Hi,
>> >
>> > > Before starting in-depth technical discussions on this list or the
>> > > ovs-dev list, I'm curious if people would be interested in splitting off
>> > > a separate OVN list for this and future OVN-related discussions? I can
>> > > see merits of keeping discussions on this list and of starting a new
>> > > one, so I'm interested in what others think about the matter.
>> > >
>> >
>> > As someone that relies on filters to get the OVN related
>> > changes/discussions from the current ML I can definitely see the
>> > benefits of creating a separated list for OVN. Also, since the code
>> > split is on it's way and OVN will become a project own its own this
>> > sounds like a natural first step to be taken towards that goal.
>> >
>> > Cheers,
>> > Lucas
>> > ___
>> > 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
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v3 2/2] NEWS: Add entry for pmd-rxq-assign.

2018-08-27 Thread Eelco Chaudron
Acked-by: Eelco Chaudron 

On 25 Aug 2018, at 12:00, Kevin Traynor wrote:

> Signed-off-by: Kevin Traynor 
> ---
>  NEWS | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/NEWS b/NEWS
> index 33b4d8a..33b3638 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -9,5 +9,7 @@ Post-v2.10.0
> - ovn:
>   * ovn-ctl: allow passing user:group ids to the OVN daemons.
> -
> +   - DPDK:
> + * Add option for simple round-robin based Rxq to PMD assignment.
> +   It can be set with pmd-rxq-assign.
>
>  v2.10.0 - xx xxx 
> -- 
> 1.8.3.1
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v3 1/2] dpif-netdev: Add round-robin based rxq to pmd assignment.

2018-08-27 Thread Eelco Chaudron




On 25 Aug 2018, at 12:00, Kevin Traynor wrote:


Prior to OVS 2.9 automatic assignment of Rxqs to PMDs
(i.e. CPUs) was done by round-robin.

That was changed in OVS 2.9 to ordering the Rxqs based on
their measured processing cycles. This was to assign the
busiest Rxqs to different PMDs, improving aggregate
throughput.

For the most part the new scheme should be better, but
there could be situations where a user prefers a simple
round-robin scheme because Rxqs from a single port are
more likely to be spread across multiple PMDs, and/or
traffic is very bursty/unpredictable.

Add 'pmd-rxq-assign' config to allow a user to select
round-robin based assignment.

Signed-off-by: Kevin Traynor 
Acked-by: Eelco Chaudron 


Reviewed v3 changes, and looks fine to me

Acked-by: Eelco Chaudron 

---

V3:
- Rolled in some style and vswitch.xml changes (Ilya)
- Set cycles mode by default on wrong config (Ilya)

V2:
- simplified nextpmd change (Eelco)
- removed confusing doc sentence (Eelco)
- fixed commit msg (Ilya)
- made change in pmd-rxq-assign value also perform re-assignment 
(Ilya)

- renamed to roundrobin mode (Ilya)
- moved vswitch.xml changes to right config section (Ilya)
- comment/log updates
- moved NEWS update to separate patch as it's been changing on master

 Documentation/topics/dpdk/pmd.rst | 33 +---
 lib/dpif-netdev.c | 83 
+--

 tests/pmd.at  | 12 +-
 vswitchd/vswitch.xml  | 24 +++
 4 files changed, 123 insertions(+), 29 deletions(-)

diff --git a/Documentation/topics/dpdk/pmd.rst 
b/Documentation/topics/dpdk/pmd.rst

index 5f0671e..dd9172d 100644
--- a/Documentation/topics/dpdk/pmd.rst
+++ b/Documentation/topics/dpdk/pmd.rst
@@ -113,10 +113,15 @@ means that this thread will only poll the 
*pinned* Rx queues.


 If ``pmd-rxq-affinity`` is not set for Rx queues, they will be 
assigned to PMDs
-(cores) automatically. Where known, the processing cycles that have 
been stored
-for each Rx queue will be used to assign Rx queue to PMDs based on a 
round
-robin of the sorted Rx queues. For example, take the following 
example, where
-there are five Rx queues and three cores - 3, 7, and 8 - available 
and the
-measured usage of core cycles per Rx queue over the last interval is 
seen to

-be:
+(cores) automatically.
+
+The algorithm used to automatically assign Rxqs to PMDs can be set 
by::

+
+$ ovs-vsctl set Open_vSwitch . 
other_config:pmd-rxq-assign=

+
+By default, ``cycles`` assignment is used where the Rxqs will be 
ordered by
+their measured processing cycles, and then be evenly assigned in 
descending
+order to PMDs based on an up/down walk of the PMDs. For example, 
where there
+are five Rx queues and three cores - 3, 7, and 8 - available and the 
measured
+usage of core cycles per Rx queue over the last interval is seen to 
be:


 - Queue #0: 30%
@@ -132,4 +137,20 @@ The Rx queues will be assigned to the cores in 
the following order::

 Core 8: Q3 (60%) | Q0 (30%)

+Alternatively, ``roundrobin`` assignment can be used, where the Rxqs 
are
+assigned to PMDs in a round-robined fashion. This algorithm was used 
by
+default prior to OVS 2.9. For example, given the following ports and 
queues:

+
+- Port #0 Queue #0 (P0Q0)
+- Port #0 Queue #1 (P0Q1)
+- Port #1 Queue #0 (P1Q0)
+- Port #1 Queue #1 (P1Q1)
+- Port #1 Queue #2 (P1Q2)
+
+The Rx queues may be assigned to the cores in the following order::
+
+Core 3: P0Q0 | P1Q1
+Core 7: P0Q1 | P1Q2
+Core 8: P1Q0 |
+
 To see the current measured usage history of PMD core cycles for each 
Rx

 queue::
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 7f836bb..8f004c5 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -342,4 +342,6 @@ struct dp_netdev {
 struct id_pool *tx_qid_pool;
 struct ovs_mutex tx_qid_pool_mutex;
+/* Use measured cycles for rxq to pmd assignment. */
+bool pmd_rxq_assign_cyc;

 /* Protects the access of the 'struct dp_netdev_pmd_thread'
@@ -1493,4 +1495,5 @@ create_dp_netdev(const char *name, const struct 
dpif_class *class,


 cmap_init(>poll_threads);
+dp->pmd_rxq_assign_cyc = true;

 ovs_mutex_init(>tx_qid_pool_mutex);
@@ -3717,4 +3720,6 @@ dpif_netdev_set_config(struct dpif *dpif, const 
struct smap *other_config)

 struct dp_netdev *dp = get_dp_netdev(dpif);
 const char *cmask = smap_get(other_config, "pmd-cpu-mask");
+const char *pmd_rxq_assign = smap_get_def(other_config, 
"pmd-rxq-assign",

+ "cycles");
 unsigned long long insert_prob =
 smap_get_ullong(other_config, "emc-insert-inv-prob",
@@ -3779,4 +3784,18 @@ dpif_netdev_set_config(struct dpif *dpif, const 
struct smap *other_config)

 }
 }
+
+bool pmd_rxq_assign_cyc = !strcmp(pmd_rxq_assign, "cycles");
+if (!pmd_rxq_assign_cyc && strcmp(pmd_rxq_assign, "roundrobin")) 
{

+VLOG_WARN("Unsupported Rxq to PMD