Re: [ovs-dev] Interested in contibuting to openvswitch

2015-05-04 Thread Ben Pfaff
On Sun, May 03, 2015 at 08:33:04PM -0600, sandesh shrestha wrote:
> I want to contribute to openvswitch. I came across this missing feature in
> FAQ and want to implement this feature.
> 
> *"Q: It looks like each of the interfaces in my bonded port shows up as an
> individual OpenFlow port. Is that right?"*
> 
> How can I start working on this ?
> 
> I have good understanding of working of openvswitch and a good knowledge on
> C programming. However, I have limited understanding of linux kernel which
> I think is also required for development.
> 
> Could anyone guide me on this  ?

I think the main issue here would be to figure out the exact semantics
that we want.  We probably need to be able to maintain backward
compatibility, for example.  That might mean that we need an option
somewhere to enable this new mode.

There should be no need to do any programming in the Linux kernel to
implement this feature.
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH] datapath-windows: Fix warning from the powershell module

2015-05-04 Thread Alin Serdean
This patch fixes the warning when datapath-windows/misc/OVS.psm1 is
imported.

Signed-off-by: Alin Gabriel Serdean 
Reported-by: Hemanth Kumar Mantri 
Reported-at: https://github.com/openvswitch/ovs-issues/issues/69
---
 datapath-windows/misc/OVS.psm1 | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/datapath-windows/misc/OVS.psm1 b/datapath-windows/misc/OVS.psm1
index d6b6b00..a8ffcae 100644
--- a/datapath-windows/misc/OVS.psm1
+++ b/datapath-windows/misc/OVS.psm1
@@ -1,5 +1,5 @@
 <#
-Copyright 2014 Cloudbase Solutions Srl
+Copyright 2014, 2015 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.
@@ -57,7 +57,7 @@ function Set-VMNetworkAdapterOVSPort
 $retVal = $vsms.ModifyResourceSettings(@($sd.GetText(1)))
 try
 {
-Check-WMIReturnValue $retVal
+CheckWMIReturnValue $retVal
 }
 catch
 {
@@ -142,7 +142,7 @@ function Get-VMNetworkAdapterWithOVSPort
 }
 }
 
-function Check-WMIReturnValue($retVal)
+function CheckWMIReturnValue($retVal)
 {
 if ($retVal.ReturnValue -ne 0)
 {
@@ -206,3 +206,5 @@ function Set-VMNetworkAdapterOVSPortDirect
 $vnic[0] | Set-VMNetworkAdapterOVSPort -OVSPortName $OVSPortName
 }
 }
+
+Export-ModuleMember -function Set-*, Get-*
-- 
1.9.5.msysgit.0
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH] datapath: stt compatibility for RHEL7

2015-05-04 Thread Jesse Gross
On Sun, May 3, 2015 at 11:56 AM, Pravin B Shelar  wrote:
> RHEL7 backported nf_hookfn from newer kernel. Handle compatibility
> by checking nf_hookfn declaration.
>
> Signed-off-by: Pravin B Shelar 

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


Re: [ovs-dev] [PATCH ovn v6 2/9] ovn-controller: Implement translation of OVN flows into OpenFlow.

2015-05-04 Thread Ben Pfaff
On Mon, May 04, 2015 at 08:23:16AM -0700, Gurucharan Shetty wrote:
> On Sun, May 3, 2015 at 6:54 PM, Ben Pfaff  wrote:
> > On Fri, May 01, 2015 at 04:17:27PM -0700, Ben Pfaff wrote:
> >> Signed-off-by: Ben Pfaff 
> >
> > I introduced a bug while applying Justin's comments and didn't take the
> > time to retest, but Guru pointed out the bug.  Here's an incremental
> > that should fix it.  I'll also update the "ovn" branch in my ovs-reviews
> > repository.
> Thanks, the below fix lets me ping between 2 docker containers.
> (It did not look like you have updated your ovn branch in ovs-reviews yet)

Oh, sorry.  It should be fixed now.
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH ovn v6 3/9] rconn: Only increment seqno when connection actually drops or reconnects.

2015-05-04 Thread Russell Bryant
On 05/01/2015 07:17 PM, Ben Pfaff wrote:
> rconn_get_connection_seqno() is documented to change only when an rconn
> connects or disconnnects, but in fact it was also changing whenever an
> rconn went into or out of the "idle" state (following sending an echo
> request).  This fixes the problem.
> 
> rconn_get_connection_seqno() didn't have any existing users, but an
> upcoming commit adds one.
> 
> Signed-off-by: Ben Pfaff 

Acked-by: Russell Bryant 

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


Re: [ovs-dev] [PATCH ovn v6 4/9] ovs-sandbox: Use "secure" mode for br-int, in OVN mode.

2015-05-04 Thread Russell Bryant
On 05/01/2015 07:17 PM, Ben Pfaff wrote:
> This is documented in ovn-architecture(7).
> 
> Signed-off-by: Ben Pfaff 

Acked-by: Russell Bryant 

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


Re: [ovs-dev] [PATCH ovn v6 5/9] match: Add MATCH_CATCHALL_INITIALIZER.

2015-05-04 Thread Russell Bryant
On 05/01/2015 07:17 PM, Ben Pfaff wrote:
> An upcoming patch will add the first user.
> 
> Signed-off-by: Ben Pfaff 

Acked-by: Russell Bryant 

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


[ovs-dev] Testing OVN with OpenStack

2015-05-04 Thread Russell Bryant
I put together some documentation on how to test OVN with OpenStack.
It's intended to be usable even if you don't have a lot of OpenStack
experience.

http://networking-ovn.readthedocs.org/en/latest/testing.html

Right now it only covers spinning up a single host test environment.
We're working on expanding the environment automation and documentation
to support multi-host testing.  That page will be updated as we make
progress.

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


Re: [ovs-dev] [PATCH v2] datapath: define compat __skb_gso_segment()

2015-05-04 Thread Jesse Gross
On Fri, May 1, 2015 at 7:00 PM, Pravin B Shelar  wrote:
> diff --git a/datapath/linux/compat/gso.c b/datapath/linux/compat/gso.c
> index 552e748..f8a70d0 100644
> --- a/datapath/linux/compat/gso.c
> +++ b/datapath/linux/compat/gso.c
> @@ -219,6 +219,9 @@ static struct sk_buff *tnl_skb_gso_segment(struct sk_buff 
> *skb,
>  * make copy of it to restore it back. */
> memcpy(cb, skb->cb, sizeof(cb));
>
> +   /* We are handling offloads by segmenting l3 packet, so
> +* no need to call OVS compat segmentation function. */
> +#undef __skb_gso_segment
> segs = __skb_gso_segment(skb, 0, tx_path);

Don't we also have a problem with using __skb_gso_segment() directly here?

What was the change that bumps up the backport requirement from 3.16 to 3.19?
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] FW:

2015-05-04 Thread CESAR KARYL GOVEA LEMOS

 
From: cekargo...@hotmail.com
To: dev@openvswitch.org
Subject: 
Date: Thu, 16 Apr 2015 13:27:48 -0500




Sra. Rosa Edwinsam
reciba un cálido abrazo y bendiciones en Cristo Jesús.
Me encuentro orando por su sanidad, esperando la pronta respuesta de mi Señor 
todopoderoso
para usted, ya que para Jehová Dios no hay nada imposible, el puede hacer que 
usted vuelva a la
normalidad y sea sanada enteramente, tenga mucha fe y crea ciegamente en el, 
usted no está sola
en la adversidad y el sufrimiento, en la enfermedad y la prueba el está siempre 
presenta aunque
físicamente no lo veamos pero espiritualmente se halla muy cerca de nosotros 
para socorrernos y
ayudarnos, nunca nos dejará solos, confíe verdaderamente en él, no la 
defraudará.
He esperado tanto tiempo para realizarme como pastor de una iglesia que debo 
organizar, necesito
construir el templo para reuniones, alimentar a niños y ancianos enfermos, 
recuperar a drogadictos y
alcoholicos y devolverlos a Dios y a la sociedad como personas muy valiosas,  
con una nueva identificación
realmente cristiana al servicio y pasión de Cristo.
Soy pastor graduado en Ciencia Teológicas, con la Universidad Latin Theologi of 
South California, en convenio con el Seminario Logos de Vida SILVE Ecuador. Y 
por revelación de Cristo para predicar el Evangelio a las naciones. Le aseguro 
que estoy dispuesto a seguir sus reglas y dar el uso conveniente al dinero 
enviado por usted a mi persona para el servicio a Dios.
 
