Re: [ovs-dev] question about dp_packet lifetime

2018-03-31 Thread Ben Pfaff
On Wed, Mar 28, 2018 at 10:50:28AM +0200, Alessandro Rosetti wrote:
> Hi Darrell, Ilya and everyone else,
> 
> I'm contacting you since you were interested.
> I've posted the patch that implements netmap in OVS attaching the file in
> the mail, did I do it wrong?
> https://mail.openvswitch.org/pipermail/ovs-dev/2018-March/345371.html
> 
> I'm posting it inline now,
> sorry for the mess!
> 
> Alessandro.

I also didn't see the attachment.

In the inline version, the patch was word-wrapped.

I recommend using "git send-email", if you can.  Otherwise, you can tell
us to pull from a repo at github or other git hosting.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] Openflow group/load balancing support in OVN

2018-03-31 Thread Manoj Sharma
Folks,

Is there any way to configure open flow group or anything similar from OVN
to load balance traffic to more than one port?

I have a logical switch with two ports connected to two different chassis.
I would like to load balance traffic to these two chassis.

ovn-nbctl ls-add foo
ovn-nbctl lsp-add foo foo-lsp1
ovn-nbctl lsp-add foo foo-lsp2

ovn-sbctl chassis-add ch0 vxlan 1.2.3.5
ovn-sbctl chassis-add ch1 vxlan 1.2.3.6

ovn-sbctl lsp-bind foo-lsp1 ch0
ovn-sbctl lsp-bind foo-lsp2 ch1

Is there any way to put foo-lsp1 and foo-lsp2 in a group or some similar
construct and load balance across these two?


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


Re: [ovs-dev] [PATCH] Adding cli for displaying LACP counters

2018-03-31 Thread Ben Pfaff
On Thu, Mar 29, 2018 at 02:16:34AM +0530, Nitin Katiyar wrote:
> Currently OVS does not provide any command to display stats for LACP
> without which it is difficult to debug LACP issues. Here we propose
> to display various statistics about LACP PDUs and slave state change.

Thanks for adding this feature.  The implementation looks good.

Please add documentation for this feature in ovs-vswitchd(8).

Please add a NEWS item.

Thanks,

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


Re: [ovs-dev] [RFC v2 1/2] ingress scheduling: schema and docs

2018-03-31 Thread Ben Pfaff
On Wed, Mar 28, 2018 at 11:11:57PM +0100, Billy O'Mahony wrote:
> Signed-off-by: Billy O'Mahony 
> ---
>  Documentation/howto/dpdk.rst | 18 ++
>  vswitchd/vswitch.ovsschema   |  9 +++--
>  vswitchd/vswitch.xml | 40 
>  3 files changed, 65 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/howto/dpdk.rst b/Documentation/howto/dpdk.rst
> index 79b626c..fca353a 100644
> --- a/Documentation/howto/dpdk.rst
> +++ b/Documentation/howto/dpdk.rst
> @@ -237,6 +237,24 @@ respective parameter. To disable the flow control at tx 
> side, run::
>  
>  $ ovs-vsctl set Interface dpdk-p0 options:tx-flow-ctrl=false
>  
> +Ingress Scheduling
> +--
> +
> +The ingress scheduling feature is described in general in
> +``ovs-vswitchd.conf.db (5)``.
> +
> +Ingress scheduling currently only supports setting a priority for incoming
> +packets for an entire interface. Priority levels 0 (lowest) to 3 (highest) 
> are
> +supported.  The default priority is 0.
> +
> +Interfaces of type ``dpdk`` and ``dpdkvhostuserclient`` support ingress
> +scheduling.
> +
> +To prioritize packets on a particular port:
> +
> +$ ovs-vsctl set Interface dpdk0 \
> +ingress_sched=port_prio=3

I'm happy to see experimentation in this area.  But, since it is
specified to particular kinds of interfaces, and because it is likely to
evolve in the future, I think I would prefer to see it defined in term
of the interface-type-specific "options" field.  Does that make sense?

Thanks,

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


[ovs-dev] [PATCH 1/2] vswitchd: Allow user to directly specify sFlow agent address.

2018-03-31 Thread Ben Pfaff
At least for testing purposes, and perhaps in production, it is useful to
be able to fix the agent IP address directly, rather that indirecting it
through a device name or the routing table.

This commit uses this feature to fix the agent IP address used in the unit
tests.  This will be particularly useful in an upcoming commit that
disables the use of the system routing table in the unit tests, to make
the tests' results independent of the host's routes.

CC: Neil McKee 
Signed-off-by: Ben Pfaff 
---
 ofproto/ofproto-dpif-sflow.c |  3 ++-
 tests/ofproto-dpif.at|  8 
 vswitchd/vswitch.xml | 25 ++---
 3 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/ofproto/ofproto-dpif-sflow.c b/ofproto/ofproto-dpif-sflow.c
index 60e1b4e0a661..5d8c0e19f8e3 100644
--- a/ofproto/ofproto-dpif-sflow.c
+++ b/ofproto/ofproto-dpif-sflow.c
@@ -453,7 +453,8 @@ sflow_choose_agent_address(const char *agent_device,
 agent_addr->type = SFLADDRESSTYPE_IP_V4;
 
 if (agent_device) {
-if (!netdev_get_in4_by_name(agent_device, )) {
+if (!netdev_get_in4_by_name(agent_device, )
+|| !lookup_ip(agent_device, )) {
 goto success;
 }
 }
diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
index d2058eddd3eb..60f28e2a08dd 100644
--- a/tests/ofproto-dpif.at
+++ b/tests/ofproto-dpif.at
@@ -6333,7 +6333,7 @@ ovs-vsctl \
   set Interface p1 options:ifindex=1003 -- \
   set Bridge br0 sflow=@sf --  \
   --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\"  \
-  header=128 sampling=1 polling=1
+  header=128 sampling=1 polling=1 agent=127.0.0.1
 
 dnl sleep long enough to get the sFlow datagram flushed out (may be delayed 
for up to 1 second)
 AT_CHECK([ovs-appctl time/warp 2000 100], [0], [ignore])
@@ -6382,7 +6382,7 @@ AT_CHECK([ovs-ofctl add-flow br0 action=3])
 dnl enable sflow
 ovs-vsctl \
set Bridge br0 sflow=@sf -- \
-   --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\" \
+   --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\" agent=127.0.0.1 \
  header=128 sampling=1 polling=0
 
 dnl introduce a packet that will be flooded to the tunnel
@@ -6474,7 +6474,7 @@ AT_CHECK([ovs-appctl netdev-dummy/receive p0 
'recirc_id(0),in_port(1),eth(src=f8
 dnl configure sflow on int-br only
 ovs-vsctl \
set Bridge int-br sflow=@sf -- \
-   --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\" \
+   --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\" agent=127.0.0.1 \
  header=128 sampling=1 polling=0
 
 dnl set up route to 192.168.1.2 via br0
@@ -6553,7 +6553,7 @@ ovs-appctl time/stop
 dnl configure sflow
 ovs-vsctl \
set Bridge br0 sflow=@sf -- \
-   --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\" \
+   --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\" agent=127.0.0.1 \
  header=128 sampling=1 polling=0
 
 AT_CHECK([ovs-appctl netdev-dummy/receive p1 
'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x8847),mpls(label=11,tc=3,ttl=64,bos=1)'])
diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml
index f899a19764a4..9c2a8263e604 100644
--- a/vswitchd/vswitch.xml
+++ b/vswitchd/vswitch.xml
@@ -5099,13 +5099,24 @@ ovs-vsctl add-port br0 p0 -- set Interface p0 
type=patch options:peer=p1 \
 monitoring of switches.
 
 
-  Name of the network device whose IP address should be reported as the
-  ``agent address'' to collectors.  If not specified, the agent device is
-  figured from the first target address and the routing table.  If the
-  routing table does not contain a route to the target, the IP address
-  defaults to the  in the
-  collector's .  If an agent IP address cannot be
-  determined any of these ways, sFlow is disabled.
+  
+Determines the agent address, that is, the IP address reported to
+collectors as the source of the sFlow data.  It may be an IP address or
+the name of a network device.  In the latter case, the network device's
+IP address is used,
+  
+
+  
+If not specified, the agent device is figured from the first target
+address and the routing table.  If the routing table does not contain a
+route to the target, the IP address defaults to the  in the collector's .
+  
+
+  
+If an agent IP address cannot be determined, sFlow is disabled.
+  
 
 
 
-- 
2.16.1

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


[ovs-dev] [PATCH 2/2] ovs-vswitchd: Do not use system routing table with --disable-system.

2018-03-31 Thread Ben Pfaff
The --disable-system option indicates that the user wants to avoid using
the host's datapath.  This is also a good indication that the user does
not want to use other host resources such as the routing table, so this
commit implements that.

This fixes a failure in the test "ptap - recirculate after packet_type
change" when the host routing table contained an entry that affected the
generated flow.  Without this patch, the commands:

# ip tuntap add mode tun tun0
# ip addr add dev tun0 10.8.0.10

led to a failure in that test.

Reported-by: Timothy Redaelli 
Reported-at: 
https://mail.openvswitch.org/pipermail/ovs-discuss/2018-March/046406.html
Signed-off-by: Ben Pfaff 
---
 lib/ovs-router.c| 19 +--
 lib/ovs-router.h|  3 +++
 vswitchd/ovs-vswitchd.c |  2 ++
 3 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/lib/ovs-router.c b/lib/ovs-router.c
index 0f1103b0ed18..ad8bd629e3ab 100644
--- a/lib/ovs-router.c
+++ b/lib/ovs-router.c
@@ -54,6 +54,10 @@ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 
5);
 static struct ovs_mutex mutex = OVS_MUTEX_INITIALIZER;
 static struct classifier cls;
 
+/* By default, use the system routing table.  For system-independent testing,
+ * the unit tests disable using the system routing table. */
+static bool use_system_routing_table = true;
+
 struct ovs_router_entry {
 struct cls_rule cr;
 char output_bridge[IFNAMSIZ];
@@ -71,13 +75,22 @@ ovs_router_entry_cast(const struct cls_rule *cr)
 return cr ? CONTAINER_OF(cr, struct ovs_router_entry, cr) : NULL;
 }
 
+/* Disables obtaining routes from the system routing table, for testing
+ * purposes. */
+void
+ovs_router_disable_system_routing_table(void)
+{
+use_system_routing_table = false;
+}
+
 static bool
 ovs_router_lookup_fallback(const struct in6_addr *ip6_dst, char 
output_bridge[],
struct in6_addr *src6, struct in6_addr *gw6)
 {
 ovs_be32 src;
 
-if (!route_table_fallback_lookup(ip6_dst, output_bridge, gw6)) {
+if (!use_system_routing_table
+|| !route_table_fallback_lookup(ip6_dst, output_bridge, gw6)) {
 return false;
 }
 if (netdev_get_in4_by_name(output_bridge, (struct in_addr *))) {
@@ -238,7 +251,9 @@ void
 ovs_router_insert(uint32_t mark, const struct in6_addr *ip_dst, uint8_t plen,
   const char output_bridge[], const struct in6_addr *gw)
 {
-ovs_router_insert__(mark, plen, ip_dst, plen, output_bridge, gw);
+if (use_system_routing_table) {
+ovs_router_insert__(mark, plen, ip_dst, plen, output_bridge, gw);
+}
 }
 
 static void
diff --git a/lib/ovs-router.h b/lib/ovs-router.h
index b55b1a50b146..f65d652b053d 100644
--- a/lib/ovs-router.h
+++ b/lib/ovs-router.h
@@ -34,6 +34,9 @@ void ovs_router_insert(uint32_t mark, const struct in6_addr 
*ip_dst,
uint8_t plen,
const char output_bridge[], const struct in6_addr *gw);
 void ovs_router_flush(void);
+
+void ovs_router_disable_system_routing_table(void);
+
 #ifdef  __cplusplus
 }
 #endif
diff --git a/vswitchd/ovs-vswitchd.c b/vswitchd/ovs-vswitchd.c
index 83639357a2ca..414b5478087f 100644
--- a/vswitchd/ovs-vswitchd.c
+++ b/vswitchd/ovs-vswitchd.c
@@ -38,6 +38,7 @@
 #include "openflow/openflow.h"
 #include "ovsdb-idl.h"
 #include "ovs-rcu.h"
+#include "ovs-router.h"
 #include "openvswitch/poll-loop.h"
 #include "simap.h"
 #include "stream-ssl.h"
@@ -219,6 +220,7 @@ parse_options(int argc, char *argv[], char **unixctl_pathp)
 
 case OPT_DISABLE_SYSTEM:
 dp_blacklist_provider("system");
+ovs_router_disable_system_routing_table();
 break;
 
 case '?':
-- 
2.16.1

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


Re: [ovs-dev] [PATCH] ovn-architecture: update description for OVN RBAC wrt Encap table

2018-03-31 Thread Ben Pfaff
Thanks Han and Mark, applied to master.

On Wed, Mar 21, 2018 at 04:49:23PM -0500, Mark Michelson wrote:
> Acked-by: Mark Michelson 
> 
> On 03/16/2018 09:11 PM, Han Zhou wrote:
> >Encap table already supported authentication. Update the out-of-date
> >description.
> >
> >Signed-off-by: Han Zhou 
> >---
> >  ovn/ovn-architecture.7.xml | 4 +---
> >  1 file changed, 1 insertion(+), 3 deletions(-)
> >
> >diff --git a/ovn/ovn-architecture.7.xml b/ovn/ovn-architecture.7.xml
> >index 808b932..ae5ca8e 100644
> >--- a/ovn/ovn-architecture.7.xml
> >+++ b/ovn/ovn-architecture.7.xml
> >@@ -1550,9 +1550,7 @@
> >  Encap
> >  
> >
> >-Authorization: disabled (all clients are considered
> >-to be authorized. Future: add a "creating chassis name" column to
> >-this table and use it for authorization checking.
> >+Authorization: client ID must match the chassis name.
> >
> >
> >  Insert/Delete: row insertion and row deletion
> >
> 
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v4 0/6] Add minimum network namespace support.

2018-03-31 Thread Ben Pfaff
On Thu, Mar 29, 2018 at 11:05:25PM -0300, Flavio Leitner wrote:
> Today Open vSwitch doesn't know about network namespaces (netns), but
> users are moving internal ports to other namespaces.  Although packets
> are still flowing, the daemon fails to find out basic port information,
> like if it is UP or DOWN, for instance.
> 
> This patchset rely on a new kernel vport API recently accepted to find
> out the new network namespace ID of a bridge's port. This information
> along with the port's name recorded in the database is used to match the
> corresponding netlink messages.
> 
> This patchset also leverages another kernel API that allows the daemon
> to listen to all netlink messages from all netns which has an ID assigned
> into it.  This and the previous change allows the userspace to track ports
> in other network namespaces.
> 
> If any of the APIs aren't available, it falls back to the older APIs to
> not break backwards compatibility.

I applied this to master.  Thank you!

I have a request: please submit a patch to add something to NEWS to
explain the new features.

I also have some further thoughts.

First, this patch has an aspect of trying a newer interface then falling
back to an older one.  I did not read the code carefully enough this
time (and do not remember from before) to figure out whether this is
likely to be a performance problem with older kernels.  If it is, that
might bear some improvement.

Second, I think that it is possible to open a Netlink socket for a
particular namespace, which might provide a way to do arbitrary Netlink
operations in a namespace even if the API doesn't support a namespace ID
as a parameter.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] Windows: Fix broken build caused by a bad file extension

2018-03-31 Thread Ben Pfaff
On Tue, Mar 27, 2018 at 08:29:49PM +0300, Alin Gabriel Serdean wrote:
> The compiler (cl) complains:
> `ovsdb/ovsdb-server.c(689) : fatal error C1083:
> Cannot open include file: 'ovsdb/_server.ovsschema.inc':
>No such file or directory`
> (https://ci.appveyor.com/project/blp/ovs/build/1.0.4079#L2586)
> 
> Generated compiler objects have the extension `.obj` on Windows.
> 
> This patch switches to `$(OBJEXT)` instead, so the schema will be generated.
> 
> Signed-off-by: Alin Gabriel Serdean aserd...@ovn.org

Oops!  Thanks for the fix.

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


Re: [ovs-dev] [PATCH] v2, python-windows: Fix unicode python tests on Windows

2018-03-31 Thread Ben Pfaff
On Wed, Mar 28, 2018 at 12:11:18PM +0300, Alin Gabriel Serdean wrote:
> This patch changes the default filesystem encodings to the values used
> before python3.6 to ensure compatibility with older versions.
> 
> Signed-off-by: Alin Gabriel Serdean 
> Co-authored-by: Alin Balutoiu 
> ---
> v2: update commit message

I don't really understand this change, but if it fixes a problem in the
tests then I'm all in favor of it.

If it is not difficult, then I would suggest adding a little more
information to the commit message, such as an example of what goes wrong
without it.

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


Re: [ovs-dev] [PATCH] Use new default nb and sb dbs for sandbox northd:

2018-03-31 Thread Ben Pfaff
On Fri, Mar 23, 2018 at 01:44:52PM -0700, aginwala wrote:
> As per new clustering change, ovn-northd sandbox should use nb1.ovsdb and
> sb1.ovsdb. It was updated in ovn-northd --help section but missed for sandbox.
> This commit fixes the same
> 
> Reported-by: Mark Michelson 
> Reported-at: 
> https://mail.openvswitch.org/pipermail/ovs-dev/2018-March/345535.html
> Signed-off-by: aginwala 

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


Re: [ovs-dev] [PATCH] json: Avoid extra memory allocation and string copy parsing object members.

2018-03-31 Thread Ben Pfaff
Thanks, applied to master.

On Mon, Mar 26, 2018 at 09:53:23AM -0700, Yifeng Sun wrote:
> Thanks for the fix, looks good to me.
> 
> 
> Reviewed-by: Yifeng Sun 
> 
> On Fri, Mar 23, 2018 at 3:46 PM, Ben Pfaff  wrote:
> 
> > Until now, every time the JSON parser added an object member, it made an
> > extra copy of the member name and then freed the original copy.  This is
> > wasteful, so this commit eliminates the extra copy.
> >
> > Signed-off-by: Ben Pfaff 
> > ---
> >  include/openvswitch/json.h  |  1 +
> >  include/openvswitch/shash.h |  1 +
> >  lib/json.c  |  9 +++--
> >  lib/shash.c | 23 +++
> >  4 files changed, 32 insertions(+), 2 deletions(-)
> >
> > diff --git a/include/openvswitch/json.h b/include/openvswitch/json.h
> > index 61b9a02cfc19..bcf6a27826ae 100644
> > --- a/include/openvswitch/json.h
> > +++ b/include/openvswitch/json.h
> > @@ -91,6 +91,7 @@ struct json *json_array_create_3(struct json *, struct
> > json *, struct json *);
> >
> >  struct json *json_object_create(void);
> >  void json_object_put(struct json *, const char *name, struct json *value);
> > +void json_object_put_nocopy(struct json *, char *name, struct json
> > *value);
> >  void json_object_put_string(struct json *,
> >  const char *name, const char *value);
> >  void json_object_put_format(struct json *,
> > diff --git a/include/openvswitch/shash.h b/include/openvswitch/shash.h
> > index afc482364f24..c249e13e1f28 100644
> > --- a/include/openvswitch/shash.h
> > +++ b/include/openvswitch/shash.h
> > @@ -62,6 +62,7 @@ struct shash_node *shash_add_nocopy(struct shash *, char
> > *, const void *);
> >  bool shash_add_once(struct shash *, const char *, const void *);
> >  void shash_add_assert(struct shash *, const char *, const void *);
> >  void *shash_replace(struct shash *, const char *, const void *data);
> > +void *shash_replace_nocopy(struct shash *, char *name, const void *data);
> >  void shash_delete(struct shash *, struct shash_node *);
> >  char *shash_steal(struct shash *, struct shash_node *);
> >  struct shash_node *shash_find(const struct shash *, const char *);
> > diff --git a/lib/json.c b/lib/json.c
> > index 07ca87b2130f..603fd1df8b6a 100644
> > --- a/lib/json.c
> > +++ b/lib/json.c
> > @@ -279,6 +279,12 @@ json_object_put(struct json *json, const char *name,
> > struct json *value)
> >  json_destroy(shash_replace(json->u.object, name, value));
> >  }
> >
> > +void
> > +json_object_put_nocopy(struct json *json, char *name, struct json *value)
> > +{
> > +json_destroy(shash_replace_nocopy(json->u.object, name, value));
> > +}
> > +
> >  void
> >  json_object_put_string(struct json *json, const char *name, const char
> > *value)
> >  {
> > @@ -1217,8 +1223,7 @@ json_parser_put_value(struct json_parser *p, struct
> > json *value)
> >  {
> >  struct json_parser_node *node = json_parser_top(p);
> >  if (node->json->type == JSON_OBJECT) {
> > -json_object_put(node->json, p->member_name, value);
> > -free(p->member_name);
> > +json_object_put_nocopy(node->json, p->member_name, value);
> >  p->member_name = NULL;
> >  } else if (node->json->type == JSON_ARRAY) {
> >  json_array_add(node->json, value);
> > diff --git a/lib/shash.c b/lib/shash.c
> > index 318a30ffc0f0..a8433629ab84 100644
> > --- a/lib/shash.c
> > +++ b/lib/shash.c
> > @@ -166,6 +166,29 @@ shash_replace(struct shash *sh, const char *name,
> > const void *data)
> >  }
> >  }
> >
> > +/* Searches for 'name' in 'sh'.  If it does not already exist, adds it
> > along
> > + * with 'data' and returns NULL.  If it does already exist, replaces its
> > data
> > + * by 'data' and returns the data that it formerly contained.
> > + *
> > + * Takes ownership of 'name'. */
> > +void *
> > +shash_replace_nocopy(struct shash *sh, char *name, const void *data)
> > +{
> > +size_t hash = hash_name(name);
> > +struct shash_node *node;
> > +
> > +node = shash_find__(sh, name, strlen(name), hash);
> > +if (!node) {
> > +shash_add_nocopy__(sh, name, data, hash);
> > +return NULL;
> > +} else {
> > +free(name);
> > +void *old_data = node->data;
> > +node->data = CONST_CAST(void *, data);
> > +return old_data;
> > +}
> > +}
> > +
> >  /* Deletes 'node' from 'sh' and frees the node's name.  The caller is
> > still
> >   * responsible for freeing the node's data, if necessary. */
> >  void
> > --
> > 2.16.1
> >
> > ___
> > dev mailing list
> > d...@openvswitch.org
> > https://mail.openvswitch.org/mailman/listinfo/ovs-dev
> >
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] checkpatch: Avoid warnings for /* or */.

2018-03-31 Thread Ben Pfaff
On Mon, Mar 26, 2018 at 05:44:01PM -0400, Aaron Conole wrote:
> Ben Pfaff  writes:
> 
> > checkpatch would sometimes confuse comment markers for operators.  This
> > fixes the problem.
> >
> > Signed-off-by: Ben Pfaff 
> > ---
> 
> Looks good to me.
> 
> Acked-by: Aaron Conole 

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


Re: [ovs-dev] [PATCH] seq: Avoid some "possible leak" warnings from valgrind.

2018-03-31 Thread Ben Pfaff
Thanks, applied to master.

On Mon, Mar 26, 2018 at 09:50:34AM -0700, Yifeng Sun wrote:
> Thanks for the fix.
> 
> Reviewed-by: Yifeng Sun 
> 
> On Fri, Mar 23, 2018 at 3:46 PM, Ben Pfaff  wrote:
> 
> > valgrind regards a block to be "possibly" leaked when no pointers exist to
> > the beginning of the block but some pointers do point to the middle of the
> > block.  By moving the hmap_node in struct seq_waiter from the middle of the
> > struct to the beginning, as this commit does, the pointers to the node from
> > the hmap in struct seq point to the beginning of the block, which reassures
> > valgrind.
> >
> > Signed-off-by: Ben Pfaff 
> > ---
> >  lib/seq.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/lib/seq.c b/lib/seq.c
> > index a39c809fc39a..6581cb06baa1 100644
> > --- a/lib/seq.c
> > +++ b/lib/seq.c
> > @@ -38,8 +38,8 @@ struct seq {
> >
> >  /* A thread waiting on a particular seq. */
> >  struct seq_waiter {
> > -struct seq *seq OVS_GUARDED;/* Seq being waited for. */
> >  struct hmap_node hmap_node OVS_GUARDED; /* In 'seq->waiters'. */
> > +struct seq *seq OVS_GUARDED;/* Seq being waited for. */
> >  unsigned int ovsthread_id OVS_GUARDED;  /* Key in 'waiters' hmap. */
> >
> >  struct seq_thread *thread OVS_GUARDED;  /* Thread preparing to wait.
> > */
> > --
> > 2.16.1
> >
> > ___
> > dev mailing list
> > d...@openvswitch.org
> > https://mail.openvswitch.org/mailman/listinfo/ovs-dev
> >
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v3] ctl-option: add --inactivity-probe= option in set targets commands

2018-03-31 Thread Ben Pfaff
On Mon, Mar 12, 2018 at 07:23:44PM +0800, Guoshuai Li wrote:
> This patch can set inactivity probe for connection by command:
> ovs-vsctl --inactivity-probe=3 set-manager tcp::6640
> ovs-vsctl --inactivity-probe=3 set-controller tcp::6641
> vtep-ctl  --inactivity-probe=3 set-manager tcp::6640
> ovn-nbctl --inactivity-probe=3 set-connection ptcp:6641:0.0.0.0
> ovn-sbctl --inactivity-probe=3 set-connection ptcp:6642:0.0.0.0
> 
> Signed-off-by: Guoshuai Li 

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


Re: [ovs-dev] [PATCH 1/4] match: Add 'tun_md' member to struct minimatch.

2018-03-31 Thread Ben Pfaff
On Tue, Mar 20, 2018 at 01:46:29PM -0700, Ben Pfaff wrote:
> struct match has had a 'tun_md' member for a long time, but struct
> minimatch has never had one.  This doesn't matter for the purposes for
> which minimatch is currently used, but it means that a minimatch is not
> completely substitutable for a match and therefore blocks some new uses.
> This patch adds the member.
> 
> Signed-off-by: Ben Pfaff 

Thanks to everyone who reviewed and tested these patches.  I applied
them to master.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 1/2] ovn-controller: support MAC_Binding aging

2018-03-31 Thread Ben Pfaff
On Thu, Mar 15, 2018 at 05:20:11PM +0800, Guoshuai Li wrote:
> Add the MAC_Binding aging. The default aging time is 20 minutes.
> Send the ARP request at 10(1*20/2), 13(2*20/3), 15(3*20/4) minutes.
> If no ARP reply is received within 20 minutes, the MAC_Binding column will be
> deleted.
> 
> Sync a MAC_Binding cache in the ovn-controller where lport redirect chassis,
> to records timestamps and ARP send times. Time traversal cache to send ARP
> requests or aging.
> 
> Signed-off-by: Guoshuai Li 

Thanks for working on adding support for this.

In addition to Mark Michelson's comment about IPv6 support, I think that
it is important to document how aging works.  I guess that
ovn/ovn-sb.xml, in the MAC_Binding table, is the right way to do that.
There is already a description of the lifetime of a MAC binding, and
aging could naturally be added to it.

I haven't reviewed the code in this patch yet.  I guess that having the
documentation will make it easier to review, so I'll wait for that.

Thanks,

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


Re: [ovs-dev] [PATCH] ovsdb-idl.at: Fix test failed. (writing large data via IDL with unicode)

2018-03-31 Thread Ben Pfaff
On Thu, Mar 22, 2018 at 02:32:34PM +0800, Guoshuai Li wrote:
> The uuidfilt command is not supported in branch 2.8 and earlier.
> Modify the test so that it can be tested successfully.
> 
> Signed-off-by: Guoshuai Li 
> ---
> 
> This patch is for branch-2.8/branch-2.7.

Thank you.  I applied this to both of those branches.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


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

2018-03-31 Thread Ben Pfaff
On Fri, Mar 23, 2018 at 05:28:49PM +, Stokes, Ian wrote:
> Hi Ben,
> 
> The following changes since commit d041ec2ecc5d03481ce0f503f58f25b4a3179f32:
> 
>   datapath-windows: fix hash creation on ct mark (2018-02-27 21:32:13 +0200)
> 
> are available in the git repository at:
> 
>   https://github.com/istokes/ovs dpdk_merge_2_7
> 
> for you to fetch changes up to 5fd8e85a8240b6c01f82a4c441e40f62dec3146a:
> 
>   netdev-dpdk: Remove 'error' from non error log. (2018-03-23 11:55:45 +)

Thanks!  Pushed to branch-2.7.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


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

2018-03-31 Thread Ben Pfaff
On Fri, Mar 23, 2018 at 05:28:36PM +, Stokes, Ian wrote:
> Hi Ben,
> 
> The following changes since commit 16596279409827b2e0af2420888d7024d10ab99d:
> 
>   odp-util: Print eth() for Ethernet flows if packet_type is absent. 
> (2018-03-14 16:47:08 -0700)
> 
> are available in the git repository at:
> 
>   https://github.com/istokes/ovs dpdk_merge_2_8
> 
> for you to fetch changes up to 3c70cfdff390ea8f300bde9e76fce68a4e68:
> 
>   netdev-dpdk: Limit rate of DPDK logs. (2018-03-23 12:56:41 +)

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


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

2018-03-31 Thread Ben Pfaff
On Fri, Mar 23, 2018 at 05:28:20PM +, Stokes, Ian wrote:
> The following changes since commit 1e8b6b45f8ef2e311774d256ea41e23df5d78930:
> 
>   lib/tc: Handle error parsing action in nl_parse_single_action (2018-03-21 
> 11:09:07 +0100)
> 
> are available in the git repository at:
> 
>   https://github.com/istokes/ovs dpdk_merge_2_9
> 
> for you to fetch changes up to f9d14ccc1c1cb7cfd21072a24862682f9fe9ad1f:
> 
>   netdev-dpdk: Limit rate of DPDK logs. (2018-03-23 12:56:03 +)

Thanks, merged into branch-2.9.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 0/8] Split up the DPDK howto

2018-03-31 Thread Ben Pfaff
Hi Ian.  I have not seen much feedback on this series.  Are you thinking
about merging it?  Stephen's contributions to the documentation are,
ordinarily, quite valuable.

Thanks,

Ben.

On Mon, Feb 12, 2018 at 06:12:58PM +, Stephen Finucane wrote:
> The DPDK howto has slowly morphed into a catch all for everything DPDK,
> which goes against the original design goal for 'howto' documents [*].
> This series attempts to return some sanity to the universe by splitting
> this document into many more 'topic' documents. Along the way, we add a
> lot of semantic markup, rework some text, and add an overview on
> 'dpdk'-type ports (the original goal here).
> 
> There's a good chance I've made some mistakes in the process and I've
> left TODOs for someone to resolve now or at a future date. I welcome
> feedback on both of these.
> 
> Now to go back to figure how exactly NUMA affinity works for and affects
> PMD threads...
> 
> [*] 'howto' documents are supposed to be brief, high-level overviews on
> a particular group of features, with a focus on the user. They're
> not as all-encompassing as a 'tutorial', but not as specific as a
> 'topic'.
> 
> Stephen Finucane (8):
>   doc: Add an overview of the 'dpdk' port
>   doc: Add "PMD" topic document
>   doc: Move additional sections to "physical ports" doc
>   doc: Move "QoS" guide to its own document
>   doc: Add "bridge" topic document
>   doc: Move "pdump" guide to its own document
>   doc: Split Jumbo Frames guide between two docs
>   doc: Final cleanup of the DPDK howto
> 
>  Documentation/conf.py|   2 +-
>  Documentation/howto/dpdk.rst | 453 
> +++
>  Documentation/topics/dpdk/bridge.rst | 103 +++
>  Documentation/topics/dpdk/index.rst  |  11 +
>  Documentation/topics/dpdk/pdump.rst  |  65 +
>  Documentation/topics/dpdk/phy.rst| 242 +
>  Documentation/topics/dpdk/pmd.rst| 139 ++
>  Documentation/topics/dpdk/qos.rst| 100 +++
>  Documentation/topics/dpdk/vhost-user.rst |  53 +++-
>  9 files changed, 740 insertions(+), 428 deletions(-)
>  create mode 100644 Documentation/topics/dpdk/bridge.rst
>  create mode 100644 Documentation/topics/dpdk/pdump.rst
>  create mode 100644 Documentation/topics/dpdk/phy.rst
>  create mode 100644 Documentation/topics/dpdk/pmd.rst
>  create mode 100644 Documentation/topics/dpdk/qos.rst
> 
> -- 
> 2.14.3
> 
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


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

2018-03-31 Thread Ben Pfaff
On Fri, Mar 23, 2018 at 05:28:01PM +, Stokes, Ian wrote:
> The following changes since commit 83e866067ea67807e573c64fc6ee69d47f6d5b7c:
> 
>   netdev-tc-offloads: Add support for IP fragmentation (2018-03-21 09:59:29 
> +0100)
> 
> are available in the git repository at:
> 
>   https://github.com/istokes/ovs dpdk_merge
> 
> for you to fetch changes up to 9fd38f6867df90a35aa276388e18a159f61e8367:
> 
>   netdev-dpdk: Limit rate of DPDK logs. (2018-03-23 12:53:36 +)

Thanks!  I merged this into master.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] Netmap implementation in OVS

2018-03-31 Thread Ben Pfaff
On Thu, Mar 22, 2018 at 12:27:09PM +0100, Alessandro Rosetti wrote:
> my name is Alessandro Rosetti and I'd like some feedback on my work.
> I wrote a patch that implements a new netdev that uses Netmap framework for
> fast packet I/O in ovs.
> I'm working on this for University of Pisa. My group develops Netmap and
> intends to mantain the support in ovs. (Giuseppe Lettieri:g.lettieri@
> iet.unipi.it, Vincenzo Maffione:v.maffi...@gmail.com)

I welcome adding netmap support to Open vSwitch, as long as it is done
cleanly.  It sounds like that is important to you too.  I'll look
forward to seeing the patches when they are available (I have not
noticed them yet).
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] lib/tc: Fix sparse warnings.

2018-03-31 Thread Ben Pfaff
On Thu, Mar 22, 2018 at 12:38:16PM +0200, Roi Dayan wrote:
> 
> 
> On 21/03/2018 22:11, Ian Stokes wrote:
> >"sparse" complains with the warning 'incorrect type in argument 1
> >(different base types)' in function nl_parse_flower_ip when parsing a key
> >flag and in function nl_msg_put_flower_options when writing the key
> >flag. Fix this by using network byte order when reading and writing key
> >flags to netlink messages.
> >
> >Fixes: 83e86606 ("netdev-tc-offloads: Add support for IP fragmentation")
> >CC: Roi Dayan 
> >Signed-off-by: Ian Stokes 
> >---
> >  lib/tc.c | 9 +
> >  1 file changed, 5 insertions(+), 4 deletions(-)
> >
> >diff --git a/lib/tc.c b/lib/tc.c
> >index c446d84..6daa447 100644
> >--- a/lib/tc.c
> >+++ b/lib/tc.c
> >@@ -377,8 +377,9 @@ nl_parse_flower_ip(struct nlattr **attrs, struct 
> >tc_flower *flower) {
> >  }
> >  if (attrs[TCA_FLOWER_KEY_FLAGS_MASK]) {
> >-key->flags = ntohl(nl_attr_get_u32(attrs[TCA_FLOWER_KEY_FLAGS]));
> >-mask->flags = 
> >ntohl(nl_attr_get_u32(attrs[TCA_FLOWER_KEY_FLAGS_MASK]));
> >+key->flags = ntohl(nl_attr_get_be32(attrs[TCA_FLOWER_KEY_FLAGS]));
> >+mask->flags =
> >+ntohl(nl_attr_get_be32(attrs[TCA_FLOWER_KEY_FLAGS_MASK]));
> >  }
> >  if (attrs[TCA_FLOWER_KEY_IPV4_SRC_MASK]) {
> >@@ -1503,9 +1504,9 @@ nl_msg_put_flower_options(struct ofpbuf *request, 
> >struct tc_flower *flower)
> >  }
> >  if (flower->mask.flags) {
> >-nl_msg_put_u32(request, TCA_FLOWER_KEY_FLAGS,
> >+nl_msg_put_be32(request, TCA_FLOWER_KEY_FLAGS,
> > htonl(flower->key.flags));
> >-nl_msg_put_u32(request, TCA_FLOWER_KEY_FLAGS_MASK,
> >+nl_msg_put_be32(request, TCA_FLOWER_KEY_FLAGS_MASK,
> > htonl(flower->mask.flags));
> >  }
> >
> 
> Acked-by: Roi Dayan 

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


Re: [ovs-dev] using pki other than ovs-pki for SSL in openvswitch

2018-03-31 Thread Ben Pfaff
On Wed, Mar 28, 2018 at 10:47:46AM -0700, Manish Regmi wrote:
>We are trying to use SSL using set-controller to communicate
> between ovs-ofctl and ovs daemon.
> Is it possible to use keys and certs generated by other PKI
> infrastructure (say vault). I could not find any info on this. is it
> possible? is there a tutorial or other info about this?

Any PKI infrastructure should work.  ovs-pki is only provided for
convenience.  It just generates keys and certificates; you can generate
them any other way.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev