Re: [ovs-dev] [PATCH] netdev-linux: do not remove ingress qdisc when disable policing.

2017-11-15 Thread Guoshuai Li

I'm sorry for my mistake. I did not think so much

I actually want to express the meaning is

tc qdisc should not be operated when never enabled policing.

Because my question is this:

   step1. Configure the tc command at the ovs-port

  # tc qdisc add dev ovs-port ingress

  # tc qdisc show dev ovs-port
 qdisc noqueue 0: root refcnt 2
 qdisc ingress : parent :fff1 

   step2. Then refresh the ovs-port state, qdisc ingress is removed.

  # ip link set ovs-port down

  # ip link set ovs-port up

  # tc qdisc show dev ovs-port
 qdisc noqueue 0: root refcnt 2


I want to fix this problem, but accidentally broke the original 
function.  I'm very sorry.


I sent a new version to fix it:
https://mail.openvswitch.org/pipermail/ovs-dev/2017-November/340971.html





After this patch is applied, it looks to me like removing policing
becomes a complete no-op.  That cannot be right; it means that policing,
once enabled, cannot be disabled.

Can you help me understand better?

Thanks,

Ben.


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


[ovs-dev] [PATCH v2] netdev-linux: Do not remove ingress qdisc when policing is never enabled.

2017-11-15 Thread Guoshuai Li
rate limiting may be implemented in other ways (such as nova/libvirt),
ovs never enable policing. I think ovs need not control qdisc, such as remove
qdisk added by other.

Signed-off-by: Guoshuai Li 
Signed-off-by: huweihua 
---

v2: Fix cannot disable policing when set ingress_policing_rate to 0.

---
 lib/netdev-linux.c | 16 +---
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
index f7205..99704938d 100644
--- a/lib/netdev-linux.c
+++ b/lib/netdev-linux.c
@@ -2128,13 +2128,15 @@ netdev_linux_set_policing(struct netdev *netdev_,
 goto out;
 }
 
