Re: [ovs-dev] [PATCH 3/3] seq: Add support for initial delay before waking up.

2016-09-19 Thread Ben Pfaff
On Fri, Sep 16, 2016 at 04:10:51PM -0700, Jarno Rajahalme wrote:
> The execution time of 'ovs-ofctl add-flows' with a large number of
> flows can be more than halved if revalidators are not running after
> each flow mod separately.  This was first suspected when it was found
> that 'ovs-ofctl --bundle add-flows' is about 10 times faster than the
> same command without the '--bundle' option in a scenario where there
> is a large set of flows being added and no datapath flows at all.  One
> of the differences caused by the '--bundle' option is that the
> revalidators are woken up only once, at the end of the whole set of
> flow table changes, rather than after each flow table change
> individually.
> 
> This patch limits the revalidation to run at most 200 times a second
> by enforcing a minimum of 5ms delay for flow table change wakeup after
> each complete revalidation round.  This is implemented by adding a new
> seq_wait_delay() function, that takes a delay parameter, which, when
> non-zero, causes the wakeup to be postponed by the given number of
> milliseconds from the original seq_wait_delay() call time.  If nothing
> happens in, say 6 milliseconds, and then a new flow table change is
> signaled, the revalidator threads wake up immediately without any
> further delay.  Values smaller than 5 were found to increase the
> 'ovs-ofctl add-flows' execution time noticeably.
> 
> Since the revalidators are not running after each flow mod, the
> overall OVS CPU utilization during the 'ovs-ofctl add-flows' run time
> is reduced roughly by one core on a four core machine.
> 
> In testing the 'ovs-ofctl add-flows' execution time is not
> significantly improved from this even if the revalidators are not
> notified about the flow table changes at all.
> 
> Signed-off-by: Jarno Rajahalme 

I need some help understanding how this works.  Before this commit, a
thread that wanted to wake up if a seq changed would call seq_wait().
If the seq changed, it got awakened immediately because seq_change()
called seq_wake_waiters() which set a latch that woke the thread.  After
this commit, that still works fine with delay==0.  However suppose that
delay==5 instead.  As I see it, the same chain of events will occur
except that seq_wake_waiters() might do nothing because the time hasn't
come yet.  Suppose that nothing ever calls seq_change() again for that
seq.  What wakes up the thread after 5 ms?

Once I understand that, here's a possible nit to look into.  A couple of
places talk about how time_msec() has to be called without holding
seq_mutex because time_msec() calls time_init(), which creates a seq,
which takes seq_mutex.  Maybe this is good enough.  But it also appears
to be easy to eliminate the dependency of seq_create() on seq_mutex.
Here is why it takes seq_mutex:

ovs_mutex_lock(_mutex);
seq->value = seq_next++;
hmap_init(>waiters);
ovs_mutex_unlock(_mutex);

The first statement is in seq_mutex because seq_next requires it.  This
could be fixed by make seq_next atomic and then using atomic_add()
on it.  The second statement is in seq_mutex only to silence Clang; an
OVS_NO_THREAD_SAFETY_ANALYSIS annotation would also silence it.

Thanks,

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


Re: [ovs-dev] [PATCH] ovn-vtep: fix arping from vtep-gw physical port

2016-09-19 Thread Darrell Ball
On Mon, Sep 19, 2016 at 2:32 PM, Ramu Ramamurthy 
wrote:

