[ovs-dev] Returned mail: Data format error

2016-02-22 Thread 0nb400blodxvyt00
The message was not delivered due to the following reason(s):

Your message was not delivered because the destination computer was
unreachable within the allowed queue period. The amount of time
a message is queued before it is returned depends on local configura-
tion parameters.

Most likely there is a network problem that prevented delivery, but
it is also possible that the computer is turned off, or does not
have a mail system running right now.

Your message could not be delivered within 6 days:
Host 181.172.133.134 is not responding.

The following recipients did not receive this message:


Please reply to postmas...@openvswitch.org
if you feel this message to be in error.

___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] Returned mail: Data format error

2016-02-22 Thread dosm
Your message was undeliverable due to the following reason:

Your message was not delivered because the destination server was
not reachable within the allowed queue period. The amount of time
a message is queued before it is returned depends on local configura-
tion parameters.

Most likely there is a network problem that prevented delivery, but
it is also possible that the computer is turned off, or does not
have a mail system running right now.

Your message could not be delivered within 3 days:
Host 196.37.4.148 is not responding.

The following recipients could not receive this message:


Please reply to postmas...@openvswitch.org
if you feel this message to be in error.

___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH v2] ovn-controller: Add external-ids:ovn-remote-probe-interval

2016-02-22 Thread Huang Lei
From: Huang Lei 

For setting the inactivity probe interval of the json session to the OVN 
southbound database.

Signed-off-by: Huang Lei 
---
 lib/jsonrpc.c   |  4 +++-
 lib/ovsdb-idl.c | 10 ++
 lib/ovsdb-idl.h |  4 
 ovn/controller/ovn-controller.8.xml | 14 ++
 ovn/controller/ovn-controller.c | 33 +
 5 files changed, 64 insertions(+), 1 deletion(-)

diff --git a/lib/jsonrpc.c b/lib/jsonrpc.c
index 35428a6..0985d52 100644
--- a/lib/jsonrpc.c
+++ b/lib/jsonrpc.c
@@ -1147,7 +1147,9 @@ void
 jsonrpc_session_set_probe_interval(struct jsonrpc_session *s,
int probe_interval)
 {
-reconnect_set_probe_interval(s->reconnect, probe_interval);
+if (stream_or_pstream_needs_probes(reconnect_get_name(s->reconnect))) {
+reconnect_set_probe_interval(s->reconnect, probe_interval);
+}
 }

 /* Sets the DSCP value used for 's''s connection to 'dscp'.  If this is
diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c
index 4cb1c81..022f0cf 100644
--- a/lib/ovsdb-idl.c
+++ b/lib/ovsdb-idl.c
@@ -565,6 +565,16 @@ ovsdb_idl_get_last_error(const struct ovsdb_idl *idl)
 {
 return jsonrpc_session_get_last_error(idl->session);
 }
+
+/* Sets the "probe interval" for 'idl->session' to 'probe_interval', in
+ * milliseconds.
+ */
+void
+ovsdb_idl_set_probe_interval(const struct ovsdb_idl *idl, int probe_interval)
+{
+jsonrpc_session_set_probe_interval(idl->session, probe_interval);
+}
+
 
 static unsigned char *
 ovsdb_idl_get_mode(struct ovsdb_idl *idl,
diff --git a/lib/ovsdb-idl.h b/lib/ovsdb-idl.h
index 136c38c..96d9436 100644
--- a/lib/ovsdb-idl.h
+++ b/lib/ovsdb-idl.h
@@ -68,7 +68,11 @@ void ovsdb_idl_verify_write_only(struct ovsdb_idl *);

 bool ovsdb_idl_is_alive(const struct ovsdb_idl *);
 int ovsdb_idl_get_last_error(const struct ovsdb_idl *);
+
+void ovsdb_idl_set_probe_interval(const struct ovsdb_idl *, int 
probe_interval);
+
 
+
 /* Choosing columns and tables to replicate. */

 /* Modes with which the IDL can monitor a column.
diff --git a/ovn/controller/ovn-controller.8.xml 
b/ovn/controller/ovn-controller.8.xml
index b261af9..6e57fc6 100644
--- a/ovn/controller/ovn-controller.8.xml
+++ b/ovn/controller/ovn-controller.8.xml
@@ -100,6 +100,20 @@
 
   

+  external_ids:ovn-remote-probe-interval
+  
+
+  The inactivity probe interval of the connection to the OVN database,
+  in milliseconds.
+  If the value is zero, it disables the connection keepalive feature.
+
+
+
+  If the value is nonzero, then it will be forced to a value of
+  at least 1000 ms.
+
+  
+
   external_ids:ovn-encap-type
   
 
diff --git a/ovn/controller/ovn-controller.c b/ovn/controller/ovn-controller.c
index 3638342..7a1b966 100644
--- a/ovn/controller/ovn-controller.c
+++ b/ovn/controller/ovn-controller.c
@@ -34,7 +34,9 @@
 #include "poll-loop.h"
 #include "fatal-signal.h"
 #include "lib/hmap.h"
+#include "lib/ovsdb-idl.h"
 #include "lib/vswitch-idl.h"
+#include "lib/util.h"
 #include "smap.h"
 #include "stream.h"
 #include "stream-ssl.h"
@@ -198,6 +200,32 @@ get_ovnsb_remote(struct ovsdb_idl *ovs_idl)
 }
 }

+/* Retrieves the OVN Southbound remote's json session probe interval from the
+ * "external-ids:ovn-remote-probe-interval" key in 'ovs_idl' and returns it.
+ *
+ * This function must be called after get_ovnsb_remote().
+ *
+ */
+static bool
+get_ovnsb_remote_probe_interval(struct ovsdb_idl *ovs_idl, int * value)
+{
+const struct ovsrec_open_vswitch *cfg = ovsrec_open_vswitch_first(ovs_idl);
+if (cfg) {
+const char * probe_interval =
+smap_get(&cfg->external_ids, "ovn-remote-probe-interval");
+if (probe_interval) {
+if (str_to_int(probe_interval, 10, value))
+{
+VLOG_INFO("OVN OVSDB remote probe interval is %d ms", *value);
+return true;
+}
+}
+}
+
+return false;
+}
+
+
 int
 main(int argc, char *argv[])
 {
@@ -261,6 +289,11 @@ main(int argc, char *argv[])
 ovsdb_idl_create(ovnsb_remote, &sbrec_idl_class, true, true));
 ovsdb_idl_get_initial_snapshot(ovnsb_idl_loop.idl);

+int probe_interval = 0;
+if (get_ovnsb_remote_probe_interval(ovs_idl_loop.idl, &probe_interval)) {
+ovsdb_idl_set_probe_interval(ovnsb_idl_loop.idl, probe_interval);
+}
+
 /* Initialize connection tracking zones. */
 struct simap ct_zones = SIMAP_INITIALIZER(&ct_zones);
 unsigned long ct_zone_bitmap[BITMAP_N_LONGS(MAX_CT_ZONES)];
--
2.5.4 (Apple Git-61)


___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH] ovn-controller: Add external-ids:ovn-remote-probe-interval

2016-02-22 Thread Huang, Lei
Thanks for your review.

BR
Huang Lei


From: Andy Zhou mailto:az...@ovn.org>>
Date: Monday, February 22, 2016 at 7:38 AM
To: Huang Lei <148012...@qq.com>
Cc: "dev@openvswitch.org" 
mailto:dev@openvswitch.org>>, "Huang, Lei" 
mailto:lhua...@ebay.com>>
Subject: Re: [ovs-dev] [PATCH] ovn-controller: Add 
external-ids:ovn-remote-probe-interval



On Sun, Feb 21, 2016 at 1:26 PM, Huang Lei 
<148012...@qq.com> wrote:
From: Huang Lei mailto:lhua...@ebay.com>>

For setting the inactivity probe interval of the json session to the OVN 
southbound database.

Signed-off-by: Huang Lei mailto:lhua...@ebay.com>>

Thanks for contributing!. Please see comments in line.
---
 lib/ovsdb-idl.c | 10 ++
 lib/ovsdb-idl.h |  3 +++
 ovn/controller/ovn-controller.8.xml | 14 ++
 ovn/controller/ovn-controller.c | 33 +
 4 files changed, 60 insertions(+)

diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c
index 7e84138..844d5b1 100644
--- a/lib/ovsdb-idl.c
+++ b/lib/ovsdb-idl.c
@@ -557,6 +557,16 @@ ovsdb_idl_get_last_error(const struct ovsdb_idl *idl)
 {
 return jsonrpc_session_get_last_error(idl->session);
 }
+
+/* Sets the "probe interval" for 'idl->session' to 'probe_interval', in
+ * milliseconds.
+ */
+void
+ovsdb_set_probe_interval(const struct ovsdb_idl *idl, int probe_interval)
+{
+   jsonrpc_session_set_probe_interval(idl->session, probe_interval);
+}
+
Should this function be called ovsdb_idl_set_probe_interval()?

 static unsigned char *
 ovsdb_idl_get_mode(struct ovsdb_idl *idl,
diff --git a/lib/ovsdb-idl.h b/lib/ovsdb-idl.h
index 136c38c..224914f 100644
--- a/lib/ovsdb-idl.h
+++ b/lib/ovsdb-idl.h
@@ -68,6 +68,9 @@ void ovsdb_idl_verify_write_only(struct ovsdb_idl *);

 bool ovsdb_idl_is_alive(const struct ovsdb_idl *);
 int ovsdb_idl_get_last_error(const struct ovsdb_idl *);
+
+void ovsdb_set_probe_interval(const struct ovsdb_idl *, int probe_interval);
+
 /* Choosing columns and tables to replicate. */

diff --git a/ovn/controller/ovn-controller.8.xml 
b/ovn/controller/ovn-controller.8.xml
index 6dcc579..4202b59 100644
--- a/ovn/controller/ovn-controller.8.xml
+++ b/ovn/controller/ovn-controller.8.xml
@@ -100,6 +100,20 @@
 
   

+  external_ids:ovn-remote-probe-interval
+  
+
+  The inactivity probe interval of the connection to the OVN database,
+  in milliseconds.
+  If the value is zero, it disables the connection keepalive feature.
+
+
+
+  If 'probe_interval' is nonzero, then it will be forced to a value of
+  at least 1000 ms
+
+  
+
   external_ids:ovn-encap-type
   
 
diff --git a/ovn/controller/ovn-controller.c b/ovn/controller/ovn-controller.c
index 02ecb3e..427d121 100644
--- a/ovn/controller/ovn-controller.c
+++ b/ovn/controller/ovn-controller.c
@@ -33,7 +33,10 @@
 #include "ovn/lib/ovn-sb-idl.h"
 #include "poll-loop.h"
 #include "fatal-signal.h"
+#include "lib/ovsdb-idl.h"
 #include "lib/vswitch-idl.h"
+#include "lib/util.h"
+#include "lib/reconnect.h"
 #include "smap.h"
 #include "stream.h"
 #include "stream-ssl.h"
@@ -197,6 +200,33 @@ get_ovnsb_remote(struct ovsdb_idl *ovs_idl)
 }
 }

+/* Retrieves the OVN Southbound remote's json session probe interval from the
+ * "external-ids:ovn-remote-probe-interval" key in 'ovs_idl' and returns it.
+ *
+ * This function Must be called after get_ovnsb_remote().
+ *
+ */
s /Must/must

+static int
+get_ovnsb_remote_probe_interval(struct ovsdb_idl *ovs_idl)
+{
+const struct ovsrec_open_vswitch *cfg = ovsrec_open_vswitch_first(ovs_idl);
+if (cfg) {
+const char * probe_interval =
+smap_get(&cfg->external_ids, "ovn-remote-probe-interval");
+if (probe_interval) {
+int ret = 0;
+if (str_to_int(probe_interval, 10, & ret))
+{
+VLOG_INFO("OVN OVSDB remote probe interval is %d ms", ret);
+return ret;
+}
+}
+}
+
+return RECONNECT_DEFAULT_PROBE_INTERVAL;
+}
+
I think I will be slightly better if get_ovnsb_remote_probe_interval() returns 
whether the field is set
in OVSDB. if it is not set, or can not be read correctly.  In those case, we 
can simply
skip the call to ovsdb_set_probe_interval(). This way, we don't have to provide 
the default from here.

+
 int
 main(int argc, char *argv[])
 {
@@ -260,6 +290,9 @@ main(int argc, char *argv[])
 ovsdb_idl_create(ovnsb_remote, &sbrec_idl_class, true, true));
 ovsdb_idl_get_initial_snapshot(ovnsb_idl_loop.idl);

+int probe_interval = get_ovnsb_remote_probe_interval(ovs_idl_loop.idl);
+ovsdb_set_probe_interval(ovnsb_idl_loop.idl, probe_interval);
+

Currently, connection made over unix domain socket will not enable probe, since 
probing is not necessary.
It seems this patch would enable probing for

[ovs-dev] [PATCH 1/3] ovsdb: Fix one off error in tracking monitor changes

2016-02-22 Thread Andy Zhou
dbmon's changes should be stored with the new transaction number,
rather than the current transaction number.

Signed-off-by: Andy Zhou 
---
 ovsdb/monitor.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ovsdb/monitor.c b/ovsdb/monitor.c
index 5ae9cdb..ef96ca2 100644
--- a/ovsdb/monitor.c
+++ b/ovsdb/monitor.c
@@ -1121,11 +1121,13 @@ ovsdb_monitor_commit(struct ovsdb_replica *replica,
 struct ovsdb_monitor_aux aux;
 
 ovsdb_monitor_init_aux(&aux, m);
+/* Update ovsdb_monitor's transaction number for
+ * each transaction, before calling ovsdb_monitor_change_cb().  */
+m->n_transactions++;
 ovsdb_txn_for_each_change(txn, ovsdb_monitor_change_cb, &aux);
 
 if (aux.efficacy == OVSDB_CHANGES_REQUIRE_EXTERNAL_UPDATE) {
 ovsdb_monitor_json_cache_flush(m);
-m->n_transactions++;
 }
 
 return NULL;
-- 
1.9.1

___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH 2/3] ovsdb: rename variables in ovsdb_monitor_get_update()

2016-02-22 Thread Andy Zhou
'prev_txn' and 'next_txn" are more confusing than 'unflushed' and
'unflushed_next'. Rename them.

Signed-off-by: Andy Zhou 
---
 ovsdb/monitor.c | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/ovsdb/monitor.c b/ovsdb/monitor.c
index ef96ca2..313cd14 100644
--- a/ovsdb/monitor.c
+++ b/ovsdb/monitor.c
@@ -724,40 +724,40 @@ ovsdb_monitor_compose_update(struct ovsdb_monitor *dbmon,
  * going to be used as part of an "update" notification. */
 struct json *
 ovsdb_monitor_get_update(struct ovsdb_monitor *dbmon,
- bool initial, uint64_t *unflushed,
+ bool initial, uint64_t *unflushed_,
  enum ovsdb_monitor_version version)
 {
 struct ovsdb_monitor_json_cache_node *cache_node;
 struct shash_node *node;
 struct json *json;
-uint64_t prev_txn = *unflushed;
-uint64_t next_txn = dbmon->n_transactions + 1;
+const uint64_t unflushed = *unflushed_;
+const uint64_t next_unflushed = dbmon->n_transactions + 1;
 
 /* Return a clone of cached json if one exists. Otherwise,
  * generate a new one and add it to the cache.  */
-cache_node = ovsdb_monitor_json_cache_search(dbmon, version, prev_txn);
+cache_node = ovsdb_monitor_json_cache_search(dbmon, version, unflushed);
 if (cache_node) {
 json = cache_node->json ? json_clone(cache_node->json) : NULL;
 } else {
 if (version == OVSDB_MONITOR_V1) {
-json = ovsdb_monitor_compose_update(dbmon, initial, prev_txn,
+json = ovsdb_monitor_compose_update(dbmon, initial, unflushed,
 ovsdb_monitor_compose_row_update);
 } else {
 ovs_assert(version == OVSDB_MONITOR_V2);
-json = ovsdb_monitor_compose_update(dbmon, initial, prev_txn,
+json = ovsdb_monitor_compose_update(dbmon, initial, unflushed,
 ovsdb_monitor_compose_row_update2);
 }
-ovsdb_monitor_json_cache_insert(dbmon, version, prev_txn, json);
+ovsdb_monitor_json_cache_insert(dbmon, version, unflushed, json);
 }
 
 /* Maintain transaction id of 'changes'. */
 SHASH_FOR_EACH (node, &dbmon->tables) {
 struct ovsdb_monitor_table *mt = node->data;
 
-ovsdb_monitor_table_untrack_changes(mt, prev_txn);
-ovsdb_monitor_table_track_changes(mt, next_txn);
+ovsdb_monitor_table_untrack_changes(mt, unflushed);
+ovsdb_monitor_table_track_changes(mt, next_unflushed);
 }
-*unflushed = next_txn;
+*unflushed_ = next_unflushed;
 
 return json;
 }
-- 
1.9.1

___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH 3/3] ovsdb: avoid unnecessary call ovsdb_monitor_get_update()

2016-02-22 Thread Andy Zhou
Avoid calling ovsdb_monitor_get_update() if there aren't any unflushed
transactions.

Reported-by: Liran Schour 
Signed-off-by: Andy Zhou 
---
 ovsdb/jsonrpc-server.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/ovsdb/jsonrpc-server.c b/ovsdb/jsonrpc-server.c
index 0d23b77..6f46dbc 100644
--- a/ovsdb/jsonrpc-server.c
+++ b/ovsdb/jsonrpc-server.c
@@ -1297,6 +1297,10 @@ static struct json *
 ovsdb_jsonrpc_monitor_compose_update(struct ovsdb_jsonrpc_monitor *m,
  bool initial)
 {
+if (!ovsdb_monitor_needs_flush(m->dbmon, m->unflushed)) {
+return NULL;
+}
+
 return ovsdb_monitor_get_update(m->dbmon, initial, &m->unflushed,
 m->version);
 }
-- 
1.9.1

___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH 2/2] ovsdb: Return NULL if prev_txn == next_txn

2016-02-22 Thread Andy Zhou
On Sat, Feb 20, 2016 at 8:35 AM, Liran Schour  wrote:

> In case that we flushed everything already, we can immeidately return NULL.
>
> Signed-off-by: Liran Schour 
> ---
>  ovsdb/monitor.c | 4 
>  1 file changed, 4 insertions(+)
>
> diff --git a/ovsdb/monitor.c b/ovsdb/monitor.c
> index 5ae9cdb..1a07f19 100644
> --- a/ovsdb/monitor.c
> +++ b/ovsdb/monitor.c
> @@ -733,6 +733,10 @@ ovsdb_monitor_get_update(struct ovsdb_monitor *dbmon,
>  uint64_t prev_txn = *unflushed;
>  uint64_t next_txn = dbmon->n_transactions + 1;
>
> +if (prev_txn == next_txn) {
> +return NULL;
> +}
> +
>
Thanks for reporting the issue. The change as is breaks the unit tests. But
the optimziation
does make sense.  After looking further, I was able to find a bug.

I have posted a patch series that fixes this bug and folded the suggested
optimization
(in a slightly different manner). . Would you please review them:

http://openvswitch.org/pipermail/dev/2016-February/066513.html

Thanks!




>  /* Return a clone of cached json if one exists. Otherwise,
>   * generate a new one and add it to the cache.  */
>  cache_node = ovsdb_monitor_json_cache_search(dbmon, version,
> prev_txn);
> --
> 2.1.4
>
>
> ___
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH] types: Fix defined but not used warning.

2016-02-22 Thread Panu Matilainen

On 02/19/2016 11:35 PM, William Tu wrote:

warning: ‘OVS_BE128_MAX’ defined but not used [-Wunused-const-variable]
Found using CentOS 6.6 with gcc 6.6.0.

Signed-off-by: William Tu 


Just FWIW, this particular gcc 6 behavior is still under debate:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901

- Panu -
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] : ovs-appctl dump and flush command for userspace conntrack

2016-02-22 Thread sourabh.bansal
Hi Joe,

I rechecked and ovs-appctl dpctl/dump-conntrack command works fine for me. 
Actually I got confused with ovs-dpctl dump-conntrack command and thought that 
userspace dump conntrack is not available.

Thanks for pointing it out. Withdrawing the patch.



-Original Message-
From: Sourabh Bansal (NEP)
Sent: Monday, February 22, 2016 11:14 AM
To: 'Joe Stringer' 
Cc: Daniele Di Proietto ; ovs dev 
; Sanjeev Sharma (Cisco) ; 
Soumyadeep Chowdhury (NEP) 
Subject: RE: [ovs-dev] : ovs-appctl dump and flush 
command for userspace conntrack

Hi Joe,

These commands will work when we are running userspace conntrack (OVS+DPDK env).
Existing commands dpctl/{dump-flush}-conntrack commands will not help here, as 
they are trying to get info of kernel based conntrack module.

NOTE: This implementation is over 
 branch which 
is implementing userspaced conntrack module.


-Original Message-
From: Joe Stringer [mailto:j...@ovn.org]
Sent: Friday, February 19, 2016 11:48 PM
To: Sourabh Bansal (NEP) 
Cc: Daniele Di Proietto ; ovs dev 
; Sanjeev Sharma (Cisco) ; 
Soumyadeep Chowdhury (NEP) 
Subject: Re: [ovs-dev] : ovs-appctl dump and flush 
command for userspace conntrack

On 19 February 2016 at 02:35,   wrote:
> Hi Joe,
>
> Thanks for pointing out my mistake. Please find below updated one.
>
>
> m 69e63a45e2773c124deb885bbc3d5deb3e032126 Mon Sep 17 00:00:00 2001
> From: soumyadeep chowdhury 
> Date: Fri, 19 Feb 2016 07:39:34 -0500
> Subject: [PATCH 4/4] Write the functions for dump-conntrack and
> flush-conntrack
>
> Signed-off-by: Sourabh Bansal 

While the format of the patch looks closer to correct, I think my primary piece 
of feedback may have been misunderstood.

What does this patch provide which isn't already available via the "ovs-appctl 
dpctl/{dump,flush}-conntrack" commands?
The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments. WARNING: Computer viruses can be transmitted via email. The 
recipient should check this email and any attachments for the presence of 
viruses. The company accepts no liability for any damage caused by any virus 
transmitted by this email. www.wipro.com
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] About QoS configuration for OpenvSwitch

2016-02-22 Thread Xiao Ma (xima2)
Hi,

Could anybody tell me why the bandwidth is so unstable?

Thanks!



在 2016年2月15日,下午8:18,Xiao Ma (xima2) mailto:xi...@cisco.com>> 
写道:

Hi, All

I want to use the QoS feature of openvswitch for networks in openstack cloud 
environment ( neutron in Vlan Mode).

I created four virtual machines, test-left1/test-left2 in vlan 1003 and 
test-right1/test-right2 in vlan 1004.
test-left1/right-right1 in host2 and test-left2/test-right2 in host3.


And I can see the port created in ovs bridge in host2:
==
[root@host2 home]# ovs-vsctl show
5844eda6-56d4-4711-9697-6eef12a53265
Bridge br-int
fail_mode: secure
Port "qvo583906a4-bb"
tag: 1004
Interface "qvo583906a4-bb"
Port br-int
Interface br-int
type: internal
Port int-br-inst
Interface int-br-inst
type: patch
options: {peer=phy-br-inst}
Port "qvo6d7a3443-4d"
tag: 1003
Interface "qvo6d7a3443-4d"
Bridge br-inst
Port phy-br-inst
Interface phy-br-inst
type: patch
options: {peer=int-br-inst}
Port br-inst
Interface br-inst
type: internal
Port "ens1f1"
Interface "ens1f1"
ovs_version: "2.4.0"
==

I tested the bandwidth between left1 and left2 and it’s about 1000M as the 
physical nic provided.

Then I created the qos queue using the command bellow:

ovs-vsctl set port ens1f1 qos=@newqos -- --id=@newqos create qos type=linux-htb 
other-config:max-rate=10 \
   queues:1=@queue1 \
   queues:2=@queue2 -- \
   --id=@queue1 create queue other-config:min-rate=2 
other-config:max-rate=10 -- \
   --id=@queue2 create queue other-config:min-rate=8 
other-config:max-rate=10


[root@host2 home]# ovs-vsctl list Queue
_uuid   : 98226a7c-270e-4213-a00f-301f464d8222
dscp: []
external_ids: {}
other_config: {max-rate="10", min-rate="2"}

_uuid   : a427ea28-704a-4c5b-8e13-27005d31b0e6
dscp: []
external_ids: {}
other_config: {max-rate="10", min-rate="8"}

_uuid   : fee9fb4c-f079-477d-a1dc-c6f717eb29e0
dscp: []
external_ids: {}
other_config: {max-rate="10", min-rate="2"}

_uuid   : bcaf0695-3796-4639-ae03-07ccb0d6159d
dscp: []
external_ids: {}
other_config: {max-rate="10", min-rate="8"}



The problem is after I created the  qos queues, the bandwidth between left1 and 
left2 became unstable as bellow:
Could anybody explain this to me and help me to solve this problem ?

Thanks.


<未知.png>





___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH] Installation steps correction for DPDK 2.2.

2016-02-22 Thread Weglicki, MichalX
Hello, 

Just gentle reminder, is this patch fine? Or I'm supposed to correct something? 

As Flavio mentioned it is important change for 2.5 branch. 

Br, 
Michal. 

-Original Message-
From: Flavio Leitner [mailto:f...@sysclose.org] 
Sent: Friday, February 12, 2016 1:18 AM
To: Weglicki, MichalX 
Cc: dev@openvswitch.org; Daniele Di Proietto 
Subject: Re: [ovs-dev] [PATCH] Installation steps correction for DPDK 2.2.

On Fri,  5 Feb 2016 11:42:06 +
mweglicx  wrote:

