[ovs-dev] OVN - QoS (Neutron API)

2015-07-09 Thread Gal Sagie
Hello all,

As of Liberty, neutron will support a QoS API which can be configured on
the logical ports.
(Currently only bandwidth limiting will be supported)

I would like to offer to implement this back-to-back in Neutron OVN plugin
and in OVN.

For this feature we would need to extend the OVN NB API to include QoS
Policy profile table
and another table for QoS rules which are attached to the policy profile.
(Currently we will only support the bandwidth limiting rule type)

Logical Ports can be attached with QoS profiles.

I suggest that currently this will be directly mapped to the SB schema by
northd (and in the future this can be extended to use Openflow Metering
flows when this is fully supported in OVS)

The local OVN-Controller can then use OVSDB for the local vswitch to
configure the current
rules (similar work that we do in Neutron with the L2 Agent)

If the general idea is good, i can take this task on myself and
describe the schema in more details.

Please let me know,

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


Re: [ovs-dev] [PATCH] netdev-dpdk: Add some missing statistics.

2015-07-09 Thread Weglicki, MichalX
Hello, 

>Do you know how much it is going to impact the vhost throughput? Other than 
>this the change looks good to me.

I compared the results based on (OVS head) vs (OVS head + patch) and seems 
there is very small performance drop: 
4,763,016 (HEAD) vs 4,699,571(Patch). 

-Original Message-
From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Daniele Di Proietto
Sent: Monday, July 6, 2015 6:59 PM
To: Puha, TimoX
Cc: dev@openvswitch.org
Subject: Re: [ovs-dev] [PATCH] netdev-dpdk: Add some missing statistics.


On 01/07/2015 11:49, "Timo Puha"  wrote:

>New stats for vhost ports are rx_bytes, tx_bytes, multicast, rx_errors 
>and rx_length_errors. New stats for PMD ports are rx_dropped, 
>rx_length_errors, rx_crc_errors and rx_missed_errors. DPDK imissed 
>packets are now classified as dropped instead of errors.
>
>Signed-off-by: Timo Puha 

Thanks for the patch.  I tried it and I can see the packets properly counted as 
"dropped" instead of "errors".

Do you know how much it is going to impact the vhost throughput? Other than 
this the change looks good to me.

>---
> lib/netdev-dpdk.c | 86
>---
> 1 file changed, 76 insertions(+), 10 deletions(-)
>
>diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index 
>8b843db..9fe625d 100644
>--- a/lib/netdev-dpdk.c
>+++ b/lib/netdev-dpdk.c
>@@ -884,6 +884,35 @@ is_vhost_running(struct virtio_net *dev)
> return (dev != NULL && (dev->flags & VIRTIO_DEV_RUNNING));  }
> 
>+static inline void
>+netdev_dpdk_vhost_update_rx_counters(struct netdev_stats *stats,
>+ struct dp_packet **packets, int
>count)
>+{
>+int i;
>+struct dp_packet *packet;
>+
>+stats->rx_packets += count;
>+for (i = 0; i < count; i++) {
>+packet = packets[i];
>+
>+if (OVS_UNLIKELY(dp_packet_size(packet) < ETH_HEADER_LEN)) {
>+/* This only protects the following multicast counting from
>+ * too short packets, but it does not stop the packet from
>+ * further processing. */
>+stats->rx_errors++;
>+stats->rx_length_errors++;
>+continue;
>+}
>+
>+struct eth_header *eh = (struct eth_header *)
>dp_packet_data(packet);
>+if (OVS_UNLIKELY(eth_addr_is_multicast(eh->eth_dst))) {
>+stats->multicast++;
>+}
>+
>+stats->rx_bytes += dp_packet_size(packet);
>+}
>+}
>+
> /*
>  * The receive path for the vhost port is the TX path out from guest.
>  */
>@@ -911,7 +940,7 @@ netdev_dpdk_vhost_rxq_recv(struct netdev_rxq *rxq_,
> }
> 
> rte_spinlock_lock(&vhost_dev->stats_lock);
>-vhost_dev->stats.rx_packets += (uint64_t)nb_rx;
>+netdev_dpdk_vhost_update_rx_counters(&vhost_dev->stats, packets,
>nb_rx);
> rte_spinlock_unlock(&vhost_dev->stats_lock);
> 
> *c = (int) nb_rx;
>@@ -948,6 +977,23 @@ netdev_dpdk_rxq_recv(struct netdev_rxq *rxq_, 
>struct dp_packet **packets,
> return 0;
> }
> 
>+static inline void
>+netdev_dpdk_vhost_update_tx_counters(struct netdev_stats *stats,
>+ struct dp_packet **packets,
>+ int attempted,
>+ int dropped) {
>+int i;
>+int sent = attempted - dropped;
>+
>+stats->tx_packets += sent;
>+stats->tx_dropped += dropped;
>+
>+for (i = 0; i < sent; i++) {
>+stats->tx_bytes += dp_packet_size(packets[i]);
>+}
>+}
>+
> static void
> __netdev_dpdk_vhost_send(struct netdev *netdev, struct dp_packet **pkts,
>  int cnt, bool may_steal) @@ -1005,8 +1051,8 
>@@ __netdev_dpdk_vhost_send(struct netdev *netdev, struct dp_packet 
>**pkts,
> rte_spinlock_unlock(&vhost_dev->vhost_tx_lock);
> 
> rte_spinlock_lock(&vhost_dev->stats_lock);
>-vhost_dev->stats.tx_packets += (total_pkts - cnt);
>-vhost_dev->stats.tx_dropped += cnt;
>+netdev_dpdk_vhost_update_tx_counters(&vhost_dev->stats, pkts,
>total_pkts,
>+ cnt);
> rte_spinlock_unlock(&vhost_dev->stats_lock);
> 
> out:
>@@ -1309,14 +1355,10 @@ netdev_dpdk_vhost_get_stats(const struct netdev 
>*netdev,
> ovs_mutex_lock(&dev->mutex);
> memset(stats, 0, sizeof(*stats));
> /* Unsupported Stats */
>-stats->rx_errors = UINT64_MAX;
>-stats->tx_errors = UINT64_MAX;
>-stats->multicast = UINT64_MAX;
> stats->collisions = UINT64_MAX;
> stats->rx_crc_errors = UINT64_MAX;
> stats->rx_fifo_errors = UINT64_MAX;
> stats->rx_frame_errors = UINT64_MAX;
>-stats->rx_length_errors = UINT64_MAX;
> stats->rx_missed_errors = UINT64_MAX;
> stats->rx_over_errors = UINT64_MAX;
> stats->tx_aborted_errors = UINT64_MAX; @@ -1325,16 +1367,20 @@ 
>netdev_dpdk_vhost_get_stats(const struct netdev *netdev,
> stats->tx_fifo_errors = UINT64_MAX;
> stats->tx_heartbeat_errors = UINT64_MAX;
> stats->tx_window_errors = UINT64_MAX;

Re: [ovs-dev] [RFC] ovn: physical network integraiton (WIP)

2015-07-09 Thread Russell Bryant
(re-adding ovs dev list)

On 07/09/2015 10:52 AM, Salvatore Orlando wrote:
> 
> 
> On 8 July 2015 at 16:12, Russell Bryant  > wrote:
> 
> On 07/07/2015 06:06 PM, Salvatore Orlando wrote:
> > Reading your post and the associated patch it seems that you're treating
> > the physical network as a logical port from a pipeline perspective but
> > exposing it as a logical switch attribute from a NB DB perspective. Is
> > that correct?
> 
> Yes, that's correct.
> 
> > If my previous statement is correct, I wonder why not treat it always as
> > a logical port and then perhaps leverage OVN gateways? This might or
> > might not represent what a Neutron provider network is, but it surely
> > represent a viable implementation of its main use case: mapping a
> > logical network to a physical VLAN in the data centre, and keeping
> > control of security policing and IP addressing over logical ports
> > created on such network.
> 
> Yes, using gateways to accomplish the use case from a high level makes a
> lot of sense and I expect to provide that, as well.  The gateway work
> needs to make its way into OVN and then we need to figure out how to
> expose it from the Neutron API.
> 
> My worry is that in OpenStack, there's still a significant demand for
> provider networks in the way the reference implementation works, without
> the use of any tunnels.  The primary justification is simplicity,
> AFAICT.
> 
> 
> You are absolutely correct. My gut feeling (I still have to try out your
> patch), is that the solution you are proposing actually does not go in
> this direction.
> I might be mistaken but it seems to me what we have here is a standard
> logical network, implemented with overlays, that "spills" into a
> physical network (and hence my suggestion on L2 gateway).
> 
> The reference implementation (and some other open source and commercial
> ones - afaict at least midonet and vmw nsx) instead implement, as you
> wrote, provider networks as a different way of doing transport mappings
> for a logical network.

Yes, it's my intention to implement it this way (no overlay usage at
all).  The code I threw up is just far from complete.

The L2 gateway stuff is getting implemented too, though.  Alex Wang has
some patches up for that.

> 
> 
> We don't *have* to implement this, but if we don't, it leaves a common
> deployment model unsatisfied by Neutron+OVN, and will continue to be
> covered by the reference implementation.  I was hoping we could cover
> everything the reference implementation provides.
> 
> 
> And we should. We might decide not to cover use cases whose usefulness
> is arguable, like a provider mappings on a specific VxLAN VNI, but the
> VLAN mapping is a must, and it should be implemented in the way
> operators expect it to be implemented.
>  
> 
> 
> > From what I gather this might simplify the broadcast issue you
> > mentioned, as you probably won't need anymore a specialised action.
> > We probably will still have the name overlap issue when doing neutron
> > integration, but this is probably an issue that can be worked around 
> easily.
> >
> > I think the solution you propose to define mappings for the physical
> > network, which is very similar to Neutron's reference control plane, is
> > viable too and can also work in the case where the physical network is
> > represented as a specialised output port. Have you considered this
> > approach?
> 
> That's interesting.  I was thinking of it as a specialized output port,
> but as you pointed out, it's exposed as attributes on the logical switch
> in the NB DB.  I hadn't considered defining the connectivity to the
> external network as a logical port.
> 
> 
> I suspect the reason for which you had not considered it is that it
> would perhaps lead to an implementation that does not render the
> physical network mapping in the way the reference implementation does.
>  
> 
> 
> There's network-wide special handling that seemed a little easier to
> think about when it's configured network-wide.  A logical port today
> exists only on a single chassis (hypervisor), while these special ports
> should exist on every chassis. 
> 
> 
> That is correct, perhaps by treating the external network as logical
> port we're just moving the complexity somewhere else, but not getting
> rid of it.
> 
>  
> 
> If this is used for a given logical
> switch, no tunnels should be created and we need the different output
> behavior.  So, I'm not sure if modeling it that way makes things easier.
> 
> 
> Perhaps not, but at least now we're both convinced it won't! 
> 
> 
> --
> Russell Bryant
> 
> 


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


[ovs-dev] [PATCH] tests: Skip IPv6 tests if the system does not support IPv6.

2015-07-09 Thread Ben Pfaff
This is only for the tests that actually create IPv6 sockets.  The tests
that merely use IPv6 addresses in flow entries, etc., do not depend on
kernel support.

Reported-by: 俊 赵 
Reported-at: http://openvswitch.org/pipermail/discuss/2015-July/018173.html
Signed-off-by: Ben Pfaff 
---
 AUTHORS   |  1 +
 tests/atlocal.in  |  7 +
 tests/ofproto-dpif.at | 75 +++
 tests/ovsdb-idl.at|  1 +
 tests/ovsdb-server.at |  2 ++
 5 files changed, 51 insertions(+), 35 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index 93d7dc5..e81ff17 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -377,6 +377,7 @@ chen zhang  3zhangchen9...@gmail.com
 kk yap  yap...@stanford.edu
 likunyunkunyu...@hotmail.com
 rahim entezari  rahim.entez...@gmail.com
+俊 赵zhaoju...@outlook.com
 冯全树(Crab)fqs...@126.com
 胡靖飞  hujingfei...@msn.com
 张伟 zhang...@126.com
diff --git a/tests/atlocal.in b/tests/atlocal.in
index 5b4cd05..5946a3c 100644
--- a/tests/atlocal.in
+++ b/tests/atlocal.in
@@ -97,6 +97,13 @@ FreeBSD|NetBSD)
 ;;
 esac
 
+# Check whether to run IPv6 tests.
+if perl -e 'use Socket; socket(FH, PF_INET6, SOCK_STREAM, 0) || exit 1;'; then
+HAVE_IPV6=yes
+else
+HAVE_IPV6=no
+fi
+
 # XXX: Disable Python related tests on Windows because Open vSwitch code
 # written in Python has not been ported to the Windows platform. We will
 # need to remove the next block after porting is complete.
diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
index 7f20786..cbf5737 100644
--- a/tests/ofproto-dpif.at
+++ b/tests/ofproto-dpif.at
@@ -4697,14 +4697,11 @@ AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/ 
*[[0-9]]\{1,\}$//' | sort],
 OVS_VSWITCHD_STOP
 AT_CLEANUP
 
-# CHECK_SFLOW_SAMPLING_PACKET(LOOPBACK_ADDR, ADDR_WITHOUT_BRACKETS)
+# CHECK_SFLOW_SAMPLING_PACKET(LOOPBACK_ADDR)
 #
 # Test that sFlow samples packets correctly using IPv4/IPv6 sFlow collector
-#
-# IP_VERSION_TYPE is used in AT_SETUP
 m4_define([CHECK_SFLOW_SAMPLING_PACKET],
-  [AT_SETUP([ofproto-dpif - sFlow packet sampling - $2 collector])
-  AT_XFAIL_IF([test "$IS_WIN32" = "yes"])
+  [AT_XFAIL_IF([test "$IS_WIN32" = "yes"])
   OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
 
   ON_EXIT([kill `cat test-sflow.pid`])
@@ -5021,11 +5018,16 @@ PORTNAME
portName=p2
 PORTNAME
portName=p2
-])
-  AT_CLEANUP])
+])])
 
-CHECK_SFLOW_SAMPLING_PACKET([127.0.0.1], [IPv4])
-CHECK_SFLOW_SAMPLING_PACKET([[[::1]]], [IPv6])
+AT_SETUP([ofproto-dpif - sFlow packet sampling - IPv4 collector])
+CHECK_SFLOW_SAMPLING_PACKET([127.0.0.1])
+AT_CLEANUP
+
+AT_SETUP([ofproto-dpif - sFlow packet sampling - IPv6 collector])
+AT_SKIP_IF([test $HAVE_IPV6 = no])
+CHECK_SFLOW_SAMPLING_PACKET([[[::1]]])
+AT_CLEANUP
 
 dnl Test sFlow LAG structures
 AT_SETUP([ofproto-dpif - sFlow LACP structures])
@@ -5085,18 +5087,15 @@ LACPCOUNTERS
 
 AT_CLEANUP
 
-# CHECK_NETFLOW_EXPIRATION(LOOPBACK_ADDR, IP_VERSION_TYPE)
+# CHECK_NETFLOW_EXPIRATION(LOOPBACK_ADDR)
 #
 # Test that basic NetFlow reports flow statistics correctly:
 # The initial packet of a flow are correctly accounted.
 # Later packets within a flow are correctly accounted.
 # Flow actions changing (in this case, due to MAC learning)
 # cause a record to be sent.
-#
-# IP_VERSION_TYPE is used in AT_SETUP
 m4_define([CHECK_NETFLOW_EXPIRATION],
-  [AT_SETUP([ofproto-dpif - NetFlow flow expiration - $2 collector])
-  OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
+  [OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
   ADD_OF_PORTS([br0], 1, 2)
 
   ovs-appctl time/stop
@@ -5129,22 +5128,22 @@ m4_define([CHECK_NETFLOW_EXPIRATION],
 
   combined=`grep "192.168.0.2 > 192.168.0.1, if 2 > 1, 2 pkts, 120 bytes, ICMP 
0:0" netflow.log | wc -l`
   separate=`grep "192.168.0.2 > 192.168.0.1, if 2 > 1, 1 pkts, 60 bytes, ICMP 
0:0" netflow.log | wc -l`
-  AT_CHECK([test $separate = 2 || test $combined = 1], [0])
+  AT_CHECK([test $separate = 2 || test $combined = 1], [0])])
 
-  AT_CLEANUP])
+AT_SETUP([ofproto-dpif - NetFlow flow expiration - IPv4 collector])
+CHECK_NETFLOW_EXPIRATION([127.0.0.1])
+AT_CLEANUP
 
-CHECK_NETFLOW_EXPIRATION([127.0.0.1], [IPv4])
-CHECK_NETFLOW_EXPIRATION([[[::1]]], [IPv6])
+AT_SETUP([ofproto-dpif - NetFlow flow expiration - IPv6 collector])
+AT_SKIP_IF([test $HAVE_IPV6 = no])
+CHECK_NETFLOW_EXPIRATION([[[::1]]])
+AT_CLEANUP
 
-# CHECK_NETFLOW_ACTIVE_EXPIRATION(LOOPBACK_ADDR, IP_VERSION_TYPE)
+# CHECK_NETFLOW_ACTIVE_EXPIRATION(LOOPBACK_ADDR)
 #
 # Test that basic NetFlow reports active expirations correctly.