> Currently, arping from a vetp-gw physical-switch port to
> a VIF IP address does not work.
>
> When a physical-switch-port arps for an IP address
> of a VIF, that arp packet comes into the VIF hypervisor via a
> vxlan tunnel. That arp packet must not be responded-to by the
> arp responder table. Its treatment must be similar to the
> arps coming in from the localnet port - which is to
> skip the arp responder table.
>
> Signed-off-by: Ramu Ramamurthy 
> ---
>  ovn/northd/ovn-northd.8.xml | 3 ++-
>  ovn/northd/ovn-northd.c | 3 ++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/ovn/northd/ovn-northd.8.xml b/ovn/northd/ovn-northd.8.xml
> index 307e8be..d6dc860 100644
> --- a/ovn/northd/ovn-northd.8.xml
> +++ b/ovn/northd/ovn-northd.8.xml
> @@ -422,7 +422,8 @@
>  
>
>  Priority-100 flows to skip ARP responder if inport is of type
> -localnet, and advances directly to the next table.
> +localnet or vtep, and advances directly
> to
> +the next table.
>
>
>
> diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c
> index 5ccb516..ebbc18a 100644
> --- a/ovn/northd/ovn-northd.c
> +++ b/ovn/northd/ovn-northd.c
> @@ -2669,7 +2669,8 @@ build_lswitch_flows(struct hmap *datapaths, struct
> hmap *ports,
>  continue;
>  }
>
> -if (!strcmp(op->nbsp->type, "localnet")) {
> +if (!strcmp(op->nbsp->type, "localnet")
> +|| !strcmp(op->nbsp->type, "vtep")) {
>  ds_clear();
>  ds_put_format(, "inport == %s", op->json_key);
>  ovn_lflow_add(lflows, op->od, S_SWITCH_IN_ARP_ND_RSP, 100,
> --
> 1.9.1
>


Does the following diff work on your system?


diff --git a/ovn/northd/ovn-northd.8.xml b/ovn/northd/ovn-northd.8.xml
index 7797417..4f1cd89 100644
--- a/ovn/northd/ovn-northd.8.xml
+++ b/ovn/northd/ovn-northd.8.xml
@@ -421,8 +421,8 @@

 
   
-Priority-100 flows to skip ARP responder if inport is of type
-localnet, and advances directly to the next table.
+Priority-100 flows to skip ARP responder if inport is not
associated
+with a local VIF, and advances directly to the next table.
   

   
diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c
index 8c7e80c..bcb9738 100644
--- a/ovn/northd/ovn-northd.c
+++ b/ovn/northd/ovn-northd.c
@@ -2428,7 +2428,9 @@ build_lswitch_flows(struct hmap *datapaths, struct
hmap *ports,
 continue;
 }

-if (!strcmp(op->nbsp->type, "localnet")) {
+/* Skip installing arp responder if the logical switch inport
+ * is not associated with a local VIF. */
+if (strcmp(op->nbsp->type, "")) {
 ds_clear();
 ds_put_format(, "inport == %s", op->json_key);
 ovn_lflow_add(lflows, op->od, S_SWITCH_IN_ARP_ND_RSP, 100,






>
> ___
> 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] ovn-controller: Fix possible null pointer dereference.

2016-09-19 Thread Justin Pettit
The code dereferences "chassis", which could be null if chassis_run()
returns null.  "chassis" will always be null if "chassis_id" is null, so
checking "chassis" is sufficient to check both.

Found by inspection.

Signed-off-by: Justin Pettit 
---
 ovn/controller/ovn-controller.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ovn/controller/ovn-controller.c b/ovn/controller/ovn-controller.c
index 5f2f90a..49821f7 100644
--- a/ovn/controller/ovn-controller.c
+++ b/ovn/controller/ovn-controller.c
@@ -427,7 +427,7 @@ main(int argc, char *argv[])
 _lports);
 }
 
-if (br_int && chassis_id) {
+if (br_int && chassis) {
 patch_run(, br_int, chassis_id, _datapaths,
   _datapaths);
 
-- 
1.9.1

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


[ovs-dev]

2016-09-19 Thread Evelyn hodshon



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


[ovs-dev]

2016-09-19 Thread Deirdre battie



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


Re: [ovs-dev] [PATCH 2/3] token-bucket: Add token_bucket_wait_at().

2016-09-19 Thread Ben Pfaff
On Fri, Sep 16, 2016 at 04:10:50PM -0700, Jarno Rajahalme wrote:
> Having the caller of token_bucket_wait() indicated in the log messages
> makes debugging easier.
> 
> Signed-off-by: Jarno Rajahalme 

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


Re: [ovs-dev] [PATCH v2 4/5] treewide: Use WC_MASK_FIELD() and FLOW_WC_GET_AND_MASK_WC().

2016-09-19 Thread Jarno Rajahalme
Unfortunately this and the last patch of the series does not apply to master, 
so you’d need to rebase these.

  Jarno

> On Aug 30, 2016, at 6:47 PM, Daniele Di Proietto  
> wrote:
> 
> I think it makes the code more readable. No functional change.
> 
> Signed-off-by: Daniele Di Proietto 
> ---
> lib/bfd.c| 36 
> lib/cfm.c|  9 +++
> lib/flow.c   | 42 
> lib/flow.h   | 47 +---
> lib/odp-util.c   |  2 +-
> lib/tnl-neigh-cache.c|  6 ++---
> lib/tnl-ports.c  |  2 +-
> ofproto/netflow.c|  6 ++---
> ofproto/ofproto-dpif-xlate.c | 57 +++-
> ofproto/tunnel.c |  2 +-
> 10 files changed, 92 insertions(+), 117 deletions(-)
> 
> diff --git a/lib/bfd.c b/lib/bfd.c
> index 87f3322..203a56e 100644
> --- a/lib/bfd.c
> +++ b/lib/bfd.c
> @@ -648,30 +648,24 @@ bfd_should_process_flow(const struct bfd *bfd_, const 
> struct flow *flow,
> {
> struct bfd *bfd = CONST_CAST(struct bfd *, bfd_);
> 
> -if (!eth_addr_is_zero(bfd->rmt_eth_dst)) {
> -memset(>masks.dl_dst, 0xff, sizeof wc->masks.dl_dst);
> -
> -if (!eth_addr_equals(bfd->rmt_eth_dst, flow->dl_dst)) {
> -return false;
> -}
> +if (!eth_addr_is_zero(bfd->rmt_eth_dst)
> +&& !eth_addr_equals(bfd->rmt_eth_dst,
> +FLOW_WC_GET_AND_MASK_WC(flow, wc, dl_dst))) {
> +return false;
> }
> 
> -if (flow->dl_type == htons(ETH_TYPE_IP)) {
> -memset(>masks.nw_proto, 0xff, sizeof wc->masks.nw_proto);
> -if (flow->nw_proto == IPPROTO_UDP && !(flow->nw_frag & 
> FLOW_NW_FRAG_LATER)) {
> -memset(>masks.tp_dst, 0xff, sizeof wc->masks.tp_dst);
> -if (flow->tp_dst == htons(BFD_DEST_PORT)) {
> -bool check_tnl_key;
> -
> -atomic_read_relaxed(>check_tnl_key, _tnl_key);
> -if (check_tnl_key) {
> -memset(>masks.tunnel.tun_id, 0xff,
> -   sizeof wc->masks.tunnel.tun_id);
> -return flow->tunnel.tun_id == htonll(0);
> -}
> -return true;
> -}
> +if (flow->dl_type == htons(ETH_TYPE_IP)
> +&& FLOW_WC_GET_AND_MASK_WC(flow, wc, nw_proto) == IPPROTO_UDP
> +&& !(flow->nw_frag & FLOW_NW_FRAG_LATER)
> +&& FLOW_WC_GET_AND_MASK_WC(flow, wc, tp_dst) == 
> htons(BFD_DEST_PORT)) {
> +bool check_tnl_key;
> +
> +atomic_read_relaxed(>check_tnl_key, _tnl_key);
> +if (check_tnl_key) {
> +return FLOW_WC_GET_AND_MASK_WC(flow, wc, tunnel.tun_id)
> +   == htonll(0);
> }
> +return true;
> }
> return false;
> }
> diff --git a/lib/cfm.c b/lib/cfm.c
> index 7bc22e3..3c55333 100644
> --- a/lib/cfm.c
> +++ b/lib/cfm.c
> @@ -731,16 +731,17 @@ cfm_should_process_flow(const struct cfm *cfm_, const 
> struct flow *flow,
> return false;
> }
> 
> -memset(>masks.dl_dst, 0xff, sizeof wc->masks.dl_dst);
> -if (OVS_UNLIKELY(!eth_addr_equals(flow->dl_dst, cfm_ccm_addr(cfm {
> +if (OVS_UNLIKELY(
> +!eth_addr_equals(FLOW_WC_GET_AND_MASK_WC(flow, wc, dl_dst),
> + cfm_ccm_addr(cfm {
> return false;
> }
> 
> atomic_read_relaxed(>check_tnl_key, _tnl_key);
> 
> if (check_tnl_key) {
> -memset(>masks.tunnel.tun_id, 0xff, sizeof 
> wc->masks.tunnel.tun_id);
> -return flow->tunnel.tun_id == htonll(0);
> +return FLOW_WC_GET_AND_MASK_WC(flow, wc, tunnel.tun_id)
> +   == htonll(0);
> }
> return true;
> }
> diff --git a/lib/flow.c b/lib/flow.c
> index ba4f8c7..8f052ba 100644
> --- a/lib/flow.c
> +++ b/lib/flow.c
> @@ -855,8 +855,8 @@ void
> flow_unwildcard_tp_ports(const struct flow *flow, struct flow_wildcards *wc)
> {
> if (flow->nw_proto != IPPROTO_ICMP) {
> -memset(>masks.tp_src, 0xff, sizeof wc->masks.tp_src);
> -memset(>masks.tp_dst, 0xff, sizeof wc->masks.tp_dst);
> +WC_MASK_FIELD(wc, tp_src);
> +WC_MASK_FIELD(wc, tp_dst);
> } else {
> wc->masks.tp_src = htons(0xff);
> wc->masks.tp_dst = htons(0xff);
> @@ -1478,8 +1478,8 @@ flow_wildcards_clear_non_packet_fields(struct 
> flow_wildcards *wc)
> /* Update this function whenever struct flow changes. */
> BUILD_ASSERT_DECL(FLOW_WC_SEQ == 36);
> 
> -memset(>masks.metadata, 0, sizeof wc->masks.metadata);
> -memset(>masks.regs, 0, sizeof wc->masks.regs);
> +WC_UNMASK_FIELD(wc, metadata);
> +WC_UNMASK_FIELD(wc, regs);
> wc->masks.actset_output = 0;
> wc->masks.conj_id = 0;
> }
> @@ -1834,21 +1834,21 @@ flow_mask_hash_fields(const struct flow *flow, struct 
> flow_wildcards *wc,
> {
> switch 

Re: [ovs-dev] [PATCH v2 3/5] tnl-neigh-cache: Unwildcard flow members before inspecting them.

2016-09-19 Thread Jarno Rajahalme
Acked-by: Jarno Rajahalme 

IMO this and the earlier (2/5) one are bug fixes that should be cherry-picked 
to branches 2.6 and 2.5, if applicable.

  Jarno

> On Aug 30, 2016, at 6:47 PM, Daniele Di Proietto  
> wrote:
> 
> tnl_neigh_snoop() is part of the translation.  During translation we
> have to unwildcard all the fields we examine to make a decision.
> 
> tnl_arp_snoop() and tnl_nd_snoop() failed to unwildcard fileds in case
> of failure.  The solution is to do unwildcarding before the field is
> inspected.
> 
> Signed-off-by: Daniele Di Proietto 
> ---
> lib/flow.h|  7 +++
> lib/tnl-neigh-cache.c | 22 --
> 2 files changed, 15 insertions(+), 14 deletions(-)
> 
> diff --git a/lib/flow.h b/lib/flow.h
> index 5b83695..ea24e28 100644
> --- a/lib/flow.h
> +++ b/lib/flow.h
> @@ -854,6 +854,13 @@ pkt_metadata_from_flow(struct pkt_metadata *md, const 
> struct flow *flow)
> md->ct_label = flow->ct_label;
> }
> 
> +/* Often, during translation we need to read a value from a flow('FLOW') and
> + * unwildcard the corresponding bits in the wildcards('WC').  This macro 
> makes
> + * it easier to do that. */
> +
> +#define FLOW_WC_GET_AND_MASK_WC(FLOW, WC, FIELD) \
> +(((WC) ? WC_MASK_FIELD(WC, FIELD) : NULL), ((FLOW)->FIELD))
> +
> static inline bool is_vlan(const struct flow *flow,
>struct flow_wildcards *wc)
> {
> diff --git a/lib/tnl-neigh-cache.c b/lib/tnl-neigh-cache.c
> index f7d29f6..499efff 100644
> --- a/lib/tnl-neigh-cache.c
> +++ b/lib/tnl-neigh-cache.c
> @@ -115,7 +115,7 @@ tnl_neigh_delete(struct tnl_neigh_entry *neigh)
> 
> static void
> tnl_neigh_set__(const char name[IFNAMSIZ], const struct in6_addr *dst,
> -  const struct eth_addr mac)
> +const struct eth_addr mac)
> {
> ovs_mutex_lock();
> struct tnl_neigh_entry *neigh = tnl_neigh_lookup__(name, dst);
> @@ -151,26 +151,21 @@ static int
> tnl_arp_snoop(const struct flow *flow, struct flow_wildcards *wc,
>   const char name[IFNAMSIZ])
> {
> -if (flow->dl_type != htons(ETH_TYPE_ARP) ||
> -flow->nw_proto != ARP_OP_REPLY ||
> -eth_addr_is_zero(flow->arp_sha)) {
> +if (flow->dl_type != htons(ETH_TYPE_ARP)
> +|| FLOW_WC_GET_AND_MASK_WC(flow, wc, nw_proto) != ARP_OP_REPLY
> +|| eth_addr_is_zero(FLOW_WC_GET_AND_MASK_WC(flow, wc, arp_sha))) {
> return EINVAL;
> }
> 
> -/* Exact Match on all ARP flows. */
> -memset(>masks.nw_proto, 0xff, sizeof wc->masks.nw_proto);
> -memset(>masks.nw_src, 0xff, sizeof wc->masks.nw_src);
> -memset(>masks.arp_sha, 0xff, sizeof wc->masks.arp_sha);
> -
> -tnl_arp_set(name, flow->nw_src, flow->arp_sha);
> +tnl_arp_set(name, FLOW_WC_GET_AND_MASK_WC(flow, wc, nw_src), 
> flow->arp_sha);
> return 0;
> }
> 
> static int
> tnl_nd_snoop(const struct flow *flow, struct flow_wildcards *wc,
> -  const char name[IFNAMSIZ])
> + const char name[IFNAMSIZ])
> {
> -if (!is_nd(flow, NULL) || flow->tp_src != htons(ND_NEIGHBOR_ADVERT)) {
> +if (!is_nd(flow, wc) || flow->tp_src != htons(ND_NEIGHBOR_ADVERT)) {
> return EINVAL;
> }
> /* - RFC4861 says Neighbor Advertisements sent in response to unicast 
> Neighbor
> @@ -179,14 +174,13 @@ tnl_nd_snoop(const struct flow *flow, struct 
> flow_wildcards *wc,
>  *   TLL address and other Advertisements not including it can be ignored.
>  * - OVS flow extract can set this field to zero in case of packet 
> parsing errors.
>  *   For details refer miniflow_extract()*/
> -if (eth_addr_is_zero(flow->arp_tha)) {
> +if (eth_addr_is_zero(FLOW_WC_GET_AND_MASK_WC(flow, wc, arp_tha))) {
> return EINVAL;
> }
> 
> memset(>masks.ipv6_src, 0xff, sizeof wc->masks.ipv6_src);
> memset(>masks.ipv6_dst, 0xff, sizeof wc->masks.ipv6_dst);
> memset(>masks.nd_target, 0xff, sizeof wc->masks.nd_target);
> -memset(>masks.arp_tha, 0xff, sizeof wc->masks.arp_tha);
> 
> tnl_neigh_set__(name, >nd_target, flow->arp_tha);
> return 0;
> -- 
> 2.9.3
> 
> ___
> 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]

2016-09-19 Thread Iva lapthorne



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


Re: [ovs-dev] [PATCH v2 2/5] ofproto-dpif-xlate: Adjust generated mask for fragments.

2016-09-19 Thread Jarno Rajahalme
Acked-by: Jarno Rajahalme 

  Jarno

> On Aug 30, 2016, at 6:47 PM, Daniele Di Proietto  
> wrote:
> 
> It's possible to install an OpenFlow flow that matches on udp source and
> destination ports without matching on fragments.  If the subtable where
> such flow stays is visited during translation of a later fragment, the
> generated mask will have incorrect prerequisited for the datapath and it
> would be revalidated away at the first chance.
> 
> This commit fixes it by adjusting the mask for later fragments after
> translation.
> 
> Other prerequisites of the mask are also prerequisites in OpenFlow, but
> not the ip fragment bit, that's why we need a special case here.
> 
> For completeness, this commits also fixes a related problem in bfd,
> where we check the udp destination port without checking if the frame is
> an ip fragment.  It's not really necessary to address this separately,
> given the adjustment that we perform.
> 
> VMware-BZ: #1651589
> Signed-off-by: Daniele Di Proietto 
> ---
> lib/bfd.c|  2 +-
> ofproto/ofproto-dpif-xlate.c | 11 +++
> tests/ofproto-dpif.at| 35 +++
> 3 files changed, 47 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/bfd.c b/lib/bfd.c
> index fcb6f64..87f3322 100644
> --- a/lib/bfd.c
> +++ b/lib/bfd.c
> @@ -658,7 +658,7 @@ bfd_should_process_flow(const struct bfd *bfd_, const 
> struct flow *flow,
> 
> if (flow->dl_type == htons(ETH_TYPE_IP)) {
> memset(>masks.nw_proto, 0xff, sizeof wc->masks.nw_proto);
> -if (flow->nw_proto == IPPROTO_UDP) {
> +if (flow->nw_proto == IPPROTO_UDP && !(flow->nw_frag & 
> FLOW_NW_FRAG_LATER)) {
> memset(>masks.tp_dst, 0xff, sizeof wc->masks.tp_dst);
> if (flow->tp_dst == htons(BFD_DEST_PORT)) {
> bool check_tnl_key;
> diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
> index 0118d01..0403c98 100644
> --- a/ofproto/ofproto-dpif-xlate.c
> +++ b/ofproto/ofproto-dpif-xlate.c
> @@ -5329,6 +5329,17 @@ xlate_wc_finish(struct xlate_ctx *ctx)
> if (ctx->wc->masks.vlan_tci) {
> ctx->wc->masks.vlan_tci |= htons(VLAN_CFI);
> }
> +
> +/* The classifier might return masks that match on tp_src and tp_dst even
> + * for later fragments.  This happens because there might be flows that
> + * match on tp_src or tp_dst without matching on the frag bits, because
> + * it is not a prerequisite for OpenFlow.  Since it is a prerequisite for
> + * datapath flows and since tp_src and tp_dst are always going to be 0,
> + * wildcard the fields here. */
> +if (ctx->xin->flow.nw_frag & FLOW_NW_FRAG_LATER) {
> +ctx->wc->masks.tp_src = 0;
> +ctx->wc->masks.tp_dst = 0;
> +}
> }
> 
> /* Translates the flow, actions, or rule in 'xin' into datapath actions in
> diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
> index 8e5fde6..e047c1c 100644
> --- a/tests/ofproto-dpif.at
> +++ b/tests/ofproto-dpif.at
> @@ -8903,3 +8903,38 @@ AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface 
> int1 mtu=1600])
> 
> OVS_VSWITCHD_STOP
> AT_CLEANUP
> +
> +AT_SETUP([ofproto - fragment prerequisites])
> +OVS_VSWITCHD_START
> +
> +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
> +
> +add_of_ports br0 1
> +
> +AT_DATA([flows.txt], [dnl
> +priority=10,in_port=1,udp,tp_src=67,tp_dst=68,action=drop
> +priority=1,in_port=1,udp,action=drop
> +])
> +
> +AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
> +
> +AT_CHECK([ovs-vsctl set Open_vSwitch . other_config:max-idle=1])
> +
> +ovs-appctl time/stop
> +AT_CHECK([ovs-appctl netdev-dummy/receive p1 
> 'recirc_id(0),in_port(1),eth_type(0x0800),ipv4(proto=17,frag=later)'])
> +ovs-appctl time/warp 5000
> +
> +AT_CHECK([strip_ufid < ovs-vswitchd.log | filter_flow_install | strip_used], 
> [0], [dnl
> +recirc_id(0),in_port(1),eth_type(0x0800),ipv4(proto=17,frag=later), 
> actions:drop
> +])
> +
> +dnl Change the flow table.  This will trigger revalidation of all the flows.
> +AT_CHECK([ovs-ofctl add-flow br0 priority=5,in_port=1,action=drop])
> +AT_CHECK([ovs-appctl revalidator/wait], [0])
> +
> +dnl We don't want revalidators to delete any flow.  If the flow has been
> +dnl deleted it means that there's some inconsistency with the revalidation.
> +AT_CHECK([grep flow_del ovs-vswitchd.log], [1])
> +
> +OVS_VSWITCHD_STOP
> +AT_CLEANUP
> -- 
> 2.9.3
> 
> ___
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev

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


Re: [ovs-dev] [PATCH v3] datapath-windows: Add define for last module number

2016-09-19 Thread Nithin Raju
Acked-by: Nithin Raju 

-Original Message-
From: dev  on behalf of Sairam Venugopal

Date: Monday, September 19, 2016 at 4:21 PM
To: Shashank Ram , "dev@openvswitch.org"

Subject: Re: [ovs-dev] [PATCH v3] datapath-windows: Add define for last
module number

>Thanks for fixing this.
>
>Acked-by: Sairam Venugopal 
>
>
>
>On 9/19/16, 4:16 PM, "Shashank Ram"  wrote:
>
>>Adds a define for the last defined module number.
>>
>>Change-Id: I1ea9230317a849e911900cf69e96ed85a65d3a8c
>>Signed-off-by: Shashank Ram 
>>---
>> datapath-windows/ovsext/Debug.c | 1 +
>> datapath-windows/ovsext/Debug.h | 4 ++--
>> 2 files changed, 3 insertions(+), 2 deletions(-)
>>
>>diff --git a/datapath-windows/ovsext/Debug.c
>>b/datapath-windows/ovsext/Debug.c
>>index a96d38d..c3d14ae 100644
>>--- a/datapath-windows/ovsext/Debug.c
>>+++ b/datapath-windows/ovsext/Debug.c
>>@@ -25,6 +25,7 @@
>> 
>> UINT32  ovsLogFlags = 0x;
>> UINT32  ovsLogLevel = OVS_DBG_DEFAULT;
>>+BUILD_ASSERT(OVS_DBG_LAST < 31); /* 'ovsLogLevel' is 32 bits. */
>> 
>> #define OVS_LOG_BUFFER_SIZE 384
>> 
>>diff --git a/datapath-windows/ovsext/Debug.h
>>b/datapath-windows/ovsext/Debug.h
>>index 935f858..cae6ac9 100644
>>--- a/datapath-windows/ovsext/Debug.h
>>+++ b/datapath-windows/ovsext/Debug.h
>>@@ -43,8 +43,8 @@
>> #define OVS_DBG_CONTRK   BIT32(23)
>> #define OVS_DBG_GENEVE   BIT32(24)
>> 
>>-#define OVS_DBG_RESERVED BIT32(31)
>>-//Please add above OVS_DBG_RESERVED.
>>+#define OVS_DBG_LAST 24  /* Set this to the last defined module
>>number. */
>>+/* Please add above OVS_DBG_LAST. */
>> 
>> #define OVS_DBG_ERRORDPFLTR_ERROR_LEVEL
>> #define OVS_DBG_WARN DPFLTR_WARNING_LEVEL
>>-- 
>>2.9.3.windows.2
>>
>>___
>>dev mailing list
>>dev@openvswitch.org
>>https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailm
>>a
>>n_listinfo_dev=CwIGaQ=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs=D
>>c
>>ruz40PROJ40ROzSpxyQSLw6fcrOWpJgEcEmNR3JEQ=TOmB5UNcg-zFOda-mCbQv18k8tPK5
>>t
>>Ym77eotJR0pnk=sYgoL2PsKAO-t1fQ6K-YkddMZxD8v35UogStZIhQD24=
>
>___
>dev mailing list
>dev@openvswitch.org
>https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailma
>n_listinfo_dev=CwIGaQ=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs=pN
>HQcdr7B40b4h6Yb7FIedI1dnBsxdDuTLBYD3JqV80=KrXss9NJ7JRZh4IY1EmPSvyJzScW73
>GyOZ0FvvQ6R0k=V0Qbul9QWt-TInWnBTIT8EdyxAbbhynFi3uTQ79Wixw= 

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


Re: [ovs-dev] [PATCH] ovsdb-idl: Update comment.

2016-09-19 Thread Ben Pfaff
On Mon, Sep 19, 2016 at 02:56:31PM -0700, Justin Pettit wrote:
> 
> > On Sep 19, 2016, at 2:54 PM, Ben Pfaff  wrote:
> > 
> > TXN_AGAIN_WAIT and TXN_AGAIN_NOW were combined into a single return code
> > TXN_TRY_AGAIN a long time ago, but this comment was not updated.
> > 
> > Reported-by: Justin Pettit 
> > Signed-off-by: Ben Pfaff 
> > ---
> > lib/ovsdb-idl.c | 4 +---
> > 1 file changed, 1 insertion(+), 3 deletions(-)
> > 
> > diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c
> > index cdee326..ed4eddc 100644
> > --- a/lib/ovsdb-idl.c
> > +++ b/lib/ovsdb-idl.c
> > @@ -3193,9 +3193,7 @@ ovsdb_idl_txn_write_clone(const struct ovsdb_idl_row 
> > *row,
> >  * prerequisite to completing the transaction.  That is, if 'column' in 
> > 'row_'
> >  * changed (or if 'row_' was deleted) between the time that the IDL 
> > originally
> >  * read its contents and the time that the transaction commits, then the
> > - * transaction aborts and ovsdb_idl_txn_commit() returns TXN_AGAIN_WAIT or
> > - * TXN_AGAIN_NOW (depending on whether the database change has already been
> > - * received).
> > + * transaction aborts and ovsdb_idl_txn_commit() returns TXN_TRY_AGAIN.
> >  *
> >  * The intention is that, to ensure that no transaction commits based on 
> > dirty
> >  * reads, an application should call ovsdb_idl_txn_verify() on each data 
> > item
> 
> I think you need to update ovsdb/ovsdb-idlc.in, too.
> 
> Acked-by: Justin Pettit 

Oops.  Thanks, I fixed that up and applied this to master.
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH v3] datapath-windows: Add define for last module number

2016-09-19 Thread Sairam Venugopal
Thanks for fixing this.

Acked-by: Sairam Venugopal 



On 9/19/16, 4:16 PM, "Shashank Ram"  wrote:

>Adds a define for the last defined module number.
>
>Change-Id: I1ea9230317a849e911900cf69e96ed85a65d3a8c
>Signed-off-by: Shashank Ram 
>---
> datapath-windows/ovsext/Debug.c | 1 +
> datapath-windows/ovsext/Debug.h | 4 ++--
> 2 files changed, 3 insertions(+), 2 deletions(-)
>
>diff --git a/datapath-windows/ovsext/Debug.c
>b/datapath-windows/ovsext/Debug.c
>index a96d38d..c3d14ae 100644
>--- a/datapath-windows/ovsext/Debug.c
>+++ b/datapath-windows/ovsext/Debug.c
>@@ -25,6 +25,7 @@
> 
> UINT32  ovsLogFlags = 0x;
> UINT32  ovsLogLevel = OVS_DBG_DEFAULT;
>+BUILD_ASSERT(OVS_DBG_LAST < 31); /* 'ovsLogLevel' is 32 bits. */
> 
> #define OVS_LOG_BUFFER_SIZE 384
> 
>diff --git a/datapath-windows/ovsext/Debug.h
>b/datapath-windows/ovsext/Debug.h
>index 935f858..cae6ac9 100644
>--- a/datapath-windows/ovsext/Debug.h
>+++ b/datapath-windows/ovsext/Debug.h
>@@ -43,8 +43,8 @@
> #define OVS_DBG_CONTRK   BIT32(23)
> #define OVS_DBG_GENEVE   BIT32(24)
> 
>-#define OVS_DBG_RESERVED BIT32(31)
>-//Please add above OVS_DBG_RESERVED.
>+#define OVS_DBG_LAST 24  /* Set this to the last defined module
>number. */
>+/* Please add above OVS_DBG_LAST. */
> 
> #define OVS_DBG_ERRORDPFLTR_ERROR_LEVEL
> #define OVS_DBG_WARN DPFLTR_WARNING_LEVEL
>-- 
>2.9.3.windows.2
>
>___
>dev mailing list
>dev@openvswitch.org
>https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailma
>n_listinfo_dev=CwIGaQ=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs=Dc
>ruz40PROJ40ROzSpxyQSLw6fcrOWpJgEcEmNR3JEQ=TOmB5UNcg-zFOda-mCbQv18k8tPK5t
>Ym77eotJR0pnk=sYgoL2PsKAO-t1fQ6K-YkddMZxD8v35UogStZIhQD24= 

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


Re: [ovs-dev] [PATCH v2] datapath-windows: Add define for last module number

2016-09-19 Thread Shashank Ram
Thanks Sai, latest patch should have this resolved.


From: Sairam Venugopal
Sent: Monday, September 19, 2016 3:55:19 PM
To: Shashank Ram; dev@openvswitch.org
Subject: Re: [ovs-dev] [PATCH v2] datapath-windows: Add define for last module 
number

Hi Shashank,

Looks like the patch is missing ancestor history. Can you resend this
patch after fixing this?

Thanks,
Sairam

On 9/19/16, 3:24 PM, "Shashank Ram"  wrote:

>Adds a define for the last defined module number.
>
>Change-Id: I1ea9230317a849e911900cf69e96ed85a65d3a8c
>Signed-off-by: Shashank Ram 
>---
> datapath-windows/ovsext/Debug.c | 1 +
> datapath-windows/ovsext/Debug.h | 5 ++---
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
>diff --git a/datapath-windows/ovsext/Debug.c
>b/datapath-windows/ovsext/Debug.c
>index a96d38d..c3d14ae 100644
>--- a/datapath-windows/ovsext/Debug.c
>+++ b/datapath-windows/ovsext/Debug.c
>@@ -25,6 +25,7 @@
>
> UINT32  ovsLogFlags = 0x;
> UINT32  ovsLogLevel = OVS_DBG_DEFAULT;
>+BUILD_ASSERT(OVS_DBG_LAST < 31); /* 'ovsLogLevel' is 32 bits. */
>
> #define OVS_LOG_BUFFER_SIZE 384
>
>diff --git a/datapath-windows/ovsext/Debug.h
>b/datapath-windows/ovsext/Debug.h
>index 2175130..cae6ac9 100644
>--- a/datapath-windows/ovsext/Debug.h
>+++ b/datapath-windows/ovsext/Debug.h
>@@ -43,9 +43,8 @@
> #define OVS_DBG_CONTRK   BIT32(23)
> #define OVS_DBG_GENEVE   BIT32(24)
>
>-#define OVS_DBG_LAST 24  // Set this to the last defined module
>number.
>-#define OVS_DBG_RESERVED BIT32(31)
>-//Please add above OVS_DBG_LAST.
>+#define OVS_DBG_LAST 24  /* Set this to the last defined module
>number. */
>+/* Please add above OVS_DBG_LAST. */
>
> #define OVS_DBG_ERRORDPFLTR_ERROR_LEVEL
> #define OVS_DBG_WARN DPFLTR_WARNING_LEVEL
>--
>2.9.3.windows.2
>
>___
>dev mailing list
>dev@openvswitch.org
>https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailma
>n_listinfo_dev=CwIGaQ=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs=Dc
>ruz40PROJ40ROzSpxyQSLw6fcrOWpJgEcEmNR3JEQ=GjWyLjyqyVEE-4nHJ3cMJfB-tgih6M
>fFkbWuZ0tgXYw=hi7MMcfgXl1-EtL2ne_kEc1YLc8ncsinInh29j1LF2g=

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


[ovs-dev] [PATCH v3] datapath-windows: Add define for last module number

2016-09-19 Thread Shashank Ram
Adds a define for the last defined module number.

Change-Id: I1ea9230317a849e911900cf69e96ed85a65d3a8c
Signed-off-by: Shashank Ram 
---
 datapath-windows/ovsext/Debug.c | 1 +
 datapath-windows/ovsext/Debug.h | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/datapath-windows/ovsext/Debug.c b/datapath-windows/ovsext/Debug.c
index a96d38d..c3d14ae 100644
--- a/datapath-windows/ovsext/Debug.c
+++ b/datapath-windows/ovsext/Debug.c
@@ -25,6 +25,7 @@
 
 UINT32  ovsLogFlags = 0x;
 UINT32  ovsLogLevel = OVS_DBG_DEFAULT;
+BUILD_ASSERT(OVS_DBG_LAST < 31); /* 'ovsLogLevel' is 32 bits. */
 
 #define OVS_LOG_BUFFER_SIZE 384
 
diff --git a/datapath-windows/ovsext/Debug.h b/datapath-windows/ovsext/Debug.h
index 935f858..cae6ac9 100644
--- a/datapath-windows/ovsext/Debug.h
+++ b/datapath-windows/ovsext/Debug.h
@@ -43,8 +43,8 @@
 #define OVS_DBG_CONTRK   BIT32(23)
 #define OVS_DBG_GENEVE   BIT32(24)
 
-#define OVS_DBG_RESERVED BIT32(31)
-//Please add above OVS_DBG_RESERVED.
+#define OVS_DBG_LAST 24  /* Set this to the last defined module number. */
+/* Please add above OVS_DBG_LAST. */
 
 #define OVS_DBG_ERRORDPFLTR_ERROR_LEVEL
 #define OVS_DBG_WARN DPFLTR_WARNING_LEVEL
-- 
2.9.3.windows.2

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


[ovs-dev]

2016-09-19 Thread Leann borthwick



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


Re: [ovs-dev] [PATCH v2] datapath-windows: Add define for last module number

2016-09-19 Thread Sairam Venugopal
Hi Shashank,

Looks like the patch is missing ancestor history. Can you resend this
patch after fixing this?

Thanks,
Sairam

On 9/19/16, 3:24 PM, "Shashank Ram"  wrote:

>Adds a define for the last defined module number.
>
>Change-Id: I1ea9230317a849e911900cf69e96ed85a65d3a8c
>Signed-off-by: Shashank Ram 
>---
> datapath-windows/ovsext/Debug.c | 1 +
> datapath-windows/ovsext/Debug.h | 5 ++---
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
>diff --git a/datapath-windows/ovsext/Debug.c
>b/datapath-windows/ovsext/Debug.c
>index a96d38d..c3d14ae 100644
>--- a/datapath-windows/ovsext/Debug.c
>+++ b/datapath-windows/ovsext/Debug.c
>@@ -25,6 +25,7 @@
> 
> UINT32  ovsLogFlags = 0x;
> UINT32  ovsLogLevel = OVS_DBG_DEFAULT;
>+BUILD_ASSERT(OVS_DBG_LAST < 31); /* 'ovsLogLevel' is 32 bits. */
> 
> #define OVS_LOG_BUFFER_SIZE 384
> 
>diff --git a/datapath-windows/ovsext/Debug.h
>b/datapath-windows/ovsext/Debug.h
>index 2175130..cae6ac9 100644
>--- a/datapath-windows/ovsext/Debug.h
>+++ b/datapath-windows/ovsext/Debug.h
>@@ -43,9 +43,8 @@
> #define OVS_DBG_CONTRK   BIT32(23)
> #define OVS_DBG_GENEVE   BIT32(24)
> 
>-#define OVS_DBG_LAST 24  // Set this to the last defined module
>number.
>-#define OVS_DBG_RESERVED BIT32(31)
>-//Please add above OVS_DBG_LAST.
>+#define OVS_DBG_LAST 24  /* Set this to the last defined module
>number. */
>+/* Please add above OVS_DBG_LAST. */
> 
> #define OVS_DBG_ERRORDPFLTR_ERROR_LEVEL
> #define OVS_DBG_WARN DPFLTR_WARNING_LEVEL
>-- 
>2.9.3.windows.2
>
>___
>dev mailing list
>dev@openvswitch.org
>https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailma
>n_listinfo_dev=CwIGaQ=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs=Dc
>ruz40PROJ40ROzSpxyQSLw6fcrOWpJgEcEmNR3JEQ=GjWyLjyqyVEE-4nHJ3cMJfB-tgih6M
>fFkbWuZ0tgXYw=hi7MMcfgXl1-EtL2ne_kEc1YLc8ncsinInh29j1LF2g= 

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


[ovs-dev] Possible Spam :

2016-09-19 Thread Maureen cawley



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


Re: [ovs-dev] [PATCH v2] datapath-windows: Add define for last module number

2016-09-19 Thread Nithin Raju
Much better. Thanks for addressing the comments.

Acked-by: Nithin Raju 


-Original Message-
From: dev  on behalf of Shashank Ram

Date: Monday, September 19, 2016 at 3:24 PM
To: "dev@openvswitch.org" 
Cc: Shashank Ram 
Subject: [ovs-dev] [PATCH v2] datapath-windows: Add define for last
module  number

>Adds a define for the last defined module number.
>
>Change-Id: I1ea9230317a849e911900cf69e96ed85a65d3a8c
>Signed-off-by: Shashank Ram 
>---
> datapath-windows/ovsext/Debug.c | 1 +
> datapath-windows/ovsext/Debug.h | 5 ++---
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
>diff --git a/datapath-windows/ovsext/Debug.c
>b/datapath-windows/ovsext/Debug.c
>index a96d38d..c3d14ae 100644
>--- a/datapath-windows/ovsext/Debug.c
>+++ b/datapath-windows/ovsext/Debug.c
>@@ -25,6 +25,7 @@
> 
> UINT32  ovsLogFlags = 0x;
> UINT32  ovsLogLevel = OVS_DBG_DEFAULT;
>+BUILD_ASSERT(OVS_DBG_LAST < 31); /* 'ovsLogLevel' is 32 bits. */
> 
> #define OVS_LOG_BUFFER_SIZE 384
> 
>diff --git a/datapath-windows/ovsext/Debug.h
>b/datapath-windows/ovsext/Debug.h
>index 2175130..cae6ac9 100644
>--- a/datapath-windows/ovsext/Debug.h
>+++ b/datapath-windows/ovsext/Debug.h
>@@ -43,9 +43,8 @@
> #define OVS_DBG_CONTRK   BIT32(23)
> #define OVS_DBG_GENEVE   BIT32(24)
> 
>-#define OVS_DBG_LAST 24  // Set this to the last defined module
>number.
>-#define OVS_DBG_RESERVED BIT32(31)
>-//Please add above OVS_DBG_LAST.
>+#define OVS_DBG_LAST 24  /* Set this to the last defined module
>number. */
>+/* Please add above OVS_DBG_LAST. */
> 
> #define OVS_DBG_ERRORDPFLTR_ERROR_LEVEL
> #define OVS_DBG_WARN DPFLTR_WARNING_LEVEL
>-- 
>2.9.3.windows.2
>
>___
>dev mailing list
>dev@openvswitch.org
>https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailma
>n_listinfo_dev=CwIGaQ=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs=pN
>HQcdr7B40b4h6Yb7FIedI1dnBsxdDuTLBYD3JqV80=aBoHFSv-pDjXxHXQ343r2asnUI_rF7
>c56636ZLZPhGs=rocZ4Y35Yytzqr9xocQc_zJGzGH0E2RcwXYM9hmbueY= 

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


[ovs-dev] [PATCH v2] datapath-windows: Add define for last module number

2016-09-19 Thread Shashank Ram
Adds a define for the last defined module number.

Change-Id: I1ea9230317a849e911900cf69e96ed85a65d3a8c
Signed-off-by: Shashank Ram 
---
 datapath-windows/ovsext/Debug.c | 1 +
 datapath-windows/ovsext/Debug.h | 5 ++---
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/datapath-windows/ovsext/Debug.c b/datapath-windows/ovsext/Debug.c
index a96d38d..c3d14ae 100644
--- a/datapath-windows/ovsext/Debug.c
+++ b/datapath-windows/ovsext/Debug.c
@@ -25,6 +25,7 @@
 
 UINT32  ovsLogFlags = 0x;
 UINT32  ovsLogLevel = OVS_DBG_DEFAULT;
+BUILD_ASSERT(OVS_DBG_LAST < 31); /* 'ovsLogLevel' is 32 bits. */
 
 #define OVS_LOG_BUFFER_SIZE 384
 
diff --git a/datapath-windows/ovsext/Debug.h b/datapath-windows/ovsext/Debug.h
index 2175130..cae6ac9 100644
--- a/datapath-windows/ovsext/Debug.h
+++ b/datapath-windows/ovsext/Debug.h
@@ -43,9 +43,8 @@
 #define OVS_DBG_CONTRK   BIT32(23)
 #define OVS_DBG_GENEVE   BIT32(24)
 
-#define OVS_DBG_LAST 24  // Set this to the last defined module number.
-#define OVS_DBG_RESERVED BIT32(31)
-//Please add above OVS_DBG_LAST.
+#define OVS_DBG_LAST 24  /* Set this to the last defined module number. */
+/* Please add above OVS_DBG_LAST. */
 
 #define OVS_DBG_ERRORDPFLTR_ERROR_LEVEL
 #define OVS_DBG_WARN DPFLTR_WARNING_LEVEL
-- 
2.9.3.windows.2

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


[ovs-dev] [PATCH] datapath-windows: Add define for last module number

2016-09-19 Thread Shashank Ram
Adds a define for the last defined module number.

Change-Id: Id3b278d261c982d407b123b6fded46758c3ebe88
Signed-off-by: Shashank Ram 
---
 datapath-windows/ovsext/Debug.c | 1 +
 datapath-windows/ovsext/Debug.h | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/datapath-windows/ovsext/Debug.c b/datapath-windows/ovsext/Debug.c
index a96d38d..be09f09 100644
--- a/datapath-windows/ovsext/Debug.c
+++ b/datapath-windows/ovsext/Debug.c
@@ -25,6 +25,7 @@
 
 UINT32  ovsLogFlags = 0x;
 UINT32  ovsLogLevel = OVS_DBG_DEFAULT;
+BUILD_ASSERT(OVS_DBG_LAST < 31); // 'ovsLogLevel' is 32 bits.
 
 #define OVS_LOG_BUFFER_SIZE 384
 
diff --git a/datapath-windows/ovsext/Debug.h b/datapath-windows/ovsext/Debug.h
index 2175130..82b0017 100644
--- a/datapath-windows/ovsext/Debug.h
+++ b/datapath-windows/ovsext/Debug.h
@@ -44,7 +44,6 @@
 #define OVS_DBG_GENEVE   BIT32(24)
 
 #define OVS_DBG_LAST 24  // Set this to the last defined module number.
-#define OVS_DBG_RESERVED BIT32(31)
 //Please add above OVS_DBG_LAST.
 
 #define OVS_DBG_ERRORDPFLTR_ERROR_LEVEL
-- 
2.9.3.windows.2

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


Re: [ovs-dev] [PATCH] ovsdb-idl: Update comment.

2016-09-19 Thread Justin Pettit

> On Sep 19, 2016, at 2:54 PM, Ben Pfaff  wrote:
> 
> TXN_AGAIN_WAIT and TXN_AGAIN_NOW were combined into a single return code
> TXN_TRY_AGAIN a long time ago, but this comment was not updated.
> 
> Reported-by: Justin Pettit 
> Signed-off-by: Ben Pfaff 
> ---
> lib/ovsdb-idl.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c
> index cdee326..ed4eddc 100644
> --- a/lib/ovsdb-idl.c
> +++ b/lib/ovsdb-idl.c
> @@ -3193,9 +3193,7 @@ ovsdb_idl_txn_write_clone(const struct ovsdb_idl_row 
> *row,
>  * prerequisite to completing the transaction.  That is, if 'column' in 'row_'
>  * changed (or if 'row_' was deleted) between the time that the IDL originally
>  * read its contents and the time that the transaction commits, then the
> - * transaction aborts and ovsdb_idl_txn_commit() returns TXN_AGAIN_WAIT or
> - * TXN_AGAIN_NOW (depending on whether the database change has already been
> - * received).
> + * transaction aborts and ovsdb_idl_txn_commit() returns TXN_TRY_AGAIN.
>  *
>  * The intention is that, to ensure that no transaction commits based on dirty
>  * reads, an application should call ovsdb_idl_txn_verify() on each data item

I think you need to update ovsdb/ovsdb-idlc.in, too.

Acked-by: Justin Pettit 

--Justin


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


[ovs-dev] [PATCH] ovsdb-idl: Update comment.

2016-09-19 Thread Ben Pfaff
TXN_AGAIN_WAIT and TXN_AGAIN_NOW were combined into a single return code
TXN_TRY_AGAIN a long time ago, but this comment was not updated.

Reported-by: Justin Pettit 
Signed-off-by: Ben Pfaff 
---
 lib/ovsdb-idl.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c
index cdee326..ed4eddc 100644
--- a/lib/ovsdb-idl.c
+++ b/lib/ovsdb-idl.c
@@ -3193,9 +3193,7 @@ ovsdb_idl_txn_write_clone(const struct ovsdb_idl_row *row,
  * prerequisite to completing the transaction.  That is, if 'column' in 'row_'
  * changed (or if 'row_' was deleted) between the time that the IDL originally
  * read its contents and the time that the transaction commits, then the
- * transaction aborts and ovsdb_idl_txn_commit() returns TXN_AGAIN_WAIT or
- * TXN_AGAIN_NOW (depending on whether the database change has already been
- * received).
+ * transaction aborts and ovsdb_idl_txn_commit() returns TXN_TRY_AGAIN.
  *
  * The intention is that, to ensure that no transaction commits based on dirty
  * reads, an application should call ovsdb_idl_txn_verify() on each data item
-- 
2.1.3

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


Re: [ovs-dev] [PATCH 3/3] netdev-dpdk: Don't fail vHost port creation if server mode is unavailable.

2016-09-19 Thread Daniele Di Proietto
I believe that this is not necessary anymore, since Ciara's change (which I
just applied) 2d24d165d6a5("netdev-dpdk: Add new 'dpdkvhostuserclient' port
type").

Thanks,

Daniele

2016-09-05 6:36 GMT-07:00 Ilya Maximets :

> Currently vHost client mode feature is broken in case where QEMU and OVS
> are configured to create sockets in the same place. While adding the port,
> OVS will try to register vHost driver in server mode and will fail because
> socket already exist if QEMU was started first.
>
> In this situation port will not be created and will not be reconfigured
> to client mode.
>
> To fix this let's not fail creation of vhost port if server mode is
> unavailable.
>
> Fixes: c1ff66ac80b5 ("netdev-dpdk: vHost client mode and reconnect")
> Signed-off-by: Ilya Maximets 
> ---
>  lib/netdev-dpdk.c | 173 ++
> +++-
>  1 file changed, 105 insertions(+), 68 deletions(-)
>
> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
> index be48218..2ba57d7 100644
> --- a/lib/netdev-dpdk.c
> +++ b/lib/netdev-dpdk.c
> @@ -355,6 +355,8 @@ struct netdev_dpdk {
>  /* virtio identifier for vhost devices */
>  ovsrcu_index vid;
>
> +bool vhost_driver_registered;
> +
>  /* True if vHost device is 'up' and has been reconfigured at least
> once */
>  bool vhost_reconfigured;
>
> @@ -400,7 +402,8 @@ static bool dpdk_thread_is_pmd(void);
>
>  static int netdev_dpdk_construct(struct netdev *);
>
> -int netdev_dpdk_get_vid(const struct netdev_dpdk *dev);
> +static void netdev_dpdk_vhost_clear(struct netdev_dpdk *);
> +static int netdev_dpdk_get_vid(const struct netdev_dpdk *);
>
>  struct ingress_policer *
>  netdev_dpdk_get_ingress_policer(const struct netdev_dpdk *dev);
> @@ -828,6 +831,7 @@ netdev_dpdk_init(struct netdev *netdev, unsigned int
> port_no,
>  dev->max_packet_len = MTU_TO_FRAME_LEN(dev->mtu);
>  ovsrcu_index_init(>vid, -1);
>  dev->vhost_reconfigured = false;
> +dev->vhost_driver_registered = false;
>  /* initialise vHost port in server mode */
>  dev->vhost_driver_flags &= ~RTE_VHOST_USER_CLIENT;
>
> @@ -903,6 +907,37 @@ get_vhost_id(struct netdev_dpdk *dev)
>  }
>
>  static int
> +netdev_dpdk_vhost_driver_register(struct netdev_dpdk *dev)
> +OVS_REQUIRES(dev->mutex)
> +{
> +int mode = !!(dev->vhost_driver_flags & RTE_VHOST_USER_CLIENT);
> +const char *str_mode[] = {"server", "client"};
> +const char *id = get_vhost_id(dev);
> +int err;
> +
> +if (dev->vhost_driver_registered) {
> +return 0;
> +}
> +
> +err = rte_vhost_driver_register(id, dev->vhost_driver_flags);
> +if (err) {
> +VLOG_ERR("%s: Unable to register vhost driver in %s mode using
> socket '"
> + "%s'.\n", dev->up.name, str_mode[mode], id);
> +return err;
> +}
> +
> +dev->vhost_driver_registered = true;
> +if (!mode) {
> +/* OVS server mode - add this socket to list for deletion */
> +fatal_signal_add_file_to_unlink(id);
> +}
> +VLOG_INFO("%s: vhost driver registered in %s mode using socket
> '%s'.\n",
> +  dev->up.name, str_mode[mode], id);
> +
> +return 0;
> +}
> +
> +static int
>  netdev_dpdk_vhost_construct(struct netdev *netdev)
>  {
>  struct netdev_dpdk *dev = netdev_dpdk_cast(netdev);
> @@ -924,6 +959,13 @@ netdev_dpdk_vhost_construct(struct netdev *netdev)
>  }
>
>  ovs_mutex_lock(_mutex);
> +
> +err = netdev_dpdk_init(netdev, -1, DPDK_DEV_VHOST);
> +if (err) {
> +goto out;
> +}
> +
> +ovs_mutex_lock(>mutex);
>  /* Take the name of the vhost-user port and append it to the location
> where
>   * the socket is to be created, then register the socket. Sockets are
>   * registered initially in 'server' mode.
> @@ -931,21 +973,9 @@ netdev_dpdk_vhost_construct(struct netdev *netdev)
>  snprintf(dev->vhost_server_id, sizeof dev->vhost_server_id, "%s/%s",
>   vhost_sock_dir, name);
>
> -err = rte_vhost_driver_register(dev->vhost_server_id,
> -dev->vhost_driver_flags);
> -if (err) {
> -VLOG_ERR("vhost-user socket device setup failure for socket %s\n",
> - dev->vhost_server_id);
> -} else {
> -if (!(dev->vhost_driver_flags & RTE_VHOST_USER_CLIENT)) {
> -/* OVS server mode - add this socket to list for deletion */
> -fatal_signal_add_file_to_unlink(dev->vhost_server_id);
> -VLOG_INFO("Socket %s created for vhost-user port %s\n",
> -  dev->vhost_server_id, name);
> -}
> -err = netdev_dpdk_init(netdev, -1, DPDK_DEV_VHOST);
> -}
> -
> +netdev_dpdk_vhost_driver_register(dev);
> +ovs_mutex_unlock(>mutex);
> +out:
>  ovs_mutex_unlock(_mutex);
>  return err;
>  }
> @@ -978,6 +1008,9 @@ netdev_dpdk_destruct(struct netdev *netdev)
>  struct netdev_dpdk *dev = 

Re: [ovs-dev] [PATCH 1/3] netdev-dpdk: Fix memory leak in dpdk_mp_{get, put}().

2016-09-19 Thread Daniele Di Proietto
Thanks, I simplified it slightly and applied this to master and branch-2.6

2016-09-05 6:36 GMT-07:00 Ilya Maximets :

> 'dmp' should be freed on failure and on put.
>
> Fixes: 8a9562d21a40 ("dpif-netdev: Add DPDK netdev.")
> Fixes: 8d38823bdf8b ("netdev-dpdk: fix memory leak")
> Signed-off-by: Ilya Maximets 
> ---
>  lib/netdev-dpdk.c | 13 ++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
> index 6d334db..f7a6f82 100644
> --- a/lib/netdev-dpdk.c
> +++ b/lib/netdev-dpdk.c
> @@ -474,7 +474,7 @@ dpdk_mp_get(int socket_id, int mtu)
> OVS_REQUIRES(dpdk_mutex)
>  LIST_FOR_EACH (dmp, list_node, _mp_list) {
>  if (dmp->socket_id == socket_id && dmp->mtu == mtu) {
>  dmp->refcount++;
> -return dmp;
> +goto out;
>  }
>  }
>
> @@ -499,7 +499,7 @@ dpdk_mp_get(int socket_id, int mtu)
> OVS_REQUIRES(dpdk_mutex)
>  do {
>  if (snprintf(mp_name, RTE_MEMPOOL_NAMESIZE, "ovs_mp_%d_%d_%u",
>   dmp->mtu, dmp->socket_id, mp_size) < 0) {
> -return NULL;
> +goto fail;
>  }
>
>  dmp->mp = rte_mempool_create(mp_name, mp_size, MBUF_SIZE(mtu),
> @@ -511,12 +511,18 @@ dpdk_mp_get(int socket_id, int mtu)
> OVS_REQUIRES(dpdk_mutex)
>  } while (!dmp->mp && rte_errno == ENOMEM && (mp_size /= 2) >=
> MIN_NB_MBUF);
>
>  if (dmp->mp == NULL) {
> -return NULL;
> +goto fail;
>  } else {
>  VLOG_DBG("Allocated \"%s\" mempool with %u mbufs", mp_name,
> mp_size );
>  }
>
>  ovs_list_push_back(_mp_list, >list_node);
> +goto out;
> +
> +fail:
> +rte_free(dmp);
> +dmp = NULL;
> +out:
>  return dmp;
>  }
>
> @@ -532,6 +538,7 @@ dpdk_mp_put(struct dpdk_mp *dmp)
> OVS_REQUIRES(dpdk_mutex)
>  if (!--dmp->refcount) {
>  ovs_list_remove(>list_node);
>  rte_mempool_free(dmp->mp);
> +rte_free(dmp);
>  }
>  }
>
> --
> 2.7.4
>
> ___
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH] ovn-vtep: fix arping from vtep-gw physical port

2016-09-19 Thread Ramu Ramamurthy
Currently, arping from a vetp-gw physical-switch port to
a VIF IP address does not work.

When a physical-switch-port arps for an IP address
of a VIF, that arp packet comes into the VIF hypervisor via a
vxlan tunnel. That arp packet must not be responded-to by the
arp responder table. Its treatment must be similar to the
arps coming in from the localnet port - which is to
skip the arp responder table.

Signed-off-by: Ramu Ramamurthy 
---
 ovn/northd/ovn-northd.8.xml | 3 ++-
 ovn/northd/ovn-northd.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/ovn/northd/ovn-northd.8.xml b/ovn/northd/ovn-northd.8.xml
index 307e8be..d6dc860 100644
--- a/ovn/northd/ovn-northd.8.xml
+++ b/ovn/northd/ovn-northd.8.xml
@@ -422,7 +422,8 @@
 
   
 Priority-100 flows to skip ARP responder if inport is of type
-localnet, and advances directly to the next table.
+localnet or vtep, and advances directly to
+the next table.
   
 
   
diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c
index 5ccb516..ebbc18a 100644
--- a/ovn/northd/ovn-northd.c
+++ b/ovn/northd/ovn-northd.c
@@ -2669,7 +2669,8 @@ build_lswitch_flows(struct hmap *datapaths, struct hmap 
*ports,
 continue;
 }
 
-if (!strcmp(op->nbsp->type, "localnet")) {
+if (!strcmp(op->nbsp->type, "localnet")
+|| !strcmp(op->nbsp->type, "vtep")) {
 ds_clear();
 ds_put_format(, "inport == %s", op->json_key);
 ovn_lflow_add(lflows, op->od, S_SWITCH_IN_ARP_ND_RSP, 100,
-- 
1.9.1

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


Re: [ovs-dev] [PATCH v2] netdev-dpdk: Add new 'dpdkvhostuserclient' port type

2016-09-19 Thread Daniele Di Proietto
Apologies for the delay, applied to master and branch-2.6

Thanks,

Daniele

2016-09-15 6:53 GMT-07:00 Mooney, Sean K :

> Hi I just wanted to follow up on the status of this patch.
>
> Without this patch support for vhost user reconnect will be blocked in
> openstack.
>
> At this point It is now too late to include support for this feature in
> the newton release
> In q4 but I would like to enable it early in the Openstack Ocata cycle if
> possible.
>
> Will this be in ovs 2.6?
> Regard
> sean
>
>
> > -Original Message-
> > From: Mooney, Sean K
> > Sent: Saturday, August 20, 2016 12:22 AM
> > To: Loftus, Ciara ; dev@openvswitch.org
> > Cc: diproiet...@vmware.com; Mooney, Sean K 
> > Subject: RE: [PATCH v2] netdev-dpdk: Add new 'dpdkvhostuserclient' port
> > type
> >
> > Hi I have updated my openstack changes
> > https://review.openstack.org/#/c/344997/ (neutron)
> > https://review.openstack.org/#/c/357555/  (os-vif)
> > https://review.openstack.org/#/c/334048/ (nova) to work with this
> > change and tested it with the v1 patch.
> > As far as I can tell the only change in v2 is in the install.dpdk-
> > advanced and Commit message but I can retest with v2 also if desired.
> >
> > Time permitting assuming this change is accepted I will also submit a
> > patch to networking-ovn And networking-odl Next week to complete
> > enabling the feature in each of the Main ovs compatible neutron
> > backends.
> >
> > > -Original Message-
> > > From: Loftus, Ciara
> > > Sent: Friday, August 19, 2016 10:23 AM
> > > To: dev@openvswitch.org
> > > Cc: diproiet...@vmware.com; Mooney, Sean K ;
> > > Loftus, Ciara 
> > > Subject: [PATCH v2] netdev-dpdk: Add new 'dpdkvhostuserclient' port
> > > type
> > >
> > > The 'dpdkvhostuser' port type no longer supports both server and
> > > client mode. Instead, 'dpdkvhostuser' ports are always 'server' mode
> > > and 'dpdkvhostuserclient' ports are always 'client' mode.
> > >
> > > Suggested-by: Daniele Di Proietto 
> > > Signed-off-by: Ciara Loftus 
> > > ---
> > >  INSTALL.DPDK-ADVANCED.md | 102 +++
> > >  NEWS |   1 +
> > >  lib/netdev-dpdk.c| 176 ++---
> > --
> > > 
> > >  vswitchd/vswitch.xml |   8 +--
> > >  4 files changed, 159 insertions(+), 128 deletions(-)
> > >
> > > diff --git a/INSTALL.DPDK-ADVANCED.md b/INSTALL.DPDK-ADVANCED.md
> > index
> > > 857c805..d7b9873 100755
> > > --- a/INSTALL.DPDK-ADVANCED.md
> > > +++ b/INSTALL.DPDK-ADVANCED.md
> > > @@ -461,6 +461,21 @@ For users wanting to do packet forwarding using
> > > kernel stack below are the steps
> > >   ```
> > >
> > >  ##  6. Vhost Walkthrough
> > > +
> > > +Two types of vHost User ports are available in OVS:
> > > +
> > > +1. vhost-user (dpdkvhostuser ports)
> > > +
> > > +2. vhost-user-client (dpdkvhostuserclient ports)
> > > +
> > > +vHost User uses a client-server model. The server
> > > +creates/manages/destroys the vHost User sockets, and the client
> > > +connects to the server. Depending on which port type you use,
> > > +dpdkvhostuser or dpdkvhostuserclient, a different configuration of
> > > +the
> > > client-server model is used.
> > > +
> > > +For vhost-user ports, OVS DPDK acts as the server and QEMU the
> > client.
> > > +For vhost-user-client ports, OVS DPDK acts as the client and QEMU
> > the
> > > server.
> > > +
> > >  ### 6.1 vhost-user
> > >
> > >- Prerequisites:
> > > @@ -570,49 +585,6 @@ For users wanting to do packet forwarding using
> > > kernel stack below are the steps
> > > where `-L`: Changes the numbers of channels of the specified
> > > network device
> > > and `combined`: Changes the number of multi-purpose channels.
> > >
> > > -4. OVS vHost client-mode & vHost reconnect (OPTIONAL)
> > > -
> > > -   By default, OVS DPDK acts as the vHost socket server for
> > > dpdkvhostuser
> > > -   ports and QEMU acts as the vHost client. This means OVS
> > creates
> > > and
> > > -   manages the vHost socket and QEMU is the client which
> > connects
> > > to the
> > > -   vHost server (OVS). In QEMU v2.7 the option is available for
> > > QEMU to act
> > > -   as the vHost server meaning the roles can be reversed and OVS
> > > can become
> > > -   the vHost client. To enable client mode for a given
> > > dpdkvhostuserport,
> > > -   one must specify a valid 'vhost-server-path' like so:
> > > -
> > > -   ```
> > > -   ovs-vsctl set Interface dpdkvhostuser0 options:vhost-server-
> > > path=/path/to/socket
> > > -   ```
> > > -
> > > -   Setting this value automatically switches the port to client
> > > mode (from
> > > -   OVS' perspective). 'vhost-server-path' reflects the full path
> > > of the
> > > -   socket that has been or will be 

Re: [ovs-dev] [PATCH] ovn-ctl: Initialize the databases.

2016-09-19 Thread Guru Shetty
On 19 September 2016 at 11:33, Ben Pfaff  wrote:

> On Mon, Sep 19, 2016 at 11:18:20AM -0700, Guru Shetty wrote:
> > On 19 September 2016 at 11:08, Ben Pfaff  wrote:
> >
> > > On Sun, Sep 18, 2016 at 11:26:52PM -0700, Gurucharan Shetty wrote:
> > > > Without initializing the databases, commands of the form
> > > > 'ovn-nbctl --wait=sb ls-add ls0' will simply hang.
> > > >
> > > > Signed-off-by: Gurucharan Shetty 
> > >
> > > It's better if the separate initialization step is optional.
> >
> > We do this everytime for OVS in do_start_ovsdb of utilities/ovs-ctl.in
> with:
> > ovs_vsctl -- init -- set Open_vSwitch . db-version="$schemaver"
> >
> > Is there a subtlety here?
>
> Setting the db-version isn't something that happens automatically, but
> the ovs-vsctl "init" command is a no-op, literally an empty function,
> because do_vsctl() always does what it would do:
>
> ovs = ovsrec_open_vswitch_first(idl);
> if (!ovs) {
> /* XXX add verification that table is empty */
> ovs = ovsrec_open_vswitch_insert(txn);
> }
>
> So the first call to ovs-vsctl, regardless of what command it is, should
> initialize the database enough for everything else to work.
>
> It looks to me like ovn-sbctl and ovn-nbctl are the same way.
>
> (Don't get me wrong, I think it's better if the databases are
> initialized explicitly.  But I also think it's nice if stuff doesn't
> hang if, for example, a database gets blanked out through data loss or
> admin mistake.)
>
> > >   I think
> > > that ovn-nbctl and ovn-sbctl should be initializing the databases
> > > automatically when any command runs, if they are not already
> > > initialized; that's what ovs-vsctl does, at least.  Is that missing?
> > >
> >
> > It does initialize when a command is run. But no-one runs ovn-sbctl
> > commands right (unless for debugging)?. So any ovn-nbctl command that is
> > run with --wait=sb will hang.
>
> I see.
>
> I think that we can make ovn-northd do the initialization too.  It's
> pretty trivial: just create an {NB,SB}_Global record if there's none at
> the moment.  Then if the databases get cleared, the system recovers.
>
> So: I think that we should initialize the databases, but I also think
> that ovn-northd should be capable of it too.
>

I think I understand what you are saying. I sent a v2 based on that.


> ___
> 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 v2] ovn: Initialize the databases.

2016-09-19 Thread Gurucharan Shetty
Without initializing the databases, commands of the form
'ovn-nbctl --wait=sb ls-add ls0' will simply hang.

Signed-off-by: Gurucharan Shetty 
---
 ovn/northd/ovn-northd.c | 10 +++---
 ovn/utilities/ovn-ctl   |  2 ++
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c
index a91e1f8..a30b4b4 100644
--- a/ovn/northd/ovn-northd.c
+++ b/ovn/northd/ovn-northd.c
@@ -4263,11 +4263,15 @@ ovnnb_db_run(struct northd_context *ctx, struct 
ovsdb_idl_loop *sb_loop)
  *
  * Also set up to update sb_cfg once our southbound transaction commits. */
 const struct nbrec_nb_global *nb = nbrec_nb_global_first(ctx->ovnnb_idl);
+if (!nb) {
+nb = nbrec_nb_global_insert(ctx->ovnnb_txn);
+}
 const struct sbrec_sb_global *sb = sbrec_sb_global_first(ctx->ovnsb_idl);
-if (nb && sb) {
-sbrec_sb_global_set_nb_cfg(sb, nb->nb_cfg);
-sb_loop->next_cfg = nb->nb_cfg;
+if (!sb) {
+sb = sbrec_sb_global_insert(ctx->ovnsb_txn);
 }
+sbrec_sb_global_set_nb_cfg(sb, nb->nb_cfg);
+sb_loop->next_cfg = nb->nb_cfg;
 
 cleanup_macam();
 }
diff --git a/ovn/utilities/ovn-ctl b/ovn/utilities/ovn-ctl
index 07bff8a..8544d14 100755
--- a/ovn/utilities/ovn-ctl
+++ b/ovn/utilities/ovn-ctl
@@ -55,6 +55,7 @@ start_ovsdb () {
 set "$@" --detach --monitor $OVN_NB_LOG --log-file=$OVN_NB_LOGFILE 
--remote=punix:$DB_NB_SOCK --remote=ptcp:$DB_NB_PORT:$DB_NB_ADDR 
--pidfile=$DB_NB_PID --unixctl=ovnnb_db.ctl
 
 $@ $DB_NB_FILE
+ovn-nbctl init
 fi
 
 # Check and eventually start ovsdb-server for Southbound DB
@@ -65,6 +66,7 @@ start_ovsdb () {
 
 set "$@" --detach --monitor $OVN_SB_LOG --log-file=$OVN_SB_LOGFILE 
--remote=punix:$DB_SB_SOCK --remote=ptcp:$DB_SB_PORT:$DB_SB_ADDR 
--pidfile=$DB_SB_PID --unixctl=ovnsb_db.ctl
 $@ $DB_SB_FILE
+ovn-sbctl init
 fi
 }
 
-- 
1.9.1

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


Re: [ovs-dev] [PATCH v7] ovn-nbctl: Add LB commands.

2016-09-19 Thread Guru Shetty
On 19 September 2016 at 09:38, nickcooper-zhangtonghao <
nickcooper-zhangtong...@opencloud.tech> wrote:

> This patch provides the command line to create a load balancer.
> You can create a load balancer independently and add it to multiple
> switches or routers. A single load balancer can have multiple vips.
> Add a name column for the load balancer. With --add-duplicate,
> the command really creates a new load balancer with a duplicate name.
> This name has no special meaning or purpose other than to provide
> convenience for human interaction with the ovn-nb database.
> This patch also provides the unit tests and the documentation.
>
> Signed-off-by: nickcooper-zhangtonghao  opencloud.tech>
>

You should run your ./configure with ---enable-Werror option and you will
not miss any warnings as they are treated as errors.

For the case wherein the LB VIP is just a IP address, you should not
automatically give it a protocol.  The code does not look at protocol when
there are no L4 ports (as explained in ovn-nb documentation).  There are a
few lines in ovn-nbctl that exceed 78 characters. You can add the following
incremental to fix them (along with the compilation error). The incremental
does not fix the problem of automatic protocol allocation when no port is
given.



diff --git a/ovn/utilities/ovn-nbctl.8.xml b/ovn/utilities/ovn-nbctl.8.xml
index bdccc23..991ecea 100644
--- a/ovn/utilities/ovn-nbctl.8.xml
+++ b/ovn/utilities/ovn-nbctl.8.xml
@@ -478,9 +478,9 @@

   ls-lb-list switch [lb]
   
-Lists the LBs.  If switch is supplied, all the LBs from
-the logical switch are listed.  If lb is also specified,
-only the lb will be listed from the logical switch.
+Lists the LBs for the given switch.  If lb is
+also specified, only the lb will be listed from the
logical
+switch.
   

   [--may-exist] lr-lb-add
router lb
@@ -502,9 +502,9 @@

   lr-lb-list router [lb]
   
-Lists the LBs.  If router is supplied, all the LBs from
-the logical router are listed. If lb is also specified,
-then only the lb will be listed from the logical router.
+Lists the LBs for the given router.  If lb is
+also specified, then only the lb will be listed from the
+logical router.
   
 

diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c
index f47070f..2541ac5 100644
--- a/ovn/utilities/ovn-nbctl.c
+++ b/ovn/utilities/ovn-nbctl.c
@@ -386,8 +386,10 @@ Route commands:\n\
 \n\
 LB commands:\n\
   lb-add LB VIP[:PORT] IP[:PORT]... [PROTOCOL]\n\
-add a load-balancer or VIP to load balancer\n\
-  lb-del LB [VIP]   remove a load-balancer or VIP from load
balancer\n\
+create a load-balancer or add a VIP to an\n\
+existing load balancer\n\
+  lb-del LB [VIP]   remove a load-balancer or just the VIP from\n\
+the load balancer\n\
   lb-list [LB]  print load-balancers\n\
   lr-lb-add ROUTER LB   add a load-balancer to ROUTER\n\
   lr-lb-del ROUTER [LB] remove load-balancers from ROUTER\n\
@@ -1381,7 +1383,8 @@ nbctl_lb_add(struct ctl_context *ctx)
 lb_proto = ctx->argv[4];
 is_update_proto = true;
 if (strcmp(lb_proto, "tcp") && strcmp(lb_proto, "udp")) {
-ctl_fatal("%s: protocol must be one of \"tcp\", \"udp\".",
lb_proto);
+ctl_fatal("%s: protocol must be one of \"tcp\", \"udp\".",
+  lb_proto);
 }
 }

@@ -1391,13 +1394,15 @@ nbctl_lb_add(struct ctl_context *ctx)
 if (lb) {
 if (smap_get(>vips, lb_vip)) {
 if (!may_exist) {
-ctl_fatal("%s: a load balancer with this vip (%s)
already exists", lb_name, lb_vip);
+ctl_fatal("%s: a load balancer with this vip (%s)
already "
+  "exists", lb_name, lb_vip);
 }
 /* Update the vips. */
-smap_replace(CONST_CAST(struct smap * ,>vips), lb_vip,
lb_ips);
+smap_replace(CONST_CAST(struct smap *, >vips), lb_vip,
+ lb_ips);
 } else {
 /* Add the new vips. */
-smap_add(CONST_CAST(struct smap * ,>vips), lb_vip,
lb_ips);
+smap_add(CONST_CAST(struct smap *, >vips), lb_vip,
lb_ips);
 }

 /* Update the load balancer. */
@@ -1481,7 +1486,7 @@ nbctl_lb_list_router(struct ctl_context *ctx, struct
smap *lbs,
 node->key,
 node->value);
 } else {
-ds_put_format(,"\n%49s %-8s %-20s %s",
+ds_put_format(, "\n%49s %-8s %-20s %s",
 "",
 lb->protocol,
 node->key,
@@ -1490,7 

Re: [ovs-dev] [PATCH v7] ovn-nbctl: Add LB commands.

2016-09-19 Thread Guru Shetty
On 19 September 2016 at 09:38, nickcooper-zhangtonghao <
nickcooper-zhangtong...@opencloud.tech> wrote:

> This patch provides the command line to create a load balancer.
> You can create a load balancer independently and add it to multiple
> switches or routers. A single load balancer can have multiple vips.
> Add a name column for the load balancer. With --add-duplicate,
> the command really creates a new load balancer with a duplicate name.
> This name has no special meaning or purpose other than to provide
> convenience for human interaction with the ovn-nb database.
> This patch also provides the unit tests and the documentation.
>
> Signed-off-by: nickcooper-zhangtonghao  opencloud.tech>
>

I also forgot to mention that only 8 characters for LB name when you do a
"lb-list" looks aggressive. I suggest increasing it to atleast 16
characters.


> ---
>  ovn/ovn-nb.ovsschema  |   5 +-
>  ovn/ovn-nb.xml|   6 +
>  ovn/utilities/ovn-nbctl.8.xml | 109 +
>  ovn/utilities/ovn-nbctl.c | 514 ++
> +++-
>  tests/ovn-nbctl.at| 167 ++
>  5 files changed, 798 insertions(+), 3 deletions(-)
>
> diff --git a/ovn/ovn-nb.ovsschema b/ovn/ovn-nb.ovsschema
> index b7e70aa..5f2f2bf 100644
> --- a/ovn/ovn-nb.ovsschema
> +++ b/ovn/ovn-nb.ovsschema
> @@ -1,7 +1,7 @@
>  {
>  "name": "OVN_Northbound",
> -"version": "5.3.3",
> -"cksum": "2442952958 9945",
> +"version": "5.3.4",
> +"cksum": "1155817817 9975",
>  "tables": {
>  "NB_Global": {
>  "columns": {
> @@ -97,6 +97,7 @@
>  "isRoot": true},
>  "Load_Balancer": {
>  "columns": {
> +   "name": {"type": "string"},
>  "vips": {
>  "type": {"key": "string", "value": "string",
>   "min": 0, "max": "unlimited"}},
> diff --git a/ovn/ovn-nb.xml b/ovn/ovn-nb.xml
> index c45a444..b7690d0 100644
> --- a/ovn/ovn-nb.xml
> +++ b/ovn/ovn-nb.xml
> @@ -676,6 +676,12 @@
>Each row represents one load balancer.
>  
>
> +
> +  A name for the load balancer.  This name has no special meaning or
> +  purpose other than to provide convenience for human interaction with
> +  the ovn-nb database.
> +
> +
>  
>
>  A map of virtual IPv4 addresses (and an optional port number with
> diff --git a/ovn/utilities/ovn-nbctl.8.xml b/ovn/utilities/ovn-nbctl.8.xml
> index 76cf97e..bdccc23 100644
> --- a/ovn/utilities/ovn-nbctl.8.xml
> +++ b/ovn/utilities/ovn-nbctl.8.xml
> @@ -400,6 +400,115 @@
>
>  
>
> +Load Balancer Commands
> +
> +  [--may-exist | --add-duplicate]
> lb-add lb vip ips
> [protocol]
> +  
> +
> + Creates a new load balancer named lb with the provided
> + vip and ips or adds the vip to
> + an existing lb.  vip should be a
> + virtual IPv4 address (or an IPv4 address and a port number with
> + : as a separator).  Examples for vip are
> + 192.168.1.4 and 192.168.1.5:8080.
> + ips should be comma separated IPv4 endpoints (or comma
> + separated IPv4 addresses and port numbers with : as
> a
> + separator).  Examples for ips are
> 10.0.0.1,10.0.0.2
> + or 20.0.0.10:8800,20.0.0.11:8800.
> +
> +
> +
> + The optional argument protocol must be either
> + tcp or udp.  This argument is useful
> when
> + a port number is provided as part of the vip.  If the
> + protocol is unspecified and a port number is provided
> as
> + part of the vip, OVN assumes the protocol
> to
> + be tcp.
> +
> +
> +
> + It is an error if the vip already exists in the load
> + balancer named lb, unless --may-exist is
> + specified.  With --add-duplicate, the command really
> + creates a new load balancer with a duplicate name.
> +
> +
> +
> + The following example adds a load balancer.
> +
> +
> +
> + lb-add lb0 30.0.0.10:80
> + 192.168.10.10:80,192.168.10.20:80,192.168.10.30:80 udp
> +
> +  
> +
> +  [--if-exists] lb-del lb
> [vip]
> +  
> +Deletes lb or the vip from lb.
> +If vip is supplied, only the vip will be
> +deleted from the lb.  If only the lb is
> supplied,
> +the lb will be deleted.  It is an error if
> vip
> +does not already exist in lb, unless
> +--if-exists is specified.
> +  
> +
> +  lb-list [lb]
> +  
> +Lists the LBs.  If lb is also specified, then only the
> +specified lb will be listed.
> +  
> +
> +  [--may-exist] ls-lb-add
> switch lb
> +  
> +Adds the specified lb to switch.
> +It is an error if a load balancer named lb already
> exists
> +in the switch, unless --may-exist is
> 

[ovs-dev] [PATCH 2/2] vagrant: use RECHECK=yes for system checks

2016-09-19 Thread Thadeu Lima de Souza Cascardo
Use RECHECK=yes for both kernel and userspace datapath tests.

Signed-off-by: Thadeu Lima de Souza Cascardo 
---
 Vagrantfile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Vagrantfile b/Vagrantfile
index 11bd048..91f943d 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -47,7 +47,7 @@ SCRIPT
 
 $test_kmod = 

[ovs-dev] [PATCH 1/2] vagrant: cleanup before building

2016-09-19 Thread Thadeu Lima de Souza Cascardo
Clean the source directory before building, otherwise, build might fail if it
has been configured already.

Signed-off-by: Thadeu Lima de Souza Cascardo 
---
 Vagrantfile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Vagrantfile b/Vagrantfile
index 72f224c..11bd048 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -33,6 +33,8 @@ SCRIPT
 $configure_ovs = 

[ovs-dev] FW: payment transfer

2016-09-19 Thread Mega Exchange service

Good day

Transfer has been made to you on request of our customer.
Find attached bank slip.



:15A SENDER'S REFERENCE
11044TRF12008119
:21B BANK OPERATION CODE
CRED
:32A CURRENCY/INTERBANK SETTLEMENT
140927 US53,744,64
:33B CURRENCY/USD INSTRUCTED

:001 ORDERING CUSTOMER
/AL362131104400933729
W.T.M


Mega Millions bureau de change
Money Exchange and transfer services
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH] ovn-ctl: Initialize the databases.

2016-09-19 Thread Ben Pfaff
On Mon, Sep 19, 2016 at 11:18:20AM -0700, Guru Shetty wrote:
> On 19 September 2016 at 11:08, Ben Pfaff  wrote:
> 
> > On Sun, Sep 18, 2016 at 11:26:52PM -0700, Gurucharan Shetty wrote:
> > > Without initializing the databases, commands of the form
> > > 'ovn-nbctl --wait=sb ls-add ls0' will simply hang.
> > >
> > > Signed-off-by: Gurucharan Shetty 
> >
> > It's better if the separate initialization step is optional.
> 
> We do this everytime for OVS in do_start_ovsdb of utilities/ovs-ctl.in with:
> ovs_vsctl -- init -- set Open_vSwitch . db-version="$schemaver"
> 
> Is there a subtlety here?

Setting the db-version isn't something that happens automatically, but
the ovs-vsctl "init" command is a no-op, literally an empty function,
because do_vsctl() always does what it would do:

ovs = ovsrec_open_vswitch_first(idl);
if (!ovs) {
/* XXX add verification that table is empty */
ovs = ovsrec_open_vswitch_insert(txn);
}

So the first call to ovs-vsctl, regardless of what command it is, should
initialize the database enough for everything else to work.

It looks to me like ovn-sbctl and ovn-nbctl are the same way.

(Don't get me wrong, I think it's better if the databases are
initialized explicitly.  But I also think it's nice if stuff doesn't
hang if, for example, a database gets blanked out through data loss or
admin mistake.)

> >   I think
> > that ovn-nbctl and ovn-sbctl should be initializing the databases
> > automatically when any command runs, if they are not already
> > initialized; that's what ovs-vsctl does, at least.  Is that missing?
> >
> 
> It does initialize when a command is run. But no-one runs ovn-sbctl
> commands right (unless for debugging)?. So any ovn-nbctl command that is
> run with --wait=sb will hang.

I see.

I think that we can make ovn-northd do the initialization too.  It's
pretty trivial: just create an {NB,SB}_Global record if there's none at
the moment.  Then if the databases get cleared, the system recovers.

So: I think that we should initialize the databases, but I also think
that ovn-northd should be capable of it too.
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] Registration Open for OVS Fall 2016 Conference

2016-09-19 Thread Justin Pettit
The Open vSwitch team will host our third annual conference focused on Open 
vSwitch and OVN on Nov. 7 and 8, 2016, to be held at the San Jose Doubletree.  
The Call for Participation is still open, but talks will likely include:

- New stateful services for OVS
- Deploying OVN at scale
- Support for new platforms
- The future of OVS and OVN
- Programmable software-based networking

This is the first OVS conference that will be run as part of the Linux 
Foundation.  Registration may be done at the following URL:

  https://events.linuxfoundation.org/events/open-vswitch-2016-fall-conference

The two-day event is $200 and will include breakfast, lunch and coffee breaks.  
Room for the event is limited, so please register early.  Talks will be 
recorded and will be made available after the conference. 


How to propose a talk
-
We've extended the proposal deadline for talks and panels on topics related to 
Open vSwitch.

Please submit proposals to to the following URL by Friday, September 23:

  https://goo.gl/forms/hX3xSwfaUXCuqFCq2

Speakers will be notified of acceptance by October 3.

Speakers should plan to attend the event in person.  Travel to and 
accommodations in San Jose are the responsibility of attendees.  The conference 
fee will be waived for speakers with accepted talks.


More information

For more information, please visit the event page at:

  https://events.linuxfoundation.org/events/open-vswitch-2016-fall-conference

To reach the organizers, email ovs...@openvswitch.org.  For general discussion 
of the conference, please use the ovs-discuss mailing list at 
disc...@openvswitch.org.


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


Re: [ovs-dev] [PATCH] ovn-ctl: Initialize the databases.

2016-09-19 Thread Guru Shetty
On 19 September 2016 at 11:08, Ben Pfaff  wrote:

> On Sun, Sep 18, 2016 at 11:26:52PM -0700, Gurucharan Shetty wrote:
> > Without initializing the databases, commands of the form
> > 'ovn-nbctl --wait=sb ls-add ls0' will simply hang.
> >
> > Signed-off-by: Gurucharan Shetty 
>
> It's better if the separate initialization step is optional.

We do this everytime for OVS in do_start_ovsdb of utilities/ovs-ctl.in with:
ovs_vsctl -- init -- set Open_vSwitch . db-version="$schemaver"

Is there a subtlety here?



>   I think
> that ovn-nbctl and ovn-sbctl should be initializing the databases
> automatically when any command runs, if they are not already
> initialized; that's what ovs-vsctl does, at least.  Is that missing?
>

It does initialize when a command is run. But no-one runs ovn-sbctl
commands right (unless for debugging)?. So any ovn-nbctl command that is
run with --wait=sb will hang.
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH] NEWS: Add known issues for v2.6.0.

2016-09-19 Thread Ben Pfaff
On Thu, Sep 15, 2016 at 04:26:05PM -0700, Joe Stringer wrote:
> Signed-off-by: Joe Stringer 

...

> + * When using the openvswitch module distributed with OVS against kernel
> +   versions 4.4-4.6, the openvswitch module cannot be loaded or used at 
> the
> +   same time as "ip_gre".

Would you mind writing "4.4 to 4.6" instead of "4.4-4.6"?  There are
kernel versions with hyphens in them (even cited later in your note) and
at first this looked like a single version to me.

The following is an editorial ack; I can't speak for this note
technically.

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


Re: [ovs-dev] [PATCH] ovsdb: monitor - Replace tabs with spaces

2016-09-19 Thread Ben Pfaff
On Fri, Sep 16, 2016 at 12:51:49AM +, Alin Serdean wrote:
> Found by inspection.
> 
> Signed-off-by: Alin Gabriel Serdean 

Thanks, applied to master.
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH] ovn-ctl: Initialize the databases.

2016-09-19 Thread Ben Pfaff
On Sun, Sep 18, 2016 at 11:26:52PM -0700, Gurucharan Shetty wrote:
> Without initializing the databases, commands of the form
> 'ovn-nbctl --wait=sb ls-add ls0' will simply hang.
> 
> Signed-off-by: Gurucharan Shetty 

It's better if the separate initialization step is optional.  I think
that ovn-nbctl and ovn-sbctl should be initializing the databases
automatically when any command runs, if they are not already
initialized; that's what ovs-vsctl does, at least.  Is that missing?
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH v2 rebase] tun-metadata: Manage tunnel TLV mapping table on a per-bridge basis.

2016-09-19 Thread Jesse Gross
On Mon, Sep 19, 2016 at 8:48 AM, Ben Pfaff  wrote:
> On Thu, Sep 15, 2016 at 09:28:37AM -0700, Jesse Gross wrote:
>> When using tunnel TLVs (at the moment, this means Geneve options), a
>> controller must first map the class and type onto an appropriate OXM
>> field so that it can be used in OVS flow operations. This table is
>> managed using OpenFlow extensions.
>>
>> The original code that added support for TLVs made the mapping table
>> global as a simplification. However, this is not really logically
>> correct as the OpenFlow management commands are operating on a per-bridge
>> basis. This removes the original limitation to make the table per-bridge.
>>
>> One nice result of this change is that it is generally clearer whether
>> the tunnel metadata is in datapath or OpenFlow format. Rather than
>> allowing ad-hoc format changes and trying to handle both formats in the
>> tunnel metadata functions, the format is more clearly separated by function.
>> Datapaths (both kernel and userspace) use datapath format and it is not
>> changed during the upcall process. At the beginning of action translation,
>> tunnel metadata is converted to OpenFlow format and flows and wildcards
>> are translated back at the end of the process.
>>
>> As an additional benefit, this change improves performance in some flow
>> setup situations by keeping the tunnel metadata in the original packet
>> format in more cases. This helps when copies need to be made as the amount
>> of data touched is only what is present in the packet rather than the
>> maximum amount of metadata supported.
>>
>> Co-authored-by: Madhu Challa 
>> Signed-off-by: Madhu Challa 
>> Signed-off-by: Jesse Gross 
>> ---
>> This is a rebased version of the previously posted patch which no longer
>> applies cleanly.
>>
>> v2: Pass 'struct tun_table' instead of 'struct ofproto' for functions that
>> need to access tunnel metadata.
>
> Thanks a lot Jesse.  I like this much better and, surprisingly, it
> yields a net reduction in code.
>
> I think that this should update NEWS to reflect the new feature.
>
> This appears to cause a new test failure:
> 2235: ovn -- 3 HVs, 1 VIFs/HV, 1 software GW, 1 LSFAILED (ovn.at:1942)
>
> I couldn't immediately figure out why.  With the patch this test seems
> to fail consistently (10 failures out of 10) and without it it succeeds
> (0 failures out of 10).
>
> If you can figure something out there,
> Acked-by: Ben Pfaff 

The test failure is the result of a silent merge conflict after the
patch was sent out introduced by "ofproto-dpif-xlate: Fix treatment of
mirrors across patch port.". That patch moved the initialization of a
variable to after some new code that was added by this patch.

I fixed that up, added an item to NEWS and applied this to master.

Thanks for reviewing it!
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH v7] ovn-nbctl: Add LB commands.

2016-09-19 Thread nickcooper-zhangtonghao
This patch provides the command line to create a load balancer.
You can create a load balancer independently and add it to multiple
switches or routers. A single load balancer can have multiple vips.
Add a name column for the load balancer. With --add-duplicate,
the command really creates a new load balancer with a duplicate name.
This name has no special meaning or purpose other than to provide
convenience for human interaction with the ovn-nb database.
This patch also provides the unit tests and the documentation.

Signed-off-by: nickcooper-zhangtonghao 
---
 ovn/ovn-nb.ovsschema  |   5 +-
 ovn/ovn-nb.xml|   6 +
 ovn/utilities/ovn-nbctl.8.xml | 109 +
 ovn/utilities/ovn-nbctl.c | 514 +-
 tests/ovn-nbctl.at| 167 ++
 5 files changed, 798 insertions(+), 3 deletions(-)

diff --git a/ovn/ovn-nb.ovsschema b/ovn/ovn-nb.ovsschema
index b7e70aa..5f2f2bf 100644
--- a/ovn/ovn-nb.ovsschema
+++ b/ovn/ovn-nb.ovsschema
@@ -1,7 +1,7 @@
 {
 "name": "OVN_Northbound",
-"version": "5.3.3",
-"cksum": "2442952958 9945",
+"version": "5.3.4",
+"cksum": "1155817817 9975",
 "tables": {
 "NB_Global": {
 "columns": {
@@ -97,6 +97,7 @@
 "isRoot": true},
 "Load_Balancer": {
 "columns": {
+   "name": {"type": "string"},
 "vips": {
 "type": {"key": "string", "value": "string",
  "min": 0, "max": "unlimited"}},
diff --git a/ovn/ovn-nb.xml b/ovn/ovn-nb.xml
index c45a444..b7690d0 100644
--- a/ovn/ovn-nb.xml
+++ b/ovn/ovn-nb.xml
@@ -676,6 +676,12 @@
   Each row represents one load balancer.
 
 
+
+  A name for the load balancer.  This name has no special meaning or
+  purpose other than to provide convenience for human interaction with
+  the ovn-nb database.
+
+
 
   
 A map of virtual IPv4 addresses (and an optional port number with
diff --git a/ovn/utilities/ovn-nbctl.8.xml b/ovn/utilities/ovn-nbctl.8.xml
index 76cf97e..bdccc23 100644
--- a/ovn/utilities/ovn-nbctl.8.xml
+++ b/ovn/utilities/ovn-nbctl.8.xml
@@ -400,6 +400,115 @@
   
 
 
+Load Balancer Commands
+
+  [--may-exist | --add-duplicate] 
lb-add lb vip ips 
[protocol]
+  
+
+ Creates a new load balancer named lb with the provided
+ vip and ips or adds the vip to
+ an existing lb.  vip should be a
+ virtual IPv4 address (or an IPv4 address and a port number with
+ : as a separator).  Examples for vip are
+ 192.168.1.4 and 192.168.1.5:8080.
+ ips should be comma separated IPv4 endpoints (or comma
+ separated IPv4 addresses and port numbers with : as a
+ separator).  Examples for ips are 10.0.0.1,10.0.0.2
+ or 20.0.0.10:8800,20.0.0.11:8800.
+
+
+
+ The optional argument protocol must be either
+ tcp or udp.  This argument is useful when
+ a port number is provided as part of the vip.  If the
+ protocol is unspecified and a port number is provided as
+ part of the vip, OVN assumes the protocol to
+ be tcp.
+
+
+
+ It is an error if the vip already exists in the load
+ balancer named lb, unless --may-exist is
+ specified.  With --add-duplicate, the command really
+ creates a new load balancer with a duplicate name.
+
+
+
+ The following example adds a load balancer.
+
+
+
+ lb-add lb0 30.0.0.10:80
+ 192.168.10.10:80,192.168.10.20:80,192.168.10.30:80 udp
+
+  
+
+  [--if-exists] lb-del lb 
[vip]
+  
+Deletes lb or the vip from lb.
+If vip is supplied, only the vip will be
+deleted from the lb.  If only the lb is supplied,
+the lb will be deleted.  It is an error if vip
+does not already exist in lb, unless
+--if-exists is specified.
+  
+
+  lb-list [lb]
+  
+Lists the LBs.  If lb is also specified, then only the
+specified lb will be listed.
+  
+
+  [--may-exist] ls-lb-add switch 
lb
+  
+Adds the specified lb to switch.
+It is an error if a load balancer named lb already exists
+in the switch, unless --may-exist is specified.
+  
+
+  [--if-exists] ls-lb-del switch 
[lb]
+  
+Removes lb from switch.  If only
+switch is supplied, all the LBs from the logical switch are
+removed.  If lb is also specified, then only the
+lb will be removed from the logical switch.
+It is an error if lb does not exist in the
+switch, unless --if-exists is specified.
+  
+
+  ls-lb-list switch [lb]
+  
+Lists the LBs.  If switch is supplied, all the LBs from
+the logical switch are 

Re: [ovs-dev] [PATCH v6] ovn-nbctl: Add LB commands.

2016-09-19 Thread nickcooper-zhangtonghao

> On Sep 19, 2016, at 10:40 PM, Guru Shetty  wrote:
> 
> On 19 September 2016 at 05:16, nickcooper-zhangtonghao 
>  > wrote:
> This patch provides the command line to create a load balancer.
> You can create a load balancer independently and add it to multiple
> switches or routers. A single load balancer can have multiple vips.
> Add a name column for the load balancer. With --add-duplicate,
> the command really creates a new load balancer with a duplicate name.
> This name has no special meaning or purpose other than to provide
> convenience for human interaction with the ovn-nb database.
> This patch also provides the unit tests and the documentation.
> 
> Signed-off-by: nickcooper-zhangtonghao 
> 
> 
> I get the following compilation error:
> 
> ovn/utilities/ovn-nbctl.c: In function ‘nbctl_lb_list_router’:
> ovn/utilities/ovn-nbctl.c:1493:13: error: format not a string literal and no 
> format arguments [-Werror=format-security]
>  smap_add_format(lbs, ds_cstr(), ds_cstr());
>  ^
> ovn/utilities/ovn-nbctl.c: In function ‘nbctl_lb_list_switch’:
> ovn/utilities/ovn-nbctl.c:1540:13: error: format not a string literal and no 
> format arguments [-Werror=format-security]
>  smap_add_format(lbs, ds_cstr(), ds_cstr());
>  ^
> ovn/utilities/ovn-nbctl.c: In function ‘nbctl_lb_list_all’:
> ovn/utilities/ovn-nbctl.c:1584:13: error: format not a string literal and no 
> format arguments [-Werror=format-security]
>  smap_add_format(lbs, ds_cstr(), ds_cstr());
>  ^
> cc1: all warnings being treated as errors
> make[2]: *** [ovn/utilities/ovn-nbctl.o] Error 1
> make[2]: *** Waiting for unfinished jobs
> make[2]: Leaving directory `/root/git/openvswitch'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/root/git/openvswitch'
> make: *** [all] Error 2
>  
> Can you please add to the unit test the scenario where we have multiple vips 
> in a single load balancer and lb-list it.. Also add the case wherein the vip 
> is just an IP address. Also, please update the version number in schema to 
> 5.3.4 (the rationale is explained in 'man ovs-vswitchd.conf.db'. Search for 
> 'db_version'.) 

I do not get the compilation error above. I submitted the v7 patch which 
updates the test case. Thanks for your review.




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


[ovs-dev] [PATCH] ovn-ctl: Initialize the databases.

2016-09-19 Thread Gurucharan Shetty
Without initializing the databases, commands of the form
'ovn-nbctl --wait=sb ls-add ls0' will simply hang.

Signed-off-by: Gurucharan Shetty 
---
 ovn/utilities/ovn-ctl | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ovn/utilities/ovn-ctl b/ovn/utilities/ovn-ctl
index 07bff8a..8544d14 100755
--- a/ovn/utilities/ovn-ctl
+++ b/ovn/utilities/ovn-ctl
@@ -55,6 +55,7 @@ start_ovsdb () {
 set "$@" --detach --monitor $OVN_NB_LOG --log-file=$OVN_NB_LOGFILE 
--remote=punix:$DB_NB_SOCK --remote=ptcp:$DB_NB_PORT:$DB_NB_ADDR 
--pidfile=$DB_NB_PID --unixctl=ovnnb_db.ctl
 
 $@ $DB_NB_FILE
+ovn-nbctl init
 fi
 
 # Check and eventually start ovsdb-server for Southbound DB
@@ -65,6 +66,7 @@ start_ovsdb () {
 
 set "$@" --detach --monitor $OVN_SB_LOG --log-file=$OVN_SB_LOGFILE 
--remote=punix:$DB_SB_SOCK --remote=ptcp:$DB_SB_PORT:$DB_SB_ADDR 
--pidfile=$DB_SB_PID --unixctl=ovnsb_db.ctl
 $@ $DB_SB_FILE
+ovn-sbctl init
 fi
 }
 
-- 
1.9.1

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


[ovs-dev] [RFC v2] ovn-northd: support IPAM with externally specified MAC

2016-09-19 Thread Lance Richardson
The current IPAM implementation allocates both a MAC address and
an IPv4 address when dynamic address allocation is requested. This
patch adds the ability to specify a fixed MAC address for use with
dynamic IPv4 address allocation.

Example:
   ovn-nbctl lsp-set-addresses p1 "00:01:02:03:04:05 dynamic"

Signed-off-by: Lance Richardson 
---
 v2: Eliminated compilation warning, dropped usage of isspace().

 ovn/lib/ovn-util.c  | 38 ++
 ovn/lib/ovn-util.h  |  2 +-
 ovn/northd/ovn-northd.c | 30 +++---
 ovn/ovn-nb.xml  | 35 ---
 tests/ovn.at|  7 +++
 5 files changed, 97 insertions(+), 15 deletions(-)

diff --git a/ovn/lib/ovn-util.c b/ovn/lib/ovn-util.c
index 5dbc138..06f48c6 100644
--- a/ovn/lib/ovn-util.c
+++ b/ovn/lib/ovn-util.c
@@ -62,6 +62,44 @@ add_ipv6_netaddr(struct lport_addresses *laddrs, struct 
in6_addr addr,
 inet_ntop(AF_INET6, >network, na->network_s, sizeof na->network_s);
 }
 
+/* Returns true if specified address specifies a dynamic address,
+ * supporting the following formats:
+ *
+ *"dynamic":
+ *Both MAC and IP are to be allocated dynamically.
+ *
+ *"xx:xx:xx:xx:xx:xx dynamic":
+ *Use specified MAC address, but allocate an IP address
+ *dynamically.
+ */
+bool
+is_dynamic_lsp_address(const char *address)
+{
+const char *buf = address;
+struct eth_addr ea;
+int buf_index = 0;
+
+if (!strcmp(address, "dynamic")) {
+return true;
+}
+
+if (!ovs_scan_len(buf, _index, ETH_ADDR_SCAN_FMT,
+  ETH_ADDR_SCAN_ARGS(ea))) {
+return false;
+}
+
+buf += buf_index;
+while (*buf == ' ') {
+buf++;
+}
+
+if (!strcmp(buf, "dynamic")) {
+return true;
+}
+
+return false;
+}
+
 /* Extracts the mac, IPv4 and IPv6 addresses from * 'address' which
  * should be of the format 'MAC [IP1 IP2 ..]" where IPn should be a
  * valid IPv4 or IPv6 address and stores them in the 'ipv4_addrs' and
diff --git a/ovn/lib/ovn-util.h b/ovn/lib/ovn-util.h
index 2329111..30b27b1 100644
--- a/ovn/lib/ovn-util.h
+++ b/ovn/lib/ovn-util.h
@@ -53,7 +53,7 @@ struct lport_addresses {
 struct ipv6_netaddr *ipv6_addrs;
 };
 
-
+bool is_dynamic_lsp_address(const char *address);
 bool extract_lsp_addresses(const char *address, struct lport_addresses *);
 bool extract_lrp_networks(const struct nbrec_logical_router_port *,
   struct lport_addresses *);
diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c
index a91e1f8..c30d70c 100644
--- a/ovn/northd/ovn-northd.c
+++ b/ovn/northd/ovn-northd.c
@@ -732,7 +732,7 @@ ipam_insert_lsp_addresses(struct ovn_datapath *od, struct 
ovn_port *op,
   char *address)
 {
 if (!od || !op || !address || !strcmp(address, "unknown")
-|| !strcmp(address, "dynamic")) {
+|| is_dynamic_lsp_address(address)) {
 return;
 }
 
@@ -857,7 +857,7 @@ ipam_get_unused_ip(struct ovn_datapath *od, uint32_t 
subnet, uint32_t mask)
 
 static bool
 ipam_allocate_addresses(struct ovn_datapath *od, struct ovn_port *op,
-ovs_be32 subnet, ovs_be32 mask)
+const char *addrspec, ovs_be32 subnet, ovs_be32 mask)
 {
 if (!od || !op || !op->nbsp) {
 return false;
@@ -869,16 +869,23 @@ ipam_allocate_addresses(struct ovn_datapath *od, struct 
ovn_port *op,
 }
 
 struct eth_addr mac;
-uint64_t mac64 = ipam_get_unused_mac();
-if (!mac64) {
-return false;
+bool check_mac;
+
+if (eth_addr_from_string(addrspec, )) {
+check_mac = true;
+} else {
+uint64_t mac64 = ipam_get_unused_mac();
+if (!mac64) {
+return false;
+}
+eth_addr_from_uint64(mac64, );
+check_mac = false;
 }
-eth_addr_from_uint64(mac64, );
 
 /* Add MAC/IP to MACAM/IPAM hmaps if both addresses were allocated
  * successfully. */
 ipam_insert_ip(od, ip, false);
-ipam_insert_mac(, false);
+ipam_insert_mac(, check_mac);
 
 char *new_addr = xasprintf(ETH_ADDR_FMT" "IP_FMT,
ETH_ADDR_ARGS(mac), IP_ARGS(htonl(ip)));
@@ -935,9 +942,10 @@ build_ipam(struct hmap *datapaths, struct hmap *ports)
 }
 
 for (size_t j = 0; j < nbsp->n_addresses; j++) {
-if (!strcmp(nbsp->addresses[j], "dynamic")
+if (is_dynamic_lsp_address(nbsp->addresses[j])
 && !nbsp->dynamic_addresses) {
-if (!ipam_allocate_addresses(od, op, subnet, mask)
+if (!ipam_allocate_addresses(od, op,
+ nbsp->addresses[j], subnet, mask)
 || !extract_lsp_addresses(nbsp->dynamic_addresses,
 

Re: [ovs-dev] [PATCH 3/3] ovs-ofctl.8.in: Fix minor formatting issues.

2016-09-19 Thread Justin Pettit

> On Sep 19, 2016, at 8:26 AM, Ben Pfaff  wrote:
> 
> On Fri, Sep 16, 2016 at 11:27:02AM -0700, Justin Pettit wrote:
>> Signed-off-by: Justin Pettit 
> 
> Please drop the changes from "flow-based" to "flow\-based".  The rule
> for "-" versus "\-" in nroff isn't "put \ before every -", but instead
> more like "put \ before a literal - in sample syntax".  The fuller
> version of the rule is that - is a hyphen and \- is a minus sign; you
> want the former in "flow-based" and the latter in e.g. "--dry-run".
> 
> I'll get off my high horse now.
> 
> Anyway, except for those particular changes,
> Acked-by: Ben Pfaff 

Thanks for the explanation.  I made that change and pushed the series to master.

--Justin


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


Re: [ovs-dev] [PATCH 1/3] jsonrpc: Improve comment for jsonrpc_get_status().

2016-09-19 Thread Justin Pettit

> On Sep 19, 2016, at 8:19 AM, Ben Pfaff  wrote:
> 
> On Fri, Sep 16, 2016 at 11:27:00AM -0700, Justin Pettit wrote:
>> Signed-off-by: Justin Pettit 
> 
> I think that this was a one-word change, plus rewrapping.

Yes, it added a word that then increased the line length of that line past 80 
columns, so I rewrapped it.

> Acked-by: Ben Pfaff 

Thanks.  I'll push it in a minute.

--Justin


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


[ovs-dev] Code complexity survey

2016-09-19 Thread Vard Antinyan
Dear openvswitch developers,



We have undertaken a task to assess code complexity triggers and generate 
recommendations for developing simple and understandable code. Our intension is 
to share the results with you, developers, so everyone can learn the triggers 
behind complex software.



We need your help for rigorous results. My request to you is - if you get 5-10 
min. time, would you please consider to answer the questions of this survey on 
code complexity?

https://goo.gl/forms/h9WXZ8VSEw7BUyHg1



You are welcome to learn preliminary results through this link:

https://www.facebook.com/SoftwareCodeQuality/photos/?tab=album_id=1639816749664288



The results will be shared in a public webpage and everyone possible will be 
invited to learn and discuss them.



Your knowledge and experience is vital for achieving substantial and 
generalizable results, and your effort is much appreciated!



Sincerely

Vard Antinyan

PhD candidate in University of Gothenburg, Sweden

Tel: 0046317725707

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


[ovs-dev] OVS 2.6 release proposal

2016-09-19 Thread Ben Pfaff
I suggest that we plan to release OVS 2.6.0 this Thursday, Sept. 22,
unless significant new bugs appear before then.

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


Re: [ovs-dev] [PATCH v2 rebase] tun-metadata: Manage tunnel TLV mapping table on a per-bridge basis.

2016-09-19 Thread Ben Pfaff
On Thu, Sep 15, 2016 at 09:28:37AM -0700, Jesse Gross wrote:
> When using tunnel TLVs (at the moment, this means Geneve options), a
> controller must first map the class and type onto an appropriate OXM
> field so that it can be used in OVS flow operations. This table is
> managed using OpenFlow extensions.
> 
> The original code that added support for TLVs made the mapping table
> global as a simplification. However, this is not really logically
> correct as the OpenFlow management commands are operating on a per-bridge
> basis. This removes the original limitation to make the table per-bridge.
> 
> One nice result of this change is that it is generally clearer whether
> the tunnel metadata is in datapath or OpenFlow format. Rather than
> allowing ad-hoc format changes and trying to handle both formats in the
> tunnel metadata functions, the format is more clearly separated by function.
> Datapaths (both kernel and userspace) use datapath format and it is not
> changed during the upcall process. At the beginning of action translation,
> tunnel metadata is converted to OpenFlow format and flows and wildcards
> are translated back at the end of the process.
> 
> As an additional benefit, this change improves performance in some flow
> setup situations by keeping the tunnel metadata in the original packet
> format in more cases. This helps when copies need to be made as the amount
> of data touched is only what is present in the packet rather than the
> maximum amount of metadata supported.
> 
> Co-authored-by: Madhu Challa 
> Signed-off-by: Madhu Challa 
> Signed-off-by: Jesse Gross 
> ---
> This is a rebased version of the previously posted patch which no longer
> applies cleanly.
> 
> v2: Pass 'struct tun_table' instead of 'struct ofproto' for functions that
> need to access tunnel metadata.

Thanks a lot Jesse.  I like this much better and, surprisingly, it
yields a net reduction in code.

I think that this should update NEWS to reflect the new feature.

This appears to cause a new test failure:
2235: ovn -- 3 HVs, 1 VIFs/HV, 1 software GW, 1 LSFAILED (ovn.at:1942)

I couldn't immediately figure out why.  With the patch this test seems
to fail consistently (10 failures out of 10) and without it it succeeds
(0 failures out of 10).

If you can figure something out there,
Acked-by: Ben Pfaff 

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


Re: [ovs-dev] [PATCH 3/3] ovs-ofctl.8.in: Fix minor formatting issues.

2016-09-19 Thread Ben Pfaff
On Fri, Sep 16, 2016 at 11:27:02AM -0700, Justin Pettit wrote:
> Signed-off-by: Justin Pettit 

Please drop the changes from "flow-based" to "flow\-based".  The rule
for "-" versus "\-" in nroff isn't "put \ before every -", but instead
more like "put \ before a literal - in sample syntax".  The fuller
version of the rule is that - is a hyphen and \- is a minus sign; you
want the former in "flow-based" and the latter in e.g. "--dry-run".

I'll get off my high horse now.

Anyway, except for those particular changes,
Acked-by: Ben Pfaff 
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH 2/3] dpif-provider: Clean up comments around ct functions.

2016-09-19 Thread Ben Pfaff
On Fri, Sep 16, 2016 at 11:27:01AM -0700, Justin Pettit wrote:
> Signed-off-by: Justin Pettit 

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


Re: [ovs-dev] [PATCH 1/3] jsonrpc: Improve comment for jsonrpc_get_status().

2016-09-19 Thread Ben Pfaff
On Fri, Sep 16, 2016 at 11:27:00AM -0700, Justin Pettit wrote:
> Signed-off-by: Justin Pettit 

I think that this was a one-word change, plus rewrapping.

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


Re: [ovs-dev] [PATCH] INSTALL.DPDK-ADVANCED.md: Remove execute permissions.

2016-09-19 Thread Ben Pfaff
On Fri, Sep 16, 2016 at 11:25:43AM -0700, Justin Pettit wrote:
> Signed-off-by: Justin Pettit 
> ---
>  INSTALL.DPDK-ADVANCED.md | 0
>  1 file changed, 0 insertions(+), 0 deletions(-)
>  mode change 100755 => 100644 INSTALL.DPDK-ADVANCED.md
> 
> diff --git a/INSTALL.DPDK-ADVANCED.md b/INSTALL.DPDK-ADVANCED.md
> old mode 100755
> new mode 100644

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


Re: [ovs-dev] Difference between hmap and cmap

2016-09-19 Thread Ben Pfaff
On Mon, Sep 19, 2016 at 01:53:37AM -0400, Hui Kang wrote:
> I am studying the hashing functions in OVS and find these two
> implementations: hmap and cmap. I understand that cmap is the improved
> cuckoo hashing and cmap supports multiple-reader and single writer. My
> questions are:
> 
> 1. What does hmap stand for? hash map?

Yes.

> 2. hmap looks much simpler than cmap; does it support multi-reader and
> single writers?

hmap supports multiple readers OR a single writer at a given time.
cmap supports multiple readers AND a single writer at a given time.

> 3. If cmap performs better than hmap, why not using cmap all over the OVS
> code?

I don't think it does perform better than hmap, except in a case where
there's lots of parallelism.
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] backport request for 2.6: enable kernel datapath check in rpms

2016-09-19 Thread Russell Bryant
On Wed, Sep 14, 2016 at 1:50 PM, Ben Pfaff  wrote:

> On Tue, Sep 13, 2016 at 12:07:25PM -0400, Lance Richardson wrote:
> > Requesting backports of these commits to the 2.6 branch:
> >
> > commit 8ef22bb1ceb7b2841d2e29eb283387f0a3a67ff9
> > rhel: add option to run kernel datapath test when building rpms
>
> Russell, will you please consider this?


I'm fine with this.  I have backported it to branch-2.6.

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


Re: [ovs-dev] [PATCH] datapath-windows: Add define for last module number

2016-09-19 Thread Nithin Raju
Only comment I had was to nuke the OVS_DBG_RESERVED and treat OVS_DBG_LAST
itself as the last bit. Basically, we are restricting this to 32 since
ŒovsLogLevel¹ is 32 bits.

We can probably do:
BUILD_ASSERT(OVS_DBG_LAST < 31)
BUILD_ASSERT(OVS_DBG_LAST < sizeof ovsLogLevel).


Thanks for the cleanup.

Thanks,
-- Nithin

-Original Message-
From: dev  on behalf of Shashank Ram

Date: Thursday, September 15, 2016 at 5:46 PM
To: "dev@openvswitch.org" 
Cc: Shashank Ram 
Subject: [ovs-dev] [PATCH] datapath-windows: Add define for last
module  number

>Adds a define for the last defined module number.
>
>Signed-off-by: Shashank Ram 
>---
> datapath-windows/ovsext/Debug.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>diff --git a/datapath-windows/ovsext/Debug.h
>b/datapath-windows/ovsext/Debug.h
>index 935f858..2175130 100644
>--- a/datapath-windows/ovsext/Debug.h
>+++ b/datapath-windows/ovsext/Debug.h
>@@ -43,8 +43,9 @@
> #define OVS_DBG_CONTRK   BIT32(23)
> #define OVS_DBG_GENEVE   BIT32(24)
> 
>+#define OVS_DBG_LAST 24  // Set this to the last defined module
>number.
> #define OVS_DBG_RESERVED BIT32(31)
>-//Please add above OVS_DBG_RESERVED.
>+//Please add above OVS_DBG_LAST.
> 
> #define OVS_DBG_ERRORDPFLTR_ERROR_LEVEL
> #define OVS_DBG_WARN DPFLTR_WARNING_LEVEL
>-- 
>2.6.2
>
>___
>dev mailing list
>dev@openvswitch.org
>https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailma
>n_listinfo_dev=CwIGaQ=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs=pN
>HQcdr7B40b4h6Yb7FIedI1dnBsxdDuTLBYD3JqV80=0pvAR9XWuxljf0K9blx9ZCxughyOW7
>ZxdCZDoaAM8Fs=Fy1eCZ44TmWJuBW9BBSsMnkVx4skKLYWOFpK876C7Eg= 

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


Re: [ovs-dev] [PATCH v6] ovn-nbctl: Add LB commands.

2016-09-19 Thread Guru Shetty
On 19 September 2016 at 05:16, nickcooper-zhangtonghao <
nickcooper-zhangtong...@opencloud.tech> wrote:

> This patch provides the command line to create a load balancer.
> You can create a load balancer independently and add it to multiple
> switches or routers. A single load balancer can have multiple vips.
> Add a name column for the load balancer. With --add-duplicate,
> the command really creates a new load balancer with a duplicate name.
> This name has no special meaning or purpose other than to provide
> convenience for human interaction with the ovn-nb database.
> This patch also provides the unit tests and the documentation.
>
> Signed-off-by: nickcooper-zhangtonghao  opencloud.tech>
>

I get the following compilation error:

ovn/utilities/ovn-nbctl.c: In function ‘nbctl_lb_list_router’:
ovn/utilities/ovn-nbctl.c:1493:13: error: format not a string literal and
no format arguments [-Werror=format-security]
 smap_add_format(lbs, ds_cstr(), ds_cstr());
 ^
ovn/utilities/ovn-nbctl.c: In function ‘nbctl_lb_list_switch’:
ovn/utilities/ovn-nbctl.c:1540:13: error: format not a string literal and
no format arguments [-Werror=format-security]
 smap_add_format(lbs, ds_cstr(), ds_cstr());
 ^
ovn/utilities/ovn-nbctl.c: In function ‘nbctl_lb_list_all’:
ovn/utilities/ovn-nbctl.c:1584:13: error: format not a string literal and
no format arguments [-Werror=format-security]
 smap_add_format(lbs, ds_cstr(), ds_cstr());
 ^
cc1: all warnings being treated as errors
make[2]: *** [ovn/utilities/ovn-nbctl.o] Error 1
make[2]: *** Waiting for unfinished jobs
make[2]: Leaving directory `/root/git/openvswitch'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/git/openvswitch'
make: *** [all] Error 2

Can you please add to the unit test the scenario where we have multiple
vips in a single load balancer and lb-list it.. Also add the case wherein
the vip is just an IP address. Also, please update the version number in
schema to 5.3.4 (the rationale is explained in 'man ovs-vswitchd.conf.db'.
Search for 'db_version'.)


---
>  ovn/ovn-nb.ovsschema  |   3 +-
>  ovn/ovn-nb.xml|   6 +
>  ovn/utilities/ovn-nbctl.8.xml | 109 +
>  ovn/utilities/ovn-nbctl.c | 514 ++
> +++-
>  tests/ovn-nbctl.at| 147 
>  5 files changed, 777 insertions(+), 2 deletions(-)
>
> diff --git a/ovn/ovn-nb.ovsschema b/ovn/ovn-nb.ovsschema
> index b7e70aa..7772ad2 100644
> --- a/ovn/ovn-nb.ovsschema
> +++ b/ovn/ovn-nb.ovsschema
> @@ -1,7 +1,7 @@
>  {
>  "name": "OVN_Northbound",
>  "version": "5.3.3",
> -"cksum": "2442952958 9945",
> +"cksum": "1191768021 9975",
>  "tables": {
>  "NB_Global": {
>  "columns": {
> @@ -97,6 +97,7 @@
>  "isRoot": true},
>  "Load_Balancer": {
>  "columns": {
> +   "name": {"type": "string"},
>  "vips": {
>  "type": {"key": "string", "value": "string",
>   "min": 0, "max": "unlimited"}},
> diff --git a/ovn/ovn-nb.xml b/ovn/ovn-nb.xml
> index 9a8bdbd..2ebae29 100644
> --- a/ovn/ovn-nb.xml
> +++ b/ovn/ovn-nb.xml
> @@ -676,6 +676,12 @@
>Each row represents one load balancer.
>  
>
> +
> +  A name for the load balancer.  This name has no special meaning or
> +  purpose other than to provide convenience for human interaction with
> +  the ovn-nb database.
> +
> +
>  
>
>  A map of virtual IPv4 addresses (and an optional port number with
> diff --git a/ovn/utilities/ovn-nbctl.8.xml b/ovn/utilities/ovn-nbctl.8.xml
> index 76cf97e..bdccc23 100644
> --- a/ovn/utilities/ovn-nbctl.8.xml
> +++ b/ovn/utilities/ovn-nbctl.8.xml
> @@ -400,6 +400,115 @@
>
>  
>
> +Load Balancer Commands
> +
> +  [--may-exist | --add-duplicate]
> lb-add lb vip ips
> [protocol]
> +  
> +
> + Creates a new load balancer named lb with the provided
> + vip and ips or adds the vip to
> + an existing lb.  vip should be a
> + virtual IPv4 address (or an IPv4 address and a port number with
> + : as a separator).  Examples for vip are
> + 192.168.1.4 and 192.168.1.5:8080.
> + ips should be comma separated IPv4 endpoints (or comma
> + separated IPv4 addresses and port numbers with : as
> a
> + separator).  Examples for ips are
> 10.0.0.1,10.0.0.2
> + or 20.0.0.10:8800,20.0.0.11:8800.
> +
> +
> +
> + The optional argument protocol must be either
> + tcp or udp.  This argument is useful
> when
> + a port number is provided as part of the vip.  If the
> + protocol is unspecified and a port number is provided
> as
> + part of the vip, OVN assumes the protocol
> to
> + be tcp.
> +
> +
> 

[ovs-dev] [PATCH] netdev-dpdk: Configure flow control only when necessary.

2016-09-19 Thread Ilya Maximets
It is not necessary to touch the physical device each time, if the
configuration has not been changed. Also, few style issues fixed.

Signed-off-by: Ilya Maximets 
---
 lib/netdev-dpdk.c | 30 +-
 1 file changed, 17 insertions(+), 13 deletions(-)

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 6d334db..1632b97 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -1057,6 +1057,7 @@ netdev_dpdk_get_config(const struct netdev *netdev, 
struct smap *args)
 
 static void
 dpdk_set_rxq_config(struct netdev_dpdk *dev, const struct smap *args)
+OVS_REQUIRES(dev->mutex)
 {
 int new_n_rxq;
 
@@ -1071,24 +1072,27 @@ static int
 netdev_dpdk_set_config(struct netdev *netdev, const struct smap *args)
 {
 struct netdev_dpdk *dev = netdev_dpdk_cast(netdev);
+uint8_t rx_fc_en, tx_fc_en, autoneg;
+enum rte_eth_fc_mode fc_mode;
+static const enum rte_eth_fc_mode fc_mode_set[2][2] = {
+{RTE_FC_NONE, RTE_FC_TX_PAUSE},
+{RTE_FC_RX_PAUSE, RTE_FC_FULL}
+};
 
 ovs_mutex_lock(>mutex);
 
 dpdk_set_rxq_config(dev, args);
 
-/* Flow control support is only available for DPDK Ethernet ports. */
-bool rx_fc_en = false;
-bool tx_fc_en = false;
-enum rte_eth_fc_mode fc_mode_set[2][2] =
-   {{RTE_FC_NONE, RTE_FC_TX_PAUSE},
-{RTE_FC_RX_PAUSE, RTE_FC_FULL}
-   };
-rx_fc_en = smap_get_bool(args, "rx-flow-ctrl", false);
-tx_fc_en = smap_get_bool(args, "tx-flow-ctrl", false);
-dev->fc_conf.autoneg = smap_get_bool(args, "flow-ctrl-autoneg", false);
-dev->fc_conf.mode = fc_mode_set[tx_fc_en][rx_fc_en];
-
-dpdk_eth_flow_ctrl_setup(dev);
+rx_fc_en = smap_get_bool(args, "rx-flow-ctrl", false) ? 1 : 0;
+tx_fc_en = smap_get_bool(args, "tx-flow-ctrl", false) ? 1 : 0;
+autoneg = smap_get_bool(args, "flow-ctrl-autoneg", false) ? 1 : 0;
+
+fc_mode = fc_mode_set[tx_fc_en][rx_fc_en];
+if (dev->fc_conf.mode != fc_mode || autoneg != dev->fc_conf.autoneg) {
+dev->fc_conf.mode = fc_mode;
+dev->fc_conf.autoneg = autoneg;
+dpdk_eth_flow_ctrl_setup(dev);
+}
 
 ovs_mutex_unlock(>mutex);
 
-- 
2.7.4

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


[ovs-dev] (no subject)

2016-09-19 Thread rbaker
Your message was undeliverable due to the following reason:

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

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

Your message could not be delivered within 8 days:
Host 147.61.188.11 is not responding.

The following recipients could not receive this message:


Please reply to postmas...@netcomstl.com
if you feel this message to be in error.

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


[ovs-dev] [PATCH v6] ovn-nbctl: Add LB commands.

2016-09-19 Thread nickcooper-zhangtonghao
This patch provides the command line to create a load balancer.
You can create a load balancer independently and add it to multiple
switches or routers. A single load balancer can have multiple vips.
Add a name column for the load balancer. With --add-duplicate,
the command really creates a new load balancer with a duplicate name.
This name has no special meaning or purpose other than to provide
convenience for human interaction with the ovn-nb database.
This patch also provides the unit tests and the documentation.

Signed-off-by: nickcooper-zhangtonghao 
---
 ovn/ovn-nb.ovsschema  |   3 +-
 ovn/ovn-nb.xml|   6 +
 ovn/utilities/ovn-nbctl.8.xml | 109 +
 ovn/utilities/ovn-nbctl.c | 514 +-
 tests/ovn-nbctl.at| 147 
 5 files changed, 777 insertions(+), 2 deletions(-)

diff --git a/ovn/ovn-nb.ovsschema b/ovn/ovn-nb.ovsschema
index b7e70aa..7772ad2 100644
--- a/ovn/ovn-nb.ovsschema
+++ b/ovn/ovn-nb.ovsschema
@@ -1,7 +1,7 @@
 {
 "name": "OVN_Northbound",
 "version": "5.3.3",
-"cksum": "2442952958 9945",
+"cksum": "1191768021 9975",
 "tables": {
 "NB_Global": {
 "columns": {
@@ -97,6 +97,7 @@
 "isRoot": true},
 "Load_Balancer": {
 "columns": {
+   "name": {"type": "string"},
 "vips": {
 "type": {"key": "string", "value": "string",
  "min": 0, "max": "unlimited"}},
diff --git a/ovn/ovn-nb.xml b/ovn/ovn-nb.xml
index 9a8bdbd..2ebae29 100644
--- a/ovn/ovn-nb.xml
+++ b/ovn/ovn-nb.xml
@@ -676,6 +676,12 @@
   Each row represents one load balancer.
 
 
+
+  A name for the load balancer.  This name has no special meaning or
+  purpose other than to provide convenience for human interaction with
+  the ovn-nb database.
+
+
 
   
 A map of virtual IPv4 addresses (and an optional port number with
diff --git a/ovn/utilities/ovn-nbctl.8.xml b/ovn/utilities/ovn-nbctl.8.xml
index 76cf97e..bdccc23 100644
--- a/ovn/utilities/ovn-nbctl.8.xml
+++ b/ovn/utilities/ovn-nbctl.8.xml
@@ -400,6 +400,115 @@
   
 
 
+Load Balancer Commands
+
+  [--may-exist | --add-duplicate] 
lb-add lb vip ips 
[protocol]
+  
+
+ Creates a new load balancer named lb with the provided
+ vip and ips or adds the vip to
+ an existing lb.  vip should be a
+ virtual IPv4 address (or an IPv4 address and a port number with
+ : as a separator).  Examples for vip are
+ 192.168.1.4 and 192.168.1.5:8080.
+ ips should be comma separated IPv4 endpoints (or comma
+ separated IPv4 addresses and port numbers with : as a
+ separator).  Examples for ips are 10.0.0.1,10.0.0.2
+ or 20.0.0.10:8800,20.0.0.11:8800.
+
+
+
+ The optional argument protocol must be either
+ tcp or udp.  This argument is useful when
+ a port number is provided as part of the vip.  If the
+ protocol is unspecified and a port number is provided as
+ part of the vip, OVN assumes the protocol to
+ be tcp.
+
+
+
+ It is an error if the vip already exists in the load
+ balancer named lb, unless --may-exist is
+ specified.  With --add-duplicate, the command really
+ creates a new load balancer with a duplicate name.
+
+
+
+ The following example adds a load balancer.
+
+
+
+ lb-add lb0 30.0.0.10:80
+ 192.168.10.10:80,192.168.10.20:80,192.168.10.30:80 udp
+
+  
+
+  [--if-exists] lb-del lb 
[vip]
+  
+Deletes lb or the vip from lb.
+If vip is supplied, only the vip will be
+deleted from the lb.  If only the lb is supplied,
+the lb will be deleted.  It is an error if vip
+does not already exist in lb, unless
+--if-exists is specified.
+  
+
+  lb-list [lb]
+  
+Lists the LBs.  If lb is also specified, then only the
+specified lb will be listed.
+  
+
+  [--may-exist] ls-lb-add switch 
lb
+  
+Adds the specified lb to switch.
+It is an error if a load balancer named lb already exists
+in the switch, unless --may-exist is specified.
+  
+
+  [--if-exists] ls-lb-del switch 
[lb]
+  
+Removes lb from switch.  If only
+switch is supplied, all the LBs from the logical switch are
+removed.  If lb is also specified, then only the
+lb will be removed from the logical switch.
+It is an error if lb does not exist in the
+switch, unless --if-exists is specified.
+  
+
+  ls-lb-list switch [lb]
+  
+Lists the LBs.  If switch is supplied, all the LBs from
+the logical switch are listed.  If lb is also 

[ovs-dev] [PATCH 2/2] flow: P4 based hash calculation on IP and Ethernet headers

2016-09-19 Thread Muhammad Shahbaz
From: Cian Ferriter 

Replaces miniflow_hash_5tuple() with miniflow_hash_ntuple() which
calls the dynamically generated OVS_HASH_FIELDS macro. This macro is
generated at the configure stage of OVS compilation and depends on the
standard header fields in the P4 input file. As a first pass, all
standard header fields defined in the P4 input file are hashed.

When testing the functionality and performance of this patch,
dp_packet_rss_valid() was modified to always return false, forcing the
calculation of the hash to take place in software.

There is some performance degradation associated with this patch. The
amount of degradation depends on the amount of header fields from the
P4 file that are used for hashing. The performance comparisons were
carried out between commit eb8917d on the 'p4' branch and this patch
applied on top of that commit. A 16% performance degradation is seen
when the Ethernet header structure is defined in the P4 input file. A
28% performance degradation is seen when the Ethernet/IPv4 header
structures are defined in the P4 input file.

These performance degradations are caused by the large amount of
fields being hashed and the pointer manipulation necessary to hash the
awkwardly sized Ethernet destination and source addresses. These
problems should be alleviated by implementing a method in P4 to
specify which fields should be hashed and by investigating whether a
better method for hashing awkwardly sized fields can be found.

Signed-off-by: Cian Ferriter 
---
 lib/dpif-netdev.c |  2 +-
 lib/flow.c| 41 +
 lib/flow.h|  6 ++
 3 files changed, 12 insertions(+), 37 deletions(-)

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index e0107b7..7a1c8c9 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -3600,7 +3600,7 @@ dpif_netdev_packet_get_rss_hash(struct dp_packet *packet,
 if (OVS_LIKELY(dp_packet_rss_valid(packet))) {
 hash = dp_packet_get_rss_hash(packet);
 } else {
-hash = miniflow_hash_5tuple(mf, 0);
+hash = miniflow_hash_ntuple(mf, 0);
 dp_packet_set_rss_hash(packet, hash);
 }
 
diff --git a/lib/flow.c b/lib/flow.c
index 4c8ac84..46be83d 100644
--- a/lib/flow.c
+++ b/lib/flow.c
@@ -41,7 +41,9 @@
 #include "unaligned.h"
 
 // @P4:
+#include "p4/src/lib/packets.h.h"
 #include "p4/src/lib/flow.c.h"
+#include "p4/src/lib/hash.c.h"
 
 COVERAGE_DEFINE(flow_extract);
 COVERAGE_DEFINE(miniflow_malloc);
@@ -1611,49 +1613,16 @@ flow_wildcards_set_xreg_mask(struct flow_wildcards *wc, 
int idx, uint64_t mask)
 flow_set_xreg(>masks, idx, mask);
 }
 
-/* Calculates the 5-tuple hash from the given miniflow.
+/* Calculates the n-tuple hash from the given miniflow.
  * This returns the same value as flow_hash_5tuple for the corresponding
  * flow. */
 uint32_t
-miniflow_hash_5tuple(const struct miniflow *flow, uint32_t basis)
+miniflow_hash_ntuple(const struct miniflow *flow, uint32_t basis)
 {
 BUILD_ASSERT_DECL(FLOW_WC_SEQ == 35);
 uint32_t hash = basis;
 
-if (flow) {
-ovs_be16 dl_type = MINIFLOW_GET_BE16(flow, dl_type);
-uint8_t nw_proto;
-
-if (dl_type == htons(ETH_TYPE_IPV6)) {
-struct flowmap map = FLOWMAP_EMPTY_INITIALIZER;
-uint64_t value;
-
-FLOWMAP_SET(, ipv6_src);
-FLOWMAP_SET(, ipv6_dst);
-
-MINIFLOW_FOR_EACH_IN_FLOWMAP(value, flow, map) {
-hash = hash_add64(hash, value);
-}
-} else if (dl_type == htons(ETH_TYPE_IP)
-   || dl_type == htons(ETH_TYPE_ARP)) {
-hash = hash_add(hash, MINIFLOW_GET_U32(flow, nw_src));
-hash = hash_add(hash, MINIFLOW_GET_U32(flow, nw_dst));
-} else {
-goto out;
-}
-
-nw_proto = MINIFLOW_GET_U8(flow, nw_proto);
-hash = hash_add(hash, nw_proto);
-if (nw_proto != IPPROTO_TCP && nw_proto != IPPROTO_UDP
-&& nw_proto != IPPROTO_SCTP && nw_proto != IPPROTO_ICMP
-&& nw_proto != IPPROTO_ICMPV6) {
-goto out;
-}
-
-/* Add both ports at once. */
-hash = hash_add(hash, MINIFLOW_GET_U32(flow, tp_src));
-}
-out:
+OVS_HASH_FIELDS
 return hash_finish(hash, 42);
 }
 
diff --git a/lib/flow.h b/lib/flow.h
index 5479677..f857997 100644
--- a/lib/flow.h
+++ b/lib/flow.h
@@ -617,6 +617,11 @@ miniflow_get__(const struct miniflow *mf, size_t idx)
  [FLOW_U64_OFFREM(FIELD) / sizeof(TYPE)]\
  : 0)
 
+#define MINIFLOW_GET_ADDRESS(MF, FIELD)  \
+(MINIFLOW_IN_MAP(MF, FLOW_U64_OFFSET(FIELD))\
+ ? ((OVS_FORCE const void *)miniflow_get__(MF, FLOW_U64_OFFSET(FIELD))) \
+ : 0)
+
 #define MINIFLOW_GET_U128(FLOW, FIELD)  \
 (ovs_u128) { .u64 = {   \
 

[ovs-dev] [PATCH 0/2] P4 support in OVS

2016-09-19 Thread Muhammad Shahbaz
Hi all,

We are submitting the following patches on this list for your review. These
patches contain changes to add support for P4 in OVS.

An earlier, proof-of-concept, implementation has been developed and published
in SIGCOMM this year:
http://pisces.cs.princeton.edu/papers/sigcomm16-pisces.pdf.

Now, our plan is to add this to the upstream OVS. As a first step, we are
providing support for adding new fields in OVS using P4. This includes
augmenting the flow struct, in OVS, with new fields; extending the
miniflow_strcut  function to parse these fields; and match-action tables to
operate on these fields. To understand the overall structure of the P4/OVS
compiler, please read our paper above, but, in short, there are two parts to
it. The first part is based on the p4c-behavioral repository
(https://github.com/p4lang/p4c-behavioral) from the p4lang organization, and
the second part is the changes made in the OVS repository, itself.

The following patches are for the OVS repository. The C (macro) code generated
by the OVS plugin in the p4c-behavioral repository, is called at different
locations within the OVS repository. The following patches add the necessary
changes needed to consume the generated code in OVS. The current changes are
for the userspace OVS implementation which can run with DPDK.

To test these changes, you can build OVS as follows (but make sure that
p4-hlir---https://github.com/p4lang/p4-hlir, and p4c-behavioral are installed):

$ ./boot.sh
$ ./configure --with-dpdk=$DPDK_BUILD p4inputfile=
$ make

---
Cian Ferriter (1):
  flow: P4 based hash calculation on IP and Ethernet headers

Muhammad Shahbaz (1):
  adding P4 support

 acinclude.m4  |  17 +++
 build-aux/extract-ofp-actions |   4 +-
 build-aux/extract-ofp-fields  |  99 ++-
 configure.ac  |   1 +
 datapath/linux/compat/include/linux/openvswitch.h |  10 ++
 include/automake.mk   |   1 +
 include/openvswitch/flow.h|   8 ++
 include/openvswitch/meta-flow.h   |   5 +
 include/openvswitch/packets.h |   6 +
 include/openvswitch/types.h   |   6 +
 include/p4/automake.mk|   3 +
 include/p4/examples/l2_switch.p4  |  89 ++
 include/p4/examples/simple_router.p4  | 143 ++
 lib/automake.mk   |   4 +-
 lib/dp-packet.h   |  10 ++
 lib/dpif-netdev.c |   2 +-
 lib/flow.c|  76 ++--
 lib/flow.h|   6 +
 lib/match.c   |  46 +++
 lib/meta-flow.c   |  24 
 lib/nx-match.c|   6 +
 lib/odp-execute.c |  12 ++
 lib/odp-util.c|  97 ++-
 lib/packets.c |   6 +
 lib/packets.h |   6 +
 ofproto/ofproto-dpif-sflow.c  |   6 +
 26 files changed, 616 insertions(+), 77 deletions(-)
 create mode 100644 include/p4/automake.mk
 create mode 100644 include/p4/examples/l2_switch.p4
 create mode 100644 include/p4/examples/simple_router.p4

--
2.7.4 (Apple Git-66)
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH 1/2] adding P4 support

2016-09-19 Thread Muhammad Shahbaz
This adds necessary changes in the OVS codebase to consume the C (macro) code
generated by the OVS plugin in p4c-behavioral. It also updates the OVS build
system to take a P4 program as input at 'configure' time.

---
 acinclude.m4  |  17 +++
 build-aux/extract-ofp-actions |   4 +-
 build-aux/extract-ofp-fields  |  99 ++-
 configure.ac  |   1 +
 datapath/linux/compat/include/linux/openvswitch.h |  10 ++
 include/automake.mk   |   1 +
 include/openvswitch/flow.h|   8 ++
 include/openvswitch/meta-flow.h   |   5 +
 include/openvswitch/packets.h |   6 +
 include/openvswitch/types.h   |   6 +
 include/p4/automake.mk|   3 +
 include/p4/examples/l2_switch.p4  |  89 ++
 include/p4/examples/simple_router.p4  | 143 ++
 lib/automake.mk   |   4 +-
 lib/dp-packet.h   |  10 ++
 lib/flow.c|  35 +-
 lib/match.c   |  46 +++
 lib/meta-flow.c   |  24 
 lib/nx-match.c|   6 +
 lib/odp-execute.c |  12 ++
 lib/odp-util.c|  97 ++-
 lib/packets.c |   6 +
 lib/packets.h |   6 +
 ofproto/ofproto-dpif-sflow.c  |   6 +
 24 files changed, 604 insertions(+), 40 deletions(-)
 create mode 100644 include/p4/automake.mk
 create mode 100644 include/p4/examples/l2_switch.p4
 create mode 100644 include/p4/examples/simple_router.p4

diff --git a/acinclude.m4 b/acinclude.m4
index bb0d90a..d258c36 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -265,6 +265,23 @@ AC_DEFUN([OVS_CHECK_DPDK], [
   AM_CONDITIONAL([DPDK_NETDEV], test "$DPDKLIB_FOUND" = true)
 ])

+AC_DEFUN([OVS_CHECK_P4], [
+  AC_ARG_VAR([p4inputfile], [Specify the p4 input file])
+  AC_ARG_VAR([p4outputdir], [Specify the p4 output directory])
+  AS_IF([test -z "$p4inputfile"],
+[AC_MSG_ERROR([missing arguments for p4 input file])])
+  AS_IF([test ! -e "$p4inputfile"],
+[AC_MSG_ERROR([p4 input file does not exist])])
+  AS_IF([test -z "$p4outputdir"],
+[AC_MSG_ERROR([missing arguments for p4 output dir])])
+  AS_IF([test -d "$p4outputdir"], [rm -rf $p4outputdir], [])
+
+  mkdir -p $p4outputdir
+  p4c-behavioral $p4inputfile --gen-dir $p4outputdir/temp --plugin ovs
+  mv $p4outputdir/temp/plugin/ovs/inc/* $p4outputdir
+  rm -rf $p4outputdir/temp
+])
+
 dnl OVS_GREP_IFELSE(FILE, REGEX, [IF-MATCH], [IF-NO-MATCH])
 dnl
 dnl Greps FILE for REGEX.  If it matches, runs IF-MATCH, otherwise IF-NO-MATCH.
diff --git a/build-aux/extract-ofp-actions b/build-aux/extract-ofp-actions
index 3a72349..10510c4 100755
--- a/build-aux/extract-ofp-actions
+++ b/build-aux/extract-ofp-actions
@@ -268,8 +268,8 @@ def extract_ofp_actions(fn, definitions):
 assert v["arg_len"] == versions[0]["arg_len"]
 assert v["base_argtype"] == versions[0]["base_argtype"]
 if (v["min_length"] != versions[0]["min_length"] or
-v["arg_ofs"] != versions[0]["arg_ofs"] or
-v["type"] != versions[0]["type"]):
+v["arg_ofs"] != versions[0]["arg_ofs"] or
+v["type"] != versions[0]["type"]):
 need_ofp_version = True
 base_argtype = versions[0]["base_argtype"]

diff --git a/build-aux/extract-ofp-fields b/build-aux/extract-ofp-fields
index 8d43e4b..c904ec6 100755
--- a/build-aux/extract-ofp-fields
+++ b/build-aux/extract-ofp-fields
@@ -1,5 +1,6 @@
 #! /usr/bin/python

+import getopt
 import sys
 import os.path
 import re
@@ -22,6 +23,10 @@ TYPES = {"u8":   (1,   False),
  "be128":(16,  False),
  "tunnelMD": (124, True)}

+# @P4:
+for i in xrange(128):
+TYPES["be"+str(8*i)] = (i, False)
+
 FORMATTING = {"decimal":("MFS_DECIMAL",  1,   8),
   "hexadecimal":("MFS_HEXADECIMAL",  1, 127),
   "ct state":   ("MFS_CT_STATE", 4,   4),
@@ -118,8 +123,9 @@ def usage():
 argv0 = os.path.basename(sys.argv[0])
 print('''\
 %(argv0)s, for extracting OpenFlow field properties from meta-flow.h
-usage: %(argv0)s INPUT [--meta-flow | --nx-match]
-  where INPUT points to lib/meta-flow.h in the source directory.
+usage: %(argv0)s [--meta-flow | --nx-match] INPUT...
+  where the first INPUT points to lib/meta-flow.h in the source directory
+and additional INPUTs may point elsewhere.
 Depending on the option given, the output written to stdout is intended to be
 saved either as lib/meta-flow.inc or 

[ovs-dev] [PATCH for p4c-behavioral 2/2] Add 'hash.c.h' file to support P4 based hash calculation

2016-09-19 Thread Muhammad Shahbaz
From: Cian Ferriter 

As a first pass, all standard header fields defined in the P4 input
file are hashed.

This file uses the bit_width of each field similar to the packets.h.h
file to decide between calling the 32bit or 64bit OVS hashing
function. This implementation was built around the Ethernet/IPv4 case
as a first pass and so may not work with other header structures
defined in P4. In the cases that the bit_width of a field is not 8,
16, 32 or 64 bits, this solution assumes the bit_width is 48 bits to
deal with Ethernet addresses. The flexibility of this can be increased
in later iterations.

Pointers were used rather than the 'MINIFLOW_GET' macros as this
method doesn't work for the Ethernet addresses.

Signed-off-by: Cian Ferriter 
---
 p4c_bm/plugin/ovs/inc/lib/hash.c.h | 51 ++
 1 file changed, 51 insertions(+)
 create mode 100644 p4c_bm/plugin/ovs/inc/lib/hash.c.h

diff --git a/p4c_bm/plugin/ovs/inc/lib/hash.c.h 
b/p4c_bm/plugin/ovs/inc/lib/hash.c.h
new file mode 100644
index 000..8dfe0bc
--- /dev/null
+++ b/p4c_bm/plugin/ovs/inc/lib/hash.c.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2016 Nicira, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef OVS_LIB_HASH_C_H
+#define OVS_LIB_HASH_C_H 1
+
+/* -- Used in lib/flow.c -- */
+#define OVS_HASH_FIELDS \
+//::  for header_name in ordered_header_instances_regular:
+const struct _${header_name}_header *_${header_name}_header_ptr; \
+//::  #endfor
+\
+//::  for header_name in ordered_header_instances_regular:
+_${header_name}_header_ptr = MINIFLOW_GET_ADDRESS(flow, _${header_name}); \
+//::  #endfor
+\
+if (flow) { \
+//::  for header_name in ordered_header_instances_regular:
+//::for field_name, bit_width in 
ordered_header_instances_non_virtual_field__name_width[header_name]:
+//::  if bit_width == 8:
+hash = hash_add(hash, _${header_name}_header_ptr->${field_name}); \
+//::  elif bit_width == 16:
+hash = hash_add(hash, _${header_name}_header_ptr->${field_name}); \
+//::  elif bit_width == 32:
+hash = hash_add(hash, _${header_name}_header_ptr->${field_name}); \
+//::  elif bit_width == 64:
+hash = hash_add64(hash, _${header_name}_header_ptr->${field_name}); \
+//::  else:
+//::# NOTE: we assume that all fields are, at least, byte aligned.
+hash = hash_add64(hash, *(uint64_t 
*)_${header_name}_header_ptr->${field_name}.data & 0x); \
+//::  #endif
+//::#endfor
+\
+//::  #endfor
+} \
+\
+
+#endif  /* OVS_LIB_HASH_C_H */
-- 
2.7.4 (Apple Git-66)

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


[ovs-dev] [PATCH for p4c-behavioral 1/2] Adding OVS plugin

2016-09-19 Thread Muhammad Shahbaz
This adds a new plugin, called OVS, in p4c-behavioral. Given a P4 program,
the plugin generates a set of C (macro) code which is called at different
locations within the OVS codebase. The code under the plugin folder reflects the
same directory structure and files in which they are called in the OVS codebase.

---
 .../linux/compat/include/linux/openvswitch.h.h |  63 +++
 p4c_bm/plugin/ovs/inc/include/openvswitch/flow.h.h |  31 +
 .../ovs/inc/include/openvswitch/meta-flow.h.h  |  74 +++
 .../plugin/ovs/inc/include/openvswitch/packets.h.h |  93 +++
 .../plugin/ovs/inc/include/openvswitch/types.h.h   |  34 ++
 p4c_bm/plugin/ovs/inc/lib/dp-packet.h.h|  46 ++
 p4c_bm/plugin/ovs/inc/lib/flow.c.h | 625 +
 p4c_bm/plugin/ovs/inc/lib/match.c.h|  58 ++
 p4c_bm/plugin/ovs/inc/lib/meta-flow.c.h| 226 
 p4c_bm/plugin/ovs/inc/lib/nx-match.c.h |  60 ++
 p4c_bm/plugin/ovs/inc/lib/odp-execute.c.h  | 130 +
 p4c_bm/plugin/ovs/inc/lib/odp-util.c.h | 251 +
 p4c_bm/plugin/ovs/inc/lib/packets.c.h  |  63 +++
 p4c_bm/plugin/ovs/inc/lib/packets.h.h  |  51 ++
 .../plugin/ovs/inc/ofproto/ofproto-dpif-sflow.c.h  |  34 ++
 .../plugin/ovs/inc/ofproto/ofproto_dpif_sflow.c.h  |  33 ++
 p4c_bm/smart.py|  77 +++
 17 files changed, 1949 insertions(+)
 create mode 100644 
p4c_bm/plugin/ovs/inc/datapath/linux/compat/include/linux/openvswitch.h.h
 create mode 100644 p4c_bm/plugin/ovs/inc/include/openvswitch/flow.h.h
 create mode 100644 p4c_bm/plugin/ovs/inc/include/openvswitch/meta-flow.h.h
 create mode 100644 p4c_bm/plugin/ovs/inc/include/openvswitch/packets.h.h
 create mode 100644 p4c_bm/plugin/ovs/inc/include/openvswitch/types.h.h
 create mode 100644 p4c_bm/plugin/ovs/inc/lib/dp-packet.h.h
 create mode 100644 p4c_bm/plugin/ovs/inc/lib/flow.c.h
 create mode 100644 p4c_bm/plugin/ovs/inc/lib/match.c.h
 create mode 100644 p4c_bm/plugin/ovs/inc/lib/meta-flow.c.h
 create mode 100644 p4c_bm/plugin/ovs/inc/lib/nx-match.c.h
 create mode 100644 p4c_bm/plugin/ovs/inc/lib/odp-execute.c.h
 create mode 100644 p4c_bm/plugin/ovs/inc/lib/odp-util.c.h
 create mode 100644 p4c_bm/plugin/ovs/inc/lib/packets.c.h
 create mode 100644 p4c_bm/plugin/ovs/inc/lib/packets.h.h
 create mode 100644 p4c_bm/plugin/ovs/inc/ofproto/ofproto-dpif-sflow.c.h
 create mode 100644 p4c_bm/plugin/ovs/inc/ofproto/ofproto_dpif_sflow.c.h

diff --git 
a/p4c_bm/plugin/ovs/inc/datapath/linux/compat/include/linux/openvswitch.h.h 
b/p4c_bm/plugin/ovs/inc/datapath/linux/compat/include/linux/openvswitch.h.h
new file mode 100644
index 000..678207c
--- /dev/null
+++ b/p4c_bm/plugin/ovs/inc/datapath/linux/compat/include/linux/openvswitch.h.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2016 Nicira, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef OVS_DATAPATH_LINUX_COMPAT_INCLUDE_LINUX_OPENVSWITCH_H_H
+#defineOVS_DATAPATH_LINUX_COMPAT_INCLUDE_LINUX_OPENVSWITCH_H_H 1
+
+/* -- Used in datapath/linux/compat/include/linux/openvswitch.h -- */
+#define OVS_KEY_ATTRS \
+//::  # TODO: remove metadata that is not touched in the parser.
+//::  for header_name in ordered_header_instances_non_virtual:
+//::if header_name == "standard_metadata" or header_name == 
"intrinsic_metadata":
+//::  continue
+//::#endif
+OVS_KEY_ATTR__${header_name.upper()}, \
+//::  #endfor
+OVS_KEY_ATTR_VALID, \
+\
+
+/* -- Used in datapath/linux/compat/include/linux/openvswitch.h -- */
+#define OVS_KEY_STRUCTS \
+//::  # TODO: remove metadata that is not touched in the parser.
+//::  for header_name in ordered_header_instances_non_virtual:
+//::if header_name == "standard_metadata" or header_name == 
"intrinsic_metadata":
+//::  continue
+//::#endif
+struct ovs_key__${header_name} { \
+//::for field_name, bit_width in 
ordered_header_instances_non_virtual_field__name_width[header_name]:
+//::  if bit_width == 8:
+uint8_t ${field_name}; \
+//::  elif bit_width == 16:
+ovs_be16 ${field_name}; \
+//::  elif bit_width == 32:
+ovs_be32 ${field_name}; \
+//::  elif bit_width == 64:
+ovs_be64 ${field_name}; \
+//::  else:
+struct ${field_name}_t ${field_name}; \
+//::  #endif
+//::#endfor
+}; \
+\
+//::  #endfor
+struct ovs_key_valid { \
+//::  for header_name in 

[ovs-dev] [PATCH for p4c-behavioral 0/2] P4 support in OVS

2016-09-19 Thread Muhammad Shahbaz
Hi all,

We are submitting the following patches on this list for your review. These
patches contain changes to add support for P4 in OVS.

An earlier, proof-of-concept, implementation has been developed and published
in SIGCOMM this year:
http://pisces.cs.princeton.edu/papers/sigcomm16-pisces.pdf.

Now, our plan is to add this to the upstream OVS. As a first step, we are
providing support for adding new fields in OVS using P4. This includes
augmenting the flow struct, in OVS, with new fields; extending the
miniflow_strcut  function to parse these fields; and match-action tables to
operate on these fields. To understand the overall structure of the P4/OVS
compiler, please read our paper above, but, in short, there are two parts to
it. The first part is based on the p4c-behavioral repository
(https://github.com/p4lang/p4c-behavioral) from the p4lang organization, and
the second part is the changes made in the OVS repository, itself.

The following patches are for the p4c-behavioral repository. In p4c-behavioral
one can generate target-specific code for different backends. It allows you to
specify these backends as a plugin.

These patches create a new plugin, called OVS, in p4c-behavioral. The current
changes are for the userspace OVS implementation which can run with DPDK.

To test these changes, you can run the following command:

$ ./p4c-behavioral  --gen-dir  --plugin ovs

---
Cian Ferriter (1):
  Add 'hash.c.h' file to support P4 based hash calculation

Muhammad Shahbaz (1):
  adding OVS plugin

 .../linux/compat/include/linux/openvswitch.h.h |  63 +++
 p4c_bm/plugin/ovs/inc/include/openvswitch/flow.h.h |  31 +
 .../ovs/inc/include/openvswitch/meta-flow.h.h  |  74 +++
 .../plugin/ovs/inc/include/openvswitch/packets.h.h |  93 +++
 .../plugin/ovs/inc/include/openvswitch/types.h.h   |  34 ++
 p4c_bm/plugin/ovs/inc/lib/dp-packet.h.h|  46 ++
 p4c_bm/plugin/ovs/inc/lib/flow.c.h | 625 +
 p4c_bm/plugin/ovs/inc/lib/hash.c.h |  51 ++
 p4c_bm/plugin/ovs/inc/lib/match.c.h|  58 ++
 p4c_bm/plugin/ovs/inc/lib/meta-flow.c.h| 226 
 p4c_bm/plugin/ovs/inc/lib/nx-match.c.h |  60 ++
 p4c_bm/plugin/ovs/inc/lib/odp-execute.c.h  | 130 +
 p4c_bm/plugin/ovs/inc/lib/odp-util.c.h | 251 +
 p4c_bm/plugin/ovs/inc/lib/packets.c.h  |  63 +++
 p4c_bm/plugin/ovs/inc/lib/packets.h.h  |  51 ++
 .../plugin/ovs/inc/ofproto/ofproto-dpif-sflow.c.h  |  34 ++
 .../plugin/ovs/inc/ofproto/ofproto_dpif_sflow.c.h  |  33 ++
 p4c_bm/smart.py|  77 +++
 18 files changed, 2000 insertions(+)
 create mode 100644 
p4c_bm/plugin/ovs/inc/datapath/linux/compat/include/linux/openvswitch.h.h
 create mode 100644 p4c_bm/plugin/ovs/inc/include/openvswitch/flow.h.h
 create mode 100644 p4c_bm/plugin/ovs/inc/include/openvswitch/meta-flow.h.h
 create mode 100644 p4c_bm/plugin/ovs/inc/include/openvswitch/packets.h.h
 create mode 100644 p4c_bm/plugin/ovs/inc/include/openvswitch/types.h.h
 create mode 100644 p4c_bm/plugin/ovs/inc/lib/dp-packet.h.h
 create mode 100644 p4c_bm/plugin/ovs/inc/lib/flow.c.h
 create mode 100644 p4c_bm/plugin/ovs/inc/lib/hash.c.h
 create mode 100644 p4c_bm/plugin/ovs/inc/lib/match.c.h
 create mode 100644 p4c_bm/plugin/ovs/inc/lib/meta-flow.c.h
 create mode 100644 p4c_bm/plugin/ovs/inc/lib/nx-match.c.h
 create mode 100644 p4c_bm/plugin/ovs/inc/lib/odp-execute.c.h
 create mode 100644 p4c_bm/plugin/ovs/inc/lib/odp-util.c.h
 create mode 100644 p4c_bm/plugin/ovs/inc/lib/packets.c.h
 create mode 100644 p4c_bm/plugin/ovs/inc/lib/packets.h.h
 create mode 100644 p4c_bm/plugin/ovs/inc/ofproto/ofproto-dpif-sflow.c.h
 create mode 100644 p4c_bm/plugin/ovs/inc/ofproto/ofproto_dpif_sflow.c.h

--
2.7.4 (Apple Git-66)
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] khgj vjsaglh

2016-09-19 Thread schedule
This message was undeliverable due to the following reason:

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

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

Your message could not be delivered within 6 days:
Server 14.6.23.96 is not responding.

The following recipients did not receive this message:


Please reply to postmas...@aisling.stanford.edu
if you feel this message to be in error.

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


Re: [ovs-dev] Setting pmd-cpu-mask in cluster-on-die mode

2016-09-19 Thread Jeremias Blendin
Hello Mauricio,

thank you for the pointer to the bin-to-hex conversion, I knew it
looked strange but I could not see why m)
In any case, it was just an example, the actual configuration for
testing is correct.


2016-09-18 18:25 GMT+02:00 Mauricio Vasquez :
> Hello Jeremias,
>
>
> On 09/18/2016 05:46 PM, Jeremias Blendin wrote:
>>
>> Hi,
>>
>> I set pmd-cpu-mask on a server running its processors in
>> cluster-on-die mode. This means, that the actual cpu topology is shown
>> to the os as shown below.
>>
>> The problem I have is that although OVS is allowed to use all available
>> CPUs:
>>
>> $ ovs-vsctl --no-wait get Open_vSwitch . other_config:pmd-cpu-mask
>> "0x1787586c4fa8a01c71bc"
>> (=python hex(int('')))
>
> The cpu mask is calculated from a binary, so in your case if you want ovs to
> have access to all cores it should be 0xF... ->
> python hex(int('1...'), 2)
>
>
>> OVS only uses the CPUs that are located in the first NUMA Node where
>> the OS is running:
>> $ ovs-appctl dpif-netdev/pmd-stats-show | grep ^pmd
>> pmd thread numa_id 0 core_id 2:
>> pmd thread numa_id 0 core_id 12:
>> pmd thread numa_id 0 core_id 13:
>> pmd thread numa_id 0 core_id 14:
>>
>> I restarted OVS multiple times, I tried to pin queues to specific cores:
>>
>> ovs-vsctl set interface dpdk0 other_config:pmd-rxq-affinity="0:2,1:12"
>> ovs-vsctl set interface dpdk1 other_config:pmd-rxq-affinity="0:13,1:14"
>> ovs-vsctl set interface vif3 other_config:pmd-rxq-affinity="0:3,1:3"
>> ovs-vsctl set interface vif4 other_config:pmd-rxq-affinity="0:4,1:4"
>>
>> but with the same result, cores in other numa nodes are not used:
>>
>> /usr/local/var/log/openvswitch/ovs-vswitchd.log
>> 2016-09-18T15:25:04.327Z|00080|dpif_netdev|INFO|Created 4 pmd threads
>> on numa node 0
>> 2016-09-18T15:25:04.327Z|00081|dpif_netdev|WARN|There is no PMD thread
>> on core 3. Queue 0 on port 'vif3' will not be polled.
>> 2016-09-18T15:25:04.327Z|00082|dpif_netdev|WARN|There is no PMD thread
>> on core 4. Queue 0 on port 'vif4' will not be polled.
>> 2016-09-18T15:25:04.327Z|00083|dpif_netdev|WARN|There's no available
>> pmd thread on numa node 0
>> 2016-09-18T15:25:04.327Z|00084|dpif_netdev|WARN|There's no available
>> pmd thread on numa node 0
>>
>> The log output seems to indicate that only numa node 0 is used for
>> some reason? Can anyone confirm this?
>
> OVS only creates pmd threads in sockets where there are ports, in the case
> of physical ports the numa node is defined by where the ports are connected
> on the server, in the case of dpdkvhostuser ports, it is defined by where
> memory of the virtio device is allocated.

That is an interesting point, I create the dpdkvhostuser ports with
Open vSwitch:
ovs-vsctl add-port br0 vif0 -- set Interface vif0 type=dpdkvhostuser
How can I define which memory it should use?

>
> Probably in your case physical ports and the memory of the virtio devices
> are on socket0.
As COD is active, I have two numa nodes per socket. So yes, the VM and
OVS are located on socket 0 but in different numa nodes.
OVS has memory on all nodes (4G), the VM has only memory on numa node 1.
However, this numa node (1) is never used by OVS, although the VM is
located there. I guess I could fix this issue by deactivating COD, but
this
has other drawbacks. Is there any way to directly tell OVS to run pmds
on a specific numa node? I understand that runnings pmds on a
different socket
might be an issue, but it seems weird to me that pmds cannot run on a
different numa node on the same socket.

Thanks!

Jeremias

>
> Regards,
>
> Mauricio Vasquez
>>
>> Best regards,
>>
>> Jeremias
>>
>>
>> ovs-vsctl show
>>  Bridge "br0"
>>  Controller "tcp::6633"
>>  is_connected: true
>>  Port "vif0"
>>  Interface "vif0"
>>  type: dpdkvhostuser
>>  options: {n_rxq="2"}
>>  Port "dpdk1"
>>  Interface "dpdk1"
>>  type: dpdk
>>  options: {n_rxq="2"}
>>  Port "vif3"
>>  Interface "vif3"
>>  type: dpdkvhostuser
>>  options: {n_rxq="2"}
>>  Port "dpdk0"
>>  Interface "dpdk0"
>>  type: dpdk
>>  options: {n_rxq="2"}
>>  Port "vif1"
>>  Interface "vif1"
>>  type: dpdkvhostuser
>>  options: {n_rxq="2"}
>>  Port "br0"
>>  Interface "br0"
>>  type: internal
>>  Port "vif4"
>>  Interface "vif4"
>>  type: dpdkvhostuser
>>  options: {n_rxq="2"}
>>  ovs_version: "2.6.90"
>>
>>
>> OVS (last commit):
>> commit 75e2077e0c43224bcca92746b28b01a4936fc101
>> Author: Thadeu Lima de Souza Cascardo 
>> Date:   Fri Sep 16 15:52:48 2016 -0300
>>
>>
>> CPU topology:
>> lstopo -p
>>
>> Machine (252GB total)
>>Package P#0
>>  

Re: [ovs-dev] [PATCH RFC v3] ovn-northd: add default_dhcpvx_options for Logical_Switch

2016-09-19 Thread Zong Kai Li
On Thu, Sep 15, 2016 at 7:48 AM, Ben Pfaff  wrote:
> On Thu, Sep 01, 2016 at 09:56:30AM +, Zongkai LI wrote:
>> This patch adds default_dhcpv4_options and default_dhcpv6_options columns for
>> Logical_Switch, which should help CMS not to calculate and set dhcpv4_options
>> and dhcpv6_options columns for lswitch ports on lswitchs one by one, when
>> most of lswitch ports on the same lswitch are using the DHCPv4_Options and
>> DHCPv6_Options. Default DHCP(v4 and v6) Options should benefit in case
>> scalling up and DB synchronization between CMS and OVN NB.
>>
>> v1 -> v2
>> add ACL lflows support for lswitch ports using default_dhcpvx_options from
>> lswitch.
>>
>> v2 -> v3
>> update ovn dhcpv4 and dhcpv6 tests for lswitch ports using specific dhcp
>> options than defualt ones in lswitch.
>
> The CMS can point the multiple dhcpvx_options column in as many rows as
> it likes to the same row in the DHCP_Options table, so I don't know why
> this offers an advantage.

Sorry for my poor english, I couldn't get your points well.
"The CMS can point the multiple dhcpvx_options column in as many rows
as it likes to the same row in the DHCP_Options table", do you mean
the CMS can point multiple options in a DHCP_Options row option column
? This patch won't help CMS on that.

The deep reason I submitted this patch is, we locate a DHCP_Options
row for Logical_Switch_Port.dhcpvx_options to refer by scanning
DHCP_Options table to find a row matching some rules we defined. Like
"subnet_id" and "port_id" defined in external_ids column, the
OpenStack integrator, networking-ovn uses them to locate a certain
DHCP_Options row for a port to set its dhcpvx_options.

It works, but not necessary for case [1] most ports from the same
logical-switch using the same dhcpvx_options, since we will locate the
same uuid duplicately.
It's possible for CMS to use some cache to store mappings between
networks/subnets and  DHCP_Options rows uuids, but I don't think this
is a CMS-friendly approach.

By adding default dhcpvx options in Logical_Switch, CMS will skip the
scanning step for ports using the default dhcp options cases, such as
creating a new port, logical switch port lost with/without dhcp
options lost(or become stale) when DB sync, and logical switch port
exist but dhcp options lost when DB sync.

This is a option way let CMS to handle dhcp options, it won't change
current approach how DHCP_Options and
Logical_Switch_Port.dhcpvx_options works. It won't benefit too much
scenarios, but at least for case [1] it would.

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