> Missing step added to INSTALL.DPDK.md which prevents
> installation error message.
> 
> Signed-off-by: Michal Weglicki 
> ---
>  INSTALL.DPDK.md | 20 ++--
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/INSTALL.DPDK.md b/INSTALL.DPDK.md
> index c601358..0928e66 100644
> --- a/INSTALL.DPDK.md
> +++ b/INSTALL.DPDK.md
> @@ -33,14 +33,22 @@ on Debian/Ubuntu)
>  
>   `CONFIG_RTE_BUILD_COMBINE_LIBS=y`
>  
> +   * Non IVSHMEM:
> +
> + `export DPDK_BUILD=$DPDK_DIR/x86_64-native-linuxapp-gcc`
> +
> +   * IVSHMEM:
> +
> + `export DPDK_BUILD=$DPDK_DIR/x86_64-ivshmem-linuxapp-gcc`
> +
>   Then run `make install` to build and install the library.
>   For default install without IVSHMEM:
>  
> - `make install T=x86_64-native-linuxapp-gcc`
> + `make install T=x86_64-native-linuxapp-gcc DESTDIR=$DPDK_BUILD/install`
>  
>   To include IVSHMEM (shared memory):
>  ake install T=x86_64-ivs
> - `make install T=x86_64-ivshmem-linuxapp-gcc`
> + `make install T=x86_64-ivshmem-linuxapp-gcc DESTDIR=$DPDK_BUILD/install`
>  
>   For further details refer to http://dpdk.org/
>  
> @@ -51,14 +59,6 @@ on Debian/Ubuntu)
>  
>  3. Configure & build OVS:
>  
> -   * Non IVSHMEM:
> -
> - `export DPDK_BUILD=$DPDK_DIR/x86_64-native-linuxapp-gcc/`
> -
> -   * IVSHMEM:
> -
> - `export DPDK_BUILD=$DPDK_DIR/x86_64-ivshmem-linuxapp-gcc/`
> -
> ```
> cd $(OVS_DIR)/
> ./boot.sh

The real change is just the addition of DESTDIR argument which could
have been, for example:
   make install T=x86_64-ivshmem-linuxapp-gcc DESTDIR=install

Anyway, the doc looks good after the patch.

Acked-by: Flavio Leitner 

BTW, this needs to go in branch-2.5 as well.

-- 
fbl

--
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263


This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.

___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCHv2 1/2] ovn-northd: Allow lport 'addresses' to store multiple ips in each set

2016-02-22 Thread Numan Siddique
If a logical port has two ipv4 addresses and one ipv6 address
it will be stored as ["MAC IPv41 IPv42 IPv61"] instead of
["MAC IPv41", "MAC IPv42", "MAC IPv61"].

Signed-off-by: Numan Siddique 
---
 lib/packets.c   | 126 +++--
 lib/packets.h   |  10 
 ovn/northd/ovn-northd.c | 145 ++--
 ovn/ovn-nb.xml  |  56 ++-
 tests/ovn.at|  24 +++-
 5 files changed, 300 insertions(+), 61 deletions(-)

diff --git a/lib/packets.c b/lib/packets.c
index d82341d..005e015 100644
--- a/lib/packets.c
+++ b/lib/packets.c
@@ -425,29 +425,29 @@ ip_parse(const char *s, ovs_be32 *ip)
 }
 
 /* Parses string 's', which must be an IP address with an optional netmask or
- * CIDR prefix length.  Stores the IP address into '*ip' and the netmask into
+ * CIDR prefix length.  Stores the IP address into '*ip',  netmask into
  * '*mask'.  (If 's' does not contain a netmask, 255.255.255.255 is
- * assumed.)
+ * assumed.) and number of scanned characters in 'n'
  *
  * Returns NULL if successful, otherwise an error message that the caller must
  * free(). */
 char * OVS_WARN_UNUSED_RESULT
-ip_parse_masked(const char *s, ovs_be32 *ip, ovs_be32 *mask)
+ip_parse_masked_len(const char *s, int *n, ovs_be32 *ip,
+ovs_be32 *mask)
 {
 int prefix;
-int n;
 
-if (ovs_scan(s, IP_SCAN_FMT"/"IP_SCAN_FMT"%n",
- IP_SCAN_ARGS(ip), IP_SCAN_ARGS(mask), &n) && !s[n]) {
+if (ovs_scan_len(s, n, IP_SCAN_FMT"/"IP_SCAN_FMT,
+ IP_SCAN_ARGS(ip), IP_SCAN_ARGS(mask))) {
 /* OK. */
-} else if (ovs_scan(s, IP_SCAN_FMT"/%d%n", IP_SCAN_ARGS(ip), &prefix, &n)
-   && !s[n]) {
+} else if (ovs_scan_len(s, n, IP_SCAN_FMT"/%d",
+IP_SCAN_ARGS(ip), &prefix)) {
 if (prefix <= 0 || prefix > 32) {
 return xasprintf("%s: network prefix bits not between 0 and "
  "32", s);
 }
 *mask = be32_prefix_mask(prefix);
-} else if (ip_parse(s, ip)) {
+} else if (ovs_scan_len(s, n, IP_SCAN_FMT, IP_SCAN_ARGS(ip))) {
 *mask = OVS_BE32_MAX;
 } else {
 return xasprintf("%s: invalid IP address", s);
@@ -455,15 +455,34 @@ ip_parse_masked(const char *s, ovs_be32 *ip, ovs_be32 
*mask)
 return NULL;
 }
 
-/* Similar to ip_parse_masked(), but the mask, if present, must be a CIDR mask
- * and is returned as a prefix length in '*plen'. */
+/* This function is similar to ip_parse_masked_len(), but doesn't return
+ * the number of scanned characters and expects 's' to be NULL terminated
+ * at the end of the ip/(optional) mask.
+ *
+ * Returns NULL if successful, otherwise an error message that the caller must
+ * free(). */
 char * OVS_WARN_UNUSED_RESULT
-ip_parse_cidr(const char *s, ovs_be32 *ip, unsigned int *plen)
+ip_parse_masked(const char *s, ovs_be32 *ip, ovs_be32 *mask)
+{
+int n = 0;
+
+char *error = ip_parse_masked_len(s, &n, ip, mask);
+if (!error && s[n]) {
+return xasprintf("%s: invalid IP address format. Not NULL terminated",
+ s);
+}
+return error;
+}
+
+/* Similar to ip_parse_masked_len(), but the mask, if present, must be a CIDR
+ * mask and is returned as a prefix len in '*plen'. */
+char * OVS_WARN_UNUSED_RESULT
+ip_parse_cidr_len(const char *s, int *n, ovs_be32 *ip, unsigned int *plen)
 {
 ovs_be32 mask;
 char *error;
 
-error = ip_parse_masked(s, ip, &mask);
+error = ip_parse_masked_len(s, n, ip, &mask);
 if (error) {
 return error;
 }
@@ -475,6 +494,21 @@ ip_parse_cidr(const char *s, ovs_be32 *ip, unsigned int 
*plen)
 return NULL;
 }
 
+/* Similar to ip_parse_cidr_len(), but doesn't return the number of scanned
+ * characters and expects 's' to be NULL terminated at the end of the
+ * ip/(optional) cidr. */
+char * OVS_WARN_UNUSED_RESULT
+ip_parse_cidr(const char *s, ovs_be32 *ip, unsigned int *plen)
+{
+int n = 0;
+
+char *error = ip_parse_cidr_len(s, &n, ip, plen);
+if (!error && s[n]) {
+return xasprintf("%s: Contains invalid characters.", s);
+}
+return error;
+}
+
 /* Parses string 's', which must be an IPv6 address.  Stores the IPv6 address
  * into '*ip'.  Returns true if successful, otherwise false. */
 bool
@@ -485,49 +519,67 @@ ipv6_parse(const char *s, struct in6_addr *ip)
 
 /* Parses string 's', which must be an IPv6 address with an optional netmask or
  * CIDR prefix length.  Stores the IPv6 address into '*ip' and the netmask into
- * '*mask'.  (If 's' does not contain a netmask, all-one-bits is assumed.)
+ * '*mask' (if 's' does not contain a netmask, all-one-bits is assumed.) and
+ * number of scanned characters in 'n'.
  *
  * Returns NULL if successful, otherwise an error message that the caller must
  * free(). */
 char * OVS_WARN_UNUSED_RESULT
-ipv6_parse_masked(const char *s, struct in6_addr *ip, struc

[ovs-dev] [PATCHv2 2/2] ovn: Add l3 port security for IPv4 and IPv6

2016-02-22 Thread Numan Siddique
For every port security defined for a logical port, add following lflows
in "ls_in_port_sec" and "ls_out_port_sec" stage
   - A priority 90 flow to allow ipv4 traffic for known ip addresses
 and (broadcast ip - for ingress, mainly for dhcp)
   - A priority 80 flow to drop all ipv4 traffic.
   - For ingress, a priority 90 flow to allow arp traffic for known
  ip addresses and priority 80 flow to drop all arp traffic
   - A priority 90 flow to allow ipv6 traffic for known ipv6 addresses if
 port security has ipv6 address(es) defined
   - A priority 80 flow to drop all ipv6 traffic.
   - A priority 50 flow to allow all traffic on that port with the matching
 eth address

Eg. if the port security is "00:00:00:00:00:01 10.0.0.2 fe80::eaff:fe28:3390"

priority=90, match=(inport == "portname" && eth.src == 00:00:00:00:00:01
&& arp && arp.sha == 00:00:00:00:00:01 && (arp.spa == 10.0.0.2)), action=(next;)

priority=90, match=(inport == "portname" && eth.src == 00:00:00:00:00:01
&& ip4 && ((ip4.src == 0.0.0.0 && ip4.dst == 255.255.255.255) ||
ip4.src == 10.0.0.3)), action=(next;)

priority=90, match=(inport == "portname" && eth.src == 00:00:00:00:00:01 && ip6
&& (ip6.src == fe80::200:ff:fe00:1 || ip6.src == :: ||
ip6.src == fe80::eaff:fe28:3390)), action=(next;)

priority=80, match=(inport == "portname" && eth.src == 00:00:00:00:00:01
&& (arp || ip4)), action=(drop;)

priority=80, match=(inport == "portname" && eth.src == 00:00:00:00:00:01
&& ip6), action=(drop;)

priority=50, match=(inport == "portname" && eth.src == 00:00:00:00:00:01),
action=(next;)

Co-Authored-by: Ben Pfaff 
Signed-off-by: Numan Siddique 
---
 lib/packets.h   |  16 +++
 ovn/northd/ovn-northd.8.xml |  84 ---
 ovn/northd/ovn-northd.c | 245 ---
 ovn/ovn-nb.xml  | 141 ++---
 tests/ovn.at| 248 
 5 files changed, 668 insertions(+), 66 deletions(-)

diff --git a/lib/packets.h b/lib/packets.h
index bf12937..be6b6b3 100644
--- a/lib/packets.h
+++ b/lib/packets.h
@@ -986,6 +986,22 @@ in6_addr_solicited_node(struct in6_addr *addr, const 
struct in6_addr *ip6)
 memcpy(&addr->s6_addr[13], &ip6->s6_addr[13], 3);
 }
 
+/*
+ * Generates ipv6 link local address from the given eth addr
+ * with prefix 'fe80::/64' and stores it in 'lla'
+ */
+static inline void
+in6_generate_lla(struct eth_addr ea, struct in6_addr *lla)
+{
+union ovs_16aligned_in6_addr *taddr = (void *) lla;
+memset(taddr->be16, 0, sizeof(taddr->be16));
+taddr->be16[0] = htons(0xfe80);
+taddr->be16[4] = htons(((ea.ea[0] ^ 0x02) << 8) | ea.ea[1]);
+taddr->be16[5] = htons(ea.ea[2] << 8 | 0x00ff);
+taddr->be16[6] = htons(0xfe << 8 | ea.ea[3]);
+taddr->be16[7] = ea.be16[2];
+}
+
 static inline void
 ipv6_multicast_to_ethernet(struct eth_addr *eth, const struct in6_addr *ip6)
 {
diff --git a/ovn/northd/ovn-northd.8.xml b/ovn/northd/ovn-northd.8.xml
index 1b2912e..45e9237 100644
--- a/ovn/northd/ovn-northd.8.xml
+++ b/ovn/northd/ovn-northd.8.xml
@@ -124,12 +124,64 @@
   
 
   
-Priority 50 flows that implement ingress port security for each enabled
-logical port.  For logical ports on which port security is enabled,
-these match the inport and the valid eth.src
-address(es) and advance only those packets to the next flow table.  For
-logical ports on which port security is not enabled, these advance all
-packets that match the inport.
+
+  Port security flows to allow traffic for each enabled logical port.
+  For logical ports on which port security is not enabled, a priority 
50
+  flow is added to allow all packets that match the 
inport.
+
+
+
+  For logical ports on which port security is enabled, following flows
+  are added.
+
+
+
+  For each element in the port security set,
+
+
+
+  
+Priority 90 flow is added to allow ipv4 traffic if it has ipv4
+addresses which match the inport, valid
+eth.src and valid ip4.src address(es).
+  
+
+  
+Priority 90 flow is added to allow arp traffic if it has ipv4
+addresses which match the inport, valid
+eth.src, valid arp.sha and valid
+arp.spa address(es).
+  
+
+  
+Priority 90 flow is added to allow ipv6 traffic if it has
+ipv6 address(es) which match the inport, valid
+eth.src and valid ip6.src address(es).
+  
+
+  
+Priority 80 flow is added to drop all ipv4 traffic if it has
+ipv4/ipv6 address(es) which match the inport and
+eth.src
+  
+
+  
+Priority 80 flow is added to drop all arp traffic if it has ipv4
+addresses which match the inport and

[ovs-dev] MEET your day with wicked Winnie Bumgardner

2016-02-22 Thread Winnie N .

Groovy my sexy catI found yr photos in instagram.. you are pretty boy.i want to ride your 
big c#ck all night!! i'm 32/f with natural b00bs and a perfect a$$!! want to be my 
f@ckbuddy? ;)the screenname - Winnie82 .my page is over there: 
http://mdacelyk.DatingProperty.ruAre you alone, Dev? Txt me @ "631 443.4568", 
I'm sure I can entertain you :-P
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH v3 1/6] datapath-windows: Added recirculation support.

2016-02-22 Thread Sorin Vinturis
Recirculation support for the OVS extension.

Tested using PING and iperf with Driver Verifier enabled.

Signed-off-by: Sorin Vinturis 
Co-authored-by: Alin Gabriel Serdean 
Reported-by: Sorin Vinturis 
Reported-at: https://github.com/openvswitch/ovs-issues/issues/104
---
v2: Initialize flow key before using it.
v3: Synchronized access to deferred actions queue.
---
 datapath-windows/automake.mk  |   3 +
 datapath-windows/ovsext/Actions.c | 215 ++
 datapath-windows/ovsext/Actions.h |  54 
 datapath-windows/ovsext/Datapath.c|   4 +
 datapath-windows/ovsext/DpInternal.h  |   2 +-
 datapath-windows/ovsext/Flow.c|  76 +--
 datapath-windows/ovsext/Flow.h|   5 +-
 datapath-windows/ovsext/Netlink/Netlink.h |  11 ++
 datapath-windows/ovsext/PacketIO.c|  16 ++-
 datapath-windows/ovsext/PacketIO.h|  10 --
 datapath-windows/ovsext/Recirc.c  | 171 
 datapath-windows/ovsext/Recirc.h  |  82 
 datapath-windows/ovsext/Tunnel.c  |  15 ++-
 datapath-windows/ovsext/User.c|  13 +-
 datapath-windows/ovsext/ovsext.vcxproj|   3 +
 15 files changed, 612 insertions(+), 68 deletions(-)
 create mode 100644 datapath-windows/ovsext/Actions.h
 create mode 100644 datapath-windows/ovsext/Recirc.c
 create mode 100644 datapath-windows/ovsext/Recirc.h

diff --git a/datapath-windows/automake.mk b/datapath-windows/automake.mk
index f29f548..04fc97f 100644
--- a/datapath-windows/automake.mk
+++ b/datapath-windows/automake.mk
@@ -9,6 +9,7 @@ EXTRA_DIST += \
datapath-windows/misc/uninstall.cmd \
datapath-windows/ovsext.sln \
datapath-windows/ovsext/Actions.c \
+   datapath-windows/ovsext/Actions.h \
datapath-windows/ovsext/Atomic.h \
datapath-windows/ovsext/BufferMgmt.c \
datapath-windows/ovsext/BufferMgmt.h \
@@ -45,6 +46,8 @@ EXTRA_DIST += \
datapath-windows/ovsext/PacketIO.h \
datapath-windows/ovsext/PacketParser.c \
datapath-windows/ovsext/PacketParser.h \
+   datapath-windows/ovsext/Recirc.c \
+   datapath-windows/ovsext/Recirc.h \
datapath-windows/ovsext/Stt.c \
datapath-windows/ovsext/Stt.h \
datapath-windows/ovsext/Switch.c \
diff --git a/datapath-windows/ovsext/Actions.c 
b/datapath-windows/ovsext/Actions.c
index 5a04541..d3f18f2 100644
--- a/datapath-windows/ovsext/Actions.c
+++ b/datapath-windows/ovsext/Actions.c
@@ -14,8 +14,7 @@
  * limitations under the License.
  */
 
-#include "precomp.h"
-
+#include "Actions.h"
 #include "Debug.h"
 #include "Event.h"
 #include "Flow.h"
@@ -24,6 +23,7 @@
 #include "NetProto.h"
 #include "Offload.h"
 #include "PacketIO.h"
+#include "Recirc.h"
 #include "Stt.h"
 #include "Switch.h"
 #include "User.h"
@@ -35,6 +35,8 @@
 #endif
 #define OVS_DBG_MOD OVS_DBG_ACTION
 
+#define OVS_DEST_PORTS_ARRAY_MIN_SIZE 2
+
 typedef struct _OVS_ACTION_STATS {
 UINT64 rxGre;
 UINT64 txGre;
@@ -66,7 +68,6 @@ OVS_ACTION_STATS ovsActionStats;
  * exercised while adding new members to the structure - only add ones that get
  * used across multiple stages in the pipeline/get used in multiple functions.
  */
-#define OVS_DEST_PORTS_ARRAY_MIN_SIZE 2
 typedef struct OvsForwardingContext {
 POVS_SWITCH_CONTEXT switchContext;
 /* The NBL currently used in the pipeline. */
@@ -99,7 +100,7 @@ typedef struct OvsForwardingContext {
  */
 OvsIPv4TunnelKey tunKey;
 
- /*
+/*
  * Tunneling - Tx:
  * To store the output port, when it is a tunneled port. We don't foresee
  * multiple tunneled ports as outport for any given NBL.
@@ -117,7 +118,6 @@ typedef struct OvsForwardingContext {
 OVS_PACKET_HDR_INFO layers;
 } OvsForwardingContext;
 
-
 /*
  * --
  * OvsInitForwardingCtx --
@@ -564,10 +564,10 @@ OvsCompleteNBLForwardingCtx(OvsForwardingContext 
*ovsFwdCtx,
 static __inline NDIS_STATUS
 OvsDoFlowLookupOutput(OvsForwardingContext *ovsFwdCtx)
 {
-OvsFlowKey key;
-OvsFlow *flow;
-UINT64 hash;
-NDIS_STATUS status;
+OvsFlowKey key = { 0 };
+OvsFlow *flow = NULL;
+UINT64 hash = 0;
+NDIS_STATUS status = NDIS_STATUS_SUCCESS;
 POVS_VPORT_ENTRY vport =
 OvsFindVportByPortNo(ovsFwdCtx->switchContext, ovsFwdCtx->srcVportNo);
 if (vport == NULL || vport->ovsState != OVS_STATE_CONNECTED) {
@@ -595,11 +595,13 @@ OvsDoFlowLookupOutput(OvsForwardingContext *ovsFwdCtx)
 if (flow) {
 OvsFlowUsed(flow, ovsFwdCtx->curNbl, &ovsFwdCtx->layers);
 ovsFwdCtx->switchContext->datapath.hits++;
-status = OvsActionsExecute(ovsFwdCtx->switchContext,
-   ovsFwdCtx->completionList, 
ovsFwdCtx->curNbl,
-   ovsFwdCtx->srcVportNo, ovsFwdCtx->sendFlags,
-   &key, &hash, &ovsFwdCtx

[ovs-dev] [PATCH v3 0/6] datapath-windows: Recirculation support

2016-02-22 Thread Sorin Vinturis
This patch series adds support for recirculation to the OVS extension.

Since the sample action patch is ready, and is dependent on
recirculation, I have added it to this series.

Sorin Vinturis (6):
  [PATCH v3 1/6] datapath-windows: Added recirculation support.
  [PATCH v3 2/6] datapath-windows: Allow recirculation feature probe.
  [PATCH v3 3/6] datapath-windows: Support for OVS_ACTION_ATTR_HASH
  [PATCH v3 4/6] datapath-windows: Extract flow metadata in execute cmd
  [PATCH v3 5/6] datapath-windows: Updated FAQ regarding Hyper-V
  [PATCH v3 6/6] datapath-windows: Sample action support.
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH v3 3/6] datapath-windows: Support for OVS_ACTION_ATTR_HASH attribute

2016-02-22 Thread Sorin Vinturis
Signed-off-by: Sorin Vinturis 
---
v3: No changes from the previous version.
---
 datapath-windows/ovsext/Actions.c| 32 
 datapath-windows/ovsext/DpInternal.h |  1 +
 datapath-windows/ovsext/Flow.c   | 13 +
 3 files changed, 46 insertions(+)

diff --git a/datapath-windows/ovsext/Actions.c 
b/datapath-windows/ovsext/Actions.c
index d3f18f2..d3f9be4 100644
--- a/datapath-windows/ovsext/Actions.c
+++ b/datapath-windows/ovsext/Actions.c
@@ -19,6 +19,7 @@
 #include "Event.h"
 #include "Flow.h"
 #include "Gre.h"
+#include "Jhash.h"
 #include "Mpls.h"
 #include "NetProto.h"
 #include "Offload.h"
@@ -1571,6 +1572,21 @@ OvsActionExecuteRecirc(POVS_SWITCH_CONTEXT switchContext,
 return STATUS_SUCCESS;
 }
 
+VOID
+OvsActionExecuteHash(OvsFlowKey *key,
+ const PNL_ATTR attr)
+{
+struct ovs_action_hash *hash_act = NlAttrData(attr);
+UINT32 hash = 0;
+
+hash = (UINT32)OvsHashFlow(key);
+hash = OvsJhashWords(&hash, 1, hash_act->hash_basis);
+if (!hash)
+hash = 1;
+
+key->dpHash = hash;
+}
+
 /*
  * --
  * OvsDoExecuteActions --
@@ -1748,6 +1764,22 @@ OvsDoExecuteActions(POVS_SWITCH_CONTEXT switchContext,
 break;
 }
 
+case OVS_ACTION_ATTR_HASH:
+{
+if (ovsFwdCtx.destPortsSizeOut > 0 || ovsFwdCtx.tunnelTxNic != NULL
+|| ovsFwdCtx.tunnelRxNic != NULL) {
+status = OvsOutputBeforeSetAction(&ovsFwdCtx);
+if (status != NDIS_STATUS_SUCCESS) {
+dropReason = L"OVS-adding destination failed";
+goto dropit;
+}
+}
+
+OvsActionExecuteHash(key, (const PNL_ATTR)a);
+
+break;
+}
+
 case OVS_ACTION_ATTR_RECIRC:
 {
 if (ovsFwdCtx.destPortsSizeOut > 0 || ovsFwdCtx.tunnelTxNic != NULL
diff --git a/datapath-windows/ovsext/DpInternal.h 
b/datapath-windows/ovsext/DpInternal.h
index 845c132..612ff7b 100644
--- a/datapath-windows/ovsext/DpInternal.h
+++ b/datapath-windows/ovsext/DpInternal.h
@@ -166,6 +166,7 @@ typedef __declspec(align(8)) struct OvsFlowKey {
 MplsKey mplsKey; /* size 8 */
 };
 UINT32 recircId; /* Recirculation ID.  */
+UINT32 dpHash;   /* Datapath calculated hash value. */
 } OvsFlowKey;
 
 #define OVS_WIN_TUNNEL_KEY_SIZE (sizeof (OvsIPv4TunnelKey))
diff --git a/datapath-windows/ovsext/Flow.c b/datapath-windows/ovsext/Flow.c
index a481eca..8fc068e 100644
--- a/datapath-windows/ovsext/Flow.c
+++ b/datapath-windows/ovsext/Flow.c
@@ -830,6 +830,14 @@ MapFlowKeyToNlKey(PNL_BUFFER nlBuf,
 goto done;
 }
 
+if (flowKey->dpHash) {
+if (!NlMsgPutTailU32(nlBuf, OVS_KEY_ATTR_DP_HASH,
+ flowKey->dpHash)) {
+rc = STATUS_UNSUCCESSFUL;
+goto done;
+}
+}
+
 /* Ethernet header */
 RtlCopyMemory(&(ethKey.eth_src), flowKey->l2.dlSrc, ETH_ADDR_LEN);
 RtlCopyMemory(&(ethKey.eth_dst), flowKey->l2.dlDst, ETH_ADDR_LEN);
@@ -1356,6 +1364,10 @@ _MapKeyAttrToFlowPut(PNL_ATTR *keyAttrs,
 destKey->recircId = NlAttrGetU32(keyAttrs[OVS_KEY_ATTR_RECIRC_ID]);
 }
 
+if (keyAttrs[OVS_KEY_ATTR_DP_HASH]) {
+destKey->dpHash = NlAttrGetU32(keyAttrs[OVS_KEY_ATTR_DP_HASH]);
+}
+
 /* = L2 headers = */
 destKey->l2.inPort = NlAttrGetU32(keyAttrs[OVS_KEY_ATTR_IN_PORT]);
 
@@ -2292,6 +2304,7 @@ ReportFlowInfo(OvsFlow *flow,
 }
 
 info->key.recircId = flow->key.recircId;
+info->key.dpHash = flow->key.dpHash;
 
 return status;
 }
-- 
1.9.0.msysgit.0
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH v3 2/6] datapath-windows: Allow recirculation feature probe.

2016-02-22 Thread Sorin Vinturis
Recirculation feature probe messages sent from userspace are
suppressed by the OVS extension.

This patch changes the current behaviour to allow feature probe
for recirculation.

Signed-off-by: Sorin Vinturis 
---
v3: No changes from the previous version.
---
 datapath-windows/ovsext/Flow.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/datapath-windows/ovsext/Flow.c b/datapath-windows/ovsext/Flow.c
index baf8422..a481eca 100644
--- a/datapath-windows/ovsext/Flow.c
+++ b/datapath-windows/ovsext/Flow.c
@@ -2625,8 +2625,15 @@ OvsProbeSupportedFeature(POVS_MESSAGE msgIn,
 OVS_LOG_ERROR("Wrong ethertype for MPLS attribute.");
 status = STATUS_INVALID_PARAMETER;
 }
+} else if (keyAttrs[OVS_KEY_ATTR_RECIRC_ID]) {
+UINT32 recircId = NlAttrGetU32(keyAttrs[OVS_KEY_ATTR_RECIRC_ID]);
+
+if (!recircId) {
+OVS_LOG_ERROR("Invalid recirculation ID.");
+status = STATUS_INVALID_PARAMETER;
+}
 } else {
-OVS_LOG_ERROR("Probed feature not supported.");
+OVS_LOG_ERROR("Feature not supported.");
 status = STATUS_INVALID_PARAMETER;
 }
 
-- 
1.9.0.msysgit.0
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH v3 5/6] datapath-windows: Updated FAQ regarding Hyper-V recirculation.

2016-02-22 Thread Sorin Vinturis
Updated FAQ document to reflect recirculation support for Hyper-V.

Signed-off-by: Sorin Vinturis 
---
v3: No changes from the previous version.
---
 FAQ.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/FAQ.md b/FAQ.md
index 8bd7ab9..062f164 100644
--- a/FAQ.md
+++ b/FAQ.md
@@ -226,7 +226,7 @@ MPLS  |  3.19  |   YES  |   
 YES|   YES   |
 UFID  |  4.0   |   YES  |YES|   NO|
 Megaflows |  3.12  |   YES  |YES|   NO|
 Masked set action |  4.0   |   YES  |YES|   NO|
-Recirculation |  3.19  |   YES  |YES|   NO|
+Recirculation |  3.19  |   YES  |YES|   YES   |
 TCP flags matching|  3.13  |   YES  |YES|   NO|
 Validate flow actions |  YES   |   YES  |N/A|   NO|
 Multiple datapaths|  YES   |   YES  |YES|   NO|
-- 
1.9.0.msysgit.0
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH v3 4/6] datapath-windows: Extract flow metadata in execute cmd handler.

2016-02-22 Thread Sorin Vinturis
Signed-off-by: Sorin Vinturis 
---
v3: No changes from the previous version.
---
 datapath-windows/ovsext/DpInternal.h |  1 +
 datapath-windows/ovsext/Flow.c   | 17 +
 datapath-windows/ovsext/Flow.h   |  2 ++
 datapath-windows/ovsext/User.c   |  7 +++
 4 files changed, 27 insertions(+)

diff --git a/datapath-windows/ovsext/DpInternal.h 
b/datapath-windows/ovsext/DpInternal.h
index 612ff7b..4d4fec3 100644
--- a/datapath-windows/ovsext/DpInternal.h
+++ b/datapath-windows/ovsext/DpInternal.h
@@ -270,6 +270,7 @@ typedef struct OvsPacketExecute {
uint32_t actionsLen;
PCHAR packetBuf;
PNL_ATTR actions;
+   PNL_ATTR *keyAttrs;
 } OvsPacketExecute;
 
 
diff --git a/datapath-windows/ovsext/Flow.c b/datapath-windows/ovsext/Flow.c
index 8fc068e..e256ec6 100644
--- a/datapath-windows/ovsext/Flow.c
+++ b/datapath-windows/ovsext/Flow.c
@@ -1735,6 +1735,23 @@ DeleteAllFlows(OVS_DATAPATH *datapath)
 }
 }
 
+NDIS_STATUS
+OvsGetFlowMetadata(OvsFlowKey *key,
+   PNL_ATTR *keyAttrs)
+{
+NDIS_STATUS status = NDIS_STATUS_SUCCESS;
+
+if (keyAttrs[OVS_KEY_ATTR_RECIRC_ID]) {
+key->recircId = NlAttrGetU32(keyAttrs[OVS_KEY_ATTR_RECIRC_ID]);
+}
+
+if (keyAttrs[OVS_KEY_ATTR_DP_HASH]) {
+key->dpHash = NlAttrGetU32(keyAttrs[OVS_KEY_ATTR_DP_HASH]);
+}
+
+return status;
+}
+
 /*
  *
  * Initializes 'flow' members from 'packet', 'skb_priority', 'tun_id', and
diff --git a/datapath-windows/ovsext/Flow.h b/datapath-windows/ovsext/Flow.h
index 78bf7cc..310c472 100644
--- a/datapath-windows/ovsext/Flow.h
+++ b/datapath-windows/ovsext/Flow.h
@@ -51,6 +51,8 @@ NDIS_STATUS OvsDeleteFlowTable(OVS_DATAPATH *datapath);
 NDIS_STATUS OvsAllocateFlowTable(OVS_DATAPATH *datapath,
  POVS_SWITCH_CONTEXT switchContext);
 
+NDIS_STATUS OvsGetFlowMetadata(OvsFlowKey *key,
+   PNL_ATTR *keyAttrs);
 NDIS_STATUS OvsExtractFlow(const NET_BUFFER_LIST *pkt, UINT32 inPort,
OvsFlowKey *flow, POVS_PACKET_HDR_INFO layers,
OvsIPv4TunnelKey *tunKey);
diff --git a/datapath-windows/ovsext/User.c b/datapath-windows/ovsext/User.c
index cadffda..6b2d94a 100644
--- a/datapath-windows/ovsext/User.c
+++ b/datapath-windows/ovsext/User.c
@@ -383,6 +383,7 @@ _MapNlAttrToOvsPktExec(PNL_ATTR *nlAttrs, PNL_ATTR 
*keyAttrs,
 execute->actionsLen = NlAttrGetSize(nlAttrs[OVS_PACKET_ATTR_ACTIONS]);
 
 execute->inPort = NlAttrGetU32(keyAttrs[OVS_KEY_ATTR_IN_PORT]);
+execute->keyAttrs = keyAttrs;
 }
 
 NTSTATUS
@@ -429,6 +430,11 @@ OvsExecuteDpIoctl(OvsPacketExecute *execute)
 }
 // XXX: Figure out if any of the other members of fwdDetail need to be set.
 
+status = OvsGetFlowMetadata(&key, execute->keyAttrs);
+if (status != STATUS_SUCCESS) {
+goto dropit;
+}
+
 ndisStatus = OvsExtractFlow(pNbl, fwdDetail->SourcePortId, &key, &layers,
 NULL);
 if (ndisStatus == NDIS_STATUS_SUCCESS) {
@@ -450,6 +456,7 @@ OvsExecuteDpIoctl(OvsPacketExecute *execute)
 }
 }
 
+dropit:
 if (pNbl) {
 OvsCompleteNBL(gOvsSwitchContext, pNbl, TRUE);
 }
-- 
1.9.0.msysgit.0
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH v3 6/6] datapath-windows: Sample action support.

2016-02-22 Thread Sorin Vinturis
This patch adds support for sampling to the OVS extension.

Signed-off-by: Sorin Vinturis 
---
v3: No previous version.
---
 datapath-windows/automake.mk   |   1 +
 datapath-windows/ovsext/Actions.c  | 183 +++--
 datapath-windows/ovsext/Random.h   |  49 +
 datapath-windows/ovsext/ovsext.vcxproj |   1 +
 4 files changed, 201 insertions(+), 33 deletions(-)
 create mode 100644 datapath-windows/ovsext/Random.h

diff --git a/datapath-windows/automake.mk b/datapath-windows/automake.mk
index 04fc97f..1eb2be1 100644
--- a/datapath-windows/automake.mk
+++ b/datapath-windows/automake.mk
@@ -46,6 +46,7 @@ EXTRA_DIST += \
datapath-windows/ovsext/PacketIO.h \
datapath-windows/ovsext/PacketParser.c \
datapath-windows/ovsext/PacketParser.h \
+   datapath-windows/ovsext/Random.h \
datapath-windows/ovsext/Recirc.c \
datapath-windows/ovsext/Recirc.h \
datapath-windows/ovsext/Stt.c \
diff --git a/datapath-windows/ovsext/Actions.c 
b/datapath-windows/ovsext/Actions.c
index d3f9be4..f5b1410 100644
--- a/datapath-windows/ovsext/Actions.c
+++ b/datapath-windows/ovsext/Actions.c
@@ -24,6 +24,7 @@
 #include "NetProto.h"
 #include "Offload.h"
 #include "PacketIO.h"
+#include "Random.h"
 #include "Recirc.h"
 #include "Stt.h"
 #include "Switch.h"
@@ -1585,6 +1586,132 @@ OvsActionExecuteHash(OvsFlowKey *key,
 hash = 1;
 
 key->dpHash = hash;
+}
+
+/*
+ * --
+ * OvsOutputUserspaceAction --
+ *  Executes a sample action.
+ * --
+ */
+static __inline NDIS_STATUS
+OvsOutputUserspaceAction(OvsForwardingContext *ovsFwdCtx,
+ OvsFlowKey *key,
+ const PNL_ATTR attr)
+{
+NTSTATUS status = NDIS_STATUS_SUCCESS;
+PNL_ATTR userdataAttr;
+PNL_ATTR queueAttr;
+POVS_PACKET_QUEUE_ELEM elem;
+POVS_PACKET_HDR_INFO layers = &ovsFwdCtx->layers;
+BOOLEAN isRecv = FALSE;
+
+POVS_VPORT_ENTRY vport = OvsFindVportByPortNo(ovsFwdCtx->switchContext,
+  ovsFwdCtx->srcVportNo);
+
+if (vport) {
+if (vport->isExternal ||
+OvsIsTunnelVportType(vport->ovsType)) {
+isRecv = TRUE;
+}
+}
+
+queueAttr = NlAttrFindNested(attr, OVS_USERSPACE_ATTR_PID);
+userdataAttr = NlAttrFindNested(attr, OVS_USERSPACE_ATTR_USERDATA);
+
+elem = OvsCreateQueueNlPacket(NlAttrData(userdataAttr),
+  NlAttrGetSize(userdataAttr),
+  OVS_PACKET_CMD_ACTION,
+  vport, key, ovsFwdCtx->curNbl,
+  NET_BUFFER_LIST_FIRST_NB(ovsFwdCtx->curNbl),
+  isRecv,
+  layers);
+if (elem) {
+LIST_ENTRY missedPackets;
+InitializeListHead(&missedPackets);
+InsertTailList(&missedPackets, &elem->link);
+OvsQueuePackets(&missedPackets, 1);
+} else {
+status = NDIS_STATUS_FAILURE;
+}
+
+return status;
+}
+
+/*
+ * --
+ * OvsExecuteSampleAction --
+ *  Executes a sample action.
+ * --
+ */
+static __inline NDIS_STATUS
+OvsExecuteSampleAction(OvsForwardingContext *ovsFwdCtx,
+   OvsFlowKey *key,
+   UINT64 *hashAction,
+   const PNL_ATTR attr)
+{
+PNET_BUFFER_LIST newNbl = NULL;
+PNL_ATTR actionsList = NULL;
+PNL_ATTR a = NULL;
+INT rem = 0;
+UINT64 hash = 0;
+
+SRand();
+NL_ATTR_FOR_EACH_UNSAFE(a, rem, NlAttrData(attr), NlAttrGetSize(attr)) {
+switch (NlAttrType(a)) {
+case OVS_SAMPLE_ATTR_PROBABILITY:
+{
+UINT32 probability = NlAttrGetU32(a);
+
+if (!probability || Rand() > probability) {
+return 0;
+}
+break;
+}
+case OVS_SAMPLE_ATTR_ACTIONS:
+actionsList = a;
+break;
+}
+}
+
+if (actionsList) {
+rem = NlAttrGetSize(actionsList);
+a = (PNL_ATTR)NlAttrData(actionsList);
+}
+
+if (!rem) {
+/* Actions list is empty, do nothing */
+return STATUS_SUCCESS;
+}
+
+/*
+ * The only known usage of sample action is having a single user-space
+ * action. Treat this usage as a special case.
+ */
+if (NlAttrType(a) == OVS_ACTION_ATTR_USERSPACE &&
+NlAttrIsLast(a, rem)) {
+return OvsOutputUserspaceAction(ovsFwdCtx, key, a);
+}
+
+newNbl = OvsPartialCopyNBL(ovsFwdCtx->switchContext, ovsFwdCtx->curNbl,
+   0, 0, TRUE /*copy NBL info*/);
+if (newNbl == NULL) {
+   

Re: [ovs-dev] [PATCH v2 1/5] datapath-windows: Added recirculation support.

2016-02-22 Thread Sorin Vinturis
Hi Sairam,

I have added a v3 version of the recirculation patch, in which the deferred 
action queue access is synchronized.
Please have a look and test it with your contrack patch. If you encounter any 
issue, please create a dump and sent it to me to have a look at it.

Thanks,
Sorin

-Original Message-
From: Sairam Venugopal [mailto:vsai...@vmware.com] 
Sent: Saturday, 20 February, 2016 02:12
To: Sorin Vinturis; dev@openvswitch.org
Subject: Re: [ovs-dev] [PATCH v2 1/5] datapath-windows: Added recirculation 
support.

Hi Sorin,

Thanks for the patch. It needs to be updated to make it thread-safe. The 
DeferredActionQueue needs a RW lock for synchronization.
I also ran into memory leak while testing out the patch (the kernel couldn¹t be 
uninstalled without a reboot).

If am able to get to it, I will send out a patch that addresses some of the 
issues that I found while testing it with my Conntrack patch.

Thanks,
Sairam

On 2/11/16, 1:59 PM, "Sorin Vinturis" 
wrote:

>Recirculation support for the OVS extension.
>
>Tested with PING using MPLS packets.
>
>Signed-off-by: Sorin Vinturis 
>Co-authored-by: Alin Gabriel Serdean 
>Reported-by: Sorin Vinturis 
>Reported-at: 
>https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvsw
>itc 
>h_ovs-2Dissues_issues_104&d=BQIGaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihV
>MNt 
>Xt-uEs&r=Dcruz40PROJ40ROzSpxyQSLw6fcrOWpJgEcEmNR3JEQ&m=CREZI27LygkjkrqW
>7Lm 
>dwo9sAA-aCidqVPqBJcTGKMU&s=xtUP8mawJ_-UjWP27ySmpPMABxUknGA-V4pRZ5SSrmk&
>e=
>---
>v2: Initialize flow key before using it.
>---
> datapath-windows/automake.mk  |   3 +
> datapath-windows/ovsext/Actions.c | 215
>++
> datapath-windows/ovsext/Actions.h |  54 
> datapath-windows/ovsext/DpInternal.h  |   2 +-
> datapath-windows/ovsext/Flow.c|  76 +--
> datapath-windows/ovsext/Flow.h|   5 +-
> datapath-windows/ovsext/Netlink/Netlink.h |  11 ++
> datapath-windows/ovsext/PacketIO.c|  16 ++-
> datapath-windows/ovsext/PacketIO.h|  10 --
> datapath-windows/ovsext/Recirc.c  | 165 +++
> datapath-windows/ovsext/Recirc.h  |  82 
> datapath-windows/ovsext/Tunnel.c  |  15 ++-
> datapath-windows/ovsext/User.c|  13 +-
> datapath-windows/ovsext/ovsext.vcxproj|   3 +
> 14 files changed, 602 insertions(+), 68 deletions(-) create mode 
> 100644 datapath-windows/ovsext/Actions.h create mode 100644 
> datapath-windows/ovsext/Recirc.c create mode 100644 
> datapath-windows/ovsext/Recirc.h
>
>diff --git a/datapath-windows/automake.mk 
>b/datapath-windows/automake.mk index f29f548..04fc97f 100644
>--- a/datapath-windows/automake.mk
>+++ b/datapath-windows/automake.mk
>@@ -9,6 +9,7 @@ EXTRA_DIST += \
>   datapath-windows/misc/uninstall.cmd \
>   datapath-windows/ovsext.sln \
>   datapath-windows/ovsext/Actions.c \
>+  datapath-windows/ovsext/Actions.h \
>   datapath-windows/ovsext/Atomic.h \
>   datapath-windows/ovsext/BufferMgmt.c \
>   datapath-windows/ovsext/BufferMgmt.h \ @@ -45,6 +46,8 @@ EXTRA_DIST 
>+= \
>   datapath-windows/ovsext/PacketIO.h \
>   datapath-windows/ovsext/PacketParser.c \
>   datapath-windows/ovsext/PacketParser.h \
>+  datapath-windows/ovsext/Recirc.c \
>+  datapath-windows/ovsext/Recirc.h \
>   datapath-windows/ovsext/Stt.c \
>   datapath-windows/ovsext/Stt.h \
>   datapath-windows/ovsext/Switch.c \
>diff --git a/datapath-windows/ovsext/Actions.c
>b/datapath-windows/ovsext/Actions.c
>index 5a04541..d3f18f2 100644
>--- a/datapath-windows/ovsext/Actions.c
>+++ b/datapath-windows/ovsext/Actions.c
>@@ -14,8 +14,7 @@
>  * limitations under the License.
>  */
> 
>-#include "precomp.h"
>-
>+#include "Actions.h"
> #include "Debug.h"
> #include "Event.h"
> #include "Flow.h"
>@@ -24,6 +23,7 @@
> #include "NetProto.h"
> #include "Offload.h"
> #include "PacketIO.h"
>+#include "Recirc.h"
> #include "Stt.h"
> #include "Switch.h"
> #include "User.h"
>@@ -35,6 +35,8 @@
> #endif
> #define OVS_DBG_MOD OVS_DBG_ACTION
> 
>+#define OVS_DEST_PORTS_ARRAY_MIN_SIZE 2
>+
> typedef struct _OVS_ACTION_STATS {
> UINT64 rxGre;
> UINT64 txGre;
>@@ -66,7 +68,6 @@ OVS_ACTION_STATS ovsActionStats;
>  * exercised while adding new members to the structure - only add ones 
>that get
>  * used across multiple stages in the pipeline/get used in multiple 
>functions.
>  */
>-#define OVS_DEST_PORTS_ARRAY_MIN_SIZE 2  typedef struct 
>OvsForwardingContext {
> POVS_SWITCH_CONTEXT switchContext;
> /* The NBL currently used in the pipeline. */ @@ -99,7 +100,7 @@ 
>typedef struct OvsForwardingContext {
>  */
> OvsIPv4TunnelKey tunKey;
> 
>- /*
>+/*
>  * Tunneling - Tx:
>  * To store the output port, when it is a tunneled port. We don't 
>foresee
>  * multiple tunneled ports as outport for any given NBL.
>@@ -117,7 +118,6 @@ typedef struct OvsForwardingContext {

[ovs-dev] Our classic ED Pack is authorised

2016-02-22 Thread Benito








96






Fine quality pills on discounts

p{margin:10px 0;padding:0;}
table{border-collapse:collapse;}
h1,h2,h3,h4,h5,h6{display:block;margin:0;padding:0;}
img,a img{border:0;height:auto;outline:none;text-decoration:none;}
body,#bodyTable,#bodyCell{height:100%;margin:0;padding:0;width:100%;}
#outlook a{padding:0;}
img{-ms-interpolation-mode:bicubic;}
table{mso-table-lspace:0pt;mso-table-rspace:0pt;}
ReadMsgBody{width:100%;}
ExternalClass{width:100%;}
p,a,li,td,blockquote{mso-line-height-rule:exactly;}
a[href^=tel],a[href^=sms]{color:inherit;cursor:default;text-decoration:none;}
p,a,li,td,body,table,blockquote{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;}
ExternalClass,.ExternalClass p,.ExternalClass td,.ExternalClass 
div,.ExternalClass span,.ExternalClass font{line-height:100%;}
a[x-apple-data-detectors]{color:inherit !important;text-decoration:none 
!important;font-size:inherit !important;font-family:inherit 
!important;font-weight:inherit !important;line-height:inherit !important;}
a.mcnButton{display:block;}
mcnImage{vertical-align:bottom;}
mcnTextContent{word-break:break-word;}
mcnTextContent img{height:auto !important;}
mcnDividerBlock{table-layout:fixed !important;}
body,#bodyTable{background-color:#DEE0E2;}
#bodyCell{border-top:0;}
#templateContainer{border:0;}
h1{color:#D83826 
!important;font-family:Arial;font-size:38px;font-style:normal;font-weight:bold;line-height:100%;letter-spacing:-1px;text-align:left;}
h2{color:#D83826 
!important;font-family:Arial;font-size:20px;font-style:normal;font-weight:bold;line-height:100%;letter-spacing:-.75px;text-align:left;}
h3{color:#D83826 
!important;font-family:Arial;font-size:18px;font-style:normal;font-weight:bold;line-height:100%;letter-spacing:-.5px;text-align:left;}
h4{color:#606060 
!important;font-family:Arial;font-size:14px;font-style:normal;font-weight:bold;line-height:200%;letter-spacing:normal;text-align:left;}
#templatePreheader{background-color:#DEE0E2;border-top:0;border-bottom:1px 
solid #CC;}
preheaderContainer .mcnTextContent,.preheaderContainer .mcnTextContent 
p{color:#606060;font-family:Arial;font-size:11px;line-height:125%;text-align:left;}
preheaderContainer .mcnTextContent 
a{color:#606060;font-weight:normal;text-decoration:underline;}
#templateHeader{background-color:#ff;border-top:0;border-bottom:0;}
headerContainer .mcnTextContent,.headerContainer .mcnTextContent 
p{color:#606060;font-family:Arial;font-size:15px;line-height:150%;text-align:left;}
headerContainer .mcnTextContent 
a{color:#6DC6DD;font-weight:normal;text-decoration:underline;}
#templateBody{background-color:#FF;border-top:0;border-bottom:0;}
bodyContainer .mcnTextContent,.bodyContainer .mcnTextContent 
p{color:#606060;font-family:Arial;font-size:15px;line-height:150%;text-align:left;}
bodyContainer .mcnTextContent 
a{color:#6DC6DD;font-weight:normal;text-decoration:underline;}
#templateColumns{background-color:#ff;border-top:0;border-bottom:0;}
leftColumnContainer .mcnTextContent,.leftColumnContainer .mcnTextContent 
p{color:#606060;font-family:Arial;font-size:15px;line-height:150%;text-align:left;}
leftColumnContainer .mcnTextContent 
a{color:#6DC6DD;font-weight:normal;text-decoration:underline;}
rightColumnContainer .mcnTextContent,.rightColumnContainer .mcnTextContent 
p{color:#606060;font-family:Arial;font-size:15px;line-height:150%;text-align:left;}
rightColumnContainer .mcnTextContent 
a{color:#6DC6DD;font-weight:normal;text-decoration:underline;}
#templateFooter{background-color:#D83826;border-top:0;border-bottom:1px solid 
#841719;}
footerContainer .mcnTextContent,.footerContainer .mcnTextContent 
p{color:#EE;font-family:Arial;font-size:10px;line-height:150%;text-align:left;}
footerContainer .mcnTextContent 
a{color:#FF;font-weight:normal;text-decoration:underline;}
@media only screen and (max-width: 
480px){body,table,td,p,a,li,blockquote{-webkit-text-size-adjust:none 
!important;}
}@media only screen and (max-width: 480px){body{width:100% 
!important;min-width:100% !important;}
}@media only screen and (max-width: 480px){#bodyCell{padding-top:10px 
!important;padding-right:10px !important;padding-bottom:10px 
!important;padding-left:10px !important;}
}@media only screen and (max-width: 
480px){#templateContainer,#templatePreheader,#templateHeader,#templateColumns,#templateBody,#templateFooter{max-width:600px
 !important;width:100% !important;}
}@media only screen and (max-width: 
480px){.columnsContainer{display:block!important;max-width:600px 
!important;width:100%!important;}
}@media only screen and (max-width: 480px){.mcnImage{height:auto 
!important;width:100% !important;}
}@media only screen and (max-width: 
480px){.mcnCaptionTopContent,.mcnCaptionBottomContent,.mcnTextContentContainer,.mcnBoxedTextContentContainer,.mcnImageGroupContentContainer,.mcnCaptionLeftTextContentContainer,.mcnCaptionRightTextContentContainer,.mcnCaptionLeftImageContentContainer,.mcnCaptionRightImageContentContainer,.mcnImageCardLeftText

Re: [ovs-dev] [PATCH v2 0/6] Add color output to `ovs-ofctl dump-flows` command

2016-02-22 Thread Quentin Monnet
2016-02-15 16:19 GMT+01:00 Quentin Monnet :

> Proposal: add an option to ovs-ofctl utility so as to obtain colorized
> output
> in tty, for easier reading. Currently, only the dump-flows command supports
> colors.
>
> A new `--color` option has been added to ovs-ofctl so as to indicate
> whether
> color markers should be used or not. It can be set to `always` (force
> colors),
> `never` (no colors) or `auto` (use colors only if output is a tty). If
> provided
> without any value, it is the same as `auto`. If the option is not provided
> at
> all, colors are disabled by default.
>
> An example screenshot of colored output is available at the following
> address:
> https://github.com/6WIND/ovs/blob/colors/README-colors.md
>
> v2: instead of using only hardcoded colors, it is now possible to define
> custom
> colors by using the `OVS_COLORS` environment variable (on the ls or grep
> tools
> model). See patch 2/6 (“ovs-ofctl: declare / set up colors for command
> output”)
> for more details. This version also splits the two patches of v1 into
> several
> smaller patches so as to ease comprehension and review.
>
> Quentin Monnet (6):
>   ovs-ofctl: add option for color output to dump-flows command
>   ovs-ofctl: declare / set up colors for command output
>   dynamic-string: define functions to print colored output
>   ovs-ofctl: add output colors for flow attributes
>   match: color output of match conditions for ovs-ofctl dump-flows
>   ofp-actions: color output of flow actions for ovs-ofctl dump-flows
>
>  lib/automake.mk   |   2 +
>  lib/bundle.c  |  19 +-
>  lib/bundle.h  |   3 +-
>  lib/colors.c  | 132 +
>  lib/colors.h  |  36 
>  lib/dpif-netdev.c |   2 +-
>  lib/dynamic-string.c  |  32 
>  lib/dynamic-string.h  |   7 +
>  lib/flow.c|   7 +-
>  lib/flow.h|   3 +-
>  lib/learn.c   |  59 --
>  lib/learn.h   |   3 +-
>  lib/learning-switch.c |   2 +-
>  lib/match.c   | 288 +---
>  lib/match.h   |   3 +-
>  lib/meta-flow.c   |   7 +-
>  lib/multipath.c   |   9 +-
>  lib/multipath.h   |   3 +-
>  lib/nx-match.c|  18 +-
>  lib/nx-match.h|   9 +-
>  lib/odp-util.c|   6 +-
>  lib/ofp-actions.c | 428
> +++---
>  lib/ofp-actions.h |   3 +-
>  lib/ofp-print.c   |  98 ++
>  lib/ofp-print.h   |   8 +-
>  lib/vconn.c   |   6 +-
>  ofproto/ofproto-dpif-xlate.c  |   2 +-
>  ofproto/ofproto-dpif.c|   4 +-
>  ofproto/ofproto.c |   2 +-
>  ovn/controller/ofctrl.c   |  12 +-
>  ovn/controller/pinctrl.c  |   2 +-
>  tests/test-ovn.c  |   2 +-
>  third-party/ofp-tcpdump.patch |   2 +-
>  utilities/ovs-ofctl.c | 101 +++---
>  34 files changed, 929 insertions(+), 391 deletions(-)
>  create mode 100644 lib/colors.c
>  create mode 100644 lib/colors.h
>
> --
> 1.9.1
>
>
Hi all,
I have no more updates on my color patches series for now, since I prefer
to wait for the proposed implementation to be validated before I extend it.
Would my current approach make sense for inclusion in OVS codebase?

Best regards,
Quentin
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH RFC v3] netdev-dpdk: vhost-user: Fix sending packets to queues not enabled by guest.

2016-02-22 Thread Flavio Leitner

Hi Ilya,


Few comments inline:


On Sat, 20 Feb 2016 14:28:52 +0300
Ilya Maximets  wrote:

> Currently virtio driver in guest operating system have to be configured
> to use exactly same number of queues. If number of queues will be less,
> some packets will get stuck in queues unused by guest and will not be
> received.
> 
> Fix that by using new 'vring_state_changed' callback, which is
> available for vhost-user since DPDK 2.2.
> Implementation uses additional mapping from configured tx queues to
> enabled by virtio driver. This requires mandatory locking of TX queues
> in __netdev_dpdk_vhost_send(), but this locking was almost always anyway
> because of calling set_multiq with n_txq = 'ovs_numa_get_n_cores() + 1'.
> 
> Fixes: 4573fbd38fa1 ("netdev-dpdk: Add vhost-user multiqueue support")
> Signed-off-by: Ilya Maximets 
> Reviewed-by: Aaron Conole 
> Acked-by: Flavio Leitner 

If you do small changes to the patch that doesn't alter its logic you
can preserve the signature from others (e.g.: typos, indentation,
comments...).  However, in this case you changed the logic so you can't
preserve those anymore.

The procedure would be to take them out and add the previous reviewers
to the CC in the hope that they will review the new patch again.



> ---
> 
> Version 3:
>   * Fixed size in dpdk_rte_mzalloc() for enabled_queues.
>   * Fixed possible segfault because of unallocated tx_q[].
>   * Added remap of tx queues after real_n_txq modification
> in netdev_dpdk_vhost_set_queues().
> 
>  lib/netdev-dpdk.c | 112 
> ++
>  1 file changed, 97 insertions(+), 15 deletions(-)
> 
> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
> index e4f789b..3e69e50 100644
> --- a/lib/netdev-dpdk.c
> +++ b/lib/netdev-dpdk.c
> @@ -173,6 +173,8 @@ struct dpdk_tx_queue {
>  * from concurrent access.  It is used 
> only
>  * if the queue is shared among different
>  * pmd threads (see 'txq_needs_locking'). 
> */
> +int map;   /* Mapping of configured vhost-user queues
> +* to enabled by guest. */
>  uint64_t tsc;
>  struct rte_mbuf *burst_pkts[MAX_TX_QUEUE_LEN];
>  };
> @@ -572,6 +574,9 @@ netdev_dpdk_alloc_txq(struct netdev_dpdk *netdev, 
> unsigned int n_txqs)
>  /* Queues are shared among CPUs. Always flush */
>  netdev->tx_q[i].flush_tx = true;
>  }
> +
> +/* Initialize map for vhost devices. */
> +netdev->tx_q[i].map = -1;
>  rte_spinlock_init(&netdev->tx_q[i].tx_lock);
>  }
>  }
> @@ -623,6 +628,8 @@ netdev_dpdk_init(struct netdev *netdev_, unsigned int 
> port_no,
>  if (err) {
>  goto unlock;
>  }
> +} else {
> +netdev_dpdk_alloc_txq(netdev, VHOST_MAX_QUEUE_PAIRS);

The VHOST_MAX_QUEUE_PAIRS is 0x8000, so we are allocating 32768 queue.
Also that the struct dpdk_tx_queue has 3096 bytes so in the end it is
allocating 101MB for each vhost-user port.

Why do we need to pre-allocate all TX queues?



>  }
>  
>  list_push_back(&dpdk_list, &netdev->list_node);
> @@ -889,10 +896,8 @@ netdev_dpdk_vhost_set_multiq(struct netdev *netdev_, 
> unsigned int n_txq,
>  ovs_mutex_lock(&dpdk_mutex);
>  ovs_mutex_lock(&netdev->mutex);
>  
> -rte_free(netdev->tx_q);
>  netdev->up.n_txq = n_txq;
>  netdev->up.n_rxq = n_rxq;
> -netdev_dpdk_alloc_txq(netdev, netdev->up.n_txq);
>  
>  ovs_mutex_unlock(&netdev->mutex);
>  ovs_mutex_unlock(&dpdk_mutex);
> @@ -1117,17 +1122,16 @@ __netdev_dpdk_vhost_send(struct netdev *netdev, int 
> qid,
>  unsigned int total_pkts = cnt;
>  uint64_t start = 0;
>  
> -if (OVS_UNLIKELY(!is_vhost_running(virtio_dev))) {
> +qid = vhost_dev->tx_q[qid % vhost_dev->real_n_txq].map;
> +
> +if (OVS_UNLIKELY(!is_vhost_running(virtio_dev) || qid == -1)) {
>  rte_spinlock_lock(&vhost_dev->stats_lock);
>  vhost_dev->stats.tx_dropped+= cnt;
>  rte_spinlock_unlock(&vhost_dev->stats_lock);
>  goto out;
>  }
>  
> -if (vhost_dev->txq_needs_locking) {
> -qid = qid % vhost_dev->real_n_txq;
> -rte_spinlock_lock(&vhost_dev->tx_q[qid].tx_lock);
> -}
> +rte_spinlock_lock(&vhost_dev->tx_q[qid].tx_lock);
>  
>  do {
>  int vhost_qid = qid * VIRTIO_QNUM + VIRTIO_RXQ;
> @@ -1165,9 +1169,7 @@ __netdev_dpdk_vhost_send(struct netdev *netdev, int qid,
>  }
>  } while (cnt);
>  
> -if (vhost_dev->txq_needs_locking) {
> -rte_spinlock_unlock(&vhost_dev->tx_q[qid].tx_lock);
> -}
> +rte_spinlock_unlock(&vhost_dev->tx_q[qid].tx_lock);
>  
>  rte_spinlock_lock(&vhost_dev->stats_lock);
>  netdev_dpdk_vhost_update_tx_counters(&vhost_dev->stats, pkts, total_pkts,
> @@ -1827,6 +1829,46 @@ set_irq_status(struct virtio_net *dev)
>  }
> 

Re: [ovs-dev] [PATCH v2 0/6] Add color output to `ovs-ofctl dump-flows` command

2016-02-22 Thread Ben Pfaff
On Mon, Feb 22, 2016 at 05:04:02PM +0100, Quentin Monnet wrote:
> I have no more updates on my color patches series for now, since I prefer
> to wait for the proposed implementation to be validated before I extend it.
> Would my current approach make sense for inclusion in OVS codebase?

I'm trying to catch up on reviews this week, so you can expect some
feedback soon.
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH] INSTALL.md: Fix shell command line formatting.

2016-02-22 Thread Ben Pfaff
On Fri, Jan 29, 2016 at 03:18:14PM -0800, Jarno Rajahalme wrote:
> Some shell command lines were quited inconsistently from others.
> 
> Signed-off-by: Jarno Rajahalme 

Since this was acked and had been sitting in patchwork for a while, I
applied it myself.
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH 05/14] json.at: Run for Python 2 and 3.

2016-02-22 Thread Ben Pfaff
On Tue, Feb 02, 2016 at 05:36:47PM -0500, Russell Bryant wrote:
> Run json.at tests for both Python 2 and 3 if available.
> 
> Signed-off-by: Russell Bryant 

The new comment here is nice:
> +# JSON_CHECK_POSITIVE_PY(TITLE, INPUT, OUTPUT, TEST-JSON-ARGS,
> +#PYTHON-CHCEK, PYTHON-BIN)
> +#

...and so it would be nice to have a similar new comment here:
>  m4_define([JSON_CHECK_NEGATIVE_PY], 
>[AT_SETUP([$1])
> AT_KEYWORDS([json negative Python])
> -   AT_SKIP_IF([test $HAVE_PYTHON = no])
> +   AT_SKIP_IF([test $5 = no])
> AT_CHECK([printf %s "AS_ESCAPE([$2])" > input])
> AT_CAPTURE_FILE([input])
> -   AT_CHECK([$PYTHON $srcdir/test-json.py $4 input], [1], [stdout], [])
> +   AT_CHECK([$6 $srcdir/test-json.py $4 input], [1], [stdout], [])
> AT_CHECK([[sed 's/^error: [^:]*:/error:/' < stdout]], [0], [$3
>  ])
> AT_CLEANUP])

Acked-by: Ben Pfaff 
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH 08/14] library.at: Run tests for Python 2 and 3.

2016-02-22 Thread Ben Pfaff
On Tue, Feb 02, 2016 at 05:36:50PM -0500, Russell Bryant wrote:
> Update Python tests to run for both Python 2 and 3.
> 
> Signed-off-by: Russell Bryant 

This needs a rebase due to conflicts, but I'm sure it'll be fine after
that, so:
Acked-by: Ben Pfaff 
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH 13/14] vlog.at: Run tests for Python 2 and 3.

2016-02-22 Thread Ben Pfaff
On Tue, Feb 02, 2016 at 05:36:55PM -0500, Russell Bryant wrote:
> Update these Python tests to run with both Python 2 and 3.
> 
> Signed-off-by: Russell Bryant 

Also needs a rebase but I'm sure it's fine:
Acked-by: Ben Pfaff 
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH] Installation steps correction for DPDK 2.2.

2016-02-22 Thread Flavio Leitner

Adding Daniele just in case.

fbl

On Mon, 22 Feb 2016 10:13:10 +
"Weglicki, MichalX"  wrote:

> Hello, 
> 
> Just gentle reminder, is this patch fine? Or I'm supposed to correct 
> something? 
> 
> As Flavio mentioned it is important change for 2.5 branch. 
> 
> Br, 
> Michal. 
> 
> -Original Message-
> From: Flavio Leitner [mailto:f...@sysclose.org] 
> Sent: Friday, February 12, 2016 1:18 AM
> To: Weglicki, MichalX 
> Cc: dev@openvswitch.org; Daniele Di Proietto 
> Subject: Re: [ovs-dev] [PATCH] Installation steps correction for DPDK 2.2.
> 
> On Fri,  5 Feb 2016 11:42:06 +
> mweglicx  wrote:
> 
> > Missing step added to INSTALL.DPDK.md which prevents
> > installation error message.
> > 
> > Signed-off-by: Michal Weglicki 
> > ---
> >  INSTALL.DPDK.md | 20 ++--
> >  1 file changed, 10 insertions(+), 10 deletions(-)
> > 
> > diff --git a/INSTALL.DPDK.md b/INSTALL.DPDK.md
> > index c601358..0928e66 100644
> > --- a/INSTALL.DPDK.md
> > +++ b/INSTALL.DPDK.md
> > @@ -33,14 +33,22 @@ on Debian/Ubuntu)
> >  
> >   `CONFIG_RTE_BUILD_COMBINE_LIBS=y`
> >  
> > +   * Non IVSHMEM:
> > +
> > + `export DPDK_BUILD=$DPDK_DIR/x86_64-native-linuxapp-gcc`
> > +
> > +   * IVSHMEM:
> > +
> > + `export DPDK_BUILD=$DPDK_DIR/x86_64-ivshmem-linuxapp-gcc`
> > +
> >   Then run `make install` to build and install the library.
> >   For default install without IVSHMEM:
> >  
> > - `make install T=x86_64-native-linuxapp-gcc`
> > + `make install T=x86_64-native-linuxapp-gcc 
> > DESTDIR=$DPDK_BUILD/install`
> >  
> >   To include IVSHMEM (shared memory):
> >  ake install T=x86_64-ivs
> > - `make install T=x86_64-ivshmem-linuxapp-gcc`
> > + `make install T=x86_64-ivshmem-linuxapp-gcc 
> > DESTDIR=$DPDK_BUILD/install`
> >  
> >   For further details refer to http://dpdk.org/
> >  
> > @@ -51,14 +59,6 @@ on Debian/Ubuntu)
> >  
> >  3. Configure & build OVS:
> >  
> > -   * Non IVSHMEM:
> > -
> > - `export DPDK_BUILD=$DPDK_DIR/x86_64-native-linuxapp-gcc/`
> > -
> > -   * IVSHMEM:
> > -
> > - `export DPDK_BUILD=$DPDK_DIR/x86_64-ivshmem-linuxapp-gcc/`
> > -
> > ```
> > cd $(OVS_DIR)/
> > ./boot.sh  
> 
> The real change is just the addition of DESTDIR argument which could
> have been, for example:
>make install T=x86_64-ivshmem-linuxapp-gcc DESTDIR=install
> 
> Anyway, the doc looks good after the patch.
> 
> Acked-by: Flavio Leitner 
> 
> BTW, this needs to go in branch-2.5 as well.
> 


___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH 04/14] check-structs.at: Run for both Python 2 and 3.

2016-02-22 Thread Ben Pfaff
On Tue, Feb 02, 2016 at 05:36:46PM -0500, Russell Bryant wrote:
> Update the tests in check-structs.at to run with both Python 2 and 3 if
> available.  The check-structs script is written in Python, though does
> not use the ovs Python library.  The script did require fixes in a
> previous commit to make it Python 3 compatible, so this ensures that
> compatibility remains.
> 
> Signed-off-by: Russell Bryant 

With all patches applied, on top of commit b1e04512f7150AA9 (from
roughly when you posted the patches) I'm getting several errors from
flake8 regarding check-structs:

../build-aux/check-structs:70:24: F821 undefined name 'inputFile'
../build-aux/check-structs:71:17: F821 undefined name 'lineNumber'
../build-aux/check-structs:73:40: F821 undefined name 'inputFile'
../build-aux/check-structs:77:40: F821 undefined name 'fileName'
../build-aux/check-structs:77:50: F821 undefined name 'inputFile'
../build-aux/check-structs:94:23: F821 undefined name 'fileName'
../build-aux/check-structs:94:33: F821 undefined name 'lineNumber'
../build-aux/check-structs:101:48: F821 undefined name 'fileName'
../build-aux/check-structs:101:58: F821 undefined name 'lineNumber'
../build-aux/check-structs:111:36: E711 comparison to None should be 'if
cond is not None:'

I'm using flake8 for Python2, version 2.2.2.

Any ideas?  I haven't investigated yet, except to note that the
final complaint about comparison to None is correct.
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH 00/14] Finish support for Python 3.

2016-02-22 Thread Ben Pfaff
On Tue, Feb 02, 2016 at 05:36:42PM -0500, Russell Bryant wrote:
> This is this final series for Python 3 support.  It refactors the test suite 
> to
> run Python tests against both Python 2 and 3.

You can consider all of these to have my ack:
Acked-by: Ben Pfaff 
except where I specifically followed up.
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH 2/3] netdev-dpdk: Do not add vhost-user ports with '/' in name.

2016-02-22 Thread Ben Pfaff
On Fri, Feb 05, 2016 at 11:40:11AM -0800, Ben Pfaff wrote:
> On Thu, Feb 04, 2016 at 03:42:34AM +, Daniele Di Proietto wrote:
> > 
> > 
> > On 03/02/2016 14:47, "Ben Pfaff"  wrote:
> > 
> > >On Tue, Feb 02, 2016 at 05:56:35PM -0800, Daniele Di Proietto wrote:
> > >> This check prevents an obvious way for a vhost-user socket to escape the
> > >> intended directory.
> > >> 
> > >> There might be other ways to escape the directory (none comes to mind at
> > >> the moment), but this is a problem that should be properly solved by
> > >> mandatory access control.
> > >> 
> > >> A similar check is done for a bridge name, since that name is used as
> > >> part of a socket as well.
> > >> 
> > >> Signed-off-by: Daniele Di Proietto 
> > >
> > >I am not sure whether the restriction for .. is necessary.  Do you have
> > >something in mind there?
> > 
> > The difference between here and the bridge management socket is that here
> > we have no suffix.  A vhost user port named .. should have a socket in
> > "/var/run/openvswitch/.."
> > 
> > It will not be possible to create a socket like this nor to remove the
> > directory (I believe unlink should refuse to remove directories), but I
> > thought it was better to check for this and fail early with a better
> > error message rather that try to create/unlink an invalid path.
> > 
> > Now that I think about it the name "." has the same problem.
> >  
> > What do you think?
> 
> I think that both unlink and bind for . and .. will yield an error, and
> I think that the cause will be pretty obvious, so I don't see a need for
> the special case.

Hi Daniele, are you planning to send a v2 for this patch?  I think that
we should definitely address it.
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH v2] lib/ovs-thread: Add Transactional Memory (TM) support.

2016-02-22 Thread William Tu
v1->v2
- Fix a bug at UNLOCK_ELISION
- Add checking if glibc version >= 2.21 (OVS_CHECK_GLIBC_TSX)
- Add checking of whether cpu has TSX support (OVS_CHECK_RTM)
- Enable LOCK_ELISION only when CPU has TSX and glibc doesn't
  (if glibc version >= 2.21, then using phtread_mutex has lock elision)
- Add 20% mutation test-cmap testcase
- List failed testcases below 

The patch (for references, not fully passed check yet) shows the preliminary
results of enabling RTM (Restricted Transactional Memory). A successful
transactional execution elides the lock, i.e., the lock is by-passed, and
exposes concurrency. However, transactions might abort due to several reasons
such as data conflicts, I/O operations, syscall, etc. When transaction aborts,
it falls back to the original locking mechanisms. Thus, the performance
improvement depends on the abort rate, and the overhead of speculative execution
and rollback.

The patch adds OVS_LOCK_ELISION, OVS_TRYLOCK_ELISION, and OVS_UNLOCK_ELISION.
Experiments show that for cmap, the TM does not seem to have observable
improvements at 2% mutations. For cmap search over 5% mutation, the cmap search
time of TM shows better numbers. The most significant improvement is at hmap
search, where with TM, there is around x2 or x3 speedup.

Results are shown by using test-cmap benchmark.
$ tests/ovstest test-cmap benchmark 2000 4 2 1
Benchmarking with n=200, 4 threads, 2.00% mutations, batch size 1:
 < baseline >   < TM >
cmap insert     293 ms      293 ms
cmap iterate37 ms       37 ms
batch search197 ms      186 ms
cmap destroy177 ms      166 ms

cmap insert     284 ms      283 ms
cmap iterate    38 ms       38 ms
cmap search     121 ms      120 ms *
cmap destroy    168 ms  245 ms

hmap insert     141 ms      164 ms
hmap iterate    138 ms  134 ms
hmap search     780 ms      414 ms *
hmap destroy    126 ms  122 ms

Benchmarking with n=200, 4 threads, 5.00% mutations, batch size 1:
cmap insert     296 ms      298 ms
cmap iterate38 ms       38 ms
batch search239 ms      332 ms
cmap destroy162 ms      159 ms

cmap insert     285 ms      284 ms
cmap iterate37 ms   37 ms
cmap search     143 ms      126 ms *
cmap destroy163 ms  159 ms

hmap insert     130 ms      128 ms
hmap iterate140 ms  134 ms
hmap search     1577 ms     489 ms *
hmap destroy117 ms  108 ms

Benchmarking with n=200, 4 threads, 10.00% mutations, batch size 1:
cmap insert     301 ms      295 ms
cmap iterate37 ms       37 ms
batch search355 ms  380 ms
cmap destroy148 ms  145 ms

cmap insert     286 ms      288 ms
cmap iterate37 ms       37 ms
cmap search     240 ms      133 ms *
cmap destroy146 ms  148 ms

hmap insert     133 ms      145 ms
hmap iterate139 ms  134 ms
hmap search     2087 ms     575 ms *
hmap destroy94 ms       87 ms

Benchmarking with n=200, 4 threads, 20.00% mutations, batch size 1:
cmap insert 295 ms      297 ms
cmap iterate37 ms   38 ms
batch search834 ms  568 ms
cmap destroy126 ms  124 ms

cmap insert 328 ms  283 ms
cmap iterate    37 ms   37 ms
cmap search     518 ms  164 ms *
cmap destroy    146 ms  124 ms

hmap insert     148 ms  128 ms
hmap iterate    134 ms  135 ms
hmap search     3034 ms     904 ms *
hmap destroy    60 ms       58 ms

=== Analysis of Abort rate ===
Linux Perf shows PMU counters for transactional memory as below.
$ perf record -e tx-start,tx-abort,tx-commit,tx-conflict 
The results from 'perf report' of the three TM experiments show:
  2%   5% 10%
tx-start 10K  14K 16K (count start transaction)
tx-abort  7K  13K 14K (count all aborts)
tx-commit10K  14K 16K (count commit of transactions)
tx-conflict   7K  13K 14K (count aborts due to conflict with other CPUs)

Note:
While test-cmap benchmark works fine, the patch fails a few cases
when doing "make check". Failed cases:
  717 ofproto - del group (OpenFlow 1.5), and the following 3
  816 ofproto-dpif - active-backup bonding, and 817, 818
  939 ofproto-dpif megaflow - normal, active-backup bonding, and 940, 955

Signed-off-by: William Tu 
---
 configure.ac  |   2 +
 lib/ovs-thread.c  | 107 ++
 m4/openvswitch.m4 |  21 +++
 3 files changed, 130 insertions(+)

diff --git a/configure.ac b/configure.ac
index 49aa182..5c3bd15 100644
--- a/configure.ac
+++ b/configure.ac
@@ -113,6 +113,8 @@ OVS_CHECK_PKIDIR
 OVS_CHECK_RUNDIR
 OVS_CHECK_DBDIR
 OVS_CHECK_BACKTRACE
+OVS_CHECK_RTM
+OVS_CHECK_GLIBC_TSX
 OVS_CHECK_PERF_EVENT
 OVS_CHECK_VALGRIND
 OVS_CHECK_SOCKET_LIBS
diff --git a/lib/ovs-thread.c b/lib/ovs-thread.c
index b0e10ee..6fde904 100644
--- a/lib/ovs-thread.c
+++ b/lib/ovs-thread.c
@@ -52,6 +52,110 @@ static const char *must_not_fork;
 /* True if we created any threads beyond the main initial thread. */
 static bool multithr

Re: [ovs-dev] [PATCH 2/2] ovsdb: Return NULL if prev_txn == next_txn

2016-02-22 Thread Ben Pfaff
On Mon, Feb 22, 2016 at 01:13:07AM -0800, Andy Zhou wrote:
> On Sat, Feb 20, 2016 at 8:35 AM, Liran Schour  wrote:
> 
> > In case that we flushed everything already, we can immeidately return NULL.
> >
> > Signed-off-by: Liran Schour 
> > ---
> >  ovsdb/monitor.c | 4 
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/ovsdb/monitor.c b/ovsdb/monitor.c
> > index 5ae9cdb..1a07f19 100644
> > --- a/ovsdb/monitor.c
> > +++ b/ovsdb/monitor.c
> > @@ -733,6 +733,10 @@ ovsdb_monitor_get_update(struct ovsdb_monitor *dbmon,
> >  uint64_t prev_txn = *unflushed;
> >  uint64_t next_txn = dbmon->n_transactions + 1;
> >
> > +if (prev_txn == next_txn) {
> > +return NULL;
> > +}
> > +
> >
> Thanks for reporting the issue. The change as is breaks the unit tests. But
> the optimziation
> does make sense.  After looking further, I was able to find a bug.
> 
> I have posted a patch series that fixes this bug and folded the suggested
> optimization
> (in a slightly different manner). . Would you please review them:
> 
> http://openvswitch.org/pipermail/dev/2016-February/066513.html

I don't think that's the right message reference.  Do you mean
http://openvswitch.org/pipermail/dev/2016-February/066515.html
?
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH] types: Fix defined but not used warning.

2016-02-22 Thread Ben Pfaff
On Mon, Feb 22, 2016 at 11:19:07AM +0200, Panu Matilainen wrote:
> On 02/19/2016 11:35 PM, William Tu wrote:
> >warning: ‘OVS_BE128_MAX’ defined but not used [-Wunused-const-variable]
> >Found using CentOS 6.6 with gcc 6.6.0.
> >
> >Signed-off-by: William Tu 
> 
> Just FWIW, this particular gcc 6 behavior is still under debate:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901

Hmm, interesting.

The fix is harmless, at least.
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [ovs-discuss] About QoS configuration for OpenvSwitch

2016-02-22 Thread Ben Pfaff
On Mon, Feb 22, 2016 at 09:52:46AM +, Xiao Ma (xima2) wrote:
> Could anybody tell me why the bandwidth is so unstable?

Did you read the FAQ?

### Q: I configured QoS, correctly, but my measurements show that it isn't
   working as well as I expect.

A: With the Linux kernel, the Open vSwitch implementation of QoS has
   two aspects:

   - Open vSwitch configures a subset of Linux kernel QoS
 features, according to what is in OVSDB.  It is possible that
 this code has bugs.  If you believe that this is so, then you
 can configure the Linux traffic control (QoS) stack directly
 with the "tc" program.  If you get better results that way,
 you can send a detailed bug report to b...@openvswitch.org.

 It is certain that Open vSwitch cannot configure every Linux
 kernel QoS feature.  If you need some feature that OVS cannot
 configure, then you can also use "tc" directly (or add that
 feature to OVS).

   - The Open vSwitch implementation of OpenFlow allows flows to
 be directed to particular queues.  This is pretty simple and
 unlikely to have serious bugs at this point.

   However, most problems with QoS on Linux are not bugs in Open
   vSwitch at all.  They tend to be either configuration errors
   (please see the earlier questions in this section) or issues with
   the traffic control (QoS) stack in Linux.  The Open vSwitch
   developers are not experts on Linux traffic control.  We suggest
   that, if you believe you are encountering a problem with Linux
   traffic control, that you consult the tc manpages (e.g. tc(8),
   tc-htb(8), tc-hfsc(8)), web resources (e.g. http://lartc.org/), or
   mailing lists (e.g. http://vger.kernel.org/vger-lists.html#netdev).
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH 1/3] tests: Add Autoconf 2.63 compatibility support for AS_VAR_APPEND.

2016-02-22 Thread Ben Pfaff
Reported-by: William Tu 
Signed-off-by: Ben Pfaff 
---
 tests/ovs-macros.at | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/tests/ovs-macros.at b/tests/ovs-macros.at
index bfd0681..aa2936e 100644
--- a/tests/ovs-macros.at
+++ b/tests/ovs-macros.at
@@ -153,3 +153,13 @@ on_exit () {
 mv cleanup.tmp cleanup
 }
 ])
+
+dnl Autoconf 2.64 introduced AS_VAR_APPEND, so introduce a compat version
+dnl for Autoconf 2.63.
+m4_ifndef([AS_VAR_APPEND],
+  [m4_divert_text([PREPARE_TESTS],
+[as_var_append () {
+   eval $1=\$$1\$2
+ }
+])
+   m4_define([AS_VAR_APPEND], [as_var_append $1 $2])])
-- 
2.1.3

___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH 2/3] tests: Move Autotest compatibility macros into tests directory.

2016-02-22 Thread Ben Pfaff
compat.at mixes compatibility for m4sh, which is used by Autoconf and
Autotest, with compatibility for Autotest.  It makes more sense to separate
them.  This moves the Autotest-only compatibility macros into an Autotest
specific file.

Signed-off-by: Ben Pfaff 
---
 m4/compat.at| 15 ---
 tests/ovs-macros.at | 21 +++--
 2 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/m4/compat.at b/m4/compat.at
index 736f1ff..78da7a9 100644
--- a/m4/compat.at
+++ b/m4/compat.at
@@ -12,21 +12,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-m4_ifndef([AT_CHECK_UNQUOTED],
-  [m4_define([AT_CHECK_UNQUOTED],
-  [_AT_CHECK([$1], [$2], AS_ESCAPE(m4_dquote(m4_expand([$3])), [""]),
-AS_ESCAPE(m4_dquote(m4_expand([$4])),[""]), [$5], [$6])])])
-
-m4_ifndef([AT_SKIP_IF],
-  [m4_define([AT_SKIP_IF],
-[AT_CHECK([($1) \
-&& exit 77 || exit 0], [0], [ignore], [ignore])])])
-
-m4_ifndef([AT_FAIL_IF],
-  [m4_define([AT_FAIL_IF],
-[AT_CHECK([($1) \
-&& exit 99 || exit 0], [0], [ignore], [ignore])])])
-
 m4_ifndef([AS_VAR_COPY],
   [m4_define([AS_VAR_COPY],
 [AS_LITERAL_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])])])
diff --git a/tests/ovs-macros.at b/tests/ovs-macros.at
index aa2936e..f09af4e 100644
--- a/tests/ovs-macros.at
+++ b/tests/ovs-macros.at
@@ -154,8 +154,7 @@ on_exit () {
 }
 ])
 
-dnl Autoconf 2.64 introduced AS_VAR_APPEND, so introduce a compat version
-dnl for Autoconf 2.63.
+dnl Autoconf 2.63 compatibility verison of macro introduced in Autoconf 2.64:
 m4_ifndef([AS_VAR_APPEND],
   [m4_divert_text([PREPARE_TESTS],
 [as_var_append () {
@@ -163,3 +162,21 @@ m4_ifndef([AS_VAR_APPEND],
  }
 ])
m4_define([AS_VAR_APPEND], [as_var_append $1 $2])])
+
+dnl Autoconf 2.63 compatibility verison of macro introduced in Autoconf 2.64:
+m4_ifndef([AT_CHECK_UNQUOTED],
+  [m4_define([AT_CHECK_UNQUOTED],
+  [_AT_CHECK([$1], [$2], AS_ESCAPE(m4_dquote(m4_expand([$3])), [""]),
+AS_ESCAPE(m4_dquote(m4_expand([$4])),[""]), [$5], [$6])])])
+
+dnl Autoconf 2.63 compatibility verison of macro introduced in Autoconf 2.64:
+m4_ifndef([AT_SKIP_IF],
+  [m4_define([AT_SKIP_IF],
+[AT_CHECK([($1) \
+&& exit 77 || exit 0], [0], [ignore], [ignore])])])
+
+dnl Autoconf 2.63 compatibility verison of macro introduced in Autoconf 2.64:
+m4_ifndef([AT_FAIL_IF],
+  [m4_define([AT_FAIL_IF],
+[AT_CHECK([($1) \
+&& exit 99 || exit 0], [0], [ignore], [ignore])])])
-- 
2.1.3

___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH] autoconf: Fix missing AS_VAR_APPEND for version 2.63.

2016-02-22 Thread Ben Pfaff
On Wed, Feb 17, 2016 at 06:00:21PM -0800, William Tu wrote:
> autoconf version 2.63 does not have AS_VAR_APPEND, resulting errors below:
> tests/testsuite.tmp:3863: error: possibly undefined macro: AS_VAR_APPEND
>   If this token and others are legitimate, please use m4_pattern_allow.
>   See the Autoconf documentation.
>   make[2]: *** [tests/testsuite] Error 1
> 
> Signed-off-by: William Tu 

Thanks for pointing out the problem, I'd forgotten about the need for
backward compatibility here.

However, this implementation is going to bite us eventually because it
doesn't allow for polymorphic variable names, as in
e.g. AS_VAR_APPEND([var$n], [123]).

I sent out an alternative series, can you test it with Autoconf 2.63?
Thanks.

My series is:
https://patchwork.ozlabs.org/patch/586442/
https://patchwork.ozlabs.org/patch/586443/
https://patchwork.ozlabs.org/patch/586444/

Thanks,

Ben.
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH] gcc: Fix compile errors due to anonymous union initilization.

2016-02-22 Thread Ben Pfaff
On Wed, Feb 17, 2016 at 06:00:22PM -0800, William Tu wrote:
> gcc 4.4.7 lets you initialize named fields, and assign to anonymous union 
> members,
> but cannot statically initialize a named member of an anonymous union. This 
> causes
> errors when doing make:
> fproto/fail-open.c: In function ‘send_bogus_packet_ins’:
> ofproto/fail-open.c:130: error: unknown field ‘pin’ specified in initializer
> ofproto/fail-open.c:131: error: unknown field ‘up’ specified in initializer
> ofproto/fail-open.c:132: error: unknown field ‘packet’ specified in 
> initializer
> ofproto/fail-open.c:132: warning: missing braces around initializer
> ofproto/fail-open.c:132: warning: (near initialization for 
> ‘am..pin.up’)
> ofproto/fail-open.c:134: error: extra brace group at end of initializer
> 
> Examaple: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42875
> We can either assign a name to the union or, in this patch, remove the 
> unnecessary union.
> 
> Signed-off-by: William Tu 

Well, that's going to bite us again.

Thanks for the patch.  Applied!
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH 3/3] m4: Rename compat.at to compat.m4.

2016-02-22 Thread Ben Pfaff
This is used by both Autoconf and Autotest, so it doesn't make sense for
it to have a .at (Autotest) extension.

Signed-off-by: Ben Pfaff 
---
 m4/{compat.at => compat.m4} | 0
 m4/openvswitch.m4   | 4 ++--
 tests/ovs-macros.at | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
 rename m4/{compat.at => compat.m4} (100%)

diff --git a/m4/compat.at b/m4/compat.m4
similarity index 100%
rename from m4/compat.at
rename to m4/compat.m4
diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4
index 0149c30..3a579f2 100644
--- a/m4/openvswitch.m4
+++ b/m4/openvswitch.m4
@@ -1,6 +1,6 @@
 # -*- autoconf -*-
 
-# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc.
+# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Nicira, 
Inc.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-m4_include([m4/compat.at])
+m4_include([m4/compat.m4])
 
 dnl Checks for --enable-coverage and updates CFLAGS and LDFLAGS appropriately.
 AC_DEFUN([OVS_CHECK_COVERAGE],
diff --git a/tests/ovs-macros.at b/tests/ovs-macros.at
index f09af4e..f2923b0 100644
--- a/tests/ovs-macros.at
+++ b/tests/ovs-macros.at
@@ -2,7 +2,7 @@ AT_TESTED([ovs-vswitchd])
 AT_TESTED([ovs-vsctl])
 AT_TESTED([perl])
 
-m4_include([m4/compat.at])
+m4_include([m4/compat.m4])
 
 dnl Make AT_SETUP automatically run the ovs_init() shell function
 dnl as the first step in every test.
-- 
2.1.3

___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH 2/2] ovsdb: Return NULL if prev_txn == next_txn

2016-02-22 Thread Andy Zhou
On Mon, Feb 22, 2016 at 9:28 AM, Ben Pfaff  wrote:

> On Mon, Feb 22, 2016 at 01:13:07AM -0800, Andy Zhou wrote:
> > On Sat, Feb 20, 2016 at 8:35 AM, Liran Schour  wrote:
> >
> > > In case that we flushed everything already, we can immeidately return
> NULL.
> > >
> > > Signed-off-by: Liran Schour 
> > > ---
> > >  ovsdb/monitor.c | 4 
> > >  1 file changed, 4 insertions(+)
> > >
> > > diff --git a/ovsdb/monitor.c b/ovsdb/monitor.c
> > > index 5ae9cdb..1a07f19 100644
> > > --- a/ovsdb/monitor.c
> > > +++ b/ovsdb/monitor.c
> > > @@ -733,6 +733,10 @@ ovsdb_monitor_get_update(struct ovsdb_monitor
> *dbmon,
> > >  uint64_t prev_txn = *unflushed;
> > >  uint64_t next_txn = dbmon->n_transactions + 1;
> > >
> > > +if (prev_txn == next_txn) {
> > > +return NULL;
> > > +}
> > > +
> > >
> > Thanks for reporting the issue. The change as is breaks the unit tests.
> But
> > the optimziation
> > does make sense.  After looking further, I was able to find a bug.
> >
> > I have posted a patch series that fixes this bug and folded the suggested
> > optimization
> > (in a slightly different manner). . Would you please review them:
> >
> > http://openvswitch.org/pipermail/dev/2016-February/066513.html
>
> I don't think that's the right message reference.  Do you mean
> http://openvswitch.org/pipermail/dev/2016-February/066515.html
> ?
>
Yes. Thanks for the correction.
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH] netdev-dpdk: Do not add vhost-user ports with '/' or '\' in name.

2016-02-22 Thread Daniele Di Proietto
This check prevents an obvious way for a vhost-user socket to escape the
intended directory.

There might be other ways to escape the directory (none comes to mind at
the moment), but this is a problem that should be properly solved by
mandatory access control.

A similar check is done for a bridge name, since that name is used as
part of a socket as well.

Signed-off-by: Daniele Di Proietto 
---
v2:
* Do not check for '..', as this doesn't really create a problem
* Document restriction in INSTALL.DPDK.md
* Also check for backward slash
* Drop next patch that unlinks the socket before creating it.  As pointed
  out by Ansis, it enables users deleting other sockets (db or management)
  in the run directory
---
 INSTALL.DPDK.md   |  3 ++-
 lib/netdev-dpdk.c | 16 ++--
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/INSTALL.DPDK.md b/INSTALL.DPDK.md
index a19a685..c98de69 100644
--- a/INSTALL.DPDK.md
+++ b/INSTALL.DPDK.md
@@ -508,7 +508,8 @@ Adding DPDK vhost-user ports to the Switch:
 
 Following the steps above to create a bridge, you can now add DPDK vhost-user
 as a port to the vswitch. Unlike DPDK ring ports, DPDK vhost-user ports can
-have arbitrary names.
+have arbitrary names, except that forward and backward slashes are prohibited
+in the names.
 
   -  For vhost-user, the name of the port type is `dpdkvhostuser`
 
diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index e4f789b..2e27adf 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -677,14 +677,26 @@ static int
 netdev_dpdk_vhost_user_construct(struct netdev *netdev_)
 {
 struct netdev_dpdk *netdev = netdev_dpdk_cast(netdev_);
+const char *name = netdev_->name;
 int err;
 
+/* 'name' is appended to 'vhost_sock_dir' and used to create a socket in
+ * the file system. '/' or '\' would traverse directories, so they're not
+ * acceptable in 'name'. */
+if (strchr(name, '/') || strchr(name, '\\')) {
+VLOG_ERR("\"%s\" is not a valid name for a vhost-user port. "
+ "A valid name must not include '/' or '\\'",
+ name);
+return EINVAL;
+}
+
 ovs_mutex_lock(&dpdk_mutex);
 /* Take the name of the vhost-user port and append it to the location where
  * the socket is to be created, then register the socket.
  */
 snprintf(netdev->vhost_id, sizeof(netdev->vhost_id), "%s/%s",
-vhost_sock_dir, netdev_->name);
+ vhost_sock_dir, name);
+
 err = rte_vhost_driver_register(netdev->vhost_id);
 if (err) {
 VLOG_ERR("vhost-user socket device setup failure for socket %s\n",
@@ -692,7 +704,7 @@ netdev_dpdk_vhost_user_construct(struct netdev *netdev_)
 } else {
 fatal_signal_add_file_to_unlink(netdev->vhost_id);
 VLOG_INFO("Socket %s created for vhost-user port %s\n",
-  netdev->vhost_id, netdev_->name);
+  netdev->vhost_id, name);
 err = vhost_construct_helper(netdev_);
 }
 
-- 
2.1.4

___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH 2/3] netdev-dpdk: Do not add vhost-user ports with '/' in name.

2016-02-22 Thread Daniele Di Proietto


On 22/02/2016 08:57, "Ben Pfaff"  wrote:

>On Fri, Feb 05, 2016 at 11:40:11AM -0800, Ben Pfaff wrote:
>> On Thu, Feb 04, 2016 at 03:42:34AM +, Daniele Di Proietto wrote:
>> > 
>> > 
>> > On 03/02/2016 14:47, "Ben Pfaff"  wrote:
>> > 
>> > >On Tue, Feb 02, 2016 at 05:56:35PM -0800, Daniele Di Proietto wrote:
>> > >> This check prevents an obvious way for a vhost-user socket to
>>escape the
>> > >> intended directory.
>> > >> 
>> > >> There might be other ways to escape the directory (none comes to
>>mind at
>> > >> the moment), but this is a problem that should be properly solved
>>by
>> > >> mandatory access control.
>> > >> 
>> > >> A similar check is done for a bridge name, since that name is used
>>as
>> > >> part of a socket as well.
>> > >> 
>> > >> Signed-off-by: Daniele Di Proietto 
>> > >
>> > >I am not sure whether the restriction for .. is necessary.  Do you
>>have
>> > >something in mind there?
>> > 
>> > The difference between here and the bridge management socket is that
>>here
>> > we have no suffix.  A vhost user port named .. should have a socket in
>> > "/var/run/openvswitch/.."
>> > 
>> > It will not be possible to create a socket like this nor to remove the
>> > directory (I believe unlink should refuse to remove directories), but
>>I
>> > thought it was better to check for this and fail early with a better
>> > error message rather that try to create/unlink an invalid path.
>> > 
>> > Now that I think about it the name "." has the same problem.
>> >  
>> > What do you think?
>> 
>> I think that both unlink and bind for . and .. will yield an error, and
>> I think that the cause will be pretty obvious, so I don't see a need for
>> the special case.
>
>Hi Daniele, are you planning to send a v2 for this patch?  I think that
>we should definitely address it.

Hi Ben,

You're right, I sent a v2 here:

http://openvswitch.org/pipermail/dev/2016-February/066556.html

Thanks

___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [Partial-Update-Map-Columns 1/7] Add Initial code for Partial-map-columns functionality

2016-02-22 Thread Lutz, Arnoldo
This commit adds some definitions and skeleton functions to start working.
Ovsdb tests run and pass ok.

Signed-off-by: arnoldo.lutz.guev...@hpe.com 
---
2   0   lib/ovsdb-idl-provider.h
31  3   lib/ovsdb-idl.c
7   0   lib/ovsdb-idl.h
 lib/ovsdb-idl-provider.h |  2 ++
 lib/ovsdb-idl.c  | 34 +++---
 lib/ovsdb-idl.h  |  7 +++
 3 files changed, 40 insertions(+), 3 deletions(-)

diff --git a/lib/ovsdb-idl-provider.h b/lib/ovsdb-idl-provider.h
index 190acca..96a9ba8 100644
--- a/lib/ovsdb-idl-provider.h
+++ b/lib/ovsdb-idl-provider.h
@@ -41,6 +41,8 @@ struct ovsdb_idl_row {
 unsigned int change_seqno[OVSDB_IDL_CHANGE_MAX];
 struct ovs_list track_node; /* Rows modified/added/deleted by IDL */
 unsigned long int *updated; /* Bitmap of columns updated by IDL */
+
+unsigned long int *partial_maps; /* Bitmap of columns containing partial 
maps */
 };
 
 struct ovsdb_idl_column {
diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c
index 4cb1c81..28ebdb3 100644
--- a/lib/ovsdb-idl.c
+++ b/lib/ovsdb-idl.c
@@ -2524,7 +2524,8 @@ ovsdb_idl_txn_complete(struct ovsdb_idl_txn *txn,
 static void
 ovsdb_idl_txn_write__(const struct ovsdb_idl_row *row_,
   const struct ovsdb_idl_column *column,
-  struct ovsdb_datum *datum, bool owns_datum)
+  struct ovsdb_datum *datum, bool owns_datum,
+  bool partial_map)
 {
 struct ovsdb_idl_row *row = CONST_CAST(struct ovsdb_idl_row *, row_);
 const struct ovsdb_idl_table_class *class;
@@ -2581,6 +2582,12 @@ ovsdb_idl_txn_write__(const struct ovsdb_idl_row *row_,
 } else {
 bitmap_set1(row->written, column_idx);
 }
+/* If the datum contains a partial map of the column, set the corresponding
+ * bit in the bitmap so it can be handle accordingly in 
ovsdb_idl_txn_commit
+ */
+if (partial_map) {
+bitmap_set1(row->partial_maps, column_idx);
+}
 if (owns_datum) {
 row->new[column_idx] = *datum;
 } else {
@@ -2601,7 +2608,7 @@ ovsdb_idl_txn_write(const struct ovsdb_idl_row *row,
 const struct ovsdb_idl_column *column,
 struct ovsdb_datum *datum)
 {
-ovsdb_idl_txn_write__(row, column, datum, true);
+ovsdb_idl_txn_write__(row, column, datum, true, false);
 }
 
 void
@@ -2610,7 +2617,7 @@ ovsdb_idl_txn_write_clone(const struct ovsdb_idl_row *row,
   const struct ovsdb_datum *datum)
 {
 ovsdb_idl_txn_write__(row, column,
-  CONST_CAST(struct ovsdb_datum *, datum), false);
+  CONST_CAST(struct ovsdb_datum *, datum), false, 
false);
 }
 
 /* Causes the original contents of 'column' in 'row_' to be verified as a
@@ -3197,3 +3204,24 @@ ovsdb_idl_loop_commit_and_wait(struct ovsdb_idl_loop 
*loop)
 
 ovsdb_idl_wait(loop->idl);
 }
+
+/* Skeleton functions needed to handle partial for map_columns
+ * This functions must be moved to a better place when finished implementation
+ *
+ */
+void
+ovsdb_idl_txn_write_partial_map(const struct ovsdb_idl_row *row,
+const struct ovsdb_idl_column *column,
+struct ovsdb_datum *datum)
+{
+ovsdb_idl_txn_write__(row, column, datum, true, true);
+}
+
+void
+ovsdb_idl_txn_delete_partial_map(const struct ovsdb_idl_row *row,
+const struct ovsdb_idl_column *column,
+struct ovsdb_datum *datum)
+{
+return;
+}
+
diff --git a/lib/ovsdb-idl.h b/lib/ovsdb-idl.h
index 136c38c..9b8df57 100644
--- a/lib/ovsdb-idl.h
+++ b/lib/ovsdb-idl.h
@@ -249,7 +249,14 @@ void ovsdb_idl_txn_write(const struct ovsdb_idl_row *,
 void ovsdb_idl_txn_write_clone(const struct ovsdb_idl_row *,
const struct ovsdb_idl_column *,
const struct ovsdb_datum *);
+void ovsdb_idl_txn_write_partial_map(const struct ovsdb_idl_row *,
+const struct ovsdb_idl_column *,
+struct ovsdb_datum *);
+void ovsdb_idl_txn_delete_partial_map(const struct ovsdb_idl_row *,
+const struct ovsdb_idl_column *,
+struct ovsdb_datum *);
 void ovsdb_idl_txn_delete(const struct ovsdb_idl_row *);
+
 const struct ovsdb_idl_row *ovsdb_idl_txn_insert(
 struct ovsdb_idl_txn *, const struct ovsdb_idl_table_class *,
 const struct uuid *);
-- 
1.9.1
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [Partial-Update-Map-Columns 0/7] Add Initial code for Partia-map-columns funtionality

2016-02-22 Thread Lutz, Arnoldo
In the current implementation, every time an element of either a map or
set column has to be modified, the entire content of the column is
sent to the server to be updated. This is not a major problem if the
information contained in the column for the corresponding row is small,
but there are cases where these columns can have a significant amount of
elements per row or the frequency at which these values are updated is
high that making the cost of the modifications to become high in terms
of time and bandwidth.

In this solution, the ovsdb-idl code is modified to use mutate
operation, already implemented in the server code, to allow that kind
of partial modifications on map columns. The functionality is exposed
to clients in the vswitch idl.

Arnoldo Lutz (3):
  Add code to create partial map functions in autogenerated code
  Add documentation on how to use partial update of map columns
  Adds usage help on command to test of partial update of map column

Edward Aymerich (3):
  Add functionality to skeleton functions for Partial Map Update
  Add and correct functionality of Partial Update Map Columns
  Add fixes, improvements, refactors and cleans code

 Makefile.am  |   1 +
 PARTIAL-UPDATE-MAP-COLUMN.md |  64 
 lib/automake.mk  |   3 +-
 lib/ovsdb-idl-provider.h |   6 ++-
 lib/ovsdb-idl.c  | 296 
+--
 lib/ovsdb-map-op.c   | 171 
+
 lib/ovsdb-map-op.h   |  45 +++
 ovsdb/ovsdb-idlc.in  |  69 +++
 tests/idltest.ovsschema  |  24 +++-
 tests/idltest2.ovsschema |  24 +++-
 tests/ovsdb-idl.at   |  34 +
 tests/test-ovsdb.c   | 110 
++-
 12 files changed, 821 insertions(+), 26 deletions(-)


Arnoldo Lutz - Outsourced Contractor
Software Engineer
R&D, HP Networking Group
arnoldo.lutz.guev...@hpe.com
Heredia
Costa Rica



Please print thoughtfully


___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH 5/7] Add documentation on how to use partial update of map columns

2016-02-22 Thread Lutz, Arnoldo
Add file PARTIAL-UPDATE-MAP-COLUMN.md with a description on the way to
use this feature.
Modifies Makefile.am to include documentation in distribution list

Signed-off-by: arnoldo.lutz.guev...@hpe.com 
---
 Makefile.am  |  1 +
 PARTIAL-UPDATE-MAP-COLUMN.md | 64 
 2 files changed, 65 insertions(+)
 create mode 100644 PARTIAL-UPDATE-MAP-COLUMN.md

diff --git a/Makefile.am b/Makefile.am
index 75ccadf..6ca55c9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -86,6 +86,7 @@ docs = \
IntegrationGuide.md \
MAINTAINERS.md \
OPENFLOW-1.1+.md \
+   PARTIAL-UPDATE-MAP-COLUMN.md \
PORTING.md \
README.md \
README-lisp.md \
diff --git a/PARTIAL-UPDATE-MAP-COLUMN.md b/PARTIAL-UPDATE-MAP-COLUMN.md
new file mode 100644
index 000..062c3cb
--- /dev/null
+++ b/PARTIAL-UPDATE-MAP-COLUMN.md
@@ -0,0 +1,64 @@
+# Partial update of map columns #
+
+New functions are created in `vswitch-idl.c` that can be used to modify
+individual elements in map columns in tables. The function generator
+automatically detects when the table contains a map column and generates the
+corresponding functions to insert, update and delete the elements given a
+key/value information.
+
+## How to use this feature ##
+
+The functions that handle this feature are named using the following format:
+```
+ovsrec__update__setkey()
+```
+and
+```
+ovsrec__update__delkey()
+```
+
+These functions take as parameters the row, the key to act on and the value (in
+set functions only). The `_setkey()` functions can be used to insert a new
+value (if the key doesn't exists in the map) or to update a value (if the key
+already exists in the map). As an example, these are the generated functions to
+modify the `external_ids` map column in the `controller` table:
+```
+void ovsrec_controller_update_external_ids_setkey(const struct 
ovsrec_controller *row_to_modify, char *new_key, char *new_value);
+
+void ovsrec_controller_update_external_ids_delkey(const struct 
ovsrec_controller *row_to_modify, char *key_to_delete);
+```
+
+As usual, tables and columns must be registered in order to get rights to
+read/write the columns as shown below:
+```
+ovsdb_idl_add_table(idl, &ovsrec_table_bridge);
+ovsdb_idl_add_column(idl, &ovsrec_bridge_col_other_config);
+ovsdb_idl_add_column(idl, &ovsrec_bridge_col_external_ids);
+```
+
+And the functions must be called in the middle of a transaction like this:
+```
+myRow = ovsrec_bridge_first(idl);
+myTxn = ovsdb_idl_txn_create(idl);
+
+other = ovsrec_bridge_get_other_config(myRow, OVSDB_TYPE_STRING, 
OVSDB_TYPE_STRING);
+ovsrec_bridge_update_other_config_setkey(myRow, other->keys[0].string, 
"myList1");
+ovsrec_bridge_update_external_ids_setkey(myRow, "ids2", "myids2");
+
+ovsdb_idl_txn_commit_block(myTxn);
+ovsdb_idl_txn_destroy(myTxn);
+```
+
+Similarly, for deleting an element of a map column, the corresponding function
+call is:
+```
+myRow = ovsrec_bridge_first(idl);
+myTxn = ovsdb_idl_txn_create(idl);
+
+other = ovsrec_bridge_get_other_config(myRow, OVSDB_TYPE_STRING, 
OVSDB_TYPE_STRING);
+ovsrec_bridge_update_other_config_delkey(myRow, other->keys[0].string);
+ovsrec_bridge_update_external_ids_delkey(myRow, "ids2");
+
+ovsdb_idl_txn_commit_block(myTxn);
+ovsdb_idl_txn_destroy(myTxn);
+```
-- 
1.9.1
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH 7/7] Adds usage help on command to test of partial update of map column

2016-02-22 Thread Lutz, Arnoldo
---
 tests/test-ovsdb.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tests/test-ovsdb.c b/tests/test-ovsdb.c
index 0ad03bd..8c7aedd 100644
--- a/tests/test-ovsdb.c
+++ b/tests/test-ovsdb.c
@@ -197,7 +197,11 @@ usage(void)
"connect to SERVER and dump the contents of the database\n"
"as seen initially by the IDL implementation and after\n"
"executing each TRANSACTION.  (Each TRANSACTION must modify\n"
-   "the database or this command will hang.)\n",
+   "the database or this command will hang.)\n"
+   "  idl-partial-update-map-column SERVER \n"
+   "connect to SERVER and executes different operations to\n"
+   "test the capacity of updating elements inside a map column\n"
+   "displaying the information on the table after each 
operation.\n",
program_name, program_name);
 vlog_usage();
 printf("\nOther options:\n"
-- 
1.9.1
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH 3/7] Add code to create partial map functions in autogenerated code

2016-02-22 Thread Lutz, Arnoldo
Code inserted that autogenerates corresponding map functions to set and
delete elements in map columns.
Inserts description to the functions that are autogenerated.
Changes on autogenerated functions

Signed-off-by: arnoldo.lutz.guev...@hpe.com 
---
 ovsdb/ovsdb-idlc.in | 69 +
 1 file changed, 69 insertions(+)

diff --git a/ovsdb/ovsdb-idlc.in b/ovsdb/ovsdb-idlc.in
index 26b0de4..0d75113 100755
--- a/ovsdb/ovsdb-idlc.in
+++ b/ovsdb/ovsdb-idlc.in
@@ -216,6 +216,13 @@ bool %(s)s_is_updated(const struct %(s)s *, enum 
%(s)s_column_id);
 print '%s);' % ', '.join(args)
 
 print
+for columnName, column in sorted(table.columns.iteritems()):
+ if column.type.is_map():
+print 'void %(s)s_update_%(c)s_setkey(const struct %(s)s *, ' 
% {'s': structName, 'c': columnName},
+print '%(coltype)s, %(valtype)s);' % 
{'coltype':column.type.key.toCType(prefix), 
'valtype':column.type.value.toCType(prefix)}
+print 'void %(s)s_update_%(c)s_delkey(const struct %(s)s *, ' 
% {'s': structName, 'c': columnName},
+print '%(coltype)s);' % 
{'coltype':column.type.key.toCType(prefix)}
+print
 
 # Table indexes.
 printEnum("%stable_id" % prefix.lower(), ["%sTABLE_%s" % (prefix.upper(), 
tableName.upper()) for tableName in sorted(schema.tables)] + ["%sN_TABLES" % 
prefix.upper()])
@@ -746,6 +753,68 @@ const struct ovsdb_datum *
'S': structName.upper(),
'C': columnName.upper()}
 print "}"