Le amo en Cristo.
Espero su pronta respuesta.
Por favor escríbame a mi correo:  cekargo...@hotmail.com
Mi móvil: 0990425021
 
En Cristo
Pstr. César Cáril Govea
Céd. Id. 080082577-0
 

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


Re: [ovs-dev] [PATCH v2] datapath: define compat __skb_gso_segment()

2015-05-04 Thread Pravin Shelar
On Mon, May 4, 2015 at 11:26 AM, Jesse Gross  wrote:
> On Fri, May 1, 2015 at 7:00 PM, Pravin B Shelar  wrote:
>> diff --git a/datapath/linux/compat/gso.c b/datapath/linux/compat/gso.c
>> index 552e748..f8a70d0 100644
>> --- a/datapath/linux/compat/gso.c
>> +++ b/datapath/linux/compat/gso.c
>> @@ -219,6 +219,9 @@ static struct sk_buff *tnl_skb_gso_segment(struct 
>> sk_buff *skb,
>>  * make copy of it to restore it back. */
>> memcpy(cb, skb->cb, sizeof(cb));
>>
>> +   /* We are handling offloads by segmenting l3 packet, so
>> +* no need to call OVS compat segmentation function. */
>> +#undef __skb_gso_segment
>> segs = __skb_gso_segment(skb, 0, tx_path);
>
> Don't we also have a problem with using __skb_gso_segment() directly here?
>
ok. We need compat code here.

> What was the change that bumps up the backport requirement from 3.16 to 3.19?

MPLS offload is supported on 3.19 or newer.
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH] datapath: stt compatibility for RHEL7

2015-05-04 Thread Pravin Shelar
On Mon, May 4, 2015 at 9:52 AM, Jesse Gross  wrote:
> On Sun, May 3, 2015 at 11:56 AM, Pravin B Shelar  wrote:
>> RHEL7 backported nf_hookfn from newer kernel. Handle compatibility
>> by checking nf_hookfn declaration.
>>
>> Signed-off-by: Pravin B Shelar 
>
> Acked-by: Jesse Gross 

I pushed it to master.

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


Re: [ovs-dev] [PATCH v2] datapath: define compat __skb_gso_segment()

2015-05-04 Thread Jesse Gross
On Mon, May 4, 2015 at 12:48 PM, Pravin Shelar  wrote:
> On Mon, May 4, 2015 at 11:26 AM, Jesse Gross  wrote:
>> What was the change that bumps up the backport requirement from 3.16 to 3.19?
>
> MPLS offload is supported on 3.19 or newer.

OK, I remember - you made some critical bugfixes in 3.19 that are
required to make it work even though the actual support was merged in
3.16. In that case, I think there are also some 3.16 version checks in
gso.c that need to be bumped up as well.
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH v2] datapath: define compat __skb_gso_segment()

2015-05-04 Thread Pravin Shelar
On Mon, May 4, 2015 at 1:25 PM, Jesse Gross  wrote:
> On Mon, May 4, 2015 at 12:48 PM, Pravin Shelar  wrote:
>> On Mon, May 4, 2015 at 11:26 AM, Jesse Gross  wrote:
>>> What was the change that bumps up the backport requirement from 3.16 to 
>>> 3.19?
>>
>> MPLS offload is supported on 3.19 or newer.
>
> OK, I remember - you made some critical bugfixes in 3.19 that are
> required to make it work even though the actual support was merged in
> 3.16. In that case, I think there are also some 3.16 version checks in
> gso.c that need to be bumped up as well.

ok, got it.

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


Re: [ovs-dev] Testing OVN with OpenStack

2015-05-04 Thread Salvatore Orlando
Thanks a lot Russell, this information are very useful.

I'm not sure what you think of it, but I feel like a link to your blog post
[1] might be very useful as well.
This is what I've been following so far to get started on the OVN side of
things.
It seems the information there complement and do not duplicate what you
published on readthedocs, although they're not strictly related to the
Neutron driver ''networking-ovn'

Regards,
Salvatore

[1]
http://blog.russellbryant.net/2015/04/08/ovn-and-openstack-integration-development-update/


On 4 May 2015 at 20:22, Russell Bryant  wrote:

> I put together some documentation on how to test OVN with OpenStack.
> It's intended to be usable even if you don't have a lot of OpenStack
> experience.
>
> http://networking-ovn.readthedocs.org/en/latest/testing.html
>
> Right now it only covers spinning up a single host test environment.
> We're working on expanding the environment automation and documentation
> to support multi-host testing.  That page will be updated as we make
> progress.
>
> --
> Russell Bryant
> ___
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH] datapath: stt compatibility for RHEL7

2015-05-04 Thread Vasiliy Tolstov
So now stt fully present in current master?
04 мая 2015 г. 23:25 пользователь "Pravin Shelar" 
написал:

> On Mon, May 4, 2015 at 9:52 AM, Jesse Gross  wrote:
> > On Sun, May 3, 2015 at 11:56 AM, Pravin B Shelar 
> wrote:
> >> RHEL7 backported nf_hookfn from newer kernel. Handle compatibility
> >> by checking nf_hookfn declaration.
> >>
> >> Signed-off-by: Pravin B Shelar 
> >
> > Acked-by: Jesse Gross 
>
> I pushed it to master.
>
> Thanks.
> ___
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] Testing OVN with OpenStack

2015-05-04 Thread Russell Bryant
On 05/04/2015 05:04 PM, Salvatore Orlando wrote:
> Thanks a lot Russell, this information are very useful.
> 
> I'm not sure what you think of it, but I feel like a link to your blog
> post [1] might be very useful as well.
> This is what I've been following so far to get started on the OVN side
> of things.
> It seems the information there complement and do not duplicate what you
> published on readthedocs, although they're not strictly related to the
> Neutron driver ''networking-ovn'
> 
> Regards,
> Salvatore
> 
> [1] 
> http://blog.russellbryant.net/2015/04/08/ovn-and-openstack-integration-development-update/

Sure, that makes sense for now.  I was actually intending to continue to
expand on what's on readthedocs to incorporate that kind of stuff.  It
would be nice to guide people through looking even closer at OVN and OVS
to verify and understand what's happening.  In the meantime, I'll put
some links to additional resources.

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


[ovs-dev] [PATCH ovn 0/2 v2] Update Fedora packaging for OVN.

2015-05-04 Thread Russell Bryant
v1->v2:
 - Change systemd units to run ovn-northd and ovn-controller directly
   instead of using ovn-ctl.  I kept ovn-ctl around anyway as it
   seemed useful to provide as an option for integrating with systems
   without systemd, similar to how ovs-ctl is used today.

[PATCH 1/2] Add ovn-ctl to assist with OVN daemon lifecycle.
[PATCH 2/2] fedora.spec: Create openvswitch-ovn package.

 ovn/automake.mk   |1 
 ovn/utilities/.gitignore  |1 
 ovn/utilities/automake.mk |9 
 ovn/utilities/ovn-ctl |  277 ++
 ovn/utilities/ovn-ctl.8.xml   |   54 
 rhel/automake.mk  |4 
 rhel/openvswitch-fedora.spec.in   |   43 ++-
 rhel/usr_lib_systemd_system_ovncontroller.service |   14 +
 rhel/usr_lib_systemd_system_ovnnorthd.service |   13 +
 9 files changed, 409 insertions(+), 7 deletions(-)

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


[ovs-dev] [PATCH ovn 1/2 v2] Add ovn-ctl to assist with OVN daemon lifecycle.

2015-05-04 Thread Russell Bryant
This patch introduces ovn-ctl, which is similar to ovs-ctl.  I opted
for a new script as everything in OVN so far is nicely isolated, so a
new script seemed to make the most sense.

ovn-ctl supports a few different scenarios.  If you'd like to run
ovn-controller on a host already running ovs:

# ovn-ctl start_controller

If you'd like to run ovn-northd and ovsdb-server on a management host
that won't be running ovs and ovn-controller:

# ovn-ctl start_northd

ovn-ctl also supports running everything on the same host.  This would
be common in a test environment with a single host or small set of
hosts.  In general, that would look like:

# ovn-ctl create_ovn_dbs
# ovs-ctl start --extra-dbs="ovnnb.db ovnsb.db"
# ovn-ctl start_northd --no-ovsdb-server
# ovn-ctl start_controller

This script is not strictly needed on systems using systemd, but is
still nice to provide as an option to enable running on other systems.

Signed-off-by: Russell Bryant 
---
 ovn/automake.mk |   1 +
 ovn/utilities/.gitignore|   1 +
 ovn/utilities/automake.mk   |   9 ++
 ovn/utilities/ovn-ctl   | 277 
 ovn/utilities/ovn-ctl.8.xml |  54 +
 5 files changed, 342 insertions(+)
 create mode 100644 ovn/utilities/.gitignore
 create mode 100644 ovn/utilities/automake.mk
 create mode 100755 ovn/utilities/ovn-ctl
 create mode 100644 ovn/utilities/ovn-ctl.8.xml

diff --git a/ovn/automake.mk b/ovn/automake.mk
index 4be5381..1ebaa55 100644
--- a/ovn/automake.mk
+++ b/ovn/automake.mk
@@ -86,3 +86,4 @@ ovn_ovn_nbctl_LDADD = ovn/lib/libovn.la ovsdb/libovsdb.la 
lib/libopenvswitch.la
 include ovn/controller/automake.mk
 include ovn/lib/automake.mk
 include ovn/northd/automake.mk
