[ovs-dev] [PATCH] Makefile: Drop vestiges of support for non-GNU Make.

2017-03-07 Thread Ben Pfaff
Open vSwitch has documented a requirement for GNU Make for a long time, yet
it had vestiges catering to other make implementations.  This removes
those.

Signed-off-by: Ben Pfaff 
---
 Makefile.am  |  6 --
 acinclude.m4 | 54 ++
 configure.ac |  3 +--
 3 files changed, 3 insertions(+), 60 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 90f5c0353811..c853085b9ca9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -184,11 +184,6 @@ CLEAN_LOCAL += clean-pycov
 
 # If we're checked out from a Git repository, make sure that every
 # file that is in Git is distributed.
-#
-# We only enable this check when GNU make is in use because the
-# Makefile in datapath/linux, needed to get the list of files to
-# distribute, requires GNU make extensions.
-if GNU_MAKE
 ALL_LOCAL += dist-hook-git
 dist-hook-git: distfiles
@if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1; then \
@@ -220,7 +215,6 @@ distfiles: Makefile
  -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t" | \
  LC_ALL=C sort -u > $@
 CLEANFILES += distfiles
-endif
 .PHONY: dist-hook-git
 
 # Check that every .c file includes .
diff --git a/acinclude.m4 b/acinclude.m4
index 19cffe08c894..5bbca0b22a9e 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -1,6 +1,6 @@
 # -*- autoconf -*-
 
-# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Nicira, 
Inc.
+# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017 
Nicira, Inc.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -873,53 +873,6 @@ AC_DEFUN([OVS_CHECK_XENSERVER_VERSION],
   ;;
   esac])
 
-dnl OVS_MAKE_HAS_IF([if-true], [if-false])
-dnl
-dnl Checks whether make has the GNU make $(if condition,then,else) extension.
-dnl Runs 'if-true' if so, 'if-false' otherwise.
-AC_DEFUN([OVS_CHECK_MAKE_IF],
-  [AC_CACHE_CHECK(
- [whether ${MAKE-make} has GNU make \$(if) extension],
- [ovs_cv_gnu_make_if],
- [cat <<'EOF' > conftest.mk
-conftest.out:
-   echo $(if x,y,z) > conftest.out
-.PHONY: all
-EOF
-  rm -f conftest.out
-  AS_ECHO(["$as_me:$LINENO: invoking ${MAKE-make} -f conftest.mk all:"]) 
>&AS_MESSAGE_LOG_FD 2>&1
-  ${MAKE-make} -f conftest.mk conftest.out >&AS_MESSAGE_LOG_FD 2>&1
-  AS_ECHO(["$as_me:$LINENO: conftest.out contains:"]) >&AS_MESSAGE_LOG_FD 
2>&1
-  cat conftest.out >&AS_MESSAGE_LOG_FD 2>&1
-  result=`cat conftest.out`
-  rm -f conftest.mk conftest.out
-  if test "X$result" = "Xy"; then
-ovs_cv_gnu_make_if=yes
-  else
-ovs_cv_gnu_make_if=no
-  fi])])
-
-dnl OVS_CHECK_GNU_MAKE
-dnl
-dnl Checks whether make is GNU make (because Linux kernel Makefiles
-dnl only work with GNU make).
-AC_DEFUN([OVS_CHECK_GNU_MAKE],
-  [AC_CACHE_CHECK(
- [whether ${MAKE-make} is GNU make],
- [ovs_cv_gnu_make],
- [rm -f conftest.out
-  AS_ECHO(["$as_me:$LINENO: invoking ${MAKE-make} --version:"]) 
>&AS_MESSAGE_LOG_FD 2>&1
-  ${MAKE-make} --version >conftest.out 2>&1
-  cat conftest.out >&AS_MESSAGE_LOG_FD 2>&1
-  result=`cat conftest.out`
-  rm -f conftest.mk conftest.out
-
-  case $result in # (
-GNU*) ovs_cv_gnu_make=yes ;; # (
-*) ovs_cv_gnu_make=no ;;
-  esac])
-   AM_CONDITIONAL([GNU_MAKE], [test $ovs_cv_gnu_make = yes])])
-
 dnl OVS_CHECK_SPARSE_TARGET
 dnl
 dnl The "cgcc" script from "sparse" isn't very good at detecting the
@@ -951,14 +904,11 @@ AC_DEFUN([OVS_SPARSE_EXTRA_INCLUDES],
 dnl OVS_ENABLE_SPARSE
 AC_DEFUN([OVS_ENABLE_SPARSE],
   [AC_REQUIRE([OVS_CHECK_SPARSE_TARGET])
-   AC_REQUIRE([OVS_CHECK_MAKE_IF])
AC_REQUIRE([OVS_SPARSE_EXTRA_INCLUDES])
: ${SPARSE=sparse}
AC_SUBST([SPARSE])
AC_CONFIG_COMMANDS_PRE(
- [if test $ovs_cv_gnu_make_if = yes; then
-CC='$(if $(C),env REAL_CC="'"$CC"'" CHECK="$(SPARSE) -I 
$(top_srcdir)/include/sparse $(SPARSEFLAGS) $(SPARSE_EXTRA_INCLUDES) " cgcc 
$(CGCCFLAGS),'"$CC"')'
-  fi])])
+ [CC='$(if $(C),env REAL_CC="'"$CC"'" CHECK="$(SPARSE) -I 
$(top_srcdir)/include/sparse $(SPARSEFLAGS) $(SPARSE_EXTRA_INCLUDES) " cgcc 
$(CGCCFLAGS),'"$CC"')'])])
 
 dnl OVS_PTHREAD_SET_NAME
 dnl
diff --git a/configure.ac b/configure.ac
index 6d75a57696f6..671fce7fbb52 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Nicira, 
Inc.
+# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017 
Nicira, Inc.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -120,7 +120,6 @@ OVS_CHECK_VALGRIND
 OVS_CHECK_SOCKET_LIBS
 OVS_CHECK_XENSERVER_VERSION
 OVS_CHECK_GROFF
-OVS_CHECK_GNU_MAKE
 OVS_CHECK_TLS
 OVS_CHECK_ATOMIC_LIBS
 OVS_CHECK_GCC4_ATOMICS
-- 
2.10.2

___
dev mailing list
d...@openvswitch.org

Re: [ovs-dev] [PATCH v3 00/22] Conntrack enhancements

2017-03-07 Thread Joe Stringer
On 6 March 2017 at 16:22, Jarno Rajahalme  wrote:
> This patch set backports the recent upstream conntrack fixes and new
> features to the OVS tree kernel module, and adds the OVS userspace
> support.
>
> Patch 1/22 is an unrelated datapath backport, and patch 22/22 allows
> compiling against Linux 4.10.
>
> Each new feature is introduced in two different commits, the first is
> the datapath backport, the second the corresponding userspace datapath
> and non-datapath functionality, including OVS system tests.  In one
> instance I have squashed the system test with the datapath backport.
> Compile would fail after the first patch due to missing userspace code
> for new enums.  We may decide to squash the datapath and userspace
> changes together for the merge, but for now the review should be more
> straightforward with the separation.
>
> System tests have been most recently run on Linux 3.16, on which the
> geneve tests fail, but that should have nothing to do with this
> series.
>
> v3: Address Joe's feedback.

I saw some minor issues which I commented on - primarily style and one
functional question in patch #15, otherwise I see a few areas for
improvement:

* System-traffic tests do not check for ct_orig_tuple support before
running, so on kernels without support the new tests fail
* There is no OpenFlow-layer rejection of matches on ct_orig_tuple
OXMs, or resubmit(,,ct) when there is no datapath support for
ct_orig_tuple.
* Similarly ct(force) doesn't have any OpenFlow-visible error
reporting based on datapath support

These could be addressed in subsequent patches, so long as they make
it before 2.8.

For the whole series:
Acked-by: Joe Stringer 
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 15/21] odp: Support conntrack orig tuple key.

2017-03-07 Thread Joe Stringer
On 23 February 2017 at 16:19, Jarno Rajahalme  wrote:
> Userspace support for datapath original direction conntrack tuple.
>
> Signed-off-by: Jarno Rajahalme 

check_mask() can also be updated to prevent controllers from matching
on the fields when they will not be populated by the datapath.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v3 17/22] actions: Add resubmit with conntrack tuple.

2017-03-07 Thread Joe Stringer
On 6 March 2017 at 16:22, Jarno Rajahalme  wrote:
> Add resubmit option to use the conntrack original direction tuple
> swapped with the corresponding packet header fields during the lookup.
> This could allow the same ACL table be used for admitting return
> and/or related traffic as is used for admitting the original direction
> traffic.
>
> Signed-off-by: Jarno Rajahalme 
> ---

I think that this new resubmit action should be rejected from OVS if
the datapath doesn't support ct_orig_tuple.

check_actions() in ofproto-dpif.c checks some of the CT actions, this
could check the resubmit action, using support->ct_orig_tuple and
return an error.

Minor style comments below.

> @@ -3961,10 +3983,12 @@ encode_RESUBMIT(const struct ofpact_resubmit 
> *resubmit,
>  uint16_t in_port = ofp_to_u16(resubmit->in_port);
>
>  if (resubmit->table_id == 0xff
> -&& resubmit->ofpact.raw != NXAST_RAW_RESUBMIT_TABLE) {
> +&& resubmit->ofpact.raw == NXAST_RAW_RESUBMIT) {
>  put_NXAST_RESUBMIT(out, in_port);
>  } else {
> -struct nx_action_resubmit *nar = put_NXAST_RESUBMIT_TABLE(out);
> +struct nx_action_resubmit *nar;
> +nar = resubmit->with_ct_orig
> +? put_NXAST_RESUBMIT_TABLE_CT(out) : 
> put_NXAST_RESUBMIT_TABLE(out);

IMO easier to parse if the '?' and ':' are lined up, but I guess
that's not actually defined in style guide..

> @@ -3487,6 +3533,17 @@ xlate_table_action(struct xlate_ctx *ctx, ofp_port_t 
> in_port, uint8_t table_id,
>
>  ctx->table_id = table_id;
>
> +/* Swap packet fields with CT 5-tuple if requested. */
> +if (with_ct_orig) {
> +/* Do not swap if there is no CT tuple, or if key is not IP. */
> +if (ctx->xin->flow.ct_nw_proto == 0 ||

If the line is too big, || usually begins the next line, indented to
align below the first character after the opening ( of the current
indentation of if condition.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] vagrant: Use official boxes for Fedora and Centos

2017-03-07 Thread Andy Zhou
On Thu, Feb 9, 2017 at 6:00 AM, Timothy Redaelli  wrote:
> Change CentOS version to last 7 (7.3 at the moment)
> since old kernel-devel version is no longer available
>
> Add net-tools to CentOS since netstat is needed for some tests
>
> Signed-off-by: Timothy Redaelli 
Pushed. Thanks (and sorry for the delay).
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v4 2/2] tunneling: Avoid recirculation on datapath by computing the recirculate actions at translate time.

2017-03-07 Thread Ben Pfaff
On Thu, Feb 09, 2017 at 03:41:54PM +, Sugesh Chandran wrote:
> Openvswitch datapath recirculates packets for tunneling, i.e.
> the incoming packets are encapsulated at first pass. Further actions are
> applied on encapsulated packets on the second pass after recirculating.
> The proposed patch compute and append the post tunnel actions at the time of
> translation itself instead of recirculating at datapath. These actions are 
> solely
> depends on tunnel attributes so there is no need of datapath recirculation.
> By avoiding the recirculation at datapath, the patch offers upto 30%
> performance improvement for VxLAN tunneling in our testing.
> The action execution logic is using the new CLONE action to define
> the packet cloning when the actions are combined. The lenght in the CLONE
> action specifies the size of nested action set.
> 
> Also fixing the test suites failures that are introduced by CLONE action in
> tunneling except the ovn test case 2299.

I guess by this you mean that this test still consistently fails?
  2301: ovn -- 1 LR with distributed router gateway port FAILED (ovn.at:6658)

What's the plan for that, presumably we can't apply a patch that causes
test failures?
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v4 1/2] odp-execute : Apply clone action on batch of packets instead of one by one.

2017-03-07 Thread Ben Pfaff
On Thu, Feb 09, 2017 at 03:41:53PM +, Sugesh Chandran wrote:
> Clone action is optimized by cloning a batch of packets together instead of
> executing independently on every packet in a batch.
> 
> Rebased onto commit: edb417cc256e7d5f02f230867865c8cf7f26e542
>  ovs-ofctl: fix memory leak reported by valgrind.
> 
> Signed-off-by: Sugesh Chandran 
> Signed-off-by: Zoltán Balogh 
> Co-authored-by: Zoltán Balogh 

I applied this to master.  Thank you!x
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] Makefile: Break the build if .gitignore files are distributed.

2017-03-07 Thread Ben Pfaff
On Wed, Mar 08, 2017 at 12:33:47AM +, Markos Chandras wrote:
> Hi Ben,
> 
> On 03/08/2017 12:29 AM, Ben Pfaff wrote:
> > This would have found a .gitignore file recently added to the distribution.
> > 
> > CC: Markos Chandras 
> > CC: Alin Gabriel Serdean 
> > Signed-off-by: Ben Pfaff 
> > ---
> 
> Looks reasonable to me. Thank you
> 
> Reviewed-by: Markos Chandras 

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


Re: [ovs-dev] [PATCH 2/2] doc: Add info on distributions shipping openvswitch package.

2017-03-07 Thread Ben Pfaff
On Tue, Feb 07, 2017 at 09:18:23PM +, Bhanuprakash Bodireddy wrote:
> List details of various popular distributions shipping Open vSwitch
> packages. Also include the information of the distros supporting DPDK
> accelerated datapath.
> 
> Signed-off-by: Bhanuprakash Bodireddy 

Thanks for writing documentation!  I applied this to master and
branch-2.7.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 1/2] Documentation: Update DPDK doc with extended statistics.

2017-03-07 Thread Ben Pfaff
On Tue, Feb 07, 2017 at 09:18:22PM +, Bhanuprakash Bodireddy wrote:
> Add instructions on how to retrieve extended statistics for DPDK physical
> and vhost ports.
> 
> Signed-off-by: Bhanuprakash Bodireddy 

Applied to master, let me know if this should also be on branch-2.7.

Thank you!

I folded in Rami's suggestions.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v2] windows: Fix uninitialized variable in netlink-socket

2017-03-07 Thread Ben Pfaff
On Mon, Mar 06, 2017 at 04:22:39PM +, Alin Serdean wrote:
> From: Alin Serdean 
> 
> The variable `request_nlmsg` was used without being initialized.
> 
> This patch assigns a value to it before being used.
> 
> Found by inspection.
> 
> Signed-off-by: Alin Gabriel Serdean 
> ---
> v2: Change commit title

Applied to master, branch-2.7, branch-2.6.  Thank you!
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] Makefile: Break the build if .gitignore files are distributed.

2017-03-07 Thread Markos Chandras
Hi Ben,

On 03/08/2017 12:29 AM, Ben Pfaff wrote:
> This would have found a .gitignore file recently added to the distribution.
> 
> CC: Markos Chandras 
> CC: Alin Gabriel Serdean 
> Signed-off-by: Ben Pfaff 
> ---

Looks reasonable to me. Thank you

Reviewed-by: Markos Chandras 

-- 
markos

SUSE LINUX GmbH | GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg) Maxfeldstr. 5, D-90409, Nürnberg
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] windows: automake.mk: Remove the .gitignore file from distributed files

2017-03-07 Thread Ben Pfaff
On Sat, Feb 04, 2017 at 05:11:11PM +, Markos Chandras wrote:
> Commit d183efc22b2b ("This commit adds the windows installer to the
> OVS tree.) added the .gitignore file to the distributed files but this
> file shouldn't be part of the distributed archive.
> 
> Cc: Alin Gabriel Serdean 
> Signed-off-by: Markos Chandras 

Thanks, applied to master and branch-2.7.

I sent out a patch that, if applied, will make this unlikely to recur:
https://patchwork.ozlabs.org/patch/736410/
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH] Makefile: Break the build if .gitignore files are distributed.

2017-03-07 Thread Ben Pfaff
This would have found a .gitignore file recently added to the distribution.

CC: Markos Chandras 
CC: Alin Gabriel Serdean 
Signed-off-by: Ben Pfaff 
---
 Makefile.am | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index cdf42d3ad244..90f5c0353811 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2016 Nicira, Inc.
+# Copyright (C) 2007-2017 Nicira, Inc.
 #
 # Copying and distribution of this file, with or without modification,
 # are permitted in any medium without royalty provided the copyright
@@ -203,6 +203,11 @@ dist-hook-git: distfiles
cat missing-distfiles; \
exit 1; \
  fi; \
+ if LC_ALL=C grep '\.gitignore$$' all-distfiles; then \
+   echo "See above for list of files that are distributed but"; \
+   echo "should not be."; \
+   exit 1; \
+ fi \
fi
 CLEANFILES += all-distfiles all-gitfiles missing-distfiles
 # The following is based on commands for the Automake "distdir" target.
-- 
2.10.2

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


Re: [ovs-dev] [PATCH v3 1/3] ovn: specify options:nat-addresses as "router"

2017-03-07 Thread Ben Pfaff
On Thu, Feb 02, 2017 at 08:48:24PM -0800, Mickey Spiegel wrote:
> Currently in OVN, the "nat-addresses" in the "options" column of a
> logical switch port of type "router" must be specified manually.
> Typically the user would specify as "nat-addresses" all of the NAT
> external IP addresses and load balancer IP addresses that have
> already been specified separately on the router.
> 
> This patch allows the logical switch port's "nat-addresses" to be
> specified as the string "router".  When ovn-northd sees this string,
> it automatically copies the following into the southbound
> Port_Binding's "nat-addresses" in the "options" column:
> The options:router-port's MAC address.
> Each NAT external IP address (of any NAT type) specified on the
> logical router of options:router-port.
> Each load balancer IP address specified on the logical router of
> options:router-port.
> This will cause the controller where the gateway router resides to
> issue gratuitous ARPs for each NAT external IP address and for each
> load balancer IP address specified on the gateway router.
> 
> This patch is written as if it will be included in OVS 2.7.  If it
> is deferred to OVS 2.8, then the OVS version mentioned in ovn-nb.xml
> will need to be updated from OVS 2.7 to OVS 2.8.
> 
> Signed-off-by: Mickey Spiegel 
> Acked-by: Gurucharan Shetty 

I applied this to master and adjusted it to talk about OVS 2.8.

Guru, are you planning to review patches 2 and 3?  Otherwise, let me
know, and I'll try to do it myself.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v3 16/22] odp: Support conntrack orig tuple key.

2017-03-07 Thread Joe Stringer
On 6 March 2017 at 16:22, Jarno Rajahalme  wrote:
> Userspace support for datapath original direction conntrack tuple.
>
> Signed-off-by: Jarno Rajahalme 

Minor comments below, but otherwise:

Acked-by: Joe Stringer 