+# Update/Delete of partial map column functions
+for columnName, column in sorted(table.columns.iteritems()):
+type = column.type
+if type.is_map():
+print '''
+/* Sets an element of the "%(c)s" map column from the "%(t)s" table in 'row'
+ * to 'new_value' given the key value 'new_key'.
+ *
+ */
+void
+%(s)s_update_%(c)s_setkey(const struct %(s)s *row, %(coltype)snew_key, 
%(valtype)snew_value)
+{
+struct ovsdb_datum *datum;
+
+ovs_assert(inited);
+
+datum = xmalloc(sizeof *datum);
+datum->n = 1;
+datum->keys = xmalloc(datum->n * sizeof *datum->keys);
+datum->values = xmalloc(datum->n * sizeof *datum->values);
+''' % {'s': structName, 'c': 
columnName,'coltype':column.type.key.toCType(prefix), 
+'valtype':column.type.value.toCType(prefix), 'S': structName.upper(),
+'C': columnName.upper(), 't': tableName}
+
+print ""+ type.key.copyCValue("datum->keys[0].%s" % 
type.key.type.to_string(), "new_key")
+print ""+ type.value.copyCValue("datum->values[0].%s" % 
type.value.type.to_string(), "new_value")
+print '''
+ovsdb_idl_txn_write_partial_map(&row->header_,
+&%(s)s_columns[%(S)s_COL_%(C)s],
+datum);
+}''' % {'s': structName, 'c': 
columnName,'coltype':column.type.key.toCType(prefix), 
+'valtype':column.type.value.toCType(prefix), 'S': structName.upper(),
+'C': columnName.upper()}
+print '''
+/* Deletes an element of the "%(c)s" map column from the "%(t)s" table in 'row'
+ * given the key value 'delete_key'.
+ *
+ */
+void
+%(s)s_update_%(c)s_delkey(const struct %(s)s *row, %(coltype)sdelete_key)
+{
+struct ovsdb_datum *datum;
+
+ovs_assert(inited);
+
+datum = xmalloc(sizeof *datum);
+datum->n = 1;
+datum->keys = xmalloc(datum->n * sizeof *datum->keys);
+datum->values = NULL;
+''' % {'s': structName, 'c': 
columnName,'coltype':column.type.key.toCType(prefix), 
+'valtype':column.type.value.toCType(prefix), 'S': structName.upper(),
+'C': columnName.upper(), 't': tableName}
+
+print ""+ type.key.copyCValue("datum->keys[0].%s" % 
type.key.type.to_string(), "delete_key")
+print '''
+ovsdb_idl_txn_delete_partial_map(&row->header_,
+&%(s)s_columns[%(S)s_COL_%(C)s],
+datum);
+}''' % {'s': structName, 'c': 
columnName,'coltype':column.type.key.toCType(prefix), 
+'valtype':column.type.value.toCType(prefix), 'S': structName.upper(),
+'C': columnName.upper()}
+# End Update/Delete of partial maps
 
 # Table columns.
 print "\nstruct ovsdb_idl_column %s_columns[%s_N_COLUMNS];" % (
-- 
1.9.1

___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [Partial-Update-Map-Columns 2/7] Add functionality to skeleton functions for Partial Map Update

2016-02-22 Thread Lutz, Arnoldo

Modified ovsdb_idl_row structure to include information on partial map updates,
which will be used to create mutate operations on map columns when the
transaction is committed.

Also filled out generic (skeleton) functions to populate partial map update
information on the row when a map is partially written or partially deleted.

Clear PMU lists when a row is deleted

Row's lists of Partial Map Updates are now cleared and deleted when such row is
deleted.

Add row to transaction's list on PMU

When a Partial Map Update is requested, the modified row is added to the
transaction's list of rows, so a mutate operation could be generated on commit.

Remove partial_map from ovsdb_idl_txn_writte__()

Removes parameter 'partial_map' from ovsdb_idl_txn_writte__() function, because
it is no longer needed there. Partial Map Updates are now handle in separate
code, that doesn't disrupt the inner working of transaction writes nor other
operation generations during commits.

Clear PMULs when transaction finish

Clear all Partial Map Update Lists when the transaction is finished.

Also fixes logic for making operations for one row in commits.

Signed-off-by: Edward Aymerich 
---
21  1   lib/ovsdb-idl-provider.h
237 16  lib/ovsdb-idl.c
 lib/ovsdb-idl-provider.h |  22 -
 lib/ovsdb-idl.c  | 253 ---
 2 files changed, 258 insertions(+), 17 deletions(-)

diff --git a/lib/ovsdb-idl-provider.h b/lib/ovsdb-idl-provider.h
index 96a9ba8..e788597 100644
--- a/lib/ovsdb-idl-provider.h
+++ b/lib/ovsdb-idl-provider.h
@@ -23,6 +23,25 @@
 #include "shash.h"
 #include "uuid.h"
 
+enum pmu_operation {
+PMU_UPDATE,
+PMU_INSERT,
+PMU_DELETE
+};
+
+/* PMU: Partial Map Update */
+struct pmu {
+struct ovsdb_datum *new_datum;
+enum pmu_operation operation;
+struct pmu *next;
+};
+
+/* PMUL: Partial Map Update List */
+struct pmul {
+struct pmu *first;
+struct pmu *last;
+};
+
 struct ovsdb_idl_row {
 struct hmap_node hmap_node; /* In struct ovsdb_idl_table's 'rows'. */
 struct uuid uuid;   /* Row "_uuid" field. */
@@ -42,7 +61,8 @@ struct ovsdb_idl_row {
 struct ovs_list track_node; /* Rows modified/added/deleted by IDL */
 unsigned long int *updated; /* Bitmap of columns updated by IDL */
 
-unsigned long int *partial_maps; /* Bitmap of columns containing partial 
maps */
+unsigned long int *partial_map_written; /* Bitmap of columns containing 
partial maps */
+struct pmul **partial_map_lists; /* List of lists of partial updates. */
 };
 
 struct ovsdb_idl_column {
diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c
index 28ebdb3..7c11c64 100644
--- a/lib/ovsdb-idl.c
+++ b/lib/ovsdb-idl.c
@@ -203,6 +203,16 @@ ovsdb_idl_table_from_class(const struct ovsdb_idl *,
const struct ovsdb_idl_table_class *);
 static bool ovsdb_idl_track_is_set(struct ovsdb_idl_table *table);
 
+
+void ovsdb_idl_txn_create_pmu(struct ovsdb_idl_row *,
+  const struct ovsdb_idl_column *,
+  struct ovsdb_datum *,
+   enum pmu_operation);
+void ovsdb_idl_txn_add_pmu(struct ovsdb_idl_row *,
+   const struct ovsdb_idl_column *,
+   struct pmu *);
+void pmul_clear(struct pmul *, const struct ovsdb_type *);
+
 /* Creates and returns a connection to database 'remote', which should be in a
  * form acceptable to jsonrpc_session_open().  The connection will maintain an
  * in-memory replica of the remote database whose schema is described by
@@ -1557,10 +1567,33 @@ ovsdb_idl_row_create(struct ovsdb_idl_table *table, 
const struct uuid *uuid)
 hmap_insert(&table->rows, &row->hmap_node, uuid_hash(uuid));
 row->uuid = *uuid;
 row->table = table;
+row->partial_map_written = NULL;
+row->partial_map_lists = NULL;
 return row;
 }
 
 static void
+ovsdb_idl_destroy_all_pmuls(struct ovsdb_idl_row *row){
+if (row->partial_map_written) {
+/* Clear PMULs */
+size_t idx, n_columns;
+const struct ovsdb_idl_column *columns;
+const struct ovsdb_type *type;
+n_columns = row->table->class->n_columns;
+columns = row->table->class->columns;
+BITMAP_FOR_EACH_1 (idx, n_columns, row->partial_map_written) {
+type = &columns[idx].type;
+pmul_clear(row->partial_map_lists[idx], type);
+free(row->partial_map_lists[idx]);
+}
+free(row->partial_map_lists);
+bitmap_free(row->partial_map_written);
+row->partial_map_lists = NULL;
+row->partial_map_written = NULL;
+}
+}
+
+static void
 ovsdb_idl_row_destroy(struct ovsdb_idl_row *row)
 {
 if (row) {
@@ -1574,6 +1607,7 @@ ovsdb_idl_row_destroy(struct ovsdb_idl_row *row)
 if (list_is_empty(&row->track_node)) {
 list_push_front(&row->table->track_list, &row->track_node);
 }
+ovsd

[ovs-dev] [PATCH 4/7] Add and correct functionality of Partial Update Map Columns

2016-02-22 Thread Lutz, Arnoldo
Several memory management errors were fixed. Also, some wrong uses of pointers
that produced segmentation faults were fixed.

Refactored code into separate files

Code for Partial Map Updates and Partial Map Update Lists was extracted into
separate files, and the inner contents of structs pmu and pmul was
encapsulated.

Verifies that column is monitored

Verifies that column is monitored before attempting to do a partial map update.

Change PMUs linked lists to hash maps

Change internal structure of PMUL from linked lists to hash maps. This will be
needed to make fast lookups of previous modifications to the same key.

Signed-off-by: Edward Aymerich 
---
 lib/automake.mk  |   3 +-
 lib/ovsdb-idl-provider.h |  20 +---
 lib/ovsdb-idl.c  | 242 ---
 lib/ovsdb-pmu.c  | 117 +++
 lib/ovsdb-pmu.h  |  44 +
 5 files changed, 269 insertions(+), 157 deletions(-)
 create mode 100644 lib/ovsdb-pmu.c
 create mode 100644 lib/ovsdb-pmu.h

diff --git a/lib/automake.mk b/lib/automake.mk
index 27a1669..770ce72 100644
--- a/lib/automake.mk
+++ b/lib/automake.mk
@@ -187,6 +187,8 @@ lib_libopenvswitch_la_SOURCES = \
lib/ovsdb-idl.h \
lib/ovsdb-parser.c \
lib/ovsdb-parser.h \
+   lib/ovsdb-pmu.c \
+   lib/ovsdb-pmu.h \
lib/ovsdb-types.c \
lib/ovsdb-types.h \
lib/packets.c \
@@ -515,4 +517,3 @@ lib-install-data-local:
$(MKDIR_P) $(DESTDIR)$(PKIDIR)
$(MKDIR_P) $(DESTDIR)$(LOGDIR)
$(MKDIR_P) $(DESTDIR)$(DBDIR)
-
diff --git a/lib/ovsdb-idl-provider.h b/lib/ovsdb-idl-provider.h
index e788597..0851c11 100644
--- a/lib/ovsdb-idl-provider.h
+++ b/lib/ovsdb-idl-provider.h
@@ -20,28 +20,10 @@
 #include "list.h"
 #include "ovsdb-idl.h"
 #include "ovsdb-types.h"
+#include "ovsdb-pmu.h"
 #include "shash.h"
 #include "uuid.h"
 
-enum pmu_operation {
-PMU_UPDATE,
-PMU_INSERT,
-PMU_DELETE
-};
-
-/* PMU: Partial Map Update */
-struct pmu {
-struct ovsdb_datum *new_datum;
-enum pmu_operation operation;
-struct pmu *next;
-};
-
-/* PMUL: Partial Map Update List */
-struct pmul {
-struct pmu *first;
-struct pmu *last;
-};
-
 struct ovsdb_idl_row {
 struct hmap_node hmap_node; /* In struct ovsdb_idl_table's 'rows'. */
 struct uuid uuid;   /* Row "_uuid" field. */
diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c
index 7c11c64..ff5e26a 100644
--- a/lib/ovsdb-idl.c
+++ b/lib/ovsdb-idl.c
@@ -203,15 +203,10 @@ ovsdb_idl_table_from_class(const struct ovsdb_idl *,
const struct ovsdb_idl_table_class *);
 static bool ovsdb_idl_track_is_set(struct ovsdb_idl_table *table);
 
-
-void ovsdb_idl_txn_create_pmu(struct ovsdb_idl_row *,
-  const struct ovsdb_idl_column *,
-  struct ovsdb_datum *,
-   enum pmu_operation);
 void ovsdb_idl_txn_add_pmu(struct ovsdb_idl_row *,
const struct ovsdb_idl_column *,
-   struct pmu *);
-void pmul_clear(struct pmul *, const struct ovsdb_type *);
+   struct ovsdb_datum *,
+   enum pmu_operation);
 
 /* Creates and returns a connection to database 'remote', which should be in a
  * form acceptable to jsonrpc_session_open().  The connection will maintain an
@@ -1583,8 +1578,7 @@ ovsdb_idl_destroy_all_pmuls(struct ovsdb_idl_row *row){
 columns = row->table->class->columns;
 BITMAP_FOR_EACH_1 (idx, n_columns, row->partial_map_written) {
 type = &columns[idx].type;
-pmul_clear(row->partial_map_lists[idx], type);
-free(row->partial_map_lists[idx]);
+pmul_destroy(row->partial_map_lists[idx], type);
 }
 free(row->partial_map_lists);
 bitmap_free(row->partial_map_written);
@@ -2280,81 +2274,7 @@ ovsdb_idl_txn_commit(struct ovsdb_idl_txn *txn)
 HMAP_FOR_EACH (row, txn_node, &txn->txn_rows) {
 const struct ovsdb_idl_table_class *class = row->table->class;
 
-if (row->partial_map_written &&
-bitmap_count1(row->partial_map_written, class->n_columns) > 0) {
-/* Add Partial Map Updates (mutate ops) */
-struct json *op, *mutations;
-size_t idx;
-
-op = json_object_create();
-json_object_put_string(op, "op", "mutate");
-json_object_put_string(op, "table", class->name);
-json_object_put(op, "where", where_uuid_equals(&row->uuid));
-mutations = json_array_create_empty();
-
-BITMAP_FOR_EACH_1(idx, class->n_columns,
-  row->partial_map_written) {
-struct pmul *pmul = row->partial_map_lists[idx];
-const struct ovsdb_idl_column *column = &class->columns[idx];
-enum ovsdb_atomic_type key_type; /*value_type;*/
-

[ovs-dev] [PATCH 6/7] Add fixes, improvements, refactors and cleans code

2016-02-22 Thread Lutz, Arnoldo
Added delta calculations for PMUs

Added additional checks to make sure that only one update operation is
performed on each key for each transaction. If several update operations are
issued by the client, these are resolved and only one is applied on commit.

Delayed operation validity checks until commit, because doing these validations
when an operation is added could lead to inconsistent results when multiple
operations are performed on the same key.

Improves JSON generation for PMUs

Improves JSON generation by grouping together all delete mutations into one
single mutation for each row, which shortens overall JSON message length. A
similar improvement is applied to insert mutations.

Code was cleaned up as well (deleted dead code, commented complex functions).

Add code to test for partial update map column

Insert basic funtionality for testing partial update column
and add a new test table named "simple2"
Tests running ok
Insert the code for testing this feature.
Add extra conditions to testing partial updates.
Clean compilation warnings.
Clean code

Added warning when trying to delete a missing key

Set txn_sdd_pmu() as static

Function ovsdb_idl_txn_add_pmu() will only be used inside this file, therefore
it ts better to make it static.

Re-factor code to make txn_commit() cleaner.

Change pmu structure name to map_op

The name 'pmu' doesn't match the coding guidelines for OVS. It is changed to
'map_op' which is more descriptive of the structure function (which is to
perform a partial update operation on a map). Other structure, function and
file names were changed accordingly.

Signed-off-by: Edward Aymerich 
---
 lib/automake.mk  |   4 +-
 lib/ovsdb-idl-provider.h |   8 +-
 lib/ovsdb-idl.c  | 305 +--
 lib/ovsdb-map-op.c   | 171 ++
 lib/ovsdb-map-op.h   |  45 +++
 lib/ovsdb-pmu.c  | 117 --
 lib/ovsdb-pmu.h  |  44 ---
 ovsdb/ovsdb-idlc.in  |   8 +-
 tests/idltest.ovsschema  |  24 +++-
 tests/idltest2.ovsschema |  24 +++-
 tests/ovsdb-idl.at   |  34 ++
 tests/test-ovsdb.c   | 104 
 12 files changed, 596 insertions(+), 292 deletions(-)
 create mode 100644 lib/ovsdb-map-op.c
 create mode 100644 lib/ovsdb-map-op.h
 delete mode 100644 lib/ovsdb-pmu.c
 delete mode 100644 lib/ovsdb-pmu.h

diff --git a/lib/automake.mk b/lib/automake.mk
index 770ce72..f8e1c43 100644
--- a/lib/automake.mk
+++ b/lib/automake.mk
@@ -185,10 +185,10 @@ lib_libopenvswitch_la_SOURCES = \
lib/ovsdb-idl-provider.h \
lib/ovsdb-idl.c \
lib/ovsdb-idl.h \
+   lib/ovsdb-map-op.c \
+   lib/ovsdb-map-op.h \
lib/ovsdb-parser.c \
lib/ovsdb-parser.h \
-   lib/ovsdb-pmu.c \
-   lib/ovsdb-pmu.h \
lib/ovsdb-types.c \
lib/ovsdb-types.h \
lib/packets.c \
diff --git a/lib/ovsdb-idl-provider.h b/lib/ovsdb-idl-provider.h
index 0851c11..f265dcd 100644
--- a/lib/ovsdb-idl-provider.h
+++ b/lib/ovsdb-idl-provider.h
@@ -20,7 +20,7 @@
 #include "list.h"
 #include "ovsdb-idl.h"
 #include "ovsdb-types.h"
-#include "ovsdb-pmu.h"
+#include "ovsdb-map-op.h"
 #include "shash.h"
 #include "uuid.h"
 
@@ -37,14 +37,14 @@ struct ovsdb_idl_row {
 unsigned long int *prereqs; /* Bitmap of columns to verify in "old". */
 unsigned long int *written; /* Bitmap of columns from "new" to write. */
 struct hmap_node txn_node;  /* Node in ovsdb_idl_txn's list. */
+unsigned long int *map_op_written; /* Bitmap of columns with pending map
+* operations. */
+struct map_op_list **map_op_lists; /* List of lists of map operations. */
 
 /* Tracking data */
 unsigned int change_seqno[OVSDB_IDL_CHANGE_MAX];
 struct ovs_list track_node; /* Rows modified/added/deleted by IDL */
 unsigned long int *updated; /* Bitmap of columns updated by IDL */
-
-unsigned long int *partial_map_written; /* Bitmap of columns containing 
partial maps */
-struct pmul **partial_map_lists; /* List of lists of partial updates. */
 };
 
 struct ovsdb_idl_column {
diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c
index ff5e26a..ae09c5c 100644
--- a/lib/ovsdb-idl.c
+++ b/lib/ovsdb-idl.c
@@ -190,6 +190,12 @@ static void ovsdb_idl_row_clear_arcs(struct ovsdb_idl_row 
*, bool destroy_dsts);
 static void ovsdb_idl_txn_abort_all(struct ovsdb_idl *);
 static bool ovsdb_idl_txn_process_reply(struct ovsdb_idl *,
 const struct jsonrpc_msg *msg);
+static bool ovsdb_idl_txn_extract_mutations(struct ovsdb_idl_row *,
+struct json *);
+static void ovsdb_idl_txn_add_map_op(struct ovsdb_idl_row *,
+ const struct ovsdb_idl_column *,
+ struct ovsdb_datum *,
+ enum map_op_type);
 
 static void ovsdb_idl_send_lock_request(st

Re: [ovs-dev] [PATCH 05/14] json.at: Run for Python 2 and 3.

2016-02-22 Thread Russell Bryant
On Mon, Feb 22, 2016 at 11:35 AM, Ben Pfaff  wrote:

> On Tue, Feb 02, 2016 at 05:36:47PM -0500, Russell Bryant wrote:
> > Run json.at tests for both Python 2 and 3 if available.
> >
> > Signed-off-by: Russell Bryant 
>
> The new comment here is nice:
> > +# JSON_CHECK_POSITIVE_PY(TITLE, INPUT, OUTPUT, TEST-JSON-ARGS,
> > +#PYTHON-CHCEK, PYTHON-BIN)
> > +#
>
> ...and so it would be nice to have a similar new comment here:
>

Good idea, I added it.


> >  m4_define([JSON_CHECK_NEGATIVE_PY],
> >[AT_SETUP([$1])
> > AT_KEYWORDS([json negative Python])
> > -   AT_SKIP_IF([test $HAVE_PYTHON = no])
> > +   AT_SKIP_IF([test $5 = no])
> > AT_CHECK([printf %s "AS_ESCAPE([$2])" > input])
> > AT_CAPTURE_FILE([input])
> > -   AT_CHECK([$PYTHON $srcdir/test-json.py $4 input], [1], [stdout], [])
> > +   AT_CHECK([$6 $srcdir/test-json.py $4 input], [1], [stdout], [])
> > AT_CHECK([[sed 's/^error: [^:]*:/error:/' < stdout]], [0], [$3
> >  ])
> > AT_CLEANUP])
>
> Acked-by: Ben Pfaff 
>



-- 
Russell Bryant
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH 04/14] check-structs.at: Run for both Python 2 and 3.

2016-02-22 Thread Russell Bryant
On Mon, Feb 22, 2016 at 11:53 AM, Ben Pfaff  wrote:

> On Tue, Feb 02, 2016 at 05:36:46PM -0500, Russell Bryant wrote:
> > Update the tests in check-structs.at to run with both Python 2 and 3 if
> > available.  The check-structs script is written in Python, though does
> > not use the ovs Python library.  The script did require fixes in a
> > previous commit to make it Python 3 compatible, so this ensures that
> > compatibility remains.
> >
> > Signed-off-by: Russell Bryant 
>
> With all patches applied, on top of commit b1e04512f7150AA9 (from
> roughly when you posted the patches) I'm getting several errors from
> flake8 regarding check-structs:
>
> ../build-aux/check-structs:70:24: F821 undefined name 'inputFile'
> ../build-aux/check-structs:71:17: F821 undefined name 'lineNumber'
> ../build-aux/check-structs:73:40: F821 undefined name 'inputFile'
> ../build-aux/check-structs:77:40: F821 undefined name 'fileName'
> ../build-aux/check-structs:77:50: F821 undefined name 'inputFile'
> ../build-aux/check-structs:94:23: F821 undefined name 'fileName'
> ../build-aux/check-structs:94:33: F821 undefined name 'lineNumber'
> ../build-aux/check-structs:101:48: F821 undefined name 'fileName'
> ../build-aux/check-structs:101:58: F821 undefined name 'lineNumber'
> ../build-aux/check-structs:111:36: E711 comparison to None should be 'if
> cond is not None:'
>
> I'm using flake8 for Python2, version 2.2.2.
>
> Any ideas?  I haven't investigated yet, except to note that the
> final complaint about comparison to None is correct.
>

I don't get any of those with:

$ flake8 --version
2.5.1 (pep8: 1.6.2, flake8-docstrings: 0.2.4, pep257: 0.7.0, hacking.core:
0.0.1, ProxyChecker: 0.0.1, pyflakes: 1.0.0, mccabe: 0.3.1) CPython 2.7.10
on Linux

The last one does look right.  The rest appear to be flake8 not
understanding 'global'.  Maybe upgrading flake8 would help.  However, I
think I'm just going to drop the two patches related to
build-aux/check-structs.  There's some other Python scripts I ended up not
touching.  The build system would never run this with Python 3.

This would only matter if we update the build system to run everything with
Python 3 if that is installed and Python 2 is not (the default for some
distros these days).  That would require work on several scripts, so this
could just be picked up then.

-- 
Russell Bryant
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH 00/14] Finish support for Python 3.

2016-02-22 Thread Russell Bryant
On Mon, Feb 22, 2016 at 11:55 AM, Ben Pfaff  wrote:

> On Tue, Feb 02, 2016 at 05:36:42PM -0500, Russell Bryant wrote:
> > This is this final series for Python 3 support.  It refactors the test
> suite to
> > run Python tests against both Python 2 and 3.
>
> You can consider all of these to have my ack:
> Acked-by: Ben Pfaff 
> except where I specifically followed up.
>

Thanks, I applied 12 of the 14 patches to master.  I dropped the patches
related to check-structs that gave you flake8 trouble, as they're really
not important right now anyway.

-- 
Russell Bryant
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] (no subject)

2016-02-22 Thread Edward J. Marto
Message from Jeffrey Skoll owner of Skoll Philanthropic Foundation for his 
charity donation and You have been selected as benefactor for $5Million Dollars 
.for more information contact Via email  ally00...@yandex.com. Rainer Roh




This electronic message is intended to be for the use only of the named 
recipient, and may contain information that is confidential or privileged.  If 
you are not the intended recipient, you are hereby notified that any 
disclosure, copying, distribution or use of the contents of this message is 
strictly prohibited.  If you have received this message in error or are not the 
named recipient, please notify us immediately by contacting the sender at the 
electronic mail address noted above, and delete and destroy all copies of this 
message.  Thank you.
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH 04/14] check-structs.at: Run for both Python 2 and 3.

2016-02-22 Thread Ben Pfaff
On Mon, Feb 22, 2016 at 03:16:15PM -0500, Russell Bryant wrote:
> On Mon, Feb 22, 2016 at 11:53 AM, Ben Pfaff  wrote:
> 
> > On Tue, Feb 02, 2016 at 05:36:46PM -0500, Russell Bryant wrote:
> > > Update the tests in check-structs.at to run with both Python 2 and 3 if
> > > available.  The check-structs script is written in Python, though does
> > > not use the ovs Python library.  The script did require fixes in a
> > > previous commit to make it Python 3 compatible, so this ensures that
> > > compatibility remains.
> > >
> > > Signed-off-by: Russell Bryant 
> >
> > With all patches applied, on top of commit b1e04512f7150AA9 (from
> > roughly when you posted the patches) I'm getting several errors from
> > flake8 regarding check-structs:
> >
> > ../build-aux/check-structs:70:24: F821 undefined name 'inputFile'
> > ../build-aux/check-structs:71:17: F821 undefined name 'lineNumber'
> > ../build-aux/check-structs:73:40: F821 undefined name 'inputFile'
> > ../build-aux/check-structs:77:40: F821 undefined name 'fileName'
> > ../build-aux/check-structs:77:50: F821 undefined name 'inputFile'
> > ../build-aux/check-structs:94:23: F821 undefined name 'fileName'
> > ../build-aux/check-structs:94:33: F821 undefined name 'lineNumber'
> > ../build-aux/check-structs:101:48: F821 undefined name 'fileName'
> > ../build-aux/check-structs:101:58: F821 undefined name 'lineNumber'
> > ../build-aux/check-structs:111:36: E711 comparison to None should be 'if
> > cond is not None:'
> >
> > I'm using flake8 for Python2, version 2.2.2.
> >
> > Any ideas?  I haven't investigated yet, except to note that the
> > final complaint about comparison to None is correct.
> >
> 
> I don't get any of those with:
> 
> $ flake8 --version
> 2.5.1 (pep8: 1.6.2, flake8-docstrings: 0.2.4, pep257: 0.7.0, hacking.core:
> 0.0.1, ProxyChecker: 0.0.1, pyflakes: 1.0.0, mccabe: 0.3.1) CPython 2.7.10
> on Linux
> 
> The last one does look right.  The rest appear to be flake8 not
> understanding 'global'.  Maybe upgrading flake8 would help.  However, I
> think I'm just going to drop the two patches related to
> build-aux/check-structs.  There's some other Python scripts I ended up not
> touching.  The build system would never run this with Python 3.
> 
> This would only matter if we update the build system to run everything with
> Python 3 if that is installed and Python 2 is not (the default for some
> distros these days).  That would require work on several scripts, so this
> could just be picked up then.

That all sounds OK.  Thanks.
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH 1/1] vtep:Add error messages for logical router support

2016-02-22 Thread Dennis Sam
Documents error codes that a Hardware Switch Controller can publish to the NVC 
to
indicate errors related to the provisioning of logical routers.

Acked-by: Anupam Chanda 

---
 Vtep/vtep.xml | 22 ++
 1 file changed, 22 insertions(+)

diff --git a/vtep/vtep.xml b/vtep/vtep.xml
Index 7112111..66a26d5 100644
--- a/vtep/vtep.xml
+++ b/vtep/vtep.xml
@@ -310,6 +310,28 @@
 Requested by the NVC due to lack of resources.
   
 
+  
+Indicates that the switch has been unable to create the logical router
+interfaces requested by the NVC due to conflicting configurations or a 
lack
+of hardware resources.
+  
+
+  
+Indicates that the switch has been unable to create the static routes
+requested by the NVC due to conflicting configurations or a lack of 
hardware
+resources.
+  
+
+  
+Indicates that the switch has been unable to create the logical router
+requested by the NVC due to conflicting configurations or a lack of 
hardware
+resources.
+  
+
+  
+Indicates that the switch does not support logical routing.
+  
+
   
 indicates that an error has occurred in the switch but that no
 More specific information is available.
-- 
1.8.1.4

___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH V5 1/2] netdev-dpdk: clean up mbuf initialization

2016-02-22 Thread Flavio Leitner
On Fri, 19 Feb 2016 11:25:11 +
Mark Kavanagh  wrote:

> Current mbuf initialization relies on magic numbers and does not
> accomodate mbufs of different sizes.
> 
> Resolve this issue by ensuring that mbufs are always aligned to a 1k
> boundary (a typical DPDK NIC Rx buffer alignment).
> 
> Signed-off-by: Mark Kavanagh 
> ---
>  lib/netdev-dpdk.c | 87 
> +++
>  1 file changed, 42 insertions(+), 45 deletions(-)

Acked-by: Flavio Leitner 

Thanks,
-- 
fbl

___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH V5 2/2] netdev-dpdk: add jumbo frame support

2016-02-22 Thread Flavio Leitner
On Fri, 19 Feb 2016 11:25:12 +
Mark Kavanagh  wrote:

> Add support for Jumbo Frames to DPDK-enabled port types,
> using single-segment-mbufs.
> 
> Using this approach, the amount of memory allocated for each mbuf
> to store frame data is increased to a value greater than 1518B
> (typical Ethernet maximum frame length). The increased space
> available in the mbuf means that an entire Jumbo Frame can be carried
> in a single mbuf, as opposed to partitioning it across multiple mbuf
> segments.
> 
> The amount of space allocated to each mbuf to hold frame data is
> defined dynamically by the user when adding a DPDK port to a bridge.
> If an MTU value is not supplied, or the user-supplied value is invalid,
> the MTU for the port defaults to standard Ethernet MTU (i.e. 1500B).
> 
> Signed-off-by: Mark Kavanagh 
> ---
>  INSTALL.DPDK.md   |  60 -
>  NEWS  |   3 +-
>  lib/netdev-dpdk.c | 248 
> +-
>  3 files changed, 233 insertions(+), 78 deletions(-)
> 
> diff --git a/INSTALL.DPDK.md b/INSTALL.DPDK.md
> index d892788..4ca98cb 100644
> --- a/INSTALL.DPDK.md
> +++ b/INSTALL.DPDK.md
> @@ -878,10 +878,63 @@ by adding the following string:
>  to  sections of all network devices used by DPDK. Parameter 'N'
>  determines how many queues can be used by the guest.
>  
> +Jumbo Frames
> +
> +
> +Support for Jumbo Frames may be enabled at run-time for DPDK-type ports.
> +
> +To avail of Jumbo Frame support, add the 'mtu_request' option to the 
> ovs-vsctl
> +'add-port' command-line, along with the required MTU for the port.
> +e.g.
> +
> + ```
> + ovs-vsctl add-port br0 dpdk0 -- set Interface dpdk0 type=dpdk 
> options:mtu_request=9000
> + ```
> +
> +When Jumbo Frames are enabled, the size of a DPDK port's mbuf segments are
> +increased, such that a full Jumbo Frame may be accommodated inside a single
> +mbuf segment. Once set, the MTU for a DPDK port is immutable.
> +
> +Note that from an OVSDB perspective, the `mtu_request` option for a specific
> +port may be disregarded once initially set, as subsequent modifications to 
> this
> +field are disregarded by the DPDK port. As with non-DPDK ports, the MTU of 
> DPDK
> +ports is reported by the `Interface` table's 'mtu' field.
> +
> +Jumbo frame support has been validated against 13312B frames, using the
> +DPDK `igb_uio` driver, but larger frames and other DPDK NIC drivers may
> +theoretically be supported. Supported port types excludes vHost-Cuse ports, 
> as
> +that feature is pending deprecation.
> +
> +vHost Ports and Jumbo Frames
> +
> +Jumbo frame support is available for DPDK vHost-User ports only. Some 
> additional
> +configuration is needed to take advantage of this feature:
> +
> +  1. `mergeable buffers` must be enabled for vHost ports, as demonstrated in
> +  the QEMU command line snippet below:
> +
> +  ```
> +  '-netdev type=vhost-user,id=mynet1,chardev=char0,vhostforce \'
> +  '-device 
> virtio-net-pci,mac=00:00:00:00:00:01,netdev=mynet1,mrg_rxbuf=on'
> +  ```
> +
> +  2. Where virtio devices are bound to the Linux kernel driver in a guest
> + environment (i.e. interfaces are not bound to an in-guest DPDK driver), 
> the
> + MTU of those logical network interfaces must also be increased. This
> + avoids segmentation of Jumbo Frames in the guest. Note that 'MTU' refers
> + to the length of the IP packet only, and not that of the entire frame.
> +
> + e.g. To calculate the exact MTU of a standard IPv4 frame, subtract the 
> L2
> + header and CRC lengths (i.e. 18B) from the max supported frame size.
> + So, to set the MTU for a 13312B Jumbo Frame:
> +
> +  ```
> +  ifconfig eth1 mtu 13294
> +  ```
> +
>  Restrictions:
>  -
>  
> -  - Work with 1500 MTU, needs few changes in DPDK lib to fix this issue.
>- Currently DPDK port does not make use any offload functionality.
>- DPDK-vHost support works with 1G huge pages.
>  
> @@ -922,6 +975,11 @@ Restrictions:
>  the next release of DPDK (which includes the above patch) is available 
> and
>  integrated into OVS.
>  
> +  Jumbo Frames:
> +  - `virtio-pmd`: DPDK apps in the guest do not exit gracefully. This is a 
> DPDK
> + issue that is currently being investigated.
> +  - vHost-Cuse: Jumbo Frame support is not available for vHost Cuse ports.
> +
>  Bug Reporting:
>  --
>  
> diff --git a/NEWS b/NEWS
> index 3e33871..43127f9 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -10,10 +10,11 @@ Post-v2.5.0
> - DPDK:
>   * New option "n_rxq" for PMD interfaces.
> Old 'other_config:n-dpdk-rxqs' is no longer supported.
> + * Support Jumbo Frames
> +
> - ovs-benchmark: This utility has been removed due to lack of use and
>   bitrot.
>  
> -
>  v2.5.0 - xx xxx 
>  -
> - Dropped support for Python older than version 2.7.  As a consequence,
> diff -

Re: [ovs-dev] [PATCH 1/1] vtep:Add error messages for logical router support

2016-02-22 Thread Justin Pettit
Thanks for the contribution.  Can you add yourself to the AUTHORS file?  Also, 
can I get your Signed-off-by?  By giving that, you are agreeing to to the 
Developer's Certificate of Origin:

https://github.com/openvswitch/ovs/blob/master/CONTRIBUTING.md

--Justin


> On Feb 22, 2016, at 2:53 PM, Dennis Sam  wrote:
> 
> Documents error codes that a Hardware Switch Controller can publish to the 
> NVC to
> indicate errors related to the provisioning of logical routers.
> 
> Acked-by: Anupam Chanda 
> 
> ---
> Vtep/vtep.xml | 22 ++
> 1 file changed, 22 insertions(+)
> 
> diff --git a/vtep/vtep.xml b/vtep/vtep.xml
> Index 7112111..66a26d5 100644
> --- a/vtep/vtep.xml
> +++ b/vtep/vtep.xml
> @@ -310,6 +310,28 @@
> Requested by the NVC due to lack of resources.
>   
> 
> +  
> +Indicates that the switch has been unable to create the logical 
> router
> +interfaces requested by the NVC due to conflicting configurations or 
> a lack
> +of hardware resources.
> +  
> +
> +  
> +Indicates that the switch has been unable to create the static routes
> +requested by the NVC due to conflicting configurations or a lack of 
> hardware
> +resources.
> +  
> +
> +  
> +Indicates that the switch has been unable to create the logical 
> router
> +requested by the NVC due to conflicting configurations or a lack of 
> hardware
> +resources.
> +  
> +
> +  
> +Indicates that the switch does not support logical routing.
> +  
> +
>   
> indicates that an error has occurred in the switch but that no
> More specific information is available.
> -- 
> 1.8.1.4
> 
> ___
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev

___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH 7/9] Move lib/ofpbuf.h to include/openvswitch directory

2016-02-22 Thread ben
From: Ben Warren 

Signed-off-by: Ben Warren 
---
 include/openvswitch/automake.mk |   1 +
 include/openvswitch/ofpbuf.h| 277 
 lib/automake.mk |   1 -
 lib/bfd.c   |   2 +-
 lib/bundle.c|   2 +-
 lib/dpctl.c |   2 +-
 lib/dpif-netdev.c   |   2 +-
 lib/dpif-netlink.c  |   2 +-
 lib/dpif.c  |   2 +-
 lib/jsonrpc.c   |   2 +-
 lib/learn.c |   2 +-
 lib/learning-switch.c   |   2 +-
 lib/netdev-dummy.c  |   2 +-
 lib/netdev-linux.c  |   2 +-
 lib/netdev-windows.c|   2 +-
 lib/netlink-conntrack.c |   2 +-
 lib/netlink-conntrack.h |   2 +-
 lib/netlink-notifier.c  |   2 +-
 lib/netlink-socket.c|   2 +-
 lib/netlink-socket.h|   2 +-
 lib/netlink.c   |   2 +-
 lib/nx-match.c  |   2 +-
 lib/odp-util.c  |   2 +-
 lib/ofp-actions.c   |   2 +-
 lib/ofp-errors.c|   2 +-
 lib/ofp-msgs.c  |   2 +-
 lib/ofp-parse.c |   2 +-
 lib/ofp-print.c |   2 +-
 lib/ofp-prop.c  |   2 +-
 lib/ofp-util.c  |   2 +-
 lib/ofpbuf.c|   2 +-
 lib/ofpbuf.h| 275 ---
 lib/rconn.c |   2 +-
 lib/route-table.c   |   2 +-
 lib/rstp-state-machines.c   |   2 +-
 lib/rstp.c  |   2 +-
 lib/rtnetlink.c |   3 +-
 lib/stp.c   |   2 +-
 lib/stream-ssl.c|   2 +-
 lib/stream.c|   2 +-
 lib/tnl-ports.c |   2 +-
 lib/tun-metadata.h  |   2 +-
 lib/vconn-stream.c  |   2 +-
 lib/vconn.c |   2 +-
 lib/vlog.c  |   2 +-
 ofproto/bond.c  |   4 +-
 ofproto/bundles.c   |   2 +-
 ofproto/connmgr.c   |   2 +-
 ofproto/fail-open.c |   2 +-
 ofproto/in-band.c   |   2 +-
 ofproto/netflow.c   |   2 +-
 ofproto/ofproto-dpif-ipfix.c|   2 +-
 ofproto/ofproto-dpif-monitor.c  |   2 +-
 ofproto/ofproto-dpif-rid.c  |   2 +-
 ofproto/ofproto-dpif-sflow.c|   2 +-
 ofproto/ofproto-dpif-upcall.c   |   2 +-
 ofproto/ofproto-dpif-xlate.h|   2 +-
 ofproto/ofproto-dpif.c  |   2 +-
 ofproto/ofproto.c   |   2 +-
 ofproto/pinsched.c  |   2 +-
 ofproto/tunnel.c|   2 +-
 ovn/controller/lflow.c  |   2 +-
 ovn/controller/ofctrl.c |   2 +-
 ovn/controller/physical.c   |   2 +-
 ovn/lib/actions.c   |   2 +-
 tests/test-bundle.c |   2 +-
 tests/test-flows.c  |   2 +-
 tests/test-list.c   |   1 +
 tests/test-netflow.c|   2 +-
 tests/test-odp.c|   2 +-
 tests/test-ofpbuf.c |   2 +-
 tests/test-ovn.c|   2 +-
 tests/test-rstp.c   |   2 +-
 tests/test-sflow.c  |   2 +-
 tests/test-stp.c|   2 +-
 tests/test-vconn.c  |   2 +-
 utilities/nlmon.c   |   2 +-
 utilities/ovs-ofctl.c   |   2 +-
 utilities/ovs-testcontroller.c  |   2 +-
 vswitchd/bridge.c   |   2 +-
 vswitchd/system-stats.c |   2 +-
 81 files changed, 357 insertions(+), 353 deletions(-)
 create mode 100644 include/openvswitch/ofpbuf.h
 delete mode 100644 lib/ofpbuf.h

diff --git a/include/openvswitch/automake.mk b/include/openvswitch/automake.mk
index a6343d2..67c164d 100644
--- a/include/openvswitch/automake.mk
+++ b/include/openvswitch/automake.mk
@@ -4,6 +4,7 @@ openvswitchinclude_HEADERS = \
include/openvswitch/dynamic-string.h \
include/openvswitch/geneve.h \
include/openvswitch/list.h \
+   include/openvswitch/ofpbuf.h \
include/openvswitch/ofp-errors.h \
include/openvswitch/ofp-parse.h \
include/openvswitch/thread.h \
diff --git a/include/openvswitch/ofpbuf.h b/include/openvswitch/ofpbuf.h
new file mode 100644
index 000..5cfdd94
--- /dev/null
+++ b/include/openvswitch/ofpbuf.h
@@ -0,0 +1,277 @@
+/*
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2015, 2016 Nicira, 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 u

[ovs-dev] [PATCH 6/9] Move lib/dynamic-string.h to include/openvswitch directory

2016-02-22 Thread ben
From: Ben Warren 

Signed-off-by: Ben Warren 
---
 include/openvswitch/automake.mk   |  1 +
 include/openvswitch/dynamic-string.h  | 93 +++
 lib/automake.mk   |  1 -
 lib/backtrace.h   |  2 +-
 lib/bfd.c |  2 +-
 lib/bundle.c  |  2 +-
 lib/cfm.c |  2 +-
 lib/classifier.c  |  2 +-
 lib/command-line.c|  2 +-
 lib/coverage.c|  2 +-
 lib/db-ctl-base.c |  2 +-
 lib/db-ctl-base.h |  2 +-
 lib/dp-packet.c   |  2 +-
 lib/dpctl.c   |  2 +-
 lib/dpif-netdev.c |  2 +-
 lib/dpif-netlink.c|  2 +-
 lib/dpif.c|  2 +-
 lib/dynamic-string.c  |  2 +-
 lib/dynamic-string.h  | 93 ---
 lib/flow.c|  2 +-
 lib/json.c|  2 +-
 lib/jsonrpc.c |  2 +-
 lib/lacp.c|  2 +-
 lib/learn.c   |  2 +-
 lib/match.c   |  2 +-
 lib/memory.c  |  2 +-
 lib/meta-flow.c   |  2 +-
 lib/multipath.c   |  2 +-
 lib/netdev-bsd.c  |  2 +-
 lib/netdev-dummy.c|  2 +-
 lib/netdev-linux.c|  2 +-
 lib/netdev-vport.c|  2 +-
 lib/netdev.c  |  2 +-
 lib/netlink-conntrack.c   |  2 +-
 lib/netlink-conntrack.h   |  2 +-
 lib/netlink-socket.c  |  2 +-
 lib/nx-match.c|  2 +-
 lib/odp-util.c|  2 +-
 lib/ofp-actions.c |  2 +-
 lib/ofp-errors.c  |  2 +-
 lib/ofp-msgs.c|  2 +-
 lib/ofp-parse.c   |  2 +-
 lib/ofp-print.c   |  2 +-
 lib/ofp-util.c|  2 +-
 lib/ofp-version-opt.c |  2 +-
 lib/ofpbuf.c  |  2 +-
 lib/ovs-lldp.c|  2 +-
 lib/ovs-router.c  |  2 +-
 lib/ovsdb-data.c  |  2 +-
 lib/ovsdb-error.c |  2 +-
 lib/ovsdb-idl.c   |  2 +-
 lib/ovsdb-types.c |  2 +-
 lib/packets.c |  2 +-
 lib/perf-counter.c|  2 +-
 lib/poll-loop.c   |  2 +-
 lib/process.c |  2 +-
 lib/socket-util.c |  2 +-
 lib/stream-ssl.c  |  2 +-
 lib/stream-tcp.c  |  2 +-
 lib/stream.c  |  2 +-
 lib/svec.c|  2 +-
 lib/syslog-direct.c   |  2 +-
 lib/syslog-libc.c |  2 +-
 lib/table.c   |  2 +-
 lib/timeval.c |  2 +-
 lib/tnl-neigh-cache.c |  2 +-
 lib/tnl-ports.c   |  2 +-
 lib/tun-metadata.h|  2 +-
 lib/unicode.c |  2 +-
 lib/unixctl.c |  2 +-
 lib/vconn.c   |  2 +-
 lib/vlog.c|  2 +-
 ofproto/bond.c|  2 +-
 ofproto/connmgr.c |  2 +-
 ofproto/ofproto-dpif-upcall.c |  2 +-
 ofproto/ofproto-dpif-xlate.c  |  2 +-
 ofproto/ofproto-dpif.c|  2 +-
 ofproto/ofproto.c |  2 +-
 ofproto/tunnel.c  |  2 +-
 ovn/controller-vtep/ovn-controller-vtep.c |  2 +-
 ovn/controller/chassis.c  |  2 +-
 ovn/controller/lflow.c|  2 +-
 ovn/controller/ofctrl.c   |  2 +-
 ovn/controller/ovn-controller.c   |  2 +-
 ovn/lib/actions.c |  2 +-
 ovn/lib/expr.c|  2 +-
 ovn/lib/lex.c |  2 +-
 ovn/northd/ovn-northd.c   |  2 +-
 ovn/utilities/ovn-sbctl.c |  2 +-
 ovsdb/column.c|  2 +-
 ovsdb/jsonrpc-server.c|  2 +-
 ovsdb/monitor.c   |  2 +-
 ovsdb/ovsdb-client.c  |  2 +-
 ovsdb/ovsdb-server.c  |  2 +-
 ovsdb/ovsdb-tool.c|  2 +-
 ovsdb/row.c   |  2 

[ovs-dev] [PATCH 5/9] Remove lib/list.h completely

2016-02-22 Thread ben
From: Ben Warren 

All code is now in include/openvswitch/list.h

Signed-off-by: Ben Warren 
---
 lib/automake.mk   |  1 -
 lib/bfd.c |  2 +-
 lib/dp-packet.h   |  2 +-
 lib/dpif-netdev.c |  2 +-
 lib/fat-rwlock.c  |  2 +-
 lib/fat-rwlock.h  |  2 +-
 lib/guarded-list.h|  2 +-
 lib/jsonrpc.c |  2 +-
 lib/list.h| 23 ---
 lib/lldp/aa-structs.h |  2 +-
 lib/lldp/lldpd.c  |  2 +-
 lib/lldp/lldpd.h  |  2 +-
 lib/mac-learning.c|  2 +-
 lib/mac-learning.h|  2 +-
 lib/mcast-snooping.c  |  2 +-
 lib/mcast-snooping.h  |  2 +-
 lib/netdev-dpdk.c |  2 +-
 lib/netdev-dummy.c|  2 +-
 lib/netdev-provider.h |  2 +-
 lib/netdev-vport.c|  2 +-
 lib/netdev.c  |  2 +-
 lib/netlink-notifier.h|  2 +-
 lib/ofp-util.h|  2 +-
 lib/ofpbuf.h  |  2 +-
 lib/ovs-lldp.c|  2 +-
 lib/ovs-lldp.h|  2 +-
 lib/ovs-numa.c|  2 +-
 lib/ovs-numa.h|  2 +-
 lib/ovs-rcu.c |  2 +-
 lib/ovs-thread.c  |  2 +-
 lib/ovsdb-idl-provider.h  |  2 +-
 lib/poll-loop.c   |  2 +-
 lib/process.c |  2 +-
 lib/rstp-common.h |  2 +-
 lib/rtbsd.h   |  2 +-
 lib/seq.c |  2 +-
 lib/tnl-ports.c   |  2 +-
 lib/unixctl.c |  2 +-
 ofproto/bond.c|  2 +-
 ofproto/connmgr.h |  2 +-
 ofproto/ofproto-dpif-ipfix.c  |  2 +-
 ofproto/ofproto-dpif-rid.h|  2 +-
 ofproto/ofproto-dpif-upcall.c |  2 +-
 ofproto/ofproto-dpif-xlate.c  |  2 +-
 ofproto/ofproto-provider.h|  2 +-
 ovn/lib/expr.h|  2 +-
 ovsdb/ovsdb-server.c  |  2 +-
 ovsdb/ovsdb.h |  2 +-
 ovsdb/row.h   |  2 +-
 ovsdb/server.h|  2 +-
 ovsdb/transaction.c   |  2 +-
 ovsdb/trigger.h   |  2 +-
 tests/test-list.c |  4 ++--
 vswitchd/bridge.c |  2 +-
 54 files changed, 53 insertions(+), 77 deletions(-)
 delete mode 100644 lib/list.h

diff --git a/lib/automake.mk b/lib/automake.mk
index 3cba91a..7ebbce1 100644
--- a/lib/automake.mk
+++ b/lib/automake.mk
@@ -109,7 +109,6 @@ lib_libopenvswitch_la_SOURCES = \
lib/learn.h \
lib/learning-switch.c \
lib/learning-switch.h \
-   lib/list.h \
lib/lockfile.c \
lib/lockfile.h \
lib/mac-learning.c \
diff --git a/lib/bfd.c b/lib/bfd.c
index 8b5daff..f976851 100644
--- a/lib/bfd.c
+++ b/lib/bfd.c
@@ -30,7 +30,7 @@
 #include "flow.h"
 #include "hash.h"
 #include "hmap.h"
-#include "list.h"
+#include "openvswitch/list.h"
 #include "netdev.h"
 #include "odp-util.h"
 #include "ofpbuf.h"
diff --git a/lib/dp-packet.h b/lib/dp-packet.h
index bf4e758..000b09d 100644
--- a/lib/dp-packet.h
+++ b/lib/dp-packet.h
@@ -19,7 +19,7 @@
 
 #include 
 #include 
-#include "list.h"
+#include "openvswitch/list.h"
 #include "packets.h"
 #include "util.h"
 #include "netdev-dpdk.h"
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 1b9793b..f3dfbcc 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -44,7 +44,7 @@
 #include "cmap.h"
 #include "coverage.h"
 #include "latch.h"
-#include "list.h"
+#include "openvswitch/list.h"
 #include "match.h"
 #include "netdev.h"
 #include "netdev-dpdk.h"
diff --git a/lib/fat-rwlock.c b/lib/fat-rwlock.c
index 89cff1d..b36cd4c 100644
--- a/lib/fat-rwlock.c
+++ b/lib/fat-rwlock.c
@@ -21,7 +21,7 @@
 #include 
 
 #include "hmap.h"
-#include "list.h"
+#include "openvswitch/list.h"
 #include "ovs-thread.h"
 #include "random.h"
 
diff --git a/lib/fat-rwlock.h b/lib/fat-rwlock.h
index 257cd56..181fa92 100644
--- a/lib/fat-rwlock.h
+++ b/lib/fat-rwlock.h
@@ -18,7 +18,7 @@
 #define FAT_RWLOCK_H 1
 
 #include "compiler.h"
-#include "list.h"
+#include "openvswitch/list.h"
 #include "ovs-thread.h"
 
 /* "Fat rwlock".
diff --git a/lib/guarded-list.h b/lib/guarded-list.h
index 3e46d51..80ce22c 100644
--- a/lib/guarded-list.h
+++ b/lib/guarded-list.h
@@ -19,7 +19,7 @@
 
 #include 
 #include "compiler.h"
-#include "list.h"
+#include "openvswitch/list.h"
 #include "ovs-thread.h"
 
 struct guarded_list {
diff --git a/lib/jsonrpc.c b/lib/jsonrpc.c
index 35428a6..c0c27c2 100644
--- a/lib/jsonrpc.c
+++ b/lib/jsonrpc.c
@@ -24,7 +24,7 @@
 #include "dynamic-string.h"
 #include "fatal-signal.h"
 #include "json.h"
-#include "list.h"
+#include "openvswitch/list.h"
 #include "ofpbuf.h"
 #include "ovs-thread.h"
 #include "poll-loop.h"
diff --git a/lib/list.h b/lib/list.h
deleted file mode 100644
index f641d39..000
--- a/lib/list.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (c) 2008, 2009, 2010, 2011, 2013, 2015 Nicira, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the

[ovs-dev] [PATCH] Makefile.am: Clean flake8-check too.

2016-02-22 Thread Ben Pfaff
Found "make distcheck".

Signed-off-by: Ben Pfaff 
---
 Makefile.am | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Makefile.am b/Makefile.am
index 75ccadf..13b0a48 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -370,6 +370,7 @@ flake8-check: $(FLAKE8_PYFILES)
flake8 $^ 
--ignore=E121,E123,E125,E126,E127,E128,E129,E131,W503,F811,D,H ${FLAKE8_FLAGS}; 
then \
touch $@; else exit 1; fi
 endif
+CLEANFILES += flake8-check
 
 include $(srcdir)/manpages.mk
 $(srcdir)/manpages.mk: $(MAN_ROOTS) build-aux/sodepends.pl
-- 
2.1.3

___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH 3/9] Move lib/ofp-errors.h to include/openvswitch directory

2016-02-22 Thread ben
From: Ben Warren 

Signed-off-by: Ben Warren 
---
 FAQ.md   |   2 +-
 build-aux/extract-ofp-errors |   4 +-
 include/openvswitch/automake.mk  |   1 +
 include/openvswitch/ofp-errors.h | 803 +++
 lib/automake.mk  |   5 +-
 lib/bundle.c |   2 +-
 lib/bundle.h |   2 +-
 lib/dpif.c   |   2 +-
 lib/learn.c  |   2 +-
 lib/learn.h  |   2 +-
 lib/learning-switch.c|   2 +-
 lib/meta-flow.c  |   2 +-
 lib/meta-flow.h  |   2 +-
 lib/multipath.c  |   2 +-
 lib/multipath.h  |   2 +-
 lib/nx-match.c   |   2 +-
 lib/nx-match.h   |   2 +-
 lib/ofp-actions.h|   2 +-
 lib/ofp-errors.c |   2 +-
 lib/ofp-errors.h | 803 ---
 lib/ofp-msgs.h   |   2 +-
 lib/ofp-print.c  |   2 +-
 lib/ofp-prop.c   |   2 +-
 lib/ofp-prop.h   |   2 +-
 lib/ofp-util.c   |   2 +-
 lib/pktbuf.h |   2 +-
 lib/vconn.c  |   2 +-
 ofproto/connmgr.h|   2 +-
 ofproto/ofproto-provider.h   |   2 +-
 ofproto/ofproto.c|   2 +-
 utilities/ovs-ofctl.c|   2 +-
 31 files changed, 834 insertions(+), 834 deletions(-)
 create mode 100644 include/openvswitch/ofp-errors.h
 delete mode 100644 lib/ofp-errors.h

diff --git a/FAQ.md b/FAQ.md
index 8bd7ab9..128e215 100644
--- a/FAQ.md
+++ b/FAQ.md
@@ -1595,7 +1595,7 @@ A: This is a Open vSwitch extension to OpenFlow error 
codes.  Open
If you want to dissect the extended error message yourself, the
format is documented in include/openflow/nicira-ext.h in the Open
vSwitch source distribution.  The extended error codes are
-   documented in lib/ofp-errors.h.
+   documented in include/openvswitch/ofp-errors.h.
 
 Q1: Some of the traffic that I'd expect my OpenFlow controller to see
 doesn't actually appear through the OpenFlow connection, even
diff --git a/build-aux/extract-ofp-errors b/build-aux/extract-ofp-errors
index 16bfbc7..8036795 100755
--- a/build-aux/extract-ofp-errors
+++ b/build-aux/extract-ofp-errors
@@ -161,9 +161,9 @@ experimenter IDs), then ERROR_HEADER to obtain OpenFlow 
error number.
 It outputs a C source file for translating OpenFlow error codes into
 strings.
 
-ERROR_HEADER should point to lib/ofp-errors.h.
+ERROR_HEADER should point to include/openvswitch/ofp-errors.h.
 VENDOR_HEADER should point to include/openflow/openflow-common.h.
-The output is suitable for use as lib/ofp-errors.inc.\
+The output is suitable for use as include/openvswitch/ofp-errors.inc.\
 ''' % {"argv0": argv0})
 sys.exit(0)
 
diff --git a/include/openvswitch/automake.mk b/include/openvswitch/automake.mk
index 9fc5d5b..3b5879a 100644
--- a/include/openvswitch/automake.mk
+++ b/include/openvswitch/automake.mk
@@ -3,6 +3,7 @@ openvswitchinclude_HEADERS = \
include/openvswitch/compiler.h \
include/openvswitch/geneve.h \
include/openvswitch/list.h \
+   include/openvswitch/ofp-errors.h \
include/openvswitch/ofp-parse.h \
include/openvswitch/thread.h \
include/openvswitch/token-bucket.h \
diff --git a/include/openvswitch/ofp-errors.h b/include/openvswitch/ofp-errors.h
new file mode 100644
index 000..22c7b94
--- /dev/null
+++ b/include/openvswitch/ofp-errors.h
@@ -0,0 +1,803 @@
+/*
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Nicira, 
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.
+ */
+
+#ifndef OPENVSWITCH_OFP_ERRORS_H
+#define OPENVSWITCH_OFP_ERRORS_H 1
+
+#include 
+#include 
+#include 
+
+#include "openflow/openflow.h"
+
+struct ds;
+struct ofpbuf;
+
+/* Error codes.
+ *
+ * We embed system errno values and OpenFlow standard and vendor extension
+ * error codes into the positive range of "int":
+ *
+ *   - Errno values are assumed to use the range 1 through 2**30 - 1.
+ *
+ * (C and POSIX say that errno values are positive.  We assume that they
+ * are less than 2**29.  They are actually less than 65536 on at least
+ * Linux, FreeBSD, OpenBSD, and Windows.)
+ *
+ *   - OpenFlow standard and vendor extension error codes use the range
+ * starting at 2**30 (OFPERR_OFS).

[ovs-dev] [PATCH 0/9] RFC: rework code base for third-party linking

2016-02-22 Thread ben
From: Ben Warren 

This patch set is a first stab at making a 'dev' distribution for OpenVswitch
The goal is to provide shared libraries and header files so that third party
applications can link in OVS rather than always using the command line
utilities.

Design:

Nothing too exotic here - some header files have been moved from 'lib' to
'include/openvswitch'.  All header files in 'include' are considered
appropriate for third-party inclusion.

Caveats:

- The header files that have been moved to 'include/openvswitch' are the ones
  that I'm using in my current project.  I'm willing to do the work to move
  others, but am looking for direction on what should be moved.
- No effort has gone into restricting the list of objects that are exported.  
All
  public functions make it into the appropriate .so libraries
- There may not seem to be much rhyme or reason as to the ordering of #include
  directives in source files.  My OCD pushes me towards always using a 
particular
  pattern, usually alphabetic with files in directories going first, but many of
  changes I made here were done using 'sed -i' which doesn't affect line 
ordering.
  I'd gladly fix these up if anybody has a preference, but there didn't seem to 
be
  any obvious rules in place.
- This is geared towards Debian, although there's nothing Debian-specific in the
  reworking of header files.
- In the Debian 'openvswitch-common' package, all command line utilities are now
  dynamically-linked agains libopenvswitch.so
- This has only been tested on Linux, although I have it running both against an
  x86_64 target as well as cross-compiled for MIPS64 (Cavium). 
- I'm a newbie with Debian packaging, which you'll find out if you build this.
  While the code compiles, links and runs, there are a ton of 'dpkg-shlibdeps'
  warnings, but I don't know the best practice for declaring symbols.
- I'm unsure how to version the dynamic libraries.  I guess start with 1.0.0?

Going Forward:

- While the code and macros in 'list.h' have pretty good namespace protection,
  we should probably do some work on 'util.h', and I'm sure there are others.
- Maybe we should add explicit namespace to the files in 'include'?

Ben Warren (9):
  Move ofp-parse.h to include/openvswitch directory
  Move lib/geneve.h to include/openvswitch directory
  Move lib/ofp-errors.h to include/openvswitch directory
  Move contents of lib/list.h to include/openvswitch directory
  Remove lib/list.h completely
  Move lib/dynamic-string.h to include/openvswitch directory
  Move lib/ofpbuf.h to include/openvswitch directory
  Debian: build openvswitch as shared libraries
  Debian: add libopenvswitch-dev build target

 FAQ.md|   2 +-
 build-aux/extract-ofp-errors  |   4 +-
 debian/automake.mk|   1 +
 debian/control|  15 +
 debian/libopenvswitch-dev.install |   5 +
 debian/openvswitch-common.install |   3 +
 debian/rules  |   5 +-
 include/openvswitch/automake.mk   |   5 +
 include/openvswitch/dynamic-string.h  |  93 
 include/openvswitch/geneve.h  |  63 +++
 include/openvswitch/list.h| 260 ++
 include/openvswitch/ofp-errors.h  | 803 ++
 include/openvswitch/ofp-parse.h   | 106 
 include/openvswitch/ofpbuf.h  | 277 +++
 include/openvswitch/util.h| 101 
 lib/automake.mk   |  10 +-
 lib/backtrace.h   |   2 +-
 lib/bfd.c |   6 +-
 lib/bundle.c  |   6 +-
 lib/bundle.h  |   2 +-
 lib/cfm.c |   2 +-
 lib/classifier.c  |   2 +-
 lib/command-line.c|   2 +-
 lib/coverage.c|   2 +-
 lib/db-ctl-base.c |   2 +-
 lib/db-ctl-base.h |   2 +-
 lib/dp-packet.c   |   2 +-
 lib/dp-packet.h   |   2 +-
 lib/dpctl.c   |   6 +-
 lib/dpif-netdev.c |   6 +-
 lib/dpif-netlink.c|   4 +-
 lib/dpif.c|   6 +-
 lib/dynamic-string.c  |   2 +-
 lib/dynamic-string.h  |  93 
 lib/fat-rwlock.c  |   2 +-
 lib/fat-rwlock.h  |   2 +-
 lib/flow.c|   2 +-
 lib/geneve.h  |  63 ---
 lib/guarded-list.h|   2 +-
 lib/json.c|   2 +-
 lib/jsonrpc.c |   6 +-
 lib/lacp.c|   2 +-
 lib/learn.c   |   6 +-
 lib/learn.h  

[ovs-dev] [PATCH 9/9] Debian: add libopenvswitch-dev build target

2016-02-22 Thread ben
From: Ben Warren 

Add shared objects and header files

Signed-off-by: Ben Warren 
---
 debian/automake.mk|  1 +
 debian/control| 15 +++
 debian/libopenvswitch-dev.install |  5 +
 3 files changed, 21 insertions(+)
 create mode 100644 debian/libopenvswitch-dev.install

diff --git a/debian/automake.mk b/debian/automake.mk
index de2350c..8315495 100644
--- a/debian/automake.mk
+++ b/debian/automake.mk
@@ -7,6 +7,7 @@ EXTRA_DIST += \
debian/copyright.in \
debian/dkms.conf.in \
debian/dirs \
+   debian/libopenvswitch-dev.install \
debian/openvswitch-common.dirs \
debian/openvswitch-common.docs \
debian/openvswitch-common.install \
diff --git a/debian/control b/debian/control
index 2918d06..19c3d0e 100644
--- a/debian/control
+++ b/debian/control
@@ -288,3 +288,18 @@ Description: Open vSwitch VTEP utilities
  .
  This package provides utilities that are useful to interact with a
  VTEP-configured database and a VTEP emulator.
+
+Package: libopenvswitch-dev
+Architecture: linux-any
+Depends: ${misc:Depends}
+Description: Openvswitch development libraries, header files and documentation
+ Open vSwitch is a production quality, multilayer, software-based, Ethernet
+ virtual switch. It is designed to enable massive network automation through
+ programmatic extension, while still supporting standard management interfaces
+ and protocols (e.g. NetFlow, sFlow, SPAN, RSPAN, CLI, LACP, 802.1ag). In
+ addition, it is designed to support distribution across multiple physical
+ servers similar to VMware's vNetwork distributed vswitch or Cisco's Nexus
+ 1000V.
+ .
+ This package provides libraries and header files that enable third-party 
applications
+ to include openvswitch code.
diff --git a/debian/libopenvswitch-dev.install 
b/debian/libopenvswitch-dev.install
new file mode 100644
index 000..fa11ea6
--- /dev/null
+++ b/debian/libopenvswitch-dev.install
@@ -0,0 +1,5 @@
+usr/lib/*.a
+usr/lib/*.so
+usr/lib/*.so.*
+include/openflow/*.h /usr/include/openflow/
+include/openvswitch/*.h /usr/include/openvswitch/
-- 
2.5.0

___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH 4/9] Move contents of lib/list.h to include/openvswitch directory

2016-02-22 Thread ben
From: Ben Warren 

Most of the list code is properly namespaced, so is OK to move to the
global export directory.  Some "lib/util.h" code had to move to the
other directory as well, but I've tried to make that as small as
possible

Signed-off-by: Ben Warren 
---
 include/openvswitch/list.h | 260 +
 include/openvswitch/util.h | 101 ++
 lib/list.h | 257 
 lib/util.h | 100 -
 4 files changed, 361 insertions(+), 357 deletions(-)

diff --git a/include/openvswitch/list.h b/include/openvswitch/list.h
index e2b97c6..961928d 100644
--- a/include/openvswitch/list.h
+++ b/include/openvswitch/list.h
@@ -16,6 +16,12 @@
 #ifndef OPENVSWITCH_LIST_H
 #define OPENVSWITCH_LIST_H 1
 
+#include 
+#include 
+#include 
+#include 
+#include 
+
 /* Doubly linked list head or element. */
 struct ovs_list {
 struct ovs_list *prev; /* Previous list element. */
@@ -24,4 +30,258 @@ struct ovs_list {
 
 #define OVS_LIST_INITIALIZER(LIST) { LIST, LIST }
 
+/* "struct ovs_list" with pointers that will (probably) cause segfaults if
+ * dereferenced and, better yet, show up clearly in a debugger. */
+#define OVS_LIST_POISON \
+(struct ovs_list) { (struct ovs_list *) (uintptr_t) 0xULL, \
+(struct ovs_list *) (uintptr_t) 0xULL }
+
+static inline void list_init(struct ovs_list *);
+static inline void list_poison(struct ovs_list *);
+
+/* List insertion. */
+static inline void list_insert(struct ovs_list *, struct ovs_list *);
+static inline void list_splice(struct ovs_list *before, struct ovs_list *first,
+   struct ovs_list *last);
+static inline void list_push_front(struct ovs_list *, struct ovs_list *);
+static inline void list_push_back(struct ovs_list *, struct ovs_list *);
+static inline void list_replace(struct ovs_list *, const struct ovs_list *);
+static inline void list_moved(struct ovs_list *, const struct ovs_list *orig);
+static inline void list_move(struct ovs_list *dst, struct ovs_list *src);
+
+/* List removal. */
+static inline struct ovs_list *list_remove(struct ovs_list *);
+static inline struct ovs_list *list_pop_front(struct ovs_list *);
+static inline struct ovs_list *list_pop_back(struct ovs_list *);
+
+/* List elements. */
+static inline struct ovs_list *list_front(const struct ovs_list *);
+static inline struct ovs_list *list_back(const struct ovs_list *);
+
+/* List properties. */
+static inline size_t list_size(const struct ovs_list *);
+static inline bool list_is_empty(const struct ovs_list *);
+static inline bool list_is_singleton(const struct ovs_list *);
+static inline bool list_is_short(const struct ovs_list *);
+
+#define LIST_FOR_EACH(ITER, MEMBER, LIST)   \
+for (INIT_CONTAINER(ITER, (LIST)->next, MEMBER);\
+ &(ITER)->MEMBER != (LIST); \
+ ASSIGN_CONTAINER(ITER, (ITER)->MEMBER.next, MEMBER))
+#define LIST_FOR_EACH_CONTINUE(ITER, MEMBER, LIST)  \
+for (ASSIGN_CONTAINER(ITER, (ITER)->MEMBER.next, MEMBER); \
+ &(ITER)->MEMBER != (LIST); \
+ ASSIGN_CONTAINER(ITER, (ITER)->MEMBER.next, MEMBER))
+#define LIST_FOR_EACH_REVERSE(ITER, MEMBER, LIST)   \
+for (INIT_CONTAINER(ITER, (LIST)->prev, MEMBER);\
+ &(ITER)->MEMBER != (LIST); \
+ ASSIGN_CONTAINER(ITER, (ITER)->MEMBER.prev, MEMBER))
+#define LIST_FOR_EACH_REVERSE_CONTINUE(ITER, MEMBER, LIST)  \
+for (ASSIGN_CONTAINER(ITER, (ITER)->MEMBER.prev, MEMBER);   \
+ &(ITER)->MEMBER != (LIST); \
+ ASSIGN_CONTAINER(ITER, (ITER)->MEMBER.prev, MEMBER))
+#define LIST_FOR_EACH_SAFE(ITER, NEXT, MEMBER, LIST)   \
+for (INIT_CONTAINER(ITER, (LIST)->next, MEMBER);   \
+ (&(ITER)->MEMBER != (LIST)\
+  ? INIT_CONTAINER(NEXT, (ITER)->MEMBER.next, MEMBER), 1   \
+  : 0);\
+ (ITER) = (NEXT))
+#define LIST_FOR_EACH_POP(ITER, MEMBER, LIST)  \
+while (!list_is_empty(LIST)\
+   && (INIT_CONTAINER(ITER, list_pop_front(LIST), MEMBER), 1))
+
+/* Inline implementations. */
+
+/* Initializes 'list' as an empty list. */
+static inline void
+list_init(struct ovs_list *list)
+{
+list->next = list->prev = list;
+}
+
+/* Initializes 'list' with pointers that will (probably) cause segfaults if
+ * dereferenced and, better yet, show up clearly in a debugger. */
+static inline void
+list_poison(struct ovs_list *list)
+{
+*list = OVS_LIST_POISON;
+}
+
+/* Inserts 'elem' just before 'before'. */

[ovs-dev] [PATCH 1/9] Move ofp-parse.h to include/openvswitch directory

2016-02-22 Thread ben
From: Ben Warren 

Signed-off-by: Ben Warren 
---
 include/openvswitch/automake.mk |   1 +
 include/openvswitch/ofp-parse.h | 106 +++
 lib/automake.mk |   1 -
 lib/dpctl.c |   2 +-
 lib/learning-switch.c   |   2 +-
 lib/ofp-actions.c   |   2 +-
 lib/ofp-parse.c |   3 +-
 lib/ofp-parse.h | 107 
 ofproto/ofproto-dpif.c  |   2 +-
 tests/test-odp.c|   2 +-
 utilities/ovs-dpctl.c   |   2 +-
 utilities/ovs-ofctl.c   |   2 +-
 utilities/ovs-testcontroller.c  |   2 +-
 13 files changed, 116 insertions(+), 118 deletions(-)
 create mode 100644 include/openvswitch/ofp-parse.h
 delete mode 100644 lib/ofp-parse.h

diff --git a/include/openvswitch/automake.mk b/include/openvswitch/automake.mk
index 90a45cb..46416be 100644
--- a/include/openvswitch/automake.mk
+++ b/include/openvswitch/automake.mk
@@ -2,6 +2,7 @@ openvswitchincludedir = $(includedir)/openvswitch
 openvswitchinclude_HEADERS = \
include/openvswitch/compiler.h \
include/openvswitch/list.h \
+   include/openvswitch/ofp-parse.h \
include/openvswitch/thread.h \
include/openvswitch/token-bucket.h \
include/openvswitch/types.h \
diff --git a/include/openvswitch/ofp-parse.h b/include/openvswitch/ofp-parse.h
new file mode 100644
index 000..258ec3b
--- /dev/null
+++ b/include/openvswitch/ofp-parse.h
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2010, 2011, 2012, 2013, 2014, 2015 Nicira, 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.
+ */
+
+/* OpenFlow protocol string to flow parser. */
+
+#ifndef OPENVSWITCH_OFP_PARSE_H
+#define OPENVSWITCH_OFP_PARSE_H 1
+
+#include 
+#include 
+#include 
+#include "openvswitch/compiler.h"
+#include "openvswitch/types.h"
+
+struct flow;
+struct ofpbuf;
+struct ofputil_flow_mod;
+struct ofputil_flow_monitor_request;
+struct ofputil_flow_stats_request;
+struct ofputil_group_mod;
+struct ofputil_meter_mod;
+struct ofputil_table_mod;
+struct ofputil_tlv_table_mod;
+struct simap;
+enum ofputil_protocol;
+
+char *parse_ofp_str(struct ofputil_flow_mod *, int command, const char *str_,
+enum ofputil_protocol *usable_protocols)
+OVS_WARN_UNUSED_RESULT;
+
+char *parse_ofp_flow_mod_str(struct ofputil_flow_mod *, const char *string,
+ int command,
+ enum ofputil_protocol *usable_protocols)
+OVS_WARN_UNUSED_RESULT;
+
+char *parse_ofp_table_mod(struct ofputil_table_mod *,
+  const char *table_id, const char *flow_miss_handling,
+  uint32_t *usable_versions)
+OVS_WARN_UNUSED_RESULT;
+
+char *parse_ofp_flow_mod_file(const char *file_name, int command,
+  struct ofputil_flow_mod **fms, size_t *n_fms,
+  enum ofputil_protocol *usable_protocols)
+OVS_WARN_UNUSED_RESULT;
+
+char *parse_ofp_flow_stats_request_str(struct ofputil_flow_stats_request *,
+   bool aggregate, const char *string,
+   enum ofputil_protocol *usable_protocols)
+OVS_WARN_UNUSED_RESULT;
+
+char *parse_ofp_exact_flow(struct flow *flow, struct flow *mask, const char *s,
+   const struct simap *portno_names);
+
+char *parse_ofp_meter_mod_str(struct ofputil_meter_mod *, const char *string,
+  int command,
+  enum ofputil_protocol *usable_protocols)
+OVS_WARN_UNUSED_RESULT;
+
+char *parse_flow_monitor_request(struct ofputil_flow_monitor_request *,
+ const char *,
+ enum ofputil_protocol *usable_protocols)
+OVS_WARN_UNUSED_RESULT;
+
+char *parse_ofp_group_mod_file(const char *file_name, uint16_t command,
+   struct ofputil_group_mod **gms, size_t *n_gms,
+   enum ofputil_protocol *usable_protocols)
+OVS_WARN_UNUSED_RESULT;
+
+char *parse_ofp_group_mod_str(struct ofputil_group_mod *, uint16_t command,
+  const char *string,
+  enum ofputil_protocol *usable_protocols)
+OVS_WARN_UNUSED_RESULT;
+
+char *parse_ofp_tlv_table_mod_str(struct ofputil_tlv_table_mod *,
+  

[ovs-dev] [PATCH 8/9] Debian: build openvswitch as shared libraries

2016-02-22 Thread ben
From: Ben Warren 

Signed-off-by: Ben Warren 
---
 debian/openvswitch-common.install | 3 +++
 debian/rules  | 5 -
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/debian/openvswitch-common.install 
b/debian/openvswitch-common.install
index 3264ea5..73c8fc9 100644
--- a/debian/openvswitch-common.install
+++ b/debian/openvswitch-common.install
@@ -9,3 +9,6 @@ usr/sbin/ovs-bugtool
 usr/share/openvswitch/bugtool-plugins
 usr/share/openvswitch/scripts/ovs-bugtool-*
 usr/share/openvswitch/scripts/ovs-lib
+usr/lib/*.a
+usr/lib/*.so
+usr/lib/*.so.*
diff --git a/debian/rules b/debian/rules
index cc17cd0..31959c1 100755
--- a/debian/rules
+++ b/debian/rules
@@ -30,7 +30,7 @@ override_dh_autoreconf:
dh_autoreconf $(DH_AS_NEEDED)
 
 override_dh_auto_configure:
-   dh_auto_configure -- --enable-ssl $(DATAPATH_CONFIGURE_OPTS)
+   dh_auto_configure -- --enable-ssl --enable-shared 
$(DATAPATH_CONFIGURE_OPTS)
 
 override_dh_auto_test:
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
@@ -92,3 +92,6 @@ override_dh_installinit:
 
 override_dh_strip:
dh_strip --dbg-package=openvswitch-dbg
+
+override_dh_shlibdeps:
+   dh_shlibdeps -l$(shell pwd)/debian/tmp/usr/lib -O--parallel 
--dpkg-shlibdeps-params=--ignore-missing-info
-- 
2.5.0

___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH 2/9] Move lib/geneve.h to include/openvswitch directory

2016-02-22 Thread ben
From: Ben Warren 

Signed-off-by: Ben Warren 
---
 include/openvswitch/automake.mk |  1 +
 include/openvswitch/geneve.h| 63 +
 lib/automake.mk |  1 -
 lib/geneve.h| 63 -
 lib/packets.h   |  2 +-
 lib/tun-metadata.h  |  2 +-
 6 files changed, 66 insertions(+), 66 deletions(-)
 create mode 100644 include/openvswitch/geneve.h
 delete mode 100644 lib/geneve.h

diff --git a/include/openvswitch/automake.mk b/include/openvswitch/automake.mk
index 46416be..9fc5d5b 100644
--- a/include/openvswitch/automake.mk
+++ b/include/openvswitch/automake.mk
@@ -1,6 +1,7 @@
 openvswitchincludedir = $(includedir)/openvswitch
 openvswitchinclude_HEADERS = \
include/openvswitch/compiler.h \
+   include/openvswitch/geneve.h \
include/openvswitch/list.h \
include/openvswitch/ofp-parse.h \
include/openvswitch/thread.h \
diff --git a/include/openvswitch/geneve.h b/include/openvswitch/geneve.h
new file mode 100644
index 000..7311985
--- /dev/null
+++ b/include/openvswitch/geneve.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2015 Nicira, 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.
+ */
+
+#ifndef OPENVSWITCH_GENEVE_H
+#define OPENVSWITCH_GENEVE_H 1
+
+#include "openvswitch/types.h"
+
+#define TLV_MAX_OPT_SIZE 124
+#define TLV_TOT_OPT_SIZE 252
+
+#define GENEVE_CRIT_OPT_TYPE (1 << 7)
+
+struct geneve_opt {
+ovs_be16  opt_class;
+uint8_t   type;
+#ifdef WORDS_BIGENDIAN
+uint8_t   r1:1;
+uint8_t   r2:1;
+uint8_t   r3:1;
+uint8_t   length:5;
+#else
+uint8_t   length:5;
+uint8_t   r3:1;
+uint8_t   r2:1;
+uint8_t   r1:1;
+#endif
+/* Option data */
+};
+
+struct genevehdr {
+#ifdef WORDS_BIGENDIAN
+uint8_t ver:2;
+uint8_t opt_len:6;
+uint8_t oam:1;
+uint8_t critical:1;
+uint8_t rsvd1:6;
+#else
+uint8_t opt_len:6;
+uint8_t ver:2;
+uint8_t rsvd1:6;
+uint8_t critical:1;
+uint8_t oam:1;
+#endif
+ovs_be16 proto_type;
+ovs_16aligned_be32 vni;
+struct geneve_opt options[];
+};
+
+#endif /* geneve.h */
diff --git a/lib/automake.mk b/lib/automake.mk
index ea2f898..183dcdb 100644
--- a/lib/automake.mk
+++ b/lib/automake.mk
@@ -84,7 +84,6 @@ lib_libopenvswitch_la_SOURCES = \
lib/fatal-signal.h \
lib/flow.c \
lib/flow.h \
-   lib/geneve.h \
lib/guarded-list.c \
lib/guarded-list.h \
lib/hash.c \
diff --git a/lib/geneve.h b/lib/geneve.h
deleted file mode 100644
index db84129..000
--- a/lib/geneve.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2015 Nicira, 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.
- */
-
-#ifndef GENEVE_H
-#define GENEVE_H 1
-
-#include "openvswitch/types.h"
-
-#define TLV_MAX_OPT_SIZE 124
-#define TLV_TOT_OPT_SIZE 252
-
-#define GENEVE_CRIT_OPT_TYPE (1 << 7)
-
-struct geneve_opt {
-ovs_be16  opt_class;
-uint8_t   type;
-#ifdef WORDS_BIGENDIAN
-uint8_t   r1:1;
-uint8_t   r2:1;
-uint8_t   r3:1;
-uint8_t   length:5;
-#else
-uint8_t   length:5;
-uint8_t   r3:1;
-uint8_t   r2:1;
-uint8_t   r1:1;
-#endif
-/* Option data */
-};
-
-struct genevehdr {
-#ifdef WORDS_BIGENDIAN
-uint8_t ver:2;
-uint8_t opt_len:6;
-uint8_t oam:1;
-uint8_t critical:1;
-uint8_t rsvd1:6;
-#else
-uint8_t opt_len:6;
-uint8_t ver:2;
-uint8_t rsvd1:6;
-uint8_t critical:1;
-uint8_t oam:1;
-#endif
-ovs_be16 proto_type;
-ovs_16aligned_be32 vni;
-struct geneve_opt options[];
-};
-
-#endif /* geneve.h */
diff --git a/lib/packets.h b/lib/packets.h
index f1445de..916ad51 100644
--- a/lib/packets.h
+++ b/lib/packets.h
@@ -23,7 +23,7 @@
 #include 
 #include 
 #include "compiler.h"
-#include "geneve.h"
+#include "openvswitch/geneve.h"
 #include "openvswitch/types.h"
 #include "odp-netlink.h"
 #include "random.

Re: [ovs-dev] [ovs-dev, v4] ovs-bugtool: Create OVN plugin and add output.

2016-02-22 Thread Ben Pfaff
On Fri, Feb 05, 2016 at 08:04:14PM -0800, William Tu wrote:
> Create a new ovn/utilities/bugtool directory, add ovn.xml to bugtool
> plugins, and add ovn-nbctl show, ovn-sbctl show, and ovn-sbctl
> lflow-list.
> 
> Signed-off-by: William Tu 
> ---
> v4:
> fix the unmatched file names at ovn.xml to 
>   ovn-bugtool-nbctl-show
>   ovn-bugtool-sbctl-show
>   ovn-bugtool-sbctl-lflow-list

Applied to master, thanks!
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] - ovn-controller: Assign zone-ids consistently

2016-02-22 Thread Ben Pfaff
On Mon, Feb 08, 2016 at 10:12:50PM +, Suryanarayan Ramamurthy wrote:
> Currently, conntrack zone-id is assigned to lport by ovn-controller,
> but the ovn-controller does not remember what was earlier assigned
> to the same lport (possibly in an earlier run across restart).
> 
> So, after ovn-controller restart, the zone-ids may get set 
> inconsistently on lports, resulting in possible hits to 
> already established connections.
> 
> Fix is to remember the zone-id as an external-id of the interface record
> in the local ovs-db, and recover zone-ids assigned earlier to lports 
> from that record.
> 
> This patch fixes:
> https://bugs.launchpad.net/networking-ovn/+bug/1538696
> 
> Signed-off-by: Ramu Ramamurthy 

Thank you for the patch.

From this part of the patch, it looks like external-ids:zone-id is
accepted even if there are duplicates, or if the value is not valid.  I
think that it should reject such cases:
> +zone = smap_get(&iface_rec->external_ids, "zone-id");
> +if (zone && ovs_scan(zone, "%d", &zone_id)) {
> +bitmap_set1(ct_zone_bitmap, zone_id);
> +simap_put(ct_zones, iface_id, zone_id);
> +}

With that in mind, update_local_zone_ids() should also update
external-ids:zone-id if it needs to change, instead of leaving it the
same.

This commit removes the XXX comment below.  Does it fix the problem that
comment points out?

> @@ -112,10 +171,8 @@ update_ct_zones(struct sset *lports, struct simap 
> *ct_zones,
>  bitmap_set1(ct_zone_bitmap, zone);
>  simap_put(ct_zones, iface_id, zone);
>  
> -/* xxx We should erase any old entries for this
> - * xxx zone, but we need a generic interface to the conntrack
> - * xxx table. */
>  }
> +update_local_zone_ids(br_int, ct_zones, ctx);
>  }

Thanks,

Ben.
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH v9 1/7] flow: add miniflow_push_uint8

2016-02-22 Thread Jarno Rajahalme
Sorry for the delay,

Acked-by: Jarno Rajahalme 

> On Jan 19, 2016, at 10:15 PM, Simon Horman  wrote:
> 
> The motivation is to allow pushing single bytes in
> a manner to that already used for 16, 32 and 64 bit integers.
> 
> This will be used by a follow-up patch to allow layer 3 packet -
> that is packets without an ethernet header - to be represented in flows.
> 
> Signed-off-by: Simon Horman 
> 
> ---
> v9
> * New patch
> ---
> lib/flow.c | 23 +++
> 1 file changed, 23 insertions(+)
> 
> diff --git a/lib/flow.c b/lib/flow.c
> index 5668d0c5899e..f09c32523899 100644
> --- a/lib/flow.c
> +++ b/lib/flow.c
> @@ -199,6 +199,23 @@ BUILD_MESSAGE("FLOW_WC_SEQ changed: miniflow_extract() 
> will have runtime "
> }   \
> }
> 
> +#define miniflow_push_uint8_(MF, OFS, VALUE)\
> +{   \
> +MINIFLOW_ASSERT(MF.data < MF.end);  \
> +\
> +if ((OFS) % 8 == 0) {   \
> +miniflow_set_map(MF, OFS / 8);  \
> +*(uint8_t *)MF.data = VALUE;\
> +} else if ((OFS) % 8 == 7) {\
> +miniflow_assert_in_map(MF, OFS / 8);\
> +*((uint8_t *)MF.data + 7) = VALUE;  \
> +MF.data++;  \
> +} else {\
> +miniflow_assert_in_map(MF, OFS / 8);\
> +*((uint8_t *)MF.data + ((OFS) % 8)) = VALUE;\
> +}   \
> +}
> +
> #define miniflow_pad_to_64_(MF, OFS)\
> {   \
> MINIFLOW_ASSERT((OFS) % 8 != 0);\
> @@ -211,6 +228,9 @@ BUILD_MESSAGE("FLOW_WC_SEQ changed: miniflow_extract() 
> will have runtime "
> #define miniflow_push_be16_(MF, OFS, VALUE) \
> miniflow_push_uint16_(MF, OFS, (OVS_FORCE uint16_t)VALUE);
> 
> +#define miniflow_push_be8_(MF, OFS, VALUE) \
> +miniflow_push_uint8_(MF, OFS, (OVS_FORCE uint8_t)VALUE);
> +
> #define miniflow_set_maps(MF, OFS, N_WORDS) \
> {   \
> size_t ofs = (OFS); \
> @@ -262,6 +282,9 @@ BUILD_MESSAGE("FLOW_WC_SEQ changed: miniflow_extract() 
> will have runtime "
> #define miniflow_push_be16(MF, FIELD, VALUE)\
> miniflow_push_be16_(MF, offsetof(struct flow, FIELD), VALUE)
> 
> +#define miniflow_push_uint8(MF, FIELD, VALUE)  \
> +miniflow_push_uint8_(MF, offsetof(struct flow, FIELD), VALUE)
> +
> #define miniflow_pad_to_64(MF, FIELD)   \
> miniflow_pad_to_64_(MF, OFFSETOFEND(struct flow, FIELD))
> 
> -- 
> 2.1.4
> 
> ___
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev

___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH v9 2/7] flow: add miniflow_pad_from_64

2016-02-22 Thread Jarno Rajahalme
Sorry for the delay,

Acked-by: Jarno Rajahalme 

> On Jan 19, 2016, at 10:15 PM, Simon Horman  wrote:
> 
> Provide leading padding to allow pushing a value to a miniflow where
> the value is not aligned to 64 bytes and no value has already been
> pushed to the same word.
> 
> This will be used by a follow-up patch to allow layer 3 packet - that is
> packets without an ethernet header - to be represented in flows.
> 
> Signed-off-by: Simon Horman 
> 
> ---
> v9
> * New patch
> ---
> lib/flow.c | 13 +
> 1 file changed, 13 insertions(+)
> 
> diff --git a/lib/flow.c b/lib/flow.c
> index f09c32523899..2a7116b675da 100644
> --- a/lib/flow.c
> +++ b/lib/flow.c
> @@ -225,6 +225,16 @@ BUILD_MESSAGE("FLOW_WC_SEQ changed: miniflow_extract() 
> will have runtime "
> MF.data++;  \
> }
> 
> +#define miniflow_pad_from_64_(MF, OFS)  \
> +{   \
> +MINIFLOW_ASSERT(MF.data < MF.end);  \
> +\
> +MINIFLOW_ASSERT((OFS) % 8 != 0);\
> +miniflow_set_map(MF, OFS / 8);  \
> +\
> +memset((uint8_t *)MF.data, 0, (OFS) % 8);   \
> +}
> +
> #define miniflow_push_be16_(MF, OFS, VALUE) \
> miniflow_push_uint16_(MF, OFS, (OVS_FORCE uint16_t)VALUE);
> 
> @@ -288,6 +298,9 @@ BUILD_MESSAGE("FLOW_WC_SEQ changed: miniflow_extract() 
> will have runtime "
> #define miniflow_pad_to_64(MF, FIELD)   \
> miniflow_pad_to_64_(MF, OFFSETOFEND(struct flow, FIELD))
> 
> +#define miniflow_pad_from_64(MF, FIELD)   \
> +miniflow_pad_from_64_(MF, offsetof(struct flow, FIELD))
> +
> #define miniflow_push_words(MF, FIELD, VALUEP, N_WORDS) \
> miniflow_push_words_(MF, offsetof(struct flow, FIELD), VALUEP, N_WORDS)
> 
> -- 
> 2.1.4
> 
> ___
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev

___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [ovs-dev,1/2] packets: Fix UDP over IPv6 checksum

2016-02-22 Thread Ben Pfaff
On Tue, Feb 09, 2016 at 06:22:04AM -0200, Thadeu Lima de Souza Cascardo wrote:
> Fix the IPv6 pseudoheader checksum. Requires that the payload length is given 
> to
> the function.
> 
> Signed-off-by: Thadeu Lima de Souza Cascardo 

Thank you for the fix.

The corresponding function for IPv4 has a test in tests/test-csum.c, in
the function test_pseudo().  Can you please add such a test for IPv6?

Thanks,

Ben.
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [ovs-dev, 2/2] packets: fix compose_nd to not crash vswitchd

2016-02-22 Thread Ben Pfaff
On Tue, Feb 09, 2016 at 06:22:05AM -0200, Thadeu Lima de Souza Cascardo wrote:
> packet_set_ipv6 and packet_set_nd assumed that valid packets were already in
> place, so they were not a good fit for composing new packets. In fact,
> packet_set_ipv6 didn't even set the IP version or set L4 offset, causing 
> crashes
> when compose_nd tried to access L4.
> 
> This patch introduces ipv6_compose and uses it for compose_nd, then set the ND
> packets without other helpers.
> 
> Signed-off-by: Thadeu Lima de Souza Cascardo 

Thank you for the fix.

Do you think that you could add a test?

Thanks,

Ben.
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH 1/1] vtep:Add error messages for logical router support

2016-02-22 Thread Dennis Sam
Documents error codes that a Hardware Switch Controller can publish to the NVC 
to
indicate errors related to the provisioning of logical routers.

Signed-off-by: Dennis Sam 
Acked-by: Anupam Chanda 

---
 AUTHORS   |  2 ++
 vtep/vtep.xml | 22 ++
 2 files changed, 24 insertions(+)

diff --git a/AUTHORS b/AUTHORS
index 936394d..18dc5bd 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -54,6 +54,7 @@ Dave Tucker d...@dtucker.co.uk
 David Erickson  deric...@stanford.edu
 David S. Miller da...@davemloft.net
 David Yang  dav...@vmware.com
+Dennis Sam  d...@arista.com
 Devendra Naga   devendra.a...@gmail.com
 Dmitry Krivenok krivenok.dmi...@gmail.com
 Dominic Curran  dominic.cur...@citrix.com
@@ -251,6 +252,7 @@ Andrey Korolyov and...@xdel.ru
 Anshuman Manral anshuman.man...@outlook.com
 Anton Matsiuk   anton.mats...@gmail.com
 Anup Khadka khadka...@gmail.com
+Anupam Chanda   acha...@vmware.com
 Anuprem Chalvadiachalv...@vmware.com
 Ariel Tubaltsev atubalt...@vmware.com
 Arkajit Ghosh   arkajit.gh...@tcs.com
diff --git a/vtep/vtep.xml b/vtep/vtep.xml
index 7112111..66a26d5 100644
--- a/vtep/vtep.xml
+++ b/vtep/vtep.xml
@@ -310,6 +310,28 @@
 requested by the NVC due to lack of resources.
   
 
+  
+Indicates that the switch has been unable to create the logical router
+interfaces requested by the NVC due to conflicting configurations or a 
lack
+of hardware resources.
+  
+
+  
+Indicates that the switch has been unable to create the static routes
+requested by the NVC due to conflicting configurations or a lack of 
hardware
+resources.
+  
+
+  
+Indicates that the switch has been unable to create the logical router
+requested by the NVC due to conflicting configurations or a lack of 
hardware
+resources.
+  
+
+  
+Indicates that the switch does not support logical routing.
+  
+
   
 Indicates that an error has occurred in the switch but that no
 more specific information is available.
-- 
2.5.4 (Apple Git-61)

___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [OVN] Applying ACL changes to existing connections

2016-02-22 Thread Joe Stringer
On 19 February 2016 at 06:53, Russell Bryant  wrote:
> On 02/18/2016 07:37 PM, Joe Stringer wrote:
>> On 17 February 2016 at 18:12, Justin Pettit  wrote:
>>>
 On Feb 5, 2016, at 1:30 PM, Russell Bryant  wrote:


 Thank you for the write-up!  This approach sounds great to me.  Some
 small questions...

 1) If we're only using 1 bit for now, is there any reason to use
 ct_label over ct_mark?  The docs in ovs-ofctl(8) seem to suggest they're
 identical other than being 32-bit vs 128-bit.  Would using the 32-bit
 ct_mark be beneficial in any way instead?
>>>
>>> I think ct_label is intended more for this bit-level twiddling, whereas 
>>> ct_mark is usually treated as a single 32-bit number.  Clearly, this 
>>> doesn't really matter in practice, since OVS interfaces with them the same. 
>>>  Also, I figure that we're going to need to identify the ACL rule at some 
>>> point, and I've been thinking ct_mark is what we'd use for that.
>>>
 2) One thing not explicitly addressed in this write-up is traffic marked
 as related.  I think the proposal means just adding a match on
 ct_label=0x1 where we match ct_state=+rel today and we just rely on a
 packet in the request direction of the main connection to set ct_label.
 That seems fine, but I wanted to clarify that point.
>>>
>>> That's a good point.  Do you know if the existing OpenStack integration 
>>> handles related flows?
>>>
>>> Jarno or Joe, do you know how the connection tracker handles children of 
>>> deleted flows?  There's the following comment in nl_ct_flush() in 
>>> lib/netlink-conntrack.c:
>>>
>>> /* Expectations are flushed automatically, because they do not
>>>  * have a master connection anymore */
>>>
>>> If we delete a specific entry, will its children get removed, too?  If 
>>> that's true, this problem shouldn't be that difficult--although it is a 
>>> little ugly.  I think we just need to have ovn-controller periodically 
>>> sweep through the connection tracking entries looking for that bit, and 
>>> blowing them away.
>>
>> No. The parent connection holds a list of expected connections, and
>> when it is cleaned up, those expectations are cleaned up as well.
>> However, once an expectation has been fulfilled by packets matching
>> the expectation, if you commit that connection then it has a life of
>> its own. I don't see any link from parent to child connections in the
>> conntrack structures, so it seems unlikely that this is possible with
>> current APIs.
>>
>> I think the way to do this currently is to uniquely identify
>> connection families with a ct_mark, and delete connections based on
>> this identifier.
>
> Right now, I don't think we ever do ct(commit) for a packet with the
> related state bit set.  In that case, if we set ct_mark/ct_label on the
> parent connection, will we see that value set when we see another
> related packet?  I think that will result in the behavior we're looking
> for ...

The mark is inherited from the initial connection down to the
related/child connection, but the label is not.
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH] ofproto-dpif-xlate: fix crash when using multicast snooping

2016-02-22 Thread Ben Pfaff
This patch seems obviously correct to me, so whenever you give me a
Signed-off-by, I'll apply it.

On Wed, Feb 17, 2016 at 12:43:56PM -0200, Thadeu Lima de Souza Cascardo wrote:
> The revalidator thread may set may_learn and call xlate_actions with no packet
> data. If the revalidated flow is IGMPv3 or MLD, vswitchd will crash when 
> trying
> to access the NULL packet.
> 
> Only process IGMP and MLD flows when there is a packet. This is a similar
> behavior than what we have for other special packets.
> 
> Not-Signed-off-yet: Thadeu Lima de Souza Cascardo 
> Reported-by: Yi Ba 
> Reported-at: http://openvswitch.org/pipermail/discuss/2016-January/020023.html
> Fixes: 06994f879c9d ("mcast-snooping: Add Multicast Listener Discovery 
> support")
> ---
> 
> Hi, Yi Ba.
> 
> Can you test this patch for your mcast_snooping bug? Remember to enable
> OVS_ENABLE_SG_FIREWALL_MULTICAST again. In order to verify it's working, you 
> can
> run ovs-vsctl get bridge br-ex mcast_snooping_enable.
> 
> Thanks.
> Cascardo.
> 
> ---
>  AUTHORS  | 1 +
>  ofproto/ofproto-dpif-xlate.c | 4 ++--
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/AUTHORS b/AUTHORS
> index 936394d..366b72f 100644
> --- a/AUTHORS
> +++ b/AUTHORS
> @@ -412,6 +412,7 @@ Vishal Swarankarvishal.swarn...@gmail.com
>  Vjekoslav Brajkovic bal...@cs.washington.edu
>  Voravit T.  vora...@kth.se
>  Yeming Zhao zhaoyem...@gmail.com
> +Yi Ba   yby.develo...@yahoo.com
>  Ying Chen   yingc...@vmware.com
>  Yongqiang Liu   liuyq7...@gmail.com
>  ZHANG Zhiming   zhangzhim...@yunshan.net.cn
> diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
> index a6ea067..7195d45 100644
> --- a/ofproto/ofproto-dpif-xlate.c
> +++ b/ofproto/ofproto-dpif-xlate.c
> @@ -2409,7 +2409,7 @@ xlate_normal(struct xlate_ctx *ctx)
>  if (is_igmp(flow)) {
>  if (mcast_snooping_is_membership(flow->tp_src) ||
>  mcast_snooping_is_query(flow->tp_src)) {
> -if (ctx->xin->may_learn) {
> +if (ctx->xin->may_learn && ctx->xin->packet) {
>  update_mcast_snooping_table(ctx->xbridge, flow, vlan,
>  in_xbundle, 
> ctx->xin->packet);
>  }
> @@ -2441,7 +2441,7 @@ xlate_normal(struct xlate_ctx *ctx)
>  return;
>  } else if (is_mld(flow)) {
>  ctx->xout->slow |= SLOW_ACTION;
> -if (ctx->xin->may_learn) {
> +if (ctx->xin->may_learn && ctx->xin->packet) {
>  update_mcast_snooping_table(ctx->xbridge, flow, vlan,
>  in_xbundle, ctx->xin->packet);
>  }
> -- 
> 2.5.0
> 
> ___
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH 1/2] tests: Add ability to automatically rerun failed tests.

2016-02-22 Thread Ben Pfaff
On Tue, Feb 09, 2016 at 11:44:39AM -0800, Ben Pfaff wrote:
> A lot of packaging was doing this already, so this simplifies their
> implementation.
> 
> Signed-off-by: Ben Pfaff 

This could use a review.
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [ovsdb monitor fix v2 3/3] ovsdb: avoid unnecessary call to ovsdb_monitor_get_update()

2016-02-22 Thread Andy Zhou
Avoid calling ovsdb_monitor_get_update() monitor has been flushed
already.

Reported-by: Liran Schour 
Signed-off-by: Andy Zhou 


v1 -> v2: no change.
---
 ovsdb/jsonrpc-server.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/ovsdb/jsonrpc-server.c b/ovsdb/jsonrpc-server.c
index 0d23b77..6f46dbc 100644
--- a/ovsdb/jsonrpc-server.c
+++ b/ovsdb/jsonrpc-server.c
@@ -1297,6 +1297,10 @@ static struct json *
 ovsdb_jsonrpc_monitor_compose_update(struct ovsdb_jsonrpc_monitor *m,
  bool initial)
 {
+if (!ovsdb_monitor_needs_flush(m->dbmon, m->unflushed)) {
+return NULL;
+}
+
 return ovsdb_monitor_get_update(m->dbmon, initial, &m->unflushed,
 m->version);
 }
-- 
1.9.1

___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [ovsdb monitor fix v2 1/3] ovsdb: Fix one off error in tracking monitor changes

2016-02-22 Thread Andy Zhou
dbmon's changes should be stored with the next transaction number,
rather than the current transaction number.  This bug causes the
changes of a transaction stored in a monitor to be unnoticed by
the jsonrpc connections that is responsible for flush the monitor
content.

However, the bug was not noticed until it was exposed by a later
optimization patch: "avoid unnecessary call to ovsdb_monitor_get_update()."
The lack of optimization means that the update is still generated
when 'unflushed' equals to n_transactions + 1, which should have
indicated the monitor has been flushed already.

Signed-off-by: Andy Zhou 

---
v1->v2:
 *Explain the bug in more detail in the commit message.
 *roll back the n_transactions if possible.
---
 ovsdb/monitor.c | 17 +++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/ovsdb/monitor.c b/ovsdb/monitor.c
index 5ae9cdb..0fe2bd6 100644
--- a/ovsdb/monitor.c
+++ b/ovsdb/monitor.c
@@ -1121,11 +1121,24 @@ ovsdb_monitor_commit(struct ovsdb_replica *replica,
 struct ovsdb_monitor_aux aux;
 
 ovsdb_monitor_init_aux(&aux, m);
+/* Update ovsdb_monitor's transaction number for
+ * each transaction, before calling ovsdb_monitor_change_cb().  */
+m->n_transactions++;
 ovsdb_txn_for_each_change(txn, ovsdb_monitor_change_cb, &aux);
 
-if (aux.efficacy == OVSDB_CHANGES_REQUIRE_EXTERNAL_UPDATE) {
+switch(aux.efficacy) {
+case OVSDB_CHANGES_NO_EFFECT:
+/* The transaction is ignored by the monitor.
+ * Roll back the 'n_transactions' as if the transaction
+ * has never happened. */
+m->n_transactions--;
+break;
+case OVSDB_CHANGES_REQUIRE_INTERNAL_UPDATE:
+/* Nothing.  */
+break;
+case  OVSDB_CHANGES_REQUIRE_EXTERNAL_UPDATE:
 ovsdb_monitor_json_cache_flush(m);
-m->n_transactions++;
+break;
 }
 
 return NULL;
-- 
1.9.1

___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [ovsdb monitor fix v2 2/3] ovsdb: rename variables in ovsdb_monitor_get_update()

2016-02-22 Thread Andy Zhou
'prev_txn' and 'next_txn" are more confusing than 'unflushed' and
'unflushed_next'. Rename them.

Signed-off-by: Andy Zhou 

---
v1->v2:  no change.
---
 ovsdb/monitor.c | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/ovsdb/monitor.c b/ovsdb/monitor.c
index 0fe2bd6..0d81d89 100644
--- a/ovsdb/monitor.c
+++ b/ovsdb/monitor.c
@@ -724,40 +724,40 @@ ovsdb_monitor_compose_update(struct ovsdb_monitor *dbmon,
  * going to be used as part of an "update" notification. */
 struct json *
 ovsdb_monitor_get_update(struct ovsdb_monitor *dbmon,
- bool initial, uint64_t *unflushed,
+ bool initial, uint64_t *unflushed_,
  enum ovsdb_monitor_version version)
 {
 struct ovsdb_monitor_json_cache_node *cache_node;
 struct shash_node *node;
 struct json *json;
-uint64_t prev_txn = *unflushed;
-uint64_t next_txn = dbmon->n_transactions + 1;
+const uint64_t unflushed = *unflushed_;
+const uint64_t next_unflushed = dbmon->n_transactions + 1;
 
 /* Return a clone of cached json if one exists. Otherwise,
  * generate a new one and add it to the cache.  */
-cache_node = ovsdb_monitor_json_cache_search(dbmon, version, prev_txn);
+cache_node = ovsdb_monitor_json_cache_search(dbmon, version, unflushed);
 if (cache_node) {
 json = cache_node->json ? json_clone(cache_node->json) : NULL;
 } else {
 if (version == OVSDB_MONITOR_V1) {
-json = ovsdb_monitor_compose_update(dbmon, initial, prev_txn,
+json = ovsdb_monitor_compose_update(dbmon, initial, unflushed,
 ovsdb_monitor_compose_row_update);
 } else {
 ovs_assert(version == OVSDB_MONITOR_V2);
-json = ovsdb_monitor_compose_update(dbmon, initial, prev_txn,
+json = ovsdb_monitor_compose_update(dbmon, initial, unflushed,
 ovsdb_monitor_compose_row_update2);
 }
-ovsdb_monitor_json_cache_insert(dbmon, version, prev_txn, json);
+ovsdb_monitor_json_cache_insert(dbmon, version, unflushed, json);
 }
 
 /* Maintain transaction id of 'changes'. */
 SHASH_FOR_EACH (node, &dbmon->tables) {
 struct ovsdb_monitor_table *mt = node->data;
 
-ovsdb_monitor_table_untrack_changes(mt, prev_txn);
-ovsdb_monitor_table_track_changes(mt, next_txn);
+ovsdb_monitor_table_untrack_changes(mt, unflushed);
+ovsdb_monitor_table_track_changes(mt, next_unflushed);
 }
-*unflushed = next_txn;
+*unflushed_ = next_unflushed;
 
 return json;
 }
-- 
1.9.1

___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH 1/3] ovsdb: Fix one off error in tracking monitor changes

2016-02-22 Thread Andy Zhou
Please ignore this series. An updated version has been posted at:
http://openvswitch.org/pipermail/dev/2016-February/066596.html

On Mon, Feb 22, 2016 at 1:06 AM, Andy Zhou  wrote:

> dbmon's changes should be stored with the new transaction number,
> rather than the current transaction number.
>
> Signed-off-by: Andy Zhou 
> ---
>  ovsdb/monitor.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/ovsdb/monitor.c b/ovsdb/monitor.c
> index 5ae9cdb..ef96ca2 100644
> --- a/ovsdb/monitor.c
> +++ b/ovsdb/monitor.c
> @@ -1121,11 +1121,13 @@ ovsdb_monitor_commit(struct ovsdb_replica *replica,
>  struct ovsdb_monitor_aux aux;
>
>  ovsdb_monitor_init_aux(&aux, m);
> +/* Update ovsdb_monitor's transaction number for
> + * each transaction, before calling ovsdb_monitor_change_cb().  */
> +m->n_transactions++;
>  ovsdb_txn_for_each_change(txn, ovsdb_monitor_change_cb, &aux);
>
>  if (aux.efficacy == OVSDB_CHANGES_REQUIRE_EXTERNAL_UPDATE) {
>  ovsdb_monitor_json_cache_flush(m);
> -m->n_transactions++;
>  }
>
>  return NULL;
> --
> 1.9.1
>
>
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH] build-windows: Enable parallel jobs for msbuild

2016-02-22 Thread Ben Pfaff
On Thu, Feb 11, 2016 at 03:09:32AM +, Alin Serdean wrote:
> This patch enables parallel build from the command line.
> 
> If vstudio_config is defined change from:
> make ovsext_make to make ovsext and also update the dependecy for it,
> since the project requires OvsDpInterface.h to be built.
> 
> Signed-off-by: Alin Gabriel Serdean 

Applied to master, thanks!
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH v2] dpif-netdev: Add dpif-netdev/pmd-rxq-show appctl command.

2016-02-22 Thread Daniele Di Proietto
Thanks Ilya and Flavio, I applied this to master

On 11/02/2016 21:08, "Flavio Leitner"  wrote:

>On Mon, 08 Feb 2016 10:38:47 +0300
>Ilya Maximets  wrote:
>
>> This command can be used to check the port/rxq assignment to
>> pmd threads. For each pmd thread of the datapath shows list
>> of queue-ids with port names.
>> 
>> Additionally log message from pmd_thread_main() extended with
>> queue-id, and type of this message changed from INFO to DBG.
>> 
>> Signed-off-by: Ilya Maximets 
>> ---
>> 
>> Version 2:
>>  * command renamed to 'pmd-rxq-show'.
>>  * Added note to NEWS.
>> 
>>  INSTALL.DPDK.md|  9 --
>>  NEWS   |  3 ++
>>  lib/dpif-netdev.c  | 77
>>++
>>  lib/netdev.c   |  6 
>>  lib/netdev.h   |  1 +
>>  vswitchd/ovs-vswitchd.8.in |  3 ++
>>  6 files changed, 77 insertions(+), 22 deletions(-)
>> 
>
>Acked-by: Flavio Leitner 
>
>Thanks for the v2
>-- 
>fbl
>

___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] - ovn-controller: Assign zone-ids consistently

2016-02-22 Thread Russell Bryant
Hi, Ben.  I know we've had a lot of mailing list problems so you may have
missed some of the follow-up to this patch.  It's up to v5.  I believe
another revision is coming to address saving zone IDs for container-in-vm
and localnet ports.

http://openvswitch.org/pipermail/dev/2016-February/066179.html

On Mon, Feb 22, 2016 at 7:03 PM, Ben Pfaff  wrote:

> On Mon, Feb 08, 2016 at 10:12:50PM +, Suryanarayan Ramamurthy wrote:
> > Currently, conntrack zone-id is assigned to lport by ovn-controller,
> > but the ovn-controller does not remember what was earlier assigned
> > to the same lport (possibly in an earlier run across restart).
> >
> > So, after ovn-controller restart, the zone-ids may get set
> > inconsistently on lports, resulting in possible hits to
> > already established connections.
> >
> > Fix is to remember the zone-id as an external-id of the interface record
> > in the local ovs-db, and recover zone-ids assigned earlier to lports
> > from that record.
> >
> > This patch fixes:
> > https://bugs.launchpad.net/networking-ovn/+bug/1538696
> >
> > Signed-off-by: Ramu Ramamurthy 
>
> Thank you for the patch.
>
> From this part of the patch, it looks like external-ids:zone-id is
> accepted even if there are duplicates, or if the value is not valid.  I
> think that it should reject such cases:
> > +zone = smap_get(&iface_rec->external_ids, "zone-id");
> > +if (zone && ovs_scan(zone, "%d", &zone_id)) {
> > +bitmap_set1(ct_zone_bitmap, zone_id);
> > +simap_put(ct_zones, iface_id, zone_id);
> > +}
>
> With that in mind, update_local_zone_ids() should also update
> external-ids:zone-id if it needs to change, instead of leaving it the
> same.
>
> This commit removes the XXX comment below.  Does it fix the problem that
> comment points out?
>
> > @@ -112,10 +171,8 @@ update_ct_zones(struct sset *lports, struct simap
> *ct_zones,
> >  bitmap_set1(ct_zone_bitmap, zone);
> >  simap_put(ct_zones, iface_id, zone);
> >
> > -/* xxx We should erase any old entries for this
> > - * xxx zone, but we need a generic interface to the conntrack
> > - * xxx table. */
> >  }
> > +update_local_zone_ids(br_int, ct_zones, ctx);
> >  }
>
> Thanks,
>
> Ben.
>



-- 
Russell Bryant
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH] Makefile.am: Clean flake8-check too.

2016-02-22 Thread Russell Bryant
On Mon, Feb 22, 2016 at 6:47 PM, Ben Pfaff  wrote:

> Found "make distcheck".
>

Found *by* "make distcheck" ?

>
> Signed-off-by: Ben Pfaff 
>

Acked-by: Russell Bryant 


> ---
>  Makefile.am | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/Makefile.am b/Makefile.am
> index 75ccadf..13b0a48 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -370,6 +370,7 @@ flake8-check: $(FLAKE8_PYFILES)
> flake8 $^
> --ignore=E121,E123,E125,E126,E127,E128,E129,E131,W503,F811,D,H
> ${FLAKE8_FLAGS}; then \
> touch $@; else exit 1; fi
>  endif
> +CLEANFILES += flake8-check
>
>  include $(srcdir)/manpages.mk
>  $(srcdir)/manpages.mk: $(MAN_ROOTS) build-aux/sodepends.pl
> --
> 2.1.3
>
> ___
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>



-- 
Russell Bryant
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [OVN] Applying ACL changes to existing connections

2016-02-22 Thread Russell Bryant
On Mon, Feb 22, 2016 at 7:25 PM, Joe Stringer  wrote:

> On 19 February 2016 at 06:53, Russell Bryant  wrote:
> > On 02/18/2016 07:37 PM, Joe Stringer wrote:
> >> On 17 February 2016 at 18:12, Justin Pettit  wrote:
> >>>
>  On Feb 5, 2016, at 1:30 PM, Russell Bryant  wrote:
> 
> 
>  Thank you for the write-up!  This approach sounds great to me.  Some
>  small questions...
> 
>  1) If we're only using 1 bit for now, is there any reason to use
>  ct_label over ct_mark?  The docs in ovs-ofctl(8) seem to suggest
> they're
>  identical other than being 32-bit vs 128-bit.  Would using the 32-bit
>  ct_mark be beneficial in any way instead?
> >>>
> >>> I think ct_label is intended more for this bit-level twiddling,
> whereas ct_mark is usually treated as a single 32-bit number.  Clearly,
> this doesn't really matter in practice, since OVS interfaces with them the
> same.  Also, I figure that we're going to need to identify the ACL rule at
> some point, and I've been thinking ct_mark is what we'd use for that.
> >>>
>  2) One thing not explicitly addressed in this write-up is traffic
> marked
>  as related.  I think the proposal means just adding a match on
>  ct_label=0x1 where we match ct_state=+rel today and we just rely on a
>  packet in the request direction of the main connection to set
> ct_label.
>  That seems fine, but I wanted to clarify that point.
> >>>
> >>> That's a good point.  Do you know if the existing OpenStack
> integration handles related flows?
> >>>
> >>> Jarno or Joe, do you know how the connection tracker handles children
> of deleted flows?  There's the following comment in nl_ct_flush() in
> lib/netlink-conntrack.c:
> >>>
> >>> /* Expectations are flushed automatically, because they do not
> >>>  * have a master connection anymore */
> >>>
> >>> If we delete a specific entry, will its children get removed, too?  If
> that's true, this problem shouldn't be that difficult--although it is a
> little ugly.  I think we just need to have ovn-controller periodically
> sweep through the connection tracking entries looking for that bit, and
> blowing them away.
> >>
> >> No. The parent connection holds a list of expected connections, and
> >> when it is cleaned up, those expectations are cleaned up as well.
> >> However, once an expectation has been fulfilled by packets matching
> >> the expectation, if you commit that connection then it has a life of
> >> its own. I don't see any link from parent to child connections in the
> >> conntrack structures, so it seems unlikely that this is possible with
> >> current APIs.
> >>
> >> I think the way to do this currently is to uniquely identify
> >> connection families with a ct_mark, and delete connections based on
> >> this identifier.
> >
> > Right now, I don't think we ever do ct(commit) for a packet with the
> > related state bit set.  In that case, if we set ct_mark/ct_label on the
> > parent connection, will we see that value set when we see another
> > related packet?  I think that will result in the behavior we're looking
> > for ...
>
> The mark is inherited from the initial connection down to the
> related/child connection, but the label is not.
>

Is it inherited only at the start of the related/child connection, or at
any time?  If we set the mark on the parent connection after a
related/child connection has also been allocated, will the mark still be
inherited?

It would be good to document these minor details for ct_mark and ct_label.

-- 
Russell Bryant
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH v4] netdev_dpdk.c: Add QoS functionality.

2016-02-22 Thread Flavio Leitner
On Fri, 19 Feb 2016 17:26:30 +
Ian Stokes  wrote:

> This patch provides the modifications required in netdev-dpdk.c and
> vswitch.xml to allow for a DPDK user space QoS algorithm.
> 
> This patch adds a QoS configuration structure for netdev-dpdk and
> expected QoS operations 'dpdk_qos_ops'. Various helper functions
> are also supplied.
> 
> Also included are the modifications required for vswitch.xml to allow a
> new QoS implementation for netdev-dpdk devices. This includes a new QoS type
> `egress-policer` as well as its expected QoS table entries.
> 
> The QoS functionality implemented for DPDK devices is `egress-policer`.
> This can be used to drop egress packets at a configurable rate.
> 
> The INSTALL.DPDK.md guide has also been modified to provide an example
> configuration of `egress-policer` QoS.
> 
> Signed-off-by: Ian Stokes 
> ---
> 
> v4:
> 
> *INSTALL.DPDK
> -Remove unneeded "--" in ovs-vsctl destroy QoS command.
> 
> *NEWS
> -Add QoS functionality to DPDK in post 2.5 section
> 
> *vswitch.xml
> -Remove references to srtcm & DPDK sample app from egress-policer
> description.
> 
> *netdev-dpdk.c
> -Remove DPDK_MAX_QOS_NAME_SIZE.
> -Replace 'qos_alg_process()' with 'qos_run()'.
> -Replace 'netdev_dpdk_qos_process__()' with 'netdev_dpdk_qos_run__()'.
> -Replace 'egress_policer_process()' with 'egress_policer_run()'.
> -Remove enum egress_policer_action to avoid mixed internal & external
>  declarations.
> -Replace strncmp with strcmp in qos_lookup_name function.
> -Simplify 'egress_pkt_handle' to make direct reference to
>  e_RTE_METER_GREEN instead of using enum.
> -egress_policer_run() fixed so as not to return incorrect packet count
>  containing freed packets.
> -In netdev_dpdk_set_qos() add mutex lock and unlock.
> -In netdev_dpdk_set_qos() treat 'type' not found or 'type'=="" equally and
>  delete QoS configuration.
> ---
>  INSTALL.DPDK.md  |   20 +++
>  NEWS |1 +
>  lib/netdev-dpdk.c|  428 
> --
>  vswitchd/vswitch.xml |   47 ++
>  4 files changed, 483 insertions(+), 13 deletions(-)
> 

Thanks for the patch!
Acked-by: Flavio Leitner 

-- 
fbl

___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH 1/3] dpif-netdev: Reload each thread only once in do_add_port.

2016-02-22 Thread Daniele Di Proietto
Thanks for the patch and the review!

I applied this to master

On 18/02/2016 12:19, "Flavio Leitner"  wrote:

>On Mon, 08 Feb 2016 18:30:29 +0300
>Ilya Maximets  wrote:
>
>> While adding of pmd interface with multiple queues several queues
>> may be assigned to one thread and this thread will be reloaded
>> one time for each added queue.
>> 
>> Signed-off-by: Ilya Maximets 
>> ---
>>  lib/dpif-netdev.c | 10 ++
>>  1 file changed, 10 insertions(+)
>> 
>> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
>> index 1b9793b..c477f2b 100644
>> --- a/lib/dpif-netdev.c
>> +++ b/lib/dpif-netdev.c
>> @@ -43,6 +43,7 @@
>>  #include "flow.h"
>>  #include "cmap.h"
>>  #include "coverage.h"
>> +#include "hmapx.h"
>>  #include "latch.h"
>>  #include "list.h"
>>  #include "match.h"
>> @@ -1139,7 +1140,10 @@ do_add_port(struct dp_netdev *dp, const char
>>*devname, const char *type,
>>  if (netdev_is_pmd(netdev)) {
>>  int numa_id = netdev_get_numa_id(netdev);
>>  struct dp_netdev_pmd_thread *pmd;
>> +struct hmapx to_reload;
>> +struct hmapx_node *node;
>>  
>> +hmapx_init(&to_reload);
>>  /* Cannot create pmd threads for invalid numa node. */
>>  ovs_assert(ovs_numa_numa_id_is_valid(numa_id));
>>  
>> @@ -1155,8 +1159,14 @@ do_add_port(struct dp_netdev *dp, const char
>>*devname, const char *type,
>>  ovs_mutex_lock(&pmd->poll_mutex);
>>  dp_netdev_add_rxq_to_pmd(pmd, port, port->rxq[i]);
>>  ovs_mutex_unlock(&pmd->poll_mutex);
>> +
>> +hmapx_add(&to_reload, pmd);
>> +}
>> +HMAPX_FOR_EACH (node, &to_reload) {
>> +pmd = (struct dp_netdev_pmd_thread *)node->data;
>>  dp_netdev_reload_pmd__(pmd);
>>  }
>> +hmapx_destroy(&to_reload);
>>  }
>>  seq_change(dp->port_seq);
>>  
>
>Acked-by: Flavio Leitner 
>
>-- 
>fbl
>

___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH 2/3] dpif-netdev: Move rxq management into functions.

2016-02-22 Thread Daniele Di Proietto
Thanks for the patch and the review!

I applied this to master


On 18/02/2016 12:20, "Flavio Leitner"  wrote:

>On Mon, 08 Feb 2016 18:30:30 +0300
>Ilya Maximets  wrote:
>
>> Signed-off-by: Ilya Maximets 
>> ---
>>  lib/dpif-netdev.c | 163
>>+++---
>>  1 file changed, 105 insertions(+), 58 deletions(-)
>> 
>> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
>> index c477f2b..e62f5f6 100644
>> --- a/lib/dpif-netdev.c
>> +++ b/lib/dpif-netdev.c
>> @@ -497,6 +497,13 @@ dp_netdev_pmd_get_next(struct dp_netdev *dp,
>>struct cmap_position *pos);
>>  static void dp_netdev_destroy_all_pmds(struct dp_netdev *dp);
>>  static void dp_netdev_del_pmds_on_numa(struct dp_netdev *dp, int
>>numa_id);
>>  static void dp_netdev_set_pmds_on_numa(struct dp_netdev *dp, int
>>numa_id);
>> +static void dp_netdev_pmd_clear_poll_list(struct dp_netdev_pmd_thread
>>*pmd);
>> +static void dp_netdev_del_port_from_pmd(struct dp_netdev_port *port,
>> +struct dp_netdev_pmd_thread
>>*pmd);
>> +static void dp_netdev_del_port_from_all_pmds(struct dp_netdev *dp,
>> + struct dp_netdev_port
>>*port);
>> +static void
>> +dp_netdev_add_port_to_pmds(struct dp_netdev *dp, struct dp_netdev_port
>>*port);
>>  static void
>>  dp_netdev_add_rxq_to_pmd(struct dp_netdev_pmd_thread *pmd,
>>   struct dp_netdev_port *port, struct
>>netdev_rxq *rx);
>> @@ -1138,35 +1145,7 @@ do_add_port(struct dp_netdev *dp, const char
>>*devname, const char *type,
>>  cmap_insert(&dp->ports, &port->node, hash_port_no(port_no));
>>  
>>  if (netdev_is_pmd(netdev)) {
>> -int numa_id = netdev_get_numa_id(netdev);
>> -struct dp_netdev_pmd_thread *pmd;
>> -struct hmapx to_reload;
>> -struct hmapx_node *node;
>> -
>> -hmapx_init(&to_reload);
>> -/* Cannot create pmd threads for invalid numa node. */
>> -ovs_assert(ovs_numa_numa_id_is_valid(numa_id));
>> -
>> -for (i = 0; i < netdev_n_rxq(netdev); i++) {
>> -pmd = dp_netdev_less_loaded_pmd_on_numa(dp, numa_id);
>> -if (!pmd) {
>> -/* There is no pmd threads on this numa node. */
>> -dp_netdev_set_pmds_on_numa(dp, numa_id);
>> -/* Assigning of rx queues done. */
>> -break;
>> -}
>> -
>> -ovs_mutex_lock(&pmd->poll_mutex);
>> -dp_netdev_add_rxq_to_pmd(pmd, port, port->rxq[i]);
>> -ovs_mutex_unlock(&pmd->poll_mutex);
>> -
>> -hmapx_add(&to_reload, pmd);
>> -}
>> -HMAPX_FOR_EACH (node, &to_reload) {
>> -pmd = (struct dp_netdev_pmd_thread *)node->data;
>> -dp_netdev_reload_pmd__(pmd);
>> -}
>> -hmapx_destroy(&to_reload);
>> +dp_netdev_add_port_to_pmds(dp, port);
>>  }
>>  seq_change(dp->port_seq);
>>  
>> @@ -1354,29 +1333,7 @@ do_del_port(struct dp_netdev *dp, struct
>>dp_netdev_port *port)
>>  if (!has_pmd_port_for_numa(dp, numa_id)) {
>>  dp_netdev_del_pmds_on_numa(dp, numa_id);
>>  } else {
>> -struct dp_netdev_pmd_thread *pmd;
>> -struct rxq_poll *poll, *next;
>> -
>> -CMAP_FOR_EACH (pmd, node, &dp->poll_threads) {
>> -if (pmd->numa_id == numa_id) {
>> -bool found = false;
>> -
>> -ovs_mutex_lock(&pmd->poll_mutex);
>> -LIST_FOR_EACH_SAFE (poll, next, node,
>>&pmd->poll_list) {
>> -if (poll->port == port) {
>> -found = true;
>> -port_unref(poll->port);
>> -list_remove(&poll->node);
>> -pmd->poll_cnt--;
>> -free(poll);
>> -}
>> -}
>> -ovs_mutex_unlock(&pmd->poll_mutex);
>> -if (found) {
>> -dp_netdev_reload_pmd__(pmd);
>> -}
>> -}
>> -}
>> +dp_netdev_del_port_from_all_pmds(dp, port);
>>  }
>>  }
>>  
>> @@ -2897,8 +2854,6 @@ dp_netdev_destroy_pmd(struct dp_netdev_pmd_thread
>>*pmd)
>>  static void
>>  dp_netdev_del_pmd(struct dp_netdev *dp, struct dp_netdev_pmd_thread
>>*pmd)
>>  {
>> -struct rxq_poll *poll;
>> -
>>  /* Uninit the 'flow_cache' since there is
>>   * no actual thread uninit it for NON_PMD_CORE_ID. */
>>  if (pmd->core_id == NON_PMD_CORE_ID) {
>> @@ -2911,10 +2866,7 @@ dp_netdev_del_pmd(struct dp_netdev *dp, struct
>>dp_netdev_pmd_thread *pmd)
>>  }
>>  
>>  /* Unref all ports and free poll_list. */
>> -LIST_FOR_EACH_POP (poll, node, &pmd->poll_list) {
>> -port_unref(poll->port);
>> -free(poll);
>> -}
>> +dp_netdev_pmd_clear_poll_list(pmd);
>>  
>>

Re: [ovs-dev] [OVN] Applying ACL changes to existing connections

2016-02-22 Thread Joe Stringer
On 22 February 2016 at 17:32, Russell Bryant  wrote:
>
>
> On Mon, Feb 22, 2016 at 7:25 PM, Joe Stringer  wrote:
>>
>> On 19 February 2016 at 06:53, Russell Bryant  wrote:
>> > On 02/18/2016 07:37 PM, Joe Stringer wrote:
>> >> On 17 February 2016 at 18:12, Justin Pettit  wrote:
>> >>>
>>  On Feb 5, 2016, at 1:30 PM, Russell Bryant  wrote:
>> 
>> 
>>  Thank you for the write-up!  This approach sounds great to me.  Some
>>  small questions...
>> 
>>  1) If we're only using 1 bit for now, is there any reason to use
>>  ct_label over ct_mark?  The docs in ovs-ofctl(8) seem to suggest
>>  they're
>>  identical other than being 32-bit vs 128-bit.  Would using the 32-bit
>>  ct_mark be beneficial in any way instead?
>> >>>
>> >>> I think ct_label is intended more for this bit-level twiddling,
>> >>> whereas ct_mark is usually treated as a single 32-bit number.  Clearly, 
>> >>> this
>> >>> doesn't really matter in practice, since OVS interfaces with them the 
>> >>> same.
>> >>> Also, I figure that we're going to need to identify the ACL rule at some
>> >>> point, and I've been thinking ct_mark is what we'd use for that.
>> >>>
>>  2) One thing not explicitly addressed in this write-up is traffic
>>  marked
>>  as related.  I think the proposal means just adding a match on
>>  ct_label=0x1 where we match ct_state=+rel today and we just rely on a
>>  packet in the request direction of the main connection to set
>>  ct_label.
>>  That seems fine, but I wanted to clarify that point.
>> >>>
>> >>> That's a good point.  Do you know if the existing OpenStack
>> >>> integration handles related flows?
>> >>>
>> >>> Jarno or Joe, do you know how the connection tracker handles children
>> >>> of deleted flows?  There's the following comment in nl_ct_flush() in
>> >>> lib/netlink-conntrack.c:
>> >>>
>> >>> /* Expectations are flushed automatically, because they do not
>> >>>  * have a master connection anymore */
>> >>>
>> >>> If we delete a specific entry, will its children get removed, too?  If
>> >>> that's true, this problem shouldn't be that difficult--although it is a
>> >>> little ugly.  I think we just need to have ovn-controller periodically 
>> >>> sweep
>> >>> through the connection tracking entries looking for that bit, and blowing
>> >>> them away.
>> >>
>> >> No. The parent connection holds a list of expected connections, and
>> >> when it is cleaned up, those expectations are cleaned up as well.
>> >> However, once an expectation has been fulfilled by packets matching
>> >> the expectation, if you commit that connection then it has a life of
>> >> its own. I don't see any link from parent to child connections in the
>> >> conntrack structures, so it seems unlikely that this is possible with
>> >> current APIs.
>> >>
>> >> I think the way to do this currently is to uniquely identify
>> >> connection families with a ct_mark, and delete connections based on
>> >> this identifier.
>> >
>> > Right now, I don't think we ever do ct(commit) for a packet with the
>> > related state bit set.  In that case, if we set ct_mark/ct_label on the
>> > parent connection, will we see that value set when we see another
>> > related packet?  I think that will result in the behavior we're looking
>> > for ...
>>
>> The mark is inherited from the initial connection down to the
>> related/child connection, but the label is not.
>
>
> Is it inherited only at the start of the related/child connection, or at any
> time?  If we set the mark on the parent connection after a related/child
> connection has also been allocated, will the mark still be inherited?

At the time that you commit the related/child connection, it takes the
mark from the original connection. That is the only time.

> It would be good to document these minor details for ct_mark and ct_label.

Sure, thanks for the reminder.
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH 3/3] dpif-netdev: Destroy pmd threads only if pmd-cpu-mask changed.

2016-02-22 Thread Daniele Di Proietto
Thanks for the patch

I have a few comments inline

On 08/02/2016 07:30, "Ilya Maximets"  wrote:

>Since 5f2ccb1c0d3b ("dpif: Allow adding ukeys for same flow by
>different pmds.") there is the possibility to reassign queues among
>pmd threads without restarting them and deleting the megaflow cache.
>
>So, reconfiguration can be performed without destroying of PMD threads
>if pmd-cpu-mask not changed.
>
>Reassignment of all rx queues done to achieve fair distribution.
>
>Signed-off-by: Ilya Maximets 
>---
> lib/dpif-netdev.c | 62
>+--
> 1 file changed, 42 insertions(+), 20 deletions(-)
>
>diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
>index e62f5f6..8069163 100644
>--- a/lib/dpif-netdev.c
>+++ b/lib/dpif-netdev.c
>@@ -2373,27 +2373,31 @@ dpif_netdev_operate(struct dpif *dpif, struct
>dpif_op **ops, size_t n_ops)
> }
> }
> 
>-/* Returns true if the configuration for rx queues or cpu mask
>- * is changed. */
>+/* Returns true if the configuration of rx queues changed. */
> static bool
>-pmd_config_changed(const struct dp_netdev *dp, const char *cmask)
>+pmd_n_rxq_changed(const struct dp_netdev *dp)
> {
> struct dp_netdev_port *port;
> 
> CMAP_FOR_EACH (port, node, &dp->ports) {
>-struct netdev *netdev = port->netdev;
>-int requested_n_rxq = netdev_requested_n_rxq(netdev);
>-if (netdev_is_pmd(netdev)
>+int requested_n_rxq = netdev_requested_n_rxq(port->netdev);
>+if (netdev_is_pmd(port->netdev)
> && port->latest_requested_n_rxq != requested_n_rxq) {
> return true;
> }
> }
>+return false;
>+}
> 
>+/* Returns true if cpu mask changed. */
>+static bool
>+pmd_cpu_mask_changed(const struct dp_netdev *dp, const char *cmask)
>+{
> if (dp->pmd_cmask != NULL && cmask != NULL) {
> return strcmp(dp->pmd_cmask, cmask);
>-} else {
>-return (dp->pmd_cmask != NULL || cmask != NULL);
> }
>+
>+return (dp->pmd_cmask != NULL || cmask != NULL);
> }
> 
> /* Resets pmd threads if the configuration for 'rxq's or cpu mask
>changes. */
>@@ -2401,11 +2405,20 @@ static int
> dpif_netdev_pmd_set(struct dpif *dpif, const char *cmask)
> {
> struct dp_netdev *dp = get_dp_netdev(dpif);
>+bool cmask_changed = pmd_cpu_mask_changed(dp, cmask);
>+struct dp_netdev_port *port;
> 
>-if (pmd_config_changed(dp, cmask)) {
>-struct dp_netdev_port *port;
>+if (cmask_changed || pmd_n_rxq_changed(dp)) {

We could just return here if nothing is changed. That will save us
one level of indentation.

>+if (cmask_changed) {
>+dp_netdev_destroy_all_pmds(dp);
>+} else {
>+struct dp_netdev_pmd_thread *pmd;
> 
>-dp_netdev_destroy_all_pmds(dp);
>+CMAP_FOR_EACH (pmd, node, &dp->poll_threads) {
>+dp_netdev_pmd_clear_poll_list(pmd);
>+dp_netdev_reload_pmd__(pmd);

I guess this is still more than necessary.  Have you thought about
reloading just touching the pmd threads involved with the ports that
changed configuration?

>+}
>+}
> 
> CMAP_FOR_EACH (port, node, &dp->ports) {
> struct netdev *netdev = port->netdev;
>@@ -2439,15 +2452,24 @@ dpif_netdev_pmd_set(struct dpif *dpif, const char
>*cmask)
> }
> }
> }
>-/* Reconfigures the cpu mask. */
>-ovs_numa_set_cpu_mask(cmask);
>-free(dp->pmd_cmask);
>-dp->pmd_cmask = cmask ? xstrdup(cmask) : NULL;
>-
>-/* Restores the non-pmd. */
>-dp_netdev_set_nonpmd(dp);
>-/* Restores all pmd threads. */
>-dp_netdev_reset_pmd_threads(dp);
>+
>+if (cmask_changed) {
>+/* Reconfigures the cpu mask. */
>+ovs_numa_set_cpu_mask(cmask);
>+free(dp->pmd_cmask);
>+dp->pmd_cmask = cmask ? xstrdup(cmask) : NULL;
>+
>+/* Restores the non-pmd. */
>+dp_netdev_set_nonpmd(dp);
>+/* Restores all pmd threads. */
>+dp_netdev_reset_pmd_threads(dp);
>+} else {
>+CMAP_FOR_EACH (port, node, &dp->ports) {
>+if (netdev_is_pmd(port->netdev)) {
>+dp_netdev_add_port_to_pmds(dp, port);
>+}
>+}
>+}
> }
> 
> return 0;
>-- 
>2.5.0
>

___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH] rhel: Add missing ovn bugtool files

2016-02-22 Thread Flavio Leitner
Fixes: 981cbd52c942 ("ovs-bugtool: Create OVN plugin and add output.")
Signed-off-by: Flavio Leitner 
---
 rhel/openvswitch-fedora.spec.in | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/rhel/openvswitch-fedora.spec.in b/rhel/openvswitch-fedora.spec.in
index 00e491b..34d8712 100644
--- a/rhel/openvswitch-fedora.spec.in
+++ b/rhel/openvswitch-fedora.spec.in
@@ -359,6 +359,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_bindir}/ovn-northd
 %{_bindir}/ovn-sbctl
 %{_datadir}/openvswitch/scripts/ovn-ctl
+%{_datadir}/openvswitch/scripts/ovn-bugtool-nbctl-show
+%{_datadir}/openvswitch/scripts/ovn-bugtool-sbctl-lflow-list
+%{_datadir}/openvswitch/scripts/ovn-bugtool-sbctl-show
 %{_mandir}/man8/ovs-testcontroller.8*
 %{_mandir}/man5/ovn-nb.5*
 %{_mandir}/man5/ovn-sb.5*
-- 
2.5.0

___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


  1   2   >