+include ovn/utilities/automake.mk
diff --git a/ovn/utilities/.gitignore b/ovn/utilities/.gitignore
new file mode 100644
index 000..1ddc63e
--- /dev/null
+++ b/ovn/utilities/.gitignore
@@ -0,0 +1 @@
+/ovn-ctl.8
diff --git a/ovn/utilities/automake.mk b/ovn/utilities/automake.mk
new file mode 100644
index 000..a55c1ad
--- /dev/null
+++ b/ovn/utilities/automake.mk
@@ -0,0 +1,9 @@
+scripts_SCRIPTS += \
+ovn/utilities/ovn-ctl
+
+man_MANS += \
+ovn/utilities/ovn-ctl.8
+
+EXTRA_DIST += \
+ovn/utilities/ovn-ctl \
+ovn/utilities/ovn-ctl.8.xml
diff --git a/ovn/utilities/ovn-ctl b/ovn/utilities/ovn-ctl
new file mode 100755
index 000..59a6698
--- /dev/null
+++ b/ovn/utilities/ovn-ctl
@@ -0,0 +1,277 @@
+#!/bin/sh
+#
+# 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.
+
+case $0 in
+*/*) dir0=`echo "$0" | sed 's,/[^/]*$,,'` ;;
+*) dir0=./ ;;
+esac
+. "$dir0/ovs-lib" || exit 1
+
+for dir in "$sbindir" "$bindir" /sbin /bin /usr/sbin /usr/bin; do
+case :$PATH: in
+*:$dir:*) ;;
+*) PATH=$PATH:$dir ;;
+esac
+done
+
+
+## - ##
+## start ##
+## - ##
+
+create_db () {
+DB_FILE=$1
+DB_SCHEMA=$2
+action "Creating empty database $DB_FILE" ovsdb-tool create "$DB_FILE" 
"$DB_SCHEMA"
+}
+
+create_ovn_dbs () {
+if test ! -e "$DB_NB_FILE"; then
+create_db "$DB_NB_FILE" "$DB_NB_SCHEMA"
+fi
+
+if test ! -e "$DB_SB_FILE"; then
+create_db "$DB_SB_FILE" "$DB_SB_SCHEMA"
+fi
+}
+
+start_ovsdb () {
+if test X"$OVSDB_SERVER" != Xyes; then
+return
+fi
+
+if daemon_is_running ovsdb-server; then
+log_success_msg "ovsdb-server is already running"
+return
+fi
+
+create_ovn_dbs
+
+set ovsdb-server "$DB_NB_FILE" "$DB_SB_FILE"
+set "$@" -vconsole:emer -vsyslog:err -vfile:info
+set "$@" --remote=punix:"$DB_SOCK"
+for remote in $OVSDB_SERVER_REMOTES; do
+set "$@" "--remote=$remote"
+done
+start_daemon "$OVSDB_SERVER_PRIORITY" "$OVSDB_SERVER_WRAPPER" "$@"
+}
+
+start_northd () {
+# We expect ovn-northd to be co-located with ovsdb-server handling both the
+# OVN_Northbound and OVN_Southbound dbs.
+start_ovsdb
+
+set ovn-northd
+set "$@" -vconsole:emer -vsyslog:err -vfile:info
+start_daemon "$OVN_NORTHD_PRIORITY" "$OVN_NORTHD_WRAPPER" "$@"
+}
+
+start_controller () {
+set ovn-controller "unix:$DB_SOCK"
+set "$@" -vconsole:emer -vsyslog:err -vfile:info
+start_daemon "$OVN_CONTROLLER_PRIORITY" "$OVN_CONTROLLER_WRAPPER" "$@"
+}
+
+##  ##
+## stop ##
+##  ##
+
+stop_ovsdb_server () {
+if test X"$OVSDB_SERVER" != Xyes; then
+return
+fi
+
+stop_daemon ovsdb-server
+}
+
+stop_northd () {
+stop_o

[ovs-dev] [PATCH ovn 2/2 v2] fedora.spec: Create openvswitch-ovn package.

2015-05-04 Thread Russell Bryant
This patch creates a new subpackage for OVN, openvswitch-ovn.  It also
installs systemd unit files for ovn-controller and ovn-northd.

If you want to run ovn-controller:

# systemctl start ovncontroller

If you want to run ovn-northd:

# systemctl start ovnnorthd

Both systemd units are currently set to depend on openvswitch.
Technically you could ovn-northd and ovsdb-server without ovs running
locally as well, but that will require some additional work.

This also means that you need to configure the openvswitch service to
serve the two OVN databases, as well:  That is done by running the
following commands before starting or restarting openvswitch:

# ovn-ctl create_ovn_dbs
# cat << EOF > /etc/sysconfig/openvswitch
OPTIONS="'--extra-dbs=ovnnb.db ovnsb.db'"
EOF

Signed-off-by: Russell Bryant 
---
 rhel/automake.mk  |  4 ++-
 rhel/openvswitch-fedora.spec.in   | 43 +++
 rhel/usr_lib_systemd_system_ovncontroller.service | 14 
 rhel/usr_lib_systemd_system_ovnnorthd.service | 13 +++
 4 files changed, 67 insertions(+), 7 deletions(-)
 create mode 100644 rhel/usr_lib_systemd_system_ovncontroller.service
 create mode 100644 rhel/usr_lib_systemd_system_ovnnorthd.service

diff --git a/rhel/automake.mk b/rhel/automake.mk
index 9c3433b..fab3634 100644
--- a/rhel/automake.mk
+++ b/rhel/automake.mk
@@ -24,7 +24,9 @@ EXTRA_DIST += \
rhel/usr_share_openvswitch_scripts_sysconfig.template \
rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \
rhel/usr_lib_systemd_system_openvswitch.service \
-   rhel/usr_lib_systemd_system_openvswitch-nonetwork.service
+   rhel/usr_lib_systemd_system_openvswitch-nonetwork.service \
+   rhel/usr_lib_systemd_system_ovncontroller.service \
+   rhel/usr_lib_systemd_system_ovnnorthd.service
 
 update_rhel_spec = \
   $(AM_V_GEN)($(ro_shell) && sed -e 's,[@]VERSION[@],$(VERSION),g') \
diff --git a/rhel/openvswitch-fedora.spec.in b/rhel/openvswitch-fedora.spec.in
index f3dbebf..5b4e9ef 100644
--- a/rhel/openvswitch-fedora.spec.in
+++ b/rhel/openvswitch-fedora.spec.in
@@ -81,6 +81,19 @@ Provides: openvswitch-static = %{version}-%{release}
 This provides static library, libopenswitch.a and the openvswitch header
 files needed to build an external application.
 
+%package ovn
+Summary: Open vSwitch - Open Virtual Network support
+License: ASL 2.0
+Requires: openvswitch
+
+%description ovn
+OVN, the Open Virtual Network, is a system to support virtual network
+abstraction.  OVN complements the existing capabilities of OVS to add
+native support for virtual network abstractions, such as virtual L2 and L3
+overlays and security groups.  Services such as DHCP are also desirable
+features.  Just like OVS, OVN's design goal is to have a production-quality
+implementation that can operate at significant scale.
+
 
 %prep
 %setup -q
@@ -98,13 +111,14 @@ install -d -m 0755 
$RPM_BUILD_ROOT%{_sysconfdir}/openvswitch
 install -p -D -m 0644 \
 rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \
 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/openvswitch
+for service in openvswitch ovncontroller ovnnorthd; do
+   install -p -D -m 0644 \
+   rhel/usr_lib_systemd_system_${service}.service \
+   $RPM_BUILD_ROOT%{_unitdir}/${service}.service
+done
 install -p -D -m 0644 \
-rhel/usr_lib_systemd_system_openvswitch.service \
-$RPM_BUILD_ROOT%{_unitdir}/openvswitch.service
-install -p -D -m 0644 \
-rhel/usr_lib_systemd_system_openvswitch-nonetwork.service \
-$RPM_BUILD_ROOT%{_unitdir}/openvswitch-nonetwork.service
-
+   rhel/usr_lib_systemd_system_openvswitch-nonetwork.service \
+   $RPM_BUILD_ROOT%{_unitdir}/openvswitch-nonetwork.service
 install -m 0755 rhel/etc_init.d_openvswitch \
 $RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/openvswitch.init
 
@@ -269,6 +283,23 @@ rm -rf $RPM_BUILD_ROOT
 %exclude %{_mandir}/man8/ovs-vlan-bug-workaround.8.gz
 %exclude %{_datadir}/openvswitch/scripts/ovs-save
 
+%files ovn
+%{_bindir}/ovn-controller
+%{_bindir}/ovn-nbctl
+%{_bindir}/ovn-northd
+%{_datadir}/openvswitch/scripts/ovn-ctl
+%{_mandir}/man8/ovs-testcontroller.8*
+%{_mandir}/man5/ovn-nb.5*
+%{_mandir}/man5/ovn-sb.5*
+%{_mandir}/man7/ovn-architecture.7*
+%{_mandir}/man8/ovn-controller.8*
+%{_mandir}/man8/ovn-ctl.8*
+%{_mandir}/man8/ovn-nbctl.8*
+%config %{_datadir}/openvswitch/ovn-nb.ovsschema
+%config %{_datadir}/openvswitch/ovn-sb.ovsschema
+%{_unitdir}/ovncontroller.service
+%{_unitdir}/ovnnorthd.service
+
 %changelog
 * Wed Jan 12 2011 Ralf Spenneberg 
 - First build on F14
diff --git a/rhel/usr_lib_systemd_system_ovncontroller.service 
b/rhel/usr_lib_systemd_system_ovncontroller.service
new file mode 100644
index 000..b30bb9a
--- /dev/null
+++ b/rhel/usr_lib_systemd_system_ovncontroller.service
@@ -0,0 +1,14 @@
+[Unit]
+Description

Re: [ovs-dev] [PATCH] datapath: stt compatibility for RHEL7

2015-05-04 Thread Pravin Shelar
On Mon, May 4, 2015 at 2:10 PM, Vasiliy Tolstov  wrote:
> So now stt fully present in current master?
>
Yes. It is available in master branch.

> 04 мая 2015 г. 23:25 пользователь "Pravin Shelar" 
> написал:
>>
>> On Mon, May 4, 2015 at 9:52 AM, Jesse Gross  wrote:
>> > On Sun, May 3, 2015 at 11:56 AM, Pravin B Shelar 
>> > wrote:
>> >> RHEL7 backported nf_hookfn from newer kernel. Handle compatibility
>> >> by checking nf_hookfn declaration.
>> >>
>> >> Signed-off-by: Pravin B Shelar 
>> >
>> > Acked-by: Jesse Gross 
>>
>> I pushed it to master.
>>
>> Thanks.
>> ___
>> dev mailing list
>> dev@openvswitch.org
>> http://openvswitch.org/mailman/listinfo/dev
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH v2] datapath: define compat __skb_gso_segment()

2015-05-04 Thread Pravin B Shelar
OVS correctly define skb_gso_segment() to handle MPLS and VLAN
segmentation correctly. But OVS also uses __skb_gso_segment() in
some cases. Following patch defines compat __skb_gso_segment()
to handle all segmentation cases.

Signed-off-by: Pravin B Shelar 
---
 datapath/linux/compat/gso.c |   26 +++-
 datapath/linux/compat/include/linux/netdevice.h |   37 +++
 datapath/linux/compat/netdevice.c   |   19 
 3 files changed, 55 insertions(+), 27 deletions(-)

diff --git a/datapath/linux/compat/gso.c b/datapath/linux/compat/gso.c
index 552e748..84cb835 100644
--- a/datapath/linux/compat/gso.c
+++ b/datapath/linux/compat/gso.c
@@ -52,7 +52,7 @@ MODULE_PARM_DESC(vlan_tso, "Enable TSO for VLAN packets");
 #define vlan_tso true
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0)
+#ifdef OVS_USE_COMPAT_GSO_SEGMENTATION
 static bool dev_supports_vlan_tx(struct net_device *dev)
 {
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)
@@ -66,7 +66,7 @@ static bool dev_supports_vlan_tx(struct net_device *dev)
 }
 
 /* Strictly this is not needed and will be optimised out
- * as this code is guarded by if LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0).
+ * as this code is guarded by if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0).
  * It is here to make things explicit should the compatibility
  * code be extended in some way prior extending its life-span
  * beyond v3.16.
@@ -74,8 +74,8 @@ static bool dev_supports_vlan_tx(struct net_device *dev)
 static bool supports_mpls_gso(void)
 {
 /* MPLS GSO was introduced in v3.11, however it was not correctly
- * activated using mpls_features until v3.16. */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)
+ * activated using mpls_features until v3.19. */
+#ifdef OVS_USE_COMPAT_GSO_SEGMENTATION
return true;
 #else
return false;
@@ -120,17 +120,17 @@ int rpl_dev_queue_xmit(struct sk_buff *skb)
/* As of v3.11 the kernel provides an mpls_features field in
 * struct net_device which allows devices to advertise which
 * features its supports for MPLS. This value defaults to
-* NETIF_F_SG and as of v3.16.
+* NETIF_F_SG and as of v3.19.
 *
 * This compatibility code is intended for kernels older
-* than v3.16 that do not support MPLS GSO and do not
+* than v3.19 that do not support MPLS GSO and do not
 * use mpls_features. Thus this code uses NETIF_F_SG
 * directly in place of mpls_features.
 */
if (mpls)
features &= NETIF_F_SG;
 
-   if (netif_needs_gso(skb, features)) {
+   if (netif_needs_gso(skb->dev, skb, features)) {
struct sk_buff *nskb;
 
nskb = skb_gso_segment(skb, features);
@@ -168,7 +168,7 @@ drop:
return err;
 }
 EXPORT_SYMBOL_GPL(rpl_dev_queue_xmit);
-#endif /* 3.16 */
+#endif /* OVS_USE_COMPAT_GSO_SEGMENTATION */
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0)
 static __be16 __skb_network_protocol(struct sk_buff *skb)
@@ -219,7 +219,17 @@ static struct sk_buff *tnl_skb_gso_segment(struct sk_buff 
*skb,
 * make copy of it to restore it back. */
memcpy(cb, skb->cb, sizeof(cb));
 
+   /* We are handling offloads by segmenting l3 packet, so
+* no need to call OVS compat segmentation function. */
+
+#ifdef HAVE___SKB_GSO_SEGMENT
+#undef __skb_gso_segment
segs = __skb_gso_segment(skb, 0, tx_path);
+#else
+#undef skb_gso_segment
+   segs = skb_gso_segment(skb, 0);
+#endif
+
if (!segs || IS_ERR(segs))
goto free;
 
diff --git a/datapath/linux/compat/include/linux/netdevice.h 
b/datapath/linux/compat/include/linux/netdevice.h
index 38315c2..3deb93d 100644
--- a/datapath/linux/compat/include/linux/netdevice.h
+++ b/datapath/linux/compat/include/linux/netdevice.h
@@ -88,31 +88,42 @@ static inline struct net_device 
*dev_get_by_index_rcu(struct net *net, int ifind
 typedef u32 netdev_features_t;
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)
+#define OVS_USE_COMPAT_GSO_SEGMENTATION
+#endif
+
+#ifdef OVS_USE_COMPAT_GSO_SEGMENTATION
+/* define compat version to handle MPLS segmentation offload. */
+#define __skb_gso_segment rpl__skb_gso_segment
+struct sk_buff *rpl__skb_gso_segment(struct sk_buff *skb,
+   netdev_features_t features,
+   bool tx_path);
+
 #define skb_gso_segment rpl_skb_gso_segment
-struct sk_buff *rpl_skb_gso_segment(struct sk_buff *skb,
-netdev_features_t features);
+static inline
+struct sk_buff *rpl_skb_gso_segment(struct sk_buff *skb, netdev_features_t 
features)
+{
+return rpl__skb_gso_segment(skb, features, true);
+}
 #endif
 
 #if L

Re: [ovs-dev] [PATCH ovn v6 2/9] ovn-controller: Implement translation of OVN flows into OpenFlow.

2015-05-04 Thread Justin Pettit

> On May 1, 2015, at 4:17 PM, Ben Pfaff  wrote:

> +/* Creates a new logical_datapath with the given 'uuid'. */
> +static struct logical_datapath *
> +ldp_create(const struct uuid *uuid)
> +{
> +static uint32_t next_integer = 1;
> +struct logical_datapath *ldp;
> +
> +ldp = xmalloc(sizeof *ldp);
> +hmap_insert(&logical_datapaths, &ldp->hmap_node, uuid_hash(uuid));
> +ldp->uuid = *uuid;
> +ldp->integer = next_integer++;

It's unlikely that we'll wrap without a bug or malicious user, but, if it does, 
I think it could lead to leaking between logical datapath.  If you don't want 
to track all the used values, we could at least put an assert if 0 is hit.

> +struct logical_datapath *next_ldp;
> +HMAP_FOR_EACH_SAFE (ldp, next_ldp, hmap_node, &logical_datapaths) {
> +if (simap_is_empty(&ldp->ports)) {
> +simap_destroy(&ldp->ports);
> +hmap_remove(&logical_datapaths, &ldp->hmap_node);
> +free(ldp);
> +}
> +}
> +}
> +
> +static void
> +ldp_destroy(void)
> +{
> +struct logical_datapath *ldp, *next_ldp;
> +HMAP_FOR_EACH_SAFE (ldp, next_ldp, hmap_node, &logical_datapaths) {
> +simap_destroy(&ldp->ports);
> +hmap_remove(&logical_datapaths, &ldp->hmap_node);
> +free(ldp);
> +}
> +}

Very minor, but do you think it's worth creating a destroy function for an ldp 
record?  I always worry that someone adds a field with dynamic data, but 
forgets to free it in one location.

> +void
> +pipeline_init(struct controller_ctx *ctx)
> +{
> +symtab_init();
> +
> +ovsdb_idl_add_column(ctx->ovnsb_idl, 
> &sbrec_pipeline_col_logical_datapath);
> +ovsdb_idl_add_column(ctx->ovnsb_idl, &sbrec_pipeline_col_table_id);
> +ovsdb_idl_add_column(ctx->ovnsb_idl, &sbrec_pipeline_col_priority);
> +ovsdb_idl_add_column(ctx->ovnsb_idl, &sbrec_pipeline_col_match);
> +ovsdb_idl_add_column(ctx->ovnsb_idl, &sbrec_pipeline_col_actions);

I think we monitor everything by default in the SB IDL, so these are probably 
unnecessary.

> +/* Translates logical flows in the Pipeline table in the OVN_SB database
> + * into OpenFlow flows. */
> +void
> +pipeline_run(struct controller_ctx *ctx)
> +{
> +struct hmap flows = HMAP_INITIALIZER(&flows);
> +uint32_t conj_id_ofs = 1;
> +
> +ldp_run(ctx);
> +
> +VLOG_INFO("starting run...");

Do you want to log this at level info?

> 
> +/* Translate OVN actions into OpenFlow actions. */
> +uint64_t ofpacts_stub[64 / 8];

The math for the size of this array seems mysterious.  Would it make sense to 
either specify the size directly or use #define names?

> +struct ofpbuf ofpacts;
> +struct expr *prereqs;
> +char *error;
> +
> +ofpbuf_use_stub(&ofpacts, ofpacts_stub, sizeof ofpacts_stub);
> +error = actions_parse_string(pipeline->actions, &symtab, &ldp->ports,
> + pipeline->table_id + 16,

I still think it would be helpful to document how tables are being used.  :-)

> +VLOG_INFO("...done");

Same question about the log level.

--Justin


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


Re: [ovs-dev] [PATCH ovn v6 3/9] rconn: Only increment seqno when connection actually drops or reconnects.

2015-05-04 Thread Justin Pettit

> On May 1, 2015, at 4:17 PM, Ben Pfaff  wrote:
> 
> rconn_get_connection_seqno() is documented to change only when an rconn
> connects or disconnnects, but in fact it was also changing whenever an
> rconn went into or out of the "idle" state (following sending an echo
> request).  This fixes the problem.
> 
> rconn_get_connection_seqno() didn't have any existing users, but an
> upcoming commit adds one.
> 
> Signed-off-by: Ben Pfaff 

Acked-by: Justin Pettit 

--Justin


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


Re: [ovs-dev] [PATCH ovn v6 4/9] ovs-sandbox: Use "secure" mode for br-int, in OVN mode.

2015-05-04 Thread Justin Pettit

> On May 1, 2015, at 4:17 PM, Ben Pfaff  wrote:
> 
> This is documented in ovn-architecture(7).
> 
> Signed-off-by: Ben Pfaff 

Acked-by: Justin Pettit 

--Justin


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


Re: [ovs-dev] [PATCH ovn v6 5/9] match: Add MATCH_CATCHALL_INITIALIZER.

2015-05-04 Thread Justin Pettit

> On May 1, 2015, at 4:17 PM, Ben Pfaff  wrote:
> 
> An upcoming patch will add the first user.
> 
> Signed-off-by: Ben Pfaff 

Signed-off-by: Justin Pettit 

--Justin


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


[ovs-dev] STP and Open vSwitch: hosts versus networks

2015-05-04 Thread Ben Pfaff
Recently we've had a number of reports on this mailing list that, when a
new port appears on an Open vSwitch switch, STP triggers a topology
change and start dropping packets for several seconds.  After thinking
about this for a while, I think what's happening is that STP in OVS is
treating every port as if it potentially connects to a switching
element.  That's correct, but it makes connecting new ports slow.  It
seems to me that we need to add a feature equivalent to Cisco's
"portfast" (e.g. see
http://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst4000/8-2glx/configuration/guide/stp_enha.html)
if we want to support STP in a way that's really convenient for users.

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


Re: [ovs-dev] [PATCH ovn v6 6/9] ovn-controller: Install generated pipeline flows into OVS via OpenFlow.

2015-05-04 Thread Justin Pettit

> On May 1, 2015, at 4:17 PM, Ben Pfaff  wrote:
> 
> 
> +/* Adds a flow with the specified 'match' and 'actions' to the OpenFlow table
> + * numbered 'table_id' with the given 'priority'.
> + *
> + * This just assembles the desired flow table in memory.  Nothing is actually
> + * sent to the switch until a later call to ofctrl_run(). */
> +void
> +ofctrl_add_flow(uint8_t table_id, uint16_t priority,
> +const struct match *match, const struct ofpbuf *ofpacts)

The function and comment refer to the supplied actions differently ("ofpacts" 
vs "actions").  I think "actions" may be a better name, since it's going into 
an array of type "ofpact", which is a little confusing.

Do you think it's worth saying that ownership of the arguments is maintained by 
the caller?

Acked-by: Justin Pettit 

--Justin


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


Re: [ovs-dev] [PATCH ovn v6 7/9] ovs-architecture: Recommend disable-in-band=true for integration bridge.

2015-05-04 Thread Justin Pettit

> On May 1, 2015, at 4:17 PM, Ben Pfaff  wrote:
> 
> -The integration bridge must be configured with failure mode ``secure'' to
> -avoid switching packets between isolated logical networks before
> -ovn-controller starts up.  See Controller Failure
> -Settings in ovs-vsctl(8) for more information.
> +The integration bridge should be configured as described below.  In
> +addition to the rationale below, the effect of each of these settings is
> +documented in ovs-vswitchd.conf.db(5):

That last sentence reads a little awkward to me.  What about just dropping "In 
addition to the rationale below" and putting it after the description of 
"disable-in-band"?

Acked-by: Justin Pettit 

--Justin


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


Re: [ovs-dev] [PATCH ovn v6 8/9] pipeline: Add macros to map logical registers to MFF_REG6 and MFF_REG7.

2015-05-04 Thread Justin Pettit

> On May 1, 2015, at 4:17 PM, Ben Pfaff  wrote:
> 
> This will allow upcoming code to refer to the logical inport and outport
> by symbolic names.
> 
> Signed-off-by: Ben Pfaff 

Is there a reason this needs to be a separate patch and not just folded into 
patch 2 of this series where these fields were added to the symbol table?

Acked-by: Justin Pettit 

--Justin


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


[ovs-dev] [PATCH] FAQ: Explain how "tap" devices work and why you should not use them.

2015-05-04 Thread Ben Pfaff
CC: 张伟 
Signed-off-by: Ben Pfaff 
---
 AUTHORS |  1 +
 FAQ.md  | 80 +
 2 files changed, 81 insertions(+)

diff --git a/AUTHORS b/AUTHORS
index cff99e6..9db112d 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -360,6 +360,7 @@ likunyunkunyu...@hotmail.com
 rahim entezari  rahim.entez...@gmail.com
 冯全树(Crab)fqs...@126.com
 胡靖飞  hujingfei...@msn.com
+张伟 zhang...@126.com
 
 Thanks to all Open vSwitch contributors.  If you are not listed above
 but believe that you should be, please write to dev@openvswitch.org.
diff --git a/FAQ.md b/FAQ.md
index 21d4e7a..3d4ce6f 100644
--- a/FAQ.md
+++ b/FAQ.md
@@ -823,6 +823,86 @@ A: Open vSwitch wasn't able to create the port.  Check the
ovs-vsctl will immediately report when there is an issue creating a
port.
 
+### Q: I created a tap device tap0, configured an IP address on it, and
+added it to a bridge, like this:
+
+tunctl -t tap0
+   ifconfig tap0 192.168.0.123
+   ovs-vsctl add-br br0
+   ovs-vsctl add-port br0 tap0
+
+I expected that I could then use this IP address to contact other
+hosts on the network, but it doesn't work.  Why not?
+
+A: The short answer is that this is a misuse of a "tap" device.  Use
+   an "internal" device implemented by Open vSwitch, which works
+   differently and is designed for this use.  To solve this problem
+   with an internal device, instead run:
+
+   ovs-vsctl add-br br0
+   ovs-vsctl add-port br0 int0 -- set Interface int0 type=internal
+   ifconfig int0 192.168.0.123
+
+   Even more simply, you can take advantage of the internal port that
+   every bridge has under the name of the bridge:
+
+   ovs-vsctl add-br br0
+   ifconfig br0 192.168.0.123
+
+   In more detail, a "tap" device is an interface between the Linux
+   (or *BSD) network stack and a user program that opens it as a
+   socket.  When the "tap" device transmits a packet, it appears in
+   the socket opened by the userspace program.  Conversely, when the
+   userspace program writes to the "tap" socket, the kernel TCP/IP
+   stack processes the packet as if it had been received by the "tap"
+   device.
+
+   Consider the configuration above.  Given this configuration, if you
+   "ping" an IP address in the 192.168.0.x subnet, the Linux kernel
+   routing stack will transmit an ARP on the tap0 device.  Open
+   vSwitch userspace treats "tap" devices just like any other network
+   device; that is, it doesn't open them as "tap" sockets.  That means
+   that the ARP packet will simply get dropped.
+
+   You might wonder why the Open vSwitch kernel module doesn't
+   intercept the ARP packet and bridge it.  After all, Open vSwitch
+   intercepts packets on other devices.  The answer is that Open
+   vSwitch only intercepts *received* packets, but this is a packet
+   being transmitted.  The same thing happens for all other types of
+   network devices, except for Open vSwitch "internal" ports.  If you,
+   for example, add a physical Ethernet port to an OVS bridge,
+   configure an IP address on a physical Ethernet port, and then issue
+   a "ping" to an address in that subnet, the same thing happens: an
+   ARP gets transmitted on the physical Ethernet port and Open vSwitch
+   never sees it.  (You should not do that, as documented at the
+   beginning of this section.)
+
+   It can make sense to add a "tap" device to an Open vSwitch bridge,
+   if some userspace program (other than Open vSwitch) has opened the
+   tap socket.  This is the case, for example, if the "tap" device was
+   created by KVM (or QEMU) to simulate a virtual NIC.  In such a
+   case, when OVS bridges a packet to the "tap" device, the kernel
+   forwards that packet to KVM in userspace, which passes it along to
+   the VM, and in the other direction, when the VM sends a packet, KVM
+   writes it to the "tap" socket, which causes OVS to receive it and
+   bridge it to the other OVS ports.  Please note that in such a case
+   no IP address is configured on the "tap" device (there is normally
+   an IP address configured in the virtual NIC inside the VM, but this
+   is not visible to the host Linux kernel or to Open vSwitch).
+
+   There is one special case in which Open vSwitch does directly read
+   and write "tap" sockets.  This is an implementation detail of the
+   Open vSwitch userspace switch, which implements its "internal"
+   ports as Linux (or *BSD) "tap" sockets.  In such a userspace
+   switch, OVS receives packets sent on the "tap" device used to
+   implement an "internal" port by reading the associated "tap"
+   socket, and bridges them to the rest of the switch.  In the other
+   direction, OVS transmits packets bridged to the "internal" port by
+   writing them to the "tap" socket, causing them to be processed by
+   the kernel TCP/IP stack as if they had been received on the "tap"
+   device.  Users s

[ovs-dev] How to set the ovs bridge MAC address

2015-05-04 Thread 陈燕明
Hi,
I have a topology as the following:
br0(bridge):
 eth0(MAC0),eth1(MAC1),eth2(MAC2)
I have the three NIC added to br0,Now I want to know the exactly mac address of 
the br0. I have read some books and do some experiments. But I can't get the 
right answer.Please help me to figure it out!
Thank u very much !
sincerely!
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH ovn v6 9/9] ovn-controller: Implement logical/physical translation flows.

2015-05-04 Thread Justin Pettit

> On May 1, 2015, at 4:17 PM, Ben Pfaff  wrote:
> 
> 
> +
> +/* Record as chassis or logical port. */

Just to make it a bit clearer, I would add that the latter is a "local logical 
port".

> +/* Table 64, Priority 50.
> + * ==
> + *
> + * For packets to remote machines, send them over a tunnel to the
> + * remote chassis.
> + *
> + * For packest to local vifs, deliver them directly. */

s/packest/packets/

Woo-hoo!  Working system!

Acked-by: Justin Pettit 

--Justin


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


Re: [ovs-dev] [PATCH v3 1/4] Windows installer

2015-05-04 Thread Alin Serdean
I will remove the copyright and respin the patches!

Alin.

-Mesaj original-
De la: Gurucharan Shetty [mailto:shet...@nicira.com] 
Trimis: Thursday, April 30, 2015 12:34 AM
Către: Alin Serdean
Cc: dev@openvswitch.org
Subiect: Re: [ovs-dev] [PATCH v3 1/4] Windows installer

On Wed, Apr 29, 2015 at 2:07 PM, Gurucharan Shetty  wrote:
> On Tue, Apr 28, 2015 at 3:33 PM, Alin Serdean 
>  wrote:
>> From: Alessandro Pilotti 
>>
>> This commit adds the windows installer to the OVS tree.
>>
>> Requirements are the following:
>> Visual Studio Community 2013
>> WiX Toolset 3.9
>> Microsoft_VC120_CRT_x86.msm
>>
>> More detailed information on the requirements and build instructions 
>> can be found under:
>> https://github.com/cloudbase/ovs-windows-installer/blob/master/README
>> .rst
>>
>> Signed-off-by: Alessandro Pilotti 
>
> Nice work! Thank you so much for doing this.
>
> There are a few whitespace errors that this patch introduces (you can 
> see them when you 'git am'). Atleast some of them look fixable.
>
> I apply this patch and do a 'make' and it fails on both Windows and Linux 
> with:
> The following files are in git but not the distribution:
> windows/LICENSE
> windows/README.rst
> windows/automake.mk
> windows/ovs-windows-installer.sln
> windows/ovs-windows-installer/Actions/OVSActions.js
> windows/ovs-windows-installer/CustomActions.wxs
> windows/ovs-windows-installer/Dialogs/ExitDialog.wxs
> windows/ovs-windows-installer/Dialogs/MaintenanceWelcomeDlg.wxs
> windows/ovs-windows-installer/Dialogs/UserExit.wxs
> windows/ovs-windows-installer/Dialogs/WelcomeDlg.wxs
> windows/ovs-windows-installer/License.rtf
> windows/ovs-windows-installer/Product.wxs
> windows/ovs-windows-installer/UI.wxs
> windows/ovs-windows-installer/images/bannrbmp.bmp
> windows/ovs-windows-installer/images/dlgbmp.bmp
> windows/ovs-windows-installer/ovs-windows-installer.wixproj
> make[2]: *** [dist-hook-git] Error 1
> make[2]: Leaving directory `/c/Shares/openvswitch'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/c/Shares/openvswitch'
> make: *** [all] Error 2
>
>
> We need each patch compilable. So if you fixed it later, then that fix 
> has to come as part of this patch.
>
> The windows/README.rst misses mentioning a few needed executables. It 
> probably makes sense to make the language generic. That way, you don't 
> have to keep updating this document whenever we have to add new 
> executables. Since "make installer" does the copying automatically it 
> should be okay not to mention all the executables by name in 
> README.rst.
>
> It probably makes sense to mention the location where the msi file is created?
>
> The installer completely ignores ssl related arguments needed for 
> ovsdb-server and ovs-vswitchd, but I don't mind that being added 
> sometime later.
>
> End User License agreement has "Copyright 2014 Open vSwitch". I have 
> not seen that one before used in OVS repo before. I will ask for Ben's 
> opinion on what is the right thing to do there.
I had a quick chat with Ben on this. Open vSwitch is not an organization, so it 
does not make sense to add a copyright that states "Open vSwitch". We have a 
long list of copyright holders in debian/copyright.in file, but it does not 
make sense to list all of it in the installer. So we thought that the easiest 
solution is to not have any copyright holders added there.

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


[ovs-dev] STP with RYU

2015-05-04 Thread FIXED-TERM Vardhan Harsha (CR/AEH4)
Hello all,

I have network whose architecture is as shown below.
As there are loops in the network ,I'm running STP on the controller which is 
RYU.
But the problem is that even though the openvswitches receive the bpdu 
configuration packets,they are being disabled.
Also the openvswitches are running on three different pc's and not on mininet.
When the same topology is run on mininet, everything works flawlessy.

c0(Ryu)
  |
  
switch--
  |  (normal switch)|
|  |   |
 |    
ovs1--- |
 |  |   
 |   |
Host1Ovs2  -- ovs3host2

The ovs version is 2.3.1.
Does ovs just drop bpdu packets when stp is disabled?
I have also modified the ports to receive-stp.

I'm also attaching the port data and the bridge configuration :

ovs-vsctl list bridge
_uuid   : 1e4df0df-fb73-4f49-8311-9a0daa88a84f
controller  : [7af3325d-754a-4bf7-9949-f6b15d5c095e]
datapath_id : "0010f33acafb"
datapath_type   : ""
external_ids: {}
fail_mode   : secure
flood_vlans : []
flow_tables : {}
ipfix   : []
mirrors : []
name: "s1"
netflow : []
other_config: {disable-in-band="true"}
ports   : [49c14788-b49e-4c39-ba7b-e3a24c11abbd, 
b9542e30-5bd0-49c0-b6c3-b0556e33f988, eacc4c3d-a10d-4ded-905f-5976ce42d4a7]
protocols   : ["OpenFlow13"]
sflow   : []
status  : {}
stp_enable  : false

ovs-ofctl -O openFlow13 dump-flows s1
OFPST_FLOW reply (OF1.3) (xid=0x2):
 cookie=0x0, duration=2793.242s, table=0, n_packets=1046, n_bytes=62760, 
priority=65535,dl_dst=01:80:c2:00:00:0e actions=CONTROLLER:65535
 cookie=0x0, duration=9125.242s, table=0, n_packets=288482, n_bytes=17308920, 
priority=65535,dl_dst=01:80:c2:00:00:00 actions=CONTROLLER:65535
 cookie=0x0, duration=2793.439s, table=0, n_packets=2014, n_bytes=474412, 
priority=0 actions=CONTROLLER:65535
 cookie=0x0, duration=50.026s, table=0, n_packets=0, n_bytes=0, 
priority=65534,in_port=3 actions=drop
 cookie=0x0, duration=40.161s, table=0, n_packets=0, n_bytes=0, 
priority=65534,in_port=1 actions=drop
 cookie=0x0, duration=601019.436s, table=0, n_packets=0, n_bytes=0, 
priority=65535,dl_dst=01:80:c2:00:00:0e,dl_type=0x88cc actions=CONTROLLER:65535

ovs-ofctl -O openFlow13 dump-ports-desc s1
OFPST_PORT_DESC reply (OF1.3) (xid=0x2):
 1(p1p1): addr:00:10:f3:3a:ca:fb
 config: NO_PACKET_IN
 state:  0
 current:1GB-FD COPPER AUTO_NEG
 advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEG
 supported:  10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEG
 speed: 1000 Mbps now, 1000 Mbps max
 3(p4p1): addr:a0:36:9f:44:3f:2c
 config: NO_PACKET_IN
 state:  0
 current:1GB-FD COPPER AUTO_NEG
 advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEG 
AUTO_PAUSE
 supported:  10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEG 
AUTO_PAUSE
 speed: 1000 Mbps now, 1000 Mbps max
 LOCAL(s1): addr:00:10:f3:3a:ca:fb
 config: 0
 state:  0
 speed: 0 Mbps now, 0 Mbps max
root@cocosdem3:/home/cocos# ovs-ofctl snoop s1
OFPT_PORT_STATUS (OF1.3) (xid=0x0): MOD: 1(p1p1): addr:00:10:f3:3a:ca:fb
 config: NO_PACKET_IN
 state:  0
 current:1GB-FD COPPER AUTO_NEG
 advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEG
 supported:  10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEG
 speed: 1000 Mbps now, 1000 Mbps max
OFPT_PORT_MOD (OF1.3) (xid=0x1868f4ee):port: 1: addr:00:10:f3:3a:ca:fb
 config: NO_PACKET_IN
 mask:   PORT_DOWN NO_RECV NO_FWD NO_PACKET_IN
 advertise: 10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEG
OFPT_FLOW_MOD (OF1.3) (xid=0x1868f4ef): ADD priority=65534,in_port=1 out_port:0 
actions=drop
OFPT_PACKET_OUT (OF1.3) (xid=0x1868f4f0): in_port=CONTROLLER actions=output:1 
data_len=52
metadata=0,in_port=0,vlan_tci=0x,dl_src=00:10:f3:3a:ca:fb,dl_dst=01:80:c2:00:00:0e,dl_type=0x05ff
OFPT_PORT_STATUS (OF1.3) (xid=0x0): MOD: 1(p1p1): addr:00:10:f3:3a:ca:fb
 config: NO_PACKET_IN
 state:  LINK_DOWN
 current:COPPER AUTO_NEG
 advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEG
 supported:  10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEG
 speed: 0 Mbps now, 1000 Mbps max
OFPT_PORT_STATUS (OF1.3) (xid=0x0): MOD: 1(p1p1): addr:00:10:f3:3a:ca:fb
 config: NO_PACKET_IN
 state:  0
 current:1GB-FD COPPER AUTO_NEG
 

Re: [ovs-dev] [PATCH ovn v6 2/9] ovn-controller: Implement translation of OVN flows into OpenFlow.

2015-05-04 Thread Gurucharan Shetty
On Sun, May 3, 2015 at 6:54 PM, Ben Pfaff  wrote:
> On Fri, May 01, 2015 at 04:17:27PM -0700, Ben Pfaff wrote:
>> Signed-off-by: Ben Pfaff 
>
> I introduced a bug while applying Justin's comments and didn't take the
> time to retest, but Guru pointed out the bug.  Here's an incremental
> that should fix it.  I'll also update the "ovn" branch in my ovs-reviews
> repository.
Thanks, the below fix lets me ping between 2 docker containers.
(It did not look like you have updated your ovn branch in ovs-reviews yet)
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH] ARP lookup and next hop functionality on windows

2015-05-04 Thread Alin Serdean
This patch implements two functionalities needed for an active manager:
1. ARP lookup
2. Next hop

The first functionality relies on the internal Windows API:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365956%28v=vs.85%29.aspx

The second one:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365915%28v=vs.85%29.aspx

Both API's are found in the Iphlpapi library. We need to add this library
when compiling.

Documentation and appveyor config has been updated to match the use of
the new library.

Tested using opendaylight.

Signed-off-by: Alin Gabriel Serdean 
Reported-by: Alin Gabriel Serdean 
Reported-at: https://github.com/openvswitch/ovs-issues/issues/63
---
 INSTALL.Windows.md   |  25 ++-
 appveyor.yml |   2 +-
 lib/netdev-windows.c | 125 +++
 3 files changed, 139 insertions(+), 13 deletions(-)

diff --git a/INSTALL.Windows.md b/INSTALL.Windows.md
index 78af0a1..0ec0af0 100644
--- a/INSTALL.Windows.md
+++ b/INSTALL.Windows.md
@@ -62,9 +62,10 @@ or from a distribution tar ball.
   the right compiler, linker, libraries, Open vSwitch component installation
   directories, etc. For example,
 
-% ./configure CC=./build-aux/cccl LD="`which link`" LIBS="-lws2_32" \
-  --prefix="C:/openvswitch/usr" --localstatedir="C:/openvswitch/var" \
-  --sysconfdir="C:/openvswitch/etc" --with-pthread="C:/pthread"
+% ./configure CC=./build-aux/cccl LD="`which link`" \
+  LIBS="-lws2_32 -liphlpapi" --prefix="C:/openvswitch/usr" \
+  --localstatedir="C:/openvswitch/var" --sysconfdir="C:/openvswitch/etc" \
+   --with-pthread="C:/pthread"
 
 By default, the above enables compiler optimization for fast code.
 For default compiler optimization, pass the "--with-debug" configure
@@ -114,10 +115,10 @@ Note down the directory where OpenSSL is installed (e.g.: 
C:/OpenSSL-Win32).
 * While configuring the package, specify the OpenSSL directory path.
 For example,
 
-% ./configure CC=./build-aux/cccl LD="`which link`" LIBS="-lws2_32" \
---prefix="C:/openvswitch/usr" --localstatedir="C:/openvswitch/var" \
---sysconfdir="C:/openvswitch/etc" --with-pthread="C:/pthread" \
---enable-ssl --with-openssl="C:/OpenSSL-Win32"
+% ./configure CC=./build-aux/cccl LD="`which link`"  \
+LIBS="-lws2_32 -liphlpapi" --prefix="C:/openvswitch/usr" \
+--localstatedir="C:/openvswitch/var" --sysconfdir="C:/openvswitch/etc" \
+--with-pthread="C:/pthread" --enable-ssl --with-openssl="C:/OpenSSL-Win32"
 
 * Run make for the ported executables.
 
@@ -131,11 +132,11 @@ level 'make' will invoke building the kernel datapath, if 
the
 '--with-vstudioddk' argument is specified while configuring the package.
 For example,
 
-% ./configure CC=./build-aux/cccl LD="`which link`" LIBS="-lws2_32" \
---prefix="C:/openvswitch/usr" --localstatedir="C:/openvswitch/var" \
---sysconfdir="C:/openvswitch/etc" --with-pthread="C:/pthread" \
---enable-ssl --with-openssl="C:/OpenSSL-Win32" \
---with-vstudioddk=""
+% ./configure CC=./build-aux/cccl LD="`which link`" \
+LIBS="-lws2_32 -liphlpapi" --prefix="C:/openvswitch/usr" \
+--localstatedir="C:/openvswitch/var" --sysconfdir="C:/openvswitch/etc" \
+--with-pthread="C:/pthread" --enable-ssl \
+--with-openssl="C:/OpenSSL-Win32" --with-vstudioddk=""
 
 Possible values for "" are:
 "Win8.1 Debug", "Win8.1 Release", "Win8 Debug" and "Win8 Release".
diff --git a/appveyor.yml b/appveyor.yml
index a14f0fc..863b561 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -39,5 +39,5 @@ build_script:
 - C:\MinGW\msys\1.0\bin\bash -lc "cp 
/c/pthreads-win32/Pre-built.2/dll/x86/*.dll /c/openvswitch/."
 - C:\MinGW\msys\1.0\bin\bash -lc "mv /bin/link.exe /bin/link_copy.exe"
 - C:\MinGW\msys\1.0\bin\bash -lc "cd /c/openvswitch && ./boot.sh"
-- C:\MinGW\msys\1.0\bin\bash -lc "cd /c/openvswitch && ./configure 
CC=build-aux/cccl LD=\"`which link`\" LIBS=-lws2_32 
--with-pthread=C:/pthreads-win32/Pre-built.2 --with-openssl=C:/OpenSSL-Win32 
--with-vstudioddk=\"Win8.1 Debug\""
+- C:\MinGW\msys\1.0\bin\bash -lc "cd /c/openvswitch && ./configure 
CC=build-aux/cccl LD=\"`which link`\" LIBS=\"-lws2_32 -liphlpapi\" 
--with-pthread=C:/pthreads-win32/Pre-built.2 --with-openssl=C:/OpenSSL-Win32 
--with-vstudioddk=\"Win8.1 Debug\""
 - C:\MinGW\msys\1.0\bin\bash -lc "cd /c/openvswitch && make"
diff --git a/lib/netdev-windows.c b/lib/netdev-windows.c
index 1fc1da7..47e12df 100644
--- a/lib/netdev-windows.c
+++ b/lib/netdev-windows.c
@@ -17,6 +17,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -373,6 +374,128 @@ netdev_windows_update_flags(struct netdev *netdev_,
 return 0;
 }
 
+/* Number of times to retry the doubling of the length of the buffer which is
+ * used to get all interfaces/ARP table */
+#define MAX_RETRIES 10
+
+/* Looks up in the ARP table entry for a given 'ip'. If it is found, the
+ * corresponding MAC address will be copied in 'mac' an