-COVERAGE_INC(netdev_set_policing);
-/* Remove any existing ingress qdisc. */
-error = tc_add_del_ingress_qdisc(ifindex, false);
-if (error) {
-VLOG_WARN_RL(&rl, "%s: removing policing failed: %s",
- netdev_name, ovs_strerror(error));
-goto out;
+if (netdev->kbits_rate || kbits_rate) {
+COVERAGE_INC(netdev_set_policing);
+/* Remove any existing ingress qdisc. */
+error = tc_add_del_ingress_qdisc(ifindex, false);
+if (error) {
+VLOG_WARN_RL(&rl, "%s: removing policing failed: %s",
+ netdev_name, ovs_strerror(error));
+goto out;
+}
 }
 
 if (kbits_rate) {
-- 
2.13.2.windows.1

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


Re: [ovs-dev] [PATCH] Skip processing actions when batch is emptied.

2017-11-15 Thread Vishal Deep Ajmera
Thank you William Tu for reviewing the patch. I have fixed the commit message & 
corrected subject line (by including file name) in V2 version of the patch.

Warm Regards,
Vishal

-Original Message-
From: William Tu [mailto:u9012...@gmail.com] 
Sent: Wednesday, November 15, 2017 9:19 PM
To: Vishal Deep Ajmera 
Cc: d...@openvswitch.org
Subject: Re: [ovs-dev] [PATCH] Skip processing actions when batch is emptied.

On Wed, Nov 8, 2017 at 1:44 AM, Vishal Deep Ajmera 
 wrote:
> Today in OVS, when errors are encountered during the execution of an action 
> the entire batch of packets may be deleted (for e.g. in processing 
> push_tnl_action, if the port is not found in the port_cache of PMD). The 
> remaining actions continue to be executed even though there are no packets to 
> be processed. It is assumed that the code dealing with each action checks 
> that the batch is not empty before executing. Crashes may occur if the 
> assumption is not met.
>
> The patch makes OVS skip processing of further actions from the action-set 
> once a batch is emptied. Doing so centralizes the check in one place and 
> avoids the possibility of crashes.
>
> Signed-off-by: Vishal Deep Ajmera 
> ---

nit: please wrap your commit messages to about 75 columns

otherwise looks good to me.

Acked-by: William Tu 

> lib/odp-execute.c | 9 ++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/lib/odp-execute.c b/lib/odp-execute.c index 
> 3109f39..8697727 100644
> --- a/lib/odp-execute.c
> +++ b/lib/odp-execute.c
> @@ -685,9 +685,12 @@ odp_execute_actions(void *dp, struct dp_packet_batch 
> *batch, bool steal,
>  dp_execute_action(dp, batch, a, may_steal);
> -if (last_action) {
> -/* We do not need to free the packets. 
> dp_execute_actions()
> - * has stolen them */
> +if (last_action || (batch->count == 0)) {
> +/* We do not need to free the packets.
> + * Either dp_execute_actions() has stolen them
> + * or the batch is freed due to errors. In either
> + * case we do not need to execute further actions.
> + */
>  return;
>  }
>  }
> ___
> 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


[ovs-dev] [PATCH v2] odp-execute: Skip processing actions when batch is emptied

2017-11-15 Thread Vishal Deep Ajmera
Today in OVS, when errors are encountered during the execution
of an action the entire batch of packets may be deleted (for
e.g. in processing push_tnl_action, if the port is not found
in the port_cache of PMD). The remaining actions continue to
be executed even though there are no packets to be processed.
It is assumed that the code dealing with each action checks that
the batch is not empty before executing. Crashes may occur if
the assumption is not met.

The patch makes OVS skip processing of further actions from the
action-set once a batch is emptied. Doing so centralizes the
check in one place and avoids the possibility of crashes.

Signed-off-by: Vishal Deep Ajmera 
---
lib/odp-execute.c | 9 ++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lib/odp-execute.c b/lib/odp-execute.c
index 3011479..887246d 100644
--- a/lib/odp-execute.c
+++ b/lib/odp-execute.c
@@ -686,9 +686,12 @@ odp_execute_actions(void *dp, struct dp_packet_batch 
*batch, bool steal,

 dp_execute_action(dp, batch, a, may_steal);

-if (last_action) {
-/* We do not need to free the packets. dp_execute_actions()
- * has stolen them */
+if (last_action || (batch->count == 0)) {
+/* We do not need to free the packets.
+ * Either dp_execute_actions() has stolen them
+ * or the batch is freed due to errors. In either
+ * case we do not need to execute further actions.
+ */
 return;
 }
 }
--
1.9.1
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 2/2] dpctl: Support flush conntrack by conntrack 5-tuple

2017-11-15 Thread Justin Pettit


> On Nov 13, 2017, at 12:13 PM, Yi-Hung Wei  wrote:
> 
> With this patch, ovs-dpctl flush-conntrack accepts a conntrack 5-tuple

I'd also mention ovs-appctl, since ovs-dpctl doesn't work on all platforms.

> diff --git a/NEWS b/NEWS
> index 047f34b9f402..800eb84cd24f 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -11,6 +11,8 @@ Post-v2.8.0
>  IPv6 packets.
>- Linux kernel 4.13
>  * Add support for compiling OVS with the latest Linux 4.13 kernel
> +   - "ovs-dpctl flush-conntrack" now accepts conntrack 5-tuple to delete a
> + connection tracking entry.

I would also mention the ovs-appctl, too.  Maybe:

"flush-conntrack" in ovs-dpctl and ovs-appctl now accept a 5-tuple to 
delete a specific connection tracking entry.

> diff --git a/lib/ct-dpif.c b/lib/ct-dpif.c
> index a9f58f4eb449..bdd9ef5d2551 100644
> --- a/lib/ct-dpif.c
> +++ b/lib/ct-dpif.c
> @@ -20,6 +20,7 @@
> #include 
> 
> #include "ct-dpif.h"
> +#include "openvswitch/ofp-parse.h"
> #include "openvswitch/vlog.h"
> 
> VLOG_DEFINE_THIS_MODULE(ct_dpif);
> @@ -434,3 +435,83 @@ ct_dpif_format_tcp_stat(struct ds * ds, int tcp_state, 
> int conn_per_state)
> ds_put_cstr(ds, "]");
> ds_put_format(ds, "=%u", conn_per_state);
> }
> +
> +/* Parses a specification of a conntrack 5-tuple from 's' into 'tuple'.
> + * Returns true on success. Otherwise, returns false and puts the error msg
> + * in 'ds'.
> + */

We would normally close the function comment on the previous line.  Also, I 
wouldn't abbreviate "message" in a comment.

> +bool
> +ct_dpif_parse_tuple(struct ct_dpif_tuple *tuple, const char *s, struct ds 
> *ds)
> +{
> ...
> +if (ipv6_is_zero(&tuple->src.in6) || ipv6_is_zero(&tuple->dst.in6) ||
> +!tuple->ip_proto || !tuple->src_port || !tuple->dst_port) {
> +ds_put_cstr(ds, "Miss at least one of the conntrack 5-tuple field");

I think this error message might be a little clearer: "At least one of the 
conntrack 5-tuple fields is missing."

> +goto out2;
> +}
> +
> +free(copy);
> +return true;
> +
> +out:
> +ds_put_format(ds, "Failed to parse field %s", key);
> +out2:
> +free(copy);
> +return false;

Minor, but I think these labels could be more descriptive.  What about 
"error_with_msg" and "error" or something?

> diff --git a/lib/dpctl.c b/lib/dpctl.c
> index 7569189d8f22..682b9bf35a75 100644
> --- a/lib/dpctl.c
> +++ b/lib/dpctl.c
> @@ -1331,14 +1331,32 @@ dpctl_flush_conntrack(int argc, const char *argv[],
>   struct dpctl_params *dpctl_p)
> {
> struct dpif *dpif;
> +struct ct_dpif_tuple tuple, *ptuple = NULL;
> +struct ds ds = DS_EMPTY_INITIALIZER;
> uint16_t zone, *pzone = NULL;
> char *name;
> int error;
> 
> +/* Parse ct tuple */
> +if (argc > 1 && ct_dpif_parse_tuple(&tuple, argv[argc-1], &ds)) {
> +ptuple = &tuple;
> +argc--;
> +} else if (argc == 4) {
> +dpctl_error(dpctl_p, EINVAL, "%s", ds_cstr(&ds));
> +ds_destroy(&ds);
> +return EINVAL;
> +}
> +ds_destroy(&ds);

I don't think this handles the case of an error parsing 'tuple' when a datapath 
name and zone isn't provided.  It also reads a little funny, since 'ds' can 
only have a value if there was an error, but it's called even on the non-error 
condition.  It's obviously correct, since it's a safe operation, but it's 
unnecessary.

> +
> +/* Parse zone */
> if (argc > 1 && ovs_scan(argv[argc - 1], "zone=%"SCNu16, &zone)) {
> pzone = &zone;
> argc--;
> +} else if (argc == 3) {
> +dpctl_error(dpctl_p, EINVAL, "Invalid zone or conntrack tuple");
> +return EINVAL;

Same thing here about this only triggering if there wasn't a datapath name.

> diff --git a/lib/dpctl.man b/lib/dpctl.man
> index 675fe5af4914..f429f1653fa7 100644
> --- a/lib/dpctl.man
> +++ b/lib/dpctl.man
> @@ -217,10 +217,20 @@ are included. With \fB\-\-statistics\fR timeouts and 
> timestamps are
> added to the output.
> .
> .TP
> -\*(DX\fBflush\-conntrack\fR [\fIdp\fR] [\fBzone=\fIzone\fR]
> -Flushes all the connection entries in the tracker used by \fIdp\fR.
> +\*(DX\fBflush\-conntrack\fR [\fIdp\fR] [\fBzone=\fIzone\fR] [\fBct-tuple\fR]

Shouldn't "ct-tuple" (and all the references below) be using "\fI", since it 
should be an argument?

> +Flushes the connection entries in the tracker used by \fIdp\fR based on
> +\fIzone\fR and connection tracking tuple (\fBct-tuple\fR).
> +If \fBct-tuple\fR is not provided, flushes all the connection entries.
> If \fBzone=\fIzone\fR is specified, only flushes the connections in
> \fBzone\fR.
> +.IP
> +If \fBct-tuple\fR is provided, flushes the connection entry specified by
> +\fBct-tuple\fR in \fIzone\fR. \fBZone\fR defaults to \fBzone 0\fR if it is

I don't think you need to bold anything on this line.  What about changing that 
sentence to "The zone defaults to 0 if it is..."?

> +not provided.
> +Example of a IPv4 \fBct-tuple\fR:

I would say "An example of 

[ovs-dev] vlan on dpdk port

2017-11-15 Thread Joo Kim
Hello folks,

I see 'tag=' option for ovs-vsctl add-portbut does the option work also
for dpdk-type port?
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 1/2] ct-dpif, dpif-netlink: Support conntrack flush by ct 5-tuple

2017-11-15 Thread Justin Pettit


> On Nov 13, 2017, at 12:12 PM, Yi-Hung Wei  wrote:
> 
> This patch adds support of flushing a conntrack entry specified by the
> conntrack 5-tuple, and provides the implementation in dpif-netlink.
> The implementation of dpif-netlink in the Linux datapath utilizes the
> NFNL_SUBSYS_CTNETLINK netlink subsystem to delete a conntrack entry in
> nf_conntrack.
> 
> VMWare-BZ: #1983178
> Signed-off-by: Yi-Hung Wei 
> ---
> lib/ct-dpif.c   |  23 ---
> lib/ct-dpif.h   |   3 +-
> lib/dpctl.c |   2 +-
> lib/dpif-netdev.c   |   6 ++-
> lib/dpif-netlink.c  |   7 +++-
> lib/dpif-provider.h |  13 --
> lib/netlink-conntrack.c | 105 
> lib/netlink-conntrack.h |   1 +
> ofproto/ofproto-dpif.c  |   2 +-
> tests/ovs-ofctl.at  |   2 +-
> 10 files changed, 148 insertions(+), 16 deletions(-)
> 
> diff --git a/lib/ct-dpif.c b/lib/ct-dpif.c
> index c79e69e23970..a9f58f4eb449 100644
> --- a/lib/ct-dpif.c
> +++ b/lib/ct-dpif.c
> @@ -111,19 +111,30 @@ ct_dpif_dump_done(struct ct_dpif_dump_state *dump)
> }
> 
> /* Flush the entries in the connection tracker used by 'dpif'.
> - *
> - * If 'zone' is not NULL, flush only the entries in '*zone'. */
> + * If both 'zone' and 'tuple' are NULL, flush all the conntrack entries.
> + * If 'zone' is not NULL, and 'tuple's is NULL, flush all the conntrack

I'd drop the "s" in "'tuple's".

> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
> index 599308d257a8..0e1696a94e31 100644
> --- a/lib/dpif-netdev.c
> +++ b/lib/dpif-netdev.c
> @@ -5741,10 +5741,14 @@ dpif_netdev_ct_dump_done(struct dpif *dpif OVS_UNUSED,
> }
> 
> static int
> -dpif_netdev_ct_flush(struct dpif *dpif, const uint16_t *zone)
> +dpif_netdev_ct_flush(struct dpif *dpif, const uint16_t *zone,
> + const struct ct_dpif_tuple *tuple)
> {
> struct dp_netdev *dp = get_dp_netdev(dpif);
> 
> +if (tuple) {
> +return EOPNOTSUPP;
> +}
> return conntrack_flush(&dp->conntrack, zone);
> }

Do you plan on implementing this?

> diff --git a/lib/dpif-provider.h b/lib/dpif-provider.h
> index 1d82a0939aa1..083d67c8d5b0 100644
> --- a/lib/dpif-provider.h
> +++ b/lib/dpif-provider.h
> ...
> -/* Flushes the connection tracking tables. If 'zone' is not NULL,
> - * only deletes connections in '*zone'. */
> -int (*ct_flush)(struct dpif *, const uint16_t *zone);
> +/* Flushes the connection tracking tables.
> + * If both 'zone' and 'tuple' are NULL, flush all the conntrack entries.
> + * If 'zone' is not NULL, and 'tuple's is NULL, flush all the conntrack
> + * entries in '*zone'.

Same comment as above about "'tuple's'".

> diff --git a/lib/netlink-conntrack.c b/lib/netlink-conntrack.c
> index 1e1bb2f79d1d..9094779aaa55 100644
> --- a/lib/netlink-conntrack.c
> +++ b/lib/netlink-conntrack.c
> 
> +int
> +nl_ct_delete(const struct ct_dpif_tuple *tuple, uint16_t zone)
> +{
> +int err;
> +struct ofpbuf buf;
> +
> +ofpbuf_init(&buf, NL_DUMP_BUFSIZE);
> +nl_msg_put_nfgenmsg(&buf, 0, tuple->l3_type, NFNL_SUBSYS_CTNETLINK,
> +IPCTNL_MSG_CT_DELETE, NLM_F_REQUEST);
> +
> +nl_msg_put_be16(&buf, CTA_ZONE, htons(zone));
> +if (!nl_ct_put_ct_tuple(&buf, tuple, CTA_TUPLE_ORIG)) {
> +err = EOPNOTSUPP;
> +goto out;
> +}
> +err = nl_transact(NETLINK_NETFILTER, &buf, NULL);
> +out:
> +ofpbuf_uninit(&buf);
> +return err;
> +}

The Linux code for nl_ct_flush_zone() seems to go through some contortions due 
to there being a problem with flushing a specific zone.  I took a brief look at 
the kernel code, and it looks like it does properly handle zones if the tuple 
is provided, but not otherwise.  Is that a correct reading?

On a more cosmetic note, most of the external interface refers to deleting a 
specific conntrack entry as a "flush", but the internal code refers to it as a 
"delete". I think this is a reasonable distinction, but if it's not carried 
externally, then it doesn't seem necessary internally.  Also, this delete and 
flush code is nearly identical, so it seems like there's some opportunity to 
just call it "flush" and consolidate to a single implementation that handles a 
tuple if it's provided.

> +static bool
> +nl_ct_put_tuple(struct ofpbuf *buf, const struct ct_dpif_tuple *tuple)
> +{
> +if (!nl_ct_put_tuple_ip(buf, tuple)) {
> +return false;
> +}
> +if (!nl_ct_put_tuple_proto(buf, tuple)) {
> +return false;
> +}
> +return true;
> +}
> +
> +static bool
> +nl_ct_put_ct_tuple(struct ofpbuf *buf, const struct ct_dpif_tuple *tuple,
> +   enum ctattr_type type)
> +{
> +if (type != CTA_TUPLE_ORIG && type != CTA_TUPLE_REPLY &&
> +type != CTA_TUPLE_MASTER) {
> +return false;
> +}
> +
> +size_t offset = nl_msg_start_nested(buf, type);
> +if (!nl_ct_put_tuple(buf, tuple)) {
> +return false;
> +}
> +
> +nl_msg_e

[ovs-dev] Ortografía y Redacción - En Línea

2017-11-15 Thread Aprenda a redactar de manera efectiva
En línea y en Vivo / Para todo su Equipo con una sola Conexión 

Seminario Intensivo de ORTOGRAFÍA Y REDACCIÓN
30 de noviembre - Online en Vivo - 10:00 a 13:00 y de 15:00 a 18:00 Hrs
 
Una buena redacción debe ser sencilla y congruente. Cualquier escrito que sea 
confuso provoca invariablemente errores de interpretación. Al dominar los 
principios de la redacción moderna y saber utilizar la fuerza del lenguaje 
cotidiano hará de su redacción una de las herramientas más poderosas para usted 
y su organización. 

TEMARIO: 

1. La comunicación escrita: una herramienta poderosa.
2. Cómo establecer su comunicación escrita de manera efectiva.
3. Cómo escribir propuestas atractivas al lector.
4. Cómo evitar frases que desmotiven.

...¡Y mucho más!

¿Requiere la información a la Brevedad?
responda este email con la palabra: 
Redacción.

Junto con los siguientes datos:
Nombre:
Teléfono:
Empresa:

centro telefónico: 018002129393

Lic. Manuel Ravell
Coordinador de Evento

¿Demasiados mensajes en su cuenta? Responda este mensaje indicando que solo 
desea recibir CALENDARIO y sólo recibirá un correo al mes. Si desea cancelar la 
suscripción, solicite su BAJA. 


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


Re: [ovs-dev] [PATCH] RPM: Improve doc to use builddep tool.

2017-11-15 Thread Flavio Leitner
On Wed, 15 Nov 2017 11:17:42 -0500
Aaron Conole  wrote:

> Flavio Leitner  writes:
> 
> > On Wed, 15 Nov 2017 02:20:16 -0500
> > Aaron Conole  wrote:
> >  
> >> Flavio Leitner  writes:
> >>   
> >> > Instead of listing all the dependencies, use the RPM group
> >> > 'Development Tools' and the builddep tool to find specific
> >> > ones.
> >> >
> >> > Signed-off-by: Flavio Leitner 
> >> > ---
> >> >  Documentation/intro/install/fedora.rst | 54
> >> > +++---
> >> >  Documentation/intro/install/rhel.rst   | 34 +++--
> >> >  2 files changed, 62 insertions(+), 26 deletions(-)
> >> >
> >> > diff --git a/Documentation/intro/install/fedora.rst
> >> > b/Documentation/intro/install/fedora.rst
> >> > index 3119bd9aa..70cebfb16 100644
> >> > --- a/Documentation/intro/install/fedora.rst
> >> > +++ b/Documentation/intro/install/fedora.rst
> >> > @@ -36,23 +36,43 @@ RHEL 7.x and its derivatives, including CentOS 7.x
> >> > and Scientific Linux 7.x.
> >> >  Build Requirements
> >> >  --
> >> >  
> >> > -To build packages for a Fedora Linux host, you will need the
> >> > packages described
> >> > -in the :doc:`general`. Specific packages (by package name) include:
> >> > -
> >> > -- rpm-build
> >> > -- autoconf automake libtool
> >> > -- systemd-units openssl openssl-devel
> >> > -- python2-devel python3-devel
> >> > -- python2 python2-twisted python2-zope-interface python2-six 
> >> > python2-sphinx
> >> > -- desktop-file-utils
> >> > -- groff graphviz
> >> > -- procps-ng
> >> > -- checkpolicy selinux-policy-devel
> >> > -
> >> > -And (optionally):
> >> > -
> >> > -- libcap-ng libcap-ng-devel
> >> > -- dpdk-devel
> >> > +You will need to install all required packages to build the RPMs.
> >> > +Newer distributions use ``dnf`` but if it's not available, then use
> >> > +``yum`` instructions.
> >> > +
> >> > +The command below will install RPM tools and generic build dependencies.
> >> > +And (optionally) include these packages: libcap-ng
> >> > libcap-ng-devel dpdk-devel.
> >> > +
> >> > +DNF:
> >> > +::
> >> > +
> >> > +$ dnf install @'Development Tools' rpm-build dnf-plugins-core
> >> > +
> >> > +YUM:
> >> > +::
> >> > +
> >> > +$ yum install @'Development Tools' rpm-build yum-utils
> >> > +
> >> > +Then it is necessary to install Open vSwitch specific build 
> >> > dependencies.
> >> > +The dependencies are listed in the SPEC file, but first it is necessary
> >> > +to replace the VERSION tag to be a valid SPEC.
> >> > +
> >> > +The command below will create a temporary SPEC file:
> >> > +::
> >> > +$ sed -e 's/@VERSION@/0.0.1/' rhel/openvswitch-fedora.spec.in \
> >> > +  > /tmp/ovs.spec
> >> > +
> >> > +And to install specific dependencies, use the corresponding tool below. 
> >> >
> >> 
> >> Is there any reason we can't `make rhel/openvswitch-fedora.spec` for
> >> this?  I think ./boot && ./configure would work with Development Tools
> >> installed, and then the only thing left is let the make system create
> >> just that file?  
> >
> > It doesn't work due to missing dependencies, like libssl-devel.
> >
> > I thought about having the minimum set of dependencies listed
> > in the documentation and then do:
> > $ ./boot
> > $ ./configure
> > $ make rpm
> >
> > which would prep the spec and run builddep and then run rpmbuild,
> > but then we are back to maintain the list of packages in the doc
> > and it is not that different from the steps in this patch and it
> > requires root.
> >
> > And the other option is to provide a rhel/ script to do what this
> > patch is explaining to do, but obviously it would require root too.  
> 
> Right.  Well, I'm okay with either approach: the tmp file as documented
> or a script.  If you decide to change it, no problems.  Otherwise:
> 
> Acked-by: Aaron Conole 

I will leave as is.
Thanks for reviewing it!
fbl

> 
> > fbl
> >
> >> > +DNF:
> >> > +::
> >> > +$ dnf builddep /tmp/ovs.spec
> >> > +
> >> > +YUM:
> >> > +::
> >> > +$ yum-builddep /tmp/ovs.spec
> >> > +
> >> > +Once that is completed, remove the file ``/tmp/ovs.spec``.
> >> >  
> >> >  Bootstraping
> >> >  
> >> > diff --git a/Documentation/intro/install/rhel.rst
> >> > b/Documentation/intro/install/rhel.rst
> >> > index 0ef6f55a3..184089e89 100644
> >> > --- a/Documentation/intro/install/rhel.rst
> >> > +++ b/Documentation/intro/install/rhel.rst
> >> > @@ -70,17 +70,33 @@ directory is ``/usr/src/redhat/SOURCES``. On RHEL
> >> > 6, the default ``_topdir`` is
> >> >  Build Requirements
> >> >  --
> >> >  
> >> > -To compile the RPMs, you will need to install the packages described in 
> >> > the
> >> > -:doc:`general` along with some additional packages. These can be
> >> > installed with
> >> > -the below command::
> >> > +You will need to install all required packages to build the RPMs.
> >> > +The command below will install RPM tools and generic build dependencies:
> >> > +::
> >> > +$ yum install @'Deve

[ovs-dev] [PATCH 3/3] bfd: Fix memory leak

2017-11-15 Thread Yifeng Sun
Valgrind complains in test 2359 ():

864 (576 direct, 288 indirect) bytes in 18 blocks are definitely
lost in loss record 96 of 101
   by 0x4A6D64: xmalloc (util.c:120)
   by 0x40BC04: gateway_chassis_get_ordered (gchassis.c:73)
   by 0x408CF0: bfd_calculate_chassis (bfd.c:219)
   by 0x408CF0: bfd_run (bfd.c:257)
   by 0x407F72: main (ovn-controller.c:718)

gateway_chassis wasn't released before the 'continue' line.

Signed-off-by: Yifeng Sun 
---
 ovn/controller/bfd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ovn/controller/bfd.c b/ovn/controller/bfd.c
index efc1482ecaa2..8f020d597083 100644
--- a/ovn/controller/bfd.c
+++ b/ovn/controller/bfd.c
@@ -221,6 +221,7 @@ bfd_calculate_chassis(struct controller_ctx *ctx,
 /* we don't need BFD for non-HA  chassisredirect */
 if (!gateway_chassis ||
 ovs_list_is_short(gateway_chassis)) {
+gateway_chassis_destroy(gateway_chassis);
 continue;
 }
 our_chassis_is_gw_for_dp = gateway_chassis_contains(
-- 
2.7.4

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


[ovs-dev] [PATCH 2/3] dpif: Fix memory leak

2017-11-15 Thread Yifeng Sun
Valgrind complains in test 2322 (ovn -- 3 HVs, 3 LS, 3 lports/LS, 1 LR):

31,584 (26,496 direct, 5,088 indirect) bytes in 48 blocks are definitely
lost in loss record 422 of 427
   by 0x5165F4: xmalloc (util.c:120)
   by 0x466194: dp_packet_new (dp-packet.c:138)
   by 0x466194: dp_packet_new_with_headroom (dp-packet.c:148)
   by 0x46621B: dp_packet_clone_data_with_headroom (dp-packet.c:210)
   by 0x46621B: dp_packet_clone_with_headroom (dp-packet.c:170)
   by 0x49DD46: dp_packet_batch_clone (dp-packet.h:789)
   by 0x49DD46: odp_execute_clone (odp-execute.c:616)
   by 0x49DD46: odp_execute_actions (odp-execute.c:795)
   by 0x471663: dpif_execute_with_help (dpif.c:1296)
   by 0x473795: dpif_operate (dpif.c:1411)
   by 0x473E20: dpif_execute.part.21 (dpif.c:1320)
   by 0x428D38: packet_execute (ofproto-dpif.c:4682)
   by 0x41EB51: ofproto_packet_out_finish (ofproto.c:3540)
   by 0x41EB51: handle_packet_out (ofproto.c:3581)
   by 0x4233DA: handle_openflow__ (ofproto.c:8044)
   by 0x4233DA: handle_openflow (ofproto.c:8219)
   by 0x4514AA: ofconn_run (connmgr.c:1437)
   by 0x4514AA: connmgr_run (connmgr.c:363)
   by 0x41C8B5: ofproto_run (ofproto.c:1813)
   by 0x40B103: bridge_run__ (bridge.c:2919)
   by 0x4103B3: bridge_run (bridge.c:2977)
   by 0x406F14: main (ovs-vswitchd.c:119)

the parameter dp_packet_batch is leaked when 'may_steal' is true.

When dpif_execute_helper_cb is passed with a true 'may_steal', it
is supposed to take the ownership of dp_packet_batch and release
it when done.

Signed-off-by: Yifeng Sun 
---
 lib/dpif.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/dpif.c b/lib/dpif.c
index 3f0742d382ed..310dec14655e 100644
--- a/lib/dpif.c
+++ b/lib/dpif.c
@@ -1279,6 +1279,7 @@ dpif_execute_helper_cb(void *aux_, struct dp_packet_batch 
*packets_,
 case __OVS_ACTION_ATTR_MAX:
 OVS_NOT_REACHED();
 }
+dp_packet_delete_batch(packets_, may_steal);
 }
 
 /* Executes 'execute' by performing most of the actions in userspace and
-- 
2.7.4

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


[ovs-dev] [PATCH 1/3] dpif-netdev: Fix memory leak

2017-11-15 Thread Yifeng Sun
Valgrind complains in test 1019 (dpctl - add-if set-if del-if):

4,850,896 (4,850,240 direct, 656 indirect) bytes in 1 blocks are
definitely lost in loss record 364 of 364
   by 0x517062: xcalloc (util.c:103)
   by 0x46CBBC: dp_netdev_set_nonpmd (dpif-netdev.c:4498)
   by 0x46CBBC: create_dp_netdev (dpif-netdev.c:1299)
   by 0x46CBBC: dpif_netdev_open (dpif-netdev.c:1337)
   by 0x472CB0: do_open (dpif.c:350)
   by 0x472E6F: dpif_create (dpif.c:404)
   by 0x472E6F: dpif_create_and_open (dpif.c:417)
   by 0x430EBC: open_dpif_backer (ofproto-dpif.c:727)
   by 0x430EBC: construct (ofproto-dpif.c:1411)
   by 0x41B714: ofproto_create (ofproto.c:539)
   by 0x40C84E: bridge_reconfigure (bridge.c:647)
   by 0x4104C5: bridge_run (bridge.c:2998)
   by 0x406FA4: main (ovs-vswitchd.c:119)

The reference count wasn't released at this earlier return.

This fix passes the test 'make check'.

Signed-off-by: Yifeng Sun 
---
 lib/dpif-netdev.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index db7831874fed..19c81583a892 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -2925,6 +2925,9 @@ dpif_netdev_execute(struct dpif *dpif, struct 
dpif_execute *execute)
 /* If this is part of a probe, Drop the packet, since executing
  * the action may actually cause spurious packets be sent into
  * the network. */
+if (pmd->core_id == NON_PMD_CORE_ID) {
+dp_netdev_pmd_unref(pmd);
+}
 return 0;
 }
 
-- 
2.7.4

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


Re: [ovs-dev] two possible bugs about ipv6 multicast

2017-11-15 Thread Ben Pfaff
On Mon, Sep 04, 2017 at 11:40:01PM +0800, Huanle Han wrote:
> I'm just learning ipv6. When I go through ovs code about ipv6 normal
> forwarding, I find 2 possible "bugs". Could you explain some for me? Thanks.
> 
> 1. In fucntion "xlate_normal". when mcast snooping is on, ipv6 neighbor
> discover packet, whose dest mac is "33:33:**", is proccessed in
> mcast_snooping code branch. Is this corrent?
> 
> 2. In function "xlate_normal", "is_mld()"  code branch deosn't return as
> "igmp" does, but continue to look up mcast table and forward to group base
> ports. Is this corrent?

Thadeu, do you have an opinion on these?  I think that you are the main
author of this code.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 1/3] netdev: Indentation and style fixes.

2017-11-15 Thread Ben Pfaff
On Tue, Nov 14, 2017 at 01:24:03PM -0800, Gregory Rose wrote:
> On 11/13/2017 2:04 PM, Ben Pfaff wrote:
> >White space changes only.
> >
> >Signed-off-by: Ben Pfaff 
> >---
> >  lib/netdev.c | 30 +++---
> >  1 file changed, 15 insertions(+), 15 deletions(-)
> >
> >diff --git a/lib/netdev.c b/lib/netdev.c
> >index 0c1545a83e3d..7792b1b75681 100644
> >--- a/lib/netdev.c
> >+++ b/lib/netdev.c
> >@@ -2190,11 +2190,11 @@ netdev_ports_lookup(odp_port_t port_no, const struct 
> >dpif_class *dpif_class)
> >  size_t hash = NETDEV_PORTS_HASH_INT(port_no, dpif_class);
> >  struct port_to_netdev_data *data;
> >-HMAP_FOR_EACH_WITH_HASH(data, node, hash, &port_to_netdev) {
> >-if (data->dpif_class == dpif_class
> >-&& data->dpif_port.port_no == port_no) {
> >-return data;
> >-}
> >+HMAP_FOR_EACH_WITH_HASH (data, node, hash, &port_to_netdev) {
> >+if (data->dpif_class == dpif_class
> >+&& data->dpif_port.port_no == port_no) {
> >+return data;
> >+}
> >  }
> >  return NULL;
> >  }
> >@@ -2311,10 +2311,10 @@ netdev_ifindex_to_odp_port(int ifindex)
> >  ovs_mutex_lock(&netdev_hmap_mutex);
> >  HMAP_FOR_EACH_WITH_HASH(data, node, ifindex, &ifindex_to_port) {
> >-if (data->ifindex == ifindex) {
> >-ret = data->port;
> >-break;
> >-}
> >+if (data->ifindex == ifindex) {
> >+ret = data->port;
> >+break;
> >+}
> >  }
> >  ovs_mutex_unlock(&netdev_hmap_mutex);
> >@@ -2327,7 +2327,7 @@ netdev_ports_flow_flush(const struct dpif_class 
> >*dpif_class)
> >  struct port_to_netdev_data *data;
> >  ovs_mutex_lock(&netdev_hmap_mutex);
> >-HMAP_FOR_EACH(data, node, &port_to_netdev) {
> >+HMAP_FOR_EACH (data, node, &port_to_netdev) {
> >  if (data->dpif_class == dpif_class) {
> >  netdev_flow_flush(data->netdev);
> >  }
> >@@ -2344,7 +2344,7 @@ netdev_ports_flow_dump_create(const struct dpif_class 
> >*dpif_class, int *ports)
> >  int i = 0;
> >  ovs_mutex_lock(&netdev_hmap_mutex);
> >-HMAP_FOR_EACH(data, node, &port_to_netdev) {
> >+HMAP_FOR_EACH (data, node, &port_to_netdev) {
> >  if (data->dpif_class == dpif_class) {
> >  count++;
> >  }
> >@@ -2352,7 +2352,7 @@ netdev_ports_flow_dump_create(const struct dpif_class 
> >*dpif_class, int *ports)
> >  dumps = count ? xzalloc(sizeof *dumps * count) : NULL;
> >-HMAP_FOR_EACH(data, node, &port_to_netdev) {
> >+HMAP_FOR_EACH (data, node, &port_to_netdev) {
> >  if (data->dpif_class == dpif_class) {
> >  if (netdev_flow_dump_create(data->netdev, &dumps[i])) {
> >  continue;
> >@@ -2376,7 +2376,7 @@ netdev_ports_flow_del(const struct dpif_class 
> >*dpif_class,
> >  struct port_to_netdev_data *data;
> >  ovs_mutex_lock(&netdev_hmap_mutex);
> >-HMAP_FOR_EACH(data, node, &port_to_netdev) {
> >+HMAP_FOR_EACH (data, node, &port_to_netdev) {
> >  if (data->dpif_class == dpif_class
> >  && !netdev_flow_del(data->netdev, ufid, stats)) {
> >  ovs_mutex_unlock(&netdev_hmap_mutex);
> >@@ -2396,7 +2396,7 @@ netdev_ports_flow_get(const struct dpif_class 
> >*dpif_class, struct match *match,
> >  struct port_to_netdev_data *data;
> >  ovs_mutex_lock(&netdev_hmap_mutex);
> >-HMAP_FOR_EACH(data, node, &port_to_netdev) {
> >+HMAP_FOR_EACH (data, node, &port_to_netdev) {
> >  if (data->dpif_class == dpif_class
> >  && !netdev_flow_get(data->netdev, match, actions,
> >  ufid, stats, buf)) {
> >@@ -2415,7 +2415,7 @@ netdev_ports_flow_init(void)
> >  struct port_to_netdev_data *data;
> >  ovs_mutex_lock(&netdev_hmap_mutex);
> >-HMAP_FOR_EACH(data, node, &port_to_netdev) {
> >+HMAP_FOR_EACH (data, node, &port_to_netdev) {
> > netdev_init_flow_api(data->netdev);
> >  }
> >  ovs_mutex_unlock(&netdev_hmap_mutex);
> 
> LGTM
> 
> Reviewed-by: Greg Rose 

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


Re: [ovs-dev] [PATCH v2 2/2] netdev: Eliminate redundant ifindex mapping.

2017-11-15 Thread Ben Pfaff
On Wed, Nov 15, 2017 at 06:57:01AM -0800, William Tu wrote:
> On Tue, Nov 14, 2017 at 10:15 AM, Ben Pfaff  wrote:
> > Until now, the code for mapping ODP port number to ifindexes and vice versa
> > has maintained two completely separate data structures, one for each
> > direction.  It was possible for the two mappings to become out of sync
> > with each other since either one could change independently.  This commit
> > merges them into a single data structure (with two indexes), which at least
> > means that if one is removed then the other is as well.
> >
> > Signed-off-by: Ben Pfaff 
> > ---
> 
> Looks good to me.
> 
> Acked-by: William Tu 

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


[ovs-dev] [PATCH 9/9] Remove Perl dependency.

2017-11-15 Thread Ben Pfaff
Nothing in the OVS tree uses Perl any longer, so remove the dependency.

Signed-off-by: Ben Pfaff 
---
 Documentation/intro/install/general.rst | 8 
 Makefile.am | 2 --
 configure.ac| 6 --
 tests/atlocal.in| 1 -
 tests/ovs-macros.at | 1 -
 5 files changed, 18 deletions(-)

diff --git a/Documentation/intro/install/general.rst 
b/Documentation/intro/install/general.rst
index e5ec155b94af..1485bdc19980 100644
--- a/Documentation/intro/install/general.rst
+++ b/Documentation/intro/install/general.rst
@@ -138,11 +138,6 @@ schema, you will also need the following software:
 
 - libtool version 2.4 or later. (Older versions might work too.)
 
-To run the unit tests, you also need:
-
-- Perl. Version 5.10.1 is known to work. Earlier versions should also
-  work.
-
 The datapath tests for userspace and Linux datapaths also rely upon:
 
 - pyftpdlib. Version 1.2.0 is known to work. Earlier versions should
@@ -162,9 +157,6 @@ other than plain text, only if you have the following:
 
 - dot from graphviz (http://www.graphviz.org/).
 
-- Perl. Version 5.10.1 is known to work. Earlier versions should also
-  work.
-
 If you are going to extensively modify Open vSwitch, consider installing the
 following to obtain better warnings:
 
diff --git a/Makefile.am b/Makefile.am
index 5bcd2919c1b4..ba62e781ffdb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -150,7 +150,6 @@ SUFFIXES += .in
-e 's,[@]PKIDIR[@],$(PKIDIR),g' \
-e 's,[@]LOGDIR[@],$(LOGDIR),g' \
-e 's,[@]DBDIR[@],$(DBDIR),g' \
-   -e 's,[@]PERL[@],$(PERL),g' \
-e 's,[@]PYTHON[@],$(PYTHON),g' \
-e 's,[@]RUNDIR[@],$(RUNDIR),g' \
-e 's,[@]VERSION[@],$(VERSION),g' \
@@ -175,7 +174,6 @@ SUFFIXES += .xml
  PKIDIR='$(PKIDIR)' \
  LOGDIR='$(LOGDIR)' \
  DBDIR='$(DBDIR)' \
- PERL='$(PERL)' \
  PYTHON='$(PYTHON)' \
  RUNDIR='$(RUNDIR)' \
  VERSION='$(VERSION)' \
diff --git a/configure.ac b/configure.ac
index 9e00818327a9..6a8113a5c58c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -30,12 +30,6 @@ AC_PROG_FGREP
 AC_PROG_EGREP
 PKG_PROG_PKG_CONFIG
 
-AC_ARG_VAR([PERL], [path to Perl interpreter])
-AC_PATH_PROG([PERL], perl, no)
-if test "$PERL" = no; then
-   AC_MSG_ERROR([Perl interpreter not found in $PATH or $PERL.])
-fi
-
 AM_MISSING_PROG([AUTOM4TE], [autom4te])
 
 AC_USE_SYSTEM_EXTENSIONS
diff --git a/tests/atlocal.in b/tests/atlocal.in
index 1ecabf03a261..55f9333eee08 100644
--- a/tests/atlocal.in
+++ b/tests/atlocal.in
@@ -3,7 +3,6 @@ HAVE_OPENSSL='@HAVE_OPENSSL@'
 HAVE_PYTHON='@HAVE_PYTHON@'
 HAVE_PYTHON3='@HAVE_PYTHON3@'
 EGREP='@EGREP@'
-PERL='@PERL@'
 
 if test x"$PYTHON" = x; then
 PYTHON='@PYTHON@'
diff --git a/tests/ovs-macros.at b/tests/ovs-macros.at
index 08d3d5a020f5..56d0a3bca86d 100644
--- a/tests/ovs-macros.at
+++ b/tests/ovs-macros.at
@@ -1,6 +1,5 @@
 AT_TESTED([ovs-vswitchd])
 AT_TESTED([ovs-vsctl])
-AT_TESTED([perl])
 
 m4_include([m4/compat.m4])
 
-- 
2.10.2

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


[ovs-dev] [PATCH 8/9] tests: Convert miscellaneous test code from Perl to Python.

2017-11-15 Thread Ben Pfaff
Perl is unfashionable and Python is more widely available and understood,
so this commit converts one of the OVS uses of Perl into Python.

Signed-off-by: Ben Pfaff 
---
 tests/atlocal.in |  8 +++-
 tests/ofproto.at | 38 --
 2 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/tests/atlocal.in b/tests/atlocal.in
index bdf5bd0ca97e..1ecabf03a261 100644
--- a/tests/atlocal.in
+++ b/tests/atlocal.in
@@ -108,11 +108,9 @@ FreeBSD|NetBSD)
 esac
 
 # Check whether to run IPv6 tests.
-if perl -e '
-use Socket qw(PF_INET6 SOCK_STREAM pack_sockaddr_in6 IN6ADDR_LOOPBACK);
-
-socket(S, PF_INET6, SOCK_STREAM, 0) || exit 1;
-bind(S, pack_sockaddr_in6(0, IN6ADDR_LOOPBACK)) || exit 1;
+if $PYTHON -c '
+import socket
+socket.socket(family=socket.AF_INET6).bind(("::1", 0, 0, 0))
 '; then
 HAVE_IPV6=yes
 else
diff --git a/tests/ofproto.at b/tests/ofproto.at
index 9853a21db989..17ede5d4ab8d 100644
--- a/tests/ofproto.at
+++ b/tests/ofproto.at
@@ -4340,23 +4340,26 @@ AT_CLEANUP
 m4_divert_push([PREPARE_TESTS])
 # Sorts groups of lines that start with a space, without moving them
 # past the nearest line that does not start with a space.
+[
 multiline_sort () {
-${PERL} -e '
-use warnings;
-use strict;
-my @buffer = ();
-while () {
-if (/^ /) {
-push(@buffer, $_);
-} else {
-print $_ foreach sort(@buffer);
-print $_;
-@buffer = ();
-}
-}
-print $_ foreach sort(@buffer);
+$PYTHON -c '
+import sys
+
+buffer = []
+while True:
+line = sys.stdin.readline()
+if not line:
+break
+if line.startswith(" "):
+buffer.append(line)
+else:
+sys.stdout.write("".join(sorted(buffer)))
+sys.stdout.write(line)
+buffer = []
+sys.stdout.write("".join(sorted(buffer)))
 '
 }
+]
 m4_divert_pop([PREPARE_TESTS])
 
 AT_SETUP([ofproto - flow monitoring])
@@ -4626,10 +4629,9 @@ ovs-appctl -t ovs-ofctl ofctl/block
 
 # Add $n_msgs flows.
 (echo "in_port=2,actions=output:2"
-${PERL} -e '
-for ($i = 0; $i < '$n_msgs'; $i++) {
-print "cookie=1,reg1=$i,actions=drop\n";
-}
+$PYTHON -c '
+for i in range('$n_msgs'):
+print("cookie=1,reg1=%d,actions=drop" % i)
 ') > flows.txt
 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
 # Check that multipart flow dumps work properly:
-- 
2.10.2

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


[ovs-dev] [PATCH 7/9] tests: Convert dot2pic build tool from Perl to Python.

2017-11-15 Thread Ben Pfaff
Perl is unfashionable and Python is more widely available and understood,
so this commit converts one of the OVS uses of Perl into Python.

Signed-off-by: Ben Pfaff 
---
 ovn/automake.mk  |   4 +-
 ovsdb/dot2pic| 155 +++
 vswitchd/automake.mk |   2 +-
 vtep/automake.mk |   2 +-
 4 files changed, 100 insertions(+), 63 deletions(-)

diff --git a/ovn/automake.mk b/ovn/automake.mk
index c5925e9285ac..b33112ef14e5 100644
--- a/ovn/automake.mk
+++ b/ovn/automake.mk
@@ -11,7 +11,7 @@ if HAVE_DOT
 ovn/ovn-sb.gv: ovsdb/ovsdb-dot.in ovn/ovn-sb.ovsschema
$(AM_V_GEN)$(OVSDB_DOT) --no-arrows $(srcdir)/ovn/ovn-sb.ovsschema > $@
 ovn/ovn-sb.pic: ovn/ovn-sb.gv ovsdb/dot2pic
-   $(AM_V_GEN)(dot -T plain < ovn/ovn-sb.gv | $(PERL) 
$(srcdir)/ovsdb/dot2pic -f 3) > $@.tmp && \
+   $(AM_V_GEN)(dot -T plain < ovn/ovn-sb.gv | $(PYTHON) 
$(srcdir)/ovsdb/dot2pic -f 3) > $@.tmp && \
mv $@.tmp $@
 OVN_SB_PIC = ovn/ovn-sb.pic
 OVN_SB_DOT_DIAGRAM_ARG = --er-diagram=$(OVN_SB_PIC)
@@ -45,7 +45,7 @@ if HAVE_DOT
 ovn/ovn-nb.gv: ovsdb/ovsdb-dot.in ovn/ovn-nb.ovsschema
$(AM_V_GEN)$(OVSDB_DOT) --no-arrows $(srcdir)/ovn/ovn-nb.ovsschema > $@
 ovn/ovn-nb.pic: ovn/ovn-nb.gv ovsdb/dot2pic
-   $(AM_V_GEN)(dot -T plain < ovn/ovn-nb.gv | $(PERL) 
$(srcdir)/ovsdb/dot2pic -f 3) > $@.tmp && \
+   $(AM_V_GEN)(dot -T plain < ovn/ovn-nb.gv | $(PYTHON) 
$(srcdir)/ovsdb/dot2pic -f 3) > $@.tmp && \
mv $@.tmp $@
 OVN_NB_PIC = ovn/ovn-nb.pic
 OVN_NB_DOT_DIAGRAM_ARG = --er-diagram=$(OVN_NB_PIC)
diff --git a/ovsdb/dot2pic b/ovsdb/dot2pic
index d682be5f9610..51d454b62e18 100755
--- a/ovsdb/dot2pic
+++ b/ovsdb/dot2pic
@@ -1,6 +1,6 @@
-#! /usr/bin/perl
+#! /usr/bin/env python
 
-# Copyright (c) 2009, 2010, 2011, 2013 Nicira, Inc.
+# Copyright (c) 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.
@@ -14,67 +14,104 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-use strict;
-use warnings;
+import getopt
+import sys
 
-use Getopt::Long;
+def dot2pic(src, dst):
+scale = 1.0
+while True:
+line = src.readline()
+if not line:
+break
 
-my $font_scale = 0;
-GetOptions("f=i" => \$font_scale) || exit 1;
+words = line.split()
+command = words[0]
+if command == 'graph':
+scale = float(words[1])
+elif command == 'node':
+name = words[1]
+x = float(words[2])
+y = float(words[3])
+width = float(words[4])
+height = float(words[5])
+label, style, shape, color, fillcolor = words[6:11]
+x *= scale
+y *= scale
+width *= scale
+height *= scale
+dst.write("linethick = %f;\n" % (0.5 if style == 'bold' else 1.0))
+dst.write('box at %f,%f wid %f height %f "%s"\n'
+  % (x, y, width, height, name))
+if style == 'bold':
+inset = 2.0 / 72.0
+width -= inset * 2
+height -= inset * 2
+dst.write("box at %f,%f wid %f height %f\n"
+  % (x, y, width, height))
+elif command == 'edge':
+tail = words[1]
+head = words[2]
+n = int(words[3])
 
-my ($scale) = 1;
-printf ".ps %+d\n", -$font_scale if $font_scale;
-print ".PS\n";
-print "linethick = 1;\n";
-while (<>) {
-if (/^graph/) {
-(undef, $scale) = split;
-} elsif (/^node/) {
-my (undef, $name, $x, $y, $width, $height, $label, $style, $shape, 
$color, $fillcolor) = split;
-$x *= $scale;
-$y *= $scale;
-$width *= $scale;
-$height *= $scale;
-print "linethick = ", ($style eq 'bold' ? 0.5 : 1.0), ";\n";
-print "box at $x,$y wid $width height $height \"$name\"\n";
-if ($style eq 'bold') {
-my $inset = 2.0 / 72.0;
-$width -= $inset * 2;
-$height -= $inset * 2;
-print "box at $x,$y wid $width height $height\n";
-}
-} elsif (/edge/) {
-my (undef, $tail, $head, $n, $rest) = split(' ', $_, 5);
-my @xy;
-for (1...$n) {
-my ($x, $y);
-($x, $y, $rest) = split(' ', $rest, 3);
-push(@xy, [$x * $scale, $y * $scale]);
-}
-my ($label, $xl, $yl);
-if (scalar(my @junk = split(' ', $rest)) > 2) {
-if ($rest =~ s/^"([^"]*)"\s+//) {
-$label = $1;
-} else {
-($label, $rest) = split(' ', $rest, 2);
-}
-($xl, $yl, $rest) = split(' ', $rest, 3);
-$xl *= $scale;
-$yl *= $scale;
-}
-my ($style, $color) = split(' ', $rest);
+# Extract x,y coordinates.
+

[ovs-dev] [PATCH 6/9] tests: Convert sodepends build tool from Perl to Python.

2017-11-15 Thread Ben Pfaff
Perl is unfashionable and Python is more widely available and understood,
so this commit converts one of the OVS uses of Perl into Python.

Signed-off-by: Ben Pfaff 
---
 Makefile.am|   6 +--
 build-aux/automake.mk  |   1 +
 build-aux/sodepends.pl |  70 -
 build-aux/sodepends.py | 105 +
 4 files changed, 109 insertions(+), 73 deletions(-)
 delete mode 100644 build-aux/sodepends.pl
 create mode 100755 build-aux/sodepends.py

diff --git a/Makefile.am b/Makefile.am
index 11e2e6d21005..5bcd2919c1b4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -87,7 +87,7 @@ EXTRA_DIST = \
build-aux/calculate-schema-cksum \
build-aux/dist-docs \
build-aux/dpdkstrip.py \
-   build-aux/sodepends.pl \
+   build-aux/sodepends.py \
build-aux/soexpand.py \
build-aux/xml2nroff \
$(MAN_FRAGMENTS) \
@@ -394,8 +394,8 @@ endif
 CLEANFILES += flake8-check
 
 include $(srcdir)/manpages.mk
-$(srcdir)/manpages.mk: $(MAN_ROOTS) build-aux/sodepends.pl
-   @$(PERL) $(srcdir)/build-aux/sodepends.pl -I. -I$(srcdir) $(MAN_ROOTS) 
>$(@F).tmp
+$(srcdir)/manpages.mk: $(MAN_ROOTS) build-aux/sodepends.py
+   @$(PYTHON) $(srcdir)/build-aux/sodepends.py -I. -I$(srcdir) 
$(MAN_ROOTS) >$(@F).tmp
@if cmp -s $(@F).tmp $@; then \
  touch $@; \
  rm -f $(@F).tmp; \
diff --git a/build-aux/automake.mk b/build-aux/automake.mk
index 1003144fd664..6baafab0e867 100644
--- a/build-aux/automake.mk
+++ b/build-aux/automake.mk
@@ -2,4 +2,5 @@
 FLAKE8_PYFILES += \
 $(srcdir)/build-aux/xml2nroff \
 build-aux/dpdkstrip.py \
+build-aux/sodepends.py \
 build-aux/soexpand.py
diff --git a/build-aux/sodepends.pl b/build-aux/sodepends.pl
deleted file mode 100644
index 333d037f2dcf..
--- a/build-aux/sodepends.pl
+++ /dev/null
@@ -1,70 +0,0 @@
-# Copyright (c) 2008, 2011 Nicira, Inc.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at:
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-use Getopt::Long;
-
-our ($exit_code) = 0;
-
-our (@include_dirs);
-Getopt::Long::Configure ("bundling");
-GetOptions("I|include=s" => \@include_dirs) or exit(1);
-@include_dirs = ('.') if !@include_dirs;
-
-sub find_file {
-my ($name) = @_;
-foreach my $dir (@include_dirs, '.') {
-my $file = "$dir/$name";
-if (stat($file)) {
-return $file;
-}
-}
-print STDERR "$name not found in: ", join(' ', @include_dirs), "\n";
-$exit_code = 1;
-return;
-}
-
-print "# Generated automatically -- do not modify!-*- buffer-read-only: t 
-*-\n";
-for my $toplevel (sort(@ARGV)) {
-# Skip names that don't end in .in.
-next if $toplevel !~ /\.in$/;
-
-# Open file.
-my ($fn) = find_file($toplevel);
-next if !defined($fn);
-if (!open(OUTER, '<', $fn)) {
-print "$fn: open: $!\n";
-$exit_code = 1;
-next;
-}
-
-my (@dependencies);
-  OUTER:
-while () {
-if (my ($name) = /^\.so (\S+)$/) {
-push(@dependencies, $name) if find_file($name);
-}
-}
-close(OUTER);
-
-my ($output) = $toplevel;
-$output =~ s/\.in//;
-
-print "\n$output:";
-print " \\\n\t$_" foreach $toplevel, sort(@dependencies);
-print "\n";
-print "$_:\n" foreach $toplevel, sort(@dependencies);
-}
-exit $exit_code;
diff --git a/build-aux/sodepends.py b/build-aux/sodepends.py
new file mode 100755
index ..fafe900b9965
--- /dev/null
+++ b/build-aux/sodepends.py
@@ -0,0 +1,105 @@
+#! /usr/bin/env python
+
+# Copyright (c) 2008, 2011, 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.
+# You may obtain a copy of the License at:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import os
+import re
+import sys
+import getopt
+
+
+def parse_include_dirs():
+include_dirs = []
+options, args = getopt.gnu_getopt(sys.argv[1:], 'I:', ['include='])
+for key, value in options:
+if key in ['-I', '--include']:
+include_dirs.append(value)
+else

[ovs-dev] [PATCH 5/9] tests: Convert soexpand build tool from Perl to Python.

2017-11-15 Thread Ben Pfaff
Perl is unfashionable and Python is more widely available and understood,
so this commit converts one of the OVS uses of Perl into Python.

Signed-off-by: Ben Pfaff 
---
 Makefile.am   |  4 +--
 build-aux/automake.mk |  3 +-
 build-aux/soexpand.pl | 40 -
 build-aux/soexpand.py | 97 +++
 4 files changed, 101 insertions(+), 43 deletions(-)
 delete mode 100644 build-aux/soexpand.pl
 create mode 100755 build-aux/soexpand.py

diff --git a/Makefile.am b/Makefile.am
index c82a9e21ec36..11e2e6d21005 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -88,7 +88,7 @@ EXTRA_DIST = \
build-aux/dist-docs \
build-aux/dpdkstrip.py \
build-aux/sodepends.pl \
-   build-aux/soexpand.pl \
+   build-aux/soexpand.py \
build-aux/xml2nroff \
$(MAN_FRAGMENTS) \
$(MAN_ROOTS) \
@@ -144,7 +144,7 @@ ro_shell = printf '\043 Generated automatically -- do not 
modify!-*- buffer-
 
 SUFFIXES += .in
 .in:
-   $(AM_V_GEN)$(PERL) $(srcdir)/build-aux/soexpand.pl -I$(srcdir) < $< | \
+   $(AM_V_GEN)$(PYTHON) $(srcdir)/build-aux/soexpand.py -I$(srcdir) < $< | 
\
  $(PYTHON) $(srcdir)/build-aux/dpdkstrip.py $(DPDKSTRIP_FLAGS) | \
  sed \
-e 's,[@]PKIDIR[@],$(PKIDIR),g' \
diff --git a/build-aux/automake.mk b/build-aux/automake.mk
index c0553e6edffb..1003144fd664 100644
--- a/build-aux/automake.mk
+++ b/build-aux/automake.mk
@@ -1,4 +1,5 @@
 # This file is purely used for checking the style of the python build tools.
 FLAKE8_PYFILES += \
 $(srcdir)/build-aux/xml2nroff \
-build-aux/dpdkstrip.py
+build-aux/dpdkstrip.py \
+build-aux/soexpand.py
diff --git a/build-aux/soexpand.pl b/build-aux/soexpand.pl
deleted file mode 100644
index 216256451a4d..
--- a/build-aux/soexpand.pl
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright (c) 2008 Nicira, Inc.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at:
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-use Getopt::Long;
-
-my ($exit_code) = 0;
-my (@include_dirs);
-Getopt::Long::Configure ("bundling");
-GetOptions("I|include=s" => \@include_dirs) or exit(1);
-@include_dirs = ('.') if !@include_dirs;
-OUTER: while () {
-if (my ($name) = /^\.so (\S+)$/) {
-   foreach my $dir (@include_dirs, '.') {
-   if (open(INNER, "$dir/$name")) {
-   while () {
-   print $_;
-   }
-   close(INNER);
-   next OUTER;
-   }
-   }
-   print STDERR "$name not found in: ", join(' ', @include_dirs), "\n";
-   $exit_code = 1;
-}
-print $_;
-}
-exit $exit_code;
diff --git a/build-aux/soexpand.py b/build-aux/soexpand.py
new file mode 100755
index ..fe99b461f980
--- /dev/null
+++ b/build-aux/soexpand.py
@@ -0,0 +1,97 @@
+#! /usr/bin/env python
+
+# Copyright (c) 2008, 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.
+# You may obtain a copy of the License at:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import getopt
+import os
+import re
+import sys
+
+
+def parse_include_dirs():
+include_dirs = []
+options, args = getopt.gnu_getopt(sys.argv[1:], 'I:', ['include='])
+for key, value in options:
+if key in ['-I', '--include']:
+include_dirs.append(value)
+else:
+assert False
+
+include_dirs.append('.')
+return include_dirs, args
+
+
+def find_file(include_dirs, name):
+for dir in include_dirs:
+file = "%s/%s" % (dir, name)
+try:
+os.stat(file)
+return file
+except IOError as e:
+pass
+sys.stderr.write("%s not found in: %s\n" % (name, ' '.join(include_dirs)))
+return None
+
+
+so_re = re.compile(r'^\.so (\S+)$')
+
+
+def extract_include_directive(line):
+m = so_re.match(line)
+if m:
+return m.group(1)
+else:
+return None
+
+
+def soexpand(include_dirs, src, dst):
+ok = True
+while True:
+line = src.readline()
+if not line:
+brea

[ovs-dev] [PATCH 4/9] tests: Convert dpdkstrip utility from Perl to Python.

2017-11-15 Thread Ben Pfaff
Perl is unfashionable and Python is more widely available and understood,
so this commit converts one of the OVS uses of Perl into Python.

Signed-off-by: Ben Pfaff 
---
 Makefile.am |  4 ++--
 build-aux/automake.mk   |  3 ++-
 build-aux/dpdkstrip.pl  | 35 --
 build-aux/dpdkstrip.py  | 48 +
 rhel/openvswitch-fedora.spec.in |  2 +-
 5 files changed, 53 insertions(+), 39 deletions(-)
 delete mode 100644 build-aux/dpdkstrip.pl
 create mode 100755 build-aux/dpdkstrip.py

diff --git a/Makefile.am b/Makefile.am
index 5d19f0833afc..c82a9e21ec36 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -86,7 +86,7 @@ EXTRA_DIST = \
build-aux/cksum-schema-check \
build-aux/calculate-schema-cksum \
build-aux/dist-docs \
-   build-aux/dpdkstrip.pl \
+   build-aux/dpdkstrip.py \
build-aux/sodepends.pl \
build-aux/soexpand.pl \
build-aux/xml2nroff \
@@ -145,7 +145,7 @@ ro_shell = printf '\043 Generated automatically -- do not 
modify!-*- buffer-
 SUFFIXES += .in
 .in:
$(AM_V_GEN)$(PERL) $(srcdir)/build-aux/soexpand.pl -I$(srcdir) < $< | \
- $(PERL) $(srcdir)/build-aux/dpdkstrip.pl $(DPDKSTRIP_FLAGS) | \
+ $(PYTHON) $(srcdir)/build-aux/dpdkstrip.py $(DPDKSTRIP_FLAGS) | \
  sed \
-e 's,[@]PKIDIR[@],$(PKIDIR),g' \
-e 's,[@]LOGDIR[@],$(LOGDIR),g' \
diff --git a/build-aux/automake.mk b/build-aux/automake.mk
index 9500e3a69402..c0553e6edffb 100644
--- a/build-aux/automake.mk
+++ b/build-aux/automake.mk
@@ -1,3 +1,4 @@
 # This file is purely used for checking the style of the python build tools.
 FLAKE8_PYFILES += \
-$(srcdir)/build-aux/xml2nroff
+$(srcdir)/build-aux/xml2nroff \
+build-aux/dpdkstrip.py
diff --git a/build-aux/dpdkstrip.pl b/build-aux/dpdkstrip.pl
deleted file mode 100644
index 98539cce8241..
--- a/build-aux/dpdkstrip.pl
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (c) 2017 Red Hat, Inc.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at:
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-use Getopt::Long;
-
-my ($check_dpdk) = 0;
-my ($disabled_print) = 0;
-
-Getopt::Long::Configure ("bundling");
-GetOptions("dpdk!" => \$check_dpdk) or exit(1);
-
-OUTER: while () {
-if (/@(begin|end)_dpdk@/) {
-if (!$check_dpdk) {
-$disabled_print = ! $disabled_print;
-}
-next;
-}
-
-print $_ unless $disabled_print;
-}
-exit 0;
diff --git a/build-aux/dpdkstrip.py b/build-aux/dpdkstrip.py
new file mode 100755
index ..48c7f06934ef
--- /dev/null
+++ b/build-aux/dpdkstrip.py
@@ -0,0 +1,48 @@
+#! /usr/bin/env python
+# Copyright (c) 2017 Red Hat, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import getopt
+import sys
+
+
+def strip_dpdk(check_dpdk, src, dst):
+disabled_print = False
+while True:
+line = src.readline()
+if not line:
+break
+if '@begin_dpdk@' in line or '@end_dpdk@' in line:
+if not check_dpdk:
+disabled_print = not disabled_print
+continue
+if not disabled_print:
+dst.write(line)
+
+
+if __name__ == '__main__':
+check_dpdk = False
+options, args = getopt.gnu_getopt(sys.argv[1:], '', ['dpdk', 'nodpdk'])
+for key, value in options:
+if key == '--dpdk':
+check_dpdk = True
+elif key == '--nodpdk':
+check_dpdk = False
+else:
+assert False
+if args:
+for arg in args:
+strip_dpdk(check_dpdk, open(arg), sys.stdout)
+else:
+strip_dpdk(check_dpdk, sys.stdin, sys.stdout)
diff --git a/rhel/openvswitch-fedora.spec.in b/rhel/openvswitch-fedora.spec.in
index b45e018f5ee9..e600a943cde6 100644
--- a/rhel/openvswitch-fedora.spec.in
+++ b/rhel/openvswitch-fedora.spec.in
@@ -229,7 +229,7 @@ Docker network plugins for OVN.
--enable-ssl \
 

[ovs-dev] [PATCH 3/9] tests: Convert flowgen utility from Perl to Python.

2017-11-15 Thread Ben Pfaff
Perl is unfashionable and Python is more widely available and understood,
so this commit converts one of the OVS uses of Perl into Python.

Signed-off-by: Ben Pfaff 
---
 tests/automake.mk |   2 +-
 tests/flowgen.pl  | 253 --
 tests/flowgen.py  | 240 +++
 tests/library.at  |   2 +-
 4 files changed, 242 insertions(+), 255 deletions(-)
 delete mode 100755 tests/flowgen.pl
 create mode 100755 tests/flowgen.py

diff --git a/tests/automake.mk b/tests/automake.mk
index 1ea08fef850d..7eed1064e82b 100644
--- a/tests/automake.mk
+++ b/tests/automake.mk
@@ -368,7 +368,6 @@ tests_ovstest_SOURCES += \
 endif
 
 tests_ovstest_LDADD = lib/libopenvswitch.la ovn/lib/libovn.la
-dist_check_SCRIPTS = tests/flowgen.pl
 
 noinst_PROGRAMS += tests/test-strtok_r
 tests_test_strtok_r_SOURCES = tests/test-strtok_r.c
@@ -379,6 +378,7 @@ tests_test_type_props_SOURCES = tests/test-type-props.c
 # Python tests.
 CHECK_PYFILES = \
tests/appctl.py \
+   tests/flowgen.py \
tests/ovsdb-monitor-sort.py \
tests/test-daemon.py \
tests/test-json.py \
diff --git a/tests/flowgen.pl b/tests/flowgen.pl
deleted file mode 100755
index a0fc345e7251..
--- a/tests/flowgen.pl
+++ /dev/null
@@ -1,253 +0,0 @@
-#! /usr/bin/perl
-
-# Copyright (c) 2009, 2010, 2011, 2012, 2015 Nicira, Inc.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at:
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-open(FLOWS, ">&=3");# or die "failed to open fd 3 for writing: $!\n";
-open(PACKETS, ">&=4");# or die "failed to open fd 4 for writing: $!\n";
-
-# Print pcap file header.
-print PACKETS pack('Nnn',
-   0xa1b2c3d4,  # magic number
-   2,   # major version
-   4,   # minor version
-   0,   # time zone offset
-   0,   # time stamp accuracy
-   1518,# snaplen
-   1);  # Ethernet
-
-output(DL_HEADER => '802.2');
-
-for my $dl_header (qw(802.2+SNAP Ethernet)) {
-my %a = (DL_HEADER => $dl_header);
-for my $dl_vlan (qw(none zero nonzero)) {
-my %b = (%a, DL_VLAN => $dl_vlan);
-
-# Non-IP case.
-output(%b, DL_TYPE => 'non-ip');
-
-for my $ip_options (qw(no yes)) {
-my %c = (%b, DL_TYPE => 'ip', IP_OPTIONS => $ip_options);
-for my $ip_fragment (qw(no first middle last)) {
-my %d = (%c, IP_FRAGMENT => $ip_fragment);
-for my $tp_proto (qw(TCP TCP+options UDP ICMP other)) {
-output(%d, TP_PROTO => $tp_proto);
-}
-}
-}
-}
-}
-
-sub output {
-my (%attrs) = @_;
-
-# Compose flow.
-my (%flow);
-$flow{DL_SRC} = "00:02:e3:0f:80:a4";
-$flow{DL_DST} = "00:1a:92:40:ac:05";
-$flow{NW_PROTO} = 0;
-$flow{NW_TOS} = 0;
-$flow{NW_SRC} = '0.0.0.0';
-$flow{NW_DST} = '0.0.0.0';
-$flow{TP_SRC} = 0;
-$flow{TP_DST} = 0;
-if (defined($attrs{DL_VLAN})) {
-my (%vlan_map) = ('none' => 0x,
-  'zero' => 0,
-  'nonzero' => 0x0123);
-$flow{DL_VLAN} = $vlan_map{$attrs{DL_VLAN}};
-} else {
-$flow{DL_VLAN} = 0x; # OFP_VLAN_NONE
-}
-if ($attrs{DL_HEADER} eq '802.2') {
-$flow{DL_TYPE} = 0x5ff; # OFP_DL_TYPE_NOT_ETH_TYPE
-} elsif ($attrs{DL_TYPE} eq 'ip') {
-$flow{DL_TYPE} = 0x0800; # ETH_TYPE_IP
-$flow{NW_SRC} = '10.0.2.15';
-$flow{NW_DST} = '192.168.1.20';
-$flow{NW_TOS} = 44;
-if ($attrs{TP_PROTO} eq 'other') {
-$flow{NW_PROTO} = 42;
-} elsif ($attrs{TP_PROTO} eq 'TCP' ||
- $attrs{TP_PROTO} eq 'TCP+options') {
-$flow{NW_PROTO} = 6; # IPPROTO_TCP
-$flow{TP_SRC} = 6667;
-$flow{TP_DST} = 9998;
-} elsif ($attrs{TP_PROTO} eq 'UDP') {
-$flow{NW_PROTO} = 17; # IPPROTO_UDP
-$flow{TP_SRC} = 1112;
-$flow{TP_DST} = 2223;
-} elsif ($attrs{TP_PROTO} eq 'ICMP') {
-$flow{NW_PROTO} = 1; # IPPROTO_ICMP
-$flow{TP_SRC} = 8;   # echo request
-$flow{TP_DST} = 0;   # code
-} else {
-die;
-}
-if ($attrs{IP_FRAGMENT} ne 'no' && $attrs{IP_FRAGMENT} ne 'first') {
-$flow{TP_SRC} = $flow{TP_DST} = 0;
-

[ovs-dev] [PATCH 1/9] tests: Convert uuidfilt utility from Perl to Python.

2017-11-15 Thread Ben Pfaff
Perl is unfashionable and Python is more widely available and understood,
so this commit converts one of the OVS uses of Perl into Python.

Signed-off-by: Ben Pfaff 
---
 tests/automake.mk|   5 +-
 tests/ofproto-macros.at  |   4 +-
 tests/ofproto.at |  24 -
 tests/ovn-controller.at  |   2 +-
 tests/ovn-nbctl.at   | 102 +++
 tests/ovs-macros.at  |   4 ++
 tests/ovs-vsctl.at   |  16 +++---
 tests/ovsdb-execution.at |   4 +-
 tests/ovsdb-idl.at   |  30 ++--
 tests/ovsdb-monitor.at   |   4 +-
 tests/ovsdb-rbac.at  |  28 +--
 tests/ovsdb-server.at|  36 +++---
 tests/ovsdb-tool.at  |  18 +++
 tests/ovsdb-trigger.at   |   2 +-
 tests/system-kmod-macros.at  |   4 +-
 tests/system-userspace-macros.at |   4 +-
 tests/uuidfilt.pl|  33 -
 tests/uuidfilt.py|  50 +++
 18 files changed, 196 insertions(+), 174 deletions(-)
 delete mode 100755 tests/uuidfilt.pl
 create mode 100755 tests/uuidfilt.py

diff --git a/tests/automake.mk b/tests/automake.mk
index 156b40f58d7c..3ca60e2ea450 100644
--- a/tests/automake.mk
+++ b/tests/automake.mk
@@ -290,7 +290,7 @@ $(srcdir)/package.m4: $(top_srcdir)/configure.ac
 noinst_PROGRAMS += tests/test-ovsdb
 tests_test_ovsdb_SOURCES = tests/test-ovsdb.c
 nodist_tests_test_ovsdb_SOURCES = tests/idltest.c tests/idltest.h
-EXTRA_DIST += tests/uuidfilt.pl tests/ovsdb-monitor-sort.pl
+EXTRA_DIST += tests/ovsdb-monitor-sort.pl
 tests_test_ovsdb_LDADD = ovsdb/libovsdb.la lib/libopenvswitch.la
 
 noinst_PROGRAMS += tests/test-lib
@@ -389,7 +389,8 @@ CHECK_PYFILES = \
tests/MockXenAPI.py \
tests/test-unix-socket.py \
tests/test-unixctl.py \
-   tests/test-vlog.py
+   tests/test-vlog.py \
+   tests/uuidfilt.py
 EXTRA_DIST += $(CHECK_PYFILES)
 PYCOV_CLEAN_FILES += $(CHECK_PYFILES:.py=.py,cover) .coverage
 
diff --git a/tests/ofproto-macros.at b/tests/ofproto-macros.at
index 38449db32ee0..4fbb10070342 100644
--- a/tests/ofproto-macros.at
+++ b/tests/ofproto-macros.at
@@ -353,7 +353,7 @@ m4_define([_OVS_VSWITCHD_START],
 # br0 with predictable settings, passing 'vsctl-args' as additional
 # commands to ovs-vsctl.  If 'vsctl-args' causes ovs-vsctl to provide
 # output (e.g. because it includes "create" commands) then 'vsctl-output'
-# specifies the expected output after filtering through uuidfilt.pl.
+# specifies the expected output after filtering through uuidfilt.
 #
 # If a test needs to use "system" devices (as dummies), then specify
 # =override (literally) as the third argument.  Otherwise, system devices
@@ -364,7 +364,7 @@ m4_define([_OVS_VSWITCHD_START],
 # to ovs-vswitchd
 m4_define([OVS_VSWITCHD_START],
   [_OVS_VSWITCHD_START([--enable-dummy$3 --disable-system $4])
-   AT_CHECK([add_of_br 0 $1 m4_if([$2], [], [], [| ${PERL} 
$srcdir/uuidfilt.pl])], [0], [$2])
+   AT_CHECK([add_of_br 0 $1 m4_if([$2], [], [], [| uuidfilt])], [0], [$2])
 ])
 
 # check_logs scans through all *.log files (except '*.log' and testsuite.log)
diff --git a/tests/ofproto.at b/tests/ofproto.at
index 31cb5208fc1c..9853a21db989 100644
--- a/tests/ofproto.at
+++ b/tests/ofproto.at
@@ -2196,7 +2196,7 @@ AT_CHECK(
  -- --id=@t0 create Flow_Table name=main \
  -- --id=@t1 create Flow_Table flow-limit=1024 \
  -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
-   | ${PERL} $srcdir/uuidfilt.pl],
+   | uuidfilt],
   [0], [<0>
 <1>
 ])
@@ -2348,7 +2348,7 @@ AT_CHECK(
  -- --id=@t0 create Flow_Table name=main \
  -- --id=@t1 create Flow_Table flow-limit=1024 \
  -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
-   | ${PERL} $srcdir/uuidfilt.pl],
+   | uuidfilt],
   [0], [<0>
 <1>
 ])
@@ -2603,7 +2603,7 @@ AT_CHECK(
  -- --id=@t0 create Flow_Table name=main \
  -- --id=@t1 create Flow_Table flow-limit=1024 \
  -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
-   | ${PERL} $srcdir/uuidfilt.pl],
+   | uuidfilt],
   [0], [<0>
 <1>
 ])
@@ -2655,7 +2655,7 @@ AT_CHECK(
   [ovs-vsctl \
  -- --id=@t0 create Flow_Table flow-limit=4 \
  -- set bridge br0 flow_tables:0=@t0 \
-   | ${PERL} $srcdir/uuidfilt.pl],
+   | uuidfilt],
   [0], [<0>
 ])
 # Add 4 flows.
@@ -2699,7 +2699,7 @@ AT_CHECK(
   [ovs-vsctl \
  -- --id=@t0 create Flow_Table flow-limit=4 \
  -- set bridge br0 flow_tables:0=@t0 \
-   | ${PERL} $srcdir/uuidfilt.pl],
+   | uuidfilt],
   [0], [<0>
 ])
 # Add 4 flows.
@@ -2738,7 +2738,7 @@ AT_CHECK(
   [ovs-vsctl \
  -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
  -- set bridge br0 flow_tables:0=@t0 \
-   | ${PERL} $srcdir/uuidfilt.pl],
+   | uuidfilt],
   [0], [<0>
 ])
 # Add 4 flows.
@@ -2796,7 +2796,7 @@ AT_CHECK(
   [ovs-vsctl \
  -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
  -- set bridge br0 flow_table

[ovs-dev] [PATCH 2/9] tests: Convert ovsdb-monitor-sort utility from Perl to Python.

2017-11-15 Thread Ben Pfaff
Perl is unfashionable and Python is more widely available and understood,
so this commit converts one of the OVS uses of Perl into Python.

Signed-off-by: Ben Pfaff 
---
 tests/automake.mk   |  2 +-
 tests/ovsdb-monitor-sort.pl | 52 ---
 tests/ovsdb-monitor-sort.py | 85 +
 tests/ovsdb-monitor.at  |  4 +--
 4 files changed, 88 insertions(+), 55 deletions(-)
 delete mode 100755 tests/ovsdb-monitor-sort.pl
 create mode 100755 tests/ovsdb-monitor-sort.py

diff --git a/tests/automake.mk b/tests/automake.mk
index 3ca60e2ea450..1ea08fef850d 100644
--- a/tests/automake.mk
+++ b/tests/automake.mk
@@ -290,7 +290,6 @@ $(srcdir)/package.m4: $(top_srcdir)/configure.ac
 noinst_PROGRAMS += tests/test-ovsdb
 tests_test_ovsdb_SOURCES = tests/test-ovsdb.c
 nodist_tests_test_ovsdb_SOURCES = tests/idltest.c tests/idltest.h
-EXTRA_DIST += tests/ovsdb-monitor-sort.pl
 tests_test_ovsdb_LDADD = ovsdb/libovsdb.la lib/libopenvswitch.la
 
 noinst_PROGRAMS += tests/test-lib
@@ -380,6 +379,7 @@ tests_test_type_props_SOURCES = tests/test-type-props.c
 # Python tests.
 CHECK_PYFILES = \
tests/appctl.py \
+   tests/ovsdb-monitor-sort.py \
tests/test-daemon.py \
tests/test-json.py \
tests/test-jsonrpc.py \
diff --git a/tests/ovsdb-monitor-sort.pl b/tests/ovsdb-monitor-sort.pl
deleted file mode 100755
index 24f3ffcd6162..
--- a/tests/ovsdb-monitor-sort.pl
+++ /dev/null
@@ -1,52 +0,0 @@
-#! /usr/bin/perl
-
-use strict;
-use warnings;
-
-# Breaks lines read from  into groups using blank lines as
-# group separators, then sorts lines within the groups for
-# reproducibility.
-
-sub compare_lines {
-my ($a, $b) = @_;
-
-my $u = '[0-9a-fA-F]';
-my $uuid_re = "${u}{8}-${u}{4}-${u}{4}-${u}{4}-${u}{12}";
-if ($a =~ /^$uuid_re/) {
-if ($b =~ /^$uuid_re/) {
-return substr($a, 36) cmp substr($b, 36);
-} else {
-return 1;
-}
-} elsif ($b =~ /^$uuid_re/) {
-return -1;
-} else {
-return $a cmp $b;
-}
-}
-
-sub output_group {
-my (@group) = @_;
-print "$_\n" foreach sort { compare_lines($a, $b) } @group;
-}
-
-if ("$^O" eq "msys") {
-$/ = "\r\n";
-}
-my @group = ();
-while () {
-chomp;
-if ($_ eq '') {
-output_group(@group);
-@group = ();
-print "\n";
-} else {
-if (/^,/ && @group) {
-$group[$#group] .= "\n" . $_;
-} else {
-push(@group, $_);
-}
-}
-}
-
-output_group(@group) if @group;
diff --git a/tests/ovsdb-monitor-sort.py b/tests/ovsdb-monitor-sort.py
new file mode 100755
index ..c538d9d6b573
--- /dev/null
+++ b/tests/ovsdb-monitor-sort.py
@@ -0,0 +1,85 @@
+#! /usr/bin/env python
+
+# Breaks lines read from stdin into groups using blank lines as
+# group separators, then sorts lines within the groups for
+# reproducibility.
+
+import re
+import sys
+
+
+# This is copied out of the Python Sorting HOWTO at
+# https://docs.python.org/3/howto/sorting.html#sortinghowto
+def cmp_to_key(mycmp):
+'Convert a cmp= function into a key= function'
+class K:
+
+def __init__(self, obj, *args):
+self.obj = obj
+
+def __lt__(self, other):
+return mycmp(self.obj, other.obj) < 0
+
+def __gt__(self, other):
+return mycmp(self.obj, other.obj) > 0
+
+def __eq__(self, other):
+return mycmp(self.obj, other.obj) == 0
+
+def __le__(self, other):
+return mycmp(self.obj, other.obj) <= 0
+
+def __ge__(self, other):
+return mycmp(self.obj, other.obj) >= 0
+
+def __ne__(self, other):
+return mycmp(self.obj, other.obj) != 0
+
+return K
+
+
+u = '[0-9a-fA-F]'
+uuid_re = re.compile(r'%s{8}-%s{4}-%s{4}-%s{4}-%s{12}' % ((u,) * 5))
+
+
+def cmp(a, b):
+return (a > b) - (a < b)
+
+
+def compare_lines(a, b):
+if uuid_re.match(a):
+if uuid_re.match(b):
+return cmp(a[36:], b[36:])
+else:
+return 1
+elif uuid_re.match(b):
+return -1
+else:
+return cmp(a, b)
+
+
+def output_group(group, dst):
+for x in sorted(group, key=cmp_to_key(compare_lines)):
+dst.write(x)
+
+
+def ovsdb_monitor_sort(src, dst):
+group = []
+while True:
+line = src.readline()
+if not line:
+break
+if line.rstrip() == '':
+output_group(group, dst)
+group = []
+dst.write(line)
+elif line.startswith(',') and group:
+group[len(group) - 1] += line
+else:
+group.append(line)
+if group:
+output_group(group, dst)
+
+
+if __name__ == '__main__':
+ovsdb_monitor_sort(sys.stdin, sys.stdout)
diff --git a/tests/ovsdb-monitor.at b/tests/ovsdb-monitor.at
index 65c595645b14..2434f43cb761 100644
--- a/tests/ovsdb-monitor.at
+++ b/tests/ovsdb-monitor

[ovs-dev] seguros empresariales

2017-11-15 Thread Invierta en su seguridad y evite cuantiosas pérdidas
Conozca todo sobre las pólizas empresariales y proteja sus intereses

Curso experto en seguros empresariales
23 de noviembre - Lic. Antemio Carrillo Sasso 9am-3pm

Las pequeñas y medianas empresas constituyen 97% de las empresas en México y 
generan alrededor de 79% de todos los empleos, por lo que la solidez de sus 
operaciones es vital para el funcionamiento del país. Sin embargo, 90% de ellas 
no cuentan con un seguro de empresas que los proteja financieramente.

BENEFICIOS DE ASISTIR: 

-Conocerá la figura jurídica del contrato de seguro 
-Apreciará la diferencia entre los tipos de seguros empresariales existentes
 -Reconocerá las causas comunes de rechazo de pago del seguro
 -Aprenderá sobre los mecanismos de protección de usuarios 

¿Requiere la información a la Brevedad? responda este email con la palabra: 
Seguro + nombre - teléfono - correo.


centro telefónico:018002120744


 


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


Re: [ovs-dev] [PATCH] RPM: Improve doc to use builddep tool.

2017-11-15 Thread Aaron Conole
Flavio Leitner  writes:

> On Wed, 15 Nov 2017 02:20:16 -0500
> Aaron Conole  wrote:
>
>> Flavio Leitner  writes:
>> 
>> > Instead of listing all the dependencies, use the RPM group
>> > 'Development Tools' and the builddep tool to find specific
>> > ones.
>> >
>> > Signed-off-by: Flavio Leitner 
>> > ---
>> >  Documentation/intro/install/fedora.rst | 54
>> > +++---
>> >  Documentation/intro/install/rhel.rst   | 34 +++--
>> >  2 files changed, 62 insertions(+), 26 deletions(-)
>> >
>> > diff --git a/Documentation/intro/install/fedora.rst
>> > b/Documentation/intro/install/fedora.rst
>> > index 3119bd9aa..70cebfb16 100644
>> > --- a/Documentation/intro/install/fedora.rst
>> > +++ b/Documentation/intro/install/fedora.rst
>> > @@ -36,23 +36,43 @@ RHEL 7.x and its derivatives, including CentOS 7.x
>> > and Scientific Linux 7.x.
>> >  Build Requirements
>> >  --
>> >  
>> > -To build packages for a Fedora Linux host, you will need the
>> > packages described
>> > -in the :doc:`general`. Specific packages (by package name) include:
>> > -
>> > -- rpm-build
>> > -- autoconf automake libtool
>> > -- systemd-units openssl openssl-devel
>> > -- python2-devel python3-devel
>> > -- python2 python2-twisted python2-zope-interface python2-six 
>> > python2-sphinx
>> > -- desktop-file-utils
>> > -- groff graphviz
>> > -- procps-ng
>> > -- checkpolicy selinux-policy-devel
>> > -
>> > -And (optionally):
>> > -
>> > -- libcap-ng libcap-ng-devel
>> > -- dpdk-devel
>> > +You will need to install all required packages to build the RPMs.
>> > +Newer distributions use ``dnf`` but if it's not available, then use
>> > +``yum`` instructions.
>> > +
>> > +The command below will install RPM tools and generic build dependencies.
>> > +And (optionally) include these packages: libcap-ng
>> > libcap-ng-devel dpdk-devel.
>> > +
>> > +DNF:
>> > +::
>> > +
>> > +$ dnf install @'Development Tools' rpm-build dnf-plugins-core
>> > +
>> > +YUM:
>> > +::
>> > +
>> > +$ yum install @'Development Tools' rpm-build yum-utils
>> > +
>> > +Then it is necessary to install Open vSwitch specific build dependencies.
>> > +The dependencies are listed in the SPEC file, but first it is necessary
>> > +to replace the VERSION tag to be a valid SPEC.
>> > +
>> > +The command below will create a temporary SPEC file:
>> > +::
>> > +$ sed -e 's/@VERSION@/0.0.1/' rhel/openvswitch-fedora.spec.in \
>> > +  > /tmp/ovs.spec
>> > +
>> > +And to install specific dependencies, use the corresponding tool below.  
>> 
>> Is there any reason we can't `make rhel/openvswitch-fedora.spec` for
>> this?  I think ./boot && ./configure would work with Development Tools
>> installed, and then the only thing left is let the make system create
>> just that file?
>
> It doesn't work due to missing dependencies, like libssl-devel.
>
> I thought about having the minimum set of dependencies listed
> in the documentation and then do:
> $ ./boot
> $ ./configure
> $ make rpm
>
> which would prep the spec and run builddep and then run rpmbuild,
> but then we are back to maintain the list of packages in the doc
> and it is not that different from the steps in this patch and it
> requires root.
>
> And the other option is to provide a rhel/ script to do what this
> patch is explaining to do, but obviously it would require root too.

Right.  Well, I'm okay with either approach: the tmp file as documented
or a script.  If you decide to change it, no problems.  Otherwise:

Acked-by: Aaron Conole 

> fbl
>  
>> > +DNF:
>> > +::
>> > +$ dnf builddep /tmp/ovs.spec
>> > +
>> > +YUM:
>> > +::
>> > +$ yum-builddep /tmp/ovs.spec
>> > +
>> > +Once that is completed, remove the file ``/tmp/ovs.spec``.
>> >  
>> >  Bootstraping
>> >  
>> > diff --git a/Documentation/intro/install/rhel.rst
>> > b/Documentation/intro/install/rhel.rst
>> > index 0ef6f55a3..184089e89 100644
>> > --- a/Documentation/intro/install/rhel.rst
>> > +++ b/Documentation/intro/install/rhel.rst
>> > @@ -70,17 +70,33 @@ directory is ``/usr/src/redhat/SOURCES``. On RHEL
>> > 6, the default ``_topdir`` is
>> >  Build Requirements
>> >  --
>> >  
>> > -To compile the RPMs, you will need to install the packages described in 
>> > the
>> > -:doc:`general` along with some additional packages. These can be
>> > installed with
>> > -the below command::
>> > +You will need to install all required packages to build the RPMs.
>> > +The command below will install RPM tools and generic build dependencies:
>> > +::
>> > +$ yum install @'Development Tools' rpm-build yum-utils
>> >  
>> > - $ yum install gcc make python-devel openssl-devel kernel-devel
>> > graphviz \
>> > -kernel-debug-devel autoconf automake rpm-build redhat-rpm-config \
>> > -libtool checkpolicy selinux-policy-devel python-sphinx
>> > +Then it is necessary to install Open vSwitch specific build dependencies.
>> > +The dependencies are listed in the SPEC fi

Re: [ovs-dev] [PATCH] Skip processing actions when batch is emptied.

2017-11-15 Thread William Tu
On Wed, Nov 8, 2017 at 1:44 AM, Vishal Deep Ajmera
 wrote:
> Today in OVS, when errors are encountered during the execution of an action 
> the entire batch of packets may be deleted (for e.g. in processing 
> push_tnl_action, if the port is not found in the port_cache of PMD). The 
> remaining actions continue to be executed even though there are no packets to 
> be processed. It is assumed that the code dealing with each action checks 
> that the batch is not empty before executing. Crashes may occur if the 
> assumption is not met.
>
> The patch makes OVS skip processing of further actions from the action-set 
> once a batch is emptied. Doing so centralizes the check in one place and 
> avoids the possibility of crashes.
>
> Signed-off-by: Vishal Deep Ajmera 
> ---

nit: please wrap your commit messages to about 75 columns

otherwise looks good to me.

Acked-by: William Tu 

> lib/odp-execute.c | 9 ++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/lib/odp-execute.c b/lib/odp-execute.c
> index 3109f39..8697727 100644
> --- a/lib/odp-execute.c
> +++ b/lib/odp-execute.c
> @@ -685,9 +685,12 @@ odp_execute_actions(void *dp, struct dp_packet_batch 
> *batch, bool steal,
>  dp_execute_action(dp, batch, a, may_steal);
> -if (last_action) {
> -/* We do not need to free the packets. 
> dp_execute_actions()
> - * has stolen them */
> +if (last_action || (batch->count == 0)) {
> +/* We do not need to free the packets.
> + * Either dp_execute_actions() has stolen them
> + * or the batch is freed due to errors. In either
> + * case we do not need to execute further actions.
> + */
>  return;
>  }
>  }
> ___
> 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 3/3] netdev-dpdk: Fix mempool creation with large MTU.

2017-11-15 Thread Stokes, Ian
> Thanks for this fix Ilya.
> 
> I've tested this, and can confirm that it resolves a SEGV that previously
> occurred in the case of 'large' MTU values (in the case of my test, 9710).
> 
> Acked-by: Mark Kavanagh 
> Tested-by: Mark Kavanagh 
> 

Thanks all for the work on this, I'll look to push this to the dpdk merge 
branch today.

Ian
> Best,
> Mark
> 
> >---
> > lib/netdev-dpdk.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> >diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index
> >75856bc..dc210cc 100644
> >--- a/lib/netdev-dpdk.c
> >+++ b/lib/netdev-dpdk.c
> >@@ -510,7 +510,8 @@ dpdk_mp_create(struct netdev_dpdk *dev, int mtu)
> > do {
> > /* Full DPDK memory pool name must be unique and cannot be
> >  * longer than RTE_MEMPOOL_NAMESIZE. */
> >-int ret = snprintf(mp_name, RTE_MEMPOOL_NAMESIZE,
> "ovs_%x_%d_%d_%u",
> >+int ret = snprintf(mp_name, RTE_MEMPOOL_NAMESIZE,
> >+   "ovs%08x%02d%05d%07u",
> >hash, socket_id, mtu, n_mbufs);
> > if (ret < 0 || ret >= RTE_MEMPOOL_NAMESIZE) {
> > VLOG_DBG("snprintf returned %d. "
> >--
> >2.7.4

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


[ovs-dev] 1 New Important Notice

2017-11-15 Thread AtTention

HiUser,

You account was logged in from unknown location. Check below to confirm if it's 
you.

   Proceed Here






Keep your file safe with Drop box.








This e-mail may contain information that is privileged and confidential. If you 
suspect that you were not the intended recipient, please delete it and notify 
the sender as soon as possible.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v2 2/2] netdev: Eliminate redundant ifindex mapping.

2017-11-15 Thread William Tu
On Tue, Nov 14, 2017 at 10:15 AM, Ben Pfaff  wrote:
> Until now, the code for mapping ODP port number to ifindexes and vice versa
> has maintained two completely separate data structures, one for each
> direction.  It was possible for the two mappings to become out of sync
> with each other since either one could change independently.  This commit
> merges them into a single data structure (with two indexes), which at least
> means that if one is removed then the other is as well.
>
> Signed-off-by: Ben Pfaff 
> ---

Looks good to me.

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


Re: [ovs-dev] [PATCH v2 1/2] netdev: Indentation and style fixes.

2017-11-15 Thread William Tu
On Tue, Nov 14, 2017 at 10:15 AM, Ben Pfaff  wrote:
> White space changes only.
>
> Signed-off-by: Ben Pfaff 
> ---

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


Re: [ovs-dev] two possible bugs about ipv6 multicast

2017-11-15 Thread Huanle Han
Does anybody has some advice for me?

On Mon, Sep 4, 2017 at 11:40 PM, Huanle Han  wrote:

> Hi, All
>
> I'm just learning ipv6. When I go through ovs code about ipv6 normal
> forwarding, I find 2 possible "bugs". Could you explain some for me? Thanks.
>
> 1. In fucntion "xlate_normal". when mcast snooping is on, ipv6 neighbor
> discover packet, whose dest mac is "33:33:**", is proccessed in
> mcast_snooping code branch. Is this corrent?
>
> 2. In function "xlate_normal", "is_mld()"  code branch deosn't return as
> "igmp" does, but continue to look up mcast table and forward to group base
> ports. Is this corrent?
>
>
> Best regards,
> Huanle
>
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] RPM: Improve doc to use builddep tool.

2017-11-15 Thread Flavio Leitner
On Wed, 15 Nov 2017 02:20:16 -0500
Aaron Conole  wrote:

> Flavio Leitner  writes:
> 
> > Instead of listing all the dependencies, use the RPM group
> > 'Development Tools' and the builddep tool to find specific
> > ones.
> >
> > Signed-off-by: Flavio Leitner 
> > ---
> >  Documentation/intro/install/fedora.rst | 54 
> > +++---
> >  Documentation/intro/install/rhel.rst   | 34 +++--
> >  2 files changed, 62 insertions(+), 26 deletions(-)
> >
> > diff --git a/Documentation/intro/install/fedora.rst
> > b/Documentation/intro/install/fedora.rst
> > index 3119bd9aa..70cebfb16 100644
> > --- a/Documentation/intro/install/fedora.rst
> > +++ b/Documentation/intro/install/fedora.rst
> > @@ -36,23 +36,43 @@ RHEL 7.x and its derivatives, including CentOS 7.x
> > and Scientific Linux 7.x.
> >  Build Requirements
> >  --
> >  
> > -To build packages for a Fedora Linux host, you will need the packages 
> > described
> > -in the :doc:`general`. Specific packages (by package name) include:
> > -
> > -- rpm-build
> > -- autoconf automake libtool
> > -- systemd-units openssl openssl-devel
> > -- python2-devel python3-devel
> > -- python2 python2-twisted python2-zope-interface python2-six python2-sphinx
> > -- desktop-file-utils
> > -- groff graphviz
> > -- procps-ng
> > -- checkpolicy selinux-policy-devel
> > -
> > -And (optionally):
> > -
> > -- libcap-ng libcap-ng-devel
> > -- dpdk-devel
> > +You will need to install all required packages to build the RPMs.
> > +Newer distributions use ``dnf`` but if it's not available, then use
> > +``yum`` instructions.
> > +
> > +The command below will install RPM tools and generic build dependencies.
> > +And (optionally) include these packages: libcap-ng libcap-ng-devel 
> > dpdk-devel.
> > +
> > +DNF:
> > +::
> > +
> > +$ dnf install @'Development Tools' rpm-build dnf-plugins-core
> > +
> > +YUM:
> > +::
> > +
> > +$ yum install @'Development Tools' rpm-build yum-utils
> > +
> > +Then it is necessary to install Open vSwitch specific build dependencies.
> > +The dependencies are listed in the SPEC file, but first it is necessary
> > +to replace the VERSION tag to be a valid SPEC.
> > +
> > +The command below will create a temporary SPEC file:
> > +::
> > +$ sed -e 's/@VERSION@/0.0.1/' rhel/openvswitch-fedora.spec.in \
> > +  > /tmp/ovs.spec
> > +
> > +And to install specific dependencies, use the corresponding tool below.  
> 
> Is there any reason we can't `make rhel/openvswitch-fedora.spec` for
> this?  I think ./boot && ./configure would work with Development Tools
> installed, and then the only thing left is let the make system create
> just that file?

It doesn't work due to missing dependencies, like libssl-devel.

I thought about having the minimum set of dependencies listed
in the documentation and then do:
$ ./boot
$ ./configure
$ make rpm

which would prep the spec and run builddep and then run rpmbuild,
but then we are back to maintain the list of packages in the doc
and it is not that different from the steps in this patch and it
requires root.

And the other option is to provide a rhel/ script to do what this
patch is explaining to do, but obviously it would require root too.

fbl
 
> > +DNF:
> > +::
> > +$ dnf builddep /tmp/ovs.spec
> > +
> > +YUM:
> > +::
> > +$ yum-builddep /tmp/ovs.spec
> > +
> > +Once that is completed, remove the file ``/tmp/ovs.spec``.
> >  
> >  Bootstraping
> >  
> > diff --git a/Documentation/intro/install/rhel.rst
> > b/Documentation/intro/install/rhel.rst
> > index 0ef6f55a3..184089e89 100644
> > --- a/Documentation/intro/install/rhel.rst
> > +++ b/Documentation/intro/install/rhel.rst
> > @@ -70,17 +70,33 @@ directory is ``/usr/src/redhat/SOURCES``. On RHEL
> > 6, the default ``_topdir`` is
> >  Build Requirements
> >  --
> >  
> > -To compile the RPMs, you will need to install the packages described in the
> > -:doc:`general` along with some additional packages. These can be installed 
> > with
> > -the below command::
> > +You will need to install all required packages to build the RPMs.
> > +The command below will install RPM tools and generic build dependencies:
> > +::
> > +$ yum install @'Development Tools' rpm-build yum-utils
> >  
> > -$ yum install gcc make python-devel openssl-devel kernel-devel 
> > graphviz \
> > -kernel-debug-devel autoconf automake rpm-build redhat-rpm-config \
> > -libtool checkpolicy selinux-policy-devel python-sphinx
> > +Then it is necessary to install Open vSwitch specific build dependencies.
> > +The dependencies are listed in the SPEC file, but first it is necessary
> > +to replace the VERSION tag to be a valid SPEC.
> >  
> > -.. note::
> > -  If python-sphinx package is not available in your version of RHEL, you 
> > can
> > -  install it via pip with 'pip install sphinx'.
> > +The command below will create a temporary SPEC file:
> > +::
> > +$ sed -e 's/@VERSION@/0.

Re: [ovs-dev] [PATCH v2 3/3] netdev-dpdk: Fix mempool creation with large MTU.

2017-11-15 Thread Kavanagh, Mark B
>From: Ilya Maximets [mailto:i.maxim...@samsung.com]
>Sent: Friday, November 10, 2017 7:12 AM
>To: ovs-dev@openvswitch.org
>Cc: Heetae Ahn ; Fischetti, Antonio
>; Loftus, Ciara ;
>Kavanagh, Mark B ; Stokes, Ian
>; Wojciechowicz, RobertX
>; Flavio Leitner ; Ilya
>Maximets 
>Subject: [PATCH v2 3/3] netdev-dpdk: Fix mempool creation with large MTU.
>
>Currently mempool name size limited to 25 characters by
>RTE_MEMPOOL_NAMESIZE. netdev-dpdk tries to create mempool with the
>following name pattern: "ovs_%{hash}_%{socket}_%{mtu}_%{n_mbuf}".
>
>We have 3 chars for "ovs" + 4 chars for delimiters + 8 chars for
>hash (because it's the 32 bit integer printed in hex) + 1 char for
>socket_id (mostly 1, but it could be 2 on some systems; larger?) = 16.
>
>Only 25 - 16 = 9 characters remains for mtu + n_mbufs.
>Minimum usual value for mtu is 1500 --> 2030 (4 chars) after
>dpdk_buf_size conversion and the minimum value for n_mbufs is 16384
>(5 chars). So, all the 9 characters are used.
>
>If we'll try to create port with mtu = 9500, mempool creation will
>fail, because FRAME_LEN_TO_MTU(dpdk_buf_size(9500)) = 10222 (5 chars)
>and this value will overflow the RTE_MEMPOOL_NAMESIZE limit.
>
>Same issue will happen if we'll try to create port with big enough
>number of queues or will try to create big enough number of PMD
>threads (number of tx queues will enlarge the mempool requirements).
>
>Fix that by removing the delimiters. To keep the readability (at least
>partial) of the mempool names exact field sizes with zero padding
>are used.
>
>Following limits should be suitable for now:
> - Hash length: 8 chars (uint32_t in hex)
> - Socket ID  : 2 chars (For systems with up to 10 sockets)
> - MTU: 5 chars (MTU (10^5 - 1) should be enough for now)
> - n_mbufs: 7 chars (Up to 10^7 of mbufs)
>
>   Total  : 22 + 3 (for "ovs") = 25
>
>CC: Antonio Fischetti 
>CC: Robert Wojciechowicz 
>Fixes: f06546a51dd8 ("Fix mempool names to reflect socket id.")
>Fixes: d555d9bded5f ("netdev-dpdk: Create separate memory pool for each
>port.")
>Signed-off-by: Ilya Maximets 
>Acked-by: Antonio Fischetti 

Thanks for this fix Ilya.

I've tested this, and can confirm that it resolves a SEGV that previously 
occurred in the case of 'large' MTU values (in the case of my test, 9710).

Acked-by: Mark Kavanagh 
Tested-by: Mark Kavanagh  

Best,
Mark

>---
> lib/netdev-dpdk.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
>index 75856bc..dc210cc 100644
>--- a/lib/netdev-dpdk.c
>+++ b/lib/netdev-dpdk.c
>@@ -510,7 +510,8 @@ dpdk_mp_create(struct netdev_dpdk *dev, int mtu)
> do {
> /* Full DPDK memory pool name must be unique and cannot be
>  * longer than RTE_MEMPOOL_NAMESIZE. */
>-int ret = snprintf(mp_name, RTE_MEMPOOL_NAMESIZE, "ovs_%x_%d_%d_%u",
>+int ret = snprintf(mp_name, RTE_MEMPOOL_NAMESIZE,
>+   "ovs%08x%02d%05d%07u",
>hash, socket_id, mtu, n_mbufs);
> if (ret < 0 || ret >= RTE_MEMPOOL_NAMESIZE) {
> VLOG_DBG("snprintf returned %d. "
>--
>2.7.4

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


[ovs-dev] I'm Modzinou KOMI, I have 50kg of Gold Bars and I want to sell in your country. Please get me a buyer I will give you a commission of 1500$/kg. The carat is 22.98 and the purity is 96%. The

2017-11-15 Thread Modzinou KOMI

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