> diff --git a/lib/conntrack.c b/lib/conntrack.c
> index 677c0d2..8ae501b 100644
> --- a/lib/conntrack.c
> +++ b/lib/conntrack.c
> @@ -159,12 +159,44 @@ static unsigned hash_to_bucket(uint32_t hash)
>
>  static void
>  write_ct_md(struct dp_packet *pkt, uint16_t state, uint16_t zone,
> -uint32_t mark, ovs_u128 label)
> +const struct conn *conn, const struct conn_key *key)
>  {
>  pkt->md.ct_state = state | CS_TRACKED;
>  pkt->md.ct_zone = zone;
> -pkt->md.ct_mark = mark;
> -pkt->md.ct_label = label;
> +pkt->md.ct_mark = conn ? conn->mark : 0;
> +pkt->md.ct_label = conn ? conn->label : OVS_U128_ZERO;
> +
> +/* Use the original direction tuple if we have it. */
> +if (conn) {
> +key = &conn->key;
> +}
> +pkt->md.ct_orig_tuple_ipv6 = false;
> +if (key) {
> +if (key->dl_type == htons(ETH_TYPE_IP)) {
> +pkt->md.ct_orig_tuple.ipv4 = (struct ovs_key_ct_tuple_ipv4) {
> +key->src.addr.ipv4_aligned,
> +key->dst.addr.ipv4_aligned,
> +key->nw_proto != IPPROTO_ICMP
> +? key->src.port : htons(key->src.icmp_type),

I think the style usually lines up '?' and ':' so the two alternatives
can be clearly seen. IMHO this is easier to read (yeah, I guess it
doesn't come out right in email but it should be right in the code):

 key->nw_proto != IPPROTO_ICMP ? key->src.port
   : htons(key->src.icmp_type),

> +key->nw_proto != IPPROTO_ICMP
> +? key->dst.port : htons(key->src.icmp_code),
> +key->nw_proto,
> +};
> +} else if (key->dl_type == htons(ETH_TYPE_IPV6)) {
> +pkt->md.ct_orig_tuple_ipv6 = true;
> +pkt->md.ct_orig_tuple.ipv6 = (struct ovs_key_ct_tuple_ipv6) {
> +key->src.addr.ipv6_aligned,
> +key->dst.addr.ipv6_aligned,
> +key->nw_proto != IPPROTO_ICMPV6
> +? key->src.port : htons(key->src.icmp_type),
> +key->nw_proto != IPPROTO_ICMPV6
> +? key->dst.port : htons(key->src.icmp_code),
> +key->nw_proto,
> +};
> +}
> +} else {
> +memset(&pkt->md.ct_orig_tuple, 0, sizeof pkt->md.ct_orig_tuple);
> +}
>  }

I think I missed this before, but it seems like 'key' is never used in
this function. I think it could be simplified a bit.

There are two callers:
write_ct_md(pkt, state, zone, conn, &ctx->key);
write_ct_md(pkts[i], CS_INVALID, zone, NULL, NULL);

In the former case, 'conn' is specified, so within the function 'key'
is set to &conn->key, then in the latter case both 'conn' and 'key'
are NULL, so we only need to zero the whole orig_tuple.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v2] packet: proper return type for vlan_tci_to_pcp()

2017-03-07 Thread Ben Pfaff
On Thu, Feb 02, 2017 at 03:31:03PM -0800, Shu Shen wrote:
> On Thu, Feb 02, 2017 at 03:08:09PM -0800, Ben Pfaff wrote:
> > On Thu, Feb 02, 2017 at 02:55:03PM -0800, Shu Shen wrote:
> > > On Tue, Jan 31, 2017 at 10:45:31AM -0800, Ben Pfaff wrote:
> > > > By my count, vlan_tci_to_pcp() is used in printf-like format
> > > > specifiers in 7 places in the tree.  Before this patch, it is used
> > > > with the following format specifiers:
> > > > 
> > > > %d  3 times %x  1 time PRIu8   1 time PRIx8   1 time
> > > > 
> > > > Both %d and %x are obviously correct, portable format specifiers for
> > > > int, which is the return type of vlan_tci_to_pcp().  I contend that
> > > > PRIu8 and PRIx8 should be acceptable too because the integer
> > > > promotions convert uint8_t to int anyway.
> > > The problem is that PRIu8 and PRIx8 the specifiers are not promoted to
> > > 'u' and 'x' respectively on macOS.
> > > 
> > > For example, for PRIu*, on Mac OS, /usr/include/inttypes.h:
> > > 
> > >  #  define __PRI_8_LENGTH_MODIFIER__ "hh"
> > >  #  define __PRI_64_LENGTH_MODIFIER__ "ll"
> > >  #  define PRIu8 __PRI_8_LENGTH_MODIFIER__ "u"
> > >  #  define PRIu16"hu"
> > >  #  define PRIu32"lu"
> > >  #  define PRIu64__PRI_64_LENGTH_MODIFIER__ "u"
> > > 
> > > While on Linux/glibc, /usr/include/inttypes.h:
> > > 
> > >  # define PRIu8  "u"
> > >  # define PRIu16 "u"
> > >  # define PRIu32 "u"
> > >  # define PRIu64 __PRI64_PREFIX "u"
> > > 
> > > where all PRIu* except PRIu64 are the same.
> > > 
> > > Therefore, using PRIu8 or PRIx8 with the int return type of
> > > vlan_tci_to_pcp() is causing compiler warnings on macOS.
> > 
> > What are the warnings?
> See https://travis-ci.org/openvswitch/ovs/jobs/197378752#L1303
> There are plenty of other warnings due to similar situation (if they are
> not problems).
> 
> > 
> > There is no real problem with using %hhd or %hhu to print an int,
> > because printf() cannot tell the difference between an int and a char:
> > they are both passed as int.
> You may be right about printf with regard to an int and a char. But how
> about an int specifier and a long variable?
> 
> When I noticed the Wformat warning messages on macOS, I have no idea
> whether there is a hidden issue where the format specifier might be
> truncating a variable.
> 
> The only way to be sure is to clean up the code base to remove the
> warning messages even if they are just noise.

I sent a patch that does this the way that makes more sense to me:
https://patchwork.ozlabs.org/patch/736405/

Thank you for raising the issue.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH] Fix format specifier technicalities.

2017-03-07 Thread Ben Pfaff
Various printf() format specifiers in the tree had minor technical issues
which the Mac OS build reported, e.g. here:
https://s3.amazonaws.com/archive.travis-ci.org/jobs/208718342/log.txt

These tend to fall into two categories of harmless warnings:

1. Wrong width for types that are all promoted to 'int'.  For example,
both uint8_t and uint16_t are both promoted to 'int' as part of a call
to printf(), but using PRIu8 for a uint16_t causes a warning.

2. Wrong format specifier for type promoted to 'int' due to arithmetic.
For example, if 'x' is a uint8_t, then x >> 1 has type 'int' due to
C's promotion rules, so the correct format specifier is %d and using
PRIu8 will cause a warning.

This commit fixes the warnings.  I didn't see anything that rose to the
level of a bug.

These warnings only showed up on Mac OS X because of differences in the
format specifiers that Mac OS uses for PRI*.

Reported-by: Shu Shen 
Signed-off-by: Ben Pfaff 
---
 lib/bfd.c|  4 ++--
 lib/match.c  |  6 +++---
 lib/multipath.c  |  4 ++--
 lib/odp-util.c   | 10 +-
 lib/ofp-actions.c| 12 ++--
 lib/ofp-print.c  |  2 +-
 lib/ofp-util.c   |  2 +-
 lib/ovs-router.c |  4 ++--
 ofproto/ofproto-dpif-xlate.c |  2 +-
 tests/test-netflow.c |  4 ++--
 utilities/ovs-ofctl.c|  2 +-
 vswitchd/bridge.c|  4 ++--
 12 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/lib/bfd.c b/lib/bfd.c
index 87f3322ee461..1fb1cfb2bc34 100644
--- a/lib/bfd.c
+++ b/lib/bfd.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2014, 2015, 2016 Nicira, Inc.
+/* Copyright (c) 2013, 2014, 2015, 2016, 2017 Nicira, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -1061,7 +1061,7 @@ log_msg(enum vlog_level level, const struct msg *p, const 
char *message,
 
 ds_put_format(&ds,
   "%s: %s."
-  "\n\tvers:%"PRIu8" diag:\"%s\" state:%s mult:%"PRIu8
+  "\n\tvers:%d diag:\"%s\" state:%s mult:%"PRIu8
   " length:%"PRIu8
   "\n\tflags: %s"
   "\n\tmy_disc:0x%"PRIx32" your_disc:0x%"PRIx32
diff --git a/lib/match.c b/lib/match.c
index 3fcaec5b08ca..6bbd34820aa1 100644
--- a/lib/match.c
+++ b/lib/match.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Nicira, Inc.
+ * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017 Nicira, 
Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -1281,11 +1281,11 @@ match_format(const struct match *match, struct ds *s, 
int priority)
   colors.param, colors.end, f->nw_tos & IP_DSCP_MASK);
 }
 if (wc->masks.nw_tos & IP_ECN_MASK) {
-ds_put_format(s, "%snw_ecn=%s%"PRIu8",",
+ds_put_format(s, "%snw_ecn=%s%d,",
   colors.param, colors.end, f->nw_tos & IP_ECN_MASK);
 }
 if (wc->masks.nw_ttl) {
-ds_put_format(s, "%snw_ttl=%s%"PRIu8",",
+ds_put_format(s, "%snw_ttl=%s%d,",
   colors.param, colors.end, f->nw_ttl);
 }
 if (wc->masks.mpls_lse[0] & htonl(MPLS_LABEL_MASK)) {
diff --git a/lib/multipath.c b/lib/multipath.c
index 8a1d1fadcf74..7eb919423a15 100644
--- a/lib/multipath.c
+++ b/lib/multipath.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2011, 2012, 2013, 2014, 2016 Nicira, Inc.
+ * Copyright (c) 2010, 2011, 2012, 2013, 2014, 2016, 2017 Nicira, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -248,7 +248,7 @@ multipath_format(const struct ofpact_multipath *mp, struct 
ds *s)
 algorithm = "";
 }
 
-ds_put_format(s, "%smultipath(%s%s,%"PRIu16",%s,%d,%"PRIu16",",
+ds_put_format(s, "%smultipath(%s%s,%"PRIu16",%s,%d,%"PRIu32",",
   colors.paren, colors.end, fields, mp->basis, algorithm,
   mp->max_link + 1, mp->arg);
 mf_format_subfield(&mp->dst, s);
diff --git a/lib/odp-util.c b/lib/odp-util.c
index a8218566e05e..527496e4d68f 100644
--- a/lib/odp-util.c
+++ b/lib/odp-util.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Nicira, Inc.
+ * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017 Nicira, 
Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -183,7 +183,7 @@ format_generic_odp_action(struct ds *ds, const struct 
nlattr *a)
 {
 size_t len = nl_attr_get_size(a);
 
-ds_put_format(ds, "action%"PRId16, nl_attr_type(a));
+ds_put_format(ds, "action%d", nl_attr_type(a));
 if (len) {
 const uint8_t *unspec;
 unsigned int i;
@@

[ovs-dev] Auditoría - Organizar y Optimizar Costos

2017-03-07 Thread Actúe oportunamente en tiempos de crisis
Este mes de Marzo le invitamos a adquirir uno de nuestros planes online, los 
cuáles constan de 12 Temas que son utilizables durante 3 meses, las 24 hrs del 
día, las veces que usted así lo requiera.

En Específico le ofrecemos el plan de Auditoría que consta de 12 temas los 
cuales les enlistamos seguidamente.

1. Conceptos Básicos de Auditoría y Control Interno para No Auditores.
2. Auditoría Administrativa.
3. Auditoría Forense en la Investigación Criminal del Lavado de Dinero y 
Activos.
4. Auditoría Informática.
5. Auditoría de Recursos Humanos.
6. Auditoría de Compras.
7. Auditoría Financiera.
8. Auditorías de Calidad.
9. Redacción de Informes de Auditoría.
10. Recomendaciones Legales y Administrativas para Enfrentar Fraudes. Personas 
Físicas, Personas Morales e Instituciones Gubernamentales.
11. Liderazgo, Coaching y Manejo de Conflictos.
12. Todo lo que el Director debe saber de las Auditorías y sus Auditores. 


Para que usted recibá la información completa de este plan, le solicitamos por 
favor enviarnos la palabra Auditoría junto los siguientes datos:

Nombre:
Empresa:
Teléfono:

Y le haremos llegar el Temario Completo para que usted revise más a detalle.

centro telefónico: 018002129393
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v3 15/22] ofp-util: Ignore unknown fields in ofputil_decode_packet_in2().

2017-03-07 Thread Joe Stringer
On 6 March 2017 at 16:22, Jarno Rajahalme  wrote:
> The decoder of packet_in messages should not fail on encountering
> unknown metadata fields.  This allows the switch to add new features
> without breaking controllers.  The controllers should, however, copy
> the metadata fields from the packet_int to packet_out so that the
> switch gets back the full metadata.  OVN is already doing this.
>
> Signed-off-by: Jarno Rajahalme 
> ---
>  lib/nx-match.c | 25 -
>  lib/nx-match.h |  4 ++--
>  lib/ofp-util.c |  5 +++--
>  3 files changed, 21 insertions(+), 13 deletions(-)
>
> diff --git a/lib/nx-match.c b/lib/nx-match.c
> index 95516a1..bcc1347 100644
> --- a/lib/nx-match.c
> +++ b/lib/nx-match.c
> @@ -504,6 +504,9 @@ nx_pull_match_entry(struct ofpbuf *b, bool allow_cookie,
>  return 0;
>  }
>
> +/* Prerequisites will only be checked when 'strict' is 'true'.  This allows
> + * decoding conntrack original direction 5-tuple IP addresses without the
> + * ethertype being present, when decoding metadata only. */
>  static enum ofperr
>  nx_pull_raw(const uint8_t *p, unsigned int match_len, bool strict,
>  struct match *match, ovs_be64 *cookie, ovs_be64 *cookie_mask,
> @@ -539,7 +542,7 @@ nx_pull_raw(const uint8_t *p, unsigned int match_len, 
> bool strict,
>  *cookie = value.be64;
>  *cookie_mask = mask.be64;
>  }
> -} else if (!mf_are_match_prereqs_ok(field, match)) {
> +} else if (strict && !mf_are_match_prereqs_ok(field, match)) {
>  error = OFPERR_OFPBMC_BAD_PREREQ;
>  } else if (!mf_is_all_wild(field, &match->wc)) {
>  error = OFPERR_OFPBMC_DUP_FIELD;
> @@ -607,7 +610,8 @@ nx_pull_match(struct ofpbuf *b, unsigned int match_len, 
> struct match *match,
>  }
>
>  /* Behaves the same as nx_pull_match(), but skips over unknown NXM headers,
> - * instead of failing with an error. */
> + * instead of failing with an error, and does not check for field
> + * prerequisities. */
>  enum ofperr
>  nx_pull_match_loose(struct ofpbuf *b, unsigned int match_len,
>  struct match *match,
> @@ -664,8 +668,9 @@ oxm_pull_match(struct ofpbuf *b, const struct tun_table 
> *tun_table,
>  return oxm_pull_match__(b, true, tun_table, match);
>  }
>
> -/* Behaves the same as oxm_pull_match() with one exception.  Skips over 
> unknown
> - * OXM headers instead of failing with an error when they are encountered. */
> +/* Behaves the same as oxm_pull_match() with two exceptions.  Skips over
> + * unknown OXM headers instead of failing with an error when they are
> + * encountered, and does not check for field prerequisities. */
>  enum ofperr
>  oxm_pull_match_loose(struct ofpbuf *b, const struct tun_table *tun_table,
>   struct match *match)
> @@ -676,14 +681,16 @@ oxm_pull_match_loose(struct ofpbuf *b, const struct 
> tun_table *tun_table,
>  /* Parses the OXM match description in the 'oxm_len' bytes in 'oxm'.  Stores
>   * the result in 'match'.
>   *
> - * Fails with an error when encountering unknown OXM headers.
> + * Returns 0 if successful, otherwise an OpenFlow error code.
>   *
> - * Returns 0 if successful, otherwise an OpenFlow error code. */
> + * Encountering unknown OXM headers or missing field prerequisites are not
> + * considered as error conditions.
> + */
>  enum ofperr
> -oxm_decode_match(const void *oxm, size_t oxm_len,
> - const struct tun_table *tun_table, struct match *match)
> +oxm_decode_match_loose(const void *oxm, size_t oxm_len,
> +   const struct tun_table *tun_table, struct match 
> *match)
>  {
> -return nx_pull_raw(oxm, oxm_len, true, match, NULL, NULL, tun_table);
> +return nx_pull_raw(oxm, oxm_len, false, match, NULL, NULL, tun_table);
>  }
>
>  /* Verify an array of OXM TLVs treating value of each TLV as a mask,
> diff --git a/lib/nx-match.h b/lib/nx-match.h
> index 631ab48..b599731 100644
> --- a/lib/nx-match.h
> +++ b/lib/nx-match.h
> @@ -61,8 +61,8 @@ enum ofperr oxm_pull_match(struct ofpbuf *, const struct 
> tun_table *,
> struct match *);
>  enum ofperr oxm_pull_match_loose(struct ofpbuf *, const struct tun_table *,
>   struct match *);
> -enum ofperr oxm_decode_match(const void *, size_t, const struct tun_table *,
> - struct match *);
> +enum ofperr oxm_decode_match_loose(const void *, size_t,
> +   const struct tun_table *, struct match *);
>  enum ofperr oxm_pull_field_array(const void *, size_t fields_len,
>   struct field_array *);
>
> diff --git a/lib/ofp-util.c b/lib/ofp-util.c
> index 7d40cbb..ed66dd1 100644
> --- a/lib/ofp-util.c
> +++ b/lib/ofp-util.c
> @@ -3397,8 +3397,9 @@ decode_nx_packet_in2(const struct ofp_header *oh, bool 
> loose,
>  }
>
>  case NXPINT_METADATA:
> -error = oxm_decode_matc

Re: [ovs-dev] [PATCH v3 2/2] conntrack: Use 'maybe_related' insted of 'related'.

2017-03-07 Thread Ben Pfaff
On Fri, Dec 23, 2016 at 05:31:41PM -0800, Daniele Di Proietto wrote:
> This is just a naming change.  When we extract the key of an ICMP error
> message we suspect that it might be related, but we're not sure until we
> perform a lookup in the connection table.
> 
> Suggested-by: Darrell Ball 
> Signed-off-by: Daniele Di Proietto 
> Acked-by: Darrell Ball 

Thanks.

s/paylod/payload/ in the extract_l4() function level comment (not a new
misspelling, but I noticed it).

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


Re: [ovs-dev] [PATCH v3 1/2] conntrack: Return NEW for IPv6 ND packets without tracking.

2017-03-07 Thread Ben Pfaff
On Fri, Dec 23, 2016 at 05:31:40PM -0800, Daniele Di Proietto wrote:
> The userspace connection tracker treats Neighbor Discovery packets
> as invalid, because they're not checked against any connection.
> 
> This in inconsistent with the kernel connection tracker which always
> returns 'CS_NEW'.
> 
> Therefore, this commit makes the userspace connection tracker conforming
> with the kernel.  ND packets still do not create or read any state, but
> they're treated as NEW.
> 
> To support this, the key extraction functions can now return
> KEY_NO_TRACK, meaning the packet should be treated statelessly and not
> be sent to the connection tracker.
> 
> We also have to remove a test that explicitly checked that neighbor
> discovery was treated as invalid.
> 
> Reported-by: Sridhar Gaddam 
> Signed-off-by: Daniele Di Proietto 

The actual changes would be slightly clearer if this were two patches:
one that changes "bool" to the new "enum", without a behavioral change,
and then a second one that adds the new KEY_NO_TRACK.

But I think that it makes sense anyway.  Thank you.

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


Re: [ovs-dev] [patch_v1] doc: Support building ovs with Trusty.

2017-03-07 Thread Ben Pfaff
On Thu, Mar 02, 2017 at 08:01:42PM -0800, Darrell Ball wrote:
> Some code-block directives are not understood using
> Trusty (I was using 14.04.1 when the issue was found)
> default package versions, which blocks the build.
> 
> An error example:
> writing output... [100%] topics/language-bindings
> Warning, treated as error:
> /home/dball/ovs/Documentation/topics/language-bindings.rst:39:
> WARNING: Pygments lexer name u'shell' is not known
> 
> 14.04.1 has Sphinx 1.2.2 and Pygments 1.6.
> 
> I expect Trusty to still be widely used, so we
> should be able to build ovs with it.
> 
> requirements.rst indicates only:
> sphinx>=1.2,<2.0
> ovs_sphinx_theme>=1.0,<1.1
> 
> Fixes: f150a8bafbf2 ("doc: Document various language bindings")
> Suggested-by: Daniele Di Proietto 
> Signed-off-by: Darrell Ball 
> CC: Stephen Finucane 

I was pointed to apply this but it adds an error for me:

/home/blp/nicira/ovs/Documentation/intro/install/windows.rst:585: WARNING: 
Could not lex literal_block as "ps1". Highlighting skipped.

I'm using Sphinx 1.4.9.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] flake8: Fix build with flake8-import-order installed.

2017-03-07 Thread Ben Pfaff
On Tue, Mar 07, 2017 at 02:50:41PM -0500, Russell Bryant wrote:
> On Tue, Mar 7, 2017 at 1:57 PM, Ben Pfaff  wrote:
> 
> > On Tue, Mar 07, 2017 at 11:16:08AM -0500, Russell Bryant wrote:
> > > OpenStack CI is currently failing due to some flake8 warnings
> > > emitted from the flake8-import-order plugin.  Just ignore all of
> > > those warnings since they're just style things that aren't important.
> > >
> > > Signed-off-by: Russell Bryant 
> >
> > I didn't test this but it sounds reasonable to me.  Fuck style.
> >
> > Acked-by: Ben Pfaff 
> >
> 
> Thanks!  I applied this to master and branch-2.7.
> 
> I'll have another patch to delete the coding guidelines document shortly.

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


Re: [ovs-dev] [PATCH 07/10] windows: add include to stream-windows.c

2017-03-07 Thread Guru Shetty
On 5 February 2017 at 20:41, Alin Serdean 
wrote:

> fatal_signal_unlink_file_now is used but the header for it is missing in
> the include section.
>
> Signed-off-by: Alin Gabriel Serdean 
>
Applied.


> ---
>  lib/stream-windows.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lib/stream-windows.c b/lib/stream-windows.c
> index 1950014..44b88bf 100644
> --- a/lib/stream-windows.c
> +++ b/lib/stream-windows.c
> @@ -1,5 +1,5 @@
>  /*
> - * Copyright (c) 2016 Cloudbase Solutions Srl
> + * Copyright (c) 2016, 2017 Cloudbase Solutions Srl
>   *
>   * Licensed under the Apache License, Version 2.0 (the "License");
>   * you may not use this file except in compliance with the License.
> @@ -22,6 +22,7 @@
>  #include 
>  #include "poll-loop.h"
>  #include "dirs.h"
> +#include "fatal-signal.h"
>  #include "util.h"
>  #include "stream-provider.h"
>  #include "openvswitch/vlog.h"
> --
> 2.10.2.windows.1
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 06/10] windows: add function definition to poll-loop.h

2017-03-07 Thread Guru Shetty
On 5 February 2017 at 20:41, Alin Serdean 
wrote:

> poll_wevent_wait_at is used in the #define but the function definition
> is missing.
>
> Signed-off-by: Alin Gabriel Serdean 
>

Applied. Thanks


> ---
>  lib/poll-loop.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lib/poll-loop.h b/lib/poll-loop.h
> index 01e1aa8..84082f0 100644
> --- a/lib/poll-loop.h
> +++ b/lib/poll-loop.h
> @@ -1,5 +1,5 @@
>  /*
> - * Copyright (c) 2008, 2009, 2010, 2011, 2013 Nicira, Inc.
> + * Copyright (c) 2008, 2009, 2010, 2011, 2013, 2017 Nicira, Inc.
>   *
>   * Licensed under the Apache License, Version 2.0 (the "License");
>   * you may not use this file except in compliance with the License.
> @@ -54,6 +54,7 @@ void poll_fd_wait_at(int fd, short int events, const
> char *where);
>  #define poll_fd_wait(fd, events) poll_fd_wait_at(fd, events,
> OVS_SOURCE_LOCATOR)
>
>  #ifdef _WIN32
> +void poll_wevent_wait_at(HANDLE wevent, const char *where);
>  #define poll_wevent_wait(wevent) poll_wevent_wait_at(wevent,
> OVS_SOURCE_LOCATOR)
>  #endif /* _WIN32 */
>
> --
> 2.10.2.windows.1
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 05/10] windows: fix calls in netlink-socket

2017-03-07 Thread Guru Shetty
On 5 February 2017 at 20:41, Alin Serdean 
wrote:

> Add nl_sock_transact forward declaration, since it is used before
> being on implemented. This applies only on Windows.
>
> Move nl_sock_subscribe_packet__ function before it is used.
>
> It makes more sense to move it rather than adding a forward declaration
> since it is used by the two functions defined above it.
>
> Signed-off-by: Alin Gabriel Serdean 
>
Applied.

> ---
>  lib/netlink-socket.c | 50 ++
> 
>  1 file changed, 26 insertions(+), 24 deletions(-)
>
> diff --git a/lib/netlink-socket.c b/lib/netlink-socket.c
> index e45914c..f4c6fd9 100644
> --- a/lib/netlink-socket.c
> +++ b/lib/netlink-socket.c
> @@ -60,6 +60,8 @@ static void log_nlmsg(const char *function, int error,
>  #ifdef _WIN32
>  static int get_sock_pid_from_kernel(struct nl_sock *sock);
>  static int set_sock_property(struct nl_sock *sock);
> +static int nl_sock_transact(struct nl_sock *sock, const struct ofpbuf
> *request,
> +struct ofpbuf **replyp);
>  #endif
>
>  /* Netlink sockets. */
> @@ -425,6 +427,30 @@ nl_sock_join_mcgroup(struct nl_sock *sock, unsigned
> int multicast_group)
>
>  #ifdef _WIN32
>  int
> +nl_sock_subscribe_packet__(struct nl_sock *sock, bool subscribe)
> +{
> +struct ofpbuf request;
> +uint64_t request_stub[128];
> +struct ovs_header *ovs_header;
> +struct nlmsghdr *nlmsg;
> +int error;
> +
> +ofpbuf_use_stub(&request, request_stub, sizeof request_stub);
> +nl_msg_put_genlmsghdr(&request, 0, OVS_WIN_NL_CTRL_FAMILY_ID, 0,
> +  OVS_CTRL_CMD_PACKET_SUBSCRIBE_REQ,
> +  OVS_WIN_CONTROL_VERSION);
> +
> +ovs_header = ofpbuf_put_uninit(&request, sizeof *ovs_header);
> +ovs_header->dp_ifindex = 0;
> +nl_msg_put_u8(&request, OVS_NL_ATTR_PACKET_SUBSCRIBE, subscribe ? 1 :
> 0);
> +nl_msg_put_u32(&request, OVS_NL_ATTR_PACKET_PID, sock->pid);
> +
> +error = nl_sock_send(sock, &request, true);
> +ofpbuf_uninit(&request);
> +return error;
> +}
> +
> +int
>  nl_sock_subscribe_packets(struct nl_sock *sock)
>  {
>  int error;
> @@ -459,30 +485,6 @@ nl_sock_unsubscribe_packets(struct nl_sock *sock)
>  sock->read_ioctl = OVS_IOCTL_READ;
>  return 0;
>  }
> -
> -int
> -nl_sock_subscribe_packet__(struct nl_sock *sock, bool subscribe)
> -{
> -struct ofpbuf request;
> -uint64_t request_stub[128];
> -struct ovs_header *ovs_header;
> -struct nlmsghdr *nlmsg;
> -int error;
> -
> -ofpbuf_use_stub(&request, request_stub, sizeof request_stub);
> -nl_msg_put_genlmsghdr(&request, 0, OVS_WIN_NL_CTRL_FAMILY_ID, 0,
> -  OVS_CTRL_CMD_PACKET_SUBSCRIBE_REQ,
> -  OVS_WIN_CONTROL_VERSION);
> -
> -ovs_header = ofpbuf_put_uninit(&request, sizeof *ovs_header);
> -ovs_header->dp_ifindex = 0;
> -nl_msg_put_u8(&request, OVS_NL_ATTR_PACKET_SUBSCRIBE, subscribe ? 1 :
> 0);
> -nl_msg_put_u32(&request, OVS_NL_ATTR_PACKET_PID, sock->pid);
> -
> -error = nl_sock_send(sock, &request, true);
> -ofpbuf_uninit(&request);
> -return error;
> -}
>  #endif
>
>  /* Tries to make 'sock' stop listening to 'multicast_group'.  Returns 0 if
> --
> 2.10.2.windows.1
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 04/10] windows: add forward declaration to dpif-netlink

2017-03-07 Thread Guru Shetty
On 5 February 2017 at 20:41, Alin Serdean 
wrote:

> dpif_netlink_port_query__ is used before it is defined on Windows.
>
> Add a forward declaration to it.
>
> Signed-off-by: Alin Gabriel Serdean 
>
Applied.


> ---
>  lib/dpif-netlink.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/lib/dpif-netlink.c b/lib/dpif-netlink.c
> index 9762a87..20431b5 100644
> --- a/lib/dpif-netlink.c
> +++ b/lib/dpif-netlink.c
> @@ -60,6 +60,9 @@ VLOG_DEFINE_THIS_MODULE(dpif_netlink);
>  #ifdef _WIN32
>  #include "wmi.h"
>  enum { WINDOWS = 1 };
> +static int dpif_netlink_port_query__(const struct dpif_netlink *dpif,
> + odp_port_t port_no, const char
> *port_name,
> + struct dpif_port *dpif_port);
>  #else
>  enum { WINDOWS = 0 };
>  #endif
> --
> 2.10.2.windows.1
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 01/10] windows: Add definition of getrusage

2017-03-07 Thread Guru Shetty
On 5 February 2017 at 20:41, Alin Serdean 
wrote:

> getrusage is implemented in lib/getrusage-windows.c.
>
> This patch just adds its definition to include/windows/sys/resource.h,
> which serves for files that include .
>
> Another that we could also do is to move the implementation to
> include/windows
>
> Signed-off-by: Alin Gabriel Serdean 
>
Applied to master.


> ---
>  include/windows/sys/resource.h | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/include/windows/sys/resource.h b/include/windows/sys/
> resource.h
> index d4628f2..d8f2607 100644
> --- a/include/windows/sys/resource.h
> +++ b/include/windows/sys/resource.h
> @@ -1,5 +1,5 @@
>  /*
> - * Copyright (c) 2014 Nicira, Inc.
> + * Copyright (c) 2014, 2017 Nicira, Inc.
>   *
>   * Licensed under the Apache License, Version 2.0 (the "License");
>   * you may not use this file except in compliance with the License.
> @@ -48,4 +48,6 @@ struct rusage {
>  #define RUSAGE_THREAD 3
>  #endif
>
> +int getrusage(int who, struct rusage *usage);
> +
>  #endif /* sys/resource.h */
> --
> 2.10.2.windows.1
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] windows: Remove dead code in daemon-windows

2017-03-07 Thread Guru Shetty
On 5 February 2017 at 15:49, Alin Serdean 
wrote:

> Found by inspection.
>
> Signed-off-by: Alin Gabriel Serdean 
>
Applied to master.

> ---
>  lib/daemon-windows.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/lib/daemon-windows.c b/lib/daemon-windows.c
> index 7e2e9da..4fc97a8 100644
> --- a/lib/daemon-windows.c
> +++ b/lib/daemon-windows.c
> @@ -77,8 +77,7 @@ daemon_usage(void)
>  "\nService options:\n"
>  "  --service   run in background as a service.\n"
>  "  --service-monitor   restart the service in case of an "
> -   "unexpected failure. \n",
> -ovs_rundir(), program_name);
> +   "unexpected failure. \n");
>  }
>
>  /* Registers the call-back and configures the actions in case of a failure
> --
> 2.10.2.windows.1
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 3/7] userspace: Switching of L3 packets in L2 pipeline

2017-03-07 Thread Ben Pfaff
On Mon, Mar 06, 2017 at 12:37:11AM +, Jan Scheurich wrote:
> > I see that match_format() prints packet_type as a hex number.  I doubt
> > that's the best for human consumption.  At the very least, it seems like
> > it's better printed as a pair of numbers, and probably it would be more
> > friendly to say what packet type it is.
> 
> I agree that a pair of numbers would be more user friendly. Would you
> prefer packet_type=(1,0x800) or packet_type={1,0x800} or some other
> notation.
> 
> For the most common Ethernet packet_type (0,0) we would print
> packet_type=ethernet.
> 
> Symbolic packet_type representation for namespace 1 could easily lead to 
> confusion with the legacy match short-hands such as "ip", "ipv6", "arp", 
> "udp", etc. I believe these will need to remain untouched, e.g. packet_type=0 
> && dl_type=0x800 && nw_proto=17 for "udp", or we would break a lot of legacy.
> 
> Here we should really agree on something up front. Changing the
> notation is very painful due to the large number of unit test cases
> that have to be adapted.

I think that packet_type=(0,0x800) is the choice closest to the existing
formats.

I wonder whether we need to print a packet_type for Ethernet at all.  We
could decide to print nothing for a match on Ethernet, and instead print
"packet_type=*" if the packet type is wildcarded.  I suspect that this
would result in no change in the common case.

> > Can we fix whatever problem this is instead of working around it?
> > 
> > +/* Wildcard ethernet addresses if the original packet type was not
> > + * Ethernet.
> > + * XXX: This is a work-around. ofproto shouldn't unwildcard the 
> > Ethernet
> > + * addresses at all. */
> > +if (ctx->xin->upcall_flow->packet_type != PT_ETH) {
> > +memset(&ctx->wc->masks.dl_dst, 0, ETH_ADDR_LEN);
> > +memset(&ctx->wc->masks.dl_src, 0, ETH_ADDR_LEN);
> > +}
> 
> I had a discussion with Jarno about this
> (https://mail.openvswitch.org/pipermail/ovs-dev/2017-January/327510.html)
> and agreed that this is needed unless ofproto-dpif-xlate maintains a
> separate mask to keep track of the field bits that have been set
> independently from the bits that have been matched. That might well be
> worth doing to get wider, more generic megaflows, but it should be a
> separate patch series. I can remove the XXX: comment.

OK.

> > and this?
> > 
> > +/* XXX: ONLY FOR NON-PTAP BRIDGE! */
> > +if (flow->packet_type != PT_ETH && in_port && in_port->is_layer3 &&
> > +ctx.table_id == 0) {
> > +/* Add dummy Ethernet header to non-L2 packet if it's coming from a
> > + * L3 port. So all packets will be L2 packets for lookup.
> > + * The dl_type has already been set from the packet_type. */
> > +flow->packet_type = PT_ETH;
> > +memset(&flow->dl_src, 0, ETH_ADDR_LEN);
> > +memset(&flow->dl_dst, 0, ETH_ADDR_LEN);
> > +}
> 
> This is not a work-around. Again the comment was more for us to
> remember what needs revising when implementing PTAP bridges. We can
> remove it.

OK, thanks.

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


Re: [ovs-dev] [PATCH] flake8: Fix build with flake8-import-order installed.

2017-03-07 Thread Russell Bryant
On Tue, Mar 7, 2017 at 1:57 PM, Ben Pfaff  wrote:

> On Tue, Mar 07, 2017 at 11:16:08AM -0500, Russell Bryant wrote:
> > OpenStack CI is currently failing due to some flake8 warnings
> > emitted from the flake8-import-order plugin.  Just ignore all of
> > those warnings since they're just style things that aren't important.
> >
> > Signed-off-by: Russell Bryant 
>
> I didn't test this but it sounds reasonable to me.  Fuck style.
>
> Acked-by: Ben Pfaff 
>

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

I'll have another patch to delete the coding guidelines document shortly.

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


[ovs-dev] Tennis Enthusiasts List

2017-03-07 Thread Katie Perry


Hello,

Greetings of the day.

Checking if you'd be interested in taking a look at our Tennis Enthusiasts List 
within USA ?

Our Databases:- 1. Golfers List 2. Basketball Enthusiasts List 3. Baseball 
Enthusiasts List 4. Soccer Enthusiasts List 5. Hockey Enthusiasts List 6. 
Football Enthusiasts List 7. Cycling Enthusiasts List 8. Horse Racing 
Enthusiasts List 9. Travelers List 10. Gamblers 11. Casino Players 12. Poker 
Players and many more

The list of contacts are opt-in verified and can be used for unlimited 
multi-channel marketing.

Information Fields:– Mailing Address,Contact Name (First, Middle and Last 
Name), List type and Opt-in email address.

Could you please let me know your target audience. I will revert back with cost 
and counts.

Waiting for your valuable and sincere reply.

Thanks&Regards,
Katie Perry
Marketing Lead


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

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


Re: [ovs-dev] [PATCH 2/7] userspace: Support for push_eth and pop_eth actions

2017-03-07 Thread Ben Pfaff
On Mon, Mar 06, 2017 at 12:00:59AM +, Jan Scheurich wrote:
> > > Signed-off-by: Lorand Jakab 
> > > Signed-off-by: Simon Horman 
> > > Signed-off-by: Jiri Benc 
> > > Signed-off-by: Yi Yang 
> > > Signed-off-by: Jean Tourrilhes 
> > > Signed-off-by: Jan Scheurich 
> > > Co-authored-by: Zoltan Balogh 
> > 
> > This sign-off chain is baffling.  Please explain it.
> 
> Support for L3 tunneling has been dragging along for several years. We
> are just the last ones in a long chain of authors who have submitted
> earlier versions of patches for this. We thought it was appropriate to
> keep the earlier Signed-off-by tags to reflect that. If there is a
> better way to express this, please let us know.

OK, it really was not clear to me that the code had really passed
through that many hands.  If it really has, then it's fine.

> > Clang reports:
> > 
> > ../lib/packets.c:260:22: error: cast from 'char *' to 'ovs_be16 *' (aka 
> > 'unsigned short *') increases required alignment from 1 to 2 [-
> > Werror,-Wcast-align]
> > ../lib/packets.c:263:22: error: cast from 'char *' to 'ovs_be16 *' (aka 
> > 'unsigned short *') increases required alignment from 1 to 2 [-
> > Werror,-Wcast-align]
> 
> I think these warnings are artifacts caused by the fact that char* does not 
> express the actual alignment of the l2.5 or l3 headers. The packet data is 
> word-aligned and the Ethernet header occupies 14 bytes. Any number of 
> potentially present VLAN tags cannot change that. Any suggestion how to fix 
> this?

When these warnings come about and the code is actually correct, then
the ALIGNED_CAST macro is the right way to suppress them.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 1/7] userspace: Add packet_type in dp_packet and flow