-#
-# IP_VERSION_TYPE is used in AT_SETUP
 m4_define([CHECK_NETFLOW_ACTIVE_EXPIRATION],
-  [AT_SETUP([ofproto-dpif - NetFlow active expiration - $2 collector])
-
-  OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
+  [OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
   ADD_OF_PORTS([br0], 1, 2)
 
   ON_

[ovs-dev] [RFC PATCH 1/6] tests: Check for core files before exiting.

2015-07-09 Thread Jarno Rajahalme
I've seen core files appear and then be automatically removed as the
test case was successful.  Such success is highly doubtful, so fail
the test cases if any core files exist at the end of the test.

Signed-off-by: Jarno Rajahalme 
---
 tests/ofproto-macros.at |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tests/ofproto-macros.at b/tests/ofproto-macros.at
index 74b02b7..124e581 100644
--- a/tests/ofproto-macros.at
+++ b/tests/ofproto-macros.at
@@ -116,6 +116,9 @@ m4_define([OVS_VSWITCHD_START],
 ])
 
 m4_divert_push([PREPARE_TESTS])
+check_cores () {
+find . -name core -print
+}
 check_logs () {
 sed -n "$1
 /timeval.*Unreasonably long [[0-9]]*ms poll interval/d
@@ -138,7 +141,8 @@ m4_divert_pop([PREPARE_TESTS])
 #
 #   OVS_VSWITCHD_STOP(["/expected error/d"])
 m4_define([OVS_VSWITCHD_STOP],
-  [AT_CHECK([check_logs $1])
+  [AT_CHECK([check_cores])
+   AT_CHECK([check_logs $1])
AT_CHECK([ovs-appctl -t ovs-vswitchd exit])
AT_CHECK([ovs-appctl -t ovsdb-server exit])])
 
-- 
1.7.10.4

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


[ovs-dev] [RFC PATCH 0/6] Increase miniflow's capacity.

2015-07-09 Thread Jarno Rajahalme
Upto now struct miniflow has been limited to 63 64-bit units.  This
series increases this capacity to 128 64-bit units.  For presimed
performance reasons the new miniflow uses one 64-bit map for tunnel
metadata and another for the rest of the metadata and the fields
extracted from packet headers.

Before making miniflow more complex, this series simplifies it a bit
by always inlining the miniflow data and cleaning up the interface a
bit.

All performance testing is yet to be done.  I would be thankful if
someone verifies the performance impact on the DPDK datapath, if any.

Jarno Rajahalme (6):
  tests: Check for core files before exiting.
  meta-flow: Add a missing break statement.
  lib: Always inline miniflows.
  match: Single malloc minimatch.
  flow: Eliminate miniflow_clone() and minimask_clone().
  flow: Split miniflow's map.

 lib/classifier-private.h |  122 
 lib/classifier.c |  149 --
 lib/dpif-netdev.c|  103 +-
 lib/flow.c   |  482 ++
 lib/flow.h   |  252 +---
 lib/match.c  |   39 ++--
 lib/match.h  |   12 +-
 lib/meta-flow.c  |2 +-
 lib/tnl-ports.c  |4 +-
 ofproto/ofproto.c|   10 +-
 tests/ofproto-macros.at  |6 +-
 tests/test-classifier.c  |  130 +++--
 12 files changed, 716 insertions(+), 595 deletions(-)

-- 
1.7.10.4

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


[ovs-dev] [RFC PATCH 6/6] flow: Split miniflow's map.

2015-07-09 Thread Jarno Rajahalme
Use two maps in miniflow to allow for expansion of struct flow past
512 bytes.  We now have one map for tunnel related fields, and another
for the rest of the packet metadata and actual packet header fields.
This split has the benefit that for non-tunneled packets the overhead
should be minimal.

Some miniflow utilities now exist in two variants, new ones operating
over all the data, and the old ones operating only on a single 64-bit
map at a time.  The old ones require doubling of code but should
execute faster, so those are used in the datapath and classifier's
lookup path.

Signed-off-by: Jarno Rajahalme 
---
 lib/classifier-private.h |  108 -
 lib/classifier.c |   72 +++
 lib/dpif-netdev.c|   73 +++-
 lib/flow.c   |  298 --
 lib/flow.h   |  174 ++-
 lib/match.c  |4 +-
 6 files changed, 475 insertions(+), 254 deletions(-)

diff --git a/lib/classifier-private.h b/lib/classifier-private.h
index 8096a36..435acc9 100644
--- a/lib/classifier-private.h
+++ b/lib/classifier-private.h
@@ -226,23 +226,47 @@ struct trie_node {
  * These are only used by the classifier, so place them here to allow
  * for better optimization. */
 
-static inline uint64_t
+/* TODO: Ensure that 'start' and 'end' are compile-time constants. */
+static inline unsigned int /* offset */
 miniflow_get_map_in_range(const struct miniflow *miniflow,
-  uint8_t start, uint8_t end, unsigned int *offset)
+  uint8_t start, uint8_t end, struct miniflow *map)
 {
-uint64_t map = miniflow->map;
-*offset = 0;
+unsigned int offset = 0;
 
-if (start > 0) {
-uint64_t msk = (UINT64_C(1) << start) - 1; /* 'start' LSBs set */
-*offset = count_1bits(map & msk);
-map &= ~msk;
+map->tnl_map = miniflow->tnl_map;
+map->pkt_map = miniflow->pkt_map;
+
+if (start >= FLOW_TNL_U64S) {
+offset += count_1bits(map->tnl_map);
+map->tnl_map = 0;
+if (start > FLOW_TNL_U64S) {
+/* Clear 'start - FLOW_TNL_U64S' LSBs from pkt_map. */
+uint64_t msk = (UINT64_C(1) << (start - FLOW_TNL_U64S)) - 1;
+
+offset += count_1bits(map->pkt_map & msk);
+map->pkt_map &= ~msk;
+}
+} else if (start > 0) {
+/* Clear 'start' LSBs from tnl_map. */
+uint64_t msk = (UINT64_C(1) << start) - 1;
+
+offset += count_1bits(map->tnl_map & msk);
+map->tnl_map &= ~msk;
 }
-if (end < FLOW_U64S) {
-uint64_t msk = (UINT64_C(1) << end) - 1; /* 'end' LSBs set */
-map &= msk;
+
+if (end <= FLOW_TNL_U64S) {
+map->pkt_map = 0;
+if (end < FLOW_TNL_U64S) {
+/* Keep 'end' LSBs in tnl_map. */
+map->tnl_map &= (UINT64_C(1) << end) - 1;
+}
+} else {
+if (end < FLOW_U64S) {
+/* Keep 'end - FLOW_TNL_U64S' LSBs in pkt_map. */
+map->pkt_map &= (UINT64_C(1) << (end - FLOW_TNL_U64S)) - 1;
+}
 }
-return map;
+return offset;
 }
 
 /* Returns a hash value for the bits of 'flow' where there are 1-bits in
@@ -258,10 +282,14 @@ flow_hash_in_minimask(const struct flow *flow, const 
struct minimask *mask,
 const uint64_t *flow_u64 = (const uint64_t *)flow;
 const uint64_t *p = mask_values;
 uint32_t hash;
-int idx;
+size_t idx;
 
 hash = basis;
-MAP_FOR_EACH_INDEX(idx, mask->masks.map) {
+MAP_FOR_EACH_INDEX(idx, mask->masks.tnl_map) {
+hash = hash_add64(hash, flow_u64[idx] & *p++);
+}
+flow_u64 += FLOW_TNL_U64S;
+MAP_FOR_EACH_INDEX(idx, mask->masks.pkt_map) {
 hash = hash_add64(hash, flow_u64[idx] & *p++);
 }
 
@@ -277,16 +305,15 @@ static inline uint32_t
 miniflow_hash_in_minimask(const struct miniflow *flow,
   const struct minimask *mask, uint32_t basis)
 {
-const uint64_t *mask_values = mask->masks.values;
-const uint64_t *p = mask_values;
+const uint64_t *p = mask->masks.values;
 uint32_t hash = basis;
 uint64_t flow_u64;
 
-MINIFLOW_FOR_EACH_IN_MAP(flow_u64, flow, mask->masks.map) {
+MINIFLOW_FOR_EACH_IN_MAPS(flow_u64, flow, mask->masks) {
 hash = hash_add64(hash, flow_u64 & *p++);
 }
 
-return hash_finish(hash, (p - mask_values) * 8);
+return hash_finish(hash, (p - mask->masks.values) * 8);
 }
 
 /* Returns a hash value for the bits of range [start, end) in 'flow',
@@ -302,14 +329,18 @@ flow_hash_in_minimask_range(const struct flow *flow,
 const uint64_t *mask_values = mask->masks.values;
 const uint64_t *flow_u64 = (const uint64_t *)flow;
 unsigned int offset;
-uint64_t map;
+struct miniflow map;
 const uint64_t *p;
 uint32_t hash = *basis;
-int idx;
+size_t idx;
 
-map = miniflow_get_map_in_range(&mask->masks, start, end, &offset);
+offset = miniflow_

[ovs-dev] [RFC PATCH 2/6] meta-flow: Add a missing break statement.

2015-07-09 Thread Jarno Rajahalme
Signed-off-by: Jarno Rajahalme 
---
 lib/meta-flow.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/meta-flow.c b/lib/meta-flow.c
index 21a13b4..541143c 100644
--- a/lib/meta-flow.c
+++ b/lib/meta-flow.c
@@ -1114,7 +1114,7 @@ mf_set_flow_value(const struct mf_field *mf,
 break;
 CASE_MFF_TUN_METADATA:
 tun_metadata_write(&flow->tunnel.metadata, mf, value);
-
+break;
 case MFF_METADATA:
 flow->metadata = value->be64;
 break;
-- 
1.7.10.4

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


[ovs-dev] [RFC PATCH 5/6] flow: Eliminate miniflow_clone() and minimask_clone().

2015-07-09 Thread Jarno Rajahalme
miniflow_clone() and minimask_clone() are no longer used, remove them
from the API.

Now that miniflow data is always inlined, it makes sense to rename
miniflow_clone_inline() miniflow_clone().

Signed-off-by: Jarno Rajahalme 
---
 lib/classifier.c|8 
 lib/flow.c  |   25 ++---
 lib/flow.h  |8 ++--
 tests/test-classifier.c |   15 ++-
 4 files changed, 22 insertions(+), 34 deletions(-)

diff --git a/lib/classifier.c b/lib/classifier.c
index 5673312..2ed8697 100644
--- a/lib/classifier.c
+++ b/lib/classifier.c
@@ -101,8 +101,8 @@ cls_match_alloc(const struct cls_rule *rule, cls_version_t 
version,
 *CONST_CAST(cls_version_t *, &cls_match->add_version) = version;
 atomic_init(&cls_match->remove_version, version);   /* Initially
  * invisible. */
-miniflow_clone_inline(CONST_CAST(struct miniflow *, &cls_match->flow),
-  rule->match.flow, count);
+miniflow_clone(CONST_CAST(struct miniflow *, &cls_match->flow),
+   rule->match.flow, count);
 ovsrcu_set_hidden(&cls_match->conj_set,
   cls_conjunction_set_alloc(cls_match, conj, n));
 
@@ -1541,8 +1541,8 @@ insert_subtable(struct classifier *cls, const struct 
minimask *mask)
 
 subtable = xzalloc(sizeof *subtable + MINIFLOW_VALUES_SIZE(count));
 cmap_init(&subtable->rules);
-miniflow_clone_inline(CONST_CAST(struct miniflow *, &subtable->mask.masks),
-  &mask->masks, count);
+miniflow_clone(CONST_CAST(struct miniflow *, &subtable->mask.masks),
+   &mask->masks, count);
 
 /* Init indices for segmented lookup, if any. */
 flow_wildcards_init_catchall(&new);
diff --git a/lib/flow.c b/lib/flow.c
index b3bfca9..0faac4f 100644
--- a/lib/flow.c
+++ b/lib/flow.c
@@ -2076,24 +2076,11 @@ miniflow_create(const struct flow *src)
 return dst;
 }
 
-/* Returns a copy of 'src'.  The caller must eventually free the returned
- * miniflow with free(). */
-struct miniflow *
-miniflow_clone(const struct miniflow *src)
-{
-struct miniflow *dst;
-size_t data_size;
-
-data_size = miniflow_alloc(&dst, 1, src);
-memcpy(dst->values, src->values, data_size);
-return dst;
-}
-
 /* Initializes 'dst' as a copy of 'src'.  The caller must have allocated
  * 'dst' to have inline space for 'n_values' data in 'src'. */
 void
-miniflow_clone_inline(struct miniflow *dst, const struct miniflow *src,
-  size_t n_values)
+miniflow_clone(struct miniflow *dst, const struct miniflow *src,
+   size_t n_values)
 {
 dst->map = src->map;
 memcpy(dst->values, src->values, MINIFLOW_VALUES_SIZE(n_values));
@@ -2185,14 +2172,6 @@ minimask_create(const struct flow_wildcards *wc)
 return (struct minimask *)miniflow_create(&wc->masks);
 }
 
-/* Returns a copy of 'src'.  The caller must eventually free the returned
- * minimask with free(). */
-struct minimask *
-minimask_clone(const struct minimask *src)
-{
-return (struct minimask *)miniflow_clone(&src->masks);
-}
-
 /* Initializes 'dst_' as the bit-wise "and" of 'a_' and 'b_'.
  *
  * The caller must provide room for FLOW_U64S "uint64_t"s in 'storage', which
diff --git a/lib/flow.h b/lib/flow.h
index d242588..1f4f9c4 100644
--- a/lib/flow.h
+++ b/lib/flow.h
@@ -402,12 +402,9 @@ void miniflow_map_init(struct miniflow *, const struct 
flow *);
 size_t miniflow_alloc(struct miniflow *dsts[], size_t n,
   const struct miniflow *src);
 void miniflow_init(struct miniflow *, const struct flow *);
-
+void miniflow_clone(struct miniflow *, const struct miniflow *,
+size_t n_values);
 struct miniflow * miniflow_create(const struct flow *);
-struct miniflow * miniflow_clone(const struct miniflow *);
-
-void miniflow_clone_inline(struct miniflow *, const struct miniflow *,
-   size_t n_values);
 
 void miniflow_expand(const struct miniflow *, struct flow *);
 
@@ -565,7 +562,6 @@ struct minimask {
 
 void minimask_init(struct minimask *, const struct flow_wildcards *);
 struct minimask * minimask_create(const struct flow_wildcards *);
-struct minimask * minimask_clone(const struct minimask *);
 void minimask_combine(struct minimask *dst,
   const struct minimask *a, const struct minimask *b,
   uint64_t storage[FLOW_U64S]);
diff --git a/tests/test-classifier.c b/tests/test-classifier.c
index 388b36d..6e5b36b 100644
--- a/tests/test-classifier.c
+++ b/tests/test-classifier.c
@@ -1423,6 +1423,19 @@ wildcard_extra_bits(struct flow_wildcards *mask)
 }
 }
 
+/* Returns a copy of 'src'.  The caller must eventually free the returned
+ * miniflow with free(). */
+static struct miniflow *
+miniflow_clone__(const struct miniflow *src)
+{
+struct miniflow *dst;
+size_t data_size;
+
+data_size = miniflow_alloc(&dst, 1, src

[ovs-dev] [RFC PATCH 4/6] match: Single malloc minimatch.

2015-07-09 Thread Jarno Rajahalme
Allocate the miniflow and minimask in struct minimatch at once, so
that they are consecutive in memory.  This halves the number of
allocations, and allows smaller minimatches to share the same cache
line.

After this a minimatch has one heap allocation for all it's data.
Previously it had either none (when data was small enough to fit in
struct miniflow's inline buffer), or two (when the inline buffer was
insufficient).  Hopefully always having one performs almost the same
as none or two, in average.

Signed-off-by: Jarno Rajahalme 
---
 lib/flow.c  |   87 +++
 lib/flow.h  |9 +--
 lib/match.c |   17 
 lib/match.h |   12 +++--
 4 files changed, 81 insertions(+), 44 deletions(-)

diff --git a/lib/flow.c b/lib/flow.c
index ca8163e..b3bfca9 100644
--- a/lib/flow.c
+++ b/lib/flow.c
@@ -2006,62 +2006,74 @@ miniflow_n_values(const struct miniflow *flow)
 }
 
 /* Completes an initialization of 'dst' as a miniflow copy of 'src' begun by
- * the caller.  The caller must have already computed 'map' properly
+ * the caller.  The caller must have already computed 'dst->map' properly
  * to indicate the significant uint64_t elements of 'src'.
  *
  * Normally the significant elements are the ones that are non-zero.  However,
  * when a miniflow is initialized from a (mini)mask, the values can be zeroes,
- * so that the flow and mask always have the same maps.
- *
- * This function always dynamically allocates a miniflow with the correct
- * amount of inline storage and copies the uint64_t elements of 'src' indicated
- * by 'map' into it. */
-static struct miniflow *
-miniflow_init__(const struct flow *src, uint64_t map)
+ * so that the flow and mask always have the same maps. */
+void
+miniflow_init(struct miniflow *dst, const struct flow *src)
 {
 const uint64_t *src_u64 = (const uint64_t *) src;
-struct miniflow *dst = xmalloc(sizeof *dst
-   + MINIFLOW_VALUES_SIZE(count_1bits(map)));
 uint64_t *dst_u64 = dst->values;
 int idx;
 
-COVERAGE_INC(miniflow_malloc);
-
-dst->map = map;
-MAP_FOR_EACH_INDEX(idx, map) {
+MAP_FOR_EACH_INDEX(idx, dst->map) {
 *dst_u64++ = src_u64[idx];
 }
-return dst;
 }
 
-/* Returns a miniflow copy of 'src'.  The caller must eventually free the
- * returned miniflow with free(). */
-struct miniflow *
-miniflow_create(const struct flow *src)
+/* Initialize the map of 'flow' from 'src'. */
+void
+miniflow_map_init(struct miniflow *flow, const struct flow *src)
 {
 const uint64_t *src_u64 = (const uint64_t *) src;
-uint64_t map;
-unsigned int i;
-
-/* Initialize dst->map, counting the number of nonzero elements. */
-map = 0;
+int i;
 
+/* Initialize map, counting the number of nonzero elements. */
+flow->map = 0;
 for (i = 0; i < FLOW_U64S; i++) {
 if (src_u64[i]) {
-map |= UINT64_C(1) << i;
+flow->map |= UINT64_C(1) << i;
 }
 }
+}
 
-return miniflow_init__(src, map);
+/* Allocates 'n' count of miniflows, consecutive in memory, initializing the
+ * map of each from 'src'.
+ * Returns the size of the miniflow data. */
+size_t
+miniflow_alloc(struct miniflow *dsts[], size_t n, const struct miniflow *src)
+{
+size_t data_size = MINIFLOW_VALUES_SIZE(count_1bits(src->map));
+size_t size = sizeof *src + data_size;
+struct miniflow *dst = xmalloc(n * size);
+unsigned int i;
+
+COVERAGE_INC(miniflow_malloc);
+
+for (i = 0; i < n; i++) {
+dst->map = src->map;
+dsts[i] = dst;
+dst += size / sizeof *dst;
+}
+return data_size;
 }
 
-/* Returns a copy of 'src', using 'mask->map'.  The caller must eventually free
- * the returned miniflow with free(). */
+/* Returns a miniflow copy of 'src'.  The caller must eventually free() the
+ * returned miniflow. */
 struct miniflow *
-miniflow_create_with_minimask(const struct flow *src,
-  const struct minimask *mask)
+miniflow_create(const struct flow *src)
 {
-return miniflow_init__(src, mask->masks.map);
+struct miniflow tmp;
+struct miniflow *dst;
+
+miniflow_map_init(&tmp, src);
+
+miniflow_alloc(&dst, 1, &tmp);
+miniflow_init(dst, src);
+return dst;
 }
 
 /* Returns a copy of 'src'.  The caller must eventually free the returned
@@ -2070,11 +2082,10 @@ struct miniflow *
 miniflow_clone(const struct miniflow *src)
 {
 struct miniflow *dst;
-int n = miniflow_n_values(src);
+size_t data_size;
 
-COVERAGE_INC(miniflow_malloc);
-dst = xmalloc(sizeof *dst + MINIFLOW_VALUES_SIZE(n));
-miniflow_clone_inline(dst, src, n);
+data_size = miniflow_alloc(&dst, 1, src);
+memcpy(dst->values, src->values, data_size);
 return dst;
 }
 
@@ -2160,6 +2171,12 @@ miniflow_equal_flow_in_minimask(const struct miniflow 
*a, const struct flow *b,
 }
 
 
+void
+minimask_init(struct minimask *mask, const st

[ovs-dev] [RFC PATCH 3/6] flow: Always inline miniflows.

2015-07-09 Thread Jarno Rajahalme
Now that performance critical code already inlines miniflows and
minimasks, we can simplify struct miniflow by always dynamically
allocating miniflows and minimasks to the correct size.  This changes
the struct minimatch to always contain pointers to its miniflow and
minimask.

Signed-off-by: Jarno Rajahalme 
---
 lib/classifier-private.h |   18 ++--
 lib/classifier.c |   77 -
 lib/dpif-netdev.c|   46 +-
 lib/flow.c   |  210 ++
 lib/flow.h   |   97 ++---
 lib/match.c  |   30 +++
 lib/match.h  |4 +-
 lib/tnl-ports.c  |4 +-
 ofproto/ofproto.c|   10 +--
 tests/test-classifier.c  |  117 +-
 10 files changed, 242 insertions(+), 371 deletions(-)

diff --git a/lib/classifier-private.h b/lib/classifier-private.h
index 7774502..8096a36 100644
--- a/lib/classifier-private.h
+++ b/lib/classifier-private.h
@@ -254,7 +254,7 @@ static inline uint32_t
 flow_hash_in_minimask(const struct flow *flow, const struct minimask *mask,
   uint32_t basis)
 {
-const uint64_t *mask_values = miniflow_get_values(&mask->masks);
+const uint64_t *mask_values = mask->masks.values;
 const uint64_t *flow_u64 = (const uint64_t *)flow;
 const uint64_t *p = mask_values;
 uint32_t hash;
@@ -277,7 +277,7 @@ static inline uint32_t
 miniflow_hash_in_minimask(const struct miniflow *flow,
   const struct minimask *mask, uint32_t basis)
 {
-const uint64_t *mask_values = miniflow_get_values(&mask->masks);
+const uint64_t *mask_values = mask->masks.values;
 const uint64_t *p = mask_values;
 uint32_t hash = basis;
 uint64_t flow_u64;
@@ -299,7 +299,7 @@ flow_hash_in_minimask_range(const struct flow *flow,
 const struct minimask *mask,
 uint8_t start, uint8_t end, uint32_t *basis)
 {
-const uint64_t *mask_values = miniflow_get_values(&mask->masks);
+const uint64_t *mask_values = mask->masks.values;
 const uint64_t *flow_u64 = (const uint64_t *)flow;
 unsigned int offset;
 uint64_t map;
@@ -339,7 +339,7 @@ flow_wildcards_fold_minimask_range(struct flow_wildcards 
*wc,
 int idx;
 
 map = miniflow_get_map_in_range(&mask->masks, start, end, &offset);
-p = miniflow_get_values(&mask->masks) + offset;
+p = mask->masks.values + offset;
 MAP_FOR_EACH_INDEX(idx, map) {
 dst_u64[idx] |= *p++;
 }
@@ -349,7 +349,7 @@ flow_wildcards_fold_minimask_range(struct flow_wildcards 
*wc,
 static inline uint32_t
 miniflow_hash(const struct miniflow *flow, uint32_t basis)
 {
-const uint64_t *values = miniflow_get_values(flow);
+const uint64_t *values = flow->values;
 const uint64_t *p = values;
 uint32_t hash = basis;
 uint64_t hash_map = 0;
@@ -378,7 +378,7 @@ minimask_hash(const struct minimask *mask, uint32_t basis)
 static inline uint32_t
 minimatch_hash(const struct minimatch *match, uint32_t basis)
 {
-return miniflow_hash(&match->flow, minimask_hash(&match->mask, basis));
+return miniflow_hash(match->flow, minimask_hash(match->mask, basis));
 }
 
 /* Returns a hash value for the bits of range [start, end) in 'minimatch',
@@ -395,10 +395,10 @@ minimatch_hash_range(const struct minimatch *match, 
uint8_t start, uint8_t end,
 uint32_t hash = *basis;
 int n, i;
 
-n = count_1bits(miniflow_get_map_in_range(&match->mask.masks, start, end,
+n = count_1bits(miniflow_get_map_in_range(&match->mask->masks, start, end,
   &offset));
-q = miniflow_get_values(&match->mask.masks) + offset;
-p = miniflow_get_values(&match->flow) + offset;
+q = match->mask->masks.values + offset;
+p = match->flow->values + offset;
 
 for (i = 0; i < n; i++) {
 hash = hash_add64(hash, p[i] & q[i]);
diff --git a/lib/classifier.c b/lib/classifier.c
index a8a4780..5673312 100644
--- a/lib/classifier.c
+++ b/lib/classifier.c
@@ -90,11 +90,10 @@ static struct cls_match *
 cls_match_alloc(const struct cls_rule *rule, cls_version_t version,
 const struct cls_conjunction conj[], size_t n)
 {
-int count = count_1bits(rule->match.flow.map);
+int count = count_1bits(rule->match.flow->map);
 
 struct cls_match *cls_match
-= xmalloc(sizeof *cls_match - sizeof cls_match->flow.inline_values
-  + MINIFLOW_VALUES_SIZE(count));
+= xmalloc(sizeof *cls_match + MINIFLOW_VALUES_SIZE(count));
 
 ovsrcu_init(&cls_match->next, NULL);
 *CONST_CAST(const struct cls_rule **, &cls_match->cls_rule) = rule;
@@ -103,7 +102,7 @@ cls_match_alloc(const struct cls_rule *rule, cls_version_t 
version,
 atomic_init(&cls_match->remove_version, version);   /* Initially
  * invisible. */
 miniflow_clone_inline(CONST_CA

Re: [ovs-dev] [PATCH] Fix detection of vhost_cuse in dpdk rte_config.h

2015-07-09 Thread Daniele Di Proietto
The patch makes sense for branch-2.4 and master. Thanks!

Acked-by: Daniele Di Proietto 

On 06/07/2015 22:41, "Mussar, Gary"  wrote:

>Fix detection of vhost_cuse in dpdk rte_config.h
>
>Dpdk allows users to create a config that includes other config files and
>then override values.
>
>Eg.
>defconfig_x86_64-native_vhost_cuse-linuxapp-gcc:
>
>CONFIG_RTE_BUILD_COMBINE_LIBS=y
>CONFIG_RTE_BUILD_SHARED_LIB=n
>CONFIG_RTE_LIBRTE_VHOST=y
>CONFIG_RTE_LIBRTE_VHOST_USER=n
>
>This allows you to have both a vhostuser and vhostcuse config in the same
>source tree without the need to replicate everything in those config files
>just to change a couple of settings. The resultant .config file has all of
>the settings from the included files with the updated settings at the end.
>The resultant rte_config.h contains multiple undefs and defines for the
>overridden settings.
>
>Eg.
>> grep RTE_LIBRTE_VHOST_USER
>>x86_64-native_vhost_cuse-linuxapp-gcc/include/rte_config.h
>
>The current mechanism to detect the RTE_LIBRTE_VHOST_USER setting merely
>greps the rte_config.h file for the string "define RTE_LIBRTE_VHOST_USER
>1"
>rather than the final setting of RTE_LIBRTE_VHOST_USER. The following
>patch
>changes this test to detect the final setting of RTE_LIBRTE_VHOST_USER.
>
>Signed-off-by: Gary Mussar 
>---
> acinclude.m4 | 7 ++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
>diff --git a/acinclude.m4 b/acinclude.m4
>index 20391ec..ef6523a 100644
>--- a/acinclude.m4
>+++ b/acinclude.m4
>@@ -221,8 +221,13 @@ AC_DEFUN([OVS_CHECK_DPDK], [
> AC_SUBST([DPDK_vswitchd_LDFLAGS])
> AC_DEFINE([DPDK_NETDEV], [1], [System uses the DPDK module.])
>
>-OVS_GREP_IFELSE([$RTE_SDK/include/rte_config.h], [define
>RTE_LIBRTE_VHOST_USER 1],
>+AC_LANG_PUSH(C)
>+AC_EGREP_CPP([int vhost = 1;], [
>+#include <$RTE_SDK/include/rte_config.h>
>+int vhost = RTE_LIBRTE_VHOST_USER;
>+],
> [], [AC_DEFINE([VHOST_CUSE], [1], [DPDK vhost-cuse
>support enabled, vhost-user disabled.])])
>+AC_LANG_POP()
>   else
> RTE_SDK=
>   fi
>--
>1.9.1
>___
>dev mailing list
>dev@openvswitch.org
>https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailma
>n_listinfo_dev&d=BQIGaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=Sm
>B5nZacmXNq0gKCC1s_Cw5yUNjxgD4v5kJqZ2uWLlE&m=sQCuPKlyVW4ybSgERn0uwJvifgVJwH
>cwvkQoaJoJ5Pw&s=PnU6MnfB9vIg-7Sq71VGeuUaxwYNKD6fR2CZZTX6FFY&e= 

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


Re: [ovs-dev] [PATCH 1/3] db-ctl-base: fix a few typos

2015-07-09 Thread Andy Zhou
On Wed, Jul 8, 2015 at 11:37 PM, Alex Wang  wrote:
> Acked-by: Alex Wang 
Thanks. pushed to master.
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH 2/3] db-ctl-base: Do not expose get_table() API

2015-07-09 Thread Andy Zhou
On Wed, Jul 8, 2015 at 11:44 PM, Alex Wang  wrote:
>
>
> On Tue, Jul 7, 2015 at 8:08 PM, Andy Zhou  wrote:
>>
>> Both get_table() and set_cloum() APIs are mostly used within db-ctl-base
>> library. This patch makes both private to the library.
>>
>> Add a new ctl_set_colum() API for library client.
>>
>> The changes are cleanups. No functional changes.
>>
>> Signed-off-by: Andy Zhou 
>> ---
>>  lib/db-ctl-base.c | 20 ++--
>>  lib/db-ctl-base.h | 12 +++-
>>  utilities/ovs-vsctl.c |  4 ++--
>>  3 files changed, 23 insertions(+), 13 deletions(-)
>>
>> diff --git a/lib/db-ctl-base.c b/lib/db-ctl-base.c
>> index 10884b4..4092f2b 100644
>> --- a/lib/db-ctl-base.c
>> +++ b/lib/db-ctl-base.c
>> @@ -46,7 +46,16 @@ VLOG_DEFINE_THIS_MODULE(db_ctl_base);
>>  struct ovsdb_idl *the_idl;
>>  struct ovsdb_idl_txn *the_idl_txn;
>>
>> +/* Represents all tables in the schema.  User must define 'tables'
>> + * in implementation and supply via clt_init().  The definition must end
>> + * with an all-NULL entry. */
>> +const struct ctl_table_class *tables;
>> +
>>  static struct shash all_commands = SHASH_INITIALIZER(&all_commands);
>> +static const struct ctl_table_class *get_table(const char *table_name);
>> +static void set_column(const struct ctl_table_class *,
>> +   const struct ovsdb_idl_row *, const char *,
>> +   struct ovsdb_symbol_table *);
>>
>>
>>  static struct option *
>> @@ -1990,7 +1999,7 @@ ctl_context_done(struct ctl_context *ctx,
>>
>>  /* Finds and returns the "struct ctl_table_class *" with 'table_name' by
>>   * searching the 'tables'. */
>> -const struct ctl_table_class *
>> +static const struct ctl_table_class *
>>  get_table(const char *table_name)
>>  {
>>  const struct ctl_table_class *table;
>> @@ -2018,7 +2027,7 @@ get_table(const char *table_name)
>>  }
>>
>>  /* Sets the column of 'row' in 'table'. */
>> -void
>> +static void
>>  set_column(const struct ctl_table_class *table,
>> const struct ovsdb_idl_row *row, const char *arg,
>> struct ovsdb_symbol_table *symtab)
>> @@ -2070,3 +2079,10 @@ set_column(const struct ctl_table_class *table,
>>  free(key_string);
>>  free(value_string);
>>  }
>
>
>
> I tried to separate private, public functions.  Do you also think it makes
> sense to move
> static function up to one of the private functions sections?
Yes. Will do.

Moving code around tends show a much bigger change set, and obscure
what is actually changed. I will
add a patch that just contain the function move.
>
>
>>
>> +
>> +void ctl_set_column(const char *table_name,
>> +const struct ovsdb_idl_row *row, const char *arg,
>> +struct ovsdb_symbol_table *symtab)
>> +{
>> +set_column(get_table(table_name), row, arg, symtab);
>> +}
>> diff --git a/lib/db-ctl-base.h b/lib/db-ctl-base.h
>> index f14d27f..42b2e4a 100644
>> --- a/lib/db-ctl-base.h
>> +++ b/lib/db-ctl-base.h
>> @@ -245,14 +245,8 @@ struct ctl_table_class {
>>  struct ctl_row_id row_ids[2];
>>  };
>>
>> -/* Represents all tables in the schema.  User must define 'tables'
>> - * in implementation.  And the definition must end with an all-NULL
>> - * entry. */
>> -extern const struct ctl_table_class tables[];
>> -
>
>
>
> We should also delete this:
Good catch. Will do.
>
> diff --git a/lib/db-ctl-base.h b/lib/db-ctl-base.h
> index f14d27f..6089180 100644
> --- a/lib/db-ctl-base.h
> +++ b/lib/db-ctl-base.h
> @@ -44,7 +44,6 @@ struct table;
>   *   additional commands implemented by user.  (See 'struct ctl_context'
> for
>   *   more info)
>   *
> - * - the 'tables[]' for each table in the schema.
>   *
>  */
>
>
>
>>
>> -const struct ctl_table_class *get_table(const char *table_name);
>> -void set_column(const struct ctl_table_class *,
>> -const struct ovsdb_idl_row *, const char *arg,
>> -struct ovsdb_symbol_table *);
>> +void ctl_set_column(const char *table_name,
>> +const struct ovsdb_idl_row *, const char *arg,
>> +struct ovsdb_symbol_table *);
>>
>>  #endif /* db-ctl-base.h */
>> diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c
>> index c9af355..863bc73 100644
>> --- a/utilities/ovs-vsctl.c
>> +++ b/utilities/ovs-vsctl.c
>> @@ -1556,8 +1556,8 @@ add_port(struct ctl_context *ctx,
>>  }
>>
>>  for (i = 0; i < n_settings; i++) {
>> -set_column(get_table("Port"), &port->header_, settings[i],
>> -   ctx->symtab);
>> +ctl_set_column("Port", &port->header_, settings[i],
>> +   ctx->symtab);
>>  }
>>
>>  bridge_insert_port((bridge->parent ? bridge->parent->br_cfg
>> --
>> 1.9.1
>>
>
> Also, I think we should combine patch 2 and 3 since this patch will break
> the unittests.
>
They are separate changes. I will fix the unit tests.
>
> Thanks,
> Alex Wang,
>
>
>
>>
>> ___
>> dev mailing list
>> dev@openvs

[ovs-dev] [db-ctl-base v2 1/3] db-ctl-base: do not expose get_table() API

2015-07-09 Thread Andy Zhou
Both get_table() and set_cloum() APIs are mostly used within db-ctl-base
library. This patch makes both private to the library.

Add a new ctl_set_colum() API for library client.

The changes are cleanups. No functional changes.

Signed-off-by: Andy Zhou 
---
 lib/db-ctl-base.c | 15 +--
 lib/db-ctl-base.h | 10 +++---
 utilities/ovs-vsctl.c |  4 ++--
 3 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/lib/db-ctl-base.c b/lib/db-ctl-base.c
index 10884b4..64c01e6 100644
--- a/lib/db-ctl-base.c
+++ b/lib/db-ctl-base.c
@@ -47,6 +47,10 @@ struct ovsdb_idl *the_idl;
 struct ovsdb_idl_txn *the_idl_txn;
 
 static struct shash all_commands = SHASH_INITIALIZER(&all_commands);
+static const struct ctl_table_class *get_table(const char *table_name);
+static void set_column(const struct ctl_table_class *,
+   const struct ovsdb_idl_row *, const char *,
+   struct ovsdb_symbol_table *);
 
 
 static struct option *
@@ -1990,7 +1994,7 @@ ctl_context_done(struct ctl_context *ctx,
 
 /* Finds and returns the "struct ctl_table_class *" with 'table_name' by
  * searching the 'tables'. */
-const struct ctl_table_class *
+static const struct ctl_table_class *
 get_table(const char *table_name)
 {
 const struct ctl_table_class *table;
@@ -2018,7 +2022,7 @@ get_table(const char *table_name)
 }
 
 /* Sets the column of 'row' in 'table'. */
-void
+static void
 set_column(const struct ctl_table_class *table,
const struct ovsdb_idl_row *row, const char *arg,
struct ovsdb_symbol_table *symtab)
@@ -2070,3 +2074,10 @@ set_column(const struct ctl_table_class *table,
 free(key_string);
 free(value_string);
 }
+
+void ctl_set_column(const char *table_name,
+const struct ovsdb_idl_row *row, const char *arg,
+struct ovsdb_symbol_table *symtab)
+{
+set_column(get_table(table_name), row, arg, symtab);
+}
diff --git a/lib/db-ctl-base.h b/lib/db-ctl-base.h
index f14d27f..8d25fbe 100644
--- a/lib/db-ctl-base.h
+++ b/lib/db-ctl-base.h
@@ -43,9 +43,6 @@ struct table;
  * - the *ctl command context by inheriting the 'struct ctl_context' for
  *   additional commands implemented by user.  (See 'struct ctl_context' for
  *   more info)
- *
- * - the 'tables[]' for each table in the schema.
- *
 */
 
 /* ctl_fatal() also logs the error, so it is preferred in this file. */
@@ -250,9 +247,8 @@ struct ctl_table_class {
  * entry. */
 extern const struct ctl_table_class tables[];
 
-const struct ctl_table_class *get_table(const char *table_name);
-void set_column(const struct ctl_table_class *,
-const struct ovsdb_idl_row *, const char *arg,
-struct ovsdb_symbol_table *);
+void ctl_set_column(const char *table_name,
+const struct ovsdb_idl_row *, const char *arg,
+struct ovsdb_symbol_table *);
 
 #endif /* db-ctl-base.h */
diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c
index c9af355..863bc73 100644
--- a/utilities/ovs-vsctl.c
+++ b/utilities/ovs-vsctl.c
@@ -1556,8 +1556,8 @@ add_port(struct ctl_context *ctx,
 }
 
 for (i = 0; i < n_settings; i++) {
-set_column(get_table("Port"), &port->header_, settings[i],
-   ctx->symtab);
+ctl_set_column("Port", &port->header_, settings[i],
+   ctx->symtab);
 }
 
 bridge_insert_port((bridge->parent ? bridge->parent->br_cfg
-- 
1.9.1

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


[ovs-dev] [db-ctl-base v2 0/3] db-ctl-base cleanup

2015-07-09 Thread Andy Zhou
Minor cleanups in db-ctl-base library, and in prepare for ovsdb join related
changes in the library.

v1->v2:
Drop the first patch that has been committed.
group static functions together
Fix comments



Andy Zhou (3):
  db-ctl-base: do not expose get_table() API
  db-ctl-base: do not require client to expose the "tables" variable
  db-ctl-base: group static functions together

 lib/db-ctl-base.c | 179 +++---
 lib/db-ctl-base.h |  18 ++---
 utilities/ovs-vsctl.c |   8 +--
 vtep/vtep-ctl.c   |   4 +-
 4 files changed, 109 insertions(+), 100 deletions(-)

-- 
1.9.1

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


[ovs-dev] [db-ctl-base v2 3/3] db-ctl-base: group static functions together

2015-07-09 Thread Andy Zhou
This file follows a convention that all static functions are grouped
towards the beginning, ahead of public functions. Re-arrange the code
to confirm to this convention.  No functional changes.

Signed-off-by: Andy Zhou 
---
 lib/db-ctl-base.c | 166 +++---
 1 file changed, 83 insertions(+), 83 deletions(-)

diff --git a/lib/db-ctl-base.c b/lib/db-ctl-base.c
index 659820b..86a87d0 100644
--- a/lib/db-ctl-base.c
+++ b/lib/db-ctl-base.c
@@ -988,6 +988,35 @@ cmd_list(struct ctl_context *ctx)
 free(columns);
 }
 
+/* Finds and returns the "struct ctl_table_class *" with 'table_name' by
+ * searching the 'tables'. */
+static const struct ctl_table_class *
+get_table(const char *table_name)
+{
+const struct ctl_table_class *table;
+const struct ctl_table_class *best_match = NULL;
+unsigned int best_score = 0;
+
+for (table = tables; table->class; table++) {
+unsigned int score = score_partial_match(table->class->name,
+ table_name);
+if (score > best_score) {
+best_match = table;
+best_score = score;
+} else if (score == best_score) {
+best_match = NULL;
+}
+}
+if (best_match) {
+return best_match;
+} else if (best_score) {
+ctl_fatal("multiple table names match \"%s\"", table_name);
+} else {
+ctl_fatal("unknown table \"%s\"", table_name);
+}
+return NULL;
+}
+
 static void
 pre_cmd_find(struct ctl_context *ctx)
 {
@@ -1034,6 +1063,60 @@ cmd_find(struct ctl_context *ctx)
 free(columns);
 }
 
+/* Sets the column of 'row' in 'table'. */
+static void
+set_column(const struct ctl_table_class *table,
+   const struct ovsdb_idl_row *row, const char *arg,
+   struct ovsdb_symbol_table *symtab)
+{
+const struct ovsdb_idl_column *column;
+char *key_string, *value_string;
+char *error;
+
+error = parse_column_key_value(arg, table, &column, &key_string,
+   NULL, NULL, 0, &value_string);
+die_if_error(error);
+if (!value_string) {
+ctl_fatal("%s: missing value", arg);
+}
+check_mutable(row, column);
+
+if (key_string) {
+union ovsdb_atom key, value;
+struct ovsdb_datum datum;
+
+if (column->type.value.type == OVSDB_TYPE_VOID) {
+ctl_fatal("cannot specify key to set for non-map column %s",
+  column->name);
+}
+
+die_if_error(ovsdb_atom_from_string(&key, &column->type.key,
+key_string, symtab));
+die_if_error(ovsdb_atom_from_string(&value, &column->type.value,
+value_string, symtab));
+
+ovsdb_datum_init_empty(&datum);
+ovsdb_datum_add_unsafe(&datum, &key, &value, &column->type);
+
+ovsdb_atom_destroy(&key, column->type.key.type);
+ovsdb_atom_destroy(&value, column->type.value.type);
+
+ovsdb_datum_union(&datum, ovsdb_idl_read(row, column),
+  &column->type, false);
+ovsdb_idl_txn_verify(row, column);
+ovsdb_idl_txn_write(row, column, &datum);
+} else {
+struct ovsdb_datum datum;
+
+die_if_error(ovsdb_datum_from_string(&datum, &column->type,
+ value_string, symtab));
+ovsdb_idl_txn_write(row, column, &datum);
+}
+
+free(key_string);
+free(value_string);
+}
+
 static void
 pre_cmd_set(struct ctl_context *ctx)
 {
@@ -1998,89 +2081,6 @@ ctl_context_done(struct ctl_context *ctx,
 invalidate_cache(ctx);
 }
 
-/* Finds and returns the "struct ctl_table_class *" with 'table_name' by
- * searching the 'tables'. */
-static const struct ctl_table_class *
-get_table(const char *table_name)
-{
-const struct ctl_table_class *table;
-const struct ctl_table_class *best_match = NULL;
-unsigned int best_score = 0;
-
-for (table = tables; table->class; table++) {
-unsigned int score = score_partial_match(table->class->name,
- table_name);
-if (score > best_score) {
-best_match = table;
-best_score = score;
-} else if (score == best_score) {
-best_match = NULL;
-}
-}
-if (best_match) {
-return best_match;
-} else if (best_score) {
-ctl_fatal("multiple table names match \"%s\"", table_name);
-} else {
-ctl_fatal("unknown table \"%s\"", table_name);
-}
-return NULL;
-}
-
-/* Sets the column of 'row' in 'table'. */
-static void
-set_column(const struct ctl_table_class *table,
-   const struct ovsdb_idl_row *row, const char *arg,
-   struct ovsdb_symbol_table *symtab)
-{
-const struct ovsdb_idl_column *column;
-char *key_string, *value_string;
-char *error;
-
-error = parse_column_key_va

[ovs-dev] [db-ctl-base v2 2/3] db-ctl-base: do not require client to expose the "tables" variable

2015-07-09 Thread Andy Zhou
Instead, client now pass it via the modified ctl_init() API.

Siigned-off-by: Andy Zhou 
---
 lib/db-ctl-base.c | 8 +++-
 lib/db-ctl-base.h | 8 ++--
 utilities/ovs-vsctl.c | 4 ++--
 vtep/vtep-ctl.c   | 4 ++--
 4 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/lib/db-ctl-base.c b/lib/db-ctl-base.c
index 64c01e6..659820b 100644
--- a/lib/db-ctl-base.c
+++ b/lib/db-ctl-base.c
@@ -46,6 +46,11 @@ VLOG_DEFINE_THIS_MODULE(db_ctl_base);
 struct ovsdb_idl *the_idl;
 struct ovsdb_idl_txn *the_idl_txn;
 
+/* Represents all tables in the schema.  User must define 'tables'
+ * in implementation and supply via clt_init().  The definition must end
+ * with an all-NULL entry. */
+static const struct ctl_table_class *tables;
+
 static struct shash all_commands = SHASH_INITIALIZER(&all_commands);
 static const struct ctl_table_class *get_table(const char *table_name);
 static void set_column(const struct ctl_table_class *,
@@ -1908,8 +1913,9 @@ ctl_register_commands(const struct ctl_command_syntax 
*commands)
 
 /* Registers the 'db_ctl_commands' to 'all_commands'. */
 void
-ctl_init(void)
+ctl_init(const struct ctl_table_class tables_[])
 {
+tables = tables_;
 ctl_register_commands(db_ctl_commands);
 ctl_register_commands(db_ctl_show_command);
 }
diff --git a/lib/db-ctl-base.h b/lib/db-ctl-base.h
index 8d25fbe..684de11 100644
--- a/lib/db-ctl-base.h
+++ b/lib/db-ctl-base.h
@@ -53,7 +53,8 @@ struct table;
 extern struct ovsdb_idl *the_idl;
 extern struct ovsdb_idl_txn *the_idl_txn;
 
-void ctl_init(void);
+struct ctl_table_class;
+void ctl_init(const struct ctl_table_class *tables);
 char *ctl_default_db(void);
 OVS_NO_RETURN void ctl_exit(int status);
 OVS_NO_RETURN void ctl_fatal(const char *, ...) OVS_PRINTF_FORMAT(1, 2);
@@ -242,11 +243,6 @@ struct ctl_table_class {
 struct ctl_row_id row_ids[2];
 };
 
-/* Represents all tables in the schema.  User must define 'tables'
- * in implementation.  And the definition must end with an all-NULL
- * entry. */
-extern const struct ctl_table_class tables[];
-
 void ctl_set_column(const char *table_name,
 const struct ovsdb_idl_row *, const char *arg,
 struct ovsdb_symbol_table *);
diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c
index 863bc73..8d62d54 100644
--- a/utilities/ovs-vsctl.c
+++ b/utilities/ovs-vsctl.c
@@ -2262,7 +2262,7 @@ cmd_get_aa_mapping(struct ctl_context *ctx)
 }
 
 
-const struct ctl_table_class tables[] = {
+static const struct ctl_table_class tables[] = {
 {&ovsrec_table_bridge,
  {{&ovsrec_table_bridge, &ovsrec_bridge_col_name, NULL},
   {&ovsrec_table_flow_sample_collector_set, NULL,
@@ -2749,6 +2749,6 @@ static const struct ctl_command_syntax vsctl_commands[] = 
{
 static void
 vsctl_cmd_init(void)
 {
-ctl_init();
+ctl_init(tables);
 ctl_register_commands(vsctl_commands);
 }
diff --git a/vtep/vtep-ctl.c b/vtep/vtep-ctl.c
index 7f455df..f065fc9 100644
--- a/vtep/vtep-ctl.c
+++ b/vtep/vtep-ctl.c
@@ -1962,7 +1962,7 @@ cmd_set_manager(struct ctl_context *ctx)
 }
 
 /* Parameter commands. */
-const struct ctl_table_class tables[] = {
+static const struct ctl_table_class tables[] = {
 {&vteprec_table_global,
  {{&vteprec_table_global, NULL, NULL},
   {NULL, NULL, NULL}}},
@@ -2310,6 +2310,6 @@ static const struct ctl_command_syntax vtep_commands[] = {
 static void
 vtep_ctl_cmd_init(void)
 {
-ctl_init();
+ctl_init(tables);
 ctl_register_commands(vtep_commands);
 }
-- 
1.9.1

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


[ovs-dev] RE

2015-07-09 Thread Flynn, Anne
I have a proposal for you kindly contact me via:: idu...@gmail.com


































































































































--
This email remains the property of the ACT Education & Training Directorate.
This transmission and any accompanying attachments may contain confidential or
legally privileged information.  If you are not the intended addressee, you
are notified that any use or dissemination of this email is strictly
forbidden. If you have received this communication in error please notify the
sender immediately and delete all copies of this message. Opinions,
conclusions, views and other information in this message that do not relate to
the official business of ACT Education & Training Directorate are the views of 
the
individual sender and shall be understood as neither given nor endorsed by ACT 
Education & Training Directorate.
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH] lib/automake.mk: Fix dependency typos

2015-07-09 Thread Kyle Upton

Fix dependency issues with lib/ofp-errors.lo and lib/ofp-msgs.lo that
caused problems when building debian packages.

Signed-off-by: Kyle Upton 
---
 lib/automake.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/automake.mk b/lib/automake.mk
index f72eb32..fe40e4a 100644
--- a/lib/automake.mk
+++ b/lib/automake.mk
@@ -483,13 +483,13 @@ lib/ofp-errors.inc: lib/ofp-errors.h 
include/openflow/openflow-common.h \
$(srcdir)/lib/ofp-errors.h \
$(srcdir)/include/openflow/openflow-common.h > $@.tmp && \
mv $@.tmp $@
-lib/ofp-errors.c: lib/ofp-errors.inc
+lib/ofp-errors.lo: lib/ofp-errors.inc
 EXTRA_DIST += build-aux/extract-ofp-errors

 lib/ofp-msgs.inc: lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
$(AM_V_GEN)$(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
$(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
-lib/ofp-msgs.c: lib/ofp-msgs.inc
+lib/ofp-msgs.lo: lib/ofp-msgs.inc
 EXTRA_DIST += build-aux/extract-ofp-msgs

 INSTALL_DATA_LOCAL += lib-install-data-local
--
1.9.1


This correspondence, and any attachments or files transmitted with this 
correspondence, contains information which may be confidential and privileged 
and is intended solely for the use of the addressee. Unless you are the 
addressee or are authorized to receive messages for the addressee, you may not 
use, copy, disseminate, or disclose this correspondence or any information 
contained in this correspondence to any third party. If you have received this 
correspondence in error, please notify the sender immediately and delete this 
correspondence and any attachments or files transmitted with this 
correspondence from your system, and destroy any and all copies thereof, 
electronic or otherwise. Your cooperation and understanding are greatly 
appreciated.
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH] doc: Document proposed OVN Gateway HA design.

2015-07-09 Thread Ethan Jackson
High availability for gateways in network virtualization deployments
is fairly difficult to get right.  There are a ton of options, most of
which are too complicated or perform badly.  To help solve this
problem, this patch proposes an HA design based on some of the lessons
learned building similar systems.  The hope is that it can be used as
a starting point for design discussions and an eventual
implementation.

Signed-off-by: Ethan Jackson 
---
 OVN-GW-HA.md | 374 +++
 1 file changed, 374 insertions(+)
 create mode 100644 OVN-GW-HA.md

diff --git a/OVN-GW-HA.md b/OVN-GW-HA.md
new file mode 100644
index 000..ea598b2
--- /dev/null
+++ b/OVN-GW-HA.md
@@ -0,0 +1,374 @@
+OVN Gateway High Availability Plan
+==
+```
+ +---+
+ |   |
+ | External Network  |
+ |   |
+ +-^-+
+   |
+   |
+ +---+
+ |   |
+ |  Gateway  |
+ |   |
+ +---+
+   ^
+   |
+   |
+ +-v-+
+ |   |
+ |OVN Virtual Network|
+ |   |
+ +---+
+
+OVN Gateway
+```
+
+The OVN gateway is responsible for shuffling traffic between logical space
+(governed by ovn-northd), and the legacy physical network.  In a naive
+implementation, the gateway is a single x86 server, or hardware VTEP.  For most
+deployments, a single system has enough forwarding capacity to service the
+entire virtualized network, however, it introduces a single point of failure.
+If this system dies, the entire OVN deployment becomes unavailable.  To mitgate
+this risk, an HA solution is critical ??? by spreading responsibilty across
+multiple systems, no single server failure can take down the network.
+
+An HA solution is both critical to the performance and manageability of the
+system, and extremely difficult to get right.  The purpose of this document, is
+to propose a plan for OVN Gateway High Availability which takes into account
+our past experience building similar systems.  It should be considered a fluid
+changing proposal, not a set-in-stone decree.
+
+Basic Architecture
+--
+In an OVN deployment, the set of hypervisors and network elements operating
+under the guidance of ovn-northd are in what's called "logical space".  These
+servers use VXLAN, STT, or Geneve to communicate, oblivious to the details of
+the underlying physical network.  When these systems need to communicate with
+legacy networks, traffic must be routed through a Gateway which translates from
+OVN controlled tunnel traffic, to raw physical network traffic.
+
+Since the broader internet is managed outside of the OVN network domain, all
+traffic between logical space and the WAN must travel through this gateway.
+This makes it a critical single point of failure ??? if the gateway dies,
+communication with the WAN ceases for all systems in logical space.
+
+To mitigate this risk, multiple gateways should be run in a "High Availability
+Cluster" or "HA Cluster".  The HA cluster will be responsible for performing
+the duties of a gateways,  while being able to recover gracefully from
+individual memember failures.
+
+```
+ +---+
+ |   |
+ | External Network  |
+ |   |
+ +-^-+
+   |
+   |
++--v--+
+| |
+|  High Availability Cluster  |
+| |
+| +---+  +---+  +---+ |
+| |   |  |   |  |   | |
+| |  Gateway  |  |  Gateway  |  |  Gateway  | |
+| |   |  |   |  |   | |
+| +---+  +---+  +---+ |
++--^--+
+   |
+   |
+ +-v-+
+ |   |
+ |OVN Virtual Network|
+ |   |
+ +---+
+
+OVN Gateway HA Cluster
+```
+
+# L2 vs L3 High Availability
+In order to achieve this goal, there are two broad approaches one can take.
+The HA cluster can appear to the network like a giant Layer 2 Ethernet Switch,
+or like a giant IP Router. These approaches are called L2HA, and L3HA
+respectively.  L2HA allows ethernet broadcast domains to extend into logical
+space, a significant advantage, but this comes at a co

[ovs-dev] About one abort in vswitchd

2015-07-09 Thread 马啸
Hi,all


  I am one engineer from UnitedStack, one OpenStack Provider.
  We are using OpenvSwitch as the software-switch in OpenStack Compute and 
Network Node, and we enabled sflow to monitor the traffic.
 And one crash happened. The core-dump information is attached, could anybody 
help us to solve the problem?


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


Re: [ovs-dev] About one abort in vswitchd

2015-07-09 Thread Alex Wang
Hey,

Could you send the core dump info (did not see any attachment)?  I assume
you
mean the gdb printout showing what causes the crash.  Also, could you
provide
the ovs version you are using?

I'm trying to debug an ipfix related crash, could we related,

Thanks, 谢谢,
Alex Wang,

On Thu, Jul 9, 2015 at 8:01 PM, 马啸  wrote:

> Hi,all
>
>
>   I am one engineer from UnitedStack, one OpenStack Provider.
>   We are using OpenvSwitch as the software-switch in OpenStack Compute and
> Network Node, and we enabled sflow to monitor the traffic.
>  And one crash happened. The core-dump information is attached, could
> anybody help us to solve the problem?
>
>
>   Thanks.
> ___
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] About one abort in vswitchd

2015-07-09 Thread Jesse Gross
This could be related to b953042214201e2693a485a8ba8b19f69e5bdf34
("datapath: simplify sample action implementation"). I would check
that you are using OVS 2.3.2 for anything related to sampling.

On Thu, Jul 9, 2015 at 8:43 PM, Alex Wang  wrote:
> Hey,
>
> Could you send the core dump info (did not see any attachment)?  I assume
> you
> mean the gdb printout showing what causes the crash.  Also, could you
> provide
> the ovs version you are using?
>
> I'm trying to debug an ipfix related crash, could we related,
>
> Thanks, 谢谢,
> Alex Wang,
>
> On Thu, Jul 9, 2015 at 8:01 PM, 马啸  wrote:
>
>> Hi,all
>>
>>
>>   I am one engineer from UnitedStack, one OpenStack Provider.
>>   We are using OpenvSwitch as the software-switch in OpenStack Compute and
>> Network Node, and we enabled sflow to monitor the traffic.
>>  And one crash happened. The core-dump information is attached, could
>> anybody help us to solve the problem?
>>
>>
>>   Thanks.
>> ___
>> dev mailing list
>> dev@openvswitch.org
>> http://openvswitch.org/mailman/listinfo/dev
>>
> ___
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev