Re: [ovs-dev] The Patch netdev-dpdk: add TSO support for vhost-user ports

2016-10-14 Thread Kavanagh, Mark B
>
>
>Hi, Mark
>
>
>OK, once it's ready, pls let me know and I'm glade to help to test it.
>
>
>BTW, you mentioned the gap, is that the TSO and CSUM of tunnel offload?
>I'm familiar with it, and I hope I could do something on it if possible.

Yes, that's what it was. 

Commits have recently been introduced to DPDK that introduce additional flags 
for tunnel offloading, but I haven't had a chance to test them with in my 
TSO+VxLAN codebase.

Thanks,
Mark

>
>
>2016/10/11 22:34, Kavanagh, Mark B :
>>> Hi,  all
>>>
>>>
>>> This patch is very important for users want to improve the performance
>>> of the large packets.
>>>
>>>
>>> But you know, in data center, lots of networks using vxlan, so if it
>>> supports vxlan, then it will be very useful.
>>>
>>>
>>> Would you guys has a plan to support it? I would like to help test it,
>>> or work together on it?
>> Hi Michael,
>>
>> Some work has already been done to enable TSO over VxLAN, but it was blocked 
>> until
>recently, on account of gaps in the DPKD i40e PMD's support for tunnel offload.
>>
>> We believe that those gaps have now been addressed; our current focus is on 
>> ironing out the
>issues in TSO support over flat and VLAN networks - once that's done, we plan 
>to resume work
>on VxLAN support (and GRE, IPinIP).
>>
>> Hope this helps,
>> Mark
>>
>>>
>>> --
>>> Thanks,
>>> Michael
>>>
>
>--
>Thanks,
>Michael
>

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


Re: [ovs-dev] The Patch netdev-dpdk: add TSO support for vhost-user ports

2016-10-14 Thread Kavanagh, Mark B
>
>Hi, Mark
>
>
>I have reviewed your RFC patch, I found one place could have issue, see
>below:
>
>
>+if (v > ETHER_MAX_LEN) {
>+b->mbuf.data_len =
>+(uint16_t)(b->mbuf.buf_len - b->mbuf.data_off);
>+} else {
>+b->mbuf.data_len = (uint16_t)v;
>+}
>+
>
>Here, what will happen if v > ETHER_MAX_LEN but v < (b->mbuf.buf_len -
>b->mbuf.data_off) ?
>
>The driver will be get wrong data lenth in my option.
>
>probably, below is right :
>if (v > (b->mbuf.buf_len - b->mbuf.data_off))
> b->mbuf.data_len = (uint16_t)(b->mbuf.buf_len - b->mbuf.data_off);

Yes, you’re right - I have the same code in my local repo :)

>
>
>Thanks,
>Michael
>
>在 2016/10/11 22:34, Kavanagh, Mark B 写道:
>>> Hi,  all
>>>
>>>
>>> This patch is very important for users want to improve the performance
>>> of the large packets.
>>>
>>>
>>> But you know, in data center, lots of networks using vxlan, so if it
>>> supports vxlan, then it will be very useful.
>>>
>>>
>>> Would you guys has a plan to support it? I would like to help test it,
>>> or work together on it?
>> Hi Michael,
>>
>> Some work has already been done to enable TSO over VxLAN, but it was blocked 
>> until
>recently, on account of gaps in the DPKD i40e PMD's support for tunnel offload.
>>
>> We believe that those gaps have now been addressed; our current focus is on 
>> ironing out the
>issues in TSO support over flat and VLAN networks - once that's done, we plan 
>to resume work
>on VxLAN support (and GRE, IPinIP).
>>
>> Hope this helps,
>> Mark
>>
>>>
>>> --
>>> Thanks,
>>> Michael
>>>
>
>--
>Thanks,
>Michael
>

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


Re: [ovs-dev] [PATCH v3 1/4] ovn: ovn-ctl support for HA ovn DB servers

2016-10-14 Thread Babu Shanmugam



On Friday 14 October 2016 04:00 AM, Andy Zhou wrote:



Done. Now it shows the following.

[root@h2 ovs]# crm configure show

node1: h1 \

attributes

node2: h2

primitiveClusterIP IPaddr2 \

paramsip=10.33.75.200cidr_netmask=32\

opstart interval=0stimeout=20s\

opstop interval=0stimeout=20s\

opmonitor interval=30s

primitiveovndb ocf:ovn:ovndb-servers \

opstart interval=0stimeout=30s\

opstop interval=0stimeout=20s\

oppromote interval=0stimeout=50s\

opdemote interval=0stimeout=50s\

opmonitor interval=1min\

meta

msovndb-master ovndb\

metanotify=true

colocationcolocation-ovndb-master-ClusterIP-INFINITY inf:
ovndb-master:Started ClusterIP:Master

orderorder-ClusterIP-ovndb-master-mandatory inf: ClusterIP:start
ovndb-master:start

propertycib-bootstrap-options: \

have-watchdog=false\

dc-version=1.1.13-10.el7_2.4-44eb2dd\

cluster-infrastructure=corosync\

cluster-name=mycluster\

stonith-enabled=false

propertyovn_ovsdb_master_server: \




My installation does not have ocf-tester,  There is a program called 
ocft with a test option. Not sure if this is a suitable replacement. 
If not, how could I get
the ocf-tester program? I ran the ocft program and get the following 
output. Not sure what it means.


 [root@h2 ovs]# ocft test -n test-ovndb -o master_ip 10.0.0.1 
/usr/share/openvswitch/scripts/ovndb-servers.ocf


ERROR: cases directory not found.




I have attached ocf-tester with this mail. I guess it's a standalone 
script. If it does not work, I think it's better not to attempt anymore 
as we have another way to find out.





Alternately, you can check if the ovsdb servers are started
properly by running

/usr/share/openvswitch/scripts/ovn-ctl --db-sb-sync-from=10.0.0.1
--db-nb-sync-from=10.0.0.1 start_ovsdb


The output are as follows. Should we use --db-sb-sync-from-addr instead?
 [root@h2 ovs]# /usr/share/openvswitch/scripts/ovn-ctl 
--db-sb-sync-from=10.0.0.1 --db-nb-sync-from=10.0.0.1 start_ovsdb


/usr/share/openvswitch/scripts/ovn-ctl: unknown option 
"--db-sb-sync-from=10.0.0.1" (use --help for help)


/usr/share/openvswitch/scripts/ovn-ctl: unknown option 
"--db-nb-sync-from=10.0.0.1" (use --help for help)


'ovn-ctl' runs without any error message after I fixed the command 
line parameter.


I am sorry for the misinformation, Andy. What you ran is correct. Could 
you check the status of the ovsdb servers in h2 after you run the above 
command using the following commands.


ovn-ctl status_ovnnb
ovn-ctl status_ovnsb

Both the above commands should return "running/backup". If you see in 
the OCF script in the function ovsdb_server_start(), we wait 
indefinitely till  the DB servers are started. Since the 'start' action 
on h2 times out, I doubt that the servers are not started properly.




I think this is mostly due to the crm configuration. Once you add
the 'ms' and 'colocation' resources, you should be able to
overcome this problem.

No, ovndb still failed to launch on h2.

[root@h2 ovs]# crm status

Last updated: Thu Oct 13 11:27:42 2016Last change: Thu Oct 13 11:17:25 
2016 by root via cibadmin on h2


Stack: corosync

Current DC: h2 (version 1.1.13-10.el7_2.4-44eb2dd) - partition with quorum

2 nodes and 3 resources configured


*Online*: [ h1 h2 ]


Full list of resources:


*ClusterIP*(ocf::heartbeat:IPaddr2):*Started*h1

*Master*/*Slave*Set: ovndb-*master*[ovndb]

*Master*s: [ h1 ]

*Stopped*: [ h2 ]


Failed Actions:

* ovndb_start_0 on h2 '*unknown error*' (1): call=39, status=*Timed 
Out*, exitreason='none',


last-rc-change='Wed Oct 12 14:43:03 2016', queued=0ms, exec=30003

I have never tried colocating two resources with the ClusterIP
resource. Just for testing, is it possible to drop the WebServer
resource?

Done.  It did not make any difference that I can see.



#!/bin/sh
#
#   $Id: ocf-tester,v 1.2 2006/08/14 09:38:20 andrew Exp $
#
# Copyright (c) 2006 Novell Inc, Andrew Beekhof
#All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it would be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# Further, this software is distributed without any warranty that it is
# free of the rightful claim of any third person regarding infringement
# or the like.  Any license provided herein, whether implied or
# otherwise, applies only to this software file.  Patent licenses, if
# any, provided herein do not apply to combinations of this program with
# other software, or any other product whatsoever.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write the

Re: [ovs-dev] The Patch netdev-dpdk: add TSO support for vhost-user ports

2016-10-14 Thread 网易
OK, Thanks for your info.

BTW, you mentioned the gap, is it the tunneling tso can't work correctly for 
multi-segments mbuf, and after some packets, guest is unable to xmit 
packets(dpdk driver failed to work any more)?

Thanks,
Michael

2016年10月14日,下午5:15,Kavanagh, Mark B  :

>> 
>> 
>> Hi, Mark
>> 
>> 
>> OK, once it's ready, pls let me know and I'm glade to help to test it.
>> 
>> 
>> BTW, you mentioned the gap, is that the TSO and CSUM of tunnel offload?
>> I'm familiar with it, and I hope I could do something on it if possible.
> 
> Yes, that's what it was. 
> 
> Commits have recently been introduced to DPDK that introduce additional flags 
> for tunnel offloading, but I haven't had a chance to test them with in my 
> TSO+VxLAN codebase.
> 
> Thanks,
> Mark
> 
>> 
>> 
>> 2016/10/11 22:34, Kavanagh, Mark B :
 Hi,  all
 
 
 This patch is very important for users want to improve the performance
 of the large packets.
 
 
 But you know, in data center, lots of networks using vxlan, so if it
 supports vxlan, then it will be very useful.
 
 
 Would you guys has a plan to support it? I would like to help test it,
 or work together on it?
>>> Hi Michael,
>>> 
>>> Some work has already been done to enable TSO over VxLAN, but it was 
>>> blocked until
>> recently, on account of gaps in the DPKD i40e PMD's support for tunnel 
>> offload.
>>> 
>>> We believe that those gaps have now been addressed; our current focus is on 
>>> ironing out the
>> issues in TSO support over flat and VLAN networks - once that's done, we 
>> plan to resume work
>> on VxLAN support (and GRE, IPinIP).
>>> 
>>> Hope this helps,
>>> Mark
>>> 
 
 --
 Thanks,
 Michael
>> 
>> --
>> Thanks,
>> Michael
> 


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


Re: [ovs-dev] [PATCH v2 01/12] dpcls: Use 32 packet batches for lookups.

2016-10-14 Thread Fischetti, Antonio
Thanks for your comments Daniele, my replies inline.

Antonio

> -Original Message-
> From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Daniele Di
> Proietto
> Sent: Friday, October 14, 2016 3:08 AM
> To: Bodireddy, Bhanuprakash 
> Cc: dev@openvswitch.org
> Subject: Re: [ovs-dev] [PATCH v2 01/12] dpcls: Use 32 packet batches for
> lookups.
> 
> I think this looks good, thanks.
> 
> I have a few comments inline to simplify the code a little bit more.
> 
> 2016-10-13 2:58 GMT-07:00 Bhanuprakash Bodireddy <
> bhanuprakash.bodire...@intel.com>:
> 
> > This patch increases the number of packets processed in a batch during a
> > lookup from 16 to 32. Processing batches of 32 packets improves
> > performance and also one of the internal loops can be avoided here.
> >
> > Signed-off-by: Antonio Fischetti 
> > Co-authored-by: Bhanuprakash Bodireddy
> 
> > ---
> >  lib/dpif-netdev.c | 110 +++---
> > 
> >  1 file changed, 47 insertions(+), 63 deletions(-)
> >
> > diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
> > index eb9f764..3b3556a 100644
> > --- a/lib/dpif-netdev.c
> > +++ b/lib/dpif-netdev.c
> > @@ -4985,23 +4985,21 @@ dpcls_lookup(struct dpcls *cls, const struct
> > netdev_flow_key keys[],
> >   int *num_lookups_p)
> >  {
> >  /* The received 'cnt' miniflows are the search-keys that will be
> > processed
> > - * in batches of 16 elements.  N_MAPS will contain the number of
> these
> > - * 16-elements batches.  i.e. for 'cnt' = 32, N_MAPS will be 2.
> The
> > batch
> > - * size 16 was experimentally found faster than 8 or 32. */
> > -typedef uint16_t map_type;
> > + * to find a matching entry into the available subtables.
> > + * The number of bits in map_type is equal to NETDEV_MAX_BURST. */
> > +typedef uint32_t map_type;
> >  #define MAP_BITS (sizeof(map_type) * CHAR_BIT)
> > +BUILD_ASSERT_DECL(MAP_BITS >= NETDEV_MAX_BURST);
> >
> > -#if !defined(__CHECKER__) && !defined(_WIN32)
> > -const int N_MAPS = DIV_ROUND_UP(cnt, MAP_BITS);
> > -#else
> > -enum { N_MAPS = DIV_ROUND_UP(NETDEV_MAX_BURST, MAP_BITS) };
> > -#endif
> > -map_type maps[N_MAPS];
> >  struct dpcls_subtable *subtable;
> >
> > -memset(maps, 0xff, sizeof maps);
> > -if (cnt % MAP_BITS) {
> > -maps[N_MAPS - 1] >>= MAP_BITS - cnt % MAP_BITS; /* Clear extra
> > bits. */
> > +map_type keys_map = 0x;
> >
> 
> Can we use TYPE_MAXIMUM(map_type) instead of 0x?
[Antonio F] Sure, will do.

> 
> 
> > +map_type found_map;
> > +uint32_t hashes[MAP_BITS];
> > +const struct cmap_node *nodes[MAP_BITS];
> >
> 
> The above three variables can be moved inside the look
[Antonio F] We moved them outside of the loop, otherwise we found
a slight performance drop.

> 
> 
> > +
> > +if (OVS_UNLIKELY(cnt != NETDEV_MAX_BURST)) {
> >
> 
> I'm not sure the OVS_UNLIKELY is important here.
> 
> I'll leave it up to you.
[Antonio F] Agree, it's better to remove it.  It could make
sense in a test environment, with EMC disabled.

> 
> 
> > +keys_map >>= NETDEV_MAX_BURST - cnt; /* Clear extra bits. */
> >  }
> >  memset(rules, 0, cnt * sizeof *rules);
> >
> > @@ -5017,59 +5015,45 @@ dpcls_lookup(struct dpcls *cls, const struct
> > netdev_flow_key keys[],
> >  PVECTOR_FOR_EACH (subtable, &cls->subtables) {
> >  const struct netdev_flow_key *mkeys = keys;
> >  struct dpcls_rule **mrules = rules;
> >
> 
> Are the two variables above still necessary?  I think they're not
[Antonio F] You're right, will remove.

> 
> 
> > -map_type remains = 0;
> > -int m;
> > -
> > -BUILD_ASSERT_DECL(sizeof remains == sizeof *maps);
> > -
> > -/* Loops on each batch of 16 search-keys. */
> > -for (m = 0; m < N_MAPS; m++, mkeys += MAP_BITS, mrules +=
> > MAP_BITS) {
> > -uint32_t hashes[MAP_BITS];
> > -const struct cmap_node *nodes[MAP_BITS];
> > -unsigned long map = maps[m];
> > -int i;
> > -
> > -if (!map) {
> > -continue; /* Skip empty maps. */
> > -}
> > -
> > -/* Compute hashes for the remaining keys.  Each search-key
> is
> > - * masked with the subtable's mask to avoid hashing the
> > wildcarded
> > - * bits. */
> > -ULLONG_FOR_EACH_1(i, map) {
> > -hashes[i] = netdev_flow_key_hash_in_mask(&mkeys[i],
> > - &subtable-
> >mask);
> > -}
> > -/* Lookup. */
> > -map = cmap_find_batch(&subtable->rules, map, hashes,
> nodes);
> > -/* Check results.  When the i-th bit of map is set, it
> means
> > that a
> > - * set of nodes with a matching hash value was found for
> the
> > i-th
> > - * search-key.  Due to possible hash collisions we need to
> > check
> > - * w

[ovs-dev] [RFC] [PATCH] ovn: Support sample action in logical datapath

2016-10-14 Thread Valentine Sinitsyn

Hi all,

This is a quick attempt to implement sample action at logical port 
level.The goal is to export IPFIX flows for logical ports, yet it is 
easy to extend this approach to logical switches as well.


Nothing is done to provision OVS instances with required 
Flow_Sample_Collector_Set and IPFIX entries at this point.


Does the approach I take looks sensible? If so, I can add tests and 
re-send this patch for in-depth review.


Many thanks.

Signed-off-by: Valentine Sinitsyn 

---
 include/ovn/actions.h |  12 +-
 ovn/lib/actions.c | 102 
++

 ovn/northd/ovn-northd.c   |  77 --
 ovn/ovn-nb.ovsschema  |  32 +--
 ovn/ovn-nb.xml|  36 
 ovn/utilities/ovn-nbctl.c |   5 +++
 ovn/utilities/ovn-trace.c |   4 ++
 7 files changed, 260 insertions(+), 8 deletions(-)

diff --git a/include/ovn/actions.h b/include/ovn/actions.h
index 2905937..7dc4bb9 100644
--- a/include/ovn/actions.h
+++ b/include/ovn/actions.h
@@ -66,7 +66,8 @@ struct simap;
 OVNACT(GET_ND,ovnact_get_mac_bind)  \
 OVNACT(PUT_ND,ovnact_put_mac_bind)  \
 OVNACT(PUT_DHCPV4_OPTS, ovnact_put_dhcp_opts)   \
-OVNACT(PUT_DHCPV6_OPTS, ovnact_put_dhcp_opts)
+OVNACT(PUT_DHCPV6_OPTS, ovnact_put_dhcp_opts)   \
+OVNACT(SAMPLE,   ovnact_sample)
  /* enum ovnact_type, with a member OVNACT_ for each action. */
 enum OVS_PACKED_ENUM ovnact_type {
@@ -219,6 +220,15 @@ struct ovnact_put_dhcp_opts {
 size_t n_options;
 };
 +/* OVNACT_SAMPLE */
+struct ovnact_sample {
+struct ovnact ovnact;
+uint32_t collector_set_id;
+uint32_t probability;
+uint32_t obs_domain_id;
+uint32_t obs_point_id;
+};
+
 /* Internal use by the helpers below. */
 void ovnact_init(struct ovnact *, enum ovnact_type, size_t len);
 void *ovnact_put(struct ofpbuf *, enum ovnact_type, size_t len);
diff --git a/ovn/lib/actions.c b/ovn/lib/actions.c
index 59131dd..e1debb3 100644
--- a/ovn/lib/actions.c
+++ b/ovn/lib/actions.c
@@ -1614,6 +1614,106 @@ free_PUT_DHCPV6_OPTS(struct ovnact_put_dhcp_opts 
*pdo)

 {
 free_put_dhcp_opts(pdo);
 }
+
+static bool
+parse_sample_arg_get_int_helper(struct lexer *lexer, uint32_t *out)
+{
+if (!lexer_force_match(lexer, LEX_T_EQUALS)) {
+   return false;
+}
+if (lexer->token.type == LEX_T_INTEGER) {
+   *out = ntohl(lexer->token.value.be32_int);
+} else {
+   lexer_syntax_error(lexer, "expecting integer");
+   return false;
+}
+lexer_get(lexer);
+return true;
+}
+
+static void
+parse_sample_args(struct action_context *ctx,
+  struct ovnact_sample *cc)
+{
+bool ok;
+
+if (lexer_match_id(ctx->lexer, "collector_set_id")) {
+   ok = parse_sample_arg_get_int_helper(ctx->lexer,
+&cc->collector_set_id);
+   if (!ok)
+   return;
+} else if (lexer_match_id(ctx->lexer, "probability")) {
+   ok = parse_sample_arg_get_int_helper(ctx->lexer,
+&cc->probability);
+   if (!ok)
+   return;
+} else if (lexer_match_id(ctx->lexer, "obs_domain_id")) {
+   ok = parse_sample_arg_get_int_helper(ctx->lexer,
+&cc->obs_domain_id);
+   if (!ok)
+   return;
+} else if (lexer_match_id(ctx->lexer, "obs_point_id")) {
+   ok = parse_sample_arg_get_int_helper(ctx->lexer,
+&cc->obs_point_id);
+   if (!ok)
+   return;
+} else {
+lexer_syntax_error(ctx->lexer, NULL);
+}
+}
+
+static void
+parse_SAMPLE(struct action_context *ctx)
+{
+struct ovnact_sample *sample = ovnact_put_SAMPLE(ctx->ovnacts);
+if (lexer_match(ctx->lexer, LEX_T_LPAREN)) {
+while (!lexer_match(ctx->lexer, LEX_T_RPAREN)) {
+parse_sample_args(ctx, sample);
+if (ctx->lexer->error) {
+return;
+}
+lexer_match(ctx->lexer, LEX_T_COMMA);
+}
+}
+
+if (!sample->probability)
+   lexer_error(ctx->lexer, "sample probability can't be zero");
+}
+
+static void
+encode_SAMPLE(const struct ovnact_sample *sample,
+  const struct ovnact_encode_params *ep OVS_UNUSED,
+  struct ofpbuf *ofpacts)
+{
+struct ofpact_sample *action = ofpact_put_SAMPLE(ofpacts);
+action->collector_set_id = sample->collector_set_id;
+/* sampling is 16 bit wide in the northbound database */
+action->probability = (uint16_t)sample->probability;
+action->obs_domain_id = sample->obs_domain_id;
+action->obs_point_id = sample->obs_point_id;
+action->sampling_port = OFPP_NONE;
+}
+
+static void
+format_SAMPLE(const struct ovnact_sample *sample, struct ds *s)
+{
+ds_put_format(s,
+ "sample(collector_set_id=%" PRIu32 \
+ ", probability=%" PRIu32 \
+ "

Re: [ovs-dev] [RFC] [PATCH] ovn: Support sample action in logical datapath

2016-10-14 Thread Valentine Sinitsyn

Looks like Thunderbird messed up my patch when sending it.
Sorry for that - although I hope it shouldn't be a problem for a 
high-level review.


Best,
Valentine

On 14.10.2016 16:35, Valentine Sinitsyn wrote:

Hi all,

This is a quick attempt to implement sample action at logical port
level.The goal is to export IPFIX flows for logical ports, yet it is
easy to extend this approach to logical switches as well.

Nothing is done to provision OVS instances with required
Flow_Sample_Collector_Set and IPFIX entries at this point.

Does the approach I take looks sensible? If so, I can add tests and
re-send this patch for in-depth review.

Many thanks.

Signed-off-by: Valentine Sinitsyn 

---
 include/ovn/actions.h |  12 +-
 ovn/lib/actions.c | 102
++
 ovn/northd/ovn-northd.c   |  77 --
 ovn/ovn-nb.ovsschema  |  32 +--
 ovn/ovn-nb.xml|  36 
 ovn/utilities/ovn-nbctl.c |   5 +++
 ovn/utilities/ovn-trace.c |   4 ++
 7 files changed, 260 insertions(+), 8 deletions(-)

diff --git a/include/ovn/actions.h b/include/ovn/actions.h
index 2905937..7dc4bb9 100644
--- a/include/ovn/actions.h
+++ b/include/ovn/actions.h
@@ -66,7 +66,8 @@ struct simap;
 OVNACT(GET_ND,ovnact_get_mac_bind)  \
 OVNACT(PUT_ND,ovnact_put_mac_bind)  \
 OVNACT(PUT_DHCPV4_OPTS, ovnact_put_dhcp_opts)   \
-OVNACT(PUT_DHCPV6_OPTS, ovnact_put_dhcp_opts)
+OVNACT(PUT_DHCPV6_OPTS, ovnact_put_dhcp_opts)   \
+OVNACT(SAMPLE,  ovnact_sample)
  /* enum ovnact_type, with a member OVNACT_ for each action. */
 enum OVS_PACKED_ENUM ovnact_type {
@@ -219,6 +220,15 @@ struct ovnact_put_dhcp_opts {
 size_t n_options;
 };
 +/* OVNACT_SAMPLE */
+struct ovnact_sample {
+struct ovnact ovnact;
+uint32_t collector_set_id;
+uint32_t probability;
+uint32_t obs_domain_id;
+uint32_t obs_point_id;
+};
+
 /* Internal use by the helpers below. */
 void ovnact_init(struct ovnact *, enum ovnact_type, size_t len);
 void *ovnact_put(struct ofpbuf *, enum ovnact_type, size_t len);
diff --git a/ovn/lib/actions.c b/ovn/lib/actions.c
index 59131dd..e1debb3 100644
--- a/ovn/lib/actions.c
+++ b/ovn/lib/actions.c
@@ -1614,6 +1614,106 @@ free_PUT_DHCPV6_OPTS(struct ovnact_put_dhcp_opts
*pdo)
 {
 free_put_dhcp_opts(pdo);
 }
+
+static bool
+parse_sample_arg_get_int_helper(struct lexer *lexer, uint32_t *out)
+{
+if (!lexer_force_match(lexer, LEX_T_EQUALS)) {
+return false;
+}
+if (lexer->token.type == LEX_T_INTEGER) {
+*out = ntohl(lexer->token.value.be32_int);
+} else {
+lexer_syntax_error(lexer, "expecting integer");
+return false;
+}
+lexer_get(lexer);
+return true;
+}
+
+static void
+parse_sample_args(struct action_context *ctx,
+  struct ovnact_sample *cc)
+{
+bool ok;
+
+if (lexer_match_id(ctx->lexer, "collector_set_id")) {
+ok = parse_sample_arg_get_int_helper(ctx->lexer,
+ &cc->collector_set_id);
+if (!ok)
+return;
+} else if (lexer_match_id(ctx->lexer, "probability")) {
+ok = parse_sample_arg_get_int_helper(ctx->lexer,
+ &cc->probability);
+if (!ok)
+return;
+} else if (lexer_match_id(ctx->lexer, "obs_domain_id")) {
+ok = parse_sample_arg_get_int_helper(ctx->lexer,
+ &cc->obs_domain_id);
+if (!ok)
+return;
+} else if (lexer_match_id(ctx->lexer, "obs_point_id")) {
+ok = parse_sample_arg_get_int_helper(ctx->lexer,
+ &cc->obs_point_id);
+if (!ok)
+return;
+} else {
+lexer_syntax_error(ctx->lexer, NULL);
+}
+}
+
+static void
+parse_SAMPLE(struct action_context *ctx)
+{
+struct ovnact_sample *sample = ovnact_put_SAMPLE(ctx->ovnacts);
+if (lexer_match(ctx->lexer, LEX_T_LPAREN)) {
+while (!lexer_match(ctx->lexer, LEX_T_RPAREN)) {
+parse_sample_args(ctx, sample);
+if (ctx->lexer->error) {
+return;
+}
+lexer_match(ctx->lexer, LEX_T_COMMA);
+}
+}
+
+if (!sample->probability)
+lexer_error(ctx->lexer, "sample probability can't be zero");
+}
+
+static void
+encode_SAMPLE(const struct ovnact_sample *sample,
+  const struct ovnact_encode_params *ep OVS_UNUSED,
+  struct ofpbuf *ofpacts)
+{
+struct ofpact_sample *action = ofpact_put_SAMPLE(ofpacts);
+action->collector_set_id = sample->collector_set_id;
+/* sampling is 16 bit wide in the northbound database */
+action->probability = (uint16_t)sample->probability;
+action->obs_domain_id = sample->obs_domain_id;
+action->obs_point_id = sample->obs_point_id;
+action->sampling_port = OFPP_NONE;
+}
+
+static void
+format_SAMPLE(const struct ovnact_sample *sample, struct ds *s)
+{
+

[ovs-dev] [PATCH RFC 0/2] Add DPDK 16.11 & vHost PMD Support

2016-10-14 Thread Ciara Loftus
This RFC patchset adds support for DPDK 16.11 (rc1) and the vHost PMD.

Thanks to a lack of API changes that affect OVS, the DPDK 16.11 support
patch doesn't require any code changes, just documentation updates.

The vHost PMD patch removes direct calls to the DPDK vHost User library,
and instead replaces them with calls to the ether PMD API, like dpdk and
dpdkr ports.

Concerns were raised during the last version of this patch here:
http://openvswitch.org/pipermail/dev/2016-August/076887.html
These have been addressed with the following DPDK patch that is
available in 16.11:
http://dpdk.org/ml/archives/dev/2016-September/046631.html

Early feedback on this patchset is important in case we need to submit
changes to DPDK (eg. see above) before the release is made in November.

Ciara Loftus (2):
  netdev-dpdk: Add support for DPDK 16.11
  netdev-dpdk: Add vHost User PMD

 .travis/linux-build.sh   |2 +-
 INSTALL.DPDK-ADVANCED.md |6 +-
 INSTALL.DPDK.md  |   30 +-
 NEWS |3 +
 lib/netdev-dpdk.c| 1101 ++
 5 files changed, 462 insertions(+), 680 deletions(-)

-- 
2.4.3

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


[ovs-dev] [PATCH RFC 1/2] netdev-dpdk: Add support for DPDK 16.11

2016-10-14 Thread Ciara Loftus
This commit announces support for DPDK 16.11. No code changes are
required, so compaitibilty with DPDK v16.07 is not broken yet. This may
change soon however with the addition of subsequent commits that
integrate 16.11-only features.

Signed-off-by: Ciara Loftus 
---
 .travis/linux-build.sh   |  2 +-
 INSTALL.DPDK-ADVANCED.md |  6 +++---
 INSTALL.DPDK.md  | 20 ++--
 NEWS |  1 +
 4 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh
index 3bcec93..6fe663c 100755
--- a/.travis/linux-build.sh
+++ b/.travis/linux-build.sh
@@ -80,7 +80,7 @@ fi
 
 if [ "$DPDK" ]; then
 if [ -z "$DPDK_VER" ]; then
-DPDK_VER="16.07"
+DPDK_VER="16.11"
 fi
 install_dpdk $DPDK_VER
 if [ "$CC" = "clang" ]; then
diff --git a/INSTALL.DPDK-ADVANCED.md b/INSTALL.DPDK-ADVANCED.md
index f6f0b5b..2ff8243 100644
--- a/INSTALL.DPDK-ADVANCED.md
+++ b/INSTALL.DPDK-ADVANCED.md
@@ -46,7 +46,7 @@ for DPDK and OVS.
 For IVSHMEM case, set `export DPDK_TARGET=x86_64-ivshmem-linuxapp-gcc`
 
 ```
-export DPDK_DIR=/usr/src/dpdk-16.07
+export DPDK_DIR=/usr/src/dpdk-16.11
 export DPDK_BUILD=$DPDK_DIR/$DPDK_TARGET
 make install T=$DPDK_TARGET DESTDIR=install
 ```
@@ -358,7 +358,7 @@ For users wanting to do packet forwarding using kernel 
stack below are the steps
cd /usr/src/cmdline_generator
wget 
https://raw.githubusercontent.com/netgroup-polito/un-orchestrator/master/orchestrator/compute_controller/plugins/kvm-libvirt/cmdline_generator/cmdline_generator.c
wget 
https://raw.githubusercontent.com/netgroup-polito/un-orchestrator/master/orchestrator/compute_controller/plugins/kvm-libvirt/cmdline_generator/Makefile
-   export RTE_SDK=/usr/src/dpdk-16.07
+   export RTE_SDK=/usr/src/dpdk-16.11
export RTE_TARGET=x86_64-ivshmem-linuxapp-gcc
make
./build/cmdline_generator -m -p dpdkr0 XXX
@@ -382,7 +382,7 @@ For users wanting to do packet forwarding using kernel 
stack below are the steps
mount -t hugetlbfs nodev /dev/hugepages (if not already mounted)
 
# Build the DPDK ring application in the VM
-   export RTE_SDK=/root/dpdk-16.07
+   export RTE_SDK=/root/dpdk-16.11
export RTE_TARGET=x86_64-ivshmem-linuxapp-gcc
make
 
diff --git a/INSTALL.DPDK.md b/INSTALL.DPDK.md
index 30e9258..2f0ae9a 100644
--- a/INSTALL.DPDK.md
+++ b/INSTALL.DPDK.md
@@ -21,7 +21,7 @@ The DPDK support of Open vSwitch is considered 'experimental'.
 
 ### Prerequisites
 
-* Required: DPDK 16.07
+* Required: DPDK 16.11
 * Hardware: [DPDK Supported NICs] when physical ports in use
 
 ##  2. Building and Installation
@@ -42,10 +42,10 @@ advanced install guide [INSTALL.DPDK-ADVANCED.md]
 
  ```
  cd /usr/src/
- wget http://dpdk.org/browse/dpdk/snapshot/dpdk-16.07.zip
- unzip dpdk-16.07.zip
+ wget http://dpdk.org/browse/dpdk/snapshot/dpdk-16.11.zip
+ unzip dpdk-16.11.zip
 
- export DPDK_DIR=/usr/src/dpdk-16.07
+ export DPDK_DIR=/usr/src/dpdk-16.11
  cd $DPDK_DIR
  ```
 
@@ -372,9 +372,9 @@ can be found in [Vhost Walkthrough].
 
   ```
   cd /root/dpdk/
-  wget http://dpdk.org/browse/dpdk/snapshot/dpdk-16.07.zip
-  unzip dpdk-16.07.zip
-  export DPDK_DIR=/root/dpdk/dpdk-16.07
+  wget http://dpdk.org/browse/dpdk/snapshot/dpdk-16.11.zip
+  unzip dpdk-16.11.zip
+  export DPDK_DIR=/root/dpdk/dpdk-16.11
   export DPDK_TARGET=x86_64-native-linuxapp-gcc
   export DPDK_BUILD=$DPDK_DIR/$DPDK_TARGET
   cd $DPDK_DIR
@@ -530,7 +530,7 @@ can be found in [Vhost Walkthrough].


  
- 
+ 
  
  

@@ -599,9 +599,9 @@ can be found in [Vhost Walkthrough].
 DPDK. It is recommended that users update Network Interface firmware to
 match what has been validated for the DPDK release.
 
-For DPDK 16.07, the list of validated firmware versions can be found at:
+For DPDK 16.11, the list of validated firmware versions can be found at:
 
-http://dpdk.org/doc/guides/rel_notes/release_16.07.html
+http://dpdk.org/doc/guides/rel_notes/release_16.11.html
 
 
 Bug Reporting:
diff --git a/NEWS b/NEWS
index 9b6fa35..ab74fcd 100644
--- a/NEWS
+++ b/NEWS
@@ -33,6 +33,7 @@ Post-v2.6.0
- DPDK:
  * New option 'n_rxq_desc' and 'n_txq_desc' fields for DPDK interfaces
which set the number of rx and tx descriptors to use for the given port.
+ * Support for DPDK v16.11.
 
 v2.6.0 - 27 Sep 2016
 -
-- 
2.4.3

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


[ovs-dev] [PATCH RFC 2/2] netdev-dpdk: Add vHost User PMD

2016-10-14 Thread Ciara Loftus
The vHost PMD allows vHost User ports to be controlled by the
librte_ether API, like physical 'dpdk' ports and IVSHM 'dpdkr' ports.
This commit integrates this PMD into OVS and removes direct calls to the
librte_vhost DPDK library.

This commit requires DPDK v16.11 functionality that isn't available in
previous releases, and thus breaks compatibility with such releases.

Signed-off-by: Ciara Loftus 
---
 INSTALL.DPDK.md   |   10 +
 NEWS  |2 +
 lib/netdev-dpdk.c | 1101 +
 3 files changed, 447 insertions(+), 666 deletions(-)

diff --git a/INSTALL.DPDK.md b/INSTALL.DPDK.md
index 2f0ae9a..5678e41 100644
--- a/INSTALL.DPDK.md
+++ b/INSTALL.DPDK.md
@@ -603,6 +603,16 @@ can be found in [Vhost Walkthrough].
 
 http://dpdk.org/doc/guides/rel_notes/release_16.11.html
 
+  - dpdk, dpdkr and dpdkvhostuser ports are 'eth' type ports in the context of
+DPDK as they are all managed by the rte_ether API. This means that they
+adhere to the DPDK configuration option CONFIG_RTE_MAX_ETHPORTS which by
+default is set to 32. This means by default the combined total number of
+dpdk, dpdkr and dpdkvhostuser ports allowable in OVS with DPDK is 32. This
+value can be changed if desired by modifying the configuration file in
+DPDK, or by overriding the default value on the command line when building
+DPDK. eg.
+
+`make install CONFIG_RTE_MAX_ETHPORTS=64`
 
 Bug Reporting:
 --
diff --git a/NEWS b/NEWS
index ab74fcd..6e47683 100644
--- a/NEWS
+++ b/NEWS
@@ -135,6 +135,8 @@ v2.6.0 - 27 Sep 2016
  * Remove dpdkvhostcuse port type.
  * OVS client mode for vHost and vHost reconnect (Requires QEMU 2.7)
  * 'dpdkvhostuserclient' port type.
+ * vHost PMD integration brings vhost-user ports under control of the
+   rte_ether DPDK API.
- Increase number of registers to 16.
- ovs-benchmark: This utility has been removed due to lack of use and
  bitrot.
diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 7c1523e..d0b80a7 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -122,6 +123,7 @@ BUILD_ASSERT_DECL((MAX_NB_MBUF / 
ROUND_DOWN_POW2(MAX_NB_MBUF/MIN_NB_MBUF))
 #define XSTAT_RX_BROADCAST_PACKETS   "rx_broadcast_packets"
 #define XSTAT_TX_BROADCAST_PACKETS   "tx_broadcast_packets"
 #define XSTAT_RX_UNDERSIZED_ERRORS   "rx_undersized_errors"
+#define XSTAT_RX_UNDERSIZE_PACKETS   "rx_undersize_packets"
 #define XSTAT_RX_OVERSIZE_ERRORS "rx_oversize_errors"
 #define XSTAT_RX_FRAGMENTED_ERRORS   "rx_fragmented_errors"
 #define XSTAT_RX_JABBER_ERRORS   "rx_jabber_errors"
@@ -143,6 +145,9 @@ BUILD_ASSERT_DECL((MAX_NB_MBUF / 
ROUND_DOWN_POW2(MAX_NB_MBUF/MIN_NB_MBUF))
 #define VHOST_ENQ_RETRY_NUM 8
 #define IF_NAME_SZ (PATH_MAX > IFNAMSIZ ? PATH_MAX : IFNAMSIZ)
 
+/* Array that tracks the used & unused vHost user driver IDs */
+static unsigned int vhost_drv_ids[RTE_MAX_ETHPORTS];
+
 static const struct rte_eth_conf port_conf = {
 .rxmode = {
 .mq_mode = ETH_MQ_RX_RSS,
@@ -343,15 +348,12 @@ struct netdev_dpdk {
 struct rte_eth_link link;
 int link_reset_cnt;
 
-/* virtio identifier for vhost devices */
-ovsrcu_index vid;
-
-/* True if vHost device is 'up' and has been reconfigured at least once */
-bool vhost_reconfigured;
-
 /* Identifier used to distinguish vhost devices from each other. */
 char vhost_id[PATH_MAX];
 
+/* ID of vhost user port given to the PMD driver */
+unsigned int vhost_pmd_id;
+
 /* In dpdk_list. */
 struct ovs_list list_node OVS_GUARDED_BY(dpdk_mutex);
 
@@ -392,16 +394,25 @@ struct netdev_rxq_dpdk {
 };
 
 static int netdev_dpdk_construct(struct netdev *);
-
-int netdev_dpdk_get_vid(const struct netdev_dpdk *dev);
+static int netdev_dpdk_vhost_construct(struct netdev *);
+static int netdev_dpdk_vhost_client_construct(struct netdev *);
 
 struct ingress_policer *
 netdev_dpdk_get_ingress_policer(const struct netdev_dpdk *dev);
 
+static void link_status_changed_callback(uint8_t port_id,
+enum rte_eth_event_type type, void *param);
+static void vring_state_changed_callback(uint8_t port_id,
+enum rte_eth_event_type type, void *param);
+static void netdev_dpdk_remap_txqs(struct netdev_dpdk *dev);
+static void netdev_dpdk_txq_map_clear(struct netdev_dpdk *dev);
+
 static bool
-is_dpdk_class(const struct netdev_class *class)
+is_dpdk_eth_class(const struct netdev_class *class)
 {
-return class->construct == netdev_dpdk_construct;
+return ((class->construct == netdev_dpdk_construct) ||
+(class->construct == netdev_dpdk_vhost_construct) ||
+(class->construct == netdev_dpdk_vhost_client_construct));
 }
 
 /* DPDK NIC drivers allocate RX buffers at a particular granularity, typically
@@ -681,8 +692,13 @@ dpdk_eth_dev_queue_setup(struct netdev

[ovs-dev] [PATCH] tnl-ports: fix missing netdev_close

2016-10-14 Thread Thadeu Lima de Souza Cascardo
There were leaks on netdev_close references. Whenever an address was removed
from an interface, it was possible that a race would make the netlink message be
processed and no address be found on the interface, causing insert_ipdev to bail
out.

When that happened, the netdev would be left opened as type system, and when
adding an interface with the same name as type internal, even though the system
interface was already gone, netdev_open would return the one with type system.
And, then, no internal interface would be created.

Tested-by: Aaron Conole 
Signed-off-by: Thadeu Lima de Souza Cascardo 
---

So, Aaron found out that applying the following commits would fix a bug in
branch 2.5, but we considered that would be too much. So, after some
investigation, we realized that the change below fixes the issue, as described
above. So, we would like to see this applied to branch 2.5, instead of doing a
backport for a larger change.

2b02db1 packets: Add new functions for IPv4 and IPv6 address parsing.
a8704b5 tunneling: Handle multiple ip address for given device.
3e6dc8b netdev: Verify ifa_addr is not NULL when iterating over getifaddrs.
c2a1cee route-table: flush addresses list when route table is reset

---
 lib/tnl-ports.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/tnl-ports.c b/lib/tnl-ports.c
index e7f2066..bcf4b94 100644
--- a/lib/tnl-ports.c
+++ b/lib/tnl-ports.c
@@ -368,12 +368,14 @@ insert_ipdev(const char dev_name[])
 ip_dev->change_seq = netdev_get_change_seq(dev);
 error = netdev_get_etheraddr(ip_dev->dev, &ip_dev->mac);
 if (error) {
+netdev_close(dev);
 free(ip_dev);
 return;
 }
 error4 = netdev_get_in4(ip_dev->dev, (struct in_addr *)&ip_dev->addr4, 
NULL);
 error6 = netdev_get_in6(ip_dev->dev, &ip_dev->addr6);
 if (error4 && error6) {
+netdev_close(dev);
 free(ip_dev);
 return;
 }
-- 
2.7.4

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


[ovs-dev] [PATCH v3 00/12] Improve performance of OVS-DPDK classifier.

2016-10-14 Thread Bhanuprakash Bodireddy
This patch series is aimed at improving the performance of OVS-DPDK
dpcls.

With few thousand flows installed, the EMC becomes inefficient due
to thrashing and the bottleneck moves to the dpcls. In EMC disabled
case, through VTune we found that significant performance degradation
is due to LLC thrashing, memory latency, machine clears and expensive
hash computation.

This first patch-set improves the dpcls performance by 15% (+1 Mpps)
when EMC is disabled and OVS-DPDK built with CFLAGS="-O2 -g".

Bhanuprakash Bodireddy (12):
  dpcls: Use 32 packet batches for lookups.
Comment: ~120k performance throughput improvement.

  flow: Add comments to mf_get_next_in_map().
Comment: Add comments to the function.

  flow: Skip invoking expensive count_1bits() with zero input.
Comment: ~630k performance throughput improvement.

  hash: Skip invoking mhash_add__() with zero input.
Comment: ~150k performance throughput improvement.

  dpif-netdev: Add comments to dp_netdev_input__().
Comment: Add comments to the function.

  cmap: Remove prefetching in cmap_find_batch().
Comment: ~39k performance throughput improvement.

  dpif-netdev: Cache align netdev_flow_keys.
Comment: ~170k performance throughput improvement in EMC enabled case.

  dpif-netdev: Reorder elements in dp_netdev_port structure.
  dpif: Reorder elements in dpif_upcall structure.
  ovsdb: Reorder elements in ovsdb_table_schema structure.
  netlink-socket: Reorder elements in nl_dump structure.
  timeval: Reorder elements in clock structure.
Comment: Reorder memeber variables of the structures to reduce
 pad bytes and there by the memory footprint.

 lib/cmap.c   |   8 +---
 lib/dpif-netdev.c| 123 +++
 lib/dpif.h   |   5 ++-
 lib/flow.h   |  47 +++-
 lib/hash.h   |   5 +++
 lib/netlink-socket.h |   6 +--
 lib/timeval.c|   4 +-
 ovsdb/table.h|   4 +-
 8 files changed, 111 insertions(+), 91 deletions(-)

-- 
2.4.11

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


[ovs-dev] [PATCH v3 02/12] flow: Add comments to mf_get_next_in_map().

2016-10-14 Thread Bhanuprakash Bodireddy
This patch adds comments to mf_get_next_in_map() to make it more
comprehensible.

Signed-off-by: Jarno Rajahalme 
Acked-by: Bhanuprakash Bodireddy 
Acked-by: Antonio Fischetti 
---
 lib/flow.h | 32 +++-
 1 file changed, 27 insertions(+), 5 deletions(-)

diff --git a/lib/flow.h b/lib/flow.h
index ea24e28..5a14941 100644
--- a/lib/flow.h
+++ b/lib/flow.h
@@ -564,12 +564,27 @@ flow_values_get_next_in_maps(struct 
flow_for_each_in_maps_aux *aux,
  flow_values_get_next_in_maps(&aux__, &(VALUE));)
 
 struct mf_for_each_in_map_aux {
-size_t unit;
-struct flowmap fmap;
-struct flowmap map;
-const uint64_t *values;
+size_t unit; /* Current 64-bit unit of the flowmaps
+   being processed. */
+struct flowmap fmap; /* Remaining 1-bits corresponding to the
+   64-bit words in ‘values’ */
+struct flowmap map;  /* Remaining 1-bits corresponding to the
+   64-bit words of interest. */
+const uint64_t *values;  /* 64-bit words corresponding to the
+   1-bits in ‘fmap’. */
 };
 
+/* Get the data from ‘aux->values’ corresponding to the next lowest 1-bit
+ * in ‘aux->map’, given that ‘aux->values’ points to an array of 64-bit
+ * words corresponding to the 1-bits in ‘aux->fmap’, starting from the
+ * rightmost 1-bit.
+ *
+ * Returns ’true’ if the traversal is incomplete, ‘false’ otherwise.
+ * ‘aux’ is prepared for the next iteration after each call.
+ *
+ * This is used to traverse through, for example, the values in a miniflow
+ * representation of a flow key selected by non-zero 64-bit words in a
+ * corresponding subtable mask. */
 static inline bool
 mf_get_next_in_map(struct mf_for_each_in_map_aux *aux,
uint64_t *value)
@@ -577,8 +592,10 @@ mf_get_next_in_map(struct mf_for_each_in_map_aux *aux,
 map_t *map, *fmap;
 map_t rm1bit;
 
+/* Skip empty map units. */
 while (OVS_UNLIKELY(!*(map = &aux->map.bits[aux->unit]))) {
-/* Skip remaining data in the previous unit. */
+/* Skip remaining data in the current unit before advancing
+ * to the next. */
 aux->values += count_1bits(aux->fmap.bits[aux->unit]);
 if (++aux->unit == FLOWMAP_UNITS) {
 return false;
@@ -589,7 +606,12 @@ mf_get_next_in_map(struct mf_for_each_in_map_aux *aux,
 *map -= rm1bit;
 fmap = &aux->fmap.bits[aux->unit];
 
+/* If the rightmost 1-bit found from the current unit in ‘aux->map’
+ * (‘rm1bit’) is also present in ‘aux->fmap’, store the corresponding
+ * value from ‘aux->values’ to ‘*value', otherwise store 0. */
 if (OVS_LIKELY(*fmap & rm1bit)) {
+/* Skip all 64-bit words in ‘values’ preceding the one corresponding
+ * to ‘rm1bit’. */
 map_t trash = *fmap & (rm1bit - 1);
 
 *fmap -= trash;
-- 
2.4.11

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


[ovs-dev] [PATCH v3 03/12] flow: Skip invoking expensive count_1bits() with zero input.

2016-10-14 Thread Bhanuprakash Bodireddy
This patch checks if trash is non-zero and only then resets the flowmap
bit and increment the pointer by set bits as found in trash.

Signed-off-by: Bhanuprakash Bodireddy 
Co-authored-by: Antonio Fischetti 
Signed-off-by: Antonio Fischetti 
Acked-by: Jarno Rajahalme 
---
 lib/flow.h | 15 ++-
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/lib/flow.h b/lib/flow.h
index 5a14941..74e75d6 100644
--- a/lib/flow.h
+++ b/lib/flow.h
@@ -614,11 +614,16 @@ mf_get_next_in_map(struct mf_for_each_in_map_aux *aux,
  * to ‘rm1bit’. */
 map_t trash = *fmap & (rm1bit - 1);
 
-*fmap -= trash;
-/* count_1bits() is fast for systems where speed matters (e.g.,
- * DPDK), so we don't try avoid using it.
- * Advance 'aux->values' to point to the value for 'rm1bit'. */
-aux->values += count_1bits(trash);
+/* Avoid resetting 'fmap' and calling count_1bits() when trash is
+ * zero. */
+if (trash) {
+*fmap -= trash;
+/* count_1bits() is fast for systems where speed matters (e.g.,
+ * DPDK), so we don't try avoid using it.
+ * Advance 'aux->values' to point to the value for 'rm1bit' only.
+ */
+aux->values += count_1bits(trash);
+}
 
 *value = *aux->values;
 } else {
-- 
2.4.11

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


[ovs-dev] [PATCH v3 01/12] dpcls: Use 32 packet batches for lookups.

2016-10-14 Thread Bhanuprakash Bodireddy
This patch increases the number of packets processed in a batch during a
lookup from 16 to 32. Processing batches of 32 packets improves
performance and also one of the internal loops can be avoided here.

Signed-off-by: Antonio Fischetti 
Co-authored-by: Bhanuprakash Bodireddy 
Signed-off-by: Bhanuprakash Bodireddy 
---
 lib/dpif-netdev.c | 110 ++
 1 file changed, 45 insertions(+), 65 deletions(-)

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index eb9f764..0a4f338 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -4985,23 +4985,21 @@ dpcls_lookup(struct dpcls *cls, const struct 
netdev_flow_key keys[],
  int *num_lookups_p)
 {
 /* The received 'cnt' miniflows are the search-keys that will be processed
- * in batches of 16 elements.  N_MAPS will contain the number of these
- * 16-elements batches.  i.e. for 'cnt' = 32, N_MAPS will be 2.  The batch
- * size 16 was experimentally found faster than 8 or 32. */
-typedef uint16_t map_type;
+ * to find a matching entry into the available subtables.
+ * The number of bits in map_type is equal to NETDEV_MAX_BURST. */
+typedef uint32_t map_type;
 #define MAP_BITS (sizeof(map_type) * CHAR_BIT)
+BUILD_ASSERT_DECL(MAP_BITS >= NETDEV_MAX_BURST);
 
-#if !defined(__CHECKER__) && !defined(_WIN32)
-const int N_MAPS = DIV_ROUND_UP(cnt, MAP_BITS);
-#else
-enum { N_MAPS = DIV_ROUND_UP(NETDEV_MAX_BURST, MAP_BITS) };
-#endif
-map_type maps[N_MAPS];
 struct dpcls_subtable *subtable;
 
-memset(maps, 0xff, sizeof maps);
-if (cnt % MAP_BITS) {
-maps[N_MAPS - 1] >>= MAP_BITS - cnt % MAP_BITS; /* Clear extra bits. */
+map_type keys_map = TYPE_MAXIMUM(map_type);
+map_type found_map;
+uint32_t hashes[MAP_BITS];
+const struct cmap_node *nodes[MAP_BITS];
+
+if (cnt != NETDEV_MAX_BURST) {
+keys_map >>= NETDEV_MAX_BURST - cnt; /* Clear extra bits. */
 }
 memset(rules, 0, cnt * sizeof *rules);
 
@@ -5015,61 +5013,43 @@ dpcls_lookup(struct dpcls *cls, const struct 
netdev_flow_key keys[],
  * search-key, the search for that key can stop because the rules are
  * non-overlapping. */
 PVECTOR_FOR_EACH (subtable, &cls->subtables) {
-const struct netdev_flow_key *mkeys = keys;
-struct dpcls_rule **mrules = rules;
-map_type remains = 0;
-int m;
-
-BUILD_ASSERT_DECL(sizeof remains == sizeof *maps);
-
-/* Loops on each batch of 16 search-keys. */
-for (m = 0; m < N_MAPS; m++, mkeys += MAP_BITS, mrules += MAP_BITS) {
-uint32_t hashes[MAP_BITS];
-const struct cmap_node *nodes[MAP_BITS];
-unsigned long map = maps[m];
-int i;
-
-if (!map) {
-continue; /* Skip empty maps. */
-}
-
-/* Compute hashes for the remaining keys.  Each search-key is
- * masked with the subtable's mask to avoid hashing the wildcarded
- * bits. */
-ULLONG_FOR_EACH_1(i, map) {
-hashes[i] = netdev_flow_key_hash_in_mask(&mkeys[i],
- &subtable->mask);
-}
-/* Lookup. */
-map = cmap_find_batch(&subtable->rules, map, hashes, nodes);
-/* Check results.  When the i-th bit of map is set, it means that a
- * set of nodes with a matching hash value was found for the i-th
- * search-key.  Due to possible hash collisions we need to check
- * which of the found rules, if any, really matches our masked
- * search-key. */
-ULLONG_FOR_EACH_1(i, map) {
-struct dpcls_rule *rule;
-
-CMAP_NODE_FOR_EACH (rule, cmap_node, nodes[i]) {
-if (OVS_LIKELY(dpcls_rule_matches_key(rule, &mkeys[i]))) {
-mrules[i] = rule;
-/* Even at 20 Mpps the 32-bit hit_cnt cannot wrap
- * within one second optimization interval  */
-subtable->hit_cnt++;
-lookups_match += subtable_pos;
-goto next;
-}
+int i;
+
+/* Compute hashes for the remaining keys.  Each search-key is
+ * masked with the subtable's mask to avoid hashing the wildcarded
+ * bits. */
+ULLONG_FOR_EACH_1(i, keys_map) {
+hashes[i] = netdev_flow_key_hash_in_mask(&keys[i],
+ &subtable->mask);
+}
+/* Lookup. */
+found_map = cmap_find_batch(&subtable->rules, keys_map, hashes, nodes);
+/* Check results.  When the i-th bit of found_map is set, it means
+ * that a set of nodes with a matching hash value was found for the
+ * i-th search-key.  Due to possible hash collisions we need to check
+ * 

[ovs-dev] [PATCH v3 04/12] hash: Skip Invoking mhash_add__() with zero input.

2016-10-14 Thread Bhanuprakash Bodireddy
mhash_add__() is expensive and should be only called with valid input.
zero-valued 'data' will not affect the 'hash' value and expensive hash
computation can be skipped when input is zero.

This patch will validate the input in mhash_add__ to save some cpu
cycles.

Signed-off-by: Bhanuprakash Bodireddy 
Co-authored-by: Antonio Fischetti 
Signed-off-by: Antonio Fischetti 
---
 lib/hash.h | 5 +
 1 file changed, 5 insertions(+)

diff --git a/lib/hash.h b/lib/hash.h
index 114a419..f2dd510 100644
--- a/lib/hash.h
+++ b/lib/hash.h
@@ -62,6 +62,11 @@ static inline uint32_t hash_string(const char *, uint32_t 
basis);
 
 static inline uint32_t mhash_add__(uint32_t hash, uint32_t data)
 {
+/* zero-valued 'data' will not change the 'hash' value */
+if (!data) {
+return hash;
+}
+
 data *= 0xcc9e2d51;
 data = hash_rot(data, 15);
 data *= 0x1b873593;
-- 
2.4.11

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


[ovs-dev] [PATCH v3 06/12] cmap: Remove prefetching in cmap_find_batch().

2016-10-14 Thread Bhanuprakash Bodireddy
prefetching the data in to the caches isn't improving the performance in
cmap_find_batch(). Moreover its found that there is slight improvement
in performance with out prefetching.

This patch removes prefetching from cmap_find_batch().

Signed-off-by: Bhanuprakash Bodireddy 
Co-authored-by: Antonio Fischetti 
Signed-off-by: Antonio Fischetti 
---
 lib/cmap.c | 8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/lib/cmap.c b/lib/cmap.c
index 8c7312d..8097b56 100644
--- a/lib/cmap.c
+++ b/lib/cmap.c
@@ -393,11 +393,10 @@ cmap_find_batch(const struct cmap *cmap, unsigned long 
map,
 const struct cmap_bucket *b2s[sizeof map * CHAR_BIT];
 uint32_t c1s[sizeof map * CHAR_BIT];
 
-/* Compute hashes and prefetch 1st buckets. */
+/* Compute hashes. */
 ULLONG_FOR_EACH_1(i, map) {
 h1s[i] = rehash(impl, hashes[i]);
 b1s[i] = &impl->buckets[h1s[i] & impl->mask];
-OVS_PREFETCH(b1s[i]);
 }
 /* Lookups, Round 1. Only look up at the first bucket. */
 ULLONG_FOR_EACH_1(i, map) {
@@ -411,15 +410,13 @@ cmap_find_batch(const struct cmap *cmap, unsigned long 
map,
 } while (OVS_UNLIKELY(counter_changed(b1, c1)));
 
 if (!node) {
-/* Not found (yet); Prefetch the 2nd bucket. */
+/* Not found (yet). */
 b2s[i] = &impl->buckets[other_hash(h1s[i]) & impl->mask];
-OVS_PREFETCH(b2s[i]);
 c1s[i] = c1; /* We may need to check this after Round 2. */
 continue;
 }
 /* Found. */
 ULLONG_SET0(map, i); /* Ignore this on round 2. */
-OVS_PREFETCH(node);
 nodes[i] = node;
 }
 /* Round 2. Look into the 2nd bucket, if needed. */
@@ -453,7 +450,6 @@ cmap_find_batch(const struct cmap *cmap, unsigned long map,
 continue;
 }
 found:
-OVS_PREFETCH(node);
 nodes[i] = node;
 }
 return result;
-- 
2.4.11

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


[ovs-dev] [PATCH v3 05/12] dpif-netdev: Add comments to dp_netdev_input__().

2016-10-14 Thread Bhanuprakash Bodireddy
Add comments in dp_netdev_input__() to explain the reason behind
clearing the flow batches before packet_batch_execute().

Signed-off-by: Bhanuprakash Bodireddy 
Co-authored-by: Antonio Fischetti 
Signed-off-by: Antonio Fischetti 
Acked-by: Daniele Di Proietto 
---
 lib/dpif-netdev.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 0a4f338..95a04df 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -4182,6 +4182,15 @@ dp_netdev_input__(struct dp_netdev_pmd_thread *pmd,
 fast_path_processing(pmd, packets, keys, batches, &n_batches, in_port, 
now);
 }
 
+/* All the flow batches need to be reset before any call to
+ * packet_batch_per_flow_execute() as it could potentially trigger
+ * recirculation. When a packet matching flow ‘j’ happens to be
+ * recirculated, the nested call to dp_netdev_input__() could potentially
+ * classify the packet as matching another flow - say 'k'. It could happen
+ * that in the previous call to dp_netdev_input__() that same flow 'k' had
+ * already its own batches[k] still waiting to be served.  So if its
+ * ‘batch’ member is not reset, the recirculated packet would be wrongly
+ * appended to batches[k] of the 1st call to dp_netdev_input__(). */
 for (i = 0; i < n_batches; i++) {
 batches[i].flow->batch = NULL;
 }
-- 
2.4.11

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


[ovs-dev] [PATCH v3 07/12] dpif-netdev: Cache align netdev_flow_keys.

2016-10-14 Thread Bhanuprakash Bodireddy
Aligning the 'keys' array seems to have positive performance impact.

Signed-off-by: Bhanuprakash Bodireddy 
Co-authored-by: Antonio Fischetti 
Signed-off-by: Antonio Fischetti 
Acked-by: Daniele Di Proietto 
---
 lib/dpif-netdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 95a04df..b5efb45 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -4166,7 +4166,7 @@ dp_netdev_input__(struct dp_netdev_pmd_thread *pmd,
 /* Sparse or MSVC doesn't like variable length array. */
 enum { PKT_ARRAY_SIZE = NETDEV_MAX_BURST };
 #endif
-struct netdev_flow_key keys[PKT_ARRAY_SIZE];
+struct netdev_flow_key keys[PKT_ARRAY_SIZE] 
OVS_ALIGNED_VAR(CACHE_LINE_SIZE);
 struct packet_batch_per_flow batches[PKT_ARRAY_SIZE];
 long long now = time_msec();
 size_t newcnt, n_batches, i;
-- 
2.4.11

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


[ovs-dev] [PATCH v3 08/12] dpif-netdev: Reorder elements in dp_netdev_port structure.

2016-10-14 Thread Bhanuprakash Bodireddy
By reordering the data elements in dp_netdev_port structure, pad bytes
can be reduced and there by saving a cache line.

Before: structure size:136, holes:3, sum padbytes:15, cachelines:3
After: structure size:128, holes:2, sum padbytes:7, cachelines:2

Signed-off-by: Bhanuprakash Bodireddy 
Co-authored-by: Antonio Fischetti 
Signed-off-by: Antonio Fischetti 
---
 lib/dpif-netdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index b5efb45..a39e1de 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -290,8 +290,8 @@ struct dp_netdev_port {
 struct netdev *netdev;
 struct hmap_node node;  /* Node in dp_netdev's 'ports'. */
 struct netdev_saved_flags *sf;
-unsigned n_rxq; /* Number of elements in 'rxq' */
 struct dp_netdev_rxq *rxqs;
+unsigned n_rxq; /* Number of elements in 'rxq' */
 bool dynamic_txqs;  /* If true XPS will be used. */
 unsigned *txq_used; /* Number of threads that uses each tx queue. 
*/
 struct ovs_mutex txq_used_mutex;
-- 
2.4.11

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


[ovs-dev] [PATCH v3 09/12] dpif: Reorder elements in dpif_upcall structure.

2016-10-14 Thread Bhanuprakash Bodireddy
By reordering the data elements in dpif_upcall structure, pad bytes can
be reduced and also a cache line. Also dp_packet should be the first
member of the structure because rte_mbuf, the first member of dp_packet
should be aligned atleast on a 64-byte boundary.

Before: structure size:768, holes:1, sum padbytes:60, cachelines:12
After: structure size:704, holes:1, sum padbytes:4, cachelines:11

Signed-off-by: Bhanuprakash Bodireddy 
Co-authored-by: Antonio Fischetti 
Signed-off-by: Antonio Fischetti 
Acked-by: Jarno Rajahalme 
---
 lib/dpif.h | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/dpif.h b/lib/dpif.h
index 8a68d5d..cade046 100644
--- a/lib/dpif.h
+++ b/lib/dpif.h
@@ -780,8 +780,11 @@ const char *dpif_upcall_type_to_string(enum 
dpif_upcall_type);
  */
 struct dpif_upcall {
 /* All types. */
+struct dp_packet packet;/* Packet data,'dp_packet' should be the first
+  member to avoid a hole. This is because
+  'rte_mbuf' in dp_packet is aligned atleast
+  on a 64-byte boundary */
 enum dpif_upcall_type type;
-struct dp_packet packet;   /* Packet data. */
 struct nlattr *key; /* Flow key. */
 size_t key_len; /* Length of 'key' in bytes. */
 ovs_u128 ufid;  /* Unique flow identifier for 'key'. */
-- 
2.4.11

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


[ovs-dev] [PATCH v3 11/12] netlink-socket: Reorder elements in nl_dump structure.

2016-10-14 Thread Bhanuprakash Bodireddy
By reordering the elements in nl_dump structure, pad bytes can be
reduced there by saving a cache line.

Before: structure size:72, holes:1, sum padbytes:4, cachelines:2
After: structure size:64, holes:0, sum padbytes:0, cachelines:1

Signed-off-by: Bhanuprakash Bodireddy 
Co-authored-by: Antonio Fischetti 
Signed-off-by: Antonio Fischetti 
Acked-by: Jarno Rajahalme 
---
 lib/netlink-socket.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/netlink-socket.h b/lib/netlink-socket.h
index f73fc7d..d3cc642 100644
--- a/lib/netlink-socket.h
+++ b/lib/netlink-socket.h
@@ -260,12 +260,12 @@ struct nl_dump {
 /* These members are immutable during the lifetime of the nl_dump. */
 struct nl_sock *sock;   /* Socket being dumped. */
 uint32_t nl_seq;/* Expected nlmsg_seq for replies. */
-
-/* 'mutex' protects 'status' and serializes access to 'sock'. */
-struct ovs_mutex mutex; /* Protects 'status', synchronizes recv(). */
 int status OVS_GUARDED; /* 0: dump in progress,
  * positive errno: dump completed with error,
  * EOF: dump completed successfully. */
+
+/* 'mutex' protects 'status' and serializes access to 'sock'. */
+struct ovs_mutex mutex; /* Protects 'status', synchronizes recv(). */
 };
 
 void nl_dump_start(struct nl_dump *, int protocol,
-- 
2.4.11

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


[ovs-dev] [PATCH v3 12/12] timeval: Reorder elements in clock structure.

2016-10-14 Thread Bhanuprakash Bodireddy
By reordering the elements in clock structure, pad bytes
can be reduced and also a cache line is saved.

Before: structure size:136, holes:3, sum padbytes:18, cachelines:3
After: structure size:120, holes:1, sum padbytes:2, cachelines:2

Signed-off-by: Bhanuprakash Bodireddy 
Co-authored-by: Antonio Fischetti 
Signed-off-by: Antonio Fischetti 
Acked-by: Jarno Rajahalme 
---
 lib/timeval.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/timeval.c b/lib/timeval.c
index 0e8709a..dd63f03 100644
--- a/lib/timeval.c
+++ b/lib/timeval.c
@@ -71,10 +71,10 @@ struct clock {
 clockid_t id;   /* CLOCK_MONOTONIC or CLOCK_REALTIME. */
 
 /* Features for use by unit tests.  Protected by 'mutex'. */
-struct ovs_mutex mutex;
 atomic_bool slow_path; /* True if warped or stopped. */
-struct timespec warp OVS_GUARDED;  /* Offset added for unit tests. */
 bool stopped OVS_GUARDED;  /* Disable real-time updates if true. */
+struct ovs_mutex mutex;
+struct timespec warp OVS_GUARDED;  /* Offset added for unit tests. */
 struct timespec cache OVS_GUARDED; /* Last time read from kernel. */
 struct large_warp large_warp OVS_GUARDED; /* Connection information waiting
  for warp response. */
-- 
2.4.11

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


[ovs-dev] [PATCH v3 10/12] ovsdb: Reorder elements in ovsdb_table_schema structure.

2016-10-14 Thread Bhanuprakash Bodireddy
By reordering the elements in ovsdb_table_schema structure, pad bytes
can be reduced and also a cache line is saved.

Before: structure size:72, holes:2, sum padbytes:10, cachelines:2
After: structure size:64, holes:1, sum padbytes:2, cachelines:1

Signed-off-by: Bhanuprakash Bodireddy 
Co-authored-by: Antonio Fischetti 
Signed-off-by: Antonio Fischetti 
Acked-by: Jarno Rajahalme 
---
 ovsdb/table.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ovsdb/table.h b/ovsdb/table.h
index f910d18..69dd649 100644
--- a/ovsdb/table.h
+++ b/ovsdb/table.h
@@ -28,9 +28,9 @@ struct uuid;
 struct ovsdb_table_schema {
 char *name;
 bool mutable;
-struct shash columns;   /* Contains "struct ovsdb_column *"s. */
-unsigned int max_rows;  /* Maximum number of rows. */
 bool is_root;   /* Part of garbage collection root set? */
+unsigned int max_rows;  /* Maximum number of rows. */
+struct shash columns;   /* Contains "struct ovsdb_column *"s. */
 struct ovsdb_column_set *indexes;
 size_t n_indexes;
 };
-- 
2.4.11

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


[ovs-dev] [PATCH RFC v2 0/2] Add DPDK 16.11 & vHost PMD Support

2016-10-14 Thread Ciara Loftus
This RFC patchset adds support for DPDK 16.11 (rc1) and the vHost PMD.

Thanks to a lack of API changes that affect OVS, the DPDK 16.11 support
patch requires just one minimal code change and is mostly documentation
updates.

The vHost PMD patch removes direct calls to the DPDK vHost User library,
and instead replaces them with calls to the ether PMD API, like dpdk and
dpdkr ports.

Concerns were raised during the last version of this patch here:
http://openvswitch.org/pipermail/dev/2016-August/076887.html
These have been addressed with the following DPDK patch that is
available in 16.11:
http://dpdk.org/ml/archives/dev/2016-September/046631.html

Early feedback on this patchset is important in case we need to submit
changes to DPDK (eg. see above) before the release is made in November.

v2:
* Disable indirect desc for vHost & update commit message

Ciara Loftus (2):
  netdev-dpdk: Add support for DPDK 16.11
  netdev-dpdk: Add vHost User PMD

 .travis/linux-build.sh   |2 +-
 INSTALL.DPDK-ADVANCED.md |6 +-
 INSTALL.DPDK.md  |   30 +-
 NEWS |3 +
 lib/netdev-dpdk.c| 1102 ++
 5 files changed, 463 insertions(+), 680 deletions(-)

-- 
2.4.3

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


[ovs-dev] [PATCH RFC v2 1/2] netdev-dpdk: Add support for DPDK 16.11

2016-10-14 Thread Ciara Loftus
This commit announces support for DPDK 16.11. Compaitibilty with DPDK
v16.07 is not broken yet thanks to only minor code changes being needed
for the upgrade. This may change soon however with the addition of
subsequent commits that integrate 16.11-only features.

Signed-off-by: Ciara Loftus 

---
v2:
* Disable indirect desc for vHost & update commit message
---
 .travis/linux-build.sh   |  2 +-
 INSTALL.DPDK-ADVANCED.md |  6 +++---
 INSTALL.DPDK.md  | 20 ++--
 NEWS |  1 +
 lib/netdev-dpdk.c|  3 ++-
 5 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh
index 3bcec93..6fe663c 100755
--- a/.travis/linux-build.sh
+++ b/.travis/linux-build.sh
@@ -80,7 +80,7 @@ fi
 
 if [ "$DPDK" ]; then
 if [ -z "$DPDK_VER" ]; then
-DPDK_VER="16.07"
+DPDK_VER="16.11"
 fi
 install_dpdk $DPDK_VER
 if [ "$CC" = "clang" ]; then
diff --git a/INSTALL.DPDK-ADVANCED.md b/INSTALL.DPDK-ADVANCED.md
index f6f0b5b..2ff8243 100644
--- a/INSTALL.DPDK-ADVANCED.md
+++ b/INSTALL.DPDK-ADVANCED.md
@@ -46,7 +46,7 @@ for DPDK and OVS.
 For IVSHMEM case, set `export DPDK_TARGET=x86_64-ivshmem-linuxapp-gcc`
 
 ```
-export DPDK_DIR=/usr/src/dpdk-16.07
+export DPDK_DIR=/usr/src/dpdk-16.11
 export DPDK_BUILD=$DPDK_DIR/$DPDK_TARGET
 make install T=$DPDK_TARGET DESTDIR=install
 ```
@@ -358,7 +358,7 @@ For users wanting to do packet forwarding using kernel 
stack below are the steps
cd /usr/src/cmdline_generator
wget 
https://raw.githubusercontent.com/netgroup-polito/un-orchestrator/master/orchestrator/compute_controller/plugins/kvm-libvirt/cmdline_generator/cmdline_generator.c
wget 
https://raw.githubusercontent.com/netgroup-polito/un-orchestrator/master/orchestrator/compute_controller/plugins/kvm-libvirt/cmdline_generator/Makefile
-   export RTE_SDK=/usr/src/dpdk-16.07
+   export RTE_SDK=/usr/src/dpdk-16.11
export RTE_TARGET=x86_64-ivshmem-linuxapp-gcc
make
./build/cmdline_generator -m -p dpdkr0 XXX
@@ -382,7 +382,7 @@ For users wanting to do packet forwarding using kernel 
stack below are the steps
mount -t hugetlbfs nodev /dev/hugepages (if not already mounted)
 
# Build the DPDK ring application in the VM
-   export RTE_SDK=/root/dpdk-16.07
+   export RTE_SDK=/root/dpdk-16.11
export RTE_TARGET=x86_64-ivshmem-linuxapp-gcc
make
 
diff --git a/INSTALL.DPDK.md b/INSTALL.DPDK.md
index 30e9258..2f0ae9a 100644
--- a/INSTALL.DPDK.md
+++ b/INSTALL.DPDK.md
@@ -21,7 +21,7 @@ The DPDK support of Open vSwitch is considered 'experimental'.
 
 ### Prerequisites
 
-* Required: DPDK 16.07
+* Required: DPDK 16.11
 * Hardware: [DPDK Supported NICs] when physical ports in use
 
 ##  2. Building and Installation
@@ -42,10 +42,10 @@ advanced install guide [INSTALL.DPDK-ADVANCED.md]
 
  ```
  cd /usr/src/
- wget http://dpdk.org/browse/dpdk/snapshot/dpdk-16.07.zip
- unzip dpdk-16.07.zip
+ wget http://dpdk.org/browse/dpdk/snapshot/dpdk-16.11.zip
+ unzip dpdk-16.11.zip
 
- export DPDK_DIR=/usr/src/dpdk-16.07
+ export DPDK_DIR=/usr/src/dpdk-16.11
  cd $DPDK_DIR
  ```
 
@@ -372,9 +372,9 @@ can be found in [Vhost Walkthrough].
 
   ```
   cd /root/dpdk/
-  wget http://dpdk.org/browse/dpdk/snapshot/dpdk-16.07.zip
-  unzip dpdk-16.07.zip
-  export DPDK_DIR=/root/dpdk/dpdk-16.07
+  wget http://dpdk.org/browse/dpdk/snapshot/dpdk-16.11.zip
+  unzip dpdk-16.11.zip
+  export DPDK_DIR=/root/dpdk/dpdk-16.11
   export DPDK_TARGET=x86_64-native-linuxapp-gcc
   export DPDK_BUILD=$DPDK_DIR/$DPDK_TARGET
   cd $DPDK_DIR
@@ -530,7 +530,7 @@ can be found in [Vhost Walkthrough].


  
- 
+ 
  
  

@@ -599,9 +599,9 @@ can be found in [Vhost Walkthrough].
 DPDK. It is recommended that users update Network Interface firmware to
 match what has been validated for the DPDK release.
 
-For DPDK 16.07, the list of validated firmware versions can be found at:
+For DPDK 16.11, the list of validated firmware versions can be found at:
 
-http://dpdk.org/doc/guides/rel_notes/release_16.07.html
+http://dpdk.org/doc/guides/rel_notes/release_16.11.html
 
 
 Bug Reporting:
diff --git a/NEWS b/NEWS
index 9b6fa35..ab74fcd 100644
--- a/NEWS
+++ b/NEWS
@@ -33,6 +33,7 @@ Post-v2.6.0
- DPDK:
  * New option 'n_rxq_desc' and 'n_txq_desc' fields for DPDK interfaces
which set the number of rx and tx descriptors to use for the given port.
+ * Support for DPDK v16.11.
 
 v2.6.0 - 27 Sep 2016
 -
diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 7c1523e..e8cd22a 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -2584,7 +2584,8 @@ netdev_dpdk_vhost_class_init(void)
 rte_vhost_driver_callback_register(&virtio_net_device_ops);
 rte_vhost_fea

[ovs-dev] [PATCH RFC v2 2/2] netdev-dpdk: Add vHost User PMD

2016-10-14 Thread Ciara Loftus
The vHost PMD allows vHost User ports to be controlled by the
librte_ether API, like physical 'dpdk' ports and IVSHM 'dpdkr' ports.
This commit integrates this PMD into OVS and removes direct calls to the
librte_vhost DPDK library.

This commit requires DPDK v16.11 functionality that isn't available in
previous releases, and thus breaks compatibility with such releases.

Signed-off-by: Ciara Loftus 
---
 INSTALL.DPDK.md   |   10 +
 NEWS  |2 +
 lib/netdev-dpdk.c | 1103 +
 3 files changed, 448 insertions(+), 667 deletions(-)

diff --git a/INSTALL.DPDK.md b/INSTALL.DPDK.md
index 2f0ae9a..5678e41 100644
--- a/INSTALL.DPDK.md
+++ b/INSTALL.DPDK.md
@@ -603,6 +603,16 @@ can be found in [Vhost Walkthrough].
 
 http://dpdk.org/doc/guides/rel_notes/release_16.11.html
 
+  - dpdk, dpdkr and dpdkvhostuser ports are 'eth' type ports in the context of
+DPDK as they are all managed by the rte_ether API. This means that they
+adhere to the DPDK configuration option CONFIG_RTE_MAX_ETHPORTS which by
+default is set to 32. This means by default the combined total number of
+dpdk, dpdkr and dpdkvhostuser ports allowable in OVS with DPDK is 32. This
+value can be changed if desired by modifying the configuration file in
+DPDK, or by overriding the default value on the command line when building
+DPDK. eg.
+
+`make install CONFIG_RTE_MAX_ETHPORTS=64`
 
 Bug Reporting:
 --
diff --git a/NEWS b/NEWS
index ab74fcd..6e47683 100644
--- a/NEWS
+++ b/NEWS
@@ -135,6 +135,8 @@ v2.6.0 - 27 Sep 2016
  * Remove dpdkvhostcuse port type.
  * OVS client mode for vHost and vHost reconnect (Requires QEMU 2.7)
  * 'dpdkvhostuserclient' port type.
+ * vHost PMD integration brings vhost-user ports under control of the
+   rte_ether DPDK API.
- Increase number of registers to 16.
- ovs-benchmark: This utility has been removed due to lack of use and
  bitrot.
diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index e8cd22a..d8e83b9 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -122,6 +123,7 @@ BUILD_ASSERT_DECL((MAX_NB_MBUF / 
ROUND_DOWN_POW2(MAX_NB_MBUF/MIN_NB_MBUF))
 #define XSTAT_RX_BROADCAST_PACKETS   "rx_broadcast_packets"
 #define XSTAT_TX_BROADCAST_PACKETS   "tx_broadcast_packets"
 #define XSTAT_RX_UNDERSIZED_ERRORS   "rx_undersized_errors"
+#define XSTAT_RX_UNDERSIZE_PACKETS   "rx_undersize_packets"
 #define XSTAT_RX_OVERSIZE_ERRORS "rx_oversize_errors"
 #define XSTAT_RX_FRAGMENTED_ERRORS   "rx_fragmented_errors"
 #define XSTAT_RX_JABBER_ERRORS   "rx_jabber_errors"
@@ -143,6 +145,9 @@ BUILD_ASSERT_DECL((MAX_NB_MBUF / 
ROUND_DOWN_POW2(MAX_NB_MBUF/MIN_NB_MBUF))
 #define VHOST_ENQ_RETRY_NUM 8
 #define IF_NAME_SZ (PATH_MAX > IFNAMSIZ ? PATH_MAX : IFNAMSIZ)
 
+/* Array that tracks the used & unused vHost user driver IDs */
+static unsigned int vhost_drv_ids[RTE_MAX_ETHPORTS];
+
 static const struct rte_eth_conf port_conf = {
 .rxmode = {
 .mq_mode = ETH_MQ_RX_RSS,
@@ -343,15 +348,12 @@ struct netdev_dpdk {
 struct rte_eth_link link;
 int link_reset_cnt;
 
-/* virtio identifier for vhost devices */
-ovsrcu_index vid;
-
-/* True if vHost device is 'up' and has been reconfigured at least once */
-bool vhost_reconfigured;
-
 /* Identifier used to distinguish vhost devices from each other. */
 char vhost_id[PATH_MAX];
 
+/* ID of vhost user port given to the PMD driver */
+unsigned int vhost_pmd_id;
+
 /* In dpdk_list. */
 struct ovs_list list_node OVS_GUARDED_BY(dpdk_mutex);
 
@@ -392,16 +394,25 @@ struct netdev_rxq_dpdk {
 };
 
 static int netdev_dpdk_construct(struct netdev *);
-
-int netdev_dpdk_get_vid(const struct netdev_dpdk *dev);
+static int netdev_dpdk_vhost_construct(struct netdev *);
+static int netdev_dpdk_vhost_client_construct(struct netdev *);
 
 struct ingress_policer *
 netdev_dpdk_get_ingress_policer(const struct netdev_dpdk *dev);
 
+static void link_status_changed_callback(uint8_t port_id,
+enum rte_eth_event_type type, void *param);
+static void vring_state_changed_callback(uint8_t port_id,
+enum rte_eth_event_type type, void *param);
+static void netdev_dpdk_remap_txqs(struct netdev_dpdk *dev);
+static void netdev_dpdk_txq_map_clear(struct netdev_dpdk *dev);
+
 static bool
-is_dpdk_class(const struct netdev_class *class)
+is_dpdk_eth_class(const struct netdev_class *class)
 {
-return class->construct == netdev_dpdk_construct;
+return ((class->construct == netdev_dpdk_construct) ||
+(class->construct == netdev_dpdk_vhost_construct) ||
+(class->construct == netdev_dpdk_vhost_client_construct));
 }
 
 /* DPDK NIC drivers allocate RX buffers at a particular granularity, typically
@@ -681,8 +692,13 @@ dpdk_eth_dev_queue_setup(struct netdev

[ovs-dev] Bug#840770: openvswitch: FTBFS on almost all big-endian architectures: 954: ofproto-dpif - in place modification (vlan) FAILED (ofproto-dpif.at:7237)

2016-10-14 Thread Emilio Pozuelo Monfort
Source: openvswitch
Version: 2.5.1~pre+git20160626-2
Severity: serious

Hi,

openvswitch failed to build on almost all of our big-endian architectures:

https://buildd.debian.org/status/package.php?p=openvswitch

As you can see it failed on mips, powerpc, s390x, m68k, ppc64 and sparc64,
all of which are big endian. powerpcspe is also big endian, but a build
hasn't been attempted there yet. hppa is the notable exception, as it is
the only big endian architecture where this has built. Perhaps it is
because of a difference in one of the build-deps or in some other build
environment difference, or perhaps it is for some other reason. Or maybe
this isn't an endianness issue at all?

Cheers,
Emilio

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (800, 'unstable'), (700, 'experimental'), (650, 'testing'), (500, 
'unstable-debug')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, armhf

Kernel: Linux 4.7.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH v3 03/12] flow: Skip invoking expensive count_1bits() with zero input.

2016-10-14 Thread Jarno Rajahalme

> On Oct 14, 2016, at 7:37 AM, Bhanuprakash Bodireddy 
>  wrote:
> 
> This patch checks if trash is non-zero and only then resets the flowmap
> bit and increment the pointer by set bits as found in trash.
> 
> Signed-off-by: Bhanuprakash Bodireddy 
> Co-authored-by: Antonio Fischetti 
> Signed-off-by: Antonio Fischetti 
> Acked-by: Jarno Rajahalme 
> ---
> lib/flow.h | 15 ++-
> 1 file changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/lib/flow.h b/lib/flow.h
> index 5a14941..74e75d6 100644
> --- a/lib/flow.h
> +++ b/lib/flow.h
> @@ -614,11 +614,16 @@ mf_get_next_in_map(struct mf_for_each_in_map_aux *aux,
>  * to ‘rm1bit’. */
> map_t trash = *fmap & (rm1bit - 1);
> 
> -*fmap -= trash;
> -/* count_1bits() is fast for systems where speed matters (e.g.,
> - * DPDK), so we don't try avoid using it.
> - * Advance 'aux->values' to point to the value for 'rm1bit'. */
> -aux->values += count_1bits(trash);
> +/* Avoid resetting 'fmap' and calling count_1bits() when trash is
> + * zero. */
> +if (trash) {
> +*fmap -= trash;
> +/* count_1bits() is fast for systems where speed matters (e.g.,
> + * DPDK), so we don't try avoid using it.

The comment above is still wrong as we now test ‘trash’ for non-zero above.

  Jarno

> + * Advance 'aux->values' to point to the value for 'rm1bit' only.
> + */
> +aux->values += count_1bits(trash);
> +}
> 
> *value = *aux->values;
> } else {
> -- 
> 2.4.11
> 
> ___
> 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] ovsdb: implement read-only remote connection type

2016-10-14 Thread Lance Richardson
This change set adds a new optional access-type specifier to
remote connection descriptors for ovsdb-server.

Examples:
--remote=ptcp:ro:0:192.168.0.10
--remote=punix:ro:asocket.sock
--remote=pssl:ro:0:192.168.0.10
--remote=tcp:ro:192.168.0.99:
--remote=unix:ro:asocket.sock
--remote=ssl:ro:192.168.0.10:

Operations that would alter the state of the database are not
permitted on connections for which the "ro" access-type is specified.

Signed-off-by: Lance Richardson 
---
RFC->v1:
   - Added autotest keywords for ssl tests.
   - Changed active tcp and ssl tests to find an unused TCP
 port instead of using hardcoded values (approach borrowed
 from ovsdb-idl.at).
   - Updated ovsdb-server.1 man page to add "ro:" connection types.
   - Fixed line length issue (identified by checkpatch.py) in
 jsonrpc-server.c.
   - Removed references to "read-write" connection type (still
 wondering "rw:" should be supported where "ro:" is allowed
 for symmetry).

 lib/stream-ssl.c  |  11 +-
 lib/stream-tcp.c  |  21 +--
 lib/stream.c  |  94 -
 lib/stream.h  |   4 +-
 manpages.mk   |   2 +
 ovn/controller-vtep/ovn-controller-vtep.c |   2 +-
 ovn/controller/ovn-controller.c   |   2 +-
 ovn/northd/ovn-northd.c   |   2 +-
 ovn/utilities/ovn-sbctl.c |   2 +-
 ovn/utilities/ovn-trace.c |   2 +-
 ovsdb/automake.mk |   2 +
 ovsdb/jsonrpc-server.c|  11 +-
 ovsdb/ovsdb-client.c  |   2 +-
 ovsdb/ovsdb-server.1.in   |   2 +
 ovsdb/ovsdb-server.c  |   2 +-
 ovsdb/remote-active-ro.man|  28 
 ovsdb/remote-passive-ro.man   |  35 +
 tests/ovsdb-server.at | 224 ++
 tests/test-jsonrpc.c  |   2 +-
 utilities/ovs-vsctl.c |   2 +-
 vswitchd/ovs-vswitchd.c   |   2 +-
 vtep/vtep-ctl.c   |   2 +-
 22 files changed, 422 insertions(+), 34 deletions(-)
 create mode 100644 ovsdb/remote-active-ro.man
 create mode 100644 ovsdb/remote-passive-ro.man

diff --git a/lib/stream-ssl.c b/lib/stream-ssl.c
index a5c32a1..2443005 100644
--- a/lib/stream-ssl.c
+++ b/lib/stream-ssl.c
@@ -778,13 +778,14 @@ pssl_pstream_cast(struct pstream *pstream)
 }
 
 static int
-pssl_open(const char *name OVS_UNUSED, char *suffix, struct pstream **pstreamp,
+pssl_open(const char *name, char *suffix, struct pstream **pstreamp,
   uint8_t dscp)
 {
 char bound_name[SS_NTOP_BUFSIZE + 16];
 char addrbuf[SS_NTOP_BUFSIZE];
 struct sockaddr_storage ss;
 struct pssl_pstream *pssl;
+const char *access = "";
 uint16_t port;
 int retval;
 int fd;
@@ -799,9 +800,13 @@ pssl_open(const char *name OVS_UNUSED, char *suffix, 
struct pstream **pstreamp,
 return -fd;
 }
 
+if (!strncmp(name, "pssl:ro:", 8)) {
+access = "ro:";
+}
+
 port = ss_get_port(&ss);
-snprintf(bound_name, sizeof bound_name, "pssl:%"PRIu16":%s",
- port, ss_format_address(&ss, addrbuf, sizeof addrbuf));
+snprintf(bound_name, sizeof bound_name, "pssl:%s%"PRIu16":%s",
+ access, port, ss_format_address(&ss, addrbuf, sizeof addrbuf));
 
 pssl = xmalloc(sizeof *pssl);
 pstream_init(&pssl->pstream, &pssl_pstream_class, bound_name);
diff --git a/lib/stream-tcp.c b/lib/stream-tcp.c
index 1749fad..e0aaa68 100644
--- a/lib/stream-tcp.c
+++ b/lib/stream-tcp.c
@@ -84,13 +84,13 @@ static int
 new_pstream(char *suffix, const char *name, struct pstream **pstreamp,
 int dscp, char *unlink_path, bool kernel_print_port)
 {
-char bound_name[SS_NTOP_BUFSIZE + 16];
+char bound_name[SS_NTOP_BUFSIZE + 20];
 char addrbuf[SS_NTOP_BUFSIZE];
 struct sockaddr_storage ss;
+const char *access = "";
 int error;
 uint16_t port;
 int fd;
-char *conn_name = CONST_CAST(char *, name);
 
 fd = inet_open_passive(SOCK_STREAM, suffix, -1, &ss, dscp,
kernel_print_port);
@@ -98,14 +98,15 @@ new_pstream(char *suffix, const char *name, struct pstream 
**pstreamp,
 return -fd;
 }
 
-port = ss_get_port(&ss);
-if (!conn_name) {
-snprintf(bound_name, sizeof bound_name, "ptcp:%"PRIu16":%s",
- port, ss_format_address(&ss, addrbuf, sizeof addrbuf));
-conn_name = bound_name;
+if (!strncmp(name, "ptcp:ro:", 8)) {
+access = "ro:";
 }
 
-error = new_fd_pstream(conn_name, fd, ptcp_accept, unlink_path, pstreamp);
+port = ss_get_port(&ss);
+snprintf(bound_name, sizeof bound_name, "ptcp:%s%"PRIu16":%s",
+ access, port, ss_format_address(&ss, addrbuf, sizeof addrbuf));
+
+error = new_fd_pstream(bound_n

[ovs-dev] [PATCH v2] ovsdb: implement read-only remote connection type

2016-10-14 Thread Lance Richardson
This change set adds a new optional access-type specifier to
remote connection descriptors for ovsdb-server.

Examples:
--remote=ptcp:ro:0:192.168.0.10
--remote=punix:ro:asocket.sock
--remote=pssl:ro:0:192.168.0.10
--remote=tcp:ro:192.168.0.99:
--remote=unix:ro:asocket.sock
--remote=ssl:ro:192.168.0.10:

Operations that would alter the state of the database are not
permitted on connections for which the "ro" access-type is specified.

Signed-off-by: Lance Richardson 
---
RFC->v1:
   - Added autotest keywords for ssl tests.
   - Changed active tcp and ssl tests to find an unused TCP
 port instead of using hardcoded values (approach borrowed
 from ovsdb-idl.at).
   - Updated ovsdb-server.1 man page to add "ro:" connection types.
   - Fixed line length issue (identified by checkpatch.py) in
 jsonrpc-server.c.
   - Removed references to "read-write" connection type (still
 wondering "rw:" should be supported where "ro:" is allowed
 for symmetry).

v1->v2:
   - Rebased to current tip of master.
   - Adjusted tests per commit 561205007e17
 ("tests: Get rid of overly specific --pidfile and --unixctl options.")

 lib/stream-ssl.c  |  11 +-
 lib/stream-tcp.c  |  21 +--
 lib/stream.c  |  94 -
 lib/stream.h  |   4 +-
 manpages.mk   |   4 +
 ovn/controller-vtep/ovn-controller-vtep.c |   2 +-
 ovn/controller/ovn-controller.c   |   2 +-
 ovn/northd/ovn-northd.c   |   2 +-
 ovn/utilities/ovn-sbctl.c |   2 +-
 ovn/utilities/ovn-trace.c |   2 +-
 ovsdb/automake.mk |   2 +
 ovsdb/jsonrpc-server.c|  11 +-
 ovsdb/ovsdb-client.c  |   2 +-
 ovsdb/ovsdb-server.1.in   |   2 +
 ovsdb/ovsdb-server.c  |   2 +-
 ovsdb/remote-active-ro.man|  28 
 ovsdb/remote-passive-ro.man   |  35 +
 tests/ovsdb-server.at | 224 ++
 tests/test-jsonrpc.c  |   2 +-
 utilities/ovs-vsctl.c |   2 +-
 vswitchd/ovs-vswitchd.c   |   2 +-
 vtep/vtep-ctl.c   |   2 +-
 22 files changed, 424 insertions(+), 34 deletions(-)
 create mode 100644 ovsdb/remote-active-ro.man
 create mode 100644 ovsdb/remote-passive-ro.man

diff --git a/lib/stream-ssl.c b/lib/stream-ssl.c
index a5c32a1..2443005 100644
--- a/lib/stream-ssl.c
+++ b/lib/stream-ssl.c
@@ -778,13 +778,14 @@ pssl_pstream_cast(struct pstream *pstream)
 }
 
 static int
-pssl_open(const char *name OVS_UNUSED, char *suffix, struct pstream **pstreamp,
+pssl_open(const char *name, char *suffix, struct pstream **pstreamp,
   uint8_t dscp)
 {
 char bound_name[SS_NTOP_BUFSIZE + 16];
 char addrbuf[SS_NTOP_BUFSIZE];
 struct sockaddr_storage ss;
 struct pssl_pstream *pssl;
+const char *access = "";
 uint16_t port;
 int retval;
 int fd;
@@ -799,9 +800,13 @@ pssl_open(const char *name OVS_UNUSED, char *suffix, 
struct pstream **pstreamp,
 return -fd;
 }
 
+if (!strncmp(name, "pssl:ro:", 8)) {
+access = "ro:";
+}
+
 port = ss_get_port(&ss);
-snprintf(bound_name, sizeof bound_name, "pssl:%"PRIu16":%s",
- port, ss_format_address(&ss, addrbuf, sizeof addrbuf));
+snprintf(bound_name, sizeof bound_name, "pssl:%s%"PRIu16":%s",
+ access, port, ss_format_address(&ss, addrbuf, sizeof addrbuf));
 
 pssl = xmalloc(sizeof *pssl);
 pstream_init(&pssl->pstream, &pssl_pstream_class, bound_name);
diff --git a/lib/stream-tcp.c b/lib/stream-tcp.c
index 1749fad..e0aaa68 100644
--- a/lib/stream-tcp.c
+++ b/lib/stream-tcp.c
@@ -84,13 +84,13 @@ static int
 new_pstream(char *suffix, const char *name, struct pstream **pstreamp,
 int dscp, char *unlink_path, bool kernel_print_port)
 {
-char bound_name[SS_NTOP_BUFSIZE + 16];
+char bound_name[SS_NTOP_BUFSIZE + 20];
 char addrbuf[SS_NTOP_BUFSIZE];
 struct sockaddr_storage ss;
+const char *access = "";
 int error;
 uint16_t port;
 int fd;
-char *conn_name = CONST_CAST(char *, name);
 
 fd = inet_open_passive(SOCK_STREAM, suffix, -1, &ss, dscp,
kernel_print_port);
@@ -98,14 +98,15 @@ new_pstream(char *suffix, const char *name, struct pstream 
**pstreamp,
 return -fd;
 }
 
-port = ss_get_port(&ss);
-if (!conn_name) {
-snprintf(bound_name, sizeof bound_name, "ptcp:%"PRIu16":%s",
- port, ss_format_address(&ss, addrbuf, sizeof addrbuf));
-conn_name = bound_name;
+if (!strncmp(name, "ptcp:ro:", 8)) {
+access = "ro:";
 }
 
-error = new_fd_pstream(conn_name, fd, ptcp_accept, unlink_path, pstreamp);
+port = ss_get_port(&ss);
+snprintf(b

[ovs-dev] [PATCH] stream-ssl: Fix memory leak on error path.

2016-10-14 Thread Ben Pfaff
The commit that this fixes is from 2009.

Reported-by: Kai-Wei Fan 
Fixes: 9467fe624698 ("Add SSL support to "stream" library and OVSDB.")
Signed-off-by: Ben Pfaff 
---
 lib/stream-ssl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/stream-ssl.c b/lib/stream-ssl.c
index a5c32a1..dcafc2d 100644
--- a/lib/stream-ssl.c
+++ b/lib/stream-ssl.c
@@ -670,7 +670,7 @@ ssl_send(struct stream *stream, const void *buffer, size_t 
n)
 case EAGAIN:
 return n;
 default:
-sslv->txbuf = NULL;
+ssl_clear_txbuf(sslv);
 return -error;
 }
 }
-- 
2.1.3

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


Re: [ovs-dev] [PATCH] stream-ssl: Fix memory leak on error path.

2016-10-14 Thread Andy Zhou
On Fri, Oct 14, 2016 at 11:12 AM, Ben Pfaff  wrote:

> The commit that this fixes is from 2009.
>
> Reported-by: Kai-Wei Fan 
> Fixes: 9467fe624698 ("Add SSL support to "stream" library and OVSDB.")
> Signed-off-by: Ben Pfaff 
>

LGTM
Acked-by: Andy Zhou 
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH v3 1/4] ovn: ovn-ctl support for HA ovn DB servers

2016-10-14 Thread Andy Zhou
On Fri, Oct 14, 2016 at 2:52 AM, Babu Shanmugam  wrote:

>
>
> On Friday 14 October 2016 04:00 AM, Andy Zhou wrote:
>
>
>
> Done. Now it shows the following.
>
> [root@h2 ovs]# crm configure show
>>
>> node 1: h1 \
>>
>> attributes
>>
>> node 2: h2
>>
>> primitive ClusterIP IPaddr2 \
>>
>> params ip=10.33.75.200 cidr_netmask=32 \
>>
>> op start interval=0s timeout=20s \
>>
>> op stop interval=0s timeout=20s \
>>
>> op monitor interval=30s
>>
>> primitive ovndb ocf:ovn:ovndb-servers \
>>
>> op start interval=0s timeout=30s \
>>
>> op stop interval=0s timeout=20s \
>>
>> op promote interval=0s timeout=50s \
>>
>> op demote interval=0s timeout=50s \
>>
>> op monitor interval=1min \
>>
>> meta
>>
>> ms ovndb-master ovndb \
>>
>> meta notify=true
>>
>> colocation colocation-ovndb-master-ClusterIP-INFINITY inf: 
>> ovndb-master:Started
>> ClusterIP:Master
>>
>> order order-ClusterIP-ovndb-master-mandatory inf: ClusterIP:start
>> ovndb-master:start
>>
>> property cib-bootstrap-options: \
>>
>> have-watchdog=false \
>>
>> dc-version=1.1.13-10.el7_2.4-44eb2dd \
>>
>> cluster-infrastructure=corosync \
>>
>> cluster-name=mycluster \
>>
>> stonith-enabled=false
>>
>> property ovn_ovsdb_master_server: \
>>
>
>
>>
>>
>>
> My installation does not have ocf-tester,  There is a program called ocft
> with a test option. Not sure if this is a suitable replacement. If not, how
> could I get
> the ocf-tester program? I ran the ocft program and get the following
> output. Not sure what it means.
>
>  [root@h2 ovs]# ocft test -n test-ovndb -o master_ip 10.0.0.1
> /usr/share/openvswitch/scripts/ovndb-servers.ocf
>
> ERROR: cases directory not found.
>
>
>
> I have attached ocf-tester with this mail. I guess it's a standalone
> script. If it does not work, I think it's better not to attempt anymore as
> we have another way to find out.
>
>
>
> Alternately, you can check if the ovsdb servers are started properly by
>> running
>>
>> /usr/share/openvswitch/scripts/ovn-ctl --db-sb-sync-from=10.0.0.1
>> --db-nb-sync-from=10.0.0.1 start_ovsdb
>>
>>
>> The output are as follows. Should we use --db-sb-sync-from-addr instead?
>  [root@h2 ovs]# /usr/share/openvswitch/scripts/ovn-ctl
> --db-sb-sync-from=10.0.0.1 --db-nb-sync-from=10.0.0.1 start_ovsdb
>
> /usr/share/openvswitch/scripts/ovn-ctl: unknown option
> "--db-sb-sync-from=10.0.0.1" (use --help for help)
> /usr/share/openvswitch/scripts/ovn-ctl: unknown option
> "--db-nb-sync-from=10.0.0.1" (use --help for help)
>
> 'ovn-ctl' runs without any error message after I fixed the command line
> parameter.
>
>
> I am sorry for the misinformation, Andy. What you ran is correct. Could
> you check the status of the ovsdb servers in h2 after you run the above
> command using the following commands.
>
> ovn-ctl status_ovnnb
> ovn-ctl status_ovnsb
>
> Both the above commands should return "running/backup". If you see in the
> OCF script in the function ovsdb_server_start(), we wait indefinitely
> till  the DB servers are started. Since the 'start' action on h2 times out,
> I doubt that the servers are not started properly.
>
> O.K. I was able to get both server up.  Mostly by try-and-error.

[root@h2 openvswitch]# crm status
>>
>> Last updated: Fri Oct 14 09:34:50 2016 Last change: Thu Oct 13 11:17:25
>> 2016 by root via cibadmin on h2
>>
>> Stack: corosync
>>
>> Current DC: h1 (version 1.1.13-10.el7_2.4-44eb2dd) - partition with quorum
>>
>> 2 nodes and 3 resources configured
>>
>>
>> *Online*: [ h1 h2 ]
>>
>>
>> Full list of resources:
>>
>>
>>  *ClusterIP* (ocf::heartbeat:IPaddr2): *Started* h1
>>
>>  *Master*/*Slave* Set: ovndb-*master* [ovndb]
>>
>>  *Master*s: [ h1 ]
>>
>>  *Slave*s: [ h2 ]
>>
>
At this point, I think the scripts can work and will probably work for the
integration task you had in mind.  However, when it does not work,
debugging it may not be tribal. Not sure if this is a show stopper. I also
don't know pacemaker well enough to compare OVN with other HA components.

From this email thread,  It should be clear the patch set can use more
documentation,  1) Enhance ovn-ctl man page  2) Add an integration guide on
integration with pacemaker, or add an 'HA' section in the
IntegrationGuide.md. 3) consider adding logs in case of error to help
trouble shooting, I don't have specific suggestions

Would you please make those changes and post a V2?   Thanks.
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH v3 1/4] ovn: ovn-ctl support for HA ovn DB servers

2016-10-14 Thread Babu Shanmugam



On Saturday 15 October 2016 02:25 AM, Andy Zhou wrote:



On Fri, Oct 14, 2016 at 2:52 AM, Babu Shanmugam > wrote:




On Friday 14 October 2016 04:00 AM, Andy Zhou wrote:



Done. Now it shows the following.

[root@h2 ovs]# crm configure show

node1: h1 \

attributes

node2: h2

primitiveClusterIP IPaddr2 \

paramsip=10.33.75.200cidr_netmask=32\

opstart interval=0stimeout=20s\

opstop interval=0stimeout=20s\

opmonitor interval=30s

primitiveovndb ocf:ovn:ovndb-servers \

opstart interval=0stimeout=30s\

opstop interval=0stimeout=20s\

oppromote interval=0stimeout=50s\

opdemote interval=0stimeout=50s\

opmonitor interval=1min\

meta

msovndb-master ovndb\

metanotify=true

colocationcolocation-ovndb-master-ClusterIP-INFINITY inf:
ovndb-master:Started ClusterIP:Master

orderorder-ClusterIP-ovndb-master-mandatory inf:
ClusterIP:start ovndb-master:start

propertycib-bootstrap-options: \

have-watchdog=false\

dc-version=1.1.13-10.el7_2.4-44eb2dd\

cluster-infrastructure=corosync\

cluster-name=mycluster\

stonith-enabled=false

propertyovn_ovsdb_master_server: \




My installation does not have ocf-tester,  There is a program
called ocft with a test option. Not sure if this is a suitable
replacement. If not, how could I get
the ocf-tester program? I ran the ocft program and get the
following output. Not sure what it means.

 [root@h2 ovs]# ocft test -n test-ovndb -o master_ip 10.0.0.1
/usr/share/openvswitch/scripts/ovndb-servers.ocf

ERROR: cases directory not found.




I have attached ocf-tester with this mail. I guess it's a
standalone script. If it does not work, I think it's better not to
attempt anymore as we have another way to find out.




Alternately, you can check if the ovsdb servers are started
properly by running

/usr/share/openvswitch/scripts/ovn-ctl
--db-sb-sync-from=10.0.0.1 --db-nb-sync-from=10.0.0.1 start_ovsdb


The output are as follows. Should we use --db-sb-sync-from-addr
instead?
 [root@h2 ovs]# /usr/share/openvswitch/scripts/ovn-ctl
--db-sb-sync-from=10.0.0.1 --db-nb-sync-from=10.0.0.1 start_ovsdb

/usr/share/openvswitch/scripts/ovn-ctl: unknown option
"--db-sb-sync-from=10.0.0.1" (use --help for help)

/usr/share/openvswitch/scripts/ovn-ctl: unknown option
"--db-nb-sync-from=10.0.0.1" (use --help for help)

'ovn-ctl' runs without any error message after I fixed the
command line parameter.


I am sorry for the misinformation, Andy. What you ran is correct.
Could you check the status of the ovsdb servers in h2 after you
run the above command using the following commands.

ovn-ctl status_ovnnb
ovn-ctl status_ovnsb

Both the above commands should return "running/backup". If you see
in the OCF script in the function ovsdb_server_start(), we wait
indefinitely till  the DB servers are started. Since the 'start'
action on h2 times out, I doubt that the servers are not started
properly.

O.K. I was able to get both server up.  Mostly by try-and-error.


[root@h2 openvswitch]# crm status

Last updated: Fri Oct 14 09:34:50 2016Last change: Thu Oct 13
11:17:25 2016 by root via cibadmin on h2

Stack: corosync

Current DC: h1 (version 1.1.13-10.el7_2.4-44eb2dd) -
partition with quorum

2 nodes and 3 resources configured


*Online*: [ h1 h2 ]


Full list of resources:


*ClusterIP*(ocf::heartbeat:IPaddr2):*Started*h1

*Master*/*Slave*Set: ovndb-*master*[ovndb]

*Master*s: [ h1 ]

*Slave*s: [ h2 ]

At this point, I think the scripts can work and will probably work for 
the integration task you had in mind. However, when it does not work, 
debugging it may not be tribal. Not sure if this is a show stopper. I 
also don't know pacemaker well enough to compare OVN with other HA 
components.


From this email thread,  It should be clear the patch set can use more 
documentation,  1) Enhance ovn-ctl man page  2) Add an integration 
guide on integration with pacemaker, or add an 'HA' section in the 
IntegrationGuide.md. 3) consider adding logs in case of error to help 
trouble shooting, I don't have specific suggestions


Would you please make those changes and post a V2? Thanks.



I agree Andy. I will post a V2 soon.

Thank you,
Babu
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH] rhel-systemd: Delay shutting down the services

2016-10-14 Thread Russell Bryant
On Thu, Oct 13, 2016 at 9:44 AM, Flavio Leitner  wrote:

> On Wed, Oct 12, 2016 at 11:56:51AM -0400, Russell Bryant wrote:
> > On Fri, Oct 7, 2016 at 1:36 PM, Aaron Conole  wrote:
> >
> > > During testing it was found that systemd would consider the openvswitch
> > > service as a part of networking component, but the dependent services
> of
> > > ovs-vswitchd and ovsdb-server were not likewise considered.  This leads
> > > to some strange race conditions, observed when using NFS over TCP,
> while
> > > shutting down systems.
> > >
> > > Fixes: 84ad12083491 ("rhel: Improved Systemd Integration")
> > > Co-authored-by: Flavio Leitner 
> > > Signed-off-by: Aaron Conole 
> > >
> >
> > This looks fine to me.  Flavio, can you provide a Signed-off-by for this
> > patch, please?
>
> Signed-off-by: Flavio Leitner 


Thanks, I applied this to master.

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


Re: [ovs-dev] [PATCH] rhel-systemd: Delay shutting down the services

2016-10-14 Thread Russell Bryant
On Fri, Oct 14, 2016 at 9:36 PM, Russell Bryant  wrote:

>
> On Thu, Oct 13, 2016 at 9:44 AM, Flavio Leitner  wrote:
>
>> On Wed, Oct 12, 2016 at 11:56:51AM -0400, Russell Bryant wrote:
>> > On Fri, Oct 7, 2016 at 1:36 PM, Aaron Conole 
>> wrote:
>> >
>> > > During testing it was found that systemd would consider the
>> openvswitch
>> > > service as a part of networking component, but the dependent services
>> of
>> > > ovs-vswitchd and ovsdb-server were not likewise considered.  This
>> leads
>> > > to some strange race conditions, observed when using NFS over TCP,
>> while
>> > > shutting down systems.
>> > >
>> > > Fixes: 84ad12083491 ("rhel: Improved Systemd Integration")
>> > > Co-authored-by: Flavio Leitner 
>> > > Signed-off-by: Aaron Conole 
>> > >
>> >
>> > This looks fine to me.  Flavio, can you provide a Signed-off-by for this
>> > patch, please?
>>
>> Signed-off-by: Flavio Leitner 
>
>
> Thanks, I applied this to master.
>

and I backported this to branch-2.6.

I'll backport this along with the other systemd related fixes to branch-2.5
in a few minutes.

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


Re: [ovs-dev] [PATCH v2] Introducing support for P4 in OVS

2016-10-14 Thread Muhammad Shahbaz
Hi Ben,

That's great! Thanks for the new set of changes to the new approach.

I have looked at the changes and, I agree, it makes more sense to have
template files inline with theOVS source code rather than having them
under a separate folder. I like the new approach for P4, much cleaner.

I will build and test it myself and let you know if I see any issues.

Cheers,
Shahbaz

On Fri, Oct 14, 2016 at 8:00 PM Ben Pfaff  wrote:

> I finished changing the build system to use the new approach.  It's on
> the same branch as before (force-pushed over the previous version).
>
> It builds, I haven't tried running it yet.
>
> On Thu, Oct 13, 2016 at 05:05:17PM -0700, Ben Pfaff wrote:
> > Thanks for sending v2.
> >
> > I think that the changes to extract-ofp-actions are white-space only and
> > can be dropped.
> >
> > I spent a lot of time this afternoon playing with the build system.
> > Running p4c-behavioral once at configure time is not a great way to
> > go.  Furthermore, it's a pain to have all these files in a separate
> > directory that's walled off from the main code.  I think that we can do
> > better.  So I pushed this branch:
> > https://github.com/blp/ovs-reviews/tree/p4-2
> > which adds a commit to demonstrate a different approach.  The basic idea
> > is to teach the build system to run any file whose name ends in .p4c
> > through p4c-behavioral regardless of where it occurs in the tree.
> > p4c-behavioral isn't well suited for this so I had to write a script
> > (preprocess-p4) to make it possible.  I included a demo use of the idea
> > for just include/openvswitch/flow.h.  You can probably see how this is
> > easier to follow than the indirection through a separate directory plus
> > an extra nested #include.
> >
> > I'll certainly have other comments, but I spent all afternoon on this
> > and I'm out of time for the day.
> >
> > What do you think of this approach?  It's an incomplete conversion for
> > now, of course, so the tree doesn't build.
> >
> > On Sat, Oct 08, 2016 at 02:12:11AM -0500, Muhammad Shahbaz wrote:
> > > This is a follow-up patch with changes proposed by Ben Pfaff in an
> earlier thread,
> > > "[PATCH 1/2] adding P4 support." This patch doesn't contain changes
> for the
> > > microflow cache; those will be posted later.
> > >
> > > Following changes have been addressed:
> > >
> > > 1. All ovs-related code is now in under the include/p4/plugin
> directory.
> > > p4c-behavioral reads this code using the --plugin-path flag. Also, no
> changes
> > > are needed in the p4c-behvaioral repository now.
> > > 2. Identifier names no longer begin with a leading "_."
> > > 3. Dropping macro definitions for headers for better readability.
> > > 4. Unified code for repetitive 8/16/32/64 bit cases.
> > > 5. Replaced OXM_OF_* with NXOXM_ET_*.
> > > 6. Only fields with valid headers are now masked.
> > > 7. Code refactoring to remove repetition and to improve readability.
> > >
> > > Remaining changes, from the earlier thread, that still need to be
> addressed are:
> > >
> > > 1. Removing duplicate parsing and integrating resets into
> dp_packet_reset_offsets().
> > > 2. Inlining packet_set__*() functions.
> > > 3. Come up with a compact representation of valid bits for the headers.
> > >
> > > Signed-off-by: Muhammad Shahbaz 
> > > ---
> > >  acinclude.m4   |  14 +
> > >  build-aux/extract-ofp-actions  |   4 +-
> > >  build-aux/extract-ofp-fields   |  99 +++--
> > >  configure.ac   |   1 +
> > >  datapath/linux/compat/include/linux/openvswitch.h  |   7 +
> > >  include/automake.mk|   1 +
> > >  include/openvswitch/flow.h |   8 +
> > >  include/openvswitch/meta-flow.h|   5 +
> > >  include/openvswitch/packets.h  |   3 +
> > >  include/openvswitch/types.h|   3 +
> > >  include/p4/automake.mk |  20 +
> > >  include/p4/examples/l2-switch.p4   |  89 
> > >  include/p4/examples/simple-router.p4   | 143 +++
> > >  include/p4/plugin/helpers.py   |  91 
> > >  .../linux/compat/include/linux/openvswitch.h.h |  56 +++
> > >  include/p4/plugin/ovs/include/openvswitch/flow.h.h |  30 ++
> > >  .../plugin/ovs/include/openvswitch/meta-flow.h.h   |  77 
> > >  .../p4/plugin/ovs/include/openvswitch/packets.h.h  |  84 
> > >  .../p4/plugin/ovs/include/openvswitch/types.h.h|  36 ++
> > >  include/p4/plugin/ovs/lib/dp-packet.h.h|  46 +++
> > >  include/p4/plugin/ovs/lib/flow.c.h | 457
> +
> > >  include/p4/plugin/ovs/lib/match.c.h|  53 +++
> > >  include/p4/plugin/ovs/lib/meta-flow.c.h| 185 +
> > >  include/p4/plugin/ovs/lib/nx-match.c.h |  52 +++
> > >  include/p4/plugin/ovs/lib/odp-ex

Re: [ovs-dev] [Backport Request] For branch-2.5, backport rhel-systemd integration

2016-10-14 Thread Russell Bryant
On Wed, Oct 12, 2016 at 12:03 PM, Russell Bryant  wrote:

>
>
> On Fri, Oct 7, 2016 at 1:48 PM, Flavio Leitner  wrote:
>
>> On Thu, Sep 08, 2016 at 07:58:21PM +0100, Markos Chandras wrote:
>> > On 09/08/2016 05:50 PM, Aaron Conole wrote:
>> > >
>> > >> It sounds like new feature territory, but you do make a case for it
>> being considered a set of fixes ...
>> > >
>> > > I agree - it straddles a line.  I was hesitant to even ask, but in
>> RHEL
>> > > we probably need to backport these anyway, so I made an assumption
>> > > (maybe poor) that other systemd distros might use the rhel scripts and
>> > > run into this class of issues also.  Good net-izen, and all that :)
>> > >
>> > > -Aaron
>> >
>> > Hi Aaron,
>> >
>> > Thanks for the backport request. I am also interested in these fixes and
>> > it's something I could use in the SUSE package as well. For my point of
>> > view I see no blockers for those updating their 2.5.0 installations with
>> > these fixes in but I will do some testing on my end as well.
>>
>>
>> Most of the changes are transparent and should not cause any issues.
>>
>> I say most of the changes because the problem is if someone is relying
>> on the openvswitch-nonetwork service state.  In that case, the service
>> doesn't exist anymore after the patchset, so it might break something.
>>
>> I am not sure if we care about that because that service should be
>> considered internal to OVS (used only by ifcfg scripts).  The front end
>> is the openvswitch.service which remains available.
>>
>> Regarding to be a new feature or bugfix, I think this is a bugfix for
>> two things at least.
>>
>> 1) The real service state is represented by openvswitch service.
>> Before the patchset there were situations where the OVS threads were
>> dead but the systemd service was up & running.  The patchset intends
>> to fix this issue.
>>
>> 2) The shutdown ordering. Before the patchset we could have OVS shutting
>> down before other networking services that depends on network.  When OVS
>> terminates, it breaks networking connectivity causing issues. The patchset
>> intends to fix the issue as well, though it needs to include the follow up
>> fix  http://openvswitch.org/pipermail/dev/2016-October/080426.html
>>
>> In another words,
>> Acked-by: Flavio Leitner 
>>
>
> I'm fine with these backports.  I'll wait until we have the follow-up
> patch applied to master, which is pending your (Flavio's) Signed-off-by.
>

As requested, the following commits have been backported to branch-2.5.
Let me know if you run into any issues with the backports.

b23b069 ovs-ctl: Remove code for upgrading from Open vSwitch 1.9 and
earlier.
bb743b6 ovs-ctl: Allow selective start for db and switch
85aa123 utilities/ovs-ctl.in: Only add_managers with vswitchd
8dfa293 utilities/ovs-ctl.in: Allow non-monitoring daemons
af3f8b0 rhel/ovsdb-server.service: Rename the nonetwork service
3704d06 rhel: Improved Systemd Integration
a3ce77d rhel-systemd: Delay shutting down the services

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


Re: [ovs-dev] [PATCH v1] Python-IDL: getattr after mutate fix

2016-10-14 Thread Russell Bryant
On Wed, Oct 12, 2016 at 5:36 PM, Amitabha Biswas  wrote:

> This commit returns the updated column value when getattr is done
> after a mutate operation is performed (but before the commit).
>
> Signed-off-by: Amitabha Biswas 
>
> Reported-by: Richard Theis 
>
> Reported-at: http://openvswitch.org/pipermail/dev/2016-September/
> 080120.html
>
> Fixes: a59912a0ee8e ("python: Add support for partial map and set
> updates")
>

Thanks!  I applied this to master and branch-2.6.

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