2017-03-07 Thread Ben Pfaff
On Sun, Mar 05, 2017 at 11:45:58PM +, Jan Scheurich wrote:
> > -Original Message-
> > From: Ben Pfaff [mailto:b...@ovn.org]
> > Sent: Friday, 03 March, 2017 19:14
> > To: Jan Scheurich 
> > Cc: d...@openvswitch.org
> > Subject: Re: [ovs-dev] [PATCH 1/7] userspace: Add packet_type in dp_packet 
> > and flow
> > 
> > On Fri, Feb 03, 2017 at 10:38:31AM +, Jan Scheurich wrote:
> > > This commit adds a packet_type attribute to the structs dp_packet and flow
> > > to explicitly carry the type of the packet as preparation for the
> > > introduction of the so-called packet type-aware pipeline (PTAP) in OVS.
> > >
> > > The packet_type is a big-endian 32 bit integer with the encoding as
> > > specified in OpenFlow verion 1.5.
> > 
> > It also causes "sparse" warnings.  The first one is easily fixed by
> > 0x to OVS_BE16_MAX:
> > 
> > ../lib/flow.c:572:24: warning: incorrect type in initializer (different 
> > base types)
> > ../lib/flow.c:572:24:expected restricted ovs_be16 [usertype] dl_type
> > ../lib/flow.c:572:24:got int
> > 
> > The second seems to be due to confused macros PACKET_TYPE and PT_NS.
> > The definition of PT_NS doesn't make any sense to me, and neither does
> > PT_NS_TYPE_BE.  Actually, PACKET_TYPE and the enums derived from it
> > don't fit the usual OVS style of having constants in host byte order:
> 
> We were not aware of that convention. Will change the constant
> definitions to be in host byte order.  BTW: What compiler did you use
> to get these warnings? gcc doesn't complain.

As I said, these warnings are from "sparse", which is integrated into
the OVS build.  See the install guide for more information.

> > I'm not sure of the value of adding comments that packet-in/outs can
> > only carry Ethernet.
> 
> It was more a reminder for us that these will require update when
> implementing packet type-aware pipeline. They would be
> rephrased/removed with the second patch series. We can remove them
> now.

OK.

> > I'm not sure of the value of dp_packet_packet_type() and
> > dp_packet_set_packet_type().  They don't seem to provide any useful
> > abstraction.
> 
> We added them to hide whether packet_type was stored in struct
> dp_packet or the pkt_metadata inside (see below). If we agree to keep
> it in dp_packet, there is indeed little value having them. If not, we
> should better keep them.

I'm OK with that distinction.

> > The names of dp_packet_is_l2() and dp_packet_l2() are now pretty
> > deceptive.  Ethernet is not the only L2 protocol, and these are
> > specifically about Ethernet packets, so perhaps they should be renamed
> > with "eth" or "ethernet" in their names.
> 
> I'm not sure. dp_packet_l2() is a legacy function that is used widely
> and has always returned the head of the packet buffer (providing that
> the packet had been parsed and thus l3_offset set) assuming that it
> pointed to an Ethernet header. I don't think the introduction of
> packet_type means OVS will start supporting other L2 protocols.

It's always returned the start of the Ethernet header, which has always
been one and the same as the start of the L2 header.  It seems that,
following this change, it should either always return the start of the
L2 header (regardless of the type of that L2 header) or the start of the
Ethernet header.  This patch makes the latter choice, which is
reasonable, but then the name is confusing and I think that we should
change it.  I only see 16 references to this function so changing those
references along with the rename seems perfectly reasonable to me.

By the way, when you start talking about "legacy" functions, etc., that
just means to me that we should fix things to be internally consistent.
If there are visible legacies in our code (and I'm sure there are) then
that just means that we need to work harder at this.

> > This patch makes the design choice of adding a separate packet_type to
> > dp_packet, instead of putting the packet_type inside struct
> > pkt_metadata.  Did you explore the trade off here?  What motivated the
> > decision?
> 
> We initially had it in pkt_metadata, but that was awkward because 
> pkt_metadata is initialized through invoking function pkt_metadata_init() in 
> the dpif-netdev datapath after reception of a packet from a netdev, while the 
> packet_type is part of the metadata returned from the netdev, similar to the 
> port number. Since a versatile tunnel netdev can return packets of different 
> packet_type in a single batch, the packet_type had to be included in struct 
> dp_packet somehow. Passing it as an out-of-band parameter as done for the 
> port_no was not an option. Making the packet_type part of struct dp_packet 
> solved those problems. 
> 
> Conceptually the packet_type can be considered as packet metadata, but we 
> didn't want to store it both in dp_packet and pkt_metadata, especially since 
> another copy is stored in struct (mini)flow after parsing.
> 
> Only storing it in pkt_metadata, woul

Re: [ovs-dev] [patch_v1] doc: Support building ovs with Trusty.

2017-03-07 Thread Ben Pfaff
On Tue, Mar 07, 2017 at 05:01:06PM +, Stephen Finucane wrote:
> PS: This also sounds like something that could be automatically tested.
> If only some folks were working on a tool to automatically test mailing
> list patches...
> 
>   https://speakerdeck.com/stephenfin/mailing-list-meet-ci

More automatic tests are (almost) always better.  Is this something
that's ready for us to try out, or should we wait until it's more
mature?
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] flake8: Fix build with flake8-import-order installed.

2017-03-07 Thread Ben Pfaff
On Tue, Mar 07, 2017 at 11:16:08AM -0500, Russell Bryant wrote:
> OpenStack CI is currently failing due to some flake8 warnings
> emitted from the flake8-import-order plugin.  Just ignore all of
> those warnings since they're just style things that aren't important.
> 
> Signed-off-by: Russell Bryant 

I didn't test this but it sounds reasonable to me.  Fuck style.

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


Re: [ovs-dev] [PATCH RFC] doc: Decrease build requirements to support RHEL7.

2017-03-07 Thread Ben Pfaff
On Tue, Mar 07, 2017 at 05:06:08PM +, Stephen Finucane wrote:
> I'm generally fine with this, but Darren Ball beat you to the punch [1]
> and caught one that you seem to have missed (documentation-style.rst)?
> As such, we only need the modifications to 'conf.py', 'openvswitch.m4'
> and 'requirements.txt'. Assuming we keep just those changes:

It's nice to avoid these things in the future, so I posted a change that
should help:
https://patchwork.ozlabs.org/patch/736331/
Feel free to add to the blacklist I propose there, I only grabbed the
ones from this change.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH] Documentation: Report errors for use of features not in Sphinx 1.1.3.

2017-03-07 Thread Ben Pfaff
Signed-off-by: Ben Pfaff 
---
 Documentation/automake.mk  | 15 ++-
 Documentation/sphinx-version-blacklist |  2 ++
 2 files changed, 16 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/sphinx-version-blacklist

diff --git a/Documentation/automake.mk b/Documentation/automake.mk
index a74807fde532..f7f1fe61d1b7 100644
--- a/Documentation/automake.mk
+++ b/Documentation/automake.mk
@@ -86,7 +86,8 @@ EXTRA_DIST += \
Documentation/internals/contributing/documentation-style.rst \
Documentation/internals/contributing/libopenvswitch-abi.rst \
Documentation/internals/contributing/submitting-patches.rst \
-   Documentation/requirements.txt
+   Documentation/requirements.txt \
+   Documentation/sphinx-version-blacklist
 
 # You can set these variables from the command line.
 SPHINXOPTS =
@@ -120,3 +121,15 @@ endif
 .PHONY: htmldocs
 .PHONY: check-docs
 .PHONY: clean-docs
+
+ALL_LOCAL += sphinx-version-check
+sphinx-version-check: $(EXTRA_DIST)
+   @if grep -n -f $(srcdir)/Documentation/sphinx-version-blacklist $?; \
+   then \
+ echo "See above for list of uses of features that Sphinx 1.1.3"; \
+ echo "does not support.  Please avoid using these features.."; \
+ exit 1; \
+   else \
+  : > $@; \
+   fi
+CLEANFILES += sphinx-version-check
diff --git a/Documentation/sphinx-version-blacklist 
b/Documentation/sphinx-version-blacklist
new file mode 100644
index ..a67339bf2758
--- /dev/null
+++ b/Documentation/sphinx-version-blacklist
@@ -0,0 +1,2 @@
+code-block:: *ps1con
+code-block:: *doscon
-- 
2.10.2

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


Re: [ovs-dev] [PATCH 6/7] ofproto: Implement learning limit.

2017-03-07 Thread Ben Pfaff
On Fri, Feb 24, 2017 at 06:58:00PM -0800, Daniele Di Proietto wrote:
> With this commit we honor the newly introduced limit to the learn
> action.
> 
> When learning a new rule (with the limit set), the rule will hold a
> reference to a counter.  The ukey that learned the rule will also keep
> the same reference,  so the counter will be decremented when both the
> ukey and the original rule have been deleted.
> 
> This means that there's a small window between the learn flow expiry and
> the next revalidation in which new flows are not learned because OVS
> thinks that we would exceed the limit.  I think this is better that the
> alternative, because if we allow learning in that interval we're not
> strictly enforcing the limit, because we still have the datapath flows
> that are passing traffic for expired rules.
> 
> There's a small corner case when we have to slowpath the ukey.  This
> happens when:
> * The learned rule has expired (or has been deleted).
> * The ukey that learned the rule is still in the datapath.
> * No packets hit the datapath flow recently.
> In this case we cannot relearn the rule (because there are no new
> packets), and the actions might depend on the learn execution, so the
> only option is to slowpath the ukey.  I don't think this has big
> performance implications since it's done only for ukey with no traffic.
> 
> Signed-off-by: Daniele Di Proietto 

You mentioned face-to-face that a change I suggested earlier in the
series would simplify this one.  If it's OK, then I'll wait to review
this patch and patch 7 until you've managed to do the simplification.

Thanks,

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


Re: [ovs-dev] [PATCH 5/7] ofproto-dpif-upcall: Encapsulate 'struct recirc_refs' into struct 'ukey_refs'.

2017-03-07 Thread Ben Pfaff
On Fri, Feb 24, 2017 at 06:57:59PM -0800, Daniele Di Proietto wrote:
> We're going to need to introduce another member in struct udpif_key very
> similar to 'struct recirc_refs', so this will make next commit easier.
> 
> No functional change.
> 
> Signed-off-by: Daniele Di Proietto 

I have no objection, but I haven't read the remaining patches that use
this yet.

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


Re: [ovs-dev] [PATCH 4/7] ofproto: New cookie-counters module.

2017-03-07 Thread Ben Pfaff
On Fri, Feb 24, 2017 at 06:57:58PM -0800, Daniele Di Proietto wrote:
> The new module will be used by ofproto to keep track of the number of
> learned flows with the same cookie in the same table.
> 
> The counters are used to implement limits for the learn action.
> 
> The module implements its own internal locking, because the counters can
> be increased/decreased from handlers and revalidators.
> 
> Signed-off-by: Daniele Di Proietto 

There's an existing hindex of flows by their cookies, the 'cookies'
member of struct ofproto, and even a 'learned_cookies' hmap.  Is there a
graceful way to avoid having more indexes of flows by cookie?
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] datapath-windows: Trigger conntrack event after setting mark and label

2017-03-07 Thread Shashank Ram
Discussed with Sai offline. Since the Event needs to be fired just the first 
time the CtEntry is created, he is using a bool for it.


Acked-by: Shashank Ram 


From: Sairam Venugopal
Sent: Tuesday, March 7, 2017 10:16:54 AM
To: Shashank Ram; d...@openvswitch.org
Subject: Re: [ovs-dev] [PATCH] datapath-windows: Trigger conntrack event after 
setting mark and label

Hi Shashank,

Can you explain this? The intent of the patch is not to confirm if an entry 
exists. Instead it is to track if an entry is created as part of the current CT 
action.

Not all CT actions trigger an Entry Creation. If an entry is created, then we 
need to delay the event generation until Mark and Label are present.

Thanks,
Sairam

From: Shashank Ram
Date: Thursday, March 2, 2017 at 2:05 PM
To: Sairam Venugopal, "d...@openvswitch.org"
Subject: Re: [ovs-dev] [PATCH] datapath-windows: Trigger conntrack event after 
setting mark and label


Thanks Sai for the change.


I was wondering if you could add a helper function to lookup the OVS_CT_ENTRY 
that got added to the OvsConntrackKeyLookupCtx list, instead of passing a 
boolean around to functions.

i.e replace "entryCreated" with "IsEntryCreated()".


Thanks,

Shashank


From: ovs-dev-boun...@openvswitch.org 
mailto:ovs-dev-boun...@openvswitch.org>> on 
behalf of Sairam Venugopal mailto:vsai...@vmware.com>>
Sent: Thursday, March 2, 2017 1:41:03 PM
To: d...@openvswitch.org
Subject: [ovs-dev] [PATCH] datapath-windows: Trigger conntrack event after 
setting mark and label

New Conntrack Entry event should be triggered after setting the mark and
label fields. The current RW lock implementation prevents Event Handler
from reading the entry until mark/label is set.

Fixing the workflow to trigger the event after setting mark/label.

Signed-off-by: Sairam Venugopal mailto:vsai...@vmware.com>>
---
 datapath-windows/ovsext/Conntrack.c | 28 +---
 1 file changed, 21 insertions(+), 7 deletions(-)

diff --git a/datapath-windows/ovsext/Conntrack.c 
b/datapath-windows/ovsext/Conntrack.c
index d1be480..9f41861 100644
--- a/datapath-windows/ovsext/Conntrack.c
+++ b/datapath-windows/ovsext/Conntrack.c
@@ -168,7 +168,7 @@ OvsCtAddEntry(POVS_CT_ENTRY entry, OvsConntrackKeyLookupCtx 
*ctx, UINT64 now)
 entry->timestampStart = now;
 InsertHeadList(&ovsConntrackTable[ctx->hash & CT_HASH_TABLE_MASK],
&entry->link);
-OvsPostCtEventEntry(entry, OVS_EVENT_CT_NEW);
+
 ctTotalEntries++;
 }

@@ -179,9 +179,11 @@ OvsCtEntryCreate(PNET_BUFFER_LIST curNbl,
  OvsConntrackKeyLookupCtx *ctx,
  OvsFlowKey *key,
  BOOLEAN commit,
- UINT64 currentTime)
+ UINT64 currentTime,
+ BOOLEAN *entryCreated)
 {
 POVS_CT_ENTRY entry = NULL;
+*entryCreated = FALSE;
 UINT32 state = 0;
 switch (ipProto)
 {
@@ -211,6 +213,7 @@ OvsCtEntryCreate(PNET_BUFFER_LIST curNbl,
 entry->parent = parentEntry;
 }
 OvsCtAddEntry(entry, ctx, currentTime);
+*entryCreated = TRUE;
 }

 OvsCtUpdateFlowKey(key, state, ctx->key.zone, 0, NULL);
@@ -232,6 +235,7 @@ OvsCtEntryCreate(PNET_BUFFER_LIST curNbl,
 return NULL;
 }
 OvsCtAddEntry(entry, ctx, currentTime);
+*entryCreated = TRUE;
 }

 OvsCtUpdateFlowKey(key, state, ctx->key.zone, 0, NULL);
@@ -246,6 +250,7 @@ OvsCtEntryCreate(PNET_BUFFER_LIST curNbl,
 return NULL;
 }
 OvsCtAddEntry(entry, ctx, currentTime);
+*entryCreated = TRUE;
 }

 OvsCtUpdateFlowKey(key, state, ctx->key.zone, 0, NULL);
@@ -525,10 +530,12 @@ OvsProcessConntrackEntry(PNET_BUFFER_LIST curNbl,
  OvsFlowKey *key,
  UINT16 zone,
  BOOLEAN commit,
- UINT64 currentTime)
+ UINT64 currentTime,
+ BOOLEAN *entryCreated)
 {
 POVS_CT_ENTRY entry = ctx->entry;
 UINT32 state = 0;
+*entryCreated = FALSE;

 /* If an entry was found, update the state based on TCP flags */
 if (ctx->related) {
@@ -555,7 +562,8 @@ OvsProcessConntrackEntry(PNET_BUFFER_LIST curNbl,
 OvsCtEntryDelete(ctx->entry);
 ctx->entry = NULL;
 entry = OvsCtEntryCreate(curNbl, key->ipKey.nwProto, l4Offset,
- ctx, key, commit, currentTime);
+ ctx, key, commit, currentTime,
+ entryCreated);
 if (!entry) {
 return NULL;
 }
@@ -644,17 +652,19 @@

Re: [ovs-dev] [PATCH 3/7] ofproto-dpif-xlate: Create XC_LEARN entry after learning.

2017-03-07 Thread Ben Pfaff
On Fri, Feb 24, 2017 at 06:57:57PM -0800, Daniele Di Proietto wrote:
> This will be useful in a separate commit, because learning can fail.
> 
> Signed-off-by: Daniele Di Proietto 

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


Re: [ovs-dev] [PATCH] ofproto-dpif-xlate: Allow sending BFD messages even when RSTP port is not forwarding

2017-03-07 Thread Joe Stringer
On 7 March 2017 at 10:22, Jarno Rajahalme  wrote:
> The reasoning and the updated patch seem right to me, so:
>
> Acked-by: Jarno Rajahalme 

Thanks for taking a look. I plan to come up with a CFM testcase as
well and fold that in before I push this.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] ofproto-dpif-xlate: Allow sending BFD messages even when RSTP port is not forwarding

2017-03-07 Thread Jarno Rajahalme
The reasoning and the updated patch seem right to me, so:

Acked-by: Jarno Rajahalme 

> On Mar 6, 2017, at 12:16 PM, Joe Stringer  wrote:
> 
> On 20 February 2017 at 04:27, Mika Väisänen  wrote:
>> Interworking of BFD and RSTP does not work, as currently BFD messages are
>> dropped if RSTP port is not in forwarding mode. To correct this problem,
>> an extra check is added to allow BFD messages to be sent even when
>> rstp_forward_state is false.
>> 
>> Note: This patch is made against branch-2.5.
>> 
>> Signed-off-by: Mika Vaisanen 
>> 
>> ---
> 
> There's something a bit off about the formatting of the patch, but
> it's simple enough that I can just make the equivalent change locally.
> The test seems to show the expected behaviour well.
> 
> I see now, looking at the codepaths, the bfd packet generation link
> through to the compose_output_action() goes like this:
> 
> monitor_mport_run()
> ofproto_dpif_send_packet()
> xlate_send_packet()
> ofproto_dpif_execute_actions()
> ofproto_dpif_execute_actions__()
> xlate_actions()
> do_xlate_actions()
> xlate_output_action()
> compose_output_action()
> 
> I didn't realise that when these various protocols (STP, RSTP, CFM,
> BFD, etc.) send packets from OVS, it goes through the standard
> translation like this. I guess it makes sense :-)
> 
> The only concern I had about this patch is if there was a way to end
> up broadcasting BFD in a loop because BFD is skipping past the
> STP/RSTP forwarding checks. However, I believe that on receive,
> xlate_actions() will handle BFD via process_special(), so typically it
> should not end up in the path where it's attempting to forward the
> packet. If it somehow does get past there, the check that is being
> added by this patch will ensure that the BFD packet matches the
> settings for this link, or otherwise it will respect the STP/RSTP
> forwarding state. So I think it's fine. I wouldn't mind bouncing it
> off someone like Jarno just to double-check my reasoning.
> 
> As a matter of style, I think this diff in ofproto-dpif-xlate.c is a
> little easier to follow---and would cover the CFM case as well:
> 
> diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
> index 89fc3a44a0d1..578fef168b30 100644
> --- a/ofproto/ofproto-dpif-xlate.c
> +++ b/ofproto/ofproto-dpif-xlate.c
> @@ -3127,6 +3127,10 @@ compose_output_action__(struct xlate_ctx *ctx,
> ofp_port_t ofp_port,
> }
> return;
> }
> +} else if ((xport->cfm && cfm_should_process_flow(xport->cfm,
> flow, wc))
> +   || (xport->bfd && bfd_should_process_flow(xport->bfd, 
> flow,
> + wc))) {
> +/* Pass; STP should not block link health detection. */
> } else if (!xport_stp_forward_state(xport) ||
>!xport_rstp_forward_state(xport)) {
> if (ctx->xbridge->stp != NULL) {

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


Re: [ovs-dev] [PATCH] datapath-windows: Trigger conntrack event after setting mark and label

2017-03-07 Thread Sairam Venugopal
Hi Shashank,

Can you explain this? The intent of the patch is not to confirm if an entry 
exists. Instead it is to track if an entry is created as part of the current CT 
action.

Not all CT actions trigger an Entry Creation. If an entry is created, then we 
need to delay the event generation until Mark and Label are present.

Thanks,
Sairam

From: Shashank Ram
Date: Thursday, March 2, 2017 at 2:05 PM
To: Sairam Venugopal, "d...@openvswitch.org"
Subject: Re: [ovs-dev] [PATCH] datapath-windows: Trigger conntrack event after 
setting mark and label


Thanks Sai for the change.


I was wondering if you could add a helper function to lookup the OVS_CT_ENTRY 
that got added to the OvsConntrackKeyLookupCtx list, instead of passing a 
boolean around to functions.

i.e replace "entryCreated" with "IsEntryCreated()".


Thanks,

Shashank


From: ovs-dev-boun...@openvswitch.org 
mailto:ovs-dev-boun...@openvswitch.org>> on 
behalf of Sairam Venugopal mailto:vsai...@vmware.com>>
Sent: Thursday, March 2, 2017 1:41:03 PM
To: d...@openvswitch.org
Subject: [ovs-dev] [PATCH] datapath-windows: Trigger conntrack event after 
setting mark and label

New Conntrack Entry event should be triggered after setting the mark and
label fields. The current RW lock implementation prevents Event Handler
from reading the entry until mark/label is set.

Fixing the workflow to trigger the event after setting mark/label.

Signed-off-by: Sairam Venugopal mailto:vsai...@vmware.com>>
---
 datapath-windows/ovsext/Conntrack.c | 28 +---
 1 file changed, 21 insertions(+), 7 deletions(-)

diff --git a/datapath-windows/ovsext/Conntrack.c 
b/datapath-windows/ovsext/Conntrack.c
index d1be480..9f41861 100644
--- a/datapath-windows/ovsext/Conntrack.c
+++ b/datapath-windows/ovsext/Conntrack.c
@@ -168,7 +168,7 @@ OvsCtAddEntry(POVS_CT_ENTRY entry, OvsConntrackKeyLookupCtx 
*ctx, UINT64 now)
 entry->timestampStart = now;
 InsertHeadList(&ovsConntrackTable[ctx->hash & CT_HASH_TABLE_MASK],
&entry->link);
-OvsPostCtEventEntry(entry, OVS_EVENT_CT_NEW);
+
 ctTotalEntries++;
 }

@@ -179,9 +179,11 @@ OvsCtEntryCreate(PNET_BUFFER_LIST curNbl,
  OvsConntrackKeyLookupCtx *ctx,
  OvsFlowKey *key,
  BOOLEAN commit,
- UINT64 currentTime)
+ UINT64 currentTime,
+ BOOLEAN *entryCreated)
 {
 POVS_CT_ENTRY entry = NULL;
+*entryCreated = FALSE;
 UINT32 state = 0;
 switch (ipProto)
 {
@@ -211,6 +213,7 @@ OvsCtEntryCreate(PNET_BUFFER_LIST curNbl,
 entry->parent = parentEntry;
 }
 OvsCtAddEntry(entry, ctx, currentTime);
+*entryCreated = TRUE;
 }

 OvsCtUpdateFlowKey(key, state, ctx->key.zone, 0, NULL);
@@ -232,6 +235,7 @@ OvsCtEntryCreate(PNET_BUFFER_LIST curNbl,
 return NULL;
 }
 OvsCtAddEntry(entry, ctx, currentTime);
+*entryCreated = TRUE;
 }

 OvsCtUpdateFlowKey(key, state, ctx->key.zone, 0, NULL);
