Re: [ovs-dev] [PATCH v3 1/3] dpif-netdev: Incremental addition/deletion of PMD threads.

2017-07-06 Thread Ilya Maximets
On 07.07.2017 07:33, Darrell Ball wrote:
> 
> 
> On 6/15/17, 4:36 AM, "Ilya Maximets"  wrote:
> 
> Currently, change of 'pmd-cpu-mask' is very heavy operation.
> It requires destroying of all the PMD threads and creating
> them back. After that, all the threads will sleep until
> ports' redistribution finished.
> 
> This patch adds ability to not stop the datapath while
> adjusting number/placement of PMD threads. All not affected
> threads will forward traffic without any additional latencies.
> 
> id-pool created for static tx queue ids to keep them sequential
> in a flexible way. non-PMD thread will always have
> static_tx_qid = 0 as it was before.
> 
> Signed-off-by: Ilya Maximets 
> Tested-by: Mark Kavanagh 
> Acked-by: Mark Kavanagh 
> ---
>  lib/dpif-netdev.c | 146 
> +++---
>  tests/pmd.at  |   2 +-
>  2 files changed, 108 insertions(+), 40 deletions(-)
> 
> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
> index 2f224db..c0bcca0 100644
> --- a/lib/dpif-netdev.c
> +++ b/lib/dpif-netdev.c
> @@ -48,6 +48,7 @@
>  #include "fat-rwlock.h"
>  #include "flow.h"
>  #include "hmapx.h"
> +#include "id-pool.h"
>  #include "latch.h"
>  #include "netdev.h"
>  #include "netdev-vport.h"
> @@ -278,6 +279,9 @@ struct dp_netdev {
>  
>  /* Stores all 'struct dp_netdev_pmd_thread's. */
>  struct cmap poll_threads;
> +/* id pool for per thread static_tx_qid. */
> +struct id_pool *tx_qid_pool;
> +struct ovs_mutex tx_qid_pool_mutex;
>  
>  /* Protects the access of the 'struct dp_netdev_pmd_thread'
>   * instance for non-pmd thread. */
> @@ -563,7 +567,7 @@ struct dp_netdev_pmd_thread {
>  /* Queue id used by this pmd thread to send packets on all netdevs if
>   * XPS disabled for this netdev. All static_tx_qid's are unique and 
> less
>   * than 'cmap_count(dp->poll_threads)'. */
> -const int static_tx_qid;
> +uint32_t static_tx_qid;
>  
>  struct ovs_mutex port_mutex;/* Mutex for 'poll_list' and 
> 'tx_ports'. */
>  /* List of rx queues to poll. */
> @@ -643,6 +647,8 @@ static struct dp_netdev_pmd_thread 
> *dp_netdev_get_pmd(struct dp_netdev *dp,
>unsigned core_id);
>  static struct dp_netdev_pmd_thread *
>  dp_netdev_pmd_get_next(struct dp_netdev *dp, struct cmap_position *pos);
> +static void dp_netdev_del_pmd(struct dp_netdev *dp,
> +  struct dp_netdev_pmd_thread *pmd);
>  static void dp_netdev_destroy_all_pmds(struct dp_netdev *dp, bool 
> non_pmd);
>  static void dp_netdev_pmd_clear_ports(struct dp_netdev_pmd_thread *pmd);
>  static void dp_netdev_add_port_tx_to_pmd(struct dp_netdev_pmd_thread 
> *pmd,
> @@ -1182,10 +1188,17 @@ create_dp_netdev(const char *name, const struct 
> dpif_class *class,
>  atomic_init(>emc_insert_min, DEFAULT_EM_FLOW_INSERT_MIN);
>  
>  cmap_init(>poll_threads);
> +
> +ovs_mutex_init(>tx_qid_pool_mutex);
> +/* We need 1 Tx queue for each possible core + 1 for non-PMD 
> threads. */
> +dp->tx_qid_pool = id_pool_create(0, ovs_numa_get_n_cores() + 1);
> +
>  ovs_mutex_init_recursive(>non_pmd_mutex);
>  ovsthread_key_create(>per_pmd_key, NULL);
>  
>  ovs_mutex_lock(>port_mutex);
> +/* non-PMD will be created before all other threads and will
> + * allocate static_tx_qid = 0. */
>  dp_netdev_set_nonpmd(dp);
>  
>  error = do_add_port(dp, name, dpif_netdev_port_open_type(dp->class,
> @@ -1280,6 +1293,9 @@ dp_netdev_free(struct dp_netdev *dp)
>  dp_netdev_destroy_all_pmds(dp, true);
>  cmap_destroy(>poll_threads);
>  
> +ovs_mutex_destroy(>tx_qid_pool_mutex);
> +id_pool_destroy(dp->tx_qid_pool);
> +
>  ovs_mutex_destroy(>non_pmd_mutex);
>  ovsthread_key_delete(dp->per_pmd_key);
>  
> @@ -3296,12 +3312,29 @@ rxq_scheduling(struct dp_netdev *dp, bool pinned) 
> OVS_REQUIRES(dp->port_mutex)
>  }
>  
>  static void
> +reload_affected_pmds(struct dp_netdev *dp)
> +{
> +struct dp_netdev_pmd_thread *pmd;
> +
> +CMAP_FOR_EACH (pmd, node, >poll_threads) {
> +if (pmd->need_reload) {
> +dp_netdev_reload_pmd__(pmd);
> +pmd->need_reload = false;
> +}
> +}
> +}
> +
> +static void
>  reconfigure_pmd_threads(struct dp_netdev *dp)
>  OVS_REQUIRES(dp->port_mutex)
>  {
>  struct dp_netdev_pmd_thread *pmd;
>  struct ovs_numa_dump *pmd_cores;
>

Re: [ovs-dev] [PATCH v3 3/3] dpif-netdev: Don't uninit emc on reload.

2017-07-06 Thread Darrell Ball
This should provide benefit in the common case.

On 6/15/17, 4:36 AM, "Ilya Maximets"  wrote:

There are many reasons for reloading of pmd threads:
* reconfiguration of one of the ports.
* Adjusting of static_tx_qid.
* Adding new tx/rx ports.

In many cases EMC is still useful after reload and uninit
will only lead to unnecessary upcalls/classifier lookups.

Such behaviour slows down the datapath. Uninit itself slows
down the reload path. All this factors leads to additional
unexpected latencies/drops on events not directly connected
to current PMD thread.

Lets not uninitialize emc cache on reload path.
'emc_cache_slow_sweep()' and replacements should free all
the old/unwanted entries.

Signed-off-by: Ilya Maximets 
Acked-by: Cian Ferriter 
Tested-by: Cian Ferriter 
---
 lib/dpif-netdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index d2443da..e7ab306 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -3794,9 +3794,9 @@ pmd_thread_main(void *f_)
 ovs_numa_thread_setaffinity_core(pmd->core_id);
 dpdk_set_lcore_id(pmd->core_id);
 poll_cnt = pmd_load_queues_and_ports(pmd, _list);
+emc_cache_init(>flow_cache);
 reload:
 pmd_alloc_static_tx_qid(pmd);
-emc_cache_init(>flow_cache);
 
 /* List port/core affinity */
 for (i = 0; i < poll_cnt; i++) {
@@ -3843,13 +3843,13 @@ reload:
  * reloading the updated configuration. */
 dp_netdev_pmd_reload_done(pmd);
 
-emc_cache_uninit(>flow_cache);
 pmd_free_static_tx_qid(pmd);
 
 if (!exiting) {
 goto reload;
 }
 
+emc_cache_uninit(>flow_cache);
 free(poll_list);
 pmd_free_cached_ports(pmd);
 return NULL;
-- 
2.7.4



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


Re: [ovs-dev] [PATCH v2 2/3] dpif-netdev: Avoid port's reconfiguration on pmd-cpu-mask changes.

2017-07-06 Thread Darrell Ball


On 5/30/17, 7:12 AM, "Ilya Maximets"  wrote:

Reconfiguration of HW NICs may lead to packet drops.
In current model all physical ports will be reconfigured each
time number of PMD threads changed. Since we not stopping
threads on pmd-cpu-mask changes, this patch will help to further
decrease port's downtime by setting the maximum possible number
of wanted tx queues to avoid unnecessary reconfigurations.

Signed-off-by: Ilya Maximets 
---
 lib/dpif-netdev.c | 26 +-
 1 file changed, 21 insertions(+), 5 deletions(-)

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 596d133..79db770 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -3453,7 +3453,7 @@ reconfigure_datapath(struct dp_netdev *dp)
 {
 struct dp_netdev_pmd_thread *pmd;
 struct dp_netdev_port *port;
-int wanted_txqs;
+int needed_txqs, wanted_txqs;
 
 dp->last_reconfigure_seq = seq_read(dp->reconfigure_seq);
 
@@ -3461,7 +3461,15 @@ reconfigure_datapath(struct dp_netdev *dp)
  * on the system and the user configuration. */
 reconfigure_pmd_threads(dp);
 
-wanted_txqs = cmap_count(>poll_threads);
+/* We need 1 Tx queue for each thread to avoid locking, but we will try
+ * to allocate the maximum possible value to minimize the number of 
port
+ * reconfigurations. */
+needed_txqs = cmap_count(>poll_threads);
+/* (n_cores + 1) is the maximum that we might need to have.
+ * Additional queue is for non-PMD threads. */
+wanted_txqs = ovs_numa_get_n_cores();
+ovs_assert(wanted_txqs != OVS_CORE_UNSPEC);
+wanted_txqs++;

I don’t think PMD mask changes are common, so this patch is trying to optimize 
a 
rare disruptive event that can/will be scheduled by the administrator.

Based on the actual number of queues supported and the number of cores present,
this optimization may or may not work. It is unpredictable whether there will 
be benefit
in a particular case from the user POV.
If I were the administrator, I would try to error on the conservative side 
anyways if I could
not predict the result.

Did I miss something ?

 /* The number of pmd threads might have changed, or a port can be new:
  * adjust the txqs. */
@@ -3474,9 +3482,17 @@ reconfigure_datapath(struct dp_netdev *dp)
 
 /* Check for all the ports that need reconfiguration.  We cache this in
  * 'port->reconfigure', because netdev_is_reconf_required() can change 
at
- * any time. */
+ * any time.
+ * Also mark for reconfiguration all ports which will likely change 
their
+ * 'dynamic_txqs' parameter. It's required to stop using them before
+ * changing this setting and it's simpler to mark ports here and allow
+ * 'pmd_remove_stale_ports' to remove them from threads. There will be
+ * no actual reconfiguration in 'port_reconfigure' because it's
+ * unnecessary.  */
 HMAP_FOR_EACH (port, node, >ports) {
-if (netdev_is_reconf_required(port->netdev)) {
+if (netdev_is_reconf_required(port->netdev)
+|| (port->dynamic_txqs
+!=  netdev_n_txq(port->netdev) < needed_txqs)) {
 port->need_reconfigure = true;
 }
 }
@@ -3510,7 +3526,7 @@ reconfigure_datapath(struct dp_netdev *dp)
 seq_change(dp->port_seq);
 port_destroy(port);
 } else {
-port->dynamic_txqs = netdev_n_txq(port->netdev) < wanted_txqs;
+port->dynamic_txqs = netdev_n_txq(port->netdev) < needed_txqs;
 }
 }
 
-- 
2.7.4



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


Re: [ovs-dev] [PATCH v3 1/3] dpif-netdev: Incremental addition/deletion of PMD threads.

2017-07-06 Thread Darrell Ball


On 6/15/17, 4:36 AM, "Ilya Maximets"  wrote:

Currently, change of 'pmd-cpu-mask' is very heavy operation.
It requires destroying of all the PMD threads and creating
them back. After that, all the threads will sleep until
ports' redistribution finished.

This patch adds ability to not stop the datapath while
adjusting number/placement of PMD threads. All not affected
threads will forward traffic without any additional latencies.

id-pool created for static tx queue ids to keep them sequential
in a flexible way. non-PMD thread will always have
static_tx_qid = 0 as it was before.

Signed-off-by: Ilya Maximets 
Tested-by: Mark Kavanagh 
Acked-by: Mark Kavanagh 
---
 lib/dpif-netdev.c | 146 
+++---
 tests/pmd.at  |   2 +-
 2 files changed, 108 insertions(+), 40 deletions(-)

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 2f224db..c0bcca0 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -48,6 +48,7 @@
 #include "fat-rwlock.h"
 #include "flow.h"
 #include "hmapx.h"
+#include "id-pool.h"
 #include "latch.h"
 #include "netdev.h"
 #include "netdev-vport.h"
@@ -278,6 +279,9 @@ struct dp_netdev {
 
 /* Stores all 'struct dp_netdev_pmd_thread's. */
 struct cmap poll_threads;
+/* id pool for per thread static_tx_qid. */
+struct id_pool *tx_qid_pool;
+struct ovs_mutex tx_qid_pool_mutex;
 
 /* Protects the access of the 'struct dp_netdev_pmd_thread'
  * instance for non-pmd thread. */
@@ -563,7 +567,7 @@ struct dp_netdev_pmd_thread {
 /* Queue id used by this pmd thread to send packets on all netdevs if
  * XPS disabled for this netdev. All static_tx_qid's are unique and 
less
  * than 'cmap_count(dp->poll_threads)'. */
-const int static_tx_qid;
+uint32_t static_tx_qid;
 
 struct ovs_mutex port_mutex;/* Mutex for 'poll_list' and 
'tx_ports'. */
 /* List of rx queues to poll. */
@@ -643,6 +647,8 @@ static struct dp_netdev_pmd_thread 
*dp_netdev_get_pmd(struct dp_netdev *dp,
   unsigned core_id);
 static struct dp_netdev_pmd_thread *
 dp_netdev_pmd_get_next(struct dp_netdev *dp, struct cmap_position *pos);
+static void dp_netdev_del_pmd(struct dp_netdev *dp,
+  struct dp_netdev_pmd_thread *pmd);
 static void dp_netdev_destroy_all_pmds(struct dp_netdev *dp, bool non_pmd);
 static void dp_netdev_pmd_clear_ports(struct dp_netdev_pmd_thread *pmd);
 static void dp_netdev_add_port_tx_to_pmd(struct dp_netdev_pmd_thread *pmd,
@@ -1182,10 +1188,17 @@ create_dp_netdev(const char *name, const struct 
dpif_class *class,
 atomic_init(>emc_insert_min, DEFAULT_EM_FLOW_INSERT_MIN);
 
 cmap_init(>poll_threads);
+
+ovs_mutex_init(>tx_qid_pool_mutex);
+/* We need 1 Tx queue for each possible core + 1 for non-PMD threads. 
*/
+dp->tx_qid_pool = id_pool_create(0, ovs_numa_get_n_cores() + 1);
+
 ovs_mutex_init_recursive(>non_pmd_mutex);
 ovsthread_key_create(>per_pmd_key, NULL);
 
 ovs_mutex_lock(>port_mutex);
+/* non-PMD will be created before all other threads and will
+ * allocate static_tx_qid = 0. */
 dp_netdev_set_nonpmd(dp);
 
 error = do_add_port(dp, name, dpif_netdev_port_open_type(dp->class,
@@ -1280,6 +1293,9 @@ dp_netdev_free(struct dp_netdev *dp)
 dp_netdev_destroy_all_pmds(dp, true);
 cmap_destroy(>poll_threads);
 
+ovs_mutex_destroy(>tx_qid_pool_mutex);
+id_pool_destroy(dp->tx_qid_pool);
+
 ovs_mutex_destroy(>non_pmd_mutex);
 ovsthread_key_delete(dp->per_pmd_key);
 
@@ -3296,12 +3312,29 @@ rxq_scheduling(struct dp_netdev *dp, bool pinned) 
OVS_REQUIRES(dp->port_mutex)
 }
 
 static void
+reload_affected_pmds(struct dp_netdev *dp)
+{
+struct dp_netdev_pmd_thread *pmd;
+
+CMAP_FOR_EACH (pmd, node, >poll_threads) {
+if (pmd->need_reload) {
+dp_netdev_reload_pmd__(pmd);
+pmd->need_reload = false;
+}
+}
+}
+
+static void
 reconfigure_pmd_threads(struct dp_netdev *dp)
 OVS_REQUIRES(dp->port_mutex)
 {
 struct dp_netdev_pmd_thread *pmd;
 struct ovs_numa_dump *pmd_cores;
+struct ovs_numa_info_core *core;
+struct hmapx to_delete = HMAPX_INITIALIZER(_delete);
+struct hmapx_node *node;
 bool changed = false;
+bool need_to_adjust_static_tx_qids = false;
 
 /* The pmd threads should be started only if there's a pmd 

Re: [ovs-dev] 答复: 答复: 答复: [PATCH] pkt reassemble: fix kernel panic for ovs reassemble

2017-07-06 Thread 王志克
Hi Greg,

Any progress?

Thanks.

Br,
Wang Zhike

-Original Message-
From: Greg Rose [mailto:gvrose8...@gmail.com] 
Sent: Friday, June 30, 2017 1:23 AM
To: 王志克
Cc: d...@openvswitch.org; Joe Stringer
Subject: Re: 答复: [ovs-dev] 答复: 答复: [PATCH] pkt reassemble: fix kernel panic for 
ovs reassemble

On 06/28/2017 05:53 PM, 王志克 wrote:
> Hi Greg,
> 
> I just download offical tar bar:
> wget http://openvswitch.org/releases/openvswitch-2.6.0.tar.gz
> 
> Then compiling as below: ( I do not see any compiling issue)
> 
> ./configure --with-linux=/lib/modules/$(uname -r)/build
> make
> make install
> make modules_install
> 
> Br,
> Wang Zhike

Weird... below is what I get at the compile phase when I follow the same steps. 
 Let me
try a completely fresh installation of Centos 7.2 on a new VM.  Perhaps 
something has muddled
the build environments for the VM I'm using.

I'll try that and see if I can get something going.

Thanks,

- Greg

In file included from include/net/inet_sock.h:24:0,
  from include/net/ip.h:30,
  from 
/home/gvrose/prj/openvswitch-2.6.0/datapath/linux/compat/include/net/ip.h:4,
  from 
/home/gvrose/prj/openvswitch-2.6.0/datapath/linux/compat/include/linux/netfilter_ipv6.h:7,
  from 
/home/gvrose/prj/openvswitch-2.6.0/datapath/linux/actions.c:25:
/home/gvrose/prj/openvswitch-2.6.0/datapath/linux/compat/include/linux/netdevice.h:125:34:
 error: conflicting types for 
‘netdev_notifier_info_to_dev’
  static inline struct net_device *netdev_notifier_info_to_dev(void *info)
   ^
In file included from 
/home/gvrose/prj/openvswitch-2.6.0/datapath/linux/compat/include/linux/netdevice.h:4:0,
  from include/net/inet_sock.h:24,
  from include/net/ip.h:30,
  from 
/home/gvrose/prj/openvswitch-2.6.0/datapath/linux/compat/include/net/ip.h:4,
  from 
/home/gvrose/prj/openvswitch-2.6.0/datapath/linux/compat/include/linux/netfilter_ipv6.h:7,
  from 
/home/gvrose/prj/openvswitch-2.6.0/datapath/linux/actions.c:25:
include/linux/netdevice.h:2257:1: note: previous definition of 
‘netdev_notifier_info_to_dev’ was here
  netdev_notifier_info_to_dev(const struct netdev_notifier_info *info)
  ^
In file included from include/uapi/linux/if_arp.h:26:0,
  from include/linux/if_arp.h:27,
  from 
/home/gvrose/prj/openvswitch-2.6.0/datapath/linux/datapath.c:23:
/home/gvrose/prj/openvswitch-2.6.0/datapath/linux/compat/include/linux/netdevice.h:125:34:
 error: conflicting types for 
‘netdev_notifier_info_to_dev’
  static inline struct net_device *netdev_notifier_info_to_dev(void *info)
   ^
In file included from 
/home/gvrose/prj/openvswitch-2.6.0/datapath/linux/compat/include/linux/netdevice.h:4:0,
  from include/uapi/linux/if_arp.h:26,
  from include/linux/if_arp.h:27,
  from 
/home/gvrose/prj/openvswitch-2.6.0/datapath/linux/datapath.c:23:
include/linux/netdevice.h:2257:1: note: previous definition of 
‘netdev_notifier_info_to_dev’ was here
  netdev_notifier_info_to_dev(const struct netdev_notifier_info *info)
  ^
In file included from 
/home/gvrose/prj/openvswitch-2.6.0/datapath/linux/dp_notify.c:19:0:
/home/gvrose/prj/openvswitch-2.6.0/datapath/linux/compat/include/linux/netdevice.h:125:34:
 error: conflicting types for 
‘netdev_notifier_info_to_dev’
  static inline struct net_device *netdev_notifier_info_to_dev(void *info)
   ^
In file included from 
/home/gvrose/prj/openvswitch-2.6.0/datapath/linux/compat/include/linux/netdevice.h:4:0,
  from 
/home/gvrose/prj/openvswitch-2.6.0/datapath/linux/dp_notify.c:19:
include/linux/netdevice.h:2257:1: note: previous definition of 
‘netdev_notifier_info_to_dev’ was here
  netdev_notifier_info_to_dev(const struct netdev_notifier_info *info)
  ^
In file included from include/net/sock.h:51:0,
  from 
/home/gvrose/prj/openvswitch-2.6.0/datapath/linux/compat/include/net/sock.h:4,
  from include/linux/tcp.h:23,
  from 
/home/gvrose/prj/openvswitch-2.6.0/datapath/linux/conntrack.c:21:
/home/gvrose/prj/openvswitch-2.6.0/datapath/linux/compat/include/linux/netdevice.h:125:34:
 error: conflicting types for 
‘netdev_notifier_info_to_dev’
  static inline struct net_device *netdev_notifier_info_to_dev(void *info)
   ^
In file included from 
/home/gvrose/prj/openvswitch-2.6.0/datapath/linux/compat/include/linux/netdevice.h:4:0,
  from include/net/sock.h:51,
  from 
/home/gvrose/prj/openvswitch-2.6.0/datapath/linux/compat/include/net/sock.h:4,
  from include/linux/tcp.h:23,
  from 
/home/gvrose/prj/openvswitch-2.6.0/datapath/linux/conntrack.c:21:
include/linux/netdevice.h:2257:1: note: previous definition of 

[ovs-dev] [PATCH] datapath: enable VxLAN-gpe port creation in compat mode

2017-07-06 Thread Yi Yang
In compat mode, ovs can't create L3 VxLAN-gpe port in old
kernels if port creation failed by rtnetlink, this patch
enables old kernels to create L3 VxLAN-gpe port.

Signed-off-by: Yi Yang 
---
 datapath/vport-vxlan.c | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/datapath/vport-vxlan.c b/datapath/vport-vxlan.c
index 7beaf6e..fbde91f 100644
--- a/datapath/vport-vxlan.c
+++ b/datapath/vport-vxlan.c
@@ -52,6 +52,18 @@ static int vxlan_get_options(const struct vport *vport, 
struct sk_buff *skb)
return -EMSGSIZE;
 
nla_nest_end(skb, exts);
+   } else if (vxlan->flags & VXLAN_F_GPE) {
+   struct nlattr *exts;
+
+   exts = nla_nest_start(skb, OVS_TUNNEL_ATTR_EXTENSION);
+   if (!exts)
+   return -EMSGSIZE;
+
+   if (vxlan->flags & VXLAN_F_GPE &&
+   nla_put_flag(skb, OVS_VXLAN_EXT_GPE))
+   return -EMSGSIZE;
+
+   nla_nest_end(skb, exts);
}
 
return 0;
@@ -59,6 +71,7 @@ static int vxlan_get_options(const struct vport *vport, 
struct sk_buff *skb)
 
 static const struct nla_policy exts_policy[OVS_VXLAN_EXT_MAX + 1] = {
[OVS_VXLAN_EXT_GBP] = { .type = NLA_FLAG, },
+   [OVS_VXLAN_EXT_GPE] = { .type = NLA_FLAG, },
 };
 
 static int vxlan_configure_exts(struct vport *vport, struct nlattr *attr,
@@ -77,6 +90,8 @@ static int vxlan_configure_exts(struct vport *vport, struct 
nlattr *attr,
 
if (exts[OVS_VXLAN_EXT_GBP])
conf->flags |= VXLAN_F_GBP;
+   else if (exts[OVS_VXLAN_EXT_GPE])
+   conf->flags |= VXLAN_F_GPE;
 
return 0;
 }
-- 
2.1.0

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


Re: [ovs-dev] [PATCH v2] dpif-netlink: convert packet_type netlink attribute

2017-07-06 Thread Yang, Yi Y
Eric, I verified this one, ptap unit tests and nsh tests passed without any 
change, so it seems it is better than the original one you did.

-Original Message-
From: Eric Garver [mailto:e...@erig.me] 
Sent: Friday, July 7, 2017 3:44 AM
To: Zoltán Balogh 
Cc: Yang, Yi Y ; 'd...@openvswitch.org' 

Subject: Re: [ovs-dev] [PATCH v2] dpif-netlink: convert packet_type netlink 
attribute

On Thu, Jul 06, 2017 at 01:14:31PM +, Zoltán Balogh wrote:
> Hi Eric,
> 
> Thank you for clarifying. 
> 
> ...
> [OVS_FLOW_ATTR_KEY]
> ...
> [OVS_KEY_ATTR_IPV4] = ...
> ...
> [OVS_KEY_ATTR_ETHERTYPE] = ...  <--- the one inserted
> 
> I have not found any API that would extend a nested attribute. 
> Maybe I'm wrong, but I thought 'buf' holds a single nested attribute. If this 
> is true, isn't possible to add the ethertype to it and increase its size?

I gave it a try and realized it doesn't matter.

During the upcall we pass back the same key that the kernel gave us, with the 
exception that we also fill in wildcard info. See
upcall_xlate() and ukey_create_from_upcall(). This is why my original patch 
works. It caused odp_flow_key_from_mask() to fill the ETHERTYPE for the mask.

So I think this can only be solved in one of two places:

  1) odp_flow_key_from_mask(), as my original patch did.
- This sets the wildcard for all dpifs, including userspace/netdev.
  2) xlate_wc_init() and xlate_wc_finish().
- Here we can limit by dpif type.

Neither which is particularly pleasing. I gave #2 a try. see patch below. It 
works for both check-kernel and check-system-userspace. It does not force 
eth_type() for userspace.

What do you think?

Eric.

--->8---

diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index 
1f4fe1dd6725..f3074c78c4b2 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -6129,7 +6129,10 @@ xlate_wc_init(struct xlate_ctx *ctx)
 /* Some fields we consider to always be examined. */
 WC_MASK_FIELD(ctx->wc, packet_type);
 WC_MASK_FIELD(ctx->wc, in_port);
-if (is_ethernet(>xin->flow, NULL)) {
+if (is_ethernet(>xin->flow, NULL)
+|| (pt_ns(ctx->xin->flow.packet_type) == OFPHTN_ETHERTYPE
+&& !strcmp(dpif_normalize_type(dpif_type(ctx->xbridge->dpif)),
+   "system"))) {
 WC_MASK_FIELD(ctx->wc, dl_type);
 }
 if (is_ip_any(>xin->flow)) {
@@ -6163,7 +6166,12 @@ xlate_wc_finish(struct xlate_ctx *ctx)
 if (ctx->xin->upcall_flow->packet_type != htonl(PT_ETH)) {
 ctx->wc->masks.dl_dst = eth_addr_zero;
 ctx->wc->masks.dl_src = eth_addr_zero;
-ctx->wc->masks.dl_type = 0;
+/* Kernel uses ETHERTYPE to implicitly mean packet_type(1, x) */
+if (pt_ns(ctx->xin->upcall_flow->packet_type) != OFPHTN_ETHERTYPE
+|| strcmp(dpif_normalize_type(dpif_type(ctx->xbridge->dpif)),
+  "system")) {
+ctx->wc->masks.dl_type = 0;
+}
 }

 /* ICMPv4 and ICMPv6 have 8-bit "type" and "code" fields.  struct flow
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v3 3/6] ovn: l3ha, handling of multiple gateway chassis

2017-07-06 Thread Russell Bryant
I'm not done reviewing this, but I figured I'd send out what I have so
far.  I'll continue tomorrow.


On Wed, Jul 5, 2017 at 9:45 AM, Miguel Angel Ajo  wrote:

Some minor commit message typos:

> This patch handles multiple gateway_chassis with in chassisredirect

s/with in/within/

> ports, any gateway with a chassis redirect port will implement the

s/, any/. Any/

s/chassis redirect/chassisredirect/

> rules to de-encapsulate incomming packets for such port.

s/incomming/incoming/


a question about this ... the L3 HA design doc mentions how it's
important for gateways to drop packets unless they are the current
active gateway.  The commit message implies that all gateway chassis
will have the flows for receiving traffic, even if they are not the
active gateway chassis.  What's the intended behavior with this series
right now?  and do any later patches change it?

>
> And hosts targetting a remote chassisredirect port will setup a

s/targetting/targeting/

> bundle(active_backup, ..) action to each tunnel port, in the given
> priority order.

maybe note that a future patch will enable BFD to detect when a remote
gateway chassis is no longer reachable?

>
> Signed-off-by: Miguel Angel Ajo 
> Signed-off-by: Venkata Anil Kommaddi 

This will need a Co-authored-by header as well for Anil.

> ---
>  ovn/controller/automake.mk  |   2 +
>  ovn/controller/binding.c|  13 +-
>  ovn/controller/binding.h|   1 +
>  ovn/controller/gchassis.c   | 176 +
>  ovn/controller/gchassis.h   |  63 
>  ovn/controller/lflow.c  |   7 +-
>  ovn/controller/lport.h  |   4 +
>  ovn/controller/ovn-controller.c |  15 +-
>  ovn/controller/physical.c   | 124 ---
>  ovn/controller/physical.h   |   4 +-
>  tests/ovn.at| 330 
> +++-
>  11 files changed, 710 insertions(+), 29 deletions(-)
>  create mode 100644 ovn/controller/gchassis.c
>  create mode 100644 ovn/controller/gchassis.h
>
> diff --git a/ovn/controller/automake.mk b/ovn/controller/automake.mk
> index 8c6a787..d3828f5 100644
> --- a/ovn/controller/automake.mk
> +++ b/ovn/controller/automake.mk
> @@ -6,6 +6,8 @@ ovn_controller_ovn_controller_SOURCES = \
> ovn/controller/chassis.h \
> ovn/controller/encaps.c \
> ovn/controller/encaps.h \
> +   ovn/controller/gchassis.c \
> +   ovn/controller/gchassis.h \
> ovn/controller/lflow.c \
> ovn/controller/lflow.h \
> ovn/controller/lport.c \
> diff --git a/ovn/controller/binding.c b/ovn/controller/binding.c
> index bb76608..f5526fd 100644
> --- a/ovn/controller/binding.c
> +++ b/ovn/controller/binding.c
> @@ -15,6 +15,7 @@
>
>  #include 
>  #include "binding.h"
> +#include "gchassis.h"
>  #include "lflow.h"
>  #include "lport.h"
>
> @@ -26,6 +27,7 @@
>  #include "lib/vswitch-idl.h"
>  #include "openvswitch/hmap.h"
>  #include "openvswitch/vlog.h"
> +#include "ovn/lib/chassis-index.h"
>  #include "ovn/lib/ovn-sb-idl.h"
>  #include "ovn-controller.h"
>
> @@ -394,12 +396,15 @@ consider_local_datapath(struct controller_ctx *ctx,
> false, local_datapaths);
>  }
>  } else if (!strcmp(binding_rec->type, "chassisredirect")) {
> -const char *chassis_id = smap_get(_rec->options,
> -  "redirect-chassis");
> -our_chassis = chassis_id && !strcmp(chassis_id, chassis_rec->name);
> -if (our_chassis) {
> +if (gateway_chassis_in_pb_contains(binding_rec, chassis_rec)) {
>  add_local_datapath(ldatapaths, lports, binding_rec->datapath,
> false, local_datapaths);
> +/* XXX this should only be set to true if our chassis
> + * (chassis_rec) is the master for this chassisredirect port
> + * but for now we'll bind it only when not bound, this is
> + * handled in subsequent patches */
> +our_chassis = !binding_rec->chassis ||
> +chassis_rec == binding_rec->chassis;

There seems to be a bit of a race condition here.  Multiple configured
gateway chassis for a port will see that this is unbound all at the
same time and they will all try to bind it.  It's not defined which
one would end up having the port bound.  I know this gets changed in a
future patch, though.

One possible change for this stage of series would be to always only
have the highest priority gateway_chassis be the one to bind the port.

>  }
>  } else if (!strcmp(binding_rec->type, "l3gateway")) {
>  const char *chassis_id = smap_get(_rec->options,
> diff --git a/ovn/controller/binding.h b/ovn/controller/binding.h
> index 3bfa7d1..136b3a7 100644
> --- a/ovn/controller/binding.h
> +++ b/ovn/controller/binding.h
> @@ -20,6 +20,7 @@
>  #include 
>
>  struct controller_ctx;
> +struct 

Re: [ovs-dev] [PATCH v4 0/7] Packet type aware pipeline

2017-07-06 Thread Yang, Yi Y
I think it needs root privilege to run.

-Original Message-
From: ovs-dev-boun...@openvswitch.org [mailto:ovs-dev-boun...@openvswitch.org] 
On Behalf Of Darrell Ball
Sent: Friday, July 7, 2017 5:06 AM
To: Eric Garver 
Cc: 'd...@openvswitch.org' ; simon.hor...@netronome.com; 
Jiri Benc 
Subject: Re: [ovs-dev] [PATCH v4 0/7] Packet type aware pipeline

btw, I asked Andy to check on his Trusty system and he observes the same 
failure. 

On 7/6/17, 1:39 PM, "Darrell Ball"  wrote:



On 7/6/17, 1:22 PM, "Eric Garver"  wrote:

On Thu, Jul 06, 2017 at 03:59:51PM +, Darrell Ball wrote:
> Patch 4 added unit tests
> One test was added to system userspace.
> I ran it many times and it has never passed.
> Is something missing in the test or supporting code ?

Works for me. Maybe there is a timing problem?

Thanks
There are races in the system tests, but those tests will pass on a second 
attempt.
This is 100% failure.

OVS: current master (fb16fec66498)

Tip of master - same for me

Kernel: 4.12.0-rc7+

I tried 2 kernels 4.2.0 and 3.19 – always fails in both.

OS: RHEL 7.4-ish

I really hope the distro is not relevant here
If you have reason to think so, pls speak up


> 
> ## -- ##
> ## openvswitch 2.7.90 test suite. ##
> ## -- ##
>  94: ptap - triangle bridge setup with L2 and L3 GRE tunnels FAILED 
(system-userspace-packet-type-aware.at:344)
> 
> ## - ##
> ## Test results. ##
> ## - ##
> 
> ERROR: 1 test was run,
> 1 failed unexpectedly.
> ## --- ##
> ## system-userspace-testsuite.log was created. ##
> ## --- ##
> 
> Please send `tests/system-userspace-testsuite.log' and all 
information you think might help:
> 
>To: 
>Subject: [openvswitch 2.7.90] system-userspace-testsuite: 94 failed
> 
> You may investigate any problem if you feel able to do so, in which
> case the test suite provides a good starting point.  Its output may
> be found below `tests/system-userspace-testsuite.dir'.
> 
> make: *** [check-system-userspace] Error 1
> make: Leaving directory `/home/dball/openvswitch/ovs/_gcc'
> 
> 
> 
> 
> On 6/27/17, 2:29 PM, "ovs-dev-boun...@openvswitch.org on behalf of 
Ben Pfaff"  wrote:
> 
> On Fri, Jun 23, 2017 at 04:47:48PM +, Zoltán Balogh wrote:
> > 
> > This series was started by Ben Pfaff, v3 can be found here:
> > 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_778070_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=01fMZLg-sq_Rf_2X9TcxmtDN0Vx2hS2v4BABA77en0w=
 
> > 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_778071_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=5fpQZh33OQ_0AGjRuJNQqvS-1E6yhFoD5TxUoLayzwM=
 
> > 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_778076_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=rqnhEoIuJ9rECQaXZafZGrAW9us8y184GCexqK8VUxQ=
 
> > 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_778072_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=p5Fnh2SQ8fUrNF0V8ChNRQyQLmbjiuvKRd1UUwE93s8=
 
> > 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_778074_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=02CPoSKkiGGsFX4neL8TpGa75VUPaaeNYWz_2WbqBsQ=
 
> > 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_778073_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=eMl7m4NpJSD07nXTN_oOdQFvysmJnclSRw39GgGg9BQ=
 
> > 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_778075_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=71zSrD_kcUjZwuKvjfeqam_rdCpeXuxtm4TW_SsZ_3w=
 
> > 
> > Ben's series is based on this one:
> > 

Re: [ovs-dev] GTP support to OVS upstream

2017-07-06 Thread Yang, Yi Y
Joe, thank you for your clarification, it will significantly reduce ovs tunnel 
implementation dependency on Linux kernel if we just use udp tunnel in kernel, 
anyway userspace tunnel implementations are also some duplicates of kernel 
tunnel implementations less or more:-)

I think it will simplify ovs tunnel implementation and maintenance if we use 
generic encap & decap framework to do tunnel encap & decap and move such 
processing into OpenFlow pipeline.

-Original Message-
From: Joe Stringer [mailto:j...@ovn.org] 
Sent: Thursday, July 6, 2017 10:25 PM
To: Yang, Yi Y 
Cc: Wieger IJntema ; d...@openvswitch.org
Subject: Re: [ovs-dev] GTP support to OVS upstream

On 5 July 2017 at 03:54, Yang, Yi Y  wrote:
> I remember OpenFlow 1.6 spec (not finalized) proposes to use OpenFlow actions 
> to do GTP-u encapsulation and decapsulation, current OvS tunnel 
> implementation can't support the third kind of use case (don't encap & decap, 
> just parse, match and forward), MEC (ETSI Molibe/Multi-access Edge Computing) 
> the third kind of use case.
>
> I'm wondering if it is feasible to implement a generic UDP tunnel in OvS, let 
> Openflow do encap /decap/parse, now ovs master has fully supported L3 
> tunnel port and PTAP(Packet type aware pipeline), we have posted out generic 
> encap & decap actions implementation, once ovs officially merges them, ovs 
> can support generic encap & decap action, we can base on them to implement 
> GTP-u encap & decap, then it will be better if we can implement a generic UDP 
> tunnel, ovs can add UDP tunnel ports with different UDP port to handle 
> different tunnel protocol, I think this will be the best way to handle the 
> aforementioned three kinds of use cases.

When it comes to the OVS userspace datapath, this seems like it maps pretty 
well to how things are already being done. When it comes to kernel APIs though 
there's a bunch of considerations around minimizing code duplication with the 
rest of the code, restricting scope/size creep of the module, and expectations 
of how long the API is supported. I think further discussion is necessary in 
that space to determine whether the OVS kernel module should really follow this 
model or not.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] 答复: Re: 答复: Re: 答复: [spam可疑邮件]Re: 答复: Re: [PATCH 2/2] ovn-northd: Fix ping failure of vlan networks.

2017-07-06 Thread Russell Bryant
On Thu, Jul 6, 2017 at 2:15 PM, Han Zhou  wrote:
> Despite the original motivation of this change, I found the patch valuable
> for data-plane performance.
>
> When localnet port is used for communication between 2 ports of same
> lswitch (basic provider network scenario), without the patch, each flow is
> tracked in conntrack table twice. With the patch, it improve the
> performance in 2 ways:
>
> 1) It reduces 50% of conntrack operations
>
> 2) It reduces 50% number of entries in conntrack table, which also helps
> reducing conntrack cost
>
> I had some tests for TCP_CRR, it improves performance for 5 - 10%.
> Discussed in today's ovn meeting and we agreed it is valid optimization
> because localnet port is used as transport, not the real end-point to
> protect.
>
> @Qianyu, would it be good to revise the patch on the commit message to put
> it as an optimization for conntrack performance? The current commit message
> is not true because it is not a supported scenario for now, and the "fix"
> is not complete, either. The new scenaro would worth a separate discussion.
> What do you think?

While the localnet port is not an endpoint, it did seem useful to me
to be able to define security policy there as that is the first place
traffic enters from "outside" of OVN.  We could potentially drop
traffic sooner, before sending it over to the final endpoint on
another chassis.  Based on a quick review of the discussion, it does
seem like dropping it is the better choice for now.

If the security aspect is desired later, perhaps we could solve it
another way by supporting ACLs associated with the L3 gateway sitting
between an OVN logical network and a physical network (localnet
network).

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


Re: [ovs-dev] [PATCH] Makefiles: Fail build for flake8 only when configured with --enable-Werror.

2017-07-06 Thread Russell Bryant
On Thu, Jul 6, 2017 at 6:12 PM, Ben Pfaff  wrote:
> flake8 checking is useful.  Until now, it always failed the build for any
> flake8 errors.  This is too aggressive, for the same reason that always
> failing the build for any compiler warnings is too aggressive: compilers
> change over time and asynchronously from OVS itself.  Thus, if we release
> some version of OVS today, even if it's flake8-clean today, it might not
> be flake8-clean tomorrow, even with the same settings.  We don't want to
> have to track flake8 warnings on every release branch.
>
> Thus, this adopts the same policy for compiler warnings: always report
> them, but only fail the build if --enable-Werror was configured.  Usually
> just developers use that configure option, and they're prepared to deal
> with the fallout.
>
> Signed-off-by: Ben Pfaff 


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


[ovs-dev] 答复: Re: 答复: Re: 答复: Re: 答复: [spam可疑邮件]Re: 答复: Re: [PATCH 2/2] ovn-northd: Fix ping failure of vlan networks.

2017-07-06 Thread wang . qianyu
Hi Han

Thanks for the reiew job.

I will revise the commit message in new patch.

Qianyu




Han Zhou 
2017/07/07 02:15
 
收件人:Mickey Spiegel , 
抄送:  wang.qia...@zte.com.cn, ovs dev , 
xurong00037997 , zhou.huij...@zte.com.cn
主题:  Re: 答复: Re: [ovs-dev] 答复: Re: 答复: [spam可疑邮件]Re: 
答复: Re: [PATCH 2/2] ovn-northd: Fix ping failure of vlan networks.


Despite the original motivation of this change, I found the patch valuable 
for data-plane performance.

When localnet port is used for communication between 2 ports of same 
lswitch (basic provider network scenario), without the patch, each flow is 
tracked in conntrack table twice. With the patch, it improve the 
performance in 2 ways:

1) It reduces 50% of conntrack operations

2) It reduces 50% number of entries in conntrack table, which also helps 
reducing conntrack cost

I had some tests for TCP_CRR, it improves performance for 5 - 10%.
Discussed in today's ovn meeting and we agreed it is valid optimization 
because localnet port is used as transport, not the real end-point to 
protect.

@Qianyu, would it be good to revise the patch on the commit message to put 
it as an optimization for conntrack performance? The current commit 
message is not true because it is not a supported scenario for now, and 
the "fix" is not complete, either. The new scenaro would worth a separate 
discussion. What do you think?

On Wed, Jul 5, 2017 at 9:07 PM, Mickey Spiegel  
wrote:

On Tue, Jul 4, 2017 at 6:01 PM,  wrote:
Hi Mickey, 

Thanks for your review. 

If we could do some modifications to avoid the north/south problem you 
mentioned? Like as follow: 

When packets send to the localnet-port, if the MAC is router-port MAC, we 
change the router-port MAC to HV physical NIC MAC. And in gateway node, we 
make the HV physical NIC MAC and router-port MAC all sense. 

In OpenStack usage, for public internet access, it is common for one 
logical switch to have many different logical routers connected to it, 
which can reside on the same hypervisor. The MAC address is used to 
identify which logical router the traffic is destined to. So you would 
need a MAC address per (logical router, chassis) pair, or you would have 
to introduce yet another type of router that front ends the distributed 
logical routers, deciding based on destination IP address. Either way, a 
port with a different MAC address on each chassis that hosts the port 
seems different than the logical router ports that exist today.

I am still trying to understand your use case. It sounds like you have 
different regions, with different logical switches in different regions. 
If you just put localnets on each of those logical switches, wouldn't that 
do what you want?

If you need L3 between the different regions, you could use a separate 
router per region, either a gateway router in each region, or a 
distributed logical router with a distributed gateway port in each region. 
With gateway routers, traffic coming in and out of each region goes 
through one centralized chassis. With a distributed logical router, 
non-NAT traffic coming in and out of each region goes through one 
centralized chassis, while NAT traffic coming in and out of each region 
can be distributed. With this type of solution, traffic will go in and out 
of each localnet symmetrically, in both directions.

Mickey



Thanks! 






Mickey Spiegel  
2017/06/30 12:31 

收件人:Han Zhou , 
抄送:wang.qia...@zte.com.cn, ovs dev , zhou.huij...@zte.com.cn, xurong00037997  
主题:Re: [ovs-dev] 答复: Re: 答复: [spam可疑邮件]Re: 答复
: Re: [PATCH 2/2] ovn-northd: Fix ping failure of vlan networks.




On Thu, Jun 29, 2017 at 2:19 PM, Han Zhou  wrote: 
I learned that this use case is kind of Hierarchical scenario:
https://specs.openstack.org/openstack/neutron-specs/specs/kilo/ml2-hierarchical-port-binding.html


In such scenario, user wants to use OVN to manage vlan networks, and the
vlan networks is connected via VTEP overlay, which is not managed by OVN
itself. VTEP is needed to connect to BM/SRIOV VMs to the same L2 that OVS
VIFs are connected to.

User don't want to use OVN to manage VTEPs since there will be flooding to
many VTEPs. (Mac-learning is not supported yet)

So in this scenario, user want to utilize distributed logical router as a
way to optimize the datapath. For VM to VM traffic between different 
vlans,
instead of going to a centralized external L3 router, user wants the
traffic to be tagged to the destination vlan directly and go straight from
source HV to destination HV through the destination vlan. 

L2 and L3 have different semantics and different ways of handling packets. 

There is a big difference between: 
1) bridging between 

[ovs-dev] [PATCH v2] netdev-linux: Replace sendmsg with sendmmsg in netdev_linux_send

2017-07-06 Thread Zhenyu Gao
Sendmmsg can reduce cpu cycles in sending packets to kernel.
Replace sendmsg with sendmmsg in function netdev_linux_send to send
batch packets if sendmmsg is available.

If kernel side doesn't support sendmmsg, will fallback to sendmsg.

netserver
||
||
|  container |
|veth|
  |
  |||
  |---veth-|   dpdk-ovs |  netperf
   ||  |--|
   |dpdk|  | bare-metal   |
 | |--|
 |  |
 |  |
pnic---pnic

Netperf was consumed to test the performance:

1)cmd:netperf -H remote-container -t UDP_STREAM -l 60 -- -m 1400
result: netserver received 2383.21Mb(sendmsg)/2551.64Mb(sendmmsg)

2)cmd:netperf -H remote-container -t UDP_STREAM -l 60 -- -m 60
result: netserver received 109.72Mb(sendmsg)/115.18Mb(sendmmsg)

Sendmmsg show about 6% improvement in netperf UDP testing.

Signed-off-by: Zhenyu Gao 
---
 configure.ac   |  2 +-
 lib/netdev-linux.c | 71 --
 2 files changed, 70 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 6404b5f..b02c7c4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -106,7 +106,7 @@ AC_CHECK_DECLS([sys_siglist], [], [], [[#include 
]])
 AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec, struct stat.st_mtimensec],
   [], [], [[#include ]])
 AC_CHECK_MEMBERS([struct ifreq.ifr_flagshigh], [], [], [[#include ]])
-AC_CHECK_FUNCS([mlockall strnlen getloadavg statvfs getmntent_r])
+AC_CHECK_FUNCS([mlockall strnlen getloadavg statvfs getmntent_r sendmmsg])
 AC_CHECK_HEADERS([mntent.h sys/statvfs.h linux/types.h linux/if_ether.h 
stdatomic.h])
 AC_CHECK_HEADERS([net/if_mib.h], [], [], [[#include 
 #include ]])
diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
index 1b88775..b90a22a 100644
--- a/lib/netdev-linux.c
+++ b/lib/netdev-linux.c
@@ -1187,6 +1187,54 @@ netdev_linux_rxq_drain(struct netdev_rxq *rxq_)
 }
 }
 
+static inline int
+netdev_linux_sock_batch_send(int sock, struct msghdr *msg,
+ struct dp_packet_batch *batch)
+{
+int error = 0;
+ssize_t retval;
+uint32_t resend_idx = 0;
+struct mmsghdr *mmsg;
+struct iovec *iov;
+
+mmsg = xmalloc(sizeof(*mmsg) * batch->count);
+iov = xmalloc(sizeof(*iov) * batch->count);
+
+for (int i = 0; i < batch->count; i++) {
+const void *data = dp_packet_data(batch->packets[i]);
+size_t size = dp_packet_size(batch->packets[i]);
+
+/* Truncate the packet if it is configured. */
+size -= dp_packet_get_cutlen(batch->packets[i]);
+
+iov[i].iov_base = CONST_CAST(void *, data);
+iov[i].iov_len = size;
+mmsg[i].msg_hdr = *msg;
+mmsg[i].msg_hdr.msg_iov = [i];
+}
+
+resend_batch:
+retval = sendmmsg(sock, mmsg + resend_idx,
+  batch->count - resend_idx, 0);
+if (retval < 0) {
+if (errno == EINTR) {
+goto resend_batch;
+}
+/* The Linux AF_PACKET implementation never blocks waiting for
+ * room for packets, instead returning ENOBUFS.  Translate this
+ * into EAGAIN for the caller. */
+error = errno == ENOBUFS ? EAGAIN : errno;
+} else if (retval != batch->count - resend_idx) {
+   /* Send remain packets again. */
+resend_idx += retval;
+goto resend_batch;
+}
+
+free(mmsg);
+free(iov);
+return error;
+}
+
 /* Sends 'buffer' on 'netdev'.  Returns 0 if successful, otherwise a positive
  * errno value.  Returns EAGAIN without blocking if the packet cannot be queued
  * immediately.  Returns EMSGSIZE if a partial packet was transmitted or if
@@ -1207,6 +1255,9 @@ netdev_linux_send(struct netdev *netdev_, int qid 
OVS_UNUSED,
 struct sockaddr_ll sll;
 struct msghdr msg;
 if (!is_tap_netdev(netdev_)) {
+#ifdef HAVE_SENDMMSG
+static bool try_sendmmsg = true;
+#endif
 sock = af_packet_sock();
 if (sock < 0) {
 error = -sock;
@@ -1231,6 +1282,21 @@ netdev_linux_send(struct netdev *netdev_, int qid 
OVS_UNUSED,
 msg.msg_control = NULL;
 msg.msg_controllen = 0;
 msg.msg_flags = 0;
+
+#ifdef HAVE_SENDMMSG
+if (try_sendmmsg) {
+/* Try batch sending to socket */
+error = netdev_linux_sock_batch_send(sock, , batch);
+if (error == ENOSYS) {
+/* Linux kernel does not implement this function */
+try_sendmmsg = false;
+VLOG_WARN("Linux kernel doesn't implement sendmmsg, "
+  "going to consume sendmsg");
+} else {
+goto check_error;
+}
+}
+#endif
 }
 
 /* 'i' is incremented only if there's no error */
@@ -1290,9 

[ovs-dev] [PATCH v1] vswitchd: Fix IFACE_STAT name error in iface_refresh_stats

2017-07-06 Thread Zhenyu Gao
The element of rx_1024_to_1522_packets has wrong name(rx_1024_to_1518_packets).
Change it from rx_1024_to_1518_packets to rx_1024_to_1522_packets, it should
record packets between 1024 to 1522.

The element of tx_1024_to_1522_packets has wrong name(tx_1024_to_1518_packets).
Change it from tx_1024_to_1518_packets to tx_1024_to_1522_packets, it should
record packets between 1024 to 1522.

Signed-off-by: Zhenyu Gao 
---
 vswitchd/bridge.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index 8336d70..b9fb8e6 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -2369,14 +2369,14 @@ iface_refresh_stats(struct iface *iface)
 IFACE_STAT(rx_128_to_255_packets,   "rx_128_to_255_packets")\
 IFACE_STAT(rx_256_to_511_packets,   "rx_256_to_511_packets")\
 IFACE_STAT(rx_512_to_1023_packets,  "rx_512_to_1023_packets")   \
-IFACE_STAT(rx_1024_to_1522_packets, "rx_1024_to_1518_packets")  \
+IFACE_STAT(rx_1024_to_1522_packets, "rx_1024_to_1522_packets")  \
 IFACE_STAT(rx_1523_to_max_packets,  "rx_1523_to_max_packets")   \
 IFACE_STAT(tx_1_to_64_packets,  "tx_1_to_64_packets")   \
 IFACE_STAT(tx_65_to_127_packets,"tx_65_to_127_packets") \
 IFACE_STAT(tx_128_to_255_packets,   "tx_128_to_255_packets")\
 IFACE_STAT(tx_256_to_511_packets,   "tx_256_to_511_packets")\
 IFACE_STAT(tx_512_to_1023_packets,  "tx_512_to_1023_packets")   \
-IFACE_STAT(tx_1024_to_1522_packets, "tx_1024_to_1518_packets")  \
+IFACE_STAT(tx_1024_to_1522_packets, "tx_1024_to_1522_packets")  \
 IFACE_STAT(tx_1523_to_max_packets,  "tx_1523_to_max_packets")   \
 IFACE_STAT(tx_multicast_packets,"tx_multicast_packets") \
 IFACE_STAT(rx_broadcast_packets,"rx_broadcast_packets") \
-- 
1.8.3.1

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


Re: [ovs-dev] [PATCH] conntrack : Use Rx checksum offload feature on DPDK ports for conntrack.

2017-07-06 Thread Darrell Ball
This has been updated and I will be reviewing the changes

Thanks Darrell

On 7/6/17, 4:59 PM, "Ben Pfaff"  wrote:

Do you still intend to look closer?

On Tue, Jun 06, 2017 at 04:40:14PM +, Darrell Ball wrote:
> I did a first pass, but I will look thru. it more carefully and test it.
> The benefit is smaller than I had hoped, even in a simple case, but the 
code delta is also simple.
> 
> Thanks Darrell
> 
> On 6/6/17, 3:45 AM, "ovs-dev-boun...@openvswitch.org on behalf of 
Chandran, Sugesh"  wrote:
> 
> Ping!. 
> Any other comments on this patch??
> 
> 
> Regards
> _Sugesh
> 
> 
> > -Original Message-
> > From: Fischetti, Antonio
> > Sent: Friday, May 26, 2017 11:05 AM
> > To: Chandran, Sugesh ; ovs-
> > d...@openvswitch.org
> > Subject: RE: [ovs-dev] [PATCH] conntrack : Use Rx checksum offload 
feature
> > on DPDK ports for conntrack.
> > 
> > Hi Sugesh,
> > it looks good to me, it makes sense to leverage the csum info when 
present.
> > 
> > I've tested it with the firewall rules - see below for details - I 
saw a ~+3%
> > improvement in my testbench with 10 UDP connections.
> > 
> > Traffic Gen: IXIA IxExplorer
> > 10 UDP different flows, 64B pkts
> > 
> > Original OvS:   3.0 Mpps
> > With this Patch: 3.1 Mpps
> > 
> > 
> > Below some details of my testbench.
> > 
> > ===
> > 
> > BUILD
> > -
> > make -j 28 CFLAGS="-O2 -march=native -g"
> > 
> > #I didn't use intrinsics, I expect in that case the benefit will be 
smaller.
> > 
> > FLOW DUMP
> > -
> > NXST_FLOW reply (xid=0x4):
> >  cookie=0x0, duration=0.064s, table=0, n_packets=0, n_bytes=0, 
idle_age=0,
> > priority=100,ct_state=-trk,ip actions=ct(table=1)  cookie=0x0,
> > duration=0.075s, table=0, n_packets=0, n_bytes=0, idle_age=0,
> > priority=10,arp actions=NORMAL  cookie=0x0, duration=0.085s, 
table=0,
> > n_packets=0, n_bytes=0, idle_age=0, priority=1 actions=drop  
cookie=0x0,
> > duration=0.054s, table=1, n_packets=0, n_bytes=0, idle_age=0,
> > ct_state=+new+trk,ip,in_port=1 actions=ct(commit),output:2  
cookie=0x0,
> > duration=0.033s, table=1, n_packets=0, n_bytes=0, idle_age=0,
> > ct_state=+new+trk,ip,in_port=2 actions=drop  cookie=0x0, 
duration=0.043s,
> > table=1, n_packets=0, n_bytes=0, idle_age=0,
> > ct_state=+est+trk,ip,in_port=1 actions=output:2  cookie=0x0,
> > duration=0.023s, table=1, n_packets=0, n_bytes=0, idle_age=0,
> > ct_state=+est+trk,ip,in_port=2 actions=output:1
> > 
> > HugePages_Total:   20480
> > HugePages_Free:20480
> > HugePages_Rsvd:0
> > HugePages_Surp:0
> > ___
> > DPDK: HEAD detached at v16.11
> > OvS:  On my local branch ConnTrack_01
> > ___
> > 
> >PID PSR COMMAND %CPU
> >  20509   0 ovsdb-server 0.0
> >  20522   2 ovs-vswitchd78.1
> >  20522   4 pmd62   80.8
> >  20522   5 pmd61   71.6
> > 
> > PDM threads:  2
> > 
> > configured_tx_queues=3,
> > configured_tx_queues=3,
> > 
> > 
> > Regards,
> > Antonio
> > 
> > 
> > Acked-by: Antonio Fischetti 
> > 
> > 
> > > -Original Message-
> > > From: ovs-dev-boun...@openvswitch.org [mailto:ovs-dev-
> > > boun...@openvswitch.org] On Behalf Of Sugesh Chandran
> > > Sent: Thursday, May 25, 2017 10:11 PM
> > > To: ovs-dev@openvswitch.org
> > > Subject: [ovs-dev] [PATCH] conntrack : Use Rx checksum offload 
feature
> > > on DPDK ports for conntrack.
> > >
> > > Avoiding checksum validation in conntrack module if it is already
> > > verified in DPDK physical NIC ports.
> > >
> > > Signed-off-by: Sugesh Chandran 
> > > ---
> > >  lib/conntrack.c | 58
> > > 
> > > -
> > >  1 file changed, 37 insertions(+), 21 deletions(-)
> > >
> > > diff --git a/lib/conntrack.c b/lib/conntrack.c index 
cb30ac7..af6a372
> > > 100644
> > > --- a/lib/conntrack.c
> > > 

Re: [ovs-dev] [PATCH] submitting-patches: Update test and documentation recommendations.

2017-07-06 Thread Darrell Ball


On 5/18/17, 5:32 AM, "ovs-dev-boun...@openvswitch.org on behalf of Ben Pfaff" 
 wrote:

Rationale:

- "make distcheck" is not as necessary anymore because we have a build-time
  check that fails if files in the repository are not distributed.

- xenserver has not been important for years, so remove the specific
  callout.

- We already have an informal custom of adding tests for new feaures and
  bug fixes, so codify it.

- Add note about updating NEWS.

Signed-off-by: Ben Pfaff 
---
 .../internals/contributing/submitting-patches.rst  | 25 
+++---
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/Documentation/internals/contributing/submitting-patches.rst 
b/Documentation/internals/contributing/submitting-patches.rst
index edbc1aa8d9ff..4f7ca0304034 100644
--- a/Documentation/internals/contributing/submitting-patches.rst
+++ b/Documentation/internals/contributing/submitting-patches.rst
@@ -44,29 +44,28 @@ particular:
 - A patch should make one logical change.  Don't make multiple, logically
   unconnected changes to disparate subsystems in a single patch.
 
-- A patch that adds or removes user-visible features should also update the
-  appropriate user documentation or manpages.  Check "Feature Deprecation
-  Guidelines" section in this document if you intend to remove user-visible
-  feature.
+- A patch that adds or removes user-visible features should also
+  update the appropriate user documentation or manpages.  Consider
+  adding an item to NEWS for nontrivial changes.  Check "Feature
+  Deprecation Guidelines" section in this document if you intend to
+  remove user-visible feature.
 
 Testing is also important:
 
-- A patch that modifies existing code should be tested with ``make
-  check`` before submission.  Refer to the `install guide`, under 
"Self-Tests",
-  for more information.
+- Test a patch that modifies existing code with ``make check`` before
+  submission.  Refer to the `install guide`, under "Self-Tests", for
+  more information.

I think “Testing” is under Documentation and the label is “Unit Tests”
I cannot find the title “Self-Tests”, but admittedly, I have little patience.

Maybe checking the system tests (kernel and userspace) should be strongly 
suggested, 
if not an expectation.

 
-- A patch that adds or deletes files should also be tested with ``make
+- Consider testing a patch that adds or deletes files with ``make
   distcheck`` before submission.
 
 - A patch that modifies Linux kernel code should be at least build-tested 
on
   various Linux kernel versions before submission.  I suggest versions 
3.10 and
   whatever the current latest release version is at the time.
 
-- A patch that modifies the ofproto or vswitchd code should be tested in at
-  least simple cases before submission.
-
-- A patch that modifies xenserver code should be tested on XenServer before
-  submission.
+- A patch that adds a new feature should add appropriate tests for the
+  feature.  A bug fix patch should preferably add a test that would
+  fail if the bug recurs.
 
 If you are using GitHub, then you may utilize the travis-ci.org CI build 
system
 by linking your GitHub repository to it. This will run some of the above 
tests
-- 
2.10.2

___
dev mailing list
d...@openvswitch.org

https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev=DwICAg=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=vV-qzeme225zuTayBoQVI5Qb9Cx0DZaeSRShNoyY1W8=6Vk6zDH4PRJGGw3UKXtOVXyIlJ3grOlwabbxT-K4wFE=
 


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


Re: [ovs-dev] [PATCHv3] ofproto-dpif: Detect support for ct_tuple6.

2017-07-06 Thread Ben Pfaff
On Fri, Jun 02, 2017 at 09:38:47AM -0700, Joe Stringer wrote:
> Support for extracting original direction 5 tuple fields from the
> connection tracking module may differ on some platforms between the IPv4
> original tuple fields vs. IPv6. Detect IPv6 original tuple support
> separately and reflect this support up to the OpenFlow layer.
> 
> Signed-off-by: Joe Stringer 
> ---
> CC: Sairam Venugopal 
> 
> v3: Only serialize IPv6 orig tuple in ODP if datapath support exists.
> v2: Fix setting of support.ct_orig_tuple6 field prior to probe.

I didn't test it, but the principles all seem solid.

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


Re: [ovs-dev] [PATCH] debian.rst: Clarify that "dpkg" needs manual help with dependencies.

2017-07-06 Thread Ben Pfaff
On Mon, May 29, 2017 at 11:40:51AM -0700, Ben Pfaff wrote:
> Reported-by: Mircea Ulinic 
> Signed-off-by: Ben Pfaff 

This patch needs a review.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] ofp-print: Don't abort on unknown reason in role status message.

2017-07-06 Thread Ben Pfaff
On Fri, May 26, 2017 at 01:22:26PM -0700, Ben Pfaff wrote:
> A buggy or malicious switch could send a role status message with a bad
> reason code, which if printed by OVS would cause it to abort.  This fixes
> the problem.
> 
> Reported-by: Bhargava Shastry 
> Signed-off-by: Ben Pfaff 

This patch needs a review.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] ofp-util: Check length of buckets in ofputil_pull_ofp15_group_mod().

2017-07-06 Thread Ben Pfaff
On Fri, May 26, 2017 at 12:59:06PM -0700, Ben Pfaff wrote:
> This code blindly read forward for the number of bytes specified by the
> message without checking that it was in range.
> 
> This bug is part of OpenFlow 1.5 support.  Open vSwitch does not enable
> OpenFlow 1.5 support by default.
> 
> Reported-by: Bhargava Shastry 
> Signed-off-by: Ben Pfaff 

This patch needs a review.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] submitting-patches: Update test and documentation recommendations.

2017-07-06 Thread Ben Pfaff
On Thu, May 18, 2017 at 05:32:59AM -0700, Ben Pfaff wrote:
> Rationale:
> 
> - "make distcheck" is not as necessary anymore because we have a build-time
>   check that fails if files in the repository are not distributed.
> 
> - xenserver has not been important for years, so remove the specific
>   callout.
> 
> - We already have an informal custom of adding tests for new feaures and
>   bug fixes, so codify it.
> 
> - Add note about updating NEWS.
> 
> Signed-off-by: Ben Pfaff 

I'd appreciate review of this documentation-only patch.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] Business Offer

2017-07-06 Thread Asgari Targhi, Ameneh,Ph.D.

YOU BE INTERESTED IN A BUSINESS...?


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] `ovs-ofctl replace-flows` unnecessarily replaces some flows

2017-07-06 Thread Ben Pfaff
On Fri, May 12, 2017 at 09:06:35AM -0700, Kevin Lin wrote:
> Hi,
> 
> We’re running OVS2.6.1. If we insert a flow with an action such as 
> resubmit(,1), then call replace-flows with the same flow, it gets replaced. 
> Specifically, the duration shown in `ovs-ofctl dump-flows` resets to zero.
> 
> I took a look around, and it looks like this is the same bug as one for 
> `diff-flows` that Ben fixed awhile back 
> (https://github.com/openvswitch/ovs/commit/98f7f427bf8bb339d4d1f1df1ff9b3310f8f5bc4
>  
> ).

You're right.

Thanks for the report, and sorry it took so long to properly go through
it.  I posted a fix:
https://mail.openvswitch.org/pipermail/ovs-dev/2017-July/335032.html
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH] ovs-ofctl: Avoid unnecessary flow replacement in "replace-flows" command.

2017-07-06 Thread Ben Pfaff
The ovs-ofctl "diff-flows" and "replace-flows" command compare the flows
in two flow tables.  Until now, the "replace-flows" command has considered
certain almost meaningless differences related to the version of OpenFlow
used to add a flow as significant, which caused it to replace a flow by an
identical-in-practice version, e.g. in the following, the "replace-flows"
command prints a FLOW_MOD that adds the flow that was already added
previously:

$ cat > flows
actions=resubmit(,1)
$ ovs-vsctl add-br br0
$ ovs-ofctl del-flows br0
$ ovs-ofctl add-flows br0 flows
$ ovs-ofctl -vvconn replace-flows br0 flows 2>&1 | grep FLOW_MOD

Re-adding an existing flow has some effects, for example, it resets the
flow's duration, so it's better to avoid it.

This commit fixes the problem using the same trick previously used for a
similar problem with the "diff-flows" command, which was fixed in commit
98f7f427bf8b ("ovs-ofctl: Avoid printing false differences on "ovs-ofctl
diff-flows".").

Reported-by: Kevin Lin 
Signed-off-by: Ben Pfaff 
---
 include/openvswitch/ofp-actions.h |  2 ++
 lib/ofp-actions.c | 24 
 utilities/ovs-ofctl.c | 18 --
 3 files changed, 34 insertions(+), 10 deletions(-)

diff --git a/include/openvswitch/ofp-actions.h 
b/include/openvswitch/ofp-actions.h
index 7b4aa9201d9b..0dcb6452ea02 100644
--- a/include/openvswitch/ofp-actions.h
+++ b/include/openvswitch/ofp-actions.h
@@ -1013,6 +1013,8 @@ bool ofpacts_output_to_group(const struct ofpact[], 
size_t ofpacts_len,
  uint32_t group_id);
 bool ofpacts_equal(const struct ofpact a[], size_t a_len,
const struct ofpact b[], size_t b_len);
+bool ofpacts_equal_stringwise(const struct ofpact a[], size_t a_len,
+  const struct ofpact b[], size_t b_len);
 const struct mf_field *ofpact_get_mf_dst(const struct ofpact *ofpact);
 uint32_t ofpacts_get_meter(const struct ofpact[], size_t ofpacts_len);
 
diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c
index ae27d9d88080..868b511dc908 100644
--- a/lib/ofp-actions.c
+++ b/lib/ofp-actions.c
@@ -8316,6 +8316,8 @@ ofpacts_output_to_group(const struct ofpact *ofpacts, 
size_t ofpacts_len,
 return false;
 }
 
+/* Returns true if the 'a_len' bytes of actions in 'a' and the 'b_len' bytes of
+ * actions in 'b' are bytewise identical. */
 bool
 ofpacts_equal(const struct ofpact *a, size_t a_len,
   const struct ofpact *b, size_t b_len)
@@ -8323,6 +8325,28 @@ ofpacts_equal(const struct ofpact *a, size_t a_len,
 return a_len == b_len && !memcmp(a, b, a_len);
 }
 
+/* Returns true if the 'a_len' bytes of actions in 'a' and the 'b_len' bytes of
+ * actions in 'b' are identical when formatted as strings.  (Converting actions
+ * to string form suppresses some rarely meaningful differences, such as the
+ * 'compat' member of actions.) */
+bool
+ofpacts_equal_stringwise(const struct ofpact *a, size_t a_len,
+ const struct ofpact *b, size_t b_len)
+{
+struct ds a_s = DS_EMPTY_INITIALIZER;
+struct ds b_s = DS_EMPTY_INITIALIZER;
+
+ofpacts_format(a, a_len, NULL, _s);
+ofpacts_format(b, b_len, NULL, _s);
+
+bool equal = !strcmp(ds_cstr(_s), ds_cstr(_s));
+
+ds_destroy(_s);
+ds_destroy(_s);
+
+return equal;
+}
+
 /* Finds the OFPACT_METER action, if any, in the 'ofpacts_len' bytes of
  * 'ofpacts'.  If found, returns its meter ID; if not, returns 0.
  *
diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c
index 6fb2cc08de50..5b7f1b02104f 100644
--- a/utilities/ovs-ofctl.c
+++ b/utilities/ovs-ofctl.c
@@ -3146,8 +3146,8 @@ fte_version_equals(const struct fte_version *a, const 
struct fte_version *b)
 && a->hard_timeout == b->hard_timeout
 && a->importance == b->importance
 && a->table_id == b->table_id
-&& ofpacts_equal(a->ofpacts, a->ofpacts_len,
- b->ofpacts, b->ofpacts_len));
+&& ofpacts_equal_stringwise(a->ofpacts, a->ofpacts_len,
+b->ofpacts, b->ofpacts_len));
 }
 
 /* Clears 's', then if 's' has a version 'index', formats 'fte' and version
@@ -3656,15 +3656,13 @@ ofctl_diff_flows(struct ovs_cmdl_context *ctx)
 if (!a || !b || !fte_version_equals(a, b)) {
 fte_version_format(_state, fte, 0, _s);
 fte_version_format(_state, fte, 1, _s);
-if (strcmp(ds_cstr(_s), ds_cstr(_s))) {
-if (a_s.length) {
-printf("-%s", ds_cstr(_s));
-}
-if (b_s.length) {
-printf("+%s", ds_cstr(_s));
-}
-differences = true;
+if (a_s.length) {
+printf("-%s", ds_cstr(_s));
+}
+if (b_s.length) {

[ovs-dev] PROPOSAL:

2017-07-06 Thread
Hello Friend,

Do not be surprised about this mail, because it was personally directed to you. 
I need you to partner with me to execute a Business that will be of great 
benefit to both of us. It is about transferring the Sum of $19,500,000.00 USD 
from my Bank to a private account that I would advise you to open. My name is 
Mr. Cheng Jianguo. I work with Hang Seng Bank in Hong Kong. I will give you 
details of the transaction if I receive your response that you are willing and 
dependable to carry out the transaction with me in absolute confidentiality. I 
look forward to hearing from you.

Please Email me directly on my private email below: 
cjianguo...@gmail.com  

Sincerely yours.
Mr. Cheng Jianguo.

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

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


Re: [ovs-dev] ovn-nbctl and patch ports for logical routers

2017-07-06 Thread Ben Pfaff
On Fri, May 12, 2017 at 09:47:46AM -0400, Lance Richardson wrote:
> With branch-2.6, we've noticed a difference in behavior when configuring
> logical switch ports via "ovn-nbctl lsp-set-*" vs. using "ovn-nbctl set
> Logical_Switch_Port". The difference seems to be a matter of setting
> individual columns for a logical switch port in multiple transactions
> versus setting all of them in a single transaction.

This should not make a difference, but it is easy for bugs to creep in.

Is this still something that causes problems?  If so, let me know, and
I'll see if I can find the problem.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 2/2] Ovn tunnel encapsulation should consider both local and remote

2017-07-06 Thread Ben Pfaff
I took another look at this and now I understand the problem that it is
meant to solve.  I think that it assumes that a hypervisor that only
offers, for example, STT, to remote hypervisors, is not capable of
using Geneve or VXLAN for tunneling to remote hypervisors.  I don't
think that's a correct assumption.

On Mon, May 08, 2017 at 09:35:37AM +0800, xu.r...@zte.com.cn wrote:
> If one end is configured external-ids:ovn-encap-type=geneve,stt,the other 
> end is configured external-ids:ovn-encap-type=stt,
> then the tunnel is not available based on the current 
> implementation,because one end is geneve,the other end is stt.
> After this revision,the tunnel will be stt on both ends,and it will be 
> available.
> 
> 
> 
> 
> 
> 发件人: xurong00037997 
> 收件人: d...@openvswitch.org, 
> 抄送:   xurong00037997 
> 日期:   2017/05/04 10:00
> 主题:   [PATCH 2/2] Ovn tunnel encapsulation should consider both local 
> and remote
> 
> 
> 
> ---
>  ovn/controller/encaps.c | 13 ++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/ovn/controller/encaps.c b/ovn/controller/encaps.c
> index f187a8f..5da7fbe 100644
> --- a/ovn/controller/encaps.c
> +++ b/ovn/controller/encaps.c
> @@ -136,14 +136,14 @@ exit:
>  }
>  
>  static struct sbrec_encap *
> -preferred_encap(const struct sbrec_chassis *chassis_rec)
> +preferred_encap(const struct sbrec_chassis *chassis_rec, uint32_t 
> all_encap_type)
>  {
>  struct sbrec_encap *best_encap = NULL;
>  uint32_t best_type = 0;
>  
>  for (int i = 0; i < chassis_rec->n_encaps; i++) {
>  uint32_t tun_type = 
> get_tunnel_type(chassis_rec->encaps[i]->type);
> -if (tun_type > best_type) {
> +if (tun_type > best_type && (tun_type & all_encap_type)) {
>  best_type = tun_type;
>  best_encap = chassis_rec->encaps[i];
>  }
> @@ -197,11 +197,18 @@ encaps_run(struct controller_ctx *ctx, const struct 
> ovsrec_bridge *br_int,
>  }
>  }
>  }
> + 
> +const struct sbrec_chassis *lchassis_rec
> += get_chassis(ctx->ovnsb_idl, chassis_id);
> +uint32_t all_encap_type = 0;
> +for (int i = 0; i < lchassis_rec->n_encaps; i++) {
> +all_encap_type |= get_tunnel_type(lchassis_rec->encaps[i]->type);
> +}
>  
>  SBREC_CHASSIS_FOR_EACH(chassis_rec, ctx->ovnsb_idl) {
>  if (strcmp(chassis_rec->name, chassis_id)) {
>  /* Create tunnels to the other chassis. */
> -const struct sbrec_encap *encap = 
> preferred_encap(chassis_rec);
> +const struct sbrec_encap *encap = 
> preferred_encap(chassis_rec,all_encap_type);
>  if (!encap) {
>  VLOG_INFO("No supported encaps for '%s'", 
> chassis_rec->name);
>  continue;
> -- 
> 2.8.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] RFC: ovs-dump-flows utility

2017-07-06 Thread Ben Pfaff
On Mon, May 08, 2017 at 11:47:46AM -0400, Aaron Conole wrote:
> Hi Ben,
> 
> Thanks for the look!
> 
> Ben Pfaff  writes:
> 
> > On Fri, Apr 28, 2017 at 04:44:32PM -0400, Aaron Conole wrote:
> >> Greetings dev,
> >> 
> >> I have whipped up a quick little utility (find below), that I've done a
> >> bit of debugging with and it seems to have made working with dump-flows
> >> from ovs-ofctl a little easier to use.
> >> 
> >> If you think it's worthwhile to add to the repository, I'll submit it
> >> formally.  We were using it while debugging some strange packet
> >> forwarding in openshift.
> >> 
> >> -Aaron
> >
> > Thanks for working to make the ovs-ofctl formatting better!
> >
> > I prefer to interpret this script as a kind of "feature request" for
> > "ovs-ofctl dump-flows".  This command already has some special support,
> > compared to other ovs-ofctl commands, and it might make sense to
> > continue adding to it.
> 
> In which way?  It calls the same ofp-print code, iirc.
> 
> > ovs-ofctl dump-flows already has one of the features that this script
> > adds, that is, sorting the flows and removing "OFPST_FLOW" lines.  You
> > turn this on by using the "--sort" (or "--rsort") option.
> 
> Ahh, cool - I missed that.
> 
> > The other features that this script provides all seem like ones that
> > would be useful to add to ovs-ofctl itself.  I'd tend to prefer to
> > continue enhancing it rather than adding wrapper scripts; I think that
> > this is likely to yield a more coherent design in the end, and possibly
> > higher quality.  Is that something you're willing to consider?
> 
> I had started to work on this, back in December, but there were hundreds
> of lines of existing formatting code that would have to change (this is
> related to the discussion here:
> https://mail.openvswitch.org/pipermail/ovs-dev/2016-December/326560.html),
> and I thought it might be a better use of time to simply wrap the output
> - especially since I didn't know if any future changes in that area were
> going to happen.  The last thing I want to do is break the existing
> output (which I do use quite a bit for debugging, so retraining myself
> would be painful) if someone has scripts which rely on it.
> Additionally, quite a few print commands would have changed to give the
> data to the table structure, rather than a long string.  It looked to be
> a rather large change for something that could be resolved with a
> wrapper.  Maybe I misinterpreted your response (from here
> https://mail.openvswitch.org/pipermail/ovs-dev/2016-December/326201.html).
> 
> The other thing that adds complication is replacing the port numbers
> with names from the database.  That would require a second transaction
> (unless there's a way to batch that during the initial dump-flows
> request, but I couldn't see an obvious way), and I didn't know if it
> would be okay to do (and how to treat failures... after all, it's
> convenient, but it isn't requisite to have the numbers replaced with
> names).  There are a few minor changes I have to my copy of the script
> (I've added back the packet counts, and I have the port output in a way
> that we can not-quite paste the flow back in to an add-flow), but I
> ended up also using the direct output of dump-flows.
> 
> As for how to implement it, I could have put some kind of post processor
> that would split the strings up (the way I have done with the script),
> but that felt rather hacky (since it's basically the formatting script,
> but in c-code form).
> 
> Anyway, I submitted this as a start.  If you think it's better to do the
> work in the ofp-print library then I can revisit it.  Maybe the reduced
> set of things that were really helpful, and the rest we can just say
> "don't fear sed".

Since this discussion, I've added what I think are the script's most
important features directly to ovs-ofctl.  Are the remaining features,
not yet in ovs-ofctl, important you?  Which ones?
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] flake8 checking for release branches

2017-07-06 Thread Ben Pfaff
On Tue, May 02, 2017 at 09:58:03PM -0400, Russell Bryant wrote:
> On Mon, May 1, 2017 at 1:26 PM, Ben Pfaff  wrote:
> > There's a bit of a problem with flake8 and release branches.  The
> > release branches mainly stay the same, but flake8 marches on, and the
> > result is that building an old branch, e.g. branch-2.6, with modern
> > flake8 causes errors that break the build.
> >
> > I can think of several ways to deal with this:
> 
> In OpenStack, we pin to a specific version to avoid this type of
> problem.  It's not so easy to use that solution here since we're just
> using whatever version of flake8 is installed on the system.
> 
> > * Do something different on master and release branches,
> >   e.g. change errors to warnings when we branch for release.
> >
> > * Only make flake8 warnings into errors when configured with
> >   --enable-Werror.
> 
> This one sounds good to me.

OK, I sent a patch:
https://mail.openvswitch.org/pipermail/ovs-dev/2017-July/335025.html

I expect to backport this to any OVS version that used flake8 (2.7 and
2.6, at least).
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH] Makefiles: Fail build for flake8 only when configured with --enable-Werror.

2017-07-06 Thread Ben Pfaff
flake8 checking is useful.  Until now, it always failed the build for any
flake8 errors.  This is too aggressive, for the same reason that always
failing the build for any compiler warnings is too aggressive: compilers
change over time and asynchronously from OVS itself.  Thus, if we release
some version of OVS today, even if it's flake8-clean today, it might not
be flake8-clean tomorrow, even with the same settings.  We don't want to
have to track flake8 warnings on every release branch.

Thus, this adopts the same policy for compiler warnings: always report
them, but only fail the build if --enable-Werror was configured.  Usually
just developers use that configure option, and they're prepared to deal
with the fallout.

Signed-off-by: Ben Pfaff 
---
 Makefile.am  |  2 +-
 acinclude.m4 | 11 ++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index d810a5e72c72..7e11e04ac748 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -365,7 +365,7 @@ ALL_LOCAL += flake8-check
 FLAKE8_SELECT = H231,H232,H233,H238
 FLAKE8_IGNORE = E121,E123,E125,E126,E127,E128,E129,E131,W503,F811,D,H,I
 flake8-check: $(FLAKE8_PYFILES)
-   $(AM_V_GEN) \
+   $(FLAKE8_WERROR)$(AM_V_GEN) \
  src='$^' && \
  flake8 $$src --select=$(FLAKE8_SELECT) $(FLAKE8_FLAGS) && \
  flake8 $$src --ignore=$(FLAKE8_IGNORE) $(FLAKE8_FLAGS) && \
diff --git a/acinclude.m4 b/acinclude.m4
index 7d7b6832bc2e..b8b43d9c377a 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -23,7 +23,16 @@ AC_DEFUN([OVS_ENABLE_WERROR],
AC_CONFIG_COMMANDS_PRE(
  [if test "X$enable_Werror" = Xyes; then
 OVS_CFLAGS="$OVS_CFLAGS -Werror"
-  fi])])
+  fi])
+
+   # Unless --enable-Werror is specified, report but do not fail the build
+   # for errors reported by flake8.
+   if test "X$enable_Werror" = Xyes; then
+ FLAKE8_WERROR=
+   else
+ FLAKE8_WERROR=-
+   fi
+   AC_SUBST([FLAKE8_WERROR])])
 
 dnl OVS_CHECK_LINUX
 dnl
-- 
2.10.2

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


Re: [ovs-dev] [PATCH] configure: Fix check for rte_config.h to handle cross-compilation.

2017-07-06 Thread Darrell Ball


On 7/6/17, 2:36 PM, "ovs-dev-boun...@openvswitch.org on behalf of Ben Pfaff" 
 wrote:

Can someone review this please?

On Mon, May 01, 2017 at 10:30:27AM -0700, Ben Pfaff wrote:
> Hemant, does this fix the problem you reported?
> 
> On Fri, Apr 14, 2017 at 09:14:55PM -0700, Ben Pfaff wrote:
> > The check for rte_config.h in acinclude.m4 used AC_CHECK_FILE, but this
> > macro is intended to check for a file on the host system, not the build
> > system, which means that it fails unconditionally in a cross-compilation
> > environment.  However, the intended check here is for a header file,
> > which is part of the build system.  To check for part of the build 
system,
> > we can just use "test", so this commit makes that change.
> > 
> > Reported-by: Hemant Agrawal 
> > Reported-at: 
https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_pipermail_ovs-2Ddev_2017-2DMarch_329994.html=DwICAg=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=9SEip3J9loq15hpoutcyARnoiI9CS9RRVfT0oFE5C8k=dOQYeMGyHRUBxuPzkJLkr2oUHFTObc-qjwZhHCDFTrU=
 
> > Signed-off-by: Ben Pfaff 
> > ---
> >  acinclude.m4 | 7 ---
> >  1 file changed, 4 insertions(+), 3 deletions(-)
> > 
> > diff --git a/acinclude.m4 b/acinclude.m4
> > index 744d8f89525c..842469455914 100644
> > --- a/acinclude.m4
> > +++ b/acinclude.m4
> > @@ -180,9 +180,10 @@ AC_DEFUN([OVS_CHECK_DPDK], [
> >  DPDK_INCLUDE="$with_dpdk/include"
> >  # If 'with_dpdk' is passed install directory, point to headers
> >  # installed in $DESTDIR/$prefix/include/dpdk
> > -AC_CHECK_FILE([$DPDK_INCLUDE/rte_config.h], [],
> > -  [AC_CHECK_FILE([$DPDK_INCLUDE/dpdk/rte_config.h],
> > - 
[DPDK_INCLUDE=$DPDK_INCLUDE/dpdk], [])])
> > +   if test ! -e "$DPDK_INCLUDE/rte_config.h" && \
> > +  test -e "$DPDK_INCLUDE/dpdk/rte_config.h"; then
> > +  DPDK_INCLUDE=$DPDK_INCLUDE/dpdk/rte_config.h

Did you mean 
DPDK_INCLUDE=$DPDK_INCLUDE/dpdk
rather than
DPDK_INCLUDE=$DPDK_INCLUDE/dpdk/rte_config.h 
?


> > +   fi
> >  DPDK_LIB_DIR="$with_dpdk/lib"
> >  ;;
> >  esac
> > -- 
> > 2.10.2
> > 
___
dev mailing list
d...@openvswitch.org

https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev=DwICAg=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=9SEip3J9loq15hpoutcyARnoiI9CS9RRVfT0oFE5C8k=5mgaD8RH43sN-x5q37TpOgF-sG-M7rA0u3U4L9eOrP0=
 


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


Re: [ovs-dev] [PATCH] configure: Fix check for rte_config.h to handle cross-compilation.

2017-07-06 Thread Ben Pfaff
Can someone review this please?

On Mon, May 01, 2017 at 10:30:27AM -0700, Ben Pfaff wrote:
> Hemant, does this fix the problem you reported?
> 
> On Fri, Apr 14, 2017 at 09:14:55PM -0700, Ben Pfaff wrote:
> > The check for rte_config.h in acinclude.m4 used AC_CHECK_FILE, but this
> > macro is intended to check for a file on the host system, not the build
> > system, which means that it fails unconditionally in a cross-compilation
> > environment.  However, the intended check here is for a header file,
> > which is part of the build system.  To check for part of the build system,
> > we can just use "test", so this commit makes that change.
> > 
> > Reported-by: Hemant Agrawal 
> > Reported-at: 
> > https://mail.openvswitch.org/pipermail/ovs-dev/2017-March/329994.html
> > Signed-off-by: Ben Pfaff 
> > ---
> >  acinclude.m4 | 7 ---
> >  1 file changed, 4 insertions(+), 3 deletions(-)
> > 
> > diff --git a/acinclude.m4 b/acinclude.m4
> > index 744d8f89525c..842469455914 100644
> > --- a/acinclude.m4
> > +++ b/acinclude.m4
> > @@ -180,9 +180,10 @@ AC_DEFUN([OVS_CHECK_DPDK], [
> >  DPDK_INCLUDE="$with_dpdk/include"
> >  # If 'with_dpdk' is passed install directory, point to headers
> >  # installed in $DESTDIR/$prefix/include/dpdk
> > -AC_CHECK_FILE([$DPDK_INCLUDE/rte_config.h], [],
> > -  [AC_CHECK_FILE([$DPDK_INCLUDE/dpdk/rte_config.h],
> > - [DPDK_INCLUDE=$DPDK_INCLUDE/dpdk], 
> > [])])
> > +   if test ! -e "$DPDK_INCLUDE/rte_config.h" && \
> > +  test -e "$DPDK_INCLUDE/dpdk/rte_config.h"; then
> > +  DPDK_INCLUDE=$DPDK_INCLUDE/dpdk/rte_config.h
> > +   fi
> >  DPDK_LIB_DIR="$with_dpdk/lib"
> >  ;;
> >  esac
> > -- 
> > 2.10.2
> > 
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH] bridge: Avoid read of uninitialized data configuring Auto-Attach.

2017-07-06 Thread Ben Pfaff
Reported-by: "qintao (F)" 
Reported-at: 
https://mail.openvswitch.org/pipermail/ovs-discuss/2017-April/044309.html
Signed-off-by: Ben Pfaff 
---
 vswitchd/bridge.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index 8336d7048dd1..f24fb9d72da9 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -3895,7 +3895,7 @@ bridge_configure_aa(struct bridge *br)
 union ovsdb_atom atom;
 
 atom.integer = m->isid;
-if (ovsdb_datum_find_key(mc, , OVSDB_TYPE_UUID) == UINT_MAX) {
+if (ovsdb_datum_find_key(mc, , OVSDB_TYPE_INTEGER) == UINT_MAX) {
 VLOG_INFO("Deleting isid=%"PRIu32", vlan=%"PRIu16,
   m->isid, m->vlan);
 bridge_aa_mapping_destroy(m);
-- 
2.10.2

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


Re: [ovs-dev] [PATCH v3 2/6] ovn: l3ha, ovn-northd gateway chassis propagation

2017-07-06 Thread Russell Bryant
On Wed, Jul 5, 2017 at 9:45 AM, Miguel Angel Ajo  wrote:
> The redirect-chassis option of logical router ports is now
> translated to Gateway_Chassis entries for backwards compatibility.
>
> Gateway_Chassis entries in nbdb are copied over to sbdb and
> linked them to the Chassis entry.
>
> Signed-off-by: Miguel Angel Ajo 
> Signed-off-by: Anil Venkata 
> ---
>  ovn/lib/automake.mk |   2 +
>  ovn/lib/chassis-index.c |  84 ++
>  ovn/lib/chassis-index.h |  40 +
>  ovn/northd/ovn-northd.c | 224 
> ++--
>  tests/ovn.at|  52 +++
>  5 files changed, 393 insertions(+), 9 deletions(-)
>  create mode 100644 ovn/lib/chassis-index.c
>  create mode 100644 ovn/lib/chassis-index.h
>
> diff --git a/ovn/lib/automake.mk b/ovn/lib/automake.mk
> index b86237e..9ad8b6a 100644
> --- a/ovn/lib/automake.mk
> +++ b/ovn/lib/automake.mk
> @@ -5,6 +5,8 @@ ovn_lib_libovn_la_LDFLAGS = \
>  $(AM_LDFLAGS)
>  ovn_lib_libovn_la_SOURCES = \
> ovn/lib/actions.c \
> +   ovn/lib/chassis-index.c \
> +   ovn/lib/chassis-index.h \
> ovn/lib/expr.c \
> ovn/lib/lex.c \
> ovn/lib/ovn-dhcp.h \
> diff --git a/ovn/lib/chassis-index.c b/ovn/lib/chassis-index.c
> new file mode 100644
> index 000..e1d6cb3
> --- /dev/null
> +++ b/ovn/lib/chassis-index.c
> @@ -0,0 +1,84 @@
> +/* Copyright (c) 2016, 2017 Red Hat, Inc.
> + * Licensed under the Apache License, Version 2.0 (the "License");
> + * you may not use this file except in compliance with the License.
> + * You may obtain a copy of the License at:
> + *
> + * http://www.apache.org/licenses/LICENSE-2.0
> + *
> + * Unless required by applicable law or agreed to in writing, software
> + * distributed under the License is distributed on an "AS IS" BASIS,
> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> + * See the License for the specific language governing permissions and
> + * limitations under the License.
> + */
> +
> +#include 
> +
> +#include 

This include probably isn't needed.

> +
> +#include "openvswitch/hmap.h"
> +#include "openvswitch/vlog.h"
> +#include "ovn/actions.h"
> +#include "ovn/lib/chassis-index.h"
> +#include "ovn/lib/ovn-sb-idl.h"
> +
> +VLOG_DEFINE_THIS_MODULE(chassis_index);
> +
> +struct chassis {
> +struct hmap_node name_node;
> +const struct sbrec_chassis *db;
> +};
> +
> +const struct sbrec_chassis *
> +chassis_lookup_by_name(const struct chassis_index *chassis_index,
> +   const char *name)
> +{
> +const struct chassis *chassis;
> +HMAP_FOR_EACH_WITH_HASH (chassis, name_node, hash_string(name, 0),
> + _index->by_name) {
> +if (!strcmp(chassis->db->name, name)) {
> +return chassis->db;
> +}
> +}
> +return NULL;
> +}
> +
> +void
> +chassis_index_init(struct chassis_index *chassis_index,
> +   struct ovsdb_idl *sb_idl)
> +{
> +hmap_init(_index->by_name);
> +
> +const struct sbrec_chassis *chassis;
> +SBREC_CHASSIS_FOR_EACH (chassis, sb_idl) {
> +if (!chassis->name) {
> +continue;
> +}
> +if (chassis_lookup_by_name(chassis_index, chassis->name)) {
> +VLOG_WARN("duplicate chassis name '%s'",
> + chassis->name);
> +continue;
> +}

I don't think you need this duplicate check.  The OVN_Southbound
schema already enforces that Chassis rows have a unique name.  See
ovn-sb.ovsschema:

 "indexes": [["name"]]},

> +struct chassis *c = xmalloc(sizeof *c);
> +hmap_insert(_index->by_name, >name_node,
> +hash_string(chassis->name, 0));
> +c->db = chassis;
> +}
> +}
> +
> +void
> +chassis_index_destroy(struct chassis_index *chassis_index)
> +{
> +if (!chassis_index) {
> +return;
> +}
> +
> +/* Destroy all of the "struct chassis"s. */
> +struct chassis *chassis, *next;
> +HMAP_FOR_EACH_SAFE (chassis, next, name_node, _index->by_name) {
> +hmap_remove(_index->by_name, >name_node);
> +free(chassis);
> +}
> +
> +hmap_destroy(_index->by_name);
> +}
> diff --git a/ovn/lib/chassis-index.h b/ovn/lib/chassis-index.h
> new file mode 100644
> index 000..a490cbb
> --- /dev/null
> +++ b/ovn/lib/chassis-index.h
> @@ -0,0 +1,40 @@
> +/* Copyright (c) 2017, Red Hat, Inc.
> + *
> + * Licensed under the Apache License, Version 2.0 (the "License");
> + * you may not use this file except in compliance with the License.
> + * You may obtain a copy of the License at:
> + *
> + * http://www.apache.org/licenses/LICENSE-2.0
> + *
> + * Unless required by applicable law or agreed to in writing, software
> + * distributed under the License is distributed on an "AS IS" BASIS,
> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> + 

[ovs-dev] Bug#860786: Bug#860786: README.Debian: include IPv6 in examples for /etc/network/interfaces

2017-07-06 Thread Ben Pfaff
On Thu, Apr 20, 2017 at 08:00:20AM +0200, Daniel Pocock wrote:
> Package: openvswitch-switch
> Version: 2.3.0+git20140819-3+deb8u1
> Severity: wishlist
> 
> 
> Looking at the examples for /etc/network/interfaces, none of them
> include IPv6.
> 
> I've tried configuring it using the example below and it appears to be
> working fine in a dual stack DHCP environment.
> 
> In another environment, I used an "up ip addr add [ipv6 addr] ..."
> command in the inet stanza
> 
> Please confirm if the inet6 stanza is fully supported and if this is the
> right way to use it and consider adding it to README.Debian:
> 
> 
> 
> 
> # This file describes the network interfaces available on your system
> # and how to activate them. For more information, see interfaces(5).
> 
> # The loopback network interface
> auto lo
> iface lo inet loopback
> 
> auto ovsbr0
> iface ovsbr0 inet dhcp
>   ovs_type OVSBridge
> ovs_ports eth0
> 
> iface ovsbr0 inet6 dhcp
> ovs_type OVSBridge
> ovs_ports eth0
> 
> allow-ovsbr0 eth0
> iface eth0 inet manual
> ovs_bridge ovsbr0
> ovs_type OVSPort

I think there is a missing space between "allow-ovs" and "br0" above.

Guru, do these examples look correct otherwise?  Would it make sense to
include an inet6 example like the one above?

Thanks,

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


[ovs-dev] [PATCH repost] dpdk: Refactor and simplify calculating vhost socket dir.

2017-07-06 Thread Ben Pfaff
It took me a few minutes to figure out what the code for deciding on the
vhost socket directory was doing, because it was needlessly complicated.
This simplifies it.

Build tested only.

Signed-off-by: Ben Pfaff 
---
This is a repost of a patch first posted in April.

 lib/dpdk.c | 64 ++
 1 file changed, 23 insertions(+), 41 deletions(-)

diff --git a/lib/dpdk.c b/lib/dpdk.c
index 8da6c324407e..1bd31ba345f5 100644
--- a/lib/dpdk.c
+++ b/lib/dpdk.c
@@ -42,29 +42,29 @@ static FILE *log_stream = NULL;   /* Stream for DPDK 
log redirection */
 
 static char *vhost_sock_dir = NULL;   /* Location of vhost-user sockets */
 
-static int
-process_vhost_flags(char *flag, const char *default_val, int size,
-const struct smap *ovs_other_config,
-char **new_val)
+static char *
+get_custom_vhost_sock_dir(const char *stem, const char *suffix)
 {
-const char *val;
-int changed = 0;
+if (!suffix) {
+return NULL;
+}
 
-val = smap_get(ovs_other_config, flag);
+if (strstr(suffix, "..")) {
+VLOG_ERR("ignoring vhost-sock-dir '%s' with invalid characters '..'",
+ suffix);
+return NULL;
+}
 
-/* Process the vhost-sock-dir flag if it is provided, otherwise resort to
- * default value.
- */
-if (val && (strlen(val) <= size)) {
-changed = 1;
-*new_val = xstrdup(val);
-VLOG_INFO("User-provided %s in use: %s", flag, *new_val);
-} else {
-VLOG_INFO("No %s provided - defaulting to %s", flag, default_val);
-*new_val = xstrdup(default_val);
+struct stat s;
+char *dir = xasprintf("%s/%s", stem, suffix);
+if (stat(dir, )) {
+VLOG_ERR("%s: ignoring requested vhost socket directory (%s)",
+ dir, ovs_strerror(errno));
+free(dir);
+return NULL;
 }
 
-return changed;
+return dir;
 }
 
 static char **
@@ -311,7 +311,6 @@ dpdk_init__(const struct smap *ovs_other_config)
 bool auto_determine = true;
 int err = 0;
 cpu_set_t cpuset;
-char *sock_dir_subcomponent;
 
 log_stream = fopencookie(NULL, "w+", dpdk_log_func);
 if (log_stream == NULL) {
@@ -321,28 +320,11 @@ dpdk_init__(const struct smap *ovs_other_config)
 rte_openlog_stream(log_stream);
 }
 
-if (process_vhost_flags("vhost-sock-dir", ovs_rundir(),
-NAME_MAX, ovs_other_config,
-_dir_subcomponent)) {
-struct stat s;
-if (!strstr(sock_dir_subcomponent, "..")) {
-vhost_sock_dir = xasprintf("%s/%s", ovs_rundir(),
-   sock_dir_subcomponent);
-
-err = stat(vhost_sock_dir, );
-if (err) {
-VLOG_ERR("vhost-user sock directory '%s' does not exist.",
- vhost_sock_dir);
-}
-} else {
-vhost_sock_dir = xstrdup(ovs_rundir());
-VLOG_ERR("vhost-user sock directory request '%s/%s' has invalid"
- "characters '..' - using %s instead.",
- ovs_rundir(), sock_dir_subcomponent, ovs_rundir());
-}
-free(sock_dir_subcomponent);
-} else {
-vhost_sock_dir = sock_dir_subcomponent;
+vhost_sock_dir = get_custom_vhost_sock_dir(ovs_rundir(),
+   smap_get(ovs_other_config,
+"vhost-sock-dir"));
+if (!vhost_sock_dir) {
+vhost_sock_dir = xstrdup(ovs_rundir());
 }
 
 argv = grow_argv(, 0, 1);
-- 
2.10.2

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


Re: [ovs-dev] [PATCH v4 0/7] Packet type aware pipeline

2017-07-06 Thread Darrell Ball
btw, I asked Andy to check on his Trusty system and he observes
the same failure. 

On 7/6/17, 1:39 PM, "Darrell Ball"  wrote:



On 7/6/17, 1:22 PM, "Eric Garver"  wrote:

On Thu, Jul 06, 2017 at 03:59:51PM +, Darrell Ball wrote:
> Patch 4 added unit tests
> One test was added to system userspace.
> I ran it many times and it has never passed.
> Is something missing in the test or supporting code ?

Works for me. Maybe there is a timing problem?

Thanks
There are races in the system tests, but those tests will pass on a second 
attempt.
This is 100% failure.

OVS: current master (fb16fec66498)

Tip of master - same for me

Kernel: 4.12.0-rc7+

I tried 2 kernels 4.2.0 and 3.19 – always fails in both.

OS: RHEL 7.4-ish

I really hope the distro is not relevant here
If you have reason to think so, pls speak up


> 
> ## -- ##
> ## openvswitch 2.7.90 test suite. ##
> ## -- ##
>  94: ptap - triangle bridge setup with L2 and L3 GRE tunnels FAILED 
(system-userspace-packet-type-aware.at:344)
> 
> ## - ##
> ## Test results. ##
> ## - ##
> 
> ERROR: 1 test was run,
> 1 failed unexpectedly.
> ## --- ##
> ## system-userspace-testsuite.log was created. ##
> ## --- ##
> 
> Please send `tests/system-userspace-testsuite.log' and all 
information you think might help:
> 
>To: 
>Subject: [openvswitch 2.7.90] system-userspace-testsuite: 94 failed
> 
> You may investigate any problem if you feel able to do so, in which
> case the test suite provides a good starting point.  Its output may
> be found below `tests/system-userspace-testsuite.dir'.
> 
> make: *** [check-system-userspace] Error 1
> make: Leaving directory `/home/dball/openvswitch/ovs/_gcc'
> 
> 
> 
> 
> On 6/27/17, 2:29 PM, "ovs-dev-boun...@openvswitch.org on behalf of 
Ben Pfaff"  wrote:
> 
> On Fri, Jun 23, 2017 at 04:47:48PM +, Zoltán Balogh wrote:
> > 
> > This series was started by Ben Pfaff, v3 can be found here:
> > 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_778070_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=01fMZLg-sq_Rf_2X9TcxmtDN0Vx2hS2v4BABA77en0w=
 
> > 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_778071_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=5fpQZh33OQ_0AGjRuJNQqvS-1E6yhFoD5TxUoLayzwM=
 
> > 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_778076_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=rqnhEoIuJ9rECQaXZafZGrAW9us8y184GCexqK8VUxQ=
 
> > 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_778072_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=p5Fnh2SQ8fUrNF0V8ChNRQyQLmbjiuvKRd1UUwE93s8=
 
> > 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_778074_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=02CPoSKkiGGsFX4neL8TpGa75VUPaaeNYWz_2WbqBsQ=
 
> > 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_778073_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=eMl7m4NpJSD07nXTN_oOdQFvysmJnclSRw39GgGg9BQ=
 
> > 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_778075_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=71zSrD_kcUjZwuKvjfeqam_rdCpeXuxtm4TW_SsZ_3w=
 
> > 
> > Ben's series is based on this one:
> > 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_770490_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=W1AcbVTr4qKOBEfQuMSmVH-Illfhs0R3TYJs1s9HtfU=
 
> > 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_770487_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=EHhVEHj-Pvdl0I609BkK_Z44CV-641MVWlLy7rZH6Qo=
 
> > 

[ovs-dev] [PATCH] pkt reassemble: fix kernel panic for ovs reassemble

2017-07-06 Thread Ben Pfaff
From: wangzhike 

Ovs and kernel stack would add frag_queue to same netns_frags list.
As result, ovs and kernel may access the fraq_queue without correct
lock. Also the struct ipq may be different on kernel(older than 4.3),
which leads to invalid pointer access.

The fix creates specific netns_frags for ovs.

Signed-off-by: wangzhike 
---
This was originally posted at:
https://github.com/openvswitch/ovs/pull/187
I'm reposting it to ovs-dev to make sure that it gets attention.

 datapath/datapath.c| 22 +++---
 datapath/datapath.h|  6 ++
 datapath/linux/compat/include/net/inet_frag.h  | 18 -
 datapath/linux/compat/include/net/ip.h |  4 ++
 .../include/net/netfilter/ipv6/nf_defrag_ipv6.h|  4 ++
 datapath/linux/compat/inet_fragment.c  | 83 --
 datapath/linux/compat/ip_fragment.c| 66 ++---
 datapath/linux/compat/nf_conntrack_reasm.c | 58 +--
 8 files changed, 138 insertions(+), 123 deletions(-)

diff --git a/datapath/datapath.c b/datapath/datapath.c
index c85029c067ca..82cad74b7972 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -2297,6 +2297,8 @@ static int __net_init ovs_init_net(struct net *net)
INIT_LIST_HEAD(_net->dps);
INIT_WORK(_net->dp_notify_work, ovs_dp_notify_wq);
ovs_ct_init(net);
+   ovs_netns_frags_init(net);
+   ovs_netns_frags6_init(net);
return 0;
 }
 
@@ -2332,6 +2334,8 @@ static void __net_exit ovs_exit_net(struct net *dnet)
struct net *net;
LIST_HEAD(head);
 
+   ovs_netns_frags6_exit(dnet);
+   ovs_netns_frags_exit(dnet);
ovs_ct_exit(dnet);
ovs_lock();
list_for_each_entry_safe(dp, dp_next, _net->dps, list_node)
@@ -2368,13 +2372,9 @@ static int __init dp_init(void)
 
pr_info("Open vSwitch switching datapath %s\n", VERSION);
 
-   err = compat_init();
-   if (err)
-   goto error;
-
err = action_fifos_init();
if (err)
-   goto error_compat_exit;
+   goto error;
 
err = ovs_internal_dev_rtnl_link_register();
if (err)
@@ -2392,10 +2392,14 @@ static int __init dp_init(void)
if (err)
goto error_vport_exit;
 
-   err = register_netdevice_notifier(_dp_device_notifier);
+   err = compat_init();
if (err)
goto error_netns_exit;
 
+   err = register_netdevice_notifier(_dp_device_notifier);
+   if (err)
+   goto error_compat_exit;
+
err = ovs_netdev_init();
if (err)
goto error_unreg_notifier;
@@ -2410,6 +2414,8 @@ error_unreg_netdev:
ovs_netdev_exit();
 error_unreg_notifier:
unregister_netdevice_notifier(_dp_device_notifier);
+error_compat_exit:
+   compat_exit();
 error_netns_exit:
unregister_pernet_device(_net_ops);
 error_vport_exit:
@@ -2420,8 +2426,6 @@ error_unreg_rtnl_link:
ovs_internal_dev_rtnl_link_unregister();
 error_action_fifos_exit:
action_fifos_exit();
-error_compat_exit:
-   compat_exit();
 error:
return err;
 }
@@ -2431,13 +2435,13 @@ static void dp_cleanup(void)
dp_unregister_genl(ARRAY_SIZE(dp_genl_families));
ovs_netdev_exit();
unregister_netdevice_notifier(_dp_device_notifier);
+   compat_exit();
unregister_pernet_device(_net_ops);
rcu_barrier();
ovs_vport_exit();
ovs_flow_exit();
ovs_internal_dev_rtnl_link_unregister();
action_fifos_exit();
-   compat_exit();
 }
 
 module_init(dp_init);
diff --git a/datapath/datapath.h b/datapath/datapath.h
index b835adac5bf9..88496257d486 100644
--- a/datapath/datapath.h
+++ b/datapath/datapath.h
@@ -141,6 +141,12 @@ struct ovs_net {
 
/* Module reference for configuring conntrack. */
bool xt_label;
+
+#ifdef HAVE_INET_FRAG_LRU_MOVE
+   struct net *net;
+   struct netns_frags ipv4_frags;
+   struct netns_frags nf_frags;
+#endif
 };
 
 extern unsigned int ovs_net_id;
diff --git a/datapath/linux/compat/include/net/inet_frag.h 
b/datapath/linux/compat/include/net/inet_frag.h
index 01d79ad8147b..34078c80db0f 100644
--- a/datapath/linux/compat/include/net/inet_frag.h
+++ b/datapath/linux/compat/include/net/inet_frag.h
@@ -52,22 +52,4 @@ static inline int rpl_inet_frags_init(struct inet_frags 
*frags)
 #define inet_frags_init rpl_inet_frags_init
 #endif
 
-#ifndef HAVE_CORRECT_MRU_HANDLING
-/* We reuse the upstream inet_fragment.c common code for managing fragment
- * stores, However we actually store the fragments within our own 'inet_frags'
- * structures (in {ip_fragment,nf_conntrack_reasm}.c). When unloading the OVS
- * kernel module, we need to flush all of the remaining fragments from these
- * caches, or else we will panic with the following sequence of events:
- *
- * 1) A fragment for a packet 

[ovs-dev] Bug#863662: openvswitch: CVE-2017-9265

2017-07-06 Thread Moritz Muehlenhoff
On Mon, May 29, 2017 at 10:16:50PM +0200, Salvatore Bonaccorso wrote:
> Source: openvswitch
> Version: 2.6.2~pre+git20161223-3
> Severity: normal
> Tags: upstream patch security
> 
> Hi,
> 
> the following vulnerability was published for openvswitch.
> 
> CVE-2017-9265[0]:
> | In Open vSwitch (OvS) v2.7.0, there is a buffer over-read while parsing
> | the group mod OpenFlow message sent from the controller in
> | `lib/ofp-util.c` in the function `ofputil_pull_ofp15_group_mod`.
> 
> this should be only in the OpenFlow 1.5+ support, not sure the message
> mentions this is not enabled by default. Affected source it as least
> there.

Maintainers, can you please clarify what

| This bug is part of OpenFlow 1.5 support.  Open vSwitch does not enable
| OpenFlow 1.5 support by default.

entails, is that something that's not compiled-in in the Debian package
or what "does not support" mean exactly?

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


Re: [ovs-dev] [PATCH v4 0/7] Packet type aware pipeline

2017-07-06 Thread Darrell Ball


On 7/6/17, 1:22 PM, "Eric Garver"  wrote:

On Thu, Jul 06, 2017 at 03:59:51PM +, Darrell Ball wrote:
> Patch 4 added unit tests
> One test was added to system userspace.
> I ran it many times and it has never passed.
> Is something missing in the test or supporting code ?

Works for me. Maybe there is a timing problem?

Thanks
There are races in the system tests, but those tests will pass on a second 
attempt.
This is 100% failure.

OVS: current master (fb16fec66498)

Tip of master - same for me

Kernel: 4.12.0-rc7+

I tried 2 kernels 4.2.0 and 3.19 – always fails in both.

OS: RHEL 7.4-ish

I really hope the distro is not relevant here
If you have reason to think so, pls speak up


> 
> ## -- ##
> ## openvswitch 2.7.90 test suite. ##
> ## -- ##
>  94: ptap - triangle bridge setup with L2 and L3 GRE tunnels FAILED 
(system-userspace-packet-type-aware.at:344)
> 
> ## - ##
> ## Test results. ##
> ## - ##
> 
> ERROR: 1 test was run,
> 1 failed unexpectedly.
> ## --- ##
> ## system-userspace-testsuite.log was created. ##
> ## --- ##
> 
> Please send `tests/system-userspace-testsuite.log' and all information 
you think might help:
> 
>To: 
>Subject: [openvswitch 2.7.90] system-userspace-testsuite: 94 failed
> 
> You may investigate any problem if you feel able to do so, in which
> case the test suite provides a good starting point.  Its output may
> be found below `tests/system-userspace-testsuite.dir'.
> 
> make: *** [check-system-userspace] Error 1
> make: Leaving directory `/home/dball/openvswitch/ovs/_gcc'
> 
> 
> 
> 
> On 6/27/17, 2:29 PM, "ovs-dev-boun...@openvswitch.org on behalf of Ben 
Pfaff"  wrote:
> 
> On Fri, Jun 23, 2017 at 04:47:48PM +, Zoltán Balogh wrote:
> > 
> > This series was started by Ben Pfaff, v3 can be found here:
> > 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_778070_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=01fMZLg-sq_Rf_2X9TcxmtDN0Vx2hS2v4BABA77en0w=
 
> > 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_778071_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=5fpQZh33OQ_0AGjRuJNQqvS-1E6yhFoD5TxUoLayzwM=
 
> > 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_778076_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=rqnhEoIuJ9rECQaXZafZGrAW9us8y184GCexqK8VUxQ=
 
> > 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_778072_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=p5Fnh2SQ8fUrNF0V8ChNRQyQLmbjiuvKRd1UUwE93s8=
 
> > 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_778074_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=02CPoSKkiGGsFX4neL8TpGa75VUPaaeNYWz_2WbqBsQ=
 
> > 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_778073_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=eMl7m4NpJSD07nXTN_oOdQFvysmJnclSRw39GgGg9BQ=
 
> > 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_778075_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=71zSrD_kcUjZwuKvjfeqam_rdCpeXuxtm4TW_SsZ_3w=
 
> > 
> > Ben's series is based on this one:
> > 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_770490_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=W1AcbVTr4qKOBEfQuMSmVH-Illfhs0R3TYJs1s9HtfU=
 
> > 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_770487_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=EHhVEHj-Pvdl0I609BkK_Z44CV-641MVWlLy7rZH6Qo=
 
> > 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_770495_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=izZUroix8O9Bcg5XNCmvsEseCctZfho3ovxvZRz0rwI=
 
> > 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_770498_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=VFf2BDMVyA1OU5h0hCBJFboZtp_U2NlqmPYkLDGnWnE=
 
  

Re: [ovs-dev] [PATCH v2] dpif-netlink: convert packet_type netlink attribute

2017-07-06 Thread Eric Garver
On Thu, Jul 06, 2017 at 01:14:31PM +, Zoltán Balogh wrote:
> Hi Eric,
> 
> Thank you for clarifying. 
> 
> ...
> [OVS_FLOW_ATTR_KEY]
> ...
> [OVS_KEY_ATTR_IPV4] = ...
> ...
> [OVS_KEY_ATTR_ETHERTYPE] = ...  <--- the one inserted
> 
> I have not found any API that would extend a nested attribute. 
> Maybe I'm wrong, but I thought 'buf' holds a single nested attribute. If this 
> is true, isn't possible to add the ethertype to it and increase its size?

I gave it a try and realized it doesn't matter.

During the upcall we pass back the same key that the kernel gave us,
with the exception that we also fill in wildcard info. See
upcall_xlate() and ukey_create_from_upcall(). This is why my original
patch works. It caused odp_flow_key_from_mask() to fill the ETHERTYPE
for the mask.

So I think this can only be solved in one of two places:

  1) odp_flow_key_from_mask(), as my original patch did.
- This sets the wildcard for all dpifs, including userspace/netdev.
  2) xlate_wc_init() and xlate_wc_finish().
- Here we can limit by dpif type.

Neither which is particularly pleasing. I gave #2 a try. see patch
below. It works for both check-kernel and check-system-userspace. It
does not force eth_type() for userspace.

What do you think?

Eric.

--->8---

diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index 1f4fe1dd6725..f3074c78c4b2 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -6129,7 +6129,10 @@ xlate_wc_init(struct xlate_ctx *ctx)
 /* Some fields we consider to always be examined. */
 WC_MASK_FIELD(ctx->wc, packet_type);
 WC_MASK_FIELD(ctx->wc, in_port);
-if (is_ethernet(>xin->flow, NULL)) {
+if (is_ethernet(>xin->flow, NULL)
+|| (pt_ns(ctx->xin->flow.packet_type) == OFPHTN_ETHERTYPE
+&& !strcmp(dpif_normalize_type(dpif_type(ctx->xbridge->dpif)),
+   "system"))) {
 WC_MASK_FIELD(ctx->wc, dl_type);
 }
 if (is_ip_any(>xin->flow)) {
@@ -6163,7 +6166,12 @@ xlate_wc_finish(struct xlate_ctx *ctx)
 if (ctx->xin->upcall_flow->packet_type != htonl(PT_ETH)) {
 ctx->wc->masks.dl_dst = eth_addr_zero;
 ctx->wc->masks.dl_src = eth_addr_zero;
-ctx->wc->masks.dl_type = 0;
+/* Kernel uses ETHERTYPE to implicitly mean packet_type(1, x) */
+if (pt_ns(ctx->xin->upcall_flow->packet_type) != OFPHTN_ETHERTYPE
+|| strcmp(dpif_normalize_type(dpif_type(ctx->xbridge->dpif)),
+  "system")) {
+ctx->wc->masks.dl_type = 0;
+}
 }

 /* ICMPv4 and ICMPv6 have 8-bit "type" and "code" fields.  struct flow
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] 答复: Re: 答复: Re: 答复: [spam可疑邮件]Re: 答复: Re: [PATCH 2/2] ovn-northd: Fix ping failure of vlan networks.

2017-07-06 Thread Han Zhou
Despite the original motivation of this change, I found the patch valuable
for data-plane performance.

When localnet port is used for communication between 2 ports of same
lswitch (basic provider network scenario), without the patch, each flow is
tracked in conntrack table twice. With the patch, it improve the
performance in 2 ways:

1) It reduces 50% of conntrack operations

2) It reduces 50% number of entries in conntrack table, which also helps
reducing conntrack cost

I had some tests for TCP_CRR, it improves performance for 5 - 10%.
Discussed in today's ovn meeting and we agreed it is valid optimization
because localnet port is used as transport, not the real end-point to
protect.

@Qianyu, would it be good to revise the patch on the commit message to put
it as an optimization for conntrack performance? The current commit message
is not true because it is not a supported scenario for now, and the "fix"
is not complete, either. The new scenaro would worth a separate discussion.
What do you think?

On Wed, Jul 5, 2017 at 9:07 PM, Mickey Spiegel 
wrote:

>
> On Tue, Jul 4, 2017 at 6:01 PM,  wrote:
>
>> Hi Mickey,
>>
>> Thanks for your review.
>>
>> If we could do some modifications to avoid the north/south problem you
>> mentioned? Like as follow:
>>
>> When packets send to the localnet-port, if the MAC is router-port MAC, we
>> change the router-port MAC to HV physical NIC MAC. And in gateway node, we
>> make the HV physical NIC MAC and router-port MAC all sense.
>
>
> In OpenStack usage, for public internet access, it is common for one
> logical switch to have many different logical routers connected to it,
> which can reside on the same hypervisor. The MAC address is used to
> identify which logical router the traffic is destined to. So you would need
> a MAC address per (logical router, chassis) pair, or you would have to
> introduce yet another type of router that front ends the distributed
> logical routers, deciding based on destination IP address. Either way, a
> port with a different MAC address on each chassis that hosts the port seems
> different than the logical router ports that exist today.
>
> I am still trying to understand your use case. It sounds like you have
> different regions, with different logical switches in different regions. If
> you just put localnets on each of those logical switches, wouldn't that do
> what you want?
>
> If you need L3 between the different regions, you could use a separate
> router per region, either a gateway router in each region, or a distributed
> logical router with a distributed gateway port in each region. With gateway
> routers, traffic coming in and out of each region goes through one
> centralized chassis. With a distributed logical router, non-NAT traffic
> coming in and out of each region goes through one centralized chassis,
> while NAT traffic coming in and out of each region can be distributed. With
> this type of solution, traffic will go in and out of each localnet
> symmetrically, in both directions.
>
> Mickey
>
>
>>
>> Thanks!
>>
>>
>>
>>
>> *Mickey Spiegel >*
>>
>> 2017/06/30 12:31
>>
>> 收件人:Han Zhou ,
>> 抄送:wang.qia...@zte.com.cn, ovs dev ,
>> zhou.huij...@zte.com.cn, xurong00037997 
>> 主题:Re: [ovs-dev] 答复: Re: 答复: [spam可疑邮件]Re: 答复: Re: [PATCH
>> 2/2] ovn-northd: Fix ping failure of vlan networks.
>>
>>
>>
>>
>> On Thu, Jun 29, 2017 at 2:19 PM, Han Zhou <*zhou...@gmail.com*
>> > wrote:
>> I learned that this use case is kind of Hierarchical scenario:
>>
>> *https://specs.openstack.org/openstack/neutron-specs/specs/kilo/ml2-hierarchical-port-binding.html*
>> 
>>
>> In such scenario, user wants to use OVN to manage vlan networks, and the
>> vlan networks is connected via VTEP overlay, which is not managed by OVN
>> itself. VTEP is needed to connect to BM/SRIOV VMs to the same L2 that OVS
>> VIFs are connected to.
>>
>> User don't want to use OVN to manage VTEPs since there will be flooding to
>> many VTEPs. (Mac-learning is not supported yet)
>>
>> So in this scenario, user want to utilize distributed logical router as a
>> way to optimize the datapath. For VM to VM traffic between different
>> vlans,
>> instead of going to a centralized external L3 router, user wants the
>> traffic to be tagged to the destination vlan directly and go straight from
>> source HV to destination HV through the destination vlan.
>>
>> L2 and L3 have different semantics and different ways of handling packets.
>> There is a big difference between:
>> 1) bridging between different VLANs, going through a VTEP overlay
>>that connects those VLANs, and
>> 2) routing between different VLANs.
>> Trying to blur that boundary will lead to unexpected 

Re: [ovs-dev] [PATCH v1] docs: Use DPDK 16.11.2 stable release.

2017-07-06 Thread Justin Pettit

> On Jul 6, 2017, at 2:11 AM, Stokes, Ian  wrote:
> 
>> Great.  I've pushed it to "branch-2.7" and it will be part of the 2.7.1
>> release, which I plan to release shortly.
>> 
>> Since the master branch still references 16.11.1, I'd think you'd also
>> like to apply this patch there, too.  The patch was targeted for "branch-
>> 2.7" and doesn't apply cleanly to master.  Normally under these
>> circumstances, we'd target master and then request the committer to
>> backport it to "branch-2.7'.  Would you like me to apply this to master?
>> 
> I think this makes sense,
> 
> The original patch acked by Mark and Darrel was aimed at the master branch 
> but would not apply cleanly to 2.7 when I tested last night, hence the 
> re-spin I did specifically targeting the 2.7 branch.
> 
> The original patch (below) still applies cleanly to master and so I think we 
> can go ahead with that.
> 
> https://mail.openvswitch.org/pipermail/ovs-dev/2017-June/334372.html

Great.  I just pushed this to master.  Thank you!

--Justin


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


Re: [ovs-dev] [PATCH v3 1/6] ovn: l3ha, NBDB and SBDB changes and documentation

2017-07-06 Thread Miguel Angel Ajo Pelayo
Thanks a lot Russell, your help & review is really appreciated.

On Thu, Jul 6, 2017 at 6:51 PM, Russell Bryant  wrote:

> On Wed, Jul 5, 2017 at 9:45 AM, Miguel Angel Ajo 
> wrote:
> > This commit introduces the north and south db changes necessary for
> > the l3ha router implementation.
> >
> > It defines a new Table in both NBDB and SBDB.
> >
> > The Gateway_Chassis table is created, with a tiny difference between
> > NBDB and SBDB, NBDB references the chassis via it's name (chassis_name)
> > and SBDB references the chassis via reference (chassis) to the Chassis
> table.
> >
> > In NBDB a new column (gateway_chassis) is added to Logical_Router_Ports
> > with a list of Gateway_Chassis which can be empty.
> >
> > In SBDB a new column (gateway_chassis) is added to Port_Binding with
> > the same list, this column will be used for ports of type
> chassis-redirect.
> >
> > Signed-off-by: Miguel Angel Ajo 
> > ---
> >  ovn/ovn-nb.ovsschema | 28 +---
> >  ovn/ovn-nb.xml   | 39 +++
> >  ovn/ovn-sb.ovsschema | 30 +++---
> >  ovn/ovn-sb.xml   | 38 ++
> >  4 files changed, 129 insertions(+), 6 deletions(-)
> >
>
> A couple of patches in this series introduce whitespace errors.  I'll
> fix them as I go through, but FYI:
>
> Applying: ovn: l3ha, NBDB and SBDB changes and documentation
> Applying: ovn: l3ha, ovn-northd gateway chassis propagation
> .git/rebase-apply/patch:539: new blank line at EOF.
> +
> warning: 1 line adds whitespace errors.
> Applying: ovn: l3ha, handling of multiple gateway chassis
> Applying: ovn: l3ha, enable bfd between tunnel endpoints
> Applying: ovn: l3ha, make is_chassis_active aware of gateway_chassis
> Applying: ovn: l3ha, gratuitous ARP for HA router
> .git/rebase-apply/patch:311: new blank line at EOF.
> +
> warning: 1 line adds whitespace errors.
>
>
> Also, here's a patch you can squash into this one that adjusts the
> schema version numbers and adds a bit to the docs.  I'll collect my
> suggestions in this branch for now:
>
> https://github.com/russellb/ovs/tree/l3ha
>
>
>
> commit 26c1347bfe8faa96a4218e363281ee7154e8d5f4
> Author: Russell Bryant 
> Date:   Thu Jul 6 08:58:27 2017 -0400
>
> ovn: Update schema versions and docs.
>
> Bump minor version since we've added new backwards compatible features.
>
> Also add some additional content and tweaks to schema documentation.
>
> Signed-off-by: Russell Bryant 
>
> diff --git a/ovn/ovn-nb.ovsschema b/ovn/ovn-nb.ovsschema
> index 6a96704..d85a3fe 100644
> --- a/ovn/ovn-nb.ovsschema
> +++ b/ovn/ovn-nb.ovsschema
> @@ -1,7 +1,7 @@
>  {
>  "name": "OVN_Northbound",
> -"version": "5.6.2",
> -"cksum": "3482049799 16164",
> +"version": "5.7.0",
> +"cksum": "3754583060 16164",
>  "tables": {
>  "NB_Global": {
>  "columns": {
> diff --git a/ovn/ovn-nb.xml b/ovn/ovn-nb.xml
> index 6061114..1e73465 100644
> --- a/ovn/ovn-nb.xml
> +++ b/ovn/ovn-nb.xml
> @@ -179,7 +179,7 @@
>
>  Set this to an IPv4 subnet, e.g. 192.168.0.0/24, to
> enable
>  ovn-northd to automatically assign IP addresses
> within
> -that subnet.
> +that subnet.
>
>
>
> @@ -1251,8 +1251,31 @@
>  
>
>  
> -  Several  can be referenced for a given
> -  logical router port.
> +  
> +If set, this indicates that this logical router port represents
> +a distributed gateway port that connects this router to a logical
> +switch with a localnet port.  There may be at most one such
> +logical router port on each logical router.
> +  
> +
> +  
> +Several  can be referenced for a
> given
> +logical router port.  A single  is
> +functionally equivalent to setting
> +.  Refer to the
> +description of 
> +for additional details on gateway handling.
> +  
> +
> +  
> +Defining more than one  will enable
> +gateway high availability.  Only one gateway will be active at a
> +time.  OVN chassis will use BFD to monitor connectivity to a
> +gateway.  If connectivity to the active gateway is interrupted,
> +another gateway will become active.
> +The  column
> +specifies the order that gateways will be chosen by OVN.
> +  
>  
>
>  
> @@ -1324,6 +1347,14 @@
>table="Logical_Switch_Port"/> should be set to
>router.
>  
> +
> +
> +  While  is still
> +  supported for backwards compatibility, it is now preferred to
> +  specify one or more  instead.
> +  It is functionally equivalent, but allows you to specify
> multiple
> +  chassis to enable high availability.
> +
>
>  
>
> @@ -2117,26 +2148,42 

Re: [ovs-dev] [PATCH v3 1/6] ovn: l3ha, NBDB and SBDB changes and documentation

2017-07-06 Thread Russell Bryant
On Wed, Jul 5, 2017 at 9:45 AM, Miguel Angel Ajo  wrote:
> This commit introduces the north and south db changes necessary for
> the l3ha router implementation.
>
> It defines a new Table in both NBDB and SBDB.
>
> The Gateway_Chassis table is created, with a tiny difference between
> NBDB and SBDB, NBDB references the chassis via it's name (chassis_name)
> and SBDB references the chassis via reference (chassis) to the Chassis table.
>
> In NBDB a new column (gateway_chassis) is added to Logical_Router_Ports
> with a list of Gateway_Chassis which can be empty.
>
> In SBDB a new column (gateway_chassis) is added to Port_Binding with
> the same list, this column will be used for ports of type chassis-redirect.
>
> Signed-off-by: Miguel Angel Ajo 
> ---
>  ovn/ovn-nb.ovsschema | 28 +---
>  ovn/ovn-nb.xml   | 39 +++
>  ovn/ovn-sb.ovsschema | 30 +++---
>  ovn/ovn-sb.xml   | 38 ++
>  4 files changed, 129 insertions(+), 6 deletions(-)
>

A couple of patches in this series introduce whitespace errors.  I'll
fix them as I go through, but FYI:

Applying: ovn: l3ha, NBDB and SBDB changes and documentation
Applying: ovn: l3ha, ovn-northd gateway chassis propagation
.git/rebase-apply/patch:539: new blank line at EOF.
+
warning: 1 line adds whitespace errors.
Applying: ovn: l3ha, handling of multiple gateway chassis
Applying: ovn: l3ha, enable bfd between tunnel endpoints
Applying: ovn: l3ha, make is_chassis_active aware of gateway_chassis
Applying: ovn: l3ha, gratuitous ARP for HA router
.git/rebase-apply/patch:311: new blank line at EOF.
+
warning: 1 line adds whitespace errors.


Also, here's a patch you can squash into this one that adjusts the
schema version numbers and adds a bit to the docs.  I'll collect my
suggestions in this branch for now:

https://github.com/russellb/ovs/tree/l3ha



commit 26c1347bfe8faa96a4218e363281ee7154e8d5f4
Author: Russell Bryant 
Date:   Thu Jul 6 08:58:27 2017 -0400

ovn: Update schema versions and docs.

Bump minor version since we've added new backwards compatible features.

Also add some additional content and tweaks to schema documentation.

Signed-off-by: Russell Bryant 

diff --git a/ovn/ovn-nb.ovsschema b/ovn/ovn-nb.ovsschema
index 6a96704..d85a3fe 100644
--- a/ovn/ovn-nb.ovsschema
+++ b/ovn/ovn-nb.ovsschema
@@ -1,7 +1,7 @@
 {
 "name": "OVN_Northbound",
-"version": "5.6.2",
-"cksum": "3482049799 16164",
+"version": "5.7.0",
+"cksum": "3754583060 16164",
 "tables": {
 "NB_Global": {
 "columns": {
diff --git a/ovn/ovn-nb.xml b/ovn/ovn-nb.xml
index 6061114..1e73465 100644
--- a/ovn/ovn-nb.xml
+++ b/ovn/ovn-nb.xml
@@ -179,7 +179,7 @@
   
 Set this to an IPv4 subnet, e.g. 192.168.0.0/24, to enable
 ovn-northd to automatically assign IP addresses within
-that subnet.
+that subnet.
   

   
@@ -1251,8 +1251,31 @@
 

 
-  Several  can be referenced for a given
-  logical router port.
+  
+If set, this indicates that this logical router port represents
+a distributed gateway port that connects this router to a logical
+switch with a localnet port.  There may be at most one such
+logical router port on each logical router.
+  
+
+  
+Several  can be referenced for a given
+logical router port.  A single  is
+functionally equivalent to setting
+.  Refer to the
+description of 
+for additional details on gateway handling.
+  
+
+  
+Defining more than one  will enable
+gateway high availability.  Only one gateway will be active at a
+time.  OVN chassis will use BFD to monitor connectivity to a
+gateway.  If connectivity to the active gateway is interrupted,
+another gateway will become active.
+The  column
+specifies the order that gateways will be chosen by OVN.
+  
 

 
@@ -1324,6 +1347,14 @@
   table="Logical_Switch_Port"/> should be set to
   router.
 
+
+
+  While  is still
+  supported for backwards compatibility, it is now preferred to
+  specify one or more  instead.
+  It is functionally equivalent, but allows you to specify multiple
+  chassis to enable high availability.
+
   
 

@@ -2117,26 +2148,42 @@
 
   
   
-Association of chassis to logical router port. The traffic
-going out through an specific router port will be redirected to a
-chassis, or a set of them in high availability configurations.
-This is the equivalent of option:redirect-chassis for Logical
-Router ports, but allowing the association and prioritize multiple
-Chassis to a single port.
+
+  Association 

[ovs-dev] Cancelled: ATM CARD

2017-07-06 Thread Mrs.Lucein Ovia via dev
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] Invitation: ATM CARD

2017-07-06 Thread Mrs.Lucein Ovia via dev
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v4 0/7] Packet type aware pipeline

2017-07-06 Thread Darrell Ball
Patch 4 added unit tests
One test was added to system userspace.
I ran it many times and it has never passed.
Is something missing in the test or supporting code ?

## -- ##
## openvswitch 2.7.90 test suite. ##
## -- ##
 94: ptap - triangle bridge setup with L2 and L3 GRE tunnels FAILED 
(system-userspace-packet-type-aware.at:344)

## - ##
## Test results. ##
## - ##

ERROR: 1 test was run,
1 failed unexpectedly.
## --- ##
## system-userspace-testsuite.log was created. ##
## --- ##

Please send `tests/system-userspace-testsuite.log' and all information you 
think might help:

   To: 
   Subject: [openvswitch 2.7.90] system-userspace-testsuite: 94 failed

You may investigate any problem if you feel able to do so, in which
case the test suite provides a good starting point.  Its output may
be found below `tests/system-userspace-testsuite.dir'.

make: *** [check-system-userspace] Error 1
make: Leaving directory `/home/dball/openvswitch/ovs/_gcc'




On 6/27/17, 2:29 PM, "ovs-dev-boun...@openvswitch.org on behalf of Ben Pfaff" 
 wrote:

On Fri, Jun 23, 2017 at 04:47:48PM +, Zoltán Balogh wrote:
> 
> This series was started by Ben Pfaff, v3 can be found here:
> 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_778070_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=01fMZLg-sq_Rf_2X9TcxmtDN0Vx2hS2v4BABA77en0w=
 
> 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_778071_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=5fpQZh33OQ_0AGjRuJNQqvS-1E6yhFoD5TxUoLayzwM=
 
> 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_778076_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=rqnhEoIuJ9rECQaXZafZGrAW9us8y184GCexqK8VUxQ=
 
> 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_778072_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=p5Fnh2SQ8fUrNF0V8ChNRQyQLmbjiuvKRd1UUwE93s8=
 
> 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_778074_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=02CPoSKkiGGsFX4neL8TpGa75VUPaaeNYWz_2WbqBsQ=
 
> 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_778073_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=eMl7m4NpJSD07nXTN_oOdQFvysmJnclSRw39GgGg9BQ=
 
> 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_778075_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=71zSrD_kcUjZwuKvjfeqam_rdCpeXuxtm4TW_SsZ_3w=
 
> 
> Ben's series is based on this one:
> 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_770490_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=W1AcbVTr4qKOBEfQuMSmVH-Illfhs0R3TYJs1s9HtfU=
 
> 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_770487_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=EHhVEHj-Pvdl0I609BkK_Z44CV-641MVWlLy7rZH6Qo=
 
> 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_770495_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=izZUroix8O9Bcg5XNCmvsEseCctZfho3ovxvZRz0rwI=
 
> 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_770498_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=VFf2BDMVyA1OU5h0hCBJFboZtp_U2NlqmPYkLDGnWnE=
 
> 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_770488_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=3_rtktraZwXdr6VkYz8ujpi_eV9MDKc8EwCDk43nnLg=
 
> 
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_770489_=DwIFAw=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=YZOYZFR6QorkvkAZXXYPq7Z9SWuK0lZg9EH6ND2me04=1OhDZfiGpq3GF4Vie9KKwKudHEAHpG8nj8qTMqlmKV8=
 
> 
> v1->v2:
>   - Squash fixup patches.
>   - Apply changes agreed with Jan.
>   - Not yet done: Figure out whether to really show packet_type in (some)
> match_format() output.
>   - New patch at the end unsuccessfully tries to re-enable packet-aware
> test.  Either I don't have enough insight yet, or it just reveals a
> bug or two.
>   - 4 new patches at 

[ovs-dev] Healthcare Professional Contacts

2017-07-06 Thread Karen Anderson
 

Hi,

 

Hope you are doing well! And my warm greetings.

 

I wanted to check with you to see if you would be interested in acquiring
the Healthcare Professional Database.

 

This database consists of: Hospitals, Hospital Management/Owners/CEO's/VP's,
Owners/Director's/Managers of Surgery/Imaging Centres/Diagnostic
Labs/Clinics, Medical Directors/Officers, Health Care Managers, Healthcare
I.T Executives, Nurse Practitioners, Physician Assistants, Paramedics,
Healthcare/Tertiary Care/Managed Care/Surgery/Urgent Care/EMS Centres,
Diagnostic Services/X-Ray Imaging Centres, Wellness Clinics/Auxiliary
Services, Medical Manufacturing/Medical Devices/Supplies/Imaging, Medical
Electronic/Software, Patient Aids, Medical Clothing, Surgical Instruments,
Laboratory Equipment/Chemical & Gases, Hospital Equipment & Supplies,
Hospital Furniture, Healthcare Recruiters, Pharmaceutical Marketers, Waste
Management Plants and Equipment, CME Programs and many more across the
world.

 

Counts:-

 


Doctors Specialty

Counts

Doctors Specialty

Counts

Doctors Specialty

Counts


Allergy Immunology Doctors

8,064

Haematology Doctors

14,860

Otorhinolaryngology Doctors

29,539


Anaesthesiology Doctors

38,155

Infectious Disease Doctors

12,677

Pathology Doctors

37,467


Cardiology Doctors

34,577

Internal Medicine Doctors

192,004

Paediatrics Doctors

70,684


Chiropractic Doctors

32,537

Medical Genetics Doctors

2,446

Physical Medicine Doctors

17,437


Dentist

165,934

Neurology Doctors

32,606

Surgery/Plastic Surgery Doctors

59,371


Dermatology Doctors

20,467

Neurology Doctors

23,354

Preventive Medicine Doctors

14,642


Emergency Medicine Doctors

37,300

Obstetrics/Gynaecology Doctors

41,163

Psychiatry Doctors

36,315


Family Practice Doctors

189,045

Oncology Doctors

24,881

Radiology Doctors

42,763


Gastroenterology Doctors

21,913

Ophthalmology Doctors

38,237

Registered Nurses (RN)

61,405


General Practice Doctors

65,536

Optometry Doctors

12,449

Urology Doctors

30,135


Geriatrics Doctors

9,634

Orthopaedic Surgery Doctors

44,145

Physicians Assistants (PA)

54,896

 

Every Contact comes with Name, Title, Verified Email Address, Phone Numbers,
Physical Address, and FAX Numbers, SIC Code, Revenue Size etc.

 

Industry Segments you would like to reach: ; (Any)

Geographies: ; (NA, EMEA, APAC etc.)

Job Titles/Audience you like to reach: ; (CVDM titles
etc.)

 

We maintain numerous Tele verified database of all industries and titles.
Let me know your thoughts. So that I can send you few samples to check our
database accuracy along with counts and pricing.

 

I know you're busy. Just give me a 1, 2 or 3.

 

1. I could potentially use your solution, but in future.

2. Interesting - let's talk.

3. Leave me alone, stalker.

 

Thanks and I look forward to hearing from you.

 

Regards,

Karen Anderson

 

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


Re: [ovs-dev] GTP support to OVS upstream

2017-07-06 Thread Ben Pfaff
I *think* that's true only if your employer is an ONF member.

On Thu, Jul 06, 2017 at 12:37:34AM +, Yang, Yi Y wrote:
> You can register yourself in https://www.opennetworking.org/ then you can 
> search any document.
> 
> From: Wieger IJntema [mailto:wieger.ijntema@gmail.com]
> Sent: Wednesday, July 5, 2017 10:41 PM
> To: Yang, Yi Y ; d...@openvswitch.org
> Subject: Re: [ovs-dev] GTP support to OVS upstream
> 
> Dear Yi,
> 
> I'm not fully updated on the current OpenFlow 1.6 specification.
> 
> I have now created a workaround with two bridge interfaces on one machine to 
> forward normal traffic and only inspect GTP traffic. But indeed this requires 
> full decapsulation of the packet before we have any knowledge of the packet 
> inside. (IP and tun_id)
> 
> I have to look deeper in the GTP code to be sure if we should proceed the way 
> you describe.
> But i have looked in the PTAP and the generic encap & decap solutions 
> described here:
> https://www.mail-archive.com/dev@openvswitch.org/msg71808.html
> and i think that is a solid basis to continue on.
> 
> i'm new to the Openvswitch development is there a way i can view:
> 
> EXT-382 Generic tunnel Encap and Decap issue?
> 
> 
> 
> regards, Wieger IJntema
> 
> 
> 
> On Wed, Jul 5, 2017 at 12:54 PM, Yang, Yi Y 
> > wrote:
> I remember OpenFlow 1.6 spec (not finalized) proposes to use OpenFlow actions 
> to do GTP-u encapsulation and decapsulation, current OvS tunnel 
> implementation can't support the third kind of use case (don't encap & decap, 
> just parse, match and forward), MEC (ETSI Molibe/Multi-access Edge Computing) 
> the third kind of use case.
> 
> I'm wondering if it is feasible to implement a generic UDP tunnel in OvS, let 
> Openflow do encap /decap/parse, now ovs master has fully supported L3 
> tunnel port and PTAP(Packet type aware pipeline), we have posted out generic 
> encap & decap actions implementation, once ovs officially merges them, ovs 
> can support generic encap & decap action, we can base on them to implement 
> GTP-u encap & decap, then it will be better if we can implement a generic UDP 
> tunnel, ovs can add UDP tunnel ports with different UDP port to handle 
> different tunnel protocol, I think this will be the best way to handle the 
> aforementioned three kinds of use cases.
> 
> -Original Message-
> From: ovs-dev-boun...@openvswitch.org 
> [mailto:ovs-dev-boun...@openvswitch.org]
>  On Behalf Of Wieger IJntema
> Sent: Wednesday, July 5, 2017 5:37 PM
> To: d...@openvswitch.org
> Subject: [ovs-dev] GTP support to OVS upstream
> 
> Dear Developers,
> 
> I would like to start a discussion to actually get native GTP tunneling 
> support in Openvswitch keeping it still compatible with the current OpenFlow 
> standard.
> https://en.wikipedia.org/wiki/GPRS_Tunnelling_Protocol
> 
> I the past there has been a patch for OVS to actually have GTP support.
> https://www.mail-archive.com/dev@openvswitch.org/msg56446.html, Feb 2016?, 
> Niti Rohilla, OVS 2.5.0 Main concern was that there was no Linux upstream GTP 
> support.
> 
> This work is updated to work with version OVS 2.6.1 
> https://github.com/ashishkurian/ovs, Dec 2016, Ashish Kurian, OVS 2.6.1 I 
> have tested it extensively if all nodes use the samen OVS version with GTP 
> support it works good!
> 
> It is just working like Lisp or GRE tunneling and you can set the key with 
> the set "tunnel_id" command from openflow.
> I have used RYU as a controller to control multiple OVS switches with GTP 
> tunneling.
> 
> In mobile networks research there is a lot interest to get GTP support in OVS.
> Especially in development towards 5G mobile network, where Openflow is 
> considered a protocol to be used there as switch-controller protocol.
> I'm currently testing this in "pre 5G" Core solution where GTP encapsulation 
> is done by OVS.
> 
> From OSMOCOM.org there is now an GTP-U (GTP userplane) Linux upstream 
> implementation and it think we can use it together with the Openvswitch GTP 
> patch to get native GTP-U support in OVS.
> https://osmocom.org/projects/linux-kernel-gtp-u/wiki, Since linux kernel
> v4.7.0
> https://www.kernel.org/doc/Documentation/networking/gtp.txt
> http://elixir.free-electrons.com/linux/v4.8.9/source/drivers/net/gtp.c
> 
> I would like to start working on this, if you guys have suggestions or 
> reservations please let me know.
> 
> Regards, Wieger IJntema
> TNO
> ___
> 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

Re: [ovs-dev] [PATCH v2] Fix nonstandard isatty on Windows

2017-07-06 Thread Alin Serdean
No worries, thanks a lot!

> -Original Message-
> From: Ben Pfaff [mailto:b...@ovn.org]
> Sent: Thursday, July 6, 2017 6:33 PM
> To: Guru Shetty 
> Cc: Alin Serdean ;
> d...@openvswitch.org
> Subject: Re: [ovs-dev] [PATCH v2] Fix nonstandard isatty on Windows
> 
> Sorry about the delay, everyone.  I was traveling and not paying much
> attention to email.
> 
> I applied this to master.
> 
> On Tue, Jun 20, 2017 at 11:11:05AM -0700, Guru Shetty wrote:
> > On 20 June 2017 at 09:31, Alin Serdean
> > 
> > wrote:
> >
> > > A lot of tests are failing, due to the open flow ports being
> > > outputted using names instead of numbers.
> > > i.e.: http://64.119.130.115/ovs/beb75a40fdc295bfd6521b0068b4cd
> > > 12f6de507c/testsuite.dir/0464/testsuite.log.gz
> > >
> > > The issues encountered above is because 'monitor' with 'detach'
> > > arguments are specified, that in turn will call 'close_standard_fds'
> > > (https://github.com/openvswitch/ovs/blob/master/lib/daemon-
> unix.c#L4
> > > 72) which will create a duplicate fd over '/dev/null' on Linux and
> > > 'nul' on Windows.
> > >
> > > 'isatty' will be called on those FDs.
> > > What POSIX standard says:
> > > http://pubs.opengroup.org/onlinepubs/009695399/functions/isatty.html
> > > 'The isatty() function shall test whether fildes, an open file
> > > descriptor, is associated with a terminal device.'
> > > What MSDN says:
> > > https://msdn.microsoft.com/en-us/library/f4s0ddew(VS.80).aspx
> > > 'The _isatty function determines whether fd is associated with a
> > > character device (a terminal, console, printer, or serial port).'
> > >
> > > This patch adds another check using 'GetConsoleMode'
> > > https://msdn.microsoft.com/en-us/library/windows/desktop/
> > > ms683167(v=vs.85).aspx
> > > which will fail if the handle pointing to the file descriptor is not
> > > associated to a console.
> > >
> > > Signed-off-by: Alin Gabriel Serdean
> > > 
> > > Co-authroed-by: Ben Pfaff 
> > >
> > Ben,
> >  Do I have take the liberty to add your Signed-off-by?
> >
> >
> > > ---
> > > v2 replace `isatty` in unistd.h
> > > ---
> > >  include/windows/unistd.h | 16 
> > >  1 file changed, 16 insertions(+)
> > >
> > > diff --git a/include/windows/unistd.h b/include/windows/unistd.h
> > > index 2e9f0ae..21cc56f 100644
> > > --- a/include/windows/unistd.h
> > > +++ b/include/windows/unistd.h
> > > @@ -85,4 +85,20 @@ __inline long sysconf(int type)
> > >  return value;
> > >  }
> > >
> > > +/* On Windows, a console is a specialized character device, and
> > > +isatty()
> > > only
> > > + * reports whether a file description is a character device and
> > > + thus
> > > reports
> > > + * that devices such as /dev/null are ttys.  This replacement
> > > +avoids that
> > > + * problem. */
> > > +#undef isatty
> > > +#define isatty(fd) rpl_isatty(fd)
> > > +static __inline int
> > > +rpl_isatty(int fd)
> > > +{
> > > +HANDLE h = (HANDLE) _get_osfhandle(fd);
> > > +DWORD st;
> > > +return (_isatty(STDOUT_FILENO)
> > > +&& h != INVALID_HANDLE_VALUE
> > > +&& GetConsoleMode(h, )); }
> > > +
> > >  #endif /* unistd.h  */
> > > --
> > > 2.10.2.windows.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 v2] Fix nonstandard isatty on Windows

2017-07-06 Thread Ben Pfaff
Sorry about the delay, everyone.  I was traveling and not paying much
attention to email.

I applied this to master.

On Tue, Jun 20, 2017 at 11:11:05AM -0700, Guru Shetty wrote:
> On 20 June 2017 at 09:31, Alin Serdean 
> wrote:
> 
> > A lot of tests are failing, due to the open flow ports being outputted
> > using
> > names instead of numbers.
> > i.e.: http://64.119.130.115/ovs/beb75a40fdc295bfd6521b0068b4cd
> > 12f6de507c/testsuite.dir/0464/testsuite.log.gz
> >
> > The issues encountered above is because 'monitor' with 'detach' arguments
> > are
> > specified, that in turn will call 'close_standard_fds'
> > (https://github.com/openvswitch/ovs/blob/master/lib/daemon-unix.c#L472)
> > which will create a duplicate fd over '/dev/null' on Linux and 'nul' on
> > Windows.
> >
> > 'isatty' will be called on those FDs.
> > What POSIX standard says:
> > http://pubs.opengroup.org/onlinepubs/009695399/functions/isatty.html
> > 'The isatty() function shall test whether fildes, an open file descriptor,
> > is associated with a terminal device.'
> > What MSDN says:
> > https://msdn.microsoft.com/en-us/library/f4s0ddew(VS.80).aspx
> > 'The _isatty function determines whether fd is associated with a character
> > device (a terminal, console, printer, or serial port).'
> >
> > This patch adds another check using 'GetConsoleMode'
> > https://msdn.microsoft.com/en-us/library/windows/desktop/
> > ms683167(v=vs.85).aspx
> > which will fail if the handle pointing to the file descriptor is not
> > associated
> > to a console.
> >
> > Signed-off-by: Alin Gabriel Serdean 
> > Co-authroed-by: Ben Pfaff 
> >
> Ben,
>  Do I have take the liberty to add your Signed-off-by?
> 
> 
> > ---
> > v2 replace `isatty` in unistd.h
> > ---
> >  include/windows/unistd.h | 16 
> >  1 file changed, 16 insertions(+)
> >
> > diff --git a/include/windows/unistd.h b/include/windows/unistd.h
> > index 2e9f0ae..21cc56f 100644
> > --- a/include/windows/unistd.h
> > +++ b/include/windows/unistd.h
> > @@ -85,4 +85,20 @@ __inline long sysconf(int type)
> >  return value;
> >  }
> >
> > +/* On Windows, a console is a specialized character device, and isatty()
> > only
> > + * reports whether a file description is a character device and thus
> > reports
> > + * that devices such as /dev/null are ttys.  This replacement avoids that
> > + * problem. */
> > +#undef isatty
> > +#define isatty(fd) rpl_isatty(fd)
> > +static __inline int
> > +rpl_isatty(int fd)
> > +{
> > +HANDLE h = (HANDLE) _get_osfhandle(fd);
> > +DWORD st;
> > +return (_isatty(STDOUT_FILENO)
> > +&& h != INVALID_HANDLE_VALUE
> > +&& GetConsoleMode(h, ));
> > +}
> > +
> >  #endif /* unistd.h  */
> > --
> > 2.10.2.windows.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] offset of 0x10001 in dpif_netlink_queue_to_priority

2017-07-06 Thread Ben Pfaff
On Thu, Jul 06, 2017 at 08:39:21AM +0200, Matthias May wrote:
> On 06/07/17 02:24, Ben Pfaff wrote:
> > On Tue, Jul 04, 2017 at 05:09:21PM +0200, Matthias May wrote:
> >> Hi
> >>
> >> I'm trying to map the vlan_pcp onto 802.11 tid.
> >>
> >> net/wireless/util.c in mac80211 specifies:
> >>
> >>>   /* skb->priority values from 256->263 are magic values to
> >>>* directly indicate a specific 802.1d priority.  This is used
> >>>* to allow 802.1d priority to be passed directly in from VLAN
> >>>* tags, etc.
> >>>*/
> >>>   if (skb->priority >= 256 && skb->priority <= 263)
> >>>   return skb->priority - 256;
> >>
> >> However the function dpif_netlink_queue_to_priority in /lib/dpif-netlink.c 
> >> sets:
> >>>if (queue_id < 0xf000) {
> >>>*priority = TC_H_MAKE(1 << 16, queue_id + 1);
> >>
> >> With this the lowest skb_priority I can set is 0x10001, slightly over the 
> >> magic values I need to use ;)
> >>
> >> Why is this offset of 0x1 + 1 in place?
> >> Is something else in ovs about which I'm not aware dependant on this 
> >> offset?
> > 
> > It's because this is mapping from an OpenFlow queue ID to a kernel
> > skb_priority value.  These aren't the same namespace and so you need a
> > mapping function.
> > 
> 
> What do you mean "not the same namespace"?
> I need to set the skb_priority, set_queue sets the skb_priority but with an 
> offset.

OpenFlow queue IDs aren't kernel skb_priorities.  They never have been.
There is a mapping function.

> If I patch the line to
> *priority = queue_id;
> everything works as I expect it.

Good for you.  You just broke every existing user.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v2 4/4] redhat: allow dpdk to also run as non-root user

2017-07-06 Thread Aaron Conole
"Timothy M. Redaelli"  writes:

> Hi Aaron,

Hi Timothy,

Thanks for the review!

> On 07/05/2017 07:56 PM, Aaron Conole wrote:
>> After this commit, users may start a dpdk-enabled ovs setup as a
>> non-root user.  This is accomplished by exporting the $HOME directory,
>> which dpdk uses to fill in it's semi-persistent RTE configuration.
>> 
>> This change may be a bit controversial since it modifies /dev/hugepages
>> as part of starting the ovs-vswitchd to set a hugetlbfs group
>> ownership.  This is used to enable writing to /dev/hugepages so that the
>> dpdk_init will successfully complete.  There is an alternate way of
>> accomplishing this - namely to initialize DPDK before dropping
>> privileges.  However, this would mean that if DPDK ever grows an uninit
>> / reinit function, non-root ovs likely could never use it.
>> 
>> This does not change OvS+DPDK's SELinux requirements.  It still must be
>> disabled.
>> 
>> Signed-off-by: Aaron Conole 
>> ---
>>  rhel/.gitignore |  1 +
>>  rhel/automake.mk|  3 ++-
>>  rhel/openvswitch-fedora.spec.in | 13 
>> +
>>  ...rvice => usr_lib_systemd_system_ovs-vswitchd.service.in} |  4 
>>  4 files changed, 20 insertions(+), 1 deletion(-)
>>  rename rhel/{usr_lib_systemd_system_ovs-vswitchd.service => 
>> usr_lib_systemd_system_ovs-vswitchd.service.in} (87%)
>> 
>> diff --git a/rhel/.gitignore b/rhel/.gitignore
>> index 164bb66..e584a1e 100644
>> --- a/rhel/.gitignore
>> +++ b/rhel/.gitignore
>> @@ -4,3 +4,4 @@ openvswitch-kmod-rhel6.spec
>>  openvswitch-kmod-fedora.spec
>>  openvswitch.spec
>>  openvswitch-fedora.spec
>> +usr_lib_systemd_system_ovs-vswitchd.service
>> diff --git a/rhel/automake.mk b/rhel/automake.mk
>> index 2d9443f..439af26 100644
>> --- a/rhel/automake.mk
>> +++ b/rhel/automake.mk
>> @@ -29,6 +29,7 @@ EXTRA_DIST += \
>>  rhel/usr_lib_systemd_system_openvswitch.service \
>>  rhel/usr_lib_systemd_system_ovsdb-server.service \
>>  rhel/usr_lib_systemd_system_ovs-vswitchd.service \
>> +rhel/usr_lib_systemd_system_ovs-vswitchd.service.in \
>>  rhel/usr_lib_systemd_system_ovn-controller.service \
>>  rhel/usr_lib_systemd_system_ovn-controller-vtep.service \
>>  rhel/usr_lib_systemd_system_ovn-northd.service \
>> @@ -59,7 +60,7 @@ RPMBUILD_TOP := $(abs_top_builddir)/rpm/rpmbuild
>>  RPMBUILD_OPT ?= --without check
>>  
>>  # Build user-space RPMs
>> -rpm-fedora: dist $(srcdir)/rhel/openvswitch-fedora.spec
>> +rpm-fedora: dist $(srcdir)/rhel/openvswitch-fedora.spec 
>> $(srcdir)/rhel/usr_lib_systemd_system_ovs-vswitchd.service
>>  ${MKDIR_P} ${RPMBUILD_TOP}/SOURCES
>>  cp ${DIST_ARCHIVES} ${RPMBUILD_TOP}/SOURCES
>>  rpmbuild ${RPMBUILD_OPT} \
>> diff --git a/rhel/openvswitch-fedora.spec.in 
>> b/rhel/openvswitch-fedora.spec.in
>> index 7c805b2..83cfb18 100644
>> --- a/rhel/openvswitch-fedora.spec.in
>> +++ b/rhel/openvswitch-fedora.spec.in
>> @@ -95,6 +95,10 @@ Requires: openssl hostname iproute module-init-tools
>>  Requires(post): /usr/bin/getent
>>  Requires(post): /usr/sbin/useradd
>>  Requires(post): /usr/bin/sed
>> +%if %{with dpdk}
>> +Requires(post): /usr/sbin/usermod
>> +Requires(post): /usr/sbin/groupadd
>> +%endif
>>  Requires(post): systemd-units
>>  Requires(preun): systemd-units
>>  Requires(postun): systemd-units
>> @@ -366,6 +370,15 @@ if [ $1 -eq 1 ]; then
>>  
>>  sed -i 's:^#OVS_USER_ID=:OVS_USER_ID=:' /etc/sysconfig/openvswitch
>>  
>> +%if %{with dpdk}
>> +getent group hugetlbfs >/dev/null || \
>> +groupadd hugetlbfs
>> +usermod -a -G hugetlbfs openvswitch
>> +sed -i \
>> +
>> 's@OVS_USER_ID="openvswitch:openvswitch"@OVS_USER_ID="openvswitch:hugetlbfs":'\
>
> There is a typo on this sed, you need to terminate it by "@" and not ":"
> or you will have:
> "sed: -e expression #1, char 76: unterminated `s' command" error

D'oh!  Missed it during my cleanup.  Thanks for this, I'll respin.

>> +/etc/sysconfig/openvswitch
>> +%endif
>> +
>>  # In the case of upgrade, this is not needed.
>>  chown -R openvswitch:openvswitch /etc/openvswitch
>>  fi
>> diff --git a/rhel/usr_lib_systemd_system_ovs-vswitchd.service 
>> b/rhel/usr_lib_systemd_system_ovs-vswitchd.service.in
>> similarity index 87%
>> rename from rhel/usr_lib_systemd_system_ovs-vswitchd.service
>> rename to rhel/usr_lib_systemd_system_ovs-vswitchd.service.in
>> index 48231b3..2d2e9e6 100644
>> --- a/rhel/usr_lib_systemd_system_ovs-vswitchd.service
>> +++ b/rhel/usr_lib_systemd_system_ovs-vswitchd.service.in
>> @@ -10,8 +10,12 @@ PartOf=openvswitch.service
>>  [Service]
>>  Type=forking
>>  Restart=on-failure
>> +Environment="HOME=/var/run/openvswitch"
>
> Usually in systemd service file you don't need to put quotes, unless you
> need to assign a value containing spaces to a variable.

Okay.

>>  

Re: [ovs-dev] [PATCH v2] dpif-netlink: convert packet_type netlink attribute

2017-07-06 Thread Zoltán Balogh
Hi Eric,

Thank you for clarifying. 

...
[OVS_FLOW_ATTR_KEY]
...
[OVS_KEY_ATTR_IPV4] = ...
...
[OVS_KEY_ATTR_ETHERTYPE] = ...  <--- the one inserted

I have not found any API that would extend a nested attribute. 
Maybe I'm wrong, but I thought 'buf' holds a single nested attribute. If this 
is true, isn't possible to add the ethertype to it and increase its size?

  nl_msg_put_be16(buf, OVS_KEY_ATTR_ETHERTYPE, ns_type);
  buf->size += NL_A_U16_SIZE;

Or should I create a new nested attribute instead and copy the content of the 
original one plus the ethernet attribute? What would you propose?

diff --git a/lib/dpif-netlink.c b/lib/dpif-netlink.c
index cf4e98f29..98a97b3a2 100644
--- a/lib/dpif-netlink.c
+++ b/lib/dpif-netlink.c
@@ -3497,6 +3497,7 @@ put_convert_packet_type(struct ofpbuf *buf,
 ovs_assert(nl_attr_get_be16(eth_type) == ns_type);
 } else {
 nl_msg_put_be16(buf, OVS_KEY_ATTR_ETHERTYPE, ns_type);
+buf->size += NL_A_U16_SIZE;
 }
 }
 } else {
@@ -3514,15 +3515,14 @@ put_convert_packet_type(struct ofpbuf *buf,
 mask_data, mask_len,
 packet_type);
 /* Put OVS_KEY_ATTR_ETHERTYPE if needed. */
-if (ntohl(value) != PT_ETH) {
+if (!ethernet_present) {
 const struct nlattr *eth_type;
 
-ovs_assert(ethernet_present == false);
-
 eth_type = nl_attr_find__(mask_data, mask_len,
   OVS_KEY_ATTR_ETHERTYPE);
 if (!eth_type) {
 nl_msg_put_be16(buf, OVS_KEY_ATTR_ETHERTYPE, OVS_BE16_MAX);
+buf->size += NL_A_U16_SIZE;
 }
 }
 } else {


---

Best regards,
Zoltan

> -Original Message-
> From: Eric Garver [mailto:e...@erig.me]
> Sent: Thursday, July 06, 2017 2:54 PM
> To: Yang, Yi Y 
> Cc: Zoltán Balogh ; 'd...@openvswitch.org' 
> 
> Subject: Re: [ovs-dev] [PATCH v2] dpif-netlink: convert packet_type netlink 
> attribute
> 
> On Thu, Jul 06, 2017 at 10:14:06AM +, Yang, Yi Y wrote:
> > I misunderstood Eric, he means we shouldn't have ETHERTYPE if packet_type 
> > is L3 type. I tried this one just now,
> it works.
> 
> No. That's not what I meant. We _need_ ETHERTYPE for L3-type (NS 1). The
> kernel expects this since it does not understand packet_type.
> 
> See my additional comments below.
> 
> >
> > diff --git a/lib/odp-util.c b/lib/odp-util.c
> > index 20373ec..2bf30bb 100644
> > --- a/lib/odp-util.c
> > +++ b/lib/odp-util.c
> > @@ -4883,7 +4883,9 @@ odp_flow_key_from_flow__(const struct 
> > odp_flow_key_parms *parms,
> >  goto unencap;
> >  }
> >
> > -nl_msg_put_be16(buf, OVS_KEY_ATTR_ETHERTYPE, data->dl_type);
> > +if (flow->packet_type == htonl(PT_ETH)) {
> > +nl_msg_put_be16(buf, OVS_KEY_ATTR_ETHERTYPE, data->dl_type);
> > +}
> >
> >  if (eth_type_vlan(flow->dl_type)) {
> >  goto unencap;
> >
> > -Original Message-
> > From: Zoltán Balogh [mailto:zoltan.bal...@ericsson.com]
> > Sent: Thursday, July 6, 2017 6:12 PM
> > To: Yang, Yi Y ; Eric Garver 
> > Cc: 'd...@openvswitch.org' ; Jan Scheurich 
> > 
> > Subject: RE: [ovs-dev] [PATCH v2] dpif-netlink: convert packet_type netlink 
> > attribute
> >
> > Hello Yi,
> >
> > I ran make check after applying your change and two tunnel tests did fail.
> >
> > ## -- ##
> > ## openvswitch 2.7.90 test suite. ##
> > ## -- ##
> >
> > 790: tunnel_push_pop_ipv6 - action   FAILED 
> > (tunnel-push-pop-ipv6.at:170)
> > 787: tunnel_push_pop - actionFAILED 
> > (tunnel-push-pop.at:221)
> >
> > The error message from testsuite.log:
> > +2017-07-06T10:06:32.119Z|1|odp_util(revalidator37)|ERR|attribute
> > +eth has length 2 but should have length 12
> >
> > Best regards,
> > Zoltan
> >
> > > -Original Message-
> > > From: Yang, Yi Y [mailto:yi.y.y...@intel.com]
> > > Sent: Thursday, July 06, 2017 11:10 AM
> > > To: Eric Garver ; Zoltán Balogh
> > > 
> > > Cc: 'd...@openvswitch.org' 
> > > Subject: RE: [ovs-dev] [PATCH v2] dpif-netlink: convert packet_type
> > > netlink attribute
> > >
> > > Eric, maybe the below patch can fix your issue, please give a try.
> > >
> > > diff --git a/lib/odp-util.c b/lib/odp-util.c index 20373ec..c5f714d
> > > 100644
> > > --- a/lib/odp-util.c
> > > +++ b/lib/odp-util.c
> > > @@ -4863,6 +4863,9 @@ odp_flow_key_from_flow__(const struct 
> > > odp_flow_key_parms *parms,
> > >  goto 

Re: [ovs-dev] [PATCH] dpif-netilnk: convert packet_type netlink attribute

2017-07-06 Thread Eric Garver
On Thu, Jul 06, 2017 at 09:04:04AM +, Yang, Yi Y wrote:
> Hi, Zoltan
> 
> I checked odp_flow_key_from_flow__ in lib/odp-util.c, it has correctly
> handled PACKET_TYPE and ETHERNET, ETHERTYPE has had correct value no
> matter packet_type is PT_ETH or other L3 types, so I think the
> original put_exclude_packet_type has done the right thing, the only
> one thing to be filtered is PACKET_TYPE. I verified net-next and ovs
> compat mode with NSH patches, both of them can work with the original
> put_exclude_packet_type.
> 
> The only issue as Eric mentioned is we should change
> odp_flow_key_from_flow__ to put mask for ETHERTYPE if packet_type is

This is what my original patch did, but it was suggested to isolate the
all the packet_type workarounds into the same function,
put_exclude_packet_type().

> L3 type. But I didn't see "match_validate complain" in my test.

I see the failure for the new test cases that I've added, layer3 tunnels
for kernel datapath.

You can see that work-in-progress here (includes Zoltan's patch):

  https://github.com/erig0/ovs/tree/temp-layer3-rtnetlink

> 
> nl_msg_put_be32(buf, OVS_KEY_ATTR_PACKET_TYPE, data->packet_type);
> 
> if (OVS_UNLIKELY(parms->probe)) {
> max_vlans = FLOW_MAX_VLAN_HEADERS;
> } else {
> max_vlans = MIN(parms->support.max_vlan_headers, flow_vlan_limit);
> }
> 
> /* Conditionally add L2 attributes for Ethernet packets */
> if (flow->packet_type == htonl(PT_ETH)) {
> eth_key = nl_msg_put_unspec_uninit(buf, OVS_KEY_ATTR_ETHERNET,
>sizeof *eth_key);
> get_ethernet_key(data, eth_key);
> 
> for (int encaps = 0; encaps < max_vlans; encaps++) {
> ovs_be16 tpid = flow->vlans[encaps].tpid;
> 
> if (flow->vlans[encaps].tci == htons(0)) {
> if (eth_type_vlan(flow->dl_type)) {
> /* If VLAN was truncated the tpid is in dl_type */
> tpid = flow->dl_type;
> } else {
> break;
> }
> }
> 
> if (export_mask) {
> nl_msg_put_be16(buf, OVS_KEY_ATTR_ETHERTYPE, OVS_BE16_MAX);
> } else {
> nl_msg_put_be16(buf, OVS_KEY_ATTR_ETHERTYPE, tpid);
> }
> nl_msg_put_be16(buf, OVS_KEY_ATTR_VLAN, data->vlans[encaps].tci);
> encap[encaps] = nl_msg_start_nested(buf, OVS_KEY_ATTR_ENCAP);
> if (flow->vlans[encaps].tci == htons(0)) {
> goto unencap;
> }
> }
> }
> 
> if (ntohs(flow->dl_type) < ETH_TYPE_MIN) {
> /* For backwards compatibility with kernels that don't support
>  * wildcarding, the following convention is used to encode the
>  * OVS_KEY_ATTR_ETHERTYPE for key and mask:
>  *
>  *   key  maskmatches
>  *    ---
>  *  >0x5ff   0x   Specified Ethernet II Ethertype.
>  *  >0x5ff  0 Any Ethernet II or non-Ethernet II frame.
>  * 0x   Any non-Ethernet II frame (except valid
>  *802.3 SNAP packet with valid eth_type).
>  */
> if (export_mask) {
> nl_msg_put_be16(buf, OVS_KEY_ATTR_ETHERTYPE, OVS_BE16_MAX);
> }
> goto unencap;
> }
> 
> nl_msg_put_be16(buf, OVS_KEY_ATTR_ETHERTYPE, data->dl_type);
> 
> -Original Message-
> From: Zoltán Balogh [mailto:zoltan.bal...@ericsson.com] 
> Sent: Wednesday, July 5, 2017 5:25 AM
> To: Yang, Yi Y ; Eric Garver 
> Cc: 'd...@openvswitch.org' ; Jan Scheurich 
> 
> Subject: RE: [ovs-dev] [PATCH] dpif-netilnk: convert packet_type netlink 
> attribute
> 
> Hi Eric and Yi,
> 
> I tried to fix the issues. I posted v2 to the list. Could you have a look at 
> it and test it, please?
> https://patchwork.ozlabs.org/patch/784317/
> 
> Best regards,
> Zoltan
> 
> > -Original Message-
> > From: Yang, Yi Y [mailto:yi.y.y...@intel.com]
> > Sent: Tuesday, July 04, 2017 2:10 AM
> > To: Eric Garver ; Zoltán Balogh 
> > 
> > Cc: 'd...@openvswitch.org' 
> > Subject: RE: [ovs-dev] [PATCH] dpif-netilnk: convert packet_type 
> > netlink attribute
> > 
> > Zoltan, I tested this patch for net-next, it will result in failure by 
> > ovs_assert, in addition, we need to handle OVS_FLOW_ATTR_MASK and 
> > OVS_FLOW_ATTR_KEY differently, to be important, we need to verify it in 
> > kernel mode. From my test and verification, this patch can't work, instead, 
> > it can work without this patch.
> > 
> > -Original Message-
> > From: ovs-dev-boun...@openvswitch.org 
> > [mailto:ovs-dev-boun...@openvswitch.org] On Behalf Of Eric Garver
> > Sent: Tuesday, July 4, 2017 2:52 AM
> > To: Zoltán Balogh 
> > Cc: 

Re: [ovs-dev] [PATCH v2] dpif-netlink: convert packet_type netlink attribute

2017-07-06 Thread Eric Garver
On Thu, Jul 06, 2017 at 10:14:06AM +, Yang, Yi Y wrote:
> I misunderstood Eric, he means we shouldn't have ETHERTYPE if packet_type is 
> L3 type. I tried this one just now, it works.

No. That's not what I meant. We _need_ ETHERTYPE for L3-type (NS 1). The
kernel expects this since it does not understand packet_type.

See my additional comments below.

> 
> diff --git a/lib/odp-util.c b/lib/odp-util.c
> index 20373ec..2bf30bb 100644
> --- a/lib/odp-util.c
> +++ b/lib/odp-util.c
> @@ -4883,7 +4883,9 @@ odp_flow_key_from_flow__(const struct 
> odp_flow_key_parms *parms,
>  goto unencap;
>  }
> 
> -nl_msg_put_be16(buf, OVS_KEY_ATTR_ETHERTYPE, data->dl_type);
> +if (flow->packet_type == htonl(PT_ETH)) {
> +nl_msg_put_be16(buf, OVS_KEY_ATTR_ETHERTYPE, data->dl_type);
> +}
> 
>  if (eth_type_vlan(flow->dl_type)) {
>  goto unencap;
> 
> -Original Message-
> From: Zoltán Balogh [mailto:zoltan.bal...@ericsson.com] 
> Sent: Thursday, July 6, 2017 6:12 PM
> To: Yang, Yi Y ; Eric Garver 
> Cc: 'd...@openvswitch.org' ; Jan Scheurich 
> 
> Subject: RE: [ovs-dev] [PATCH v2] dpif-netlink: convert packet_type netlink 
> attribute
> 
> Hello Yi,
> 
> I ran make check after applying your change and two tunnel tests did fail.
> 
> ## -- ##
> ## openvswitch 2.7.90 test suite. ##
> ## -- ##
> 
> 790: tunnel_push_pop_ipv6 - action   FAILED 
> (tunnel-push-pop-ipv6.at:170)
> 787: tunnel_push_pop - actionFAILED 
> (tunnel-push-pop.at:221)
> 
> The error message from testsuite.log:
> +2017-07-06T10:06:32.119Z|1|odp_util(revalidator37)|ERR|attribute 
> +eth has length 2 but should have length 12
> 
> Best regards,
> Zoltan
> 
> > -Original Message-
> > From: Yang, Yi Y [mailto:yi.y.y...@intel.com]
> > Sent: Thursday, July 06, 2017 11:10 AM
> > To: Eric Garver ; Zoltán Balogh 
> > 
> > Cc: 'd...@openvswitch.org' 
> > Subject: RE: [ovs-dev] [PATCH v2] dpif-netlink: convert packet_type 
> > netlink attribute
> > 
> > Eric, maybe the below patch can fix your issue, please give a try.
> > 
> > diff --git a/lib/odp-util.c b/lib/odp-util.c index 20373ec..c5f714d 
> > 100644
> > --- a/lib/odp-util.c
> > +++ b/lib/odp-util.c
> > @@ -4863,6 +4863,9 @@ odp_flow_key_from_flow__(const struct 
> > odp_flow_key_parms *parms,
> >  goto unencap;
> >  }
> >  }
> > +} else {
> > +if (export_mask) {
> > +nl_msg_put_be16(buf, OVS_KEY_ATTR_ETHERTYPE, 
> > + OVS_BE16_MAX);
> >  }
> > 
> >  if (ntohs(flow->dl_type) < ETH_TYPE_MIN) {
> > 
> > -Original Message-
> > From: Eric Garver [mailto:e...@erig.me]
> > Sent: Wednesday, July 5, 2017 11:14 PM
> > To: Zoltán Balogh 
> > Cc: Yang, Yi Y ; 'd...@openvswitch.org' 
> > 
> > Subject: Re: [ovs-dev] [PATCH v2] dpif-netlink: convert packet_type 
> > netlink attribute
> > 
> > Hi Zoltan,
> > 
> > On Tue, Jul 04, 2017 at 09:23:17PM +, Zoltán Balogh wrote:
> > > By introducing packet type-aware pipeline, match on ethertype was 
> > > removed when packet type is not Ethernet. As pointed out by Eric 
> > > Garver, this could have a side effect on the kernel datapath:
> > > https://patchwork.ozlabs.org/patch/782991/
> > >
> > > This patch does approach the problem from a different perspective.
> > > Instead of re-introducing the unconditional match on Ethernet type 
> > > in all megaflow entries, as suggested by Eric, mapping of 
> > > packet_type != PT_ETH to dl_type could be handled in the 
> > > put_exclude_packet_type() in dpif-netlink.c.
> > >
> > > Put_exclude_packet_type() filters the packet_type netlink attribute 
> > > out, before all attributes are sent from userspace to kernel. This 
> > > commit modifies the put_exclude_packet_type() function to do a 
> > > proper conversation and add the missing OVS_KEY_ATTR_ETHERTYPE attribute 
> > > if it's needed.
> > >
> > > Signed-off-by: Zoltán Balogh 
> > > Reported-by: Eric Garver 
> > > ---
> > >  lib/dpif-netlink.c | 120
> > > +++--
> > >  1 file changed, 90 insertions(+), 30 deletions(-)
> > >
> > > diff --git a/lib/dpif-netlink.c b/lib/dpif-netlink.c index 
> > > 562f613..cf4e98f 100644
> > > --- a/lib/dpif-netlink.c
> > > +++ b/lib/dpif-netlink.c
> > > @@ -3433,34 +3433,101 @@ dpif_netlink_flow_from_ofpbuf(struct
> > > dpif_netlink_flow *flow,  }
> > >
> > >
> > > +static bool
> > > +put_exclude_packet_type(struct ofpbuf *buf, uint16_t type,
> > > +const struct nlattr *data, uint16_t data_len,
> > > +const struct nlattr *packet_type) {
> > > +

[ovs-dev] [PATCH 1/1] userspace: Add IPv6 extension header parsing for tunnels

2017-07-06 Thread Eelco Chaudron
While OVS userspace datapath (OVS-DPDK) supports GREv6, it does not
inter-operate with a native Linux ip6gretap tunnel. This is because
the Linux driver uses IPv6 optional headers for the Tunnel
Encapsulation Limit (rfc 2473, section 6.6).

OVS userspace simply does not parse these IPv6 extension headers
inside netdev_tnl_ip_extract_tnl_md(), as such popping the tunnel
leaves extra bytes resulting in a mangled decapsulated frame.

The change below will parse the IPv6 "next header" chain, and return
the offset to the upper layer protocol.

Signed-off-by: Eelco Chaudron 
---
 lib/netdev-native-tnl.c | 91 -
 1 file changed, 90 insertions(+), 1 deletion(-)

diff --git a/lib/netdev-native-tnl.c b/lib/netdev-native-tnl.c
index 7f3cf98..9a97b7f 100644
--- a/lib/netdev-native-tnl.c
+++ b/lib/netdev-native-tnl.c
@@ -57,6 +57,80 @@ static struct vlog_rate_limit err_rl = 
VLOG_RATE_LIMIT_INIT(60, 5);
 uint16_t tnl_udp_port_min = 32768;
 uint16_t tnl_udp_port_max = 61000;
 
+static int
+netdev_tnl_ip6_get_upperlayer_offset(struct ovs_16aligned_ip6_hdr *ip6)
+{
+uint8_t  ext = ip6->ip6_nxt;
+int  ext_hdr_offset = IPV6_HEADER_LEN;
+uint16_t bytes_left = ntohs(ip6->ip6_plen);
+
+while (true) {
+size_t  ext_size = 0;
+struct ip6_ext *ext_hdr = (struct ip6_ext *) ((uint8_t *)ip6 + \
+  ext_hdr_offset);
+
+if (bytes_left < 8) {
+/*
+ * We need at least 8 bytes of data, which is the minimal extension
+ * header length. The upper layer headers are also minimal 8 bytes.
+ */
+break;
+}
+
+switch (ext) {
+case IPPROTO_TCP:
+case IPPROTO_UDP:
+case IPPROTO_GRE:
+/*
+ * If its any of the upper layer protocols we support for tunnels
+ * return the offset.
+ */
+return ext_hdr_offset;
+
+case IPPROTO_HOPOPTS:
+case IPPROTO_ROUTING:
+case IPPROTO_DSTOPTS:
+/*
+ * Silently ignore these extensions, and their options.
+ */
+ext_size = (ext_hdr->ip6e_len + 1) * 8;
+if (bytes_left < ext_size) {
+return 0;
+}
+break;
+
+case IPPROTO_FRAGMENT:
+/*
+ * Currently IPv6 reassembly is not supported, so do not process
+ * fragmented packets.
+ */
+return 0;
+
+case IPPROTO_AH:
+/*
+ * Currently authentication is not supported, so do not process
+ * the packet further.
+ */
+return 0;
+
+default:
+/*
+ * Drop all packets with an unsupported transport layer,
+ * or unknown extension header.
+ */
+return 0;
+}
+
+ext = ext_hdr->ip6e_nxt;
+bytes_left -= ext_size;
+ext_hdr_offset += ext_size;
+}
+/*
+ * If we end up here the packet is invalid, so drop it...
+ */
+return 0;
+}
+
 void *
 netdev_tnl_ip_extract_tnl_md(struct dp_packet *packet, struct flow_tnl *tnl,
   unsigned int *hlen)
@@ -115,6 +189,7 @@ netdev_tnl_ip_extract_tnl_md(struct dp_packet *packet, 
struct flow_tnl *tnl,
 
 } else if (IP_VER(ip->ip_ihl_ver) == 6) {
 ovs_be32 tc_flow = get_16aligned_be32(>ip6_flow);
+unsigned int upper_layer_offset = 0;
 
 memcpy(tnl->ipv6_src.s6_addr, ip6->ip6_src.be16, sizeof ip6->ip6_src);
 memcpy(tnl->ipv6_dst.s6_addr, ip6->ip6_dst.be16, sizeof ip6->ip6_dst);
@@ -122,7 +197,21 @@ netdev_tnl_ip_extract_tnl_md(struct dp_packet *packet, 
struct flow_tnl *tnl,
 tnl->ip_tos = ntohl(tc_flow) >> 20;
 tnl->ip_ttl = ip6->ip6_hlim;
 
-*hlen += IPV6_HEADER_LEN;
+if ((l3_size - IPV6_HEADER_LEN) >= ntohs(ip6->ip6_plen)) {
+/*
+ * Make sure the remaining buffer is big enough to contain
+ * the entire payload.
+ */
+upper_layer_offset = netdev_tnl_ip6_get_upperlayer_offset(ip6);
+}
+
+if (upper_layer_offset <= 0) {
+VLOG_WARN_RL(_rl,
+ "ipv6 packet has unsupported extension headers");
+return NULL;
+}
+
+*hlen += upper_layer_offset;
 
 } else {
 VLOG_WARN_RL(_rl, "ipv4 packet has invalid version (%d)",
-- 
2.7.5

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


Re: [ovs-dev] [PATCH] checkpatch: Use default encoding from email library.

2017-07-06 Thread Joe Stringer
On 5 July 2017 at 17:26, Ben Pfaff  wrote:
> On Tue, Jul 04, 2017 at 07:16:46AM -0700, Joe Stringer wrote:
>> There are three paths for running the core checkpatch path: From a file,
>> from stdin, or reading from git output. Currently, the file version of
>> this calls the "email" library's decode routine which translates the
>> stream into a bytes array, which we later call decode() to turn it back
>> into a regular string. This works on python2 and python3, but the other
>> paths don't work in python3 due to the following error:
>>
>> $ utilities/checkpatch.py -1
>> == Checking HEAD~0 ==
>> Traceback (most recent call last):
>>   File "utilities/checkpatch.py", line 491, in 
>> if ovs_checkpatch_parse(patch, revision):
>>   File "utilities/checkpatch.py", line 324, in ovs_checkpatch_parse
>> for line in text.decode().split('\n'):
>> AttributeError: 'str' object has no attribute 'decode'
>>
>> Rather than performing this extra encode/decode, strip these out from
>> this path so that the stdin and git variants of checkpatch can work in
>> python3.
>>
>> Signed-off-by: Joe Stringer 
>
> I didn't test this but it sounds reasonable to me.
>
> Acked-by: Ben Pfaff 

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


[ovs-dev] LTTO

2017-07-06 Thread THE NATIONAL
Read Attachment for claim 



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


Re: [ovs-dev] [PATCH v2] dpif-netlink: convert packet_type netlink attribute

2017-07-06 Thread Yang, Yi Y
I misunderstood Eric, he means we shouldn't have ETHERTYPE if packet_type is L3 
type. I tried this one just now, it works.

diff --git a/lib/odp-util.c b/lib/odp-util.c
index 20373ec..2bf30bb 100644
--- a/lib/odp-util.c
+++ b/lib/odp-util.c
@@ -4883,7 +4883,9 @@ odp_flow_key_from_flow__(const struct odp_flow_key_parms 
*parms,
 goto unencap;
 }

-nl_msg_put_be16(buf, OVS_KEY_ATTR_ETHERTYPE, data->dl_type);
+if (flow->packet_type == htonl(PT_ETH)) {
+nl_msg_put_be16(buf, OVS_KEY_ATTR_ETHERTYPE, data->dl_type);
+}

 if (eth_type_vlan(flow->dl_type)) {
 goto unencap;

-Original Message-
From: Zoltán Balogh [mailto:zoltan.bal...@ericsson.com] 
Sent: Thursday, July 6, 2017 6:12 PM
To: Yang, Yi Y ; Eric Garver 
Cc: 'd...@openvswitch.org' ; Jan Scheurich 

Subject: RE: [ovs-dev] [PATCH v2] dpif-netlink: convert packet_type netlink 
attribute

Hello Yi,

I ran make check after applying your change and two tunnel tests did fail.

## -- ##
## openvswitch 2.7.90 test suite. ##
## -- ##

790: tunnel_push_pop_ipv6 - action   FAILED 
(tunnel-push-pop-ipv6.at:170)
787: tunnel_push_pop - actionFAILED 
(tunnel-push-pop.at:221)

The error message from testsuite.log:
+2017-07-06T10:06:32.119Z|1|odp_util(revalidator37)|ERR|attribute 
+eth has length 2 but should have length 12

Best regards,
Zoltan

> -Original Message-
> From: Yang, Yi Y [mailto:yi.y.y...@intel.com]
> Sent: Thursday, July 06, 2017 11:10 AM
> To: Eric Garver ; Zoltán Balogh 
> 
> Cc: 'd...@openvswitch.org' 
> Subject: RE: [ovs-dev] [PATCH v2] dpif-netlink: convert packet_type 
> netlink attribute
> 
> Eric, maybe the below patch can fix your issue, please give a try.
> 
> diff --git a/lib/odp-util.c b/lib/odp-util.c index 20373ec..c5f714d 
> 100644
> --- a/lib/odp-util.c
> +++ b/lib/odp-util.c
> @@ -4863,6 +4863,9 @@ odp_flow_key_from_flow__(const struct 
> odp_flow_key_parms *parms,
>  goto unencap;
>  }
>  }
> +} else {
> +if (export_mask) {
> +nl_msg_put_be16(buf, OVS_KEY_ATTR_ETHERTYPE, 
> + OVS_BE16_MAX);
>  }
> 
>  if (ntohs(flow->dl_type) < ETH_TYPE_MIN) {
> 
> -Original Message-
> From: Eric Garver [mailto:e...@erig.me]
> Sent: Wednesday, July 5, 2017 11:14 PM
> To: Zoltán Balogh 
> Cc: Yang, Yi Y ; 'd...@openvswitch.org' 
> 
> Subject: Re: [ovs-dev] [PATCH v2] dpif-netlink: convert packet_type 
> netlink attribute
> 
> Hi Zoltan,
> 
> On Tue, Jul 04, 2017 at 09:23:17PM +, Zoltán Balogh wrote:
> > By introducing packet type-aware pipeline, match on ethertype was 
> > removed when packet type is not Ethernet. As pointed out by Eric 
> > Garver, this could have a side effect on the kernel datapath:
> > https://patchwork.ozlabs.org/patch/782991/
> >
> > This patch does approach the problem from a different perspective.
> > Instead of re-introducing the unconditional match on Ethernet type 
> > in all megaflow entries, as suggested by Eric, mapping of 
> > packet_type != PT_ETH to dl_type could be handled in the 
> > put_exclude_packet_type() in dpif-netlink.c.
> >
> > Put_exclude_packet_type() filters the packet_type netlink attribute 
> > out, before all attributes are sent from userspace to kernel. This 
> > commit modifies the put_exclude_packet_type() function to do a 
> > proper conversation and add the missing OVS_KEY_ATTR_ETHERTYPE attribute if 
> > it's needed.
> >
> > Signed-off-by: Zoltán Balogh 
> > Reported-by: Eric Garver 
> > ---
> >  lib/dpif-netlink.c | 120
> > +++--
> >  1 file changed, 90 insertions(+), 30 deletions(-)
> >
> > diff --git a/lib/dpif-netlink.c b/lib/dpif-netlink.c index 
> > 562f613..cf4e98f 100644
> > --- a/lib/dpif-netlink.c
> > +++ b/lib/dpif-netlink.c
> > @@ -3433,34 +3433,101 @@ dpif_netlink_flow_from_ofpbuf(struct
> > dpif_netlink_flow *flow,  }
> >
> >
> > +static bool
> > +put_exclude_packet_type(struct ofpbuf *buf, uint16_t type,
> > +const struct nlattr *data, uint16_t data_len,
> > +const struct nlattr *packet_type) {
> > +ovs_assert(NLA_ALIGN(packet_type->nla_len) == NL_A_U32_SIZE);
> > +size_t packet_type_len = NL_A_U32_SIZE;
> > +size_t first_chunk_size = (uint8_t *)packet_type - (uint8_t *)data;
> > +size_t second_chunk_size = data_len - first_chunk_size
> > +   - packet_type_len;
> > +uint8_t *first_attr = NULL;
> > +struct nlattr *next_attr = nl_attr_next(packet_type);
> > +
> > +bool ethernet_present = nl_attr_find__(data, data_len,
> > +

Re: [ovs-dev] [PATCH v2] dpif-netlink: convert packet_type netlink attribute

2017-07-06 Thread Zoltán Balogh
Hello Yi,

I ran make check after applying your change and two tunnel tests did fail.

## -- ##
## openvswitch 2.7.90 test suite. ##
## -- ##

790: tunnel_push_pop_ipv6 - action   FAILED 
(tunnel-push-pop-ipv6.at:170)
787: tunnel_push_pop - actionFAILED 
(tunnel-push-pop.at:221)

The error message from testsuite.log:
+2017-07-06T10:06:32.119Z|1|odp_util(revalidator37)|ERR|attribute eth has 
length 2 but should have length 12

Best regards,
Zoltan

> -Original Message-
> From: Yang, Yi Y [mailto:yi.y.y...@intel.com]
> Sent: Thursday, July 06, 2017 11:10 AM
> To: Eric Garver ; Zoltán Balogh 
> Cc: 'd...@openvswitch.org' 
> Subject: RE: [ovs-dev] [PATCH v2] dpif-netlink: convert packet_type netlink 
> attribute
> 
> Eric, maybe the below patch can fix your issue, please give a try.
> 
> diff --git a/lib/odp-util.c b/lib/odp-util.c
> index 20373ec..c5f714d 100644
> --- a/lib/odp-util.c
> +++ b/lib/odp-util.c
> @@ -4863,6 +4863,9 @@ odp_flow_key_from_flow__(const struct 
> odp_flow_key_parms *parms,
>  goto unencap;
>  }
>  }
> +} else {
> +if (export_mask) {
> +nl_msg_put_be16(buf, OVS_KEY_ATTR_ETHERTYPE, OVS_BE16_MAX);
>  }
> 
>  if (ntohs(flow->dl_type) < ETH_TYPE_MIN) {
> 
> -Original Message-
> From: Eric Garver [mailto:e...@erig.me]
> Sent: Wednesday, July 5, 2017 11:14 PM
> To: Zoltán Balogh 
> Cc: Yang, Yi Y ; 'd...@openvswitch.org' 
> 
> Subject: Re: [ovs-dev] [PATCH v2] dpif-netlink: convert packet_type netlink 
> attribute
> 
> Hi Zoltan,
> 
> On Tue, Jul 04, 2017 at 09:23:17PM +, Zoltán Balogh wrote:
> > By introducing packet type-aware pipeline, match on ethertype was
> > removed when packet type is not Ethernet. As pointed out by Eric
> > Garver, this could have a side effect on the kernel datapath:
> > https://patchwork.ozlabs.org/patch/782991/
> >
> > This patch does approach the problem from a different perspective.
> > Instead of re-introducing the unconditional match on Ethernet type in
> > all megaflow entries, as suggested by Eric, mapping of packet_type !=
> > PT_ETH to dl_type could be handled in the put_exclude_packet_type() in 
> > dpif-netlink.c.
> >
> > Put_exclude_packet_type() filters the packet_type netlink attribute
> > out, before all attributes are sent from userspace to kernel. This
> > commit modifies the put_exclude_packet_type() function to do a proper
> > conversation and add the missing OVS_KEY_ATTR_ETHERTYPE attribute if it's 
> > needed.
> >
> > Signed-off-by: Zoltán Balogh 
> > Reported-by: Eric Garver 
> > ---
> >  lib/dpif-netlink.c | 120
> > +++--
> >  1 file changed, 90 insertions(+), 30 deletions(-)
> >
> > diff --git a/lib/dpif-netlink.c b/lib/dpif-netlink.c index
> > 562f613..cf4e98f 100644
> > --- a/lib/dpif-netlink.c
> > +++ b/lib/dpif-netlink.c
> > @@ -3433,34 +3433,101 @@ dpif_netlink_flow_from_ofpbuf(struct
> > dpif_netlink_flow *flow,  }
> >
> >
> > +static bool
> > +put_exclude_packet_type(struct ofpbuf *buf, uint16_t type,
> > +const struct nlattr *data, uint16_t data_len,
> > +const struct nlattr *packet_type) {
> > +ovs_assert(NLA_ALIGN(packet_type->nla_len) == NL_A_U32_SIZE);
> > +size_t packet_type_len = NL_A_U32_SIZE;
> > +size_t first_chunk_size = (uint8_t *)packet_type - (uint8_t *)data;
> > +size_t second_chunk_size = data_len - first_chunk_size
> > +   - packet_type_len;
> > +uint8_t *first_attr = NULL;
> > +struct nlattr *next_attr = nl_attr_next(packet_type);
> > +
> > +bool ethernet_present = nl_attr_find__(data, data_len,
> > +   OVS_KEY_ATTR_ETHERNET);
> > +
> > +first_attr = nl_msg_put_unspec_uninit(buf, type,
> > +  data_len - packet_type_len);
> > +memcpy(first_attr, data, first_chunk_size);
> > +memcpy(first_attr + first_chunk_size, next_attr,
> > + second_chunk_size);
> > +
> > +return ethernet_present;
> > +}
> > +
> >  /*
> > - * If PACKET_TYPE attribute is present in 'data', it filters
> > PACKET_TYPE out,
> > - * then puts 'data' to 'buf'.
> > + * If PACKET_TYPE attribute is present in 'data', converts it to
> > + ETHERNET and
> > + * ETHERTYPE attributes, then puts 'data' to 'buf'.
> >   */
> >  static void
> > -put_exclude_packet_type(struct ofpbuf *buf, uint16_t type,
> > -const struct nlattr *data, uint16_t data_len)
> > +put_convert_packet_type(struct ofpbuf *buf,
> > +const struct dpif_netlink_flow *flow)
> >  {
> >  const struct nlattr *packet_type;
> > +const struct 

Re: [ovs-dev] [RFC] [PATCH 00/11] Data Path Classifier Offloading

2017-07-06 Thread Finn Christensen
It seems that this patch implements a partial hw-offload using DPDK RTE FLOW 
api.
Using a flow_tag to circumvent the EMC, and get the flow from NIC-delivered 
flow_tag on input.

In general I think that RTE FLOW is capable of doing more, like full flow 
offload, and therefore we should aim at a more full implementation of RTE FLOW 
usage in OVS. We may not always be in the output datapath in OVS, but OVS 
should still be fully updated and in control. 
At least we will need that.
The RTE FLOW feature: rte_flow_query() can be used to retrieve NIC flow 
statistics. And that is what we need here.

Furthermore, we would also like to have the possibility to offload virtual 
ports (at least at some point later), so that the in_port may not be the native 
pmd port_id. This feature is also available in RTE FLOW - item type: 
RTE_FLOW_ITEM_TYPE_PORT
And again, this RTE FLOW feature is more or less, what is needed for this. 

Besides that, I have some questions about this implementation. It is probably 
me that have not read the code carefully enough, but maybe you could clarify 
them for me:

You build an item array out of the flow wildcard mask:
...
if (memcmp(>dl_dst,_mac,sizeof(struct eth_addr))!=0
|| memcmp(>dl_src,_mac,sizeof(struct eth_addr))!=0) {
VLOG_INFO("rte_item_eth\n");
item_any_flow[ii++].set = rte_item_set_eth;
*buf_size += sizeof(struct rte_flow_item_eth);
*buf_size += sizeof(struct rte_flow_item_eth);
if (mask->nw_src!=0 || mask->nw_dst!=0) {
VLOG_INFO("rte_item_ip\n");
item_any_flow[ii++].set = rte_item_set_ip;
*buf_size += sizeof(struct rte_flow_item_ipv4);
*buf_size += sizeof(struct rte_flow_item_ipv4);
if (mask->tp_dst!=0 || mask->tp_src!=0) {
item_any_flow[ii++].set = rte_item_set_udp;
*buf_size += sizeof(struct rte_flow_item_udp);
*buf_size += sizeof(struct rte_flow_item_udp);
}
}
}
Taken from the function hw_pipeline_item_array_build().

I would like to know how you make sure that all important bits in the flow/mask 
does match the flow that you are about to program into the NIC?
Theoretically, would it be possible to program an UDP RTE FLOW filter in NIC by 
using a TCP flow?


It seems as if the flows are never programmed into NIC:

From hw_pipeline_thread():
...
while (1) {
// listen to read_socket :
// call the rte_flow_create ( flow , wildcard mask)
ret = hw_pipeline_msg_queue_dequeue(msgq,_rule);
if (ret != 0) {
continue;
}
if (ptr_rule.mode == HW_PIPELINE_REMOVE_RULE) {
ret =hw_pipeline_remove_flow(dp,_rule.data.rm_flow);
if (OVS_UNLIKELY(ret)) {
VLOG_ERR(" hw_pipeline_remove_flow failed to remove flow  \n");
}
}
ptr_rule.mode = HW_PIPELINE_NO_RULE;
}
Shouldn't hw_pipeline_insert_flow() function be called?


Finn Christensen


-Original Message-
From: ovs-dev-boun...@openvswitch.org [mailto:ovs-dev-boun...@openvswitch.org] 
On Behalf Of Shachar Beiser
Sent: 6. juli 2017 06:33
To: ovs-dev@openvswitch.org
Subject: Re: [ovs-dev] [RFC] [PATCH 00/11] Data Path Classifier Offloading

Hi ,

 I would like to clarify since I did not add the label [RFC] to the subject 
of my patches , but only to the cover letter that All the patches I have sent 
were sent as a RFC:

[RFC] [PATCH 00/11] Data Path Classifier Offloading [RFC][PATCH 1/11] 
ovs/dp-cls 
[RFC][PATCH 2/11] ovs/dp-cls 
[RFC] [PATCH 3/11] ovs/dp-cls 
[RFC] [PATCH 4/11] ovs/dp-cls 
[RFC] [PATCH 5/11] ovs/dp-cls 
[RFC][PATCH 6/11] ovs/dp-cls 
[RFC] [PATCH 7/11] ovs/dp-cls 
[RFC] [PATCH 8/11] ovs/dp-cls 
[RFC] [PATCH 9/11] ovs/dp-cls 
[RFC] [PATCH 10/11] ovs/dp-cls 
[RFC] [PATCH 11/11] ovs/dp-cls 

-Shachar Beiser


-Original Message-
From: Shachar Beiser [mailto:shacha...@mellanox.com]
Sent: Wednesday, July 5, 2017 3:27 PM
To: ovs-dev@openvswitch.org
Cc: Shachar Beiser ; Mark Bloch ; 
Olga Shern 
Subject: [PATCH 00/11] Data Path Classifier Offloading

Request for comments Subject: OVS data-path classifier offload 

Versions:
  OVS master.
  DPDK 17.05.1.

Purpose & Scope
This RFC describes the flows’ hardware offloading over DPDK .
The motivation of hardware flows’ offloading is accelerating the OVS DPDK data 
plane.The classification is done by the hardware.
A flow tag that represents the matched rule in the hardware, received by the 
OVS and saves the lookup time.
OVS data-path classifier has to support additional functionality.
If the hardware supports flows table offloading and the user activates the 
feature,the classifier rules are offloaded to the hardware classifier in 
addition to the data-path classifier.
When flows are removed from the classifier the flows have to be removed 

Re: [ovs-dev] [PATCH v1] docs: Use DPDK 16.11.2 stable release.

2017-07-06 Thread Stokes, Ian
> Great.  I've pushed it to "branch-2.7" and it will be part of the 2.7.1
> release, which I plan to release shortly.
> 
> Since the master branch still references 16.11.1, I'd think you'd also
> like to apply this patch there, too.  The patch was targeted for "branch-
> 2.7" and doesn't apply cleanly to master.  Normally under these
> circumstances, we'd target master and then request the committer to
> backport it to "branch-2.7'.  Would you like me to apply this to master?
> 
I think this makes sense,

The original patch acked by Mark and Darrel was aimed at the master branch but 
would not apply cleanly to 2.7 when I tested last night, hence the re-spin I 
did specifically targeting the 2.7 branch.

The original patch (below) still applies cleanly to master and so I think we 
can go ahead with that.

https://mail.openvswitch.org/pipermail/ovs-dev/2017-June/334372.html

Thanks 
Ian

> Thanks,
> 
> --Justin
> 
> 
> > On Jul 5, 2017, at 11:51 AM, Stokes, Ian  wrote:
> >
> > Hi All,
> >
> > I've rebased the patch to specifically apply to the current 2.7 branch.
> I've added your acks to the commit.
> >
> > https://mail.openvswitch.org/pipermail/ovs-dev/2017-July/334952.html
> >
> > Thanks
> > Ian
> >
> >> -Original Message-
> >> From: ovs-dev-boun...@openvswitch.org [mailto:ovs-dev-
> >> boun...@openvswitch.org] On Behalf Of Stokes, Ian
> >> Sent: Wednesday, July 5, 2017 7:23 PM
> >> To: Darrell Ball ; Kavanagh, Mark B
> >> ; d...@openvswitch.org
> >> Subject: Re: [ovs-dev] [PATCH v1] docs: Use DPDK 16.11.2 stable
> release.
> >>
> >>
> >>
> >>> -Original Message-
> >>> From: Darrell Ball [mailto:db...@vmware.com]
> >>> Sent: Wednesday, July 5, 2017 5:48 PM
> >>> To: Kavanagh, Mark B ; Stokes, Ian
> >>> ; d...@openvswitch.org
> >>> Cc: Justin Pettit 
> >>> Subject: Re: [ovs-dev] [PATCH v1] docs: Use DPDK 16.11.2 stable
> release.
> >>>
> >>>
> >>>
> >>> On 7/5/17, 8:15 AM, "Kavanagh, Mark B" 
> >> wrote:
> >>>
>  From: ovs-dev-boun...@openvswitch.org [mailto:ovs-dev-
> >>> boun...@openvswitch.org]
>  On Behalf Of Stokes, Ian
>  Sent: Tuesday, July 4, 2017 10:09 AM
>  To: Darrell Ball ; d...@openvswitch.org
>  Subject: Re: [ovs-dev] [PATCH v1] docs: Use DPDK 16.11.2 stable
> >>> release.
> 
> > Hi Ian
> >
> > Do you have a good link to the 16.11.2 release notes ?
> > I have been looking around and found some links but may not be
> >>> the best
> > and I am not sure new functionality is not being enabled with
> >>> 16.11.2 ?
> >
> > What specifically do we want from 16.11.2 ?
> >
> > Thanks Darrell
> 
>  Hi Darrell,
> 
>  16.11.2 will not have new functionality, it will consist of the
> >>> latest bug
>  fixes for existing functionality for DPDK 16.11.1. There is no
> >>> API/ABI changes
>  in the stable point releases for DPDK.
> 
>  A list of the bugs fixed in 16.11.2 since 16.11.1 is available here
> 
>  https://urldefense.proofpoint.com/v2/url?u=http-
> >>> 3A__dpdk.org_doc_guides-2D16.11_rel-5Fnotes_release-5F16-
> >>> 5F11.html=DwIFAg=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-
> >>> uZnsw=WT0gkeJ7w_DRRPKN4FC6Wg_G7qmoH7ZjWdDuGE9RkPQ=ESCIMH2vhsR-
> >>> QKMN6ZZCt5cy1GPtZLi5CJHz9ACELWg=
> 
>  In particular what caught my eye was the bug fixes for vfio and
> >> vhost
> 
>  vfio: fix disabling INTx
>  vfio: fix secondary process start
>  vhost: change log levels in client mode
>  vhost: fix dequeue zero copy
>  vhost: fix false sharing
>  vhost: fix fd leaks for vhost-user server mode
>  vhost: fix max queues
>  vhost: fix multiple queue not enabled for old kernels
>  vhost: fix use after free
> 
>  There is also a number of out of bound array bug fixes for the
> >>> i40e and ixgbe
>  drivers.
> 
>  On a side note for the motivation for the move, there has been
> >>> instances in
>  the past (for example mempool allocations) where a bug has been
> >>> reported in
>  OVS DPDK in specific cornercases, upon investigating we found it
> >>> was a bug in
>  DPDK 16.11.0 release which had already been reported and fixed in
> >>> the
> >>> 16.11.1
>  release.
> >>>
> >>>
> >>>+1 on this - I've handled similar OvS 'bugs' where the root-cause
> >>> was a DPDK issue that had already been resolved on the DPDK stable
> >> branch.
> >>>I can't recommend strongly enough that we move to the 16.11.2
> >>> branch for OvS 2.7.1 (stable branch + stable branch =  fewer bugs
> >>> all
> >> 'round).
> >>>
> >>>Thanks,
> >>>Mark
> >>>
> >>> Hi Ian
> >>>
> >>> There is no issue regarding plain bug fixes.
> >>> The only theoretical concern is enabling new code paths that were
> >>> short- circuited before because of bugs, but I don’t think that is

Re: [ovs-dev] [PATCH v2] dpif-netlink: convert packet_type netlink attribute

2017-07-06 Thread Yang, Yi Y
Eric, maybe the below patch can fix your issue, please give a try.

diff --git a/lib/odp-util.c b/lib/odp-util.c
index 20373ec..c5f714d 100644
--- a/lib/odp-util.c
+++ b/lib/odp-util.c
@@ -4863,6 +4863,9 @@ odp_flow_key_from_flow__(const struct odp_flow_key_parms 
*parms,
 goto unencap;
 }
 }
+} else {
+if (export_mask) {
+nl_msg_put_be16(buf, OVS_KEY_ATTR_ETHERTYPE, OVS_BE16_MAX);
 }

 if (ntohs(flow->dl_type) < ETH_TYPE_MIN) {

-Original Message-
From: Eric Garver [mailto:e...@erig.me] 
Sent: Wednesday, July 5, 2017 11:14 PM
To: Zoltán Balogh 
Cc: Yang, Yi Y ; 'd...@openvswitch.org' 

Subject: Re: [ovs-dev] [PATCH v2] dpif-netlink: convert packet_type netlink 
attribute

Hi Zoltan,

On Tue, Jul 04, 2017 at 09:23:17PM +, Zoltán Balogh wrote:
> By introducing packet type-aware pipeline, match on ethertype was 
> removed when packet type is not Ethernet. As pointed out by Eric 
> Garver, this could have a side effect on the kernel datapath:
> https://patchwork.ozlabs.org/patch/782991/
> 
> This patch does approach the problem from a different perspective.
> Instead of re-introducing the unconditional match on Ethernet type in 
> all megaflow entries, as suggested by Eric, mapping of packet_type != 
> PT_ETH to dl_type could be handled in the put_exclude_packet_type() in 
> dpif-netlink.c.
> 
> Put_exclude_packet_type() filters the packet_type netlink attribute 
> out, before all attributes are sent from userspace to kernel. This 
> commit modifies the put_exclude_packet_type() function to do a proper 
> conversation and add the missing OVS_KEY_ATTR_ETHERTYPE attribute if it's 
> needed.
> 
> Signed-off-by: Zoltán Balogh 
> Reported-by: Eric Garver 
> ---
>  lib/dpif-netlink.c | 120 
> +++--
>  1 file changed, 90 insertions(+), 30 deletions(-)
> 
> diff --git a/lib/dpif-netlink.c b/lib/dpif-netlink.c index 
> 562f613..cf4e98f 100644
> --- a/lib/dpif-netlink.c
> +++ b/lib/dpif-netlink.c
> @@ -3433,34 +3433,101 @@ dpif_netlink_flow_from_ofpbuf(struct 
> dpif_netlink_flow *flow,  }
>  
>  
> +static bool
> +put_exclude_packet_type(struct ofpbuf *buf, uint16_t type,
> +const struct nlattr *data, uint16_t data_len,
> +const struct nlattr *packet_type) {
> +ovs_assert(NLA_ALIGN(packet_type->nla_len) == NL_A_U32_SIZE);
> +size_t packet_type_len = NL_A_U32_SIZE;
> +size_t first_chunk_size = (uint8_t *)packet_type - (uint8_t *)data;
> +size_t second_chunk_size = data_len - first_chunk_size
> +   - packet_type_len;
> +uint8_t *first_attr = NULL;
> +struct nlattr *next_attr = nl_attr_next(packet_type);
> +
> +bool ethernet_present = nl_attr_find__(data, data_len,
> +   OVS_KEY_ATTR_ETHERNET);
> +
> +first_attr = nl_msg_put_unspec_uninit(buf, type,
> +  data_len - packet_type_len);
> +memcpy(first_attr, data, first_chunk_size);
> +memcpy(first_attr + first_chunk_size, next_attr, 
> + second_chunk_size);
> +
> +return ethernet_present;
> +}
> +
>  /*
> - * If PACKET_TYPE attribute is present in 'data', it filters 
> PACKET_TYPE out,
> - * then puts 'data' to 'buf'.
> + * If PACKET_TYPE attribute is present in 'data', converts it to 
> + ETHERNET and
> + * ETHERTYPE attributes, then puts 'data' to 'buf'.
>   */
>  static void
> -put_exclude_packet_type(struct ofpbuf *buf, uint16_t type,
> -const struct nlattr *data, uint16_t data_len)
> +put_convert_packet_type(struct ofpbuf *buf,
> +const struct dpif_netlink_flow *flow)
>  {
>  const struct nlattr *packet_type;
> +const struct nlattr *data = flow->key;
> +uint16_t data_len = flow->key_len;
> +const struct nlattr *mask_data = flow->mask;
> +uint16_t mask_len = flow->mask_len;
> +ovs_be32 value = htonl(PT_ETH);
> +bool ethernet_present = false;
> +
> +/* Verify KEY attributes.  */
> +if (data_len) {
> +packet_type = nl_attr_find__(data, data_len, 
> OVS_KEY_ATTR_PACKET_TYPE);
> +if (packet_type) {
> +/* Convert PACKET_TYPE Netlink attribute. */
> +value = nl_attr_get_be32(packet_type);
> +ethernet_present = put_exclude_packet_type(buf, 
> OVS_FLOW_ATTR_KEY,
> +   data, data_len,
> +   packet_type);
> +/* Put OVS_KEY_ATTR_ETHERTYPE if needed. */
> +if (ntohl(value) == PT_ETH) {
> +ovs_assert(ethernet_present);
> +} else {
> +const struct nlattr *eth_type;
> +ovs_be16 ns_type = pt_ns_type_be(value);
>  
> -packet_type = 

Re: [ovs-dev] [PATCH v2 4/4] redhat: allow dpdk to also run as non-root user

2017-07-06 Thread Timothy M. Redaelli
Hi Aaron,

On 07/05/2017 07:56 PM, Aaron Conole wrote:
> After this commit, users may start a dpdk-enabled ovs setup as a
> non-root user.  This is accomplished by exporting the $HOME directory,
> which dpdk uses to fill in it's semi-persistent RTE configuration.
> 
> This change may be a bit controversial since it modifies /dev/hugepages
> as part of starting the ovs-vswitchd to set a hugetlbfs group
> ownership.  This is used to enable writing to /dev/hugepages so that the
> dpdk_init will successfully complete.  There is an alternate way of
> accomplishing this - namely to initialize DPDK before dropping
> privileges.  However, this would mean that if DPDK ever grows an uninit
> / reinit function, non-root ovs likely could never use it.
> 
> This does not change OvS+DPDK's SELinux requirements.  It still must be
> disabled.
> 
> Signed-off-by: Aaron Conole 
> ---
>  rhel/.gitignore |  1 +
>  rhel/automake.mk|  3 ++-
>  rhel/openvswitch-fedora.spec.in | 13 
> +
>  ...rvice => usr_lib_systemd_system_ovs-vswitchd.service.in} |  4 
>  4 files changed, 20 insertions(+), 1 deletion(-)
>  rename rhel/{usr_lib_systemd_system_ovs-vswitchd.service => 
> usr_lib_systemd_system_ovs-vswitchd.service.in} (87%)
> 
> diff --git a/rhel/.gitignore b/rhel/.gitignore
> index 164bb66..e584a1e 100644
> --- a/rhel/.gitignore
> +++ b/rhel/.gitignore
> @@ -4,3 +4,4 @@ openvswitch-kmod-rhel6.spec
>  openvswitch-kmod-fedora.spec
>  openvswitch.spec
>  openvswitch-fedora.spec
> +usr_lib_systemd_system_ovs-vswitchd.service
> diff --git a/rhel/automake.mk b/rhel/automake.mk
> index 2d9443f..439af26 100644
> --- a/rhel/automake.mk
> +++ b/rhel/automake.mk
> @@ -29,6 +29,7 @@ EXTRA_DIST += \
>   rhel/usr_lib_systemd_system_openvswitch.service \
>   rhel/usr_lib_systemd_system_ovsdb-server.service \
>   rhel/usr_lib_systemd_system_ovs-vswitchd.service \
> + rhel/usr_lib_systemd_system_ovs-vswitchd.service.in \
>   rhel/usr_lib_systemd_system_ovn-controller.service \
>   rhel/usr_lib_systemd_system_ovn-controller-vtep.service \
>   rhel/usr_lib_systemd_system_ovn-northd.service \
> @@ -59,7 +60,7 @@ RPMBUILD_TOP := $(abs_top_builddir)/rpm/rpmbuild
>  RPMBUILD_OPT ?= --without check
>  
>  # Build user-space RPMs
> -rpm-fedora: dist $(srcdir)/rhel/openvswitch-fedora.spec
> +rpm-fedora: dist $(srcdir)/rhel/openvswitch-fedora.spec 
> $(srcdir)/rhel/usr_lib_systemd_system_ovs-vswitchd.service
>   ${MKDIR_P} ${RPMBUILD_TOP}/SOURCES
>   cp ${DIST_ARCHIVES} ${RPMBUILD_TOP}/SOURCES
>   rpmbuild ${RPMBUILD_OPT} \
> diff --git a/rhel/openvswitch-fedora.spec.in b/rhel/openvswitch-fedora.spec.in
> index 7c805b2..83cfb18 100644
> --- a/rhel/openvswitch-fedora.spec.in
> +++ b/rhel/openvswitch-fedora.spec.in
> @@ -95,6 +95,10 @@ Requires: openssl hostname iproute module-init-tools
>  Requires(post): /usr/bin/getent
>  Requires(post): /usr/sbin/useradd
>  Requires(post): /usr/bin/sed
> +%if %{with dpdk}
> +Requires(post): /usr/sbin/usermod
> +Requires(post): /usr/sbin/groupadd
> +%endif
>  Requires(post): systemd-units
>  Requires(preun): systemd-units
>  Requires(postun): systemd-units
> @@ -366,6 +370,15 @@ if [ $1 -eq 1 ]; then
>  
>  sed -i 's:^#OVS_USER_ID=:OVS_USER_ID=:' /etc/sysconfig/openvswitch
>  
> +%if %{with dpdk}
> +getent group hugetlbfs >/dev/null || \
> +groupadd hugetlbfs
> +usermod -a -G hugetlbfs openvswitch
> +sed -i \
> +
> 's@OVS_USER_ID="openvswitch:openvswitch"@OVS_USER_ID="openvswitch:hugetlbfs":'\

There is a typo on this sed, you need to terminate it by "@" and not ":"
or you will have:
"sed: -e expression #1, char 76: unterminated `s' command" error

> +/etc/sysconfig/openvswitch
> +%endif
> +
>  # In the case of upgrade, this is not needed.
>  chown -R openvswitch:openvswitch /etc/openvswitch
>  fi
> diff --git a/rhel/usr_lib_systemd_system_ovs-vswitchd.service 
> b/rhel/usr_lib_systemd_system_ovs-vswitchd.service.in
> similarity index 87%
> rename from rhel/usr_lib_systemd_system_ovs-vswitchd.service
> rename to rhel/usr_lib_systemd_system_ovs-vswitchd.service.in
> index 48231b3..2d2e9e6 100644
> --- a/rhel/usr_lib_systemd_system_ovs-vswitchd.service
> +++ b/rhel/usr_lib_systemd_system_ovs-vswitchd.service.in
> @@ -10,8 +10,12 @@ PartOf=openvswitch.service
>  [Service]
>  Type=forking
>  Restart=on-failure
> +Environment="HOME=/var/run/openvswitch"

Usually in systemd service file you don't need to put quotes, unless you
need to assign a value containing spaces to a variable.

>  EnvironmentFile=/etc/openvswitch/default.conf
>  EnvironmentFile=-/etc/sysconfig/openvswitch
> +@begin_dpdk@
> +ExecStartPre="/usr/sbin/chown :hugetlbfs /dev/hugepages"

quotes are not needed in ExecStartPre too and I suggest to remove them
for coherency with the other service files.
chown is in "/usr/bin" 

Re: [ovs-dev] [PATCH] dpif-netilnk: convert packet_type netlink attribute

2017-07-06 Thread Yang, Yi Y
Hi, Zoltan

I checked odp_flow_key_from_flow__ in lib/odp-util.c, it has correctly handled 
PACKET_TYPE and ETHERNET, ETHERTYPE has had correct value no matter packet_type 
is PT_ETH or other L3 types, so I think the original put_exclude_packet_type 
has done the right thing, the only one thing to be filtered is PACKET_TYPE. I 
verified net-next and ovs compat mode with NSH patches, both of them can work 
with the original put_exclude_packet_type.

The only issue as Eric mentioned is we should change odp_flow_key_from_flow__ 
to put mask for ETHERTYPE if packet_type is L3 type. But I didn't see 
"match_validate complain" in my test.

nl_msg_put_be32(buf, OVS_KEY_ATTR_PACKET_TYPE, data->packet_type);

if (OVS_UNLIKELY(parms->probe)) {
max_vlans = FLOW_MAX_VLAN_HEADERS;
} else {
max_vlans = MIN(parms->support.max_vlan_headers, flow_vlan_limit);
}

/* Conditionally add L2 attributes for Ethernet packets */
if (flow->packet_type == htonl(PT_ETH)) {
eth_key = nl_msg_put_unspec_uninit(buf, OVS_KEY_ATTR_ETHERNET,
   sizeof *eth_key);
get_ethernet_key(data, eth_key);

for (int encaps = 0; encaps < max_vlans; encaps++) {
ovs_be16 tpid = flow->vlans[encaps].tpid;

if (flow->vlans[encaps].tci == htons(0)) {
if (eth_type_vlan(flow->dl_type)) {
/* If VLAN was truncated the tpid is in dl_type */
tpid = flow->dl_type;
} else {
break;
}
}

if (export_mask) {
nl_msg_put_be16(buf, OVS_KEY_ATTR_ETHERTYPE, OVS_BE16_MAX);
} else {
nl_msg_put_be16(buf, OVS_KEY_ATTR_ETHERTYPE, tpid);
}
nl_msg_put_be16(buf, OVS_KEY_ATTR_VLAN, data->vlans[encaps].tci);
encap[encaps] = nl_msg_start_nested(buf, OVS_KEY_ATTR_ENCAP);
if (flow->vlans[encaps].tci == htons(0)) {
goto unencap;
}
}
}

if (ntohs(flow->dl_type) < ETH_TYPE_MIN) {
/* For backwards compatibility with kernels that don't support
 * wildcarding, the following convention is used to encode the
 * OVS_KEY_ATTR_ETHERTYPE for key and mask:
 *
 *   key  maskmatches
 *    ---
 *  >0x5ff   0x   Specified Ethernet II Ethertype.
 *  >0x5ff  0 Any Ethernet II or non-Ethernet II frame.
 * 0x   Any non-Ethernet II frame (except valid
 *802.3 SNAP packet with valid eth_type).
 */
if (export_mask) {
nl_msg_put_be16(buf, OVS_KEY_ATTR_ETHERTYPE, OVS_BE16_MAX);
}
goto unencap;
}

nl_msg_put_be16(buf, OVS_KEY_ATTR_ETHERTYPE, data->dl_type);

-Original Message-
From: Zoltán Balogh [mailto:zoltan.bal...@ericsson.com] 
Sent: Wednesday, July 5, 2017 5:25 AM
To: Yang, Yi Y ; Eric Garver 
Cc: 'd...@openvswitch.org' ; Jan Scheurich 

Subject: RE: [ovs-dev] [PATCH] dpif-netilnk: convert packet_type netlink 
attribute

Hi Eric and Yi,

I tried to fix the issues. I posted v2 to the list. Could you have a look at it 
and test it, please?
https://patchwork.ozlabs.org/patch/784317/

Best regards,
Zoltan

> -Original Message-
> From: Yang, Yi Y [mailto:yi.y.y...@intel.com]
> Sent: Tuesday, July 04, 2017 2:10 AM
> To: Eric Garver ; Zoltán Balogh 
> 
> Cc: 'd...@openvswitch.org' 
> Subject: RE: [ovs-dev] [PATCH] dpif-netilnk: convert packet_type 
> netlink attribute
> 
> Zoltan, I tested this patch for net-next, it will result in failure by 
> ovs_assert, in addition, we need to handle OVS_FLOW_ATTR_MASK and 
> OVS_FLOW_ATTR_KEY differently, to be important, we need to verify it in 
> kernel mode. From my test and verification, this patch can't work, instead, 
> it can work without this patch.
> 
> -Original Message-
> From: ovs-dev-boun...@openvswitch.org 
> [mailto:ovs-dev-boun...@openvswitch.org] On Behalf Of Eric Garver
> Sent: Tuesday, July 4, 2017 2:52 AM
> To: Zoltán Balogh 
> Cc: 'd...@openvswitch.org' 
> Subject: Re: [ovs-dev] [PATCH] dpif-netilnk: convert packet_type 
> netlink attribute
> 
> On Mon, Jul 03, 2017 at 02:27:18PM +, Zoltán Balogh wrote:
> > By introducing packet type-aware pipeline, match on ethertype was 
> > removed when packet type is not Ethernet. As pointed out by Eric 
> > Garver, this could have a side effect on the kernel datapath:
> > https://patchwork.ozlabs.org/patch/782991/
> >
> > This patch does approach the problem from a different perspective.
> > Instead of re-introducing the unconditional match on Ethernet type 
> > in all megaflow entries, as suggested by Eric, 

Re: [ovs-dev] [PATCHv2 1/2] ofp-parse: Fix small memory leak when calling parse_ofp_meter_mod_str().

2017-07-06 Thread Justin Pettit

> On Jul 5, 2017, at 4:09 PM, Ben Pfaff  wrote:
> 
> On Tue, Jun 27, 2017 at 06:14:43PM -0700, Justin Pettit wrote:
>> The function parse_ofp_meter_mod_str() allocates a buffer called
>> 'bands', which parse_ofp_meter_mod_str__() then steals for the member
>> 'mm->meter.bands'.  Calling functions didn't free that stolen value and
>> the comments for those function didn't indicate that was necessary.
>> 
>> Found by valgrind.
>> 
>> Signed-off-by: Justin Pettit 
>> ---
>> v1->v2: Fix unitialized path.
> 
> I think there's still an uninitialized variable, fold this in?

Good catch.  I made that change and pushed it to master.

Thanks,

--Justin



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


Re: [ovs-dev] [PATCH v1] docs: Use DPDK 16.11.2 stable release.

2017-07-06 Thread Justin Pettit
Great.  I've pushed it to "branch-2.7" and it will be part of the 2.7.1 
release, which I plan to release shortly.

Since the master branch still references 16.11.1, I'd think you'd also like to 
apply this patch there, too.  The patch was targeted for "branch-2.7" and 
doesn't apply cleanly to master.  Normally under these circumstances, we'd 
target master and then request the committer to backport it to "branch-2.7'.  
Would you like me to apply this to master?

Thanks,

--Justin


> On Jul 5, 2017, at 11:51 AM, Stokes, Ian  wrote:
> 
> Hi All,
> 
> I've rebased the patch to specifically apply to the current 2.7 branch. I've 
> added your acks to the commit.
> 
> https://mail.openvswitch.org/pipermail/ovs-dev/2017-July/334952.html
> 
> Thanks
> Ian
> 
>> -Original Message-
>> From: ovs-dev-boun...@openvswitch.org [mailto:ovs-dev-
>> boun...@openvswitch.org] On Behalf Of Stokes, Ian
>> Sent: Wednesday, July 5, 2017 7:23 PM
>> To: Darrell Ball ; Kavanagh, Mark B
>> ; d...@openvswitch.org
>> Subject: Re: [ovs-dev] [PATCH v1] docs: Use DPDK 16.11.2 stable release.
>> 
>> 
>> 
>>> -Original Message-
>>> From: Darrell Ball [mailto:db...@vmware.com]
>>> Sent: Wednesday, July 5, 2017 5:48 PM
>>> To: Kavanagh, Mark B ; Stokes, Ian
>>> ; d...@openvswitch.org
>>> Cc: Justin Pettit 
>>> Subject: Re: [ovs-dev] [PATCH v1] docs: Use DPDK 16.11.2 stable release.
>>> 
>>> 
>>> 
>>> On 7/5/17, 8:15 AM, "Kavanagh, Mark B" 
>> wrote:
>>> 
 From: ovs-dev-boun...@openvswitch.org [mailto:ovs-dev-
>>> boun...@openvswitch.org]
 On Behalf Of Stokes, Ian
 Sent: Tuesday, July 4, 2017 10:09 AM
 To: Darrell Ball ; d...@openvswitch.org
 Subject: Re: [ovs-dev] [PATCH v1] docs: Use DPDK 16.11.2 stable
>>> release.
 
> Hi Ian
> 
> Do you have a good link to the 16.11.2 release notes ?
> I have been looking around and found some links but may not be
>>> the best
> and I am not sure new functionality is not being enabled with
>>> 16.11.2 ?
> 
> What specifically do we want from 16.11.2 ?
> 
> Thanks Darrell
 
 Hi Darrell,
 
 16.11.2 will not have new functionality, it will consist of the
>>> latest bug
 fixes for existing functionality for DPDK 16.11.1. There is no
>>> API/ABI changes
 in the stable point releases for DPDK.
 
 A list of the bugs fixed in 16.11.2 since 16.11.1 is available here
 
 https://urldefense.proofpoint.com/v2/url?u=http-
>>> 3A__dpdk.org_doc_guides-2D16.11_rel-5Fnotes_release-5F16-
>>> 5F11.html=DwIFAg=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-
>>> uZnsw=WT0gkeJ7w_DRRPKN4FC6Wg_G7qmoH7ZjWdDuGE9RkPQ=ESCIMH2vhsR-
>>> QKMN6ZZCt5cy1GPtZLi5CJHz9ACELWg=
 
 In particular what caught my eye was the bug fixes for vfio and
>> vhost
 
 vfio: fix disabling INTx
 vfio: fix secondary process start
 vhost: change log levels in client mode
 vhost: fix dequeue zero copy
 vhost: fix false sharing
 vhost: fix fd leaks for vhost-user server mode
 vhost: fix max queues
 vhost: fix multiple queue not enabled for old kernels
 vhost: fix use after free
 
 There is also a number of out of bound array bug fixes for the
>>> i40e and ixgbe
 drivers.
 
 On a side note for the motivation for the move, there has been
>>> instances in
 the past (for example mempool allocations) where a bug has been
>>> reported in
 OVS DPDK in specific cornercases, upon investigating we found it
>>> was a bug in
 DPDK 16.11.0 release which had already been reported and fixed in
>>> the
>>> 16.11.1
 release.
>>> 
>>> 
>>>+1 on this - I've handled similar OvS 'bugs' where the root-cause
>>> was a DPDK issue that had already been resolved on the DPDK stable
>> branch.
>>>I can't recommend strongly enough that we move to the 16.11.2
>>> branch for OvS 2.7.1 (stable branch + stable branch =  fewer bugs all
>> 'round).
>>> 
>>>Thanks,
>>>Mark
>>> 
>>> Hi Ian
>>> 
>>> There is no issue regarding plain bug fixes.
>>> The only theoretical concern is enabling new code paths that were
>>> short- circuited before because of bugs, but I don’t think that is all
>>> that common.
>>> 
>>> The link you sent is the one I was referring to but I had some doubts
>>> about the contents so I asked to confirm. I assume the new features
>>> and API changes sections are only related to .0 ?
>>> 
>>> If that is the case, then:
>>> Acked-by: Darrell Ball 
>>> 
>>> Thanks Darrell
>>> 
>>> 
>> 
>> Hi Darrell,
>> 
>> I understand the concern with new code paths being enabled but I think we
>> should be ok with this regard.
>> 
>> From what I understand the DPDK stable release revisions undergo
>> validation from the DPDK side before release to ensure these problems are
>> not introduced.
>> 

Re: [ovs-dev] [PATCH v1] docs: Use DPDK 16.11.2 stable release.

2017-07-06 Thread Stokes, Ian
> On Wed, Jul 05, 2017 at 03:48:01PM +, Stokes, Ian wrote:
> > > >From: ovs-dev-boun...@openvswitch.org
> > > >[mailto:ovs-dev-boun...@openvswitch.org]
> > > >On Behalf Of Ian Stokes
> > > >Sent: Tuesday, June 20, 2017 1:57 PM
> > > >To: d...@openvswitch.org
> > > >Subject: [ovs-dev] [PATCH v1] docs: Use DPDK 16.11.2 stable release.
> > > >
> > > >Modify docs and travis linux build script to use the DPDK 16.11.2
> > > >stable branch to benefit from most recent bug fixes.
> > > >
> > > >Signed-off-by: Ian Stokes 
> > >
> > > One comment - I see references to 16.11 in $OVS_DIR/debian/changelog
> > > and $OVS_DIR/rhel/openvswitch-fedora.spec.in.
> > >
> > > Although these weren't updated for 16.11.1, I wonder if they should
> > > have been, and consequently updated here for 16.11.2?
> > HI Mark,
> >
> > I'm not sure of those should be updated tbh, for debian it's under the
> > header of
> >
> > openvswitch (2.7.0-1) unstable; urgency=low
> >
> > I think it should stay as 16.11 here as that's what was initially
> supported for 2.7.0-1 I would guess.
> >
> > If a new section for 2.7.1 is added I guess we could add it there (Im
> not sure though as we haven't done this before).
> 
> debian/changelog is mostly a copy of NEWS.  It's meant to explain what
> features were added in a release.  It doesn't make sense to update old
> entries here, just as it doesn't make sense to update old entries in NEWS.
> 
> > I'd be slow to update the reference in
> > $OVS_DIR/rhel/openvswitch-fedora.spec.in as its
> >
> > BuildRequires: dpdk-devel >= 16.11
> >
> > I would think the >= takes care of moving to the latest 16.11 available
> for the distro?
> 
> That's my understanding too.

Thanks for confirming these 2 points Ben, much appreciated.

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


Re: [ovs-dev] offset of 0x10001 in dpif_netlink_queue_to_priority

2017-07-06 Thread Matthias May
On 06/07/17 02:24, Ben Pfaff wrote:
> On Tue, Jul 04, 2017 at 05:09:21PM +0200, Matthias May wrote:
>> Hi
>>
>> I'm trying to map the vlan_pcp onto 802.11 tid.
>>
>> net/wireless/util.c in mac80211 specifies:
>>
>>> /* skb->priority values from 256->263 are magic values to
>>>  * directly indicate a specific 802.1d priority.  This is used
>>>  * to allow 802.1d priority to be passed directly in from VLAN
>>>  * tags, etc.
>>>  */
>>> if (skb->priority >= 256 && skb->priority <= 263)
>>> return skb->priority - 256;
>>
>> However the function dpif_netlink_queue_to_priority in /lib/dpif-netlink.c 
>> sets:
>>>if (queue_id < 0xf000) {
>>>*priority = TC_H_MAKE(1 << 16, queue_id + 1);
>>
>> With this the lowest skb_priority I can set is 0x10001, slightly over the 
>> magic values I need to use ;)
>>
>> Why is this offset of 0x1 + 1 in place?
>> Is something else in ovs about which I'm not aware dependant on this offset?
> 
> It's because this is mapping from an OpenFlow queue ID to a kernel
> skb_priority value.  These aren't the same namespace and so you need a
> mapping function.
> 

What do you mean "not the same namespace"?
I need to set the skb_priority, set_queue sets the skb_priority but with an 
offset.
If I patch the line to
*priority = queue_id;
everything works as I expect it.

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