@@ -246,6 +250,7 @@ OvsCtEntryCreate(PNET_BUFFER_LIST curNbl,
 return NULL;
 }
 OvsCtAddEntry(entry, ctx, currentTime);
+*entryCreated = TRUE;
 }

 OvsCtUpdateFlowKey(key, state, ctx->key.zone, 0, NULL);
@@ -525,10 +530,12 @@ OvsProcessConntrackEntry(PNET_BUFFER_LIST curNbl,
  OvsFlowKey *key,
  UINT16 zone,
  BOOLEAN commit,
- UINT64 currentTime)
+ UINT64 currentTime,
+ BOOLEAN *entryCreated)
 {
 POVS_CT_ENTRY entry = ctx->entry;
 UINT32 state = 0;
+*entryCreated = FALSE;

 /* If an entry was found, update the state based on TCP flags */
 if (ctx->related) {
@@ -555,7 +562,8 @@ OvsProcessConntrackEntry(PNET_BUFFER_LIST curNbl,
 OvsCtEntryDelete(ctx->entry);
 ctx->entry = NULL;
 entry = OvsCtEntryCreate(curNbl, key->ipKey.nwProto, l4Offset,
- ctx, key, commit, currentTime);
+ ctx, key, commit, currentTime,
+ entryCreated);
 if (!entry) {
 return NULL;
 }
@@ -644,17 +652,19 @@ OvsCtExecute_(PNET_BUFFER_LIST curNbl,

 /* Lookup Conntrack entries for a matching entry */
 entry = OvsCtLookup(&ctx);
-
+BOOLEAN entryCreated = FALSE;
 if (!entry) {
 /* If no matching entry was found, create one and add New state */
 entry = OvsCtEntryCreate(curNbl, key->ipKey.nwProto,
  layers->l4Offset, &ctx,
-  

Re: [ovs-dev] [PATCH 2/7] ofp-actions: Add limit to learn action.

2017-03-07 Thread Ben Pfaff
On Fri, Feb 24, 2017 at 06:57:56PM -0800, Daniele Di Proietto wrote:
> This commit adds a new feature to the learn actions: the possibility to
> limit the number of learned flows.
> 
> To be compatible with users of the old learn action, a new structure is
> introduced as well as a new OpenFlow raw action number.
> 
> This commit only implements parsing of the action and documentation.
> A later commit will implement the feature in ofproto-dpif.
> 
> Signed-off-by: Daniele Di Proietto 

I'm not sure why this is a separate commit.

OFPERR_NXBAC_MUST_BE_ZERO is clearer than OFPERR_OFPBAC_BAD_ARGUMENT for
reporting must-be-zero errors here:
+if (nal->pad || nal->pad2) {
+return OFPERR_OFPBAC_BAD_ARGUMENT;
+}

I think that struct nx_action_learn2 has struct nx_action_learn as a
prefix.  Would it make sense to either make it nx_action_learn a member
of nx_action_learn2 or to make struct nx_action_learn2 just the last 8
bytes that are not in nx_action_learn?  Maybe it would factor out some
code?

I am not sure why experimenter OXM fields are not supported.  It looks
like the code actually supports them, other than the check that rejects
them.  If they cannot be supported then the header is always exactly 4
bytes so the comment in nx_action_learn2 should be updated:
/* Followed by:
 * - OXM/NXM header for destination field (4 or 8 bytes),
 *   if NX_LEARN_F_WRITE_RESULT is set in 'flags'

The documented behavior is that flows installed other than by a "learn"
action with limit= don't count.  Is there a way for a controller (or an
administrator using ovs-ofctl) to discover which flows were added by
such an action?  Otherwise it's going to be confusing.  Also that
behavior is going to break if someone dumps the flow table, restarts
OVS, and restores the flow table (which some OVS scripts do
automatically on upgrade), since there's presumably no way to save and
restore whether the flow was added by a learn action.  So at first, at
least, this seems like an undesirable design.

I haven't read the remaining commits to add this feature so perhaps I'll
have more comments.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 1/7] ofp-actions: Factor out decode_LEARN_common().

2017-03-07 Thread Ben Pfaff
On Fri, Feb 24, 2017 at 06:57:55PM -0800, Daniele Di Proietto wrote:
> No functional change, it will be used by next commit.
> 
> Signed-off-by: Daniele Di Proietto 

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


[ovs-dev] [PATCH 2/2] ofproto: Add ref counting for variable length mf_fields.

2017-03-07 Thread Yi-Hung Wei
Currently, a controller may potentially trigger a segmentation fault if it
accidentally removes a TLV mapping that is still used by an active flow.
To resolve this issue, in this patch, we maintain reference counting for each
dynamically allocated variable length mf_fields, so that vswitchd can use this
information to properly remove a TLV mapping, and to return an error if the
controller tries to remove a TLV mapping that is still used by any active flow.

To keep track of the usage of tun_metadata for each flow, two 'uint64_t'
bitmaps are introduce for the flow match and flow action respectively. We use
'uint64_t' as a bitmap since the 64 geneve TLV tunnel metadata are the only
available variable length mf_fields for now. We shall adopt general bitmap when
more variable length mf_fields are introduced. The bitmaps are configured
during the flow decoding process, and vswitchd use these bitmaps to increase or
decrease the ref counting when the flow is created or deleted.

VMWare-BZ: #1768370
Fixes: 04f48a68c428 ("ofp-actions: Fix variable length meta-flow OXMs.")
Suggested-by: Jarno Rajahalme 
Suggested-by: Joe Stringer 
Signed-off-by: Yi-Hung Wei 
---
 build-aux/extract-ofp-actions |   9 +-
 include/openvswitch/ofp-actions.h |   3 +-
 include/openvswitch/ofp-errors.h  |   4 +
 include/openvswitch/ofp-util.h|   1 +
 lib/learn.c   |   6 ++
 lib/meta-flow.c   | 196 +++---
 lib/ofp-actions.c | 156 ++
 lib/ofp-util.c|  21 ++--
 lib/vl-mff-map.h  |  10 +-
 ofproto/ofproto-provider.h|   4 +
 ofproto/ofproto.c |  39 ++--
 ovn/controller/pinctrl.c  |   6 +-
 tests/tunnel.at   |  76 ++-
 utilities/ovs-ofctl.c |   2 +-
 14 files changed, 404 insertions(+), 129 deletions(-)

diff --git a/build-aux/extract-ofp-actions b/build-aux/extract-ofp-actions
index 184447b99422..0062ab881dd5 100755
--- a/build-aux/extract-ofp-actions
+++ b/build-aux/extract-ofp-actions
@@ -322,7 +322,8 @@ def extract_ofp_actions(fn, definitions):
 static enum ofperr
 ofpact_decode(const struct ofp_action_header *a, enum ofp_raw_action_type raw,
   enum ofp_version version, uint64_t arg,
-  const struct vl_mff_map *vl_mff_map, struct ofpbuf *out)
+  const struct vl_mff_map *vl_mff_map,
+  uint64_t *tlv_bitmap, struct ofpbuf *out)
 {
 switch (raw) {\
 """
@@ -343,7 +344,7 @@ ofpact_decode(const struct ofp_action_header *a, enum 
ofp_raw_action_type raw,
 else:
 arg = "arg"
 if arg_vl_mff_map:
-print "return decode_%s(%s, version, vl_mff_map, 
out);" % (enum, arg)
+print "return decode_%s(%s, version, vl_mff_map, 
tlv_bitmap, out);" % (enum, arg)
 else:
 print "return decode_%s(%s, version, out);" % 
(enum, arg)
 print
@@ -365,7 +366,7 @@ ofpact_decode(const struct ofp_action_header *a, enum 
ofp_raw_action_type raw,
 else:
 prototype += "%s, enum ofp_version, " % base_argtype
 if arg_vl_mff_map:
-prototype += 'const struct vl_mff_map *, '
+prototype += 'const struct vl_mff_map *, uint64_t *, '
 prototype += "struct ofpbuf *);"
 print prototype
 
@@ -374,7 +375,7 @@ static enum ofperr ofpact_decode(const struct 
ofp_action_header *,
  enum ofp_raw_action_type raw,
  enum ofp_version version,
  uint64_t arg, const struct vl_mff_map 
*vl_mff_map,
- struct ofpbuf *out);
+ uint64_t *tlv_bitmap, struct ofpbuf *out);
 """
 
 if __name__ == '__main__':
diff --git a/include/openvswitch/ofp-actions.h 
b/include/openvswitch/ofp-actions.h
index 88f573dcd74e..808715e9b1a4 100644
--- a/include/openvswitch/ofp-actions.h
+++ b/include/openvswitch/ofp-actions.h
@@ -946,13 +946,14 @@ enum ofperr ofpacts_pull_openflow_actions(struct ofpbuf 
*openflow,
   unsigned int actions_len,
   enum ofp_version version,
   const struct vl_mff_map *,
+  uint64_t *,
   struct ofpbuf *ofpacts);
 enum ofperr
 ofpacts_pull_openflow_instructions(struct ofpbuf *openflow,
unsigned int instructions_len,
enum ofp_version version,
const struct vl_mff_map *vl_mff_map,
-   struct ofpbuf *ofpacts);
+   uint6

[ovs-dev] [PATCH 1/2] nx-match: Use vl_mff_map to parse match field.

2017-03-07 Thread Yi-Hung Wei
vl_mff_map is introduced in patch (04f48a68c428 ofp-actions: Fix variable
length meta-flow OXMs) to account variable length mf_field, and it is used
to decode variable length mf_field in ofp_action. In this patch, vl_mff_map
is further used to decode the variable length match field as well.

Signed-off-by: Yi-Hung Wei 
---
 include/openvswitch/ofp-util.h |  6 ++--
 lib/learning-switch.c  |  2 +-
 lib/nx-match.c | 43 +++--
 lib/nx-match.h | 11 ---
 lib/ofp-print.c|  4 +--
 lib/ofp-util.c | 71 ++
 ofproto/ofproto.c  | 11 ---
 ovn/controller/pinctrl.c   |  2 +-
 tests/ofproto.at   | 15 ++---
 utilities/ovs-ofctl.c  | 17 +-
 10 files changed, 112 insertions(+), 70 deletions(-)

diff --git a/include/openvswitch/ofp-util.h b/include/openvswitch/ofp-util.h
index 0c3a10aa4264..e73a942a3e15 100644
--- a/include/openvswitch/ofp-util.h
+++ b/include/openvswitch/ofp-util.h
@@ -222,7 +222,7 @@ void ofputil_match_to_ofp10_match(const struct match *, 
struct ofp10_match *);
 
 /* Work with ofp11_match. */
 enum ofperr ofputil_pull_ofp11_match(struct ofpbuf *, const struct tun_table *,
- struct match *,
+ const struct vl_mff_map *, struct match *,
  uint16_t *padded_match_len);
 enum ofperr ofputil_pull_ofp11_mask(struct ofpbuf *, struct match *,
 struct mf_bitmap *bm);
@@ -352,7 +352,7 @@ struct ofputil_flow_stats_request {
 
 enum ofperr ofputil_decode_flow_stats_request(
 struct ofputil_flow_stats_request *, const struct ofp_header *,
-const struct tun_table *);
+const struct tun_table *, const struct vl_mff_map *);
 struct ofpbuf *ofputil_encode_flow_stats_request(
 const struct ofputil_flow_stats_request *, enum ofputil_protocol);
 
@@ -457,6 +457,7 @@ void ofputil_packet_in_destroy(struct ofputil_packet_in *);
 
 enum ofperr ofputil_decode_packet_in(const struct ofp_header *, bool loose,
  const struct tun_table *,
+ const struct vl_mff_map *,
  struct ofputil_packet_in *,
  size_t *total_len, uint32_t *buffer_id,
  struct ofpbuf *continuation);
@@ -509,6 +510,7 @@ struct ofpbuf *ofputil_encode_packet_in_private(
 enum ofperr ofputil_decode_packet_in_private(
 const struct ofp_header *, bool loose,
 const struct tun_table *,
+const struct vl_mff_map *,
 struct ofputil_packet_in_private *,
 size_t *total_len, uint32_t *buffer_id);
 
diff --git a/lib/learning-switch.c b/lib/learning-switch.c
index bc757f46dd7a..77155d04fcc0 100644
--- a/lib/learning-switch.c
+++ b/lib/learning-switch.c
@@ -523,7 +523,7 @@ process_packet_in(struct lswitch *sw, const struct 
ofp_header *oh)
 struct dp_packet pkt;
 struct flow flow;
 
-error = ofputil_decode_packet_in(oh, true, NULL, &pi, NULL,
+error = ofputil_decode_packet_in(oh, true, NULL, NULL, &pi, NULL,
  &buffer_id, NULL);
 if (error) {
 VLOG_WARN_RL(&rl, "failed to decode packet-in: %s",
diff --git a/lib/nx-match.c b/lib/nx-match.c
index 91401e2201c6..931e46e21198 100644
--- a/lib/nx-match.c
+++ b/lib/nx-match.c
@@ -480,13 +480,14 @@ nx_pull_header(struct ofpbuf *b, const struct vl_mff_map 
*vl_mff_map,
 
 static enum ofperr
 nx_pull_match_entry(struct ofpbuf *b, bool allow_cookie,
+const struct vl_mff_map *vl_mff_map,
 const struct mf_field **field,
 union mf_value *value, union mf_value *mask)
 {
 enum ofperr error;
 uint64_t header;
 
-error = nx_pull_entry__(b, allow_cookie, NULL, &header, field, value,
+error = nx_pull_entry__(b, allow_cookie, vl_mff_map, &header, field, value,
 mask);
 if (error) {
 return error;
@@ -507,7 +508,8 @@ nx_pull_match_entry(struct ofpbuf *b, bool allow_cookie,
 static enum ofperr
 nx_pull_raw(const uint8_t *p, unsigned int match_len, bool strict,
 struct match *match, ovs_be64 *cookie, ovs_be64 *cookie_mask,
-const struct tun_table *tun_table)
+const struct tun_table *tun_table,
+const struct vl_mff_map *vl_mff_map)
 {
 ovs_assert((cookie != NULL) == (cookie_mask != NULL));
 
@@ -525,7 +527,8 @@ nx_pull_raw(const uint8_t *p, unsigned int match_len, bool 
strict,
 union mf_value mask;
 enum ofperr error;
 
-error = nx_pull_match_entry(&b, cookie != NULL, &field, &value, &mask);
+error = nx_pull_match_entry(&b, cookie != NULL, vl_mff_map, &field,
+&value, &mask);
 if (error) {
 if (error == OFPE

Re: [ovs-dev] [PATCH RFC] doc: Decrease build requirements to support RHEL7.

2017-03-07 Thread Stephen Finucane
On Tue, 2017-03-07 at 17:31 +0300, Ilya Maximets wrote:
> Sphynx 1.1.3 on RHEL7 is able to properly build the documentation.
> One last thing is that 'ps1con' and 'doscon' lexers are not
> supported by available python-pygments-2.0.2. Changing them
> to 'ps1' and 'console' accordingly doesn't make many differencies.
> 
> Sphinx discovering fixed because 'sphinx-build v1.1.3' doesn't
> support '--version' option.
> 
> Signed-off-by: Ilya Maximets 

I'm generally fine with this, but Darren Ball beat you to the punch [1]
and caught one that you seem to have missed (documentation-style.rst)?
As such, we only need the modifications to 'conf.py', 'openvswitch.m4'
and 'requirements.txt'. Assuming we keep just those changes:

Acked-by: Stephen Finucane 

Stephen

[1] https://patchwork.ozlabs.org/patch/734930/

> ---
> 
>  Note:
>   Marked as RFC because I don't know sphinx well.
> 
>  Documentation/conf.py   |  2 +-
>  Documentation/intro/install/windows.rst | 70 ---
> --
>  Documentation/requirements.txt  |  2 +-
>  m4/openvswitch.m4   |  2 +-
>  4 files changed, 38 insertions(+), 38 deletions(-)
> 
> diff --git a/Documentation/conf.py b/Documentation/conf.py
> index 389ef70..5909669 100644
> --- a/Documentation/conf.py
> +++ b/Documentation/conf.py
> @@ -30,7 +30,7 @@ except ImportError:
>  
>  # If your documentation needs a minimal Sphinx version, state it
> here.
>  #
> -needs_sphinx = '1.2'
> +needs_sphinx = '1.1'
>  
>  # Add any Sphinx extension module names here, as strings. They can
> be
>  # extensions coming with Sphinx (named 'sphinx.ext.*') or your
> custom
> diff --git a/Documentation/intro/install/windows.rst
> b/Documentation/intro/install/windows.rst
> index caa9f40..d78a442 100644
> --- a/Documentation/intro/install/windows.rst
> +++ b/Documentation/intro/install/windows.rst
> @@ -225,7 +225,7 @@ building on Linux, FreeBSD, or NetBSD.
>    all MinGW sessions and then run the below command from MSVC
> developers
>    command prompt.:
>  
> -  .. code-block:: doscon
> +  .. code-block:: console
>  
>   > mingw-get upgrade msys-core-bin=1.0.17-1
>  
> @@ -276,7 +276,7 @@ Now run ``./uninstall.cmd`` to remove the old
> extension. Once complete, run
>  turn on ``TESTSIGNING`` boot option or 'Disable Driver Signature
>  Enforcement' during boot.  The following commands can be used:
>  
> -.. code-block:: doscon
> +.. code-block:: console
>  
> > bcdedit /set LOADOPTIONS DISABLE_INTEGRITY_CHECKS
> > bcdedit /set TESTSIGNING ON
> @@ -294,7 +294,7 @@ to work (covered later).
>  The command to create a new switch named 'OVS-Extended-Switch' using
> a physical
>  NIC named 'Ethernet 1' is:
>  
> -.. code-block:: ps1con
> +.. code-block:: ps1
>  
> PS > New-VMSwitch "OVS-Extended-Switch" -NetAdapterName "Ethernet
> 1"
>  
> @@ -307,7 +307,7 @@ In the properties of any switch, you should
> should now see "Open vSwitch
>  Extension" under 'Extensions'.  Click the check box to enable the
> extension.
>  An alternative way to do the same is to run the following command:
>  
> -.. code-block:: ps1con
> +.. code-block:: ps1
>  
> PS > Enable-VMSwitchExtension "Open vSwitch Extension" OVS-
> Extended-Switch
>  
> @@ -330,7 +330,7 @@ database, ovsdb-server. Each machine on which
> Open vSwitch is installed should
>  run its own copy of ovsdb-server. Before ovsdb-server itself can be
> started,
>  configure a database that it can use:
>  
> -.. code-block:: doscon
> +.. code-block:: console
>  
> > ovsdb-tool create C:\openvswitch\etc\openvswitch\conf.db \
> C:\openvswitch\usr\share\openvswitch\vswitch.ovsschema
> @@ -338,7 +338,7 @@ configure a database that it can use:
>  Configure ovsdb-server to use database created above and to listen
> on a Unix
>  domain socket:
>  
> -.. code-block:: doscon
> +.. code-block:: console
>  
> > ovsdb-server -vfile:info --remote=punix:db.sock --log-file \
> --pidfile --detach
> @@ -351,7 +351,7 @@ Initialize the database using ovs-vsctl. This is
> only necessary the first time
>  after you create the database with ovsdb-tool, though running it at
> any time is
>  harmless:
>  
> -.. code-block:: doscon
> +.. code-block:: console
>  
> > ovs-vsctl --no-wait init
>  
> @@ -359,14 +359,14 @@ harmless:
>  
> If you would later like to terminate the started ovsdb-server,
> run:
>  
> -   .. code-block:: doscon
> +   .. code-block:: console
>  
>    > ovs-appctl -t ovsdb-server exit
>  
>  Start the main Open vSwitch daemon, telling it to connect to the
> same Unix
>  domain socket:
>  
> -.. code-block:: doscon
> +.. code-block:: console
>  
> > ovs-vswitchd -vfile:info --log-file --pidfile --detach
>  
> @@ -374,7 +374,7 @@ domain socket:
>  
> If you would like to terminate the started ovs-vswitchd, run:
>  
> -   .. code-block:: doscon
> +   .. code-block:: console
>  
>    > ovs-appctl exit
>  
> @@ -394,7 +394,7 @@ Ad

Re: [ovs-dev] [patch_v1] doc: Support building ovs with Trusty.

2017-03-07 Thread Stephen Finucane
On Tue, 2017-03-07 at 08:21 -0500, Russell Bryant wrote:
> 
> 
> On Tue, Mar 7, 2017 at 5:31 AM, Stephen Finucane 
> wrote:
> > On Thu, 2017-03-02 at 20:01 -0800, Darrell Ball wrote:
> > > Some code-block directives are not understood using
> > > Trusty (I was using 14.04.1 when the issue was found)
> > > default package versions, which blocks the build.
> > >
> > > An error example:
> > > writing output... [100%] topics/language-bindings
> > > Warning, treated as error:
> > > /home/dball/ovs/Documentation/topics/language-bindings.rst:39:
> > > WARNING: Pygments lexer name u'shell' is not known
> > >
> > > 14.04.1 has Sphinx 1.2.2 and Pygments 1.6.
> > >
> > > I expect Trusty to still be widely used, so we
> > > should be able to build ovs with it.
> > >
> > > requirements.rst indicates only:
> > > sphinx>=1.2,<2.0
> > > ovs_sphinx_theme>=1.0,<1.1
> > >
> > > Fixes: f150a8bafbf2 ("doc: Document various language bindings")
> > > Suggested-by: Daniele Di Proietto 
> > > Signed-off-by: Darrell Ball 
> > > CC: Stephen Finucane 
> > 
> > This all looks fine to me. I'm not sure if 14.04 is a valid
> > target still (for development at least), but these changes are
> > small
> > enough and the requirements *do* state 1.2 as the minimum. As such:
> > 
> > Acked-by: Stephen Finucane 
> > 
> > Could you also submit a modification to the documentation style
> > guide
> > as a follow up, noting the need to validate docs against the
> > minimum
> > supported version?
> 
> Maybe we should set up a tox environment that builds the docs using
> the minimum supported version of sphinx.  That would make it easy on
> everyone to test.

This sounds good to me - I'd have it done already only I wasn't sure if
you'd want a tox file in a non-Python project :) I can draft that
shortly if you're OK with it.

I'd still like to update the documentation guide in any case, even if
only to reference the tox option.

Stephen

PS: This also sounds like something that could be automatically tested.
If only some folks were working on a tool to automatically test mailing
list patches...

  https://speakerdeck.com/stephenfin/mailing-list-meet-ci
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH] flake8: Fix build with flake8-import-order installed.

2017-03-07 Thread Russell Bryant
OpenStack CI is currently failing due to some flake8 warnings
emitted from the flake8-import-order plugin.  Just ignore all of
those warnings since they're just style things that aren't important.

Signed-off-by: Russell Bryant 
---
 Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index a4dd7b8..cdf42d3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -350,7 +350,7 @@ ALL_LOCAL += flake8-check
 #   H233 Python 3.x incompatible use of print operator
 #   H238 old style class declaration, use new style (inherit from `object`)
 FLAKE8_SELECT = H231,H232,H233,H238
-FLAKE8_IGNORE = E121,E123,E125,E126,E127,E128,E129,E131,W503,F811,D,H
+FLAKE8_IGNORE = E121,E123,E125,E126,E127,E128,E129,E131,W503,F811,D,H,I
 flake8-check: $(FLAKE8_PYFILES)
$(AM_V_GEN) \
  src='$^' && \
-- 
2.9.3

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


Re: [ovs-dev] [PATCH RFC] doc: Decrease build requirements to support RHEL7.

2017-03-07 Thread Ben Pfaff
Stephen, do you have an opinion on this?  I'll leave it up to you.

On Tue, Mar 07, 2017 at 05:31:02PM +0300, Ilya Maximets wrote:
> Sphynx 1.1.3 on RHEL7 is able to properly build the documentation.
> One last thing is that 'ps1con' and 'doscon' lexers are not
> supported by available python-pygments-2.0.2. Changing them
> to 'ps1' and 'console' accordingly doesn't make many differencies.
> 
> Sphinx discovering fixed because 'sphinx-build v1.1.3' doesn't
> support '--version' option.
> 
> Signed-off-by: Ilya Maximets 
> ---
> 
>  Note:
>   Marked as RFC because I don't know sphinx well.
> 
>  Documentation/conf.py   |  2 +-
>  Documentation/intro/install/windows.rst | 70 
> -
>  Documentation/requirements.txt  |  2 +-
>  m4/openvswitch.m4   |  2 +-
>  4 files changed, 38 insertions(+), 38 deletions(-)
> 
> diff --git a/Documentation/conf.py b/Documentation/conf.py
> index 389ef70..5909669 100644
> --- a/Documentation/conf.py
> +++ b/Documentation/conf.py
> @@ -30,7 +30,7 @@ except ImportError:
>  
>  # If your documentation needs a minimal Sphinx version, state it here.
>  #
> -needs_sphinx = '1.2'
> +needs_sphinx = '1.1'
>  
>  # Add any Sphinx extension module names here, as strings. They can be
>  # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
> diff --git a/Documentation/intro/install/windows.rst 
> b/Documentation/intro/install/windows.rst
> index caa9f40..d78a442 100644
> --- a/Documentation/intro/install/windows.rst
> +++ b/Documentation/intro/install/windows.rst
> @@ -225,7 +225,7 @@ building on Linux, FreeBSD, or NetBSD.
>all MinGW sessions and then run the below command from MSVC developers
>command prompt.:
>  
> -  .. code-block:: doscon
> +  .. code-block:: console
>  
>   > mingw-get upgrade msys-core-bin=1.0.17-1
>  
> @@ -276,7 +276,7 @@ Now run ``./uninstall.cmd`` to remove the old extension. 
> Once complete, run
>  turn on ``TESTSIGNING`` boot option or 'Disable Driver Signature
>  Enforcement' during boot.  The following commands can be used:
>  
> -.. code-block:: doscon
> +.. code-block:: console
>  
> > bcdedit /set LOADOPTIONS DISABLE_INTEGRITY_CHECKS
> > bcdedit /set TESTSIGNING ON
> @@ -294,7 +294,7 @@ to work (covered later).
>  The command to create a new switch named 'OVS-Extended-Switch' using a 
> physical
>  NIC named 'Ethernet 1' is:
>  
> -.. code-block:: ps1con
> +.. code-block:: ps1
>  
> PS > New-VMSwitch "OVS-Extended-Switch" -NetAdapterName "Ethernet 1"
>  
> @@ -307,7 +307,7 @@ In the properties of any switch, you should should now 
> see "Open vSwitch
>  Extension" under 'Extensions'.  Click the check box to enable the extension.
>  An alternative way to do the same is to run the following command:
>  
> -.. code-block:: ps1con
> +.. code-block:: ps1
>  
> PS > Enable-VMSwitchExtension "Open vSwitch Extension" OVS-Extended-Switch
>  
> @@ -330,7 +330,7 @@ database, ovsdb-server. Each machine on which Open 
> vSwitch is installed should
>  run its own copy of ovsdb-server. Before ovsdb-server itself can be started,
>  configure a database that it can use:
>  
> -.. code-block:: doscon
> +.. code-block:: console
>  
> > ovsdb-tool create C:\openvswitch\etc\openvswitch\conf.db \
> C:\openvswitch\usr\share\openvswitch\vswitch.ovsschema
> @@ -338,7 +338,7 @@ configure a database that it can use:
>  Configure ovsdb-server to use database created above and to listen on a Unix
>  domain socket:
>  
> -.. code-block:: doscon
> +.. code-block:: console
>  
> > ovsdb-server -vfile:info --remote=punix:db.sock --log-file \
> --pidfile --detach
> @@ -351,7 +351,7 @@ Initialize the database using ovs-vsctl. This is only 
> necessary the first time
>  after you create the database with ovsdb-tool, though running it at any time 
> is
>  harmless:
>  
> -.. code-block:: doscon
> +.. code-block:: console
>  
> > ovs-vsctl --no-wait init
>  
> @@ -359,14 +359,14 @@ harmless:
>  
> If you would later like to terminate the started ovsdb-server, run:
>  
> -   .. code-block:: doscon
> +   .. code-block:: console
>  
>> ovs-appctl -t ovsdb-server exit
>  
>  Start the main Open vSwitch daemon, telling it to connect to the same Unix
>  domain socket:
>  
> -.. code-block:: doscon
> +.. code-block:: console
>  
> > ovs-vswitchd -vfile:info --log-file --pidfile --detach
>  
> @@ -374,7 +374,7 @@ domain socket:
>  
> If you would like to terminate the started ovs-vswitchd, run:
>  
> -   .. code-block:: doscon
> +   .. code-block:: console
>  
>> ovs-appctl exit
>  
> @@ -394,7 +394,7 @@ Add bridges
>  Let's start by creating an integration bridge, ``br-int`` and a PIF bridge,
>  ``br-pif``:
>  
> -.. code-block:: doscon
> +.. code-block:: console
>  
> > ovs-vsctl add-br br-int
> > ovs-vsctl add-br br-pif
> @@ -408,7 +408,7 @@ Let's start by creating an integration bridge, ``br-i

[ovs-dev] [PATCH 4/4] stp: Don't wait a hello-time before sending BPDU.

2017-03-07 Thread nickcooper-zhangtonghao
Signed-off-by: nickcooper-zhangtonghao 
---
 lib/stp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/stp.c b/lib/stp.c
index d90b400..d828c64 100644
--- a/lib/stp.c
+++ b/lib/stp.c
@@ -306,7 +306,7 @@ stp_create(const char *name, stp_identifier bridge_id,
 
 stp_stop_timer(&stp->tcn_timer);
 stp_stop_timer(&stp->topology_change_timer);
-stp_start_timer(&stp->hello_timer, 0);
+stp_start_timer(&stp->hello_timer, stp->hello_time);
 
 stp->send_bpdu = send_bpdu;
 stp->aux = aux;
-- 
1.8.3.1




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


Re: [ovs-dev] [PATCH] ovs-tcpdump: Set mirror port mtu

2017-03-07 Thread Aaron Conole
Aaron Conole  writes:

> When using ovs-tcpdump to mirror interfaces with MTU larger than the default,
> Open vSwitch will lower the interfaces we are interested in monitoring.
> Instead, probe the MTU and set the mirrored port's MTU value correctly.
>
> Fixes: 314ce6479a83 ("ovs-tcpdump: Add a tcpdump wrapper utility")
> Reported-by: Dan Williams 
> Signed-off-by: Aaron Conole 
> ---

Sorry to pester - ping?
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH RFC] doc: Decrease build requirements to support RHEL7.

2017-03-07 Thread Ilya Maximets
Sphynx 1.1.3 on RHEL7 is able to properly build the documentation.
One last thing is that 'ps1con' and 'doscon' lexers are not
supported by available python-pygments-2.0.2. Changing them
to 'ps1' and 'console' accordingly doesn't make many differencies.

Sphinx discovering fixed because 'sphinx-build v1.1.3' doesn't
support '--version' option.

Signed-off-by: Ilya Maximets 
---

 Note:
Marked as RFC because I don't know sphinx well.

 Documentation/conf.py   |  2 +-
 Documentation/intro/install/windows.rst | 70 -
 Documentation/requirements.txt  |  2 +-
 m4/openvswitch.m4   |  2 +-
 4 files changed, 38 insertions(+), 38 deletions(-)

diff --git a/Documentation/conf.py b/Documentation/conf.py
index 389ef70..5909669 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -30,7 +30,7 @@ except ImportError:
 
 # If your documentation needs a minimal Sphinx version, state it here.
 #
-needs_sphinx = '1.2'
+needs_sphinx = '1.1'
 
 # Add any Sphinx extension module names here, as strings. They can be
 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
diff --git a/Documentation/intro/install/windows.rst 
b/Documentation/intro/install/windows.rst
index caa9f40..d78a442 100644
--- a/Documentation/intro/install/windows.rst
+++ b/Documentation/intro/install/windows.rst
@@ -225,7 +225,7 @@ building on Linux, FreeBSD, or NetBSD.
   all MinGW sessions and then run the below command from MSVC developers
   command prompt.:
 
-  .. code-block:: doscon
+  .. code-block:: console
 
  > mingw-get upgrade msys-core-bin=1.0.17-1
 
@@ -276,7 +276,7 @@ Now run ``./uninstall.cmd`` to remove the old extension. 
Once complete, run
 turn on ``TESTSIGNING`` boot option or 'Disable Driver Signature
 Enforcement' during boot.  The following commands can be used:
 
-.. code-block:: doscon
+.. code-block:: console
 
> bcdedit /set LOADOPTIONS DISABLE_INTEGRITY_CHECKS
> bcdedit /set TESTSIGNING ON
@@ -294,7 +294,7 @@ to work (covered later).
 The command to create a new switch named 'OVS-Extended-Switch' using a physical
 NIC named 'Ethernet 1' is:
 
-.. code-block:: ps1con
+.. code-block:: ps1
 
PS > New-VMSwitch "OVS-Extended-Switch" -NetAdapterName "Ethernet 1"
 
@@ -307,7 +307,7 @@ In the properties of any switch, you should should now see 
"Open vSwitch
 Extension" under 'Extensions'.  Click the check box to enable the extension.
 An alternative way to do the same is to run the following command:
 
-.. code-block:: ps1con
+.. code-block:: ps1
 
PS > Enable-VMSwitchExtension "Open vSwitch Extension" OVS-Extended-Switch
 
@@ -330,7 +330,7 @@ database, ovsdb-server. Each machine on which Open vSwitch 
is installed should
 run its own copy of ovsdb-server. Before ovsdb-server itself can be started,
 configure a database that it can use:
 
-.. code-block:: doscon
+.. code-block:: console
 
> ovsdb-tool create C:\openvswitch\etc\openvswitch\conf.db \
C:\openvswitch\usr\share\openvswitch\vswitch.ovsschema
@@ -338,7 +338,7 @@ configure a database that it can use:
 Configure ovsdb-server to use database created above and to listen on a Unix
 domain socket:
 
-.. code-block:: doscon
+.. code-block:: console
 
> ovsdb-server -vfile:info --remote=punix:db.sock --log-file \
--pidfile --detach
@@ -351,7 +351,7 @@ Initialize the database using ovs-vsctl. This is only 
necessary the first time
 after you create the database with ovsdb-tool, though running it at any time is
 harmless:
 
-.. code-block:: doscon
+.. code-block:: console
 
> ovs-vsctl --no-wait init
 
@@ -359,14 +359,14 @@ harmless:
 
If you would later like to terminate the started ovsdb-server, run:
 
-   .. code-block:: doscon
+   .. code-block:: console
 
   > ovs-appctl -t ovsdb-server exit
 
 Start the main Open vSwitch daemon, telling it to connect to the same Unix
 domain socket:
 
-.. code-block:: doscon
+.. code-block:: console
 
> ovs-vswitchd -vfile:info --log-file --pidfile --detach
 
@@ -374,7 +374,7 @@ domain socket:
 
If you would like to terminate the started ovs-vswitchd, run:
 
-   .. code-block:: doscon
+   .. code-block:: console
 
   > ovs-appctl exit
 
@@ -394,7 +394,7 @@ Add bridges
 Let's start by creating an integration bridge, ``br-int`` and a PIF bridge,
 ``br-pif``:
 
-.. code-block:: doscon
+.. code-block:: console
 
> ovs-vsctl add-br br-int
> ovs-vsctl add-br br-pif
@@ -408,7 +408,7 @@ Let's start by creating an integration bridge, ``br-int`` 
and a PIF bridge,
 
 Validate that ports are added by dumping from both ovs-dpctl and ovs-vsctl:
 
-.. code-block:: doscon
+.. code-block:: console
 
> ovs-dpctl show
system@ovs-system:
@@ -457,7 +457,7 @@ enable them and set the corresponding values to it to make 
them IP-able.
 
 As a whole example, if we issue the following in a powershell console:
 
-.. code-block:: ps1con
+.. code-block:: ps1
 
   

Re: [ovs-dev] [PATCH v4] ovn: Modify the DHCPv4 router option to optional

2017-03-07 Thread Russell Bryant
On Tue, Mar 7, 2017 at 12:50 AM, Guoshuai Li  wrote:

> Co-authored-by: Dong Jun 
>

Since Dong Jun is a co-author of the patch, we need a "Signed-off-by"
header for Dong Jun, as well.  Can you please add it?

Thanks for the patch!


> Signed-off-by: Guoshuai Li 
> Acked-by: Numan Siddique 
>



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


Re: [ovs-dev] [patch_v1] doc: Support building ovs with Trusty.

2017-03-07 Thread Russell Bryant
On Tue, Mar 7, 2017 at 5:31 AM, Stephen Finucane  wrote:

> On Thu, 2017-03-02 at 20:01 -0800, Darrell Ball wrote:
> > Some code-block directives are not understood using
> > Trusty (I was using 14.04.1 when the issue was found)
> > default package versions, which blocks the build.
> >
> > An error example:
> > writing output... [100%] topics/language-bindings
> > Warning, treated as error:
> > /home/dball/ovs/Documentation/topics/language-bindings.rst:39:
> > WARNING: Pygments lexer name u'shell' is not known
> >
> > 14.04.1 has Sphinx 1.2.2 and Pygments 1.6.
> >
> > I expect Trusty to still be widely used, so we
> > should be able to build ovs with it.
> >
> > requirements.rst indicates only:
> > sphinx>=1.2,<2.0
> > ovs_sphinx_theme>=1.0,<1.1
> >
> > Fixes: f150a8bafbf2 ("doc: Document various language bindings")
> > Suggested-by: Daniele Di Proietto 
> > Signed-off-by: Darrell Ball 
> > CC: Stephen Finucane 
>
> This all looks fine to me. I'm not sure if 14.04 is a valid
> target still (for development at least), but these changes are small
> enough and the requirements *do* state 1.2 as the minimum. As such:
>
> Acked-by: Stephen Finucane 
>
> Could you also submit a modification to the documentation style guide
> as a follow up, noting the need to validate docs against the minimum
> supported version?
>

Maybe we should set up a tox environment that builds the docs using the
minimum supported version of sphinx.  That would make it easy on everyone
to test.

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


[ovs-dev] [PATCH 3/4] stp: Set BPDU max age exactly.

2017-03-07 Thread nickcooper-zhangtonghao
Signed-off-by: nickcooper-zhangtonghao 
---
 vswitchd/bridge.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index 2e10013..961ebe6 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -1538,7 +1538,7 @@ bridge_configure_stp(struct bridge *br, bool enable_stp)
   STP_DEFAULT_HELLO_TIME);
 
 br_s.max_age = smap_get_ullong(&br->cfg->other_config, "stp-max-age",
-   STP_DEFAULT_HELLO_TIME / 1000) * 1000;
+   STP_DEFAULT_MAX_AGE / 1000) * 1000;
 br_s.fwd_delay = smap_get_ullong(&br->cfg->other_config,
  "stp-forward-delay",
  STP_DEFAULT_FWD_DELAY / 1000) * 1000;
-- 
1.8.3.1




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


[ovs-dev] [PATCH 2/4] stp: Add the stp/show command.

2017-03-07 Thread nickcooper-zhangtonghao
The stp/show command will help users and developers get
more details about stp. This patch works together with
the previous patch "stp: Change the api for next patch."

Signed-off-by: nickcooper-zhangtonghao 
---
 lib/stp.c | 108 ++
 1 file changed, 108 insertions(+)

diff --git a/lib/stp.c b/lib/stp.c
index 1444dd7..d90b400 100644
--- a/lib/stp.c
+++ b/lib/stp.c
@@ -236,6 +236,8 @@ static void stp_send_bpdu(struct stp_port *, const void *, 
size_t)
 OVS_REQUIRES(mutex);
 static void stp_unixctl_tcn(struct unixctl_conn *, int argc,
 const char *argv[], void *aux);
+static void stp_unixctl_show(struct unixctl_conn *, int argc,
+ const char *argv[], void *aux);
 
 void
 stp_init(void)
@@ -251,6 +253,8 @@ stp_init(void)
 
 unixctl_command_register("stp/tcn", "[bridge]", 0, 1, stp_unixctl_tcn,
  NULL);
+unixctl_command_register("stp/show", "[bridge]", 0, 1,
+ stp_unixctl_show, NULL);
 ovsthread_once_done(&once);
 }
 }
@@ -1634,3 +1638,107 @@ stp_unixctl_tcn(struct unixctl_conn *conn, int argc,
 out:
 ovs_mutex_unlock(&mutex);
 }
+
+static void
+stp_bridge_id_details(struct ds *ds, const stp_identifier bridge_id,
+  const int hello_time, const int max_age,
+  const int forward_delay)
+OVS_REQUIRES(mutex)
+{
+struct eth_addr mac;
+const uint64_t mac_bits = (UINT64_C(1) << 48) - 1;
+
+ds_put_format(ds, "\tstp-priority\t%"PRIu32"\n",
+  (uint16_t)(bridge_id >> 48));
+
+eth_addr_from_uint64(bridge_id & mac_bits, &mac);
+ds_put_format(ds, "\tstp-system-id\t"ETH_ADDR_FMT"\n",
+  ETH_ADDR_ARGS(mac));
+ds_put_format(ds, "\tstp-hello-time\t%"PRId32"s\n",
+  timer_to_ms(hello_time) / 1000);
+ds_put_format(ds, "\tstp-max-age\t%"PRId32"s\n",
+  timer_to_ms(max_age) / 1000);
+ds_put_format(ds, "\tstp-fwd-delay\t%"PRId32"s\n",
+  timer_to_ms(forward_delay) / 1000);
+}
+
+static void
+stp_print_details(struct ds *ds, const struct stp *stp)
+OVS_REQUIRES(mutex)
+{
+const uint16_t port_no_bits = (UINT16_C(1) << 8) - 1;
+
+ds_put_format(ds, " %s \n", stp->name);
+ds_put_cstr(ds, "Root ID:\n");
+
+stp_bridge_id_details(ds, stp->designated_root,
+  stp->bridge_hello_time,
+  stp->bridge_max_age,
+  stp->bridge_forward_delay);
+
+if (stp_is_root_bridge(stp)) {
+ds_put_cstr(ds, "\tThis bridge is the root\n");
+} else {
+ds_put_format(ds, "\troot-port\t%s\n",
+  stp->root_port->port_name);
+ds_put_format(ds, "\troot-path-cost\t%"PRIu32"\n",
+  stp->root_path_cost);
+}
+
+ds_put_cstr(ds, "\n");
+
+ds_put_cstr(ds, "Bridge ID:\n");
+stp_bridge_id_details(ds, stp->bridge_id,
+  stp->hello_time,
+  stp->max_age,
+  stp->forward_delay);
+
+ds_put_cstr(ds, "\n");
+
+const struct stp_port *p;
+ds_put_format(ds, "\t%-11.10s%-11.10s%-11.10s%-6.5s%-8.7s\n",
+  "Interface", "Role", "State", "Cost", "Pri.Nbr");
+ds_put_cstr(ds, "\t-- -- -- - ---\n");
+FOR_EACH_ENABLED_PORT (p, stp) {
+ds_put_format(ds, "\t%-11.10s", p->port_name);
+ds_put_format(ds, "%-11.10s", stp_role_name(stp_port_get_role(p)));
+ds_put_format(ds, "%-11.10s", stp_state_name(p->state));
+ds_put_format(ds, "%-6"PRId32, p->path_cost);
+ds_put_format(ds, "%"PRIu16".%"PRIu16"\n",
+  p->port_id >> 8,
+  p->port_id & port_no_bits);
+}
+
+ds_put_cstr(ds, "\n");
+}
+
+static void
+stp_unixctl_show(struct unixctl_conn *conn, int argc,
+const char *argv[], void *aux OVS_UNUSED)
+{
+struct ds ds = DS_EMPTY_INITIALIZER;
+
+ovs_mutex_lock(&mutex);
+if (argc > 1) {
+struct stp *stp = stp_find(argv[1]);
+
+if (!stp) {
+unixctl_command_reply_error(conn, "no such stp object");
+goto out;
+}
+
+stp_print_details(&ds, stp);
+} else {
+struct stp *stp;
+
+LIST_FOR_EACH (stp, node, all_stps) {
+stp_print_details(&ds, stp);
+}
+}
+
+unixctl_command_reply(conn, ds_cstr(&ds));
+ds_destroy(&ds);
+
+out:
+ovs_mutex_unlock(&mutex);
+}
-- 
1.8.3.1



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


[ovs-dev] [PATCH 1/4] stp: Change the api for next patch.

2017-03-07 Thread nickcooper-zhangtonghao
This patch changes the stp_port_get_role and removes
the stp_port_get_id, because stp/show has locked the
mutex before calling the stp_port_get_role, and
stp_port_get_id will not be used.

Signed-off-by: nickcooper-zhangtonghao 
---
 lib/stp.c  | 29 +
 lib/stp.h  |  4 ++--
 ofproto/ofproto-dpif.c |  4 +---
 3 files changed, 16 insertions(+), 21 deletions(-)

diff --git a/lib/stp.c b/lib/stp.c
index ecef012..1444dd7 100644
--- a/lib/stp.c
+++ b/lib/stp.c
@@ -857,18 +857,6 @@ stp_port_no(const struct stp_port *p)
 return index;
 }
 
-/* Returns the port ID for 'p'. */
-int
-stp_port_get_id(const struct stp_port *p)
-{
-int port_id;
-
-ovs_mutex_lock(&mutex);
-port_id = p->port_id;
-ovs_mutex_unlock(&mutex);
-return port_id;
-}
-
 /* Returns the state of port 'p'. */
 enum stp_state
 stp_port_get_state(const struct stp_port *p)
@@ -882,13 +870,12 @@ stp_port_get_state(const struct stp_port *p)
 }
 
 /* Returns the role of port 'p'. */
-enum stp_role
-stp_port_get_role(const struct stp_port *p)
+static enum stp_role
+stp_port_get_role(const struct stp_port *p) OVS_REQUIRES(mutex)
 {
 struct stp_port *root_port;
 enum stp_role role;
 
-ovs_mutex_lock(&mutex);
 root_port = p->stp->root_port;
 if (root_port && root_port->port_id == p->port_id) {
 role = STP_ROLE_ROOT;
@@ -899,7 +886,6 @@ stp_port_get_role(const struct stp_port *p)
 } else {
 role = STP_ROLE_ALTERNATE;
 }
-ovs_mutex_unlock(&mutex);
 return role;
 }
 
@@ -915,6 +901,17 @@ stp_port_get_counts(const struct stp_port *p,
 ovs_mutex_unlock(&mutex);
 }
 
+void
+stp_port_get_status(const struct stp_port *p,
+int *port_id, enum stp_state *state, enum stp_role *role)
+{
+ovs_mutex_lock(&mutex);
+*port_id = p->port_id;
+*state = p->state;
+*role = stp_port_get_role(p);
+ovs_mutex_unlock(&mutex);
+}
+
 /* Disables STP on port 'p'. */
 void
 stp_port_disable(struct stp_port *p)
diff --git a/lib/stp.h b/lib/stp.h
index 9f945ad..c64089a 100644
--- a/lib/stp.h
+++ b/lib/stp.h
@@ -145,11 +145,11 @@ void stp_port_set_name(struct stp_port *, const char *);
 void stp_port_set_aux(struct stp_port *, void *);
 void *stp_port_get_aux(struct stp_port *);
 int stp_port_no(const struct stp_port *);
-int stp_port_get_id(const struct stp_port *);
 enum stp_state stp_port_get_state(const struct stp_port *);
-enum stp_role stp_port_get_role(const struct stp_port *);
 void stp_port_get_counts(const struct stp_port *,
  int *tx_count, int *rx_count, int *error_count);
+void stp_port_get_status(const struct stp_port *p,
+ int *port_id, enum stp_state *state, enum stp_role 
*role);
 void stp_port_enable(struct stp_port *);
 void stp_port_disable(struct stp_port *);
 void stp_port_set_priority(struct stp_port *, uint8_t new_priority);
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 1e1b107..526ef27 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -2442,10 +2442,8 @@ get_stp_port_status(struct ofport *ofport_,
 }
 
 s->enabled = true;
-s->port_id = stp_port_get_id(sp);
-s->state = stp_port_get_state(sp);
+stp_port_get_status(sp, &s->port_id, &s->state, &s->role);
 s->sec_in_state = (time_msec() - ofport->stp_state_entered) / 1000;
-s->role = stp_port_get_role(sp);
 
 return 0;
 }
-- 
1.8.3.1



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


Re: [ovs-dev] ORDER NO 8/8/17/020

2017-03-07 Thread Ziad G . Nasrallah
AS ATTACHED ONLINE ORDER NO 8/8/17/020 ..PLS ARRANGE FOR THE DESPATCH ASAP AS 
THEY ARE EXTREMELY NEEDED
THANK YOU
 Best Regards.
  
 Ziad G. Nasrallah  |   Senior Sales Coordinator
 
 Meet us at Index 2017, Booth # 1236
 4  13 7 April 2017 , Geneva, Switzerland
 
 
  
 
Phoenix Machinery s.a.l., Safra, Keserwan, Lebanon
P.O. Box: 11-2354 Beirut, Lebanon

Tel: +961-9-855 690 / 1 / 2 / 3 / 4 / 5 Ext. 4364  |  Fax: + 961-9-855 696 Cel: 
961-70-148005
E-mail: ziad.nasral...@phoenixlb.com  |  Web:  http://www.phoenixlb.com
 Facebook: https://www.facebook.com/PhoenixEnergyLebanon
  
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] Guarantee Reply ASAP

2017-03-07 Thread HAGGARD
I am Capt. Haggard I have special proposal that will do you good, contact me 
for more understanding

Regard
Haggard
Email: cpt.hagg...@us-mil-army.com
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [patch_v1] doc: Support building ovs with Trusty.

2017-03-07 Thread Stephen Finucane
On Thu, 2017-03-02 at 20:01 -0800, Darrell Ball wrote:
> Some code-block directives are not understood using
> Trusty (I was using 14.04.1 when the issue was found)
> default package versions, which blocks the build.
> 
> An error example:
> writing output... [100%] topics/language-bindings
> Warning, treated as error:
> /home/dball/ovs/Documentation/topics/language-bindings.rst:39:
> WARNING: Pygments lexer name u'shell' is not known
> 
> 14.04.1 has Sphinx 1.2.2 and Pygments 1.6.
> 
> I expect Trusty to still be widely used, so we
> should be able to build ovs with it.
> 
> requirements.rst indicates only:
> sphinx>=1.2,<2.0
> ovs_sphinx_theme>=1.0,<1.1
> 
> Fixes: f150a8bafbf2 ("doc: Document various language bindings")
> Suggested-by: Daniele Di Proietto 
> Signed-off-by: Darrell Ball 
> CC: Stephen Finucane 

This all looks fine to me. I'm not sure if 14.04 is a valid
target still (for development at least), but these changes are small
enough and the requirements *do* state 1.2 as the minimum. As such:

Acked-by: Stephen Finucane 

Could you also submit a modification to the documentation style guide
as a follow up, noting the need to validate docs against the minimum
supported version?

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


[ovs-dev] Wichtiger Hinweis!

2017-03-07 Thread Tom Crist via dev



Hallo, Sie haben eine wohltätige Spende von $ 4,8 Millionen, gewann ich im 
Lotto Amerika Wert $ 40 Millionen in Amerika und Spende ich einen Teil davon 
fünf glückliche Menschen und Altersheimen in Erinnerung an meine Frau, die an 
Krebs gestorben. Kontaktieren Sie mich für nähere Infos unter: 
tomcris...@yahoo.com
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 07/10] windows: add include to stream-windows.c

2017-03-07 Thread Sairam Venugopal
Acked-by: Sairam Venugopal 






On 2/5/17, 8:41 PM, "ovs-dev-boun...@openvswitch.org on behalf of Alin Serdean" 
 
wrote:

>fatal_signal_unlink_file_now is used but the header for it is missing in
>the include section.
>
>Signed-off-by: Alin Gabriel Serdean 
>---
> lib/stream-windows.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>diff --git a/lib/stream-windows.c b/lib/stream-windows.c
>index 1950014..44b88bf 100644
>--- a/lib/stream-windows.c
>+++ b/lib/stream-windows.c
>@@ -1,5 +1,5 @@
> /*
>- * Copyright (c) 2016 Cloudbase Solutions Srl
>+ * Copyright (c) 2016, 2017 Cloudbase Solutions Srl
>  *
>  * Licensed under the Apache License, Version 2.0 (the "License");
>  * you may not use this file except in compliance with the License.
>@@ -22,6 +22,7 @@
> #include 
> #include "poll-loop.h"
> #include "dirs.h"
>+#include "fatal-signal.h"
> #include "util.h"
> #include "stream-provider.h"
> #include "openvswitch/vlog.h"
>-- 
>2.10.2.windows.1
>___
>dev mailing list
>d...@openvswitch.org
>https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=Z6vowHUOjP5ysP_g372c49Nqc1vEKqHKNBkR5Q5Z7uo&m=EMvAFL6hi4dJTHjZN0D_bsrzIyU7Z0yKkVrFcCmEYac&s=YxdZd27GFcaY5WwD71S8a3ZVYchl2CtEGh1nJOlJcys&e=
> 
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 06/10] windows: add function definition to poll-loop.h

2017-03-07 Thread Sairam Venugopal
Acked-by: Sairam Venugopal 






On 2/5/17, 8:41 PM, "ovs-dev-boun...@openvswitch.org on behalf of Alin Serdean" 
 
wrote:

>poll_wevent_wait_at is used in the #define but the function definition
>is missing.
>
>Signed-off-by: Alin Gabriel Serdean 
>---
> lib/poll-loop.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>diff --git a/lib/poll-loop.h b/lib/poll-loop.h
>index 01e1aa8..84082f0 100644
>--- a/lib/poll-loop.h
>+++ b/lib/poll-loop.h
>@@ -1,5 +1,5 @@
> /*
>- * Copyright (c) 2008, 2009, 2010, 2011, 2013 Nicira, Inc.
>+ * Copyright (c) 2008, 2009, 2010, 2011, 2013, 2017 Nicira, Inc.
>  *
>  * Licensed under the Apache License, Version 2.0 (the "License");
>  * you may not use this file except in compliance with the License.
>@@ -54,6 +54,7 @@ void poll_fd_wait_at(int fd, short int events, const char 
>*where);
> #define poll_fd_wait(fd, events) poll_fd_wait_at(fd, events, 
> OVS_SOURCE_LOCATOR)
> 
> #ifdef _WIN32
>+void poll_wevent_wait_at(HANDLE wevent, const char *where);
> #define poll_wevent_wait(wevent) poll_wevent_wait_at(wevent, 
> OVS_SOURCE_LOCATOR)
> #endif /* _WIN32 */
> 
>-- 
>2.10.2.windows.1
>___
>dev mailing list
>d...@openvswitch.org
>https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=Z6vowHUOjP5ysP_g372c49Nqc1vEKqHKNBkR5Q5Z7uo&m=M32LvRr9xt20dh_l_AwSAi50_YQfMlmlCtPpeAvFyDg&s=k_jyDqCZtMWucz5m42AmlLDtipJpx3bXC72DeP5DK1A&e=
> 
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 03/10] windows: add includes to daemon-windows

2017-03-07 Thread Sairam Venugopal
Why should _getpid() be replaced with the other function? 

Thanks,
Sairam



On 2/5/17, 8:41 PM, "ovs-dev-boun...@openvswitch.org on behalf of Alin Serdean" 
 
wrote:

>Add fatal-signal.h include since it uses: fatal_signal_atexit_handler
>and fatal_signal_add_hook
>
>Use the defined getpid() function and also include  since
>it is defined in include/windows/unistd.h .
>
>Signed-off-by: Alin Gabriel Serdean 
>---
> lib/daemon-windows.c | 6 --
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
>diff --git a/lib/daemon-windows.c b/lib/daemon-windows.c
>index 7e2e9da..ccf4297 100644
>--- a/lib/daemon-windows.c
>+++ b/lib/daemon-windows.c
>@@ -1,5 +1,5 @@
> /*
>- * Copyright (c) 2014 Nicira, Inc.
>+ * Copyright (c) 2014, 2017 Nicira, Inc.
>  *
>  * Licensed under the Apache License, Version 2.0 (the "License");
>  * you may not use this file except in compliance with the License.
>@@ -20,7 +20,9 @@
> #include 
> #include 
> #include 
>+#include 
> #include "dirs.h"
>+#include "fatal-signal.h"
> #include "ovs-thread.h"
> #include "poll-loop.h"
> #include "openvswitch/vlog.h"
>@@ -476,7 +478,7 @@ make_pidfile(void)
> 
> fatal_signal_add_hook(unlink_pidfile, NULL, NULL, true);
> 
>-fprintf(filep_pidfile, "%d\n", _getpid());
>+fprintf(filep_pidfile, "%d\n", getpid());
> if (fflush(filep_pidfile) == EOF) {
> VLOG_FATAL("Failed to write into the pidfile %s", pidfile);
> }
>-- 
>2.10.2.windows.1
>___
>dev mailing list
>d...@openvswitch.org
>https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=Z6vowHUOjP5ysP_g372c49Nqc1vEKqHKNBkR5Q5Z7uo&m=4bES-cJ6lfbtKBVTx_l5djCuYUzfaAv1eo2-AJJVP4I&s=g49Hk4r9F29861GqEbXLFLjyYxmJENyhOos6Tr-BEdQ&e=
> 
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 05/10] windows: fix calls in netlink-socket

2017-03-07 Thread Sairam Venugopal
Acked-by: Sairam Venugopal 







On 2/5/17, 8:41 PM, "ovs-dev-boun...@openvswitch.org on behalf of Alin Serdean" 
 
wrote:

>Add nl_sock_transact forward declaration, since it is used before
>being on implemented. This applies only on Windows.
>
>Move nl_sock_subscribe_packet__ function before it is used.
>
>It makes more sense to move it rather than adding a forward declaration
>since it is used by the two functions defined above it.
>
>Signed-off-by: Alin Gabriel Serdean 
>---
> lib/netlink-socket.c | 50 ++
> 1 file changed, 26 insertions(+), 24 deletions(-)
>
>diff --git a/lib/netlink-socket.c b/lib/netlink-socket.c
>index e45914c..f4c6fd9 100644
>--- a/lib/netlink-socket.c
>+++ b/lib/netlink-socket.c
>@@ -60,6 +60,8 @@ static void log_nlmsg(const char *function, int error,
> #ifdef _WIN32
> static int get_sock_pid_from_kernel(struct nl_sock *sock);
> static int set_sock_property(struct nl_sock *sock);
>+static int nl_sock_transact(struct nl_sock *sock, const struct ofpbuf 
>*request,
>+struct ofpbuf **replyp);
> #endif
> ?
> /* Netlink sockets. */
>@@ -425,6 +427,30 @@ nl_sock_join_mcgroup(struct nl_sock *sock, unsigned int 
>multicast_group)
> 
> #ifdef _WIN32
> int
>+nl_sock_subscribe_packet__(struct nl_sock *sock, bool subscribe)
>+{
>+struct ofpbuf request;
>+uint64_t request_stub[128];
>+struct ovs_header *ovs_header;
>+struct nlmsghdr *nlmsg;
>+int error;
>+
>+ofpbuf_use_stub(&request, request_stub, sizeof request_stub);
>+nl_msg_put_genlmsghdr(&request, 0, OVS_WIN_NL_CTRL_FAMILY_ID, 0,
>+  OVS_CTRL_CMD_PACKET_SUBSCRIBE_REQ,
>+  OVS_WIN_CONTROL_VERSION);
>+
>+ovs_header = ofpbuf_put_uninit(&request, sizeof *ovs_header);
>+ovs_header->dp_ifindex = 0;
>+nl_msg_put_u8(&request, OVS_NL_ATTR_PACKET_SUBSCRIBE, subscribe ? 1 : 0);
>+nl_msg_put_u32(&request, OVS_NL_ATTR_PACKET_PID, sock->pid);
>+
>+error = nl_sock_send(sock, &request, true);
>+ofpbuf_uninit(&request);
>+return error;
>+}
>+
>+int
> nl_sock_subscribe_packets(struct nl_sock *sock)
> {
> int error;
>@@ -459,30 +485,6 @@ nl_sock_unsubscribe_packets(struct nl_sock *sock)
> sock->read_ioctl = OVS_IOCTL_READ;
> return 0;
> }
>-
>-int
>-nl_sock_subscribe_packet__(struct nl_sock *sock, bool subscribe)
>-{
>-struct ofpbuf request;
>-uint64_t request_stub[128];
>-struct ovs_header *ovs_header;
>-struct nlmsghdr *nlmsg;
>-int error;
>-
>-ofpbuf_use_stub(&request, request_stub, sizeof request_stub);
>-nl_msg_put_genlmsghdr(&request, 0, OVS_WIN_NL_CTRL_FAMILY_ID, 0,
>-  OVS_CTRL_CMD_PACKET_SUBSCRIBE_REQ,
>-  OVS_WIN_CONTROL_VERSION);
>-
>-ovs_header = ofpbuf_put_uninit(&request, sizeof *ovs_header);
>-ovs_header->dp_ifindex = 0;
>-nl_msg_put_u8(&request, OVS_NL_ATTR_PACKET_SUBSCRIBE, subscribe ? 1 : 0);
>-nl_msg_put_u32(&request, OVS_NL_ATTR_PACKET_PID, sock->pid);
>-
>-error = nl_sock_send(sock, &request, true);
>-ofpbuf_uninit(&request);
>-return error;
>-}
> #endif
> 
> /* Tries to make 'sock' stop listening to 'multicast_group'.  Returns 0 if
>-- 
>2.10.2.windows.1
>___
>dev mailing list
>d...@openvswitch.org
>https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=Z6vowHUOjP5ysP_g372c49Nqc1vEKqHKNBkR5Q5Z7uo&m=Rv_yI-lt1EoeaN4Xzp2r3ZeNVphsVz65WcblPQ_igvU&s=gm4S8Z7cdQx42sqD7mWNa2g9JBWKsiE-NV81-1k8i8s&e=
> 
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 04/10] windows: add forward declaration to dpif-netlink

2017-03-07 Thread Sairam Venugopal
Acked-by: Sairam Venugopal 







On 2/5/17, 8:41 PM, "ovs-dev-boun...@openvswitch.org on behalf of Alin Serdean" 
 
wrote:

>dpif_netlink_port_query__ is used before it is defined on Windows.
>
>Add a forward declaration to it.
>
>Signed-off-by: Alin Gabriel Serdean 
>---
> lib/dpif-netlink.c | 3 +++
> 1 file changed, 3 insertions(+)
>
>diff --git a/lib/dpif-netlink.c b/lib/dpif-netlink.c
>index 9762a87..20431b5 100644
>--- a/lib/dpif-netlink.c
>+++ b/lib/dpif-netlink.c
>@@ -60,6 +60,9 @@ VLOG_DEFINE_THIS_MODULE(dpif_netlink);
> #ifdef _WIN32
> #include "wmi.h"
> enum { WINDOWS = 1 };
>+static int dpif_netlink_port_query__(const struct dpif_netlink *dpif,
>+ odp_port_t port_no, const char 
>*port_name,
>+ struct dpif_port *dpif_port);
> #else
> enum { WINDOWS = 0 };
> #endif
>-- 
>2.10.2.windows.1
>___
>dev mailing list
>d...@openvswitch.org
>https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=Z6vowHUOjP5ysP_g372c49Nqc1vEKqHKNBkR5Q5Z7uo&m=HkzeKnUuwz3ua03n3alMNjEk-jNebQCyg5Wa1C2JUDQ&s=t7u4Me0d_2oVg6ejIhWuB_rGOQHFqHiHeoykB7Xpdv8&e=
> 
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 01/10] windows: Add definition of getrusage

2017-03-07 Thread Sairam Venugopal
Acked-by: Sairam Venugopal 






On 2/5/17, 8:41 PM, "ovs-dev-boun...@openvswitch.org on behalf of Alin Serdean" 
 
wrote:

>getrusage is implemented in lib/getrusage-windows.c.
>
>This patch just adds its definition to include/windows/sys/resource.h,
>which serves for files that include .
>
>Another that we could also do is to move the implementation to
>include/windows
>
>Signed-off-by: Alin Gabriel Serdean 
>---
> include/windows/sys/resource.h | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
>diff --git a/include/windows/sys/resource.h b/include/windows/sys/resource.h
>index d4628f2..d8f2607 100644
>--- a/include/windows/sys/resource.h
>+++ b/include/windows/sys/resource.h
>@@ -1,5 +1,5 @@
> /*
>- * Copyright (c) 2014 Nicira, Inc.
>+ * Copyright (c) 2014, 2017 Nicira, Inc.
>  *
>  * Licensed under the Apache License, Version 2.0 (the "License");
>  * you may not use this file except in compliance with the License.
>@@ -48,4 +48,6 @@ struct rusage {
> #define RUSAGE_THREAD 3
> #endif
> 
>+int getrusage(int who, struct rusage *usage);
>+
> #endif /* sys/resource.h */
>-- 
>2.10.2.windows.1
>___
>dev mailing list
>d...@openvswitch.org
>https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=Z6vowHUOjP5ysP_g372c49Nqc1vEKqHKNBkR5Q5Z7uo&m=2qmMMX2ar0lS1DaBjcl2Wai9GZhly6Gx4MEWthzYti8&s=uo8oTXbFBlE-9GA0Jrnii5rk7F-qHmpzz2E0le7pd6o&e=
> 
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 02/10] windows: add definition of getpid and getcwd

2017-03-07 Thread Sairam Venugopal
Shouldn’t we cast the DWORD to unsigned int for the GetCurrentProcessId?




On 2/5/17, 8:41 PM, "ovs-dev-boun...@openvswitch.org on behalf of Alin Serdean" 
 
wrote:

>getcwd - is used in lib/util.c. getcwd is deprecated on Windows but has
>_getcwd which is defined in :
>https://urldefense.proofpoint.com/v2/url?u=https-3A__msdn.microsoft.com_en-2Dus_library_sf98bd4y-28v-3Dvs.120-29.aspx&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=Z6vowHUOjP5ysP_g372c49Nqc1vEKqHKNBkR5Q5Z7uo&m=og4savUMMSe8GoOfKq6AMAirivJFLgVTMx5lx7hx6gk&s=CVjSRN456APj3-mMAQuXYxdJ4oUgduwqZHzkod6cLvQ&e=
> 
>
>getpid - is used in several files (i.e. lib/vlog.c). getpid
>is also and deprecated and _getpid should be used:
>https://urldefense.proofpoint.com/v2/url?u=https-3A__msdn.microsoft.com_en-2Dus_library_t2y34y40-28v-3Dvs.120-29.aspx&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=Z6vowHUOjP5ysP_g372c49Nqc1vEKqHKNBkR5Q5Z7uo&m=og4savUMMSe8GoOfKq6AMAirivJFLgVTMx5lx7hx6gk&s=pDh2W8ECiQdxZdHgHBdWHIDhLPcTJ9A6rb2n1YcRZ94&e=
> 
>The problem using _getpid is that the definition is in .
>A file called process.h also exists in the lib folder. This will mess up
>includes.
>An option would be to use a wrapper like we use for lib/string.h(.in) but
>that would mean to also add it to the automake chain.
>A simple solution would be to map it to GetCurrentProcessId
>https://urldefense.proofpoint.com/v2/url?u=https-3A__msdn.microsoft.com_en-2Dus_library_windows_desktop_ms683180-28v-3Dvs.85-29.aspx&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=Z6vowHUOjP5ysP_g372c49Nqc1vEKqHKNBkR5Q5Z7uo&m=og4savUMMSe8GoOfKq6AMAirivJFLgVTMx5lx7hx6gk&s=QWV0dTQAbL1Jt9ZeQeUAUs-WBb8w5YW0mn1cHxFeaZs&e=
> 
>The disadvantage is the type but Windows recycles pids so in theory
>it should be ok.
>
>Signed-off-by: Alin Gabriel Serdean 
>---
> include/windows/unistd.h | 3 +++
> 1 file changed, 3 insertions(+)
>
>diff --git a/include/windows/unistd.h b/include/windows/unistd.h
>index 8629f7e..3f92616 100644
>--- a/include/windows/unistd.h
>+++ b/include/windows/unistd.h
>@@ -18,8 +18,11 @@
> 
> #define WIN32_LEAN_AND_MEAN
> #include 
>+#include 
> 
> #define fsync _commit
>+#define getpid GetCurrentProcessId
>+#define getcwd _getcwd
> 
> /* Standard file descriptors.  */
> #define STDIN_FILENO0   /* Standard input.  */
>-- 
>2.10.2.windows.1
>___
>dev mailing list
>d...@openvswitch.org
>https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=Z6vowHUOjP5ysP_g372c49Nqc1vEKqHKNBkR5Q5Z7uo&m=og4savUMMSe8GoOfKq6AMAirivJFLgVTMx5lx7hx6gk&s=864IlShezC_8X9CmDoHDkTjOqBJ3IcRu1LeeoRJrhdM&e=
> 
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] windows: Remove dead code in daemon-windows

2017-03-07 Thread Sairam Venugopal
Commit message should probably say - unused code instead of dead code.

Acked-by: Sairam Venugopal 







On 2/5/17, 3:49 PM, "ovs-dev-boun...@openvswitch.org on behalf of Alin Serdean" 
 
wrote:

>Found by inspection.
>
>Signed-off-by: Alin Gabriel Serdean 
>---
> lib/daemon-windows.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
>diff --git a/lib/daemon-windows.c b/lib/daemon-windows.c
>index 7e2e9da..4fc97a8 100644
>--- a/lib/daemon-windows.c
>+++ b/lib/daemon-windows.c
>@@ -77,8 +77,7 @@ daemon_usage(void)
> "\nService options:\n"
> "  --service   run in background as a service.\n"
> "  --service-monitor   restart the service in case of an "
>-   "unexpected failure. \n",
>-ovs_rundir(), program_name);
>+   "unexpected failure. \n");
> }
> 
> /* Registers the call-back and configures the actions in case of a failure
>-- 
>2.10.2.windows.1
>___
>dev mailing list
>d...@openvswitch.org
>https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=Z6vowHUOjP5ysP_g372c49Nqc1vEKqHKNBkR5Q5Z7uo&m=Uxb18p0v_M-Rlapp2oC270tEowSxS9lacSo6a2QNePU&s=tFiprG6rV5uzISIuOGtCx1IX3-DPrk9MmUyjZxiQ15M&e=
> 
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v2] datapath-windows: Fix GENEVE option header

2017-03-07 Thread Sairam Venugopal
Acked-by: Sairam Venugopal 





On 3/6/17, 8:16 AM, "ovs-dev-boun...@openvswitch.org on behalf of Alin Serdean" 
 
wrote:

>From: Alin Serdean 
>
>The GENEVE option header is defined in big endian, however we support only
>little endian on Windows at the moment.
>
>This patch changes the GENEVE option header into little endian.
>
>Found while testing.
>
>Signed-off-by: Alin Gabriel Serdean 
>Acked-by: Yin Lin 
>---
>v2: Change commit title and message as suggested by:
>Guru Shetty 
>intended for: master, branch-2.7
>---
> datapath-windows/ovsext/Geneve.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/datapath-windows/ovsext/Geneve.h 
>b/datapath-windows/ovsext/Geneve.h
>index be8a834..019c0dd 100644
>--- a/datapath-windows/ovsext/Geneve.h
>+++ b/datapath-windows/ovsext/Geneve.h
>@@ -71,10 +71,10 @@ typedef struct GeneveOptionHdr {
> UINT32   optionClass:16;
> /* Format of data contained in the option. */
> UINT32   type:8;
>-/* Reserved. */
>-UINT32   reserved:3;
> /* Length of option in int32 excluding the option header. */
> UINT32   length:5;
>+/* Reserved. */
>+UINT32   reserved:3;
> } GeneveOptionHdr;
> 
> #define GENEVE_CRIT_OPT_TYPE (1 << 7)
>-- 
>2.10.2.windows.1
>___
>dev mailing list
>d...@openvswitch.org
>https://mail.openvswitch.org/mailman/listinfo/ovs-dev
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v2] windows: Fix uninitialized variable in netlink-socket

2017-03-07 Thread Sairam Venugopal
Acked-by: Sairam Venugopal 





On 3/6/17, 8:22 AM, "ovs-dev-boun...@openvswitch.org on behalf of Alin Serdean" 
 
wrote:

>From: Alin Serdean 
>
>The variable `request_nlmsg` was used without being initialized.
>
>This patch assigns a value to it before being used.
>
>Found by inspection.
>
>Signed-off-by: Alin Gabriel Serdean 
>---
>v2: Change commit title
>---
> lib/netlink-socket.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>diff --git a/lib/netlink-socket.c b/lib/netlink-socket.c
>index e45914c..7105b9b 100644
>--- a/lib/netlink-socket.c
>+++ b/lib/netlink-socket.c
>@@ -886,6 +886,8 @@ nl_sock_transact_multiple__(struct nl_sock *sock,
> }
> 
> if (reply_len != 0) {
>+request_nlmsg = nl_msg_nlmsghdr(txn->request);
>+
> if (reply_len < sizeof *reply_nlmsg) {
> nl_sock_record_errors__(transactions, n, 0);
> VLOG_DBG_RL(&rl, "insufficient length of reply %#"PRIu32
>@@ -894,7 +896,6 @@ nl_sock_transact_multiple__(struct nl_sock *sock,
> }
> 
> /* Validate the sequence number in the reply. */
>-request_nlmsg = nl_msg_nlmsghdr(txn->request);
> reply_nlmsg = (struct nlmsghdr *)reply_buf;
> 
> if (request_nlmsg->nlmsg_seq != reply_nlmsg->nlmsg_seq) {
>-- 
>2.10.2.windows.1
>___
>dev mailing list
>d...@openvswitch.org
>https://mail.openvswitch.org/mailman/listinfo/ovs